0.0.1 • Published 6 months ago

node-encrypter v0.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

node-encrypter

npm simple module to easily encrypt and decrypt strings & passwords.

GitHub Repo: https://github.com/sannjayy/node-encrypter

This module does not have any third-party dependencies.

Install using npm / yarn

npm install node-encrypter

yarn add node-encrypter

Example usage encrypt and decrypt

var Encrypter = require('node-encrypter');

const secretKey = "<YOUR-SECRET-KEY>";
const encrypter = new Encrypter(secretKey);

const clearText = 'sanjaysikdar.dev';
const encryptedText = encrypter.encrypt(clearText);

const decryptedText = encrypter.decrypt(encryptedText);

Advanced options

const secretKey = "<YOUR-SECRET-KEY>";
const algorithm = 'aes256';
const saltKeyLength = 32;
const digest = 'hex';

const encrypter = new Encrypter(secretKey, algorithm, saltKeyLength, digest);
  • secretKey - secret string key used for encryption.
  • algorithm - cipher Algorithm (default: aes256).
  • saltKeyLength - length of salt key (default: 32).
  • digest - message digest algorithm (default: hex).

npm.io
Developed by Sanjay Sikdar.

  • 📫 me@sanjaysikdar.dev

License

The Node Encrypter is open-sourced software licensed under the MIT license.