1const Cryptr = require('cryptr');
2const cryptr = new Cryptr('ReallySecretKey');
3
4const encryptedString = cryptr.encrypt('Popcorn');
5const decryptedString = cryptr.decrypt(encryptedString);
6
7console.log(encryptedString);
1 var encrypted = CryptoJS.AES.encrypt("Message", "Secret Passphrase");
2//U2FsdGVkX18ZUVvShFSES21qHsQEqZXMxQ9zgHy+bu0=
3
4var decrypted = CryptoJS.AES.decrypt(encrypted, "Secret Passphrase");
5//4d657373616765
6
7
8document.getElementById("demo1").innerHTML = encrypted;
9document.getElementById("demo2").innerHTML = decrypted;
10document.getElementById("demo3").innerHTML = decrypted.toString(CryptoJS.enc.Utf8);