level-encrypt
Note: bulk of code originates from modeler-leveldb.
Encryption for levelup. Performs necessary hydration/dehydration of JSON objects using hydration.
Usage
var crypto = var levelup = var memdown = var encryption = var encryptionOptions = // key derivation parameters saltBytes: 32 digest: 'sha256' keyBytes: 32 // iterations for pbkdf2Sync used to derive the encryption key from the password iterations: 100000 // encryption parameters algorithm:'aes-256-cbc' ivBytes: 16 // tip: this password is crap password: 'oogabooga' // optionally, pass in key instead of password // key: myKeyBuffer // for custom encryption options, encryptionOptions should look like this:// {// encrypt: Function,// decrypt: Function// }// var dbPath = './encrypted.db'var baseDB = var db = encryptionvar key = 'ho'var val = hey: 'ho' db