我的客戶端代碼:如何破譯節點JS字符串,它是加密的js在javascript加密
data.username = CryptoJS.AES.encrypt(user.username, "password");
data.password = CryptoJS.AES.encrypt(user.password, "password");
然後我送「數據」服務器是express.js
var user = req.body;
var decipher = crypto.createDecipher('aes256', "password");
var decrypted = decipher.update(user.username, 'hex', 'utf-8');
decrypted += decipher.final('utf-8');
我收到此錯誤:
Error: DecipherInit error
at new Decipher (crypto.js:368:17)
at Object.Decipher (crypto.js:365:12)
下面是一些類似的問題和答案:[解密AES256與node.js返回錯誤的最終塊長度](https://stackoverflow.com/q/21292142/608639),[Nodejs解密使用加密錯誤錯誤的最終塊長度](https://stackoverflow.com/q/23111388/608639),[在解密AES256時獲取錯誤的最終塊長度](https://stackoverflow.com/q/32038267/608639),[Decrypt file in Node。 js使用OpenSSL加密](https://stackoverflow.com/q/44482151/608639),[node.js加密解密有什麼問題?](https://stackoverflow.com/q/12219499/608639) – jww 2017-06-11 10:19:21