Skip to content

Euthor/crypto-object

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

crypto-object

Encrypt Objects in Node.js, using built-in Crypto. Uses AES 256(CTR mode)

Build Status XO code style

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

Owners

License

The MIT License