cryptr

A very basic encrypt and decrypt node module.

npm install cryptr
270 downloads in the last day
820 downloads in the last week
910 downloads in the last month

cryptr

cryptr is a simple encrypt and decrypt module for node.js

It is for doing simple encryption of values that need to be decrypted at a later time.

The Cryptr constructor takes 2 option arguments.

Cryptr([secret, algorithm])

If a secret is not provided the default secret is used but a warning message is logged to the console.

Cryptr: Warning - Using default secret...

If an algorithm is not provided it defaults to aes256.\

DO NOT USE THIS MODULE FOR ENCRYPTING PASSWORDS!

Passwords should be a one way hash. Use bcrypt for that.

Install

npm install cryptr

Usage

Simple

var Cryptr = require("./cryptr"),
    cryptr = new Cryptr('myTotalySecretKey'); ;

...

var encryptedString = cryptr.encrypt('bacon');  
console.log(encryptedString);  // 876c9f1ce7d2465fb919e66e11daaafc

...

var decryptedString = cryptr.decrypt(encryptedString);
console.log(decryptedString);  // bacon
npm loves you