I have a password encrypt in symbols and i try to decrypt this using Crypto-JS but its not possible. I use this code:
function dec2(ciphertext, key) {
var source = ciphertext;
var decrypted = CryptoJS.DES.decrypt(source, key, { mode: CryptoJS.mode.ECB, padding: CryptoJS.pad.NoPadding });
console.log("decrypted", decrypted);
console.log("decrypted", decrypted.toString());
console.log("decrypted", decrypted.toString(CryptoJS.enc.Base64));
}
The password I use is like this: í•L6˜9³Y½f.õ
And when I decrypt it in the console log you see:
First console.log: array of bytes
Second console.log: Base64
Third console.log: base64
If anyone can help me convert this to a string I would really appreciate it
console.log("decrypted", decrypted.toString(CryptoJS.enc.Utf8))
String just needs to be encoded as Utf8