1.0.3 • Published 7 years ago

cryptobject v1.0.3

Weekly downloads
2
License
MIT
Repository
-
Last release
7 years ago

cryptobject

CircleCI

cryptobject provides AES256 encryption to every string value in an object.

Installation

npm i cryptobject

Usage

To use cryptobject, simply import the package and call one of encryptor or decryptor to create a function capable of applying encryption or decryption to an object.

without es6 imports

const cryptobject = require('cryptobject').default;
const { encryptor, decryptor } = cryptobject;

const obj = { 'key': 'value' };

const passphrase = 'testpass';

const encrypt = encryptor(passphrase);
const encryptedObject = encrypt(obj);

const decrypt = decryptor(passphrase);
const decrytpedObject = decrypt(encryptedObject);

with es6 imports (babel)

import cryptobject from 'cryptobject';
const { encryptor, decryptor } = cryptobject;

const obj = { 'key': 'value' };

const passphrase = 'testpass';

const encrypt = encryptor(passphrase);
const encryptedObject = encrypt(obj);

const decrypt = decryptor(passphrase);
const decrytpedObject = decrypt(encryptedObject);

License

MIT

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

9 years ago