browser-protector

1.0.1 • Public • Published

🔒 browser-protector

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

 

🚀 installation

npm install browser-protector

 

⚡️ 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)
})

 

📃 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.

 

💂 Tests:

After having cloned the repo

npm run build

And then open /test/index.html

Package Sidebar

Install

npm i browser-protector

Weekly Downloads

1

Version

1.0.1

License

MIT

Unpacked Size

389 kB

Total Files

5

Last publish

Collaborators

  • allemanfredi