Getting random AES encryped value


#1

Hi,

I am using CryptoJS to encrypt the password. Below is the code that i’m using to generate the encrypted password,but it is generating random value on every attempt .

let encrypted = CryptoJS.AES.encrypt(“pass”, “secret Key”);
console.log(encrypted.toString());

Anyone have idea about this and Implememnted this in ionic 3


#2
    encrypt(data, key) {
        return CryptoJS.AES.encrypt(JSON.stringify(data), key).toString();
    }

    decrypt(data, key) {
        let bytes = CryptoJS.AES.decrypt(data, key);
        return JSON.parse(bytes.toString(CryptoJS.enc.Utf8));
    }

Implementing CryptoJS in Ionic using CFB mode
Ionic Local Storage?
#3

Dear @kamakshi,

Did you get solution for it ? I am looking a same implementation corresponding to mcrypt in PHP of backend . Please advise

Thanks
Anes