添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
相关文章推荐
爱听歌的松树  ·  Qt ...·  3 天前    · 
好帅的小熊猫  ·  🔥2024安全体育平台·  3 周前    · 
坚韧的大葱  ·  SPLIT_PART | Vertica ...·  1 月前    · 

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?