Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

vue js encrypt localstorage data

let obj = {"studentName":"John Smith","studentId":"CSC001"};
const envryptedObject = AES.encrypt(JSON.stringify(obj),'MYKEY4DEMO');
sessionStorage.setItem('envryptedObject', envryptedObject.toString());

const decrypted2 = AES.decrypt(sessionStorage.getItem('envryptedObject'), 'MYKEY4DEMO');
const decryptedObject = decrypted2.toString(enc.Utf8);
sessionStorage.setItem('decryptedObject', decryptedObject);
Comment

PREVIOUS NEXT
Code Example
Javascript :: add quotes to array items 
Javascript :: for in javascript 
Javascript :: javascript encryption decryption 
Javascript :: javascript insertbefore 
Javascript :: how to attach function to button sweetalert2 
Javascript :: cors axios 
Javascript :: if statement in react native 
Javascript :: nodejs add element to array 
Javascript :: puppeteer js headless mode 
Javascript :: js get datatable attr value on click 
Javascript :: array destructuring 
Javascript :: react context api 
Javascript :: react hook form clear form 
Javascript :: how to generate random text in vue js 
Javascript :: $.ajax how to read data vale in controller in rails 
Javascript :: array.splice javascript 
Javascript :: check if the difference between two dates is more than 1 month in javascript 
Javascript :: how to return argument in javascript 
Javascript :: how to use json stringify in javascript 
Javascript :: javascript add item to list 
Javascript :: date format in moment js 
Javascript :: js array .filter 
Javascript :: why app.use(cors()) not workin 
Javascript :: jQuery - Add Elements 
Javascript :: regex for not accepting zeros 
Javascript :: Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "text/html". Strict MIME type checking is enforced for module scripts per HTML spec. 
Javascript :: javascript merge two array with spread operator 
Javascript :: mean stack tutorial 
Javascript :: js dictionary 
Javascript :: pull out only text from element javascript 
ADD CONTENT
Topic
Content
Source link
Name
7+8 =