1.0.1 • Published 4 years ago

browser-protector v1.0.1

Weekly downloads
-
License
MIT
Repository
-
Last release
4 years ago

:lock: browser-protector

Simple module for storing data within the Browser through Argon2id and AES-GCM

 

:rocket: installation

npm install browser-protector

 

:zap: Usage

import {
  encrypt,
  decrypt
} from'browser-protector'

const password = 'ver1StrongPasswo0rd'
const secrets = {
  hello: 'world'
}

encrypt(password, secrets)
.then(enc => {
  return decrypt(password, enc)
})
.then(result => {
  assert.deepEqual(result, secrets)
})

 

:page_with_curl: Details

After the ecryption, the result is an object that includes three base64-encoded fields, data iv and salt.

The data is encrypted using the AES-GCM algorithm with a key generated with Argon2id.

 

:guardsman: Tests:

After having cloned the repo

npm run build

And then open /test/index.html