crypto-object
v1.0.0
Published
Encrypt objects in Node.js
Downloads
3
Readme
crypto-object
Encrypt Objects in Node.js, using built-in Crypto. Uses AES 256(CTR mode)
Usage
$ npm i --save https://github.com/Euthor/crypto-object.git
const CryptoObject = require('crypto-object');
const cryptoObject = new CryptoObject({
password: 'monica', // The encryption password - Required
keys: ['foo', 'bar'] // Which object keys to encrypt - Required
});
cryptoObject.encrypt({foo: 'hello', bar: 'world', id: 'x-001'})
// `{ foo: '1a29e0e604', bar: '0523fee60f', id: 'x-001' }`
cryptoObject.decrypt({ foo: '1a29e0e604', bar: '0523fee60f', id: 'x-001' })
// `{ foo: 'hello', bar: 'world', id: 'x-001' }`
Run the tests
$ npm install -g mocha
$ npm test
Contributing?
# Always run the linter & fix code style before pushing
$ npm run lint
Authors
- Nicholas Kyriakides, @nicholaswmin
Owners
License
The MIT License