Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

encrypt in js

var secret = "My Secret Passphrase";
var plainText = "the brown fox jumped over the lazy dog";
var encrypted = CryptoJS.AES.encrypt(plainText, secret);
var decrypted = CryptoJS.AES.decrypt(encrypted, secret);

document.getElementById("m1").innerHTML = encrypted;
document.getElementById("m2").innerHTML = decrypted;
document.getElementById("m3").innerHTML = decrypted.toString(CryptoJS.enc.Utf8);
Comment

encrpting data in javascript

alert(btoa("category=textile&user=user1")); // ==> Y2F0ZWdvcnk9dGV4dGlsZSZ1c2VyPXVzZXIx
Comment

de-encrpting data in javascript

alert(atob("Y2F0ZWdvcnk9dGV4dGlsZSZ1c2VyPXVzZXIx")); // ==> category=textile&user=user1
Comment

PREVIOUS NEXT
Code Example
Javascript :: useeffect react 
Javascript :: populate in mongoose 
Javascript :: flatten array 
Javascript :: add new element to existing json object 
Javascript :: vue component naming convention 
Javascript :: node js templates 
Javascript :: context api in react 
Javascript :: asyncio.sleep in javascript 
Javascript :: What do "module.exports" and "exports.methods" mean in NodeJS / Express 
Javascript :: Uncaught ReferenceError: function is not defined 
Javascript :: passing ref to child component 
Javascript :: node js http request express 
Javascript :: how to edit image tags in javascript 
Javascript :: timer javascript 
Javascript :: replace() in javascript 
Javascript :: web app let user confirm closing tab 
Javascript :: formatt json to create node and child node react 
Javascript :: aria labelledby js 
Javascript :: can we send image in json in angular 
Javascript :: MERN stack implementing Sign in with Google. 
Javascript :: for each add character javascript 
Javascript :: anonymous auto invoke is not a function 
Javascript :: @angular/fire has missing dependencies 
Javascript :: how to program in javascript and jquery on a page 
Javascript :: nightmare node example 
Javascript :: javascript run function forever 
Javascript :: asdasd junsd js 
Javascript :: cypress read xml file 
Javascript :: filtering array of friends javascript 
Javascript :: listen to document height changes 
ADD CONTENT
Topic
Content
Source link
Name
3+2 =