aes加密提交时不小心重复点击,导致数据加密了两次,正常解密是不行的,请问有什么其他方法解吗?
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 || ''
//密钥16位
var key = CryptoJS.enc.Utf8.parse(skey);
//加密向量16位
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);
}
部分代码而已,具体怎么分析就不上代码了。