0

我似乎无法让 CryptoJS.AES 正确解密它加密的内容。请看这个javascript代码:

var plaintext = "Message";
var encrypted = CryptoJS.AES.encrypt(plaintext, "Secret Passphrase");
var decrypted = CryptoJS.AES.decrypt(encrypted, "Secret Passphrase");
console.log(plaintext);
console.log(encrypted.toString());
console.log(decrypted.toString());

结果输出是

Message
U2FsdGVkX18Y2Cs77gkggFx8fkEajT1uztVYRkSkt/E
4d657373616765

为什么我不拿回原件"Message"

4

1 回答 1

4
decrypted.toString(CryptoJS.enc.Utf8)
于 2013-11-12T15:53:42.507 回答