current position:Home>How to solve CBC mode in AES encryption

How to solve CBC mode in AES encryption

2022-02-03 02:32:55 CSDN Q & A

aes Click again and again when submitting the encryption , This caused the data to be encrypted twice , Normal decryption is not possible , Is there any other way to solve ?
export function decryption(word) {  if(word == null || word == ''){    return word  }  //console.log(word)   const skey = store.state.encryptedString.key || ''  const sIv = store.state.encryptedString.iv || ''  // secret key 16 position   var key = CryptoJS.enc.Utf8.parse(skey);  // Encryption vector 16 position   var iv = CryptoJS.enc.Utf8.parse(sIv);  let base64 = CryptoJS.enc.Base64.parse(word)  let src = CryptoJS.enc.Base64.stringify(base64)  var decrypted = CryptoJS.AES.decrypt(src, key, {    iv: iv,    mode: CryptoJS.mode.CBC,    padding: CryptoJS.pad.ZeroPadding  });  return decrypted.toString(CryptoJS.enc.Utf8);  }
Just part of the code , The specific analysis is not on the code .

copyright notice
author[CSDN Q & A],Please bring the original link to reprint, thank you.
https://en.primo.wiki/2022/02/202202030232536034.html

Random recommended