I have trouble decrypting data in CryptoJS. After decrypting the data it returns an empty string Here is my code:
var iv = CryptoJS.enc.Utf8.parse(dataa[5]);
var key = 'AAAAAAAAAAAAAAAA';
key = CryptoJS.enc.Utf8.parse(key);
var decrypted = CryptoJS.AES.decrypt(dataa[1], key, { iv: iv, mode: CryptoJS.mode.CBC});
decrypted = decrypted.toString(CryptoJS.enc.Utf8);
console.log(decrypted);
alert(decrypted);
The alert returns an empty string. Dataa[5] is the IV and dataa1 is the data that has to decrypted. After the CryptoJS.AES.decrypt the variable decrypted is already empty. I am new to CryptoJS and do not understand why it wont work.
dataa[ 1 ] = gXodEwQf2Mk+ZW9RDiktNw
dataa[ 5 ] = s/D0LaJK1SwL9pgF/r1DAQ==