Encrypt Objects in Node.js, using built-in Crypto. Uses AES 256(CTR mode)
$ 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' }`
$ npm install -g mocha
$ npm test
# Always run the linter & fix code style before pushing
$ npm run lint
- Nicholas Kyriakides, @nicholaswmin
The MIT License