nodejs 解密aes 报错
源码
JM: function JM(e) {
var t = this.getKey(), n = new Date().getTime().toString(), r = a.a.enc.Utf8.parse(t + n);
"object" == (void 0 === e ? "undefined" : s(e)) && (e = JSON.stringify(e));
var o = a.a.AES.encrypt(e, r, {
iv: r,
mode: a.a.mode.CBC,
padding: a.a.pad.Pkcs7
}).toString(), i = a.a.AES.decrypt(o.toString(), r, {
iv: r,
mode: a.a.mode.CBC,
padding: a.a.pad.Pkcs7
}).toString(a.a.enc.Utf8);
return {
data: o,
time: n,
decryData: "string" == typeof i ? i : JSON.parse(i)
};
},
function data_dencrypt()
{
data='zRuujcI5XEbYqvgx4pPMOA1cYSrGRNjlw9+PYMFwrQ140Abp5uJ7micdHwq0Z5u6UOO8Bl4TXCYU3rN6yUoSxbYKSAX6K6InfUTveWaOoEJIYLVJJeGsamJl6Cj1gtmnOuZnbqzQzf7TPU0r4FvbYIN+Homn0G0tnWp9jnTPUAJ0JTzG3CK4V3FvRF1ifNUugQobFLdP/pW/v9ryLqYZacgnFp6XddKKoPoFn5+ZMGquTbiL9OPdQ77ia+EmKlRVXcUC7gYQNF+Qyvxn9GmLvRIW5uGMaQHpRNiffEg9j3dsFGOBlDpf8JNxcUPvnqYlj6SAv25+TBEBr7/O8xzXPG3Bsyj8kJDc37Ojnk6F+LN8a6D3ql2JtYmYfZ8vdpkIobtFolTF+jyFGNmoiIuZO6Sm7rG3HntYLChh9E16yJ1yERqPUzkdVv1u43ENz+Pj2JBFAw+l0O67D25nQVtDPPBIBtEcSs3QsAiw0ARWkbZS+cdsT4Gi/1xb0Opc92Z1xPcrvy/lexI0sT/DH5HexEWeM3UUqUejpEPVpyInCnGr+6A3yb5xR7PAvKjBNdaL8caKGBwRyERFdBsJ5eMWRiWtLhMLLXYyWeFh7cMUZopZAAh9IWAMFhUZk1mAnrNi+aBQJwvH1qAgkUWF5GRizmlRf/mo1mdc2+xo11IGdgPi+VpKYOxitiITXyLHyGBRCO2RSh5pr9ju0an8D9wqKgFCLNcMwCwAEwRs4QUk9FIYhPnvVMq3LUiVvuqsWjtja8iBxWsz+H5/h3TFWfXi/Qy9o94OY1b2xKxdKjXs/26STSaBYGvzrO27EtmYJPYISQUHku96FeXFtc9bd23sGanSfiDeemoAsPLEnfm1iznVECFm3VwJn14CTZpk9dHJp6DLbhuV6AzX6cQftDRyAbwGvGibDTZiVjMBvLUpm5mIX6yE9LwYy9sM1NqV2H3ksLjnrr75cEKUHNWAOpKS9ZGQrHLCaloXFNTqqn5939Y3ECOk25VEbc8CpnBC1UApd+fDVZV68UTLyakVCJdxka7k4+zag5UuX4MlbH1cYhynzE2oziChwLc/pV2exc3oaQYrg1LrN0yj0Bix3Oruwh9rR6Mpa53OWWGDtdLrSXQgjFC3CCTSwXnrqkMb/Q6pcxMYSUHcesNrcl09fbLRsg=='
var t = 'E6C'
var n = new Date().getTime().toString()
varkey = CryptoJS.enc.Utf8.parse(t + n);
var iv =varkey
var uuData=CryptoJS.enc.Utf8.parse(data);
Decryptor = CryptoJS.AES.decrypt(uuData.toString(), varkey, { iv: iv,mode:CryptoJS.mode.CBC, padding: CryptoJS.pad.Pkcs7});
dataStr=Decryptor.toString(CryptoJS.enc.Utf8)
return dataStr
}
var result=data_dencrypt()
console.log(result)
malform utf-8报错
报错如下
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论