:closed_lock_with_key: encrypt-down :closed_lock_with_key:
![NpmLicense](https://img.shields.io/npm/l/@adorsys/encrypt-down.svg)
encrypt-down is an encryption layer for LevelDB.
For LevelDB exist several persistence bindings.
Amongst others bindings for IndexedDB.
By using encrypt-down it is possible to store lots (several MB) of sensitive user data securely (encrypted) in the browser across user sessions.
Installation
npm install @adorsys/encrypt-down
Usage
We need a JSON Web Key (JWK) or JSON Web Key Set (JWKS) as specified by RFC 7517.
const memdown = require('memdown')
const encryptdown = require('@adorsys/encrypt-down')
const levelup = require('levelup')
const jwk = {
kty: 'oct',
alg: 'A256GCM',
use: 'enc',
k: '123456789abcdefghijklmnopqrstuvwxyz12345678'
}
const memdb = memdown()
const db = levelup(encryptdown(memdb, { jwk }))
db.put('key', { awesome: true }, function (err) {
memdb._get('key', { asBuffer: false }, function (err, value) {
console.log(value)
})
db.get('key', { asBuffer: false }, function (err, value) {
console.log(value)
})
})
Browser Support
![Sauce Test Status](https://saucelabs.com/browser-matrix/radzom.svg)
API
const db = require('@adorsys/encrypt-down')(db[, options])
db
must be an abstract-leveldown
compliant storeoptions
:
jwk
: a JSON Web Key (JWK) or JSON Web Key Set (JWKS) as specified by RFC 7517
Credits
Made with :heart: by radzom and all these wonderful contributors (emoji key):
![](https://avatars.githubusercontent.com/u/3055345) Vincent Weevers 💬 | ![](https://avatars.githubusercontent.com/u/1225651) Francis Pouatcha 🤔 | ![](https://avatars2.githubusercontent.com/u/25199775) Boris Skert 📖 | | | | |
---|
This project follows the all-contributors specification. Contributions of any kind are welcome!
Big Thanks
Cross-browser Testing Platform and Open Source ♥ Provided by Sauce Labs.
![Sauce Labs logo](https://github.com/adorsys/encrypt-down/raw/HEAD/./Sauce-Labs.png)