1.0.0 • Published 8 years ago

p-kvstore-crypt v1.0.0

Weekly downloads
4
License
MIT
Repository
github
Last release
8 years ago

p-kvstore-crypto

Wrap any p-kvstore to encrypt data stored transparently using an aesXXX cipher.

The values are encrypted while the keys are rehashed using sha256 with the key and iv.

const MapStore = require('p-kvstore').MapStore;
const CryptStore = require('p-kvstore-crypt');

const store = new CryptStore({
  password: 'my-ultra-secret-password',
  salt: 'some-spice-for-the-password', // optional: will use the sha256 of the password by default
  iterations: 1024, // optional: iterations used in pbkdf2
  algorithm: 'aes256', // optional: aes256|aes192|aes128
  backing: new MapStore()
});
const MapStore = require('p-kvstore').MapStore;
const CryptStore = require('p-kvstore-crypt');

const store = new CryptStore({
  key: new Buffer('key of correct length'),
  iv: new Buffer('iv of correct length'),
  algorithm: 'aes256', // optional: aes256|aes192|aes128
  backing: new MapStore()
});