encrypt-webstorage as a service code example

Example 1: encrypt-webstorage

npm install encrypt-webstorage@latest

Example 2: encrypt-webstorage

npm install --legacy-peer-deps --save encrypt-webstorage@latest

Example 3: encrypt-webstorage

import {EncryptionService} from "encrypt-webstorage";

constructor(private encryptor : EncryptionService){}

const secret_key = "!!34fffd99kdsdnn@as"

// encrypt decryption value without secret key

   let encryptedString = this.encryptor.encryptionAES({"test" : "test"});

    console.log('encrypted',encryptedString); //encrypted U2FsdGVkX19qgGyDwcinGl24YVn1e7fmcdR3t/v43BA=

    let decryptedValue = this.encryptor.decryptionAES(encryptedString);

    console.log('decrypted',decryptedValue); //decrypted {test: "test"}

// encrypt decryption value without secret key

 this.encryptor.encryptionAES({"test" : "test"}, secret_key);

 this.encryptor.decryptionAES(encryptedString, secret_key);


// can able to pass all the types code will handle stringify and parse

Tags:

Misc Example