Is it necessary for front-end H5 to use AES encryption before transmitting data?

problem description

since all the code in the front end H5 can be seen in the browser, the AES encrypted key will be exposed, so is it necessary to encrypt ?

the environmental background of the problem

the front end H5 uses AES encryption to transmit data to the background, and the background gets the data through decryption.

related codes

// AES
function aesEncrypt(value){
  var key = "abcdefg"
  var encryptedData = CryptoJS.AES.encrypt(CryptoJS.enc.Utf8.parse(value), CryptoJS.enc.Utf8.parse(key), {
    mode: CryptoJS.mode.ECB,
    padding: CryptoJS.pad.Pkcs7
  });
  return encryptedData.ciphertext.toString();
}
Jun.11,2021

generally does not encrypt data, but gives it to https (after all, there is nothing to stop others from seeing the data generated by their own operations), but only encrypts cookie , etc., just to increase the difficulty of cracking.


Front-end encryption is not meaningful, because your code has exposed


encryption is really not meaningful


Front-end encryption can only be used to increase the difficulty of cracking.

Menu