one-encryption
v2.7.1
Published
Helper encryption build with crypto
Downloads
8
Maintainers
Readme
One encrypt
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);