websecure-local-storage

1.0.15 • Public • Published

websecure-local-storage

JavaScript library of websecure-local-storage.

Node.js (Install)

Requirements:

  • Node.js
  • npm (Node.js package manager)
npm install websecure-local-storage

Usage

ES6 import case:

  • Setup your ENV CRYPT_LOCAL_STORAGE_SECRET
import { secureStorage } from 'websecure-local-storage';

const secureLs = secureStorage();
secureLs.setItem('foo-key','bar-val');

console.log(secureLs.getItem('foo-key')); // bar-val
console.log(localStorage.getItem('foo-key'));// null
console.log(localStorage.getItem('Y2ViZTAzMGIyZjVhY2E0YTYxYWVjNmU3OWUzMGUwZTM2YmU3MTdhOA=='));// U2FsdGVkX1/hB+TTx5wd1JpWIIX1WHTS96tGvYMtUmQ=

If CRYPT_LOCAL_STORAGE_SECRET is not set, only the keys are encrypted

Engine

Encrypt localStorage keys: SHA1 <- BASE64 Encrypt/Decrypt localStorage values: AES Encrypt/Decrypt secret: ENV CRYPT_LOCAL_STORAGE_SECRET

Release notes

1.0.x

This is an initia release.

Readme

Keywords

Package Sidebar

Install

npm i websecure-local-storage

Weekly Downloads

3

Version

1.0.15

License

MIT

Unpacked Size

11.5 kB

Total Files

6

Last publish

Collaborators

  • rafaelrabelo