showing results for - "vue js encrypt localstorage data"
Noah
11 Apr 2020
1let obj = {"studentName":"John Smith","studentId":"CSC001"};
2const envryptedObject = AES.encrypt(JSON.stringify(obj),'MYKEY4DEMO');
3sessionStorage.setItem('envryptedObject', envryptedObject.toString());
4
5const decrypted2 = AES.decrypt(sessionStorage.getItem('envryptedObject'), 'MYKEY4DEMO');
6const decryptedObject = decrypted2.toString(enc.Utf8);
7sessionStorage.setItem('decryptedObject', decryptedObject);