ez-crypt

1.1.0 • Public • Published

Installation

npm install ez-crypt

A simple example

ezcrypt = require('ez-crypt');

var crypt = new ezcrypt.Crypt(),
    string = 'Hello, world!',
    encrypted = crypt.encrypt(string),
    decrypted = crypt.decrypt(encrypted);
    
console.log('String to encrypt: ' + string);
console.log('Key: ' + crypt.key_str);
console.log('IV: ' + crypt.iv_str);
console.log('Encrypted string: ' + encrypted);
console.log('Decrypted string: ' + decrypted);

The Crypt class variables

Variable Description Requirements Default
key They encryption/decryption key A string containing 32 random hex numbers 32 random hex numbers
iv The initialization vectior A string containing 32 random hex numbers 32 random hex numbers
mode The cryptographic method Modes from the crypto-js package mode.CFB
padding The method used for padding Padding types from the crypto-js package pad.Pkcs7

Readme

Keywords

none

Package Sidebar

Install

npm i ez-crypt

Weekly Downloads

1

Version

1.1.0

License

MIT

Last publish

Collaborators

  • zaebos