添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
相关文章推荐
可爱的乌冬面  ·  or-pandas/articles/pan ...·  1 月前    · 
气势凌人的西装  ·  资料下载·  1 月前    · 
俊逸的奔马  ·  GitHub - ...·  2 月前    · 
悲伤的大熊猫  ·  使用Delphi ...·  4 月前    · 

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement . We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I have the following test snippet:

let plain_text_message = "abc!?";
let passphrase = "your passphrase";
console.log("Encrypting message:", plain_text_message);
let encrypted = CryptoJS.AES.encrypt(plain_text_message, passphrase);
let encrypted_as_string = encrypted.toString();  // here I would like to specify and encoding, for example CryptoJS.enc.Base64
console.log("Encrypted message:", encrypted_as_string);
let decrypted = CryptoJS.AES.decrypt(encrypted, passphrase);
let decrypted_as_string = decrypted.toString(CryptoJS.enc.Base64);
console.log("Decrypted message:", decrypted_as_string);

However when I insert CryptoJS.enc.Base64 in the toString() argument, I get an error:

TypeError: e.clamp is not a function

It seems to be base 64 anyway, but I would rather specify that, than rely on some default. Is this not intended to work as I tried to make it work?