Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

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='))
Comment

PREVIOUS NEXT
Code Example
Javascript :: react navigation transparent header 
Javascript :: javascript trigger click on element 
Javascript :: javascript button onclick 
Javascript :: pattern cpf js 
Javascript :: javascript set file input value to null 
Javascript :: react how to scroll to element 
Javascript :: how to access vuex state properties with getters in nuxt vuex 
Javascript :: array remove element js 
Javascript :: es6 get text between quotes and double quotes 
Javascript :: get top n objects from list node js 
Javascript :: 11.10*15.1667 
Javascript :: adonisjs findorcreate 
Javascript :: react native memo styles 
Javascript :: byte to kb javascript 
Javascript :: js reverse array of objects 
Javascript :: first remove active class from classlist and append to current element using javascript 
Javascript :: javscript .split().reverse.joni 
Javascript :: jquery get input type 
Javascript :: json decode in jquery 
Javascript :: react slick slider duplicate items when infinite true #1623 
Javascript :: render image url in react native 
Javascript :: remove event listener react hooks 
Javascript :: convert milliseconds to seconds js 
Javascript :: create array initialize size javascript 
Javascript :: ipv4 to int32 js 
Javascript :: use state value change right after setState or state update 
Javascript :: update node js version ubuntu 
Javascript :: pandas to json 
Javascript :: javascript get cookie 
Javascript :: tomodachi 
ADD CONTENT
Topic
Content
Source link
Name
5+5 =