Answers for "simple AES encryption javascript"

1

simple AES encryption javascript

function encrypt(message = '', key = ''){
    var message = CryptoJS.AES.encrypt(message, key);
    return message.toString();
}
function decrypt(message = '', key = ''){
    var code = CryptoJS.AES.decrypt(message, key);
    var decryptedMessage = code.toString(CryptoJS.enc.Utf8);

    return decryptedMessage;
}
console.log(encrypt('Hello World'));
console.log(decrypt('U2FsdGVkX1/0oPpnJ5S5XTELUonupdtYCdO91v+/SMs='))
Posted by: Guest on October-20-2021

Code answers related to "simple AES encryption javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language