# websecure-local-storage 
JavaScript library of websecure-local-storage.

## Node.js (Install)

Requirements:

- Node.js
- npm (Node.js package manager)

```bash
npm install websecure-local-storage
```

### Usage

ES6 import case:

- ```Setup your ENV CRYPT_LOCAL_STORAGE_SECRET```

```javascript
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.

