2.7.1 • Published 8 years ago

one-encryption v2.7.1

Weekly downloads
3
License
ISC
Repository
github
Last release
8 years ago

One encrypt

license version downloads

This module help cipher and decipher with openssl system and crypto module

  npm install --save one-encryption

Usage - step 1 "instantiation"

  var Encryption = require('one-encryption'),
      oneEncrypt = new Encryption();

    or

  var oneEncrypt = new (require('one-encryption'))();

Usage - step 2 "Simple usage"

  cipheredWord = oneEncrypt.encrypt('Mi top secret!!');

  decipheredWord = oneEncrypt.decrypt(cipheredWord);

Usage - step 3 "Custom usage" You can customize the algorithm and encryption key

  config = {
    algorithm : 'algorithm',// It's not required (DEFAULT : 'aes-256-ecb')
    key : 'masterkey'// It's not required
  };

  cipheredWord = oneEncrypt.encrypt(config, 'Mi top secret!!');

  decipheredWord = oneEncrypt.decrypt(config, cipheredWord);