lowdb-encryption
v0.1.0
Published
Lowdb add-on for encryption.
Downloads
24
Maintainers
Readme
Table of Contents
Install
npm:
npm install lowdb-encryption
Yarn:
yarn add lowdb-encryption
GitHub:
git clone https://github.com/mazecodes/lowdb-encryption.git
Usage
const lowdb = require('lowdb');
const FileSync = require('lowdb/adapters/FileSync');
const lowdbEncryption = require('lowdb-encryption');
const adapter = new FileSync('db.json', {
...lowdbEncryption({
secret: 's3cr3t',
iterations: 100_000,
}),
});
const db = lowdb(adapter);
iterations
is the number of iterations used for key derivation. The encryption key will be derived from secret
. (Iterations is set to 100,000 by default)
Encryption Details
Lowdb Encryption uses PBKDF2 for key derivation with 100,000
iterations set by default and uses AES256 in CBC mode for encryption. It also uses HMAC-SHA256 for signing and validation the state.
Contributing
All contributions, issues and feature requests are welcome! Please feel free to check issues page.
- Fork the project
- Create your feature branch (
git checkout -b feature/AwesomeFeature
) - Commit your changes (
git commit -m "Add Awesome Feature"
) - Push to the branch (
git push origin feature/AwesomeFeature
) - Open a Pull Request
Author
Maze Peterson:
Show your support
Give a ⭐ if you liked this project!
License
MIT © Maze Peterson