node-encrypter

0.0.1 • Public • Published

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).


Developed by Sanjay Sikdar.

License

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

/node-encrypter/

    Package Sidebar

    Install

    npm i node-encrypter

    Weekly Downloads

    3

    Version

    0.0.1

    License

    MIT

    Unpacked Size

    5.29 kB

    Total Files

    5

    Last publish

    Collaborators

    • sannjayy