New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

lowdb-encryption

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lowdb-encryption

Lowdb add-on for encryption.

latest
Source
npmnpm
Version
0.1.0
Version published
Maintainers
1
Created
Source

Lowdb Encryption

Lowdb add-on for ecnryption.


Table of Contents

  • Install
  • Usage
  • Encryption Details
  • Contributing
  • Author
  • Support
  • License

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

Keywords

lowdb

FAQs

Package last updated on 08 Feb 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts