0.3.0 • Published 6 years ago

json-decrypt v0.3.0

Weekly downloads
3
License
GPL-3.0
Repository
github
Last release
6 years ago

json-decrypt

NPM version Linux Status Windows Status Dependency Status Coveralls

decrypt (or encrypt) your json configuration (or object) with a password. You can save your key into user environment for decrypt this cfg file

Installation

Install through NPM

npm install json-decrypt

or

git clone git://github.com/hex7c0/json-decrypt.git

API

decrypt your Object key, with an ENV passphrase

var decrypt = require('json-decrypt').decrypt;

var cfg = {
  fix: 'ciao',
  foo: 'hRzVwi8=',
  pr: [ 'foo' ]
};

var plaintext_cfg = decrypt(cfg, 'pr', process.env.p);

encrypt your Object key

var encrypt = require('json-decrypt').encrypt;

var cfg = {
  fix: 'ciao',
  foo: 'hex7c',
  pr: [ 'foo' ]
};

var ciphertext_cfg = encrypt(cfg, 'pr', process.env.p);

decrypt(obj, index, key [, cipher , encoding])

options

  • obj - Object Your object (default "required")
  • index - String Object key (default "required")
  • key - String Your Key (default "required")
  • cipher - String Cipher (default "aes-128-ctr")
  • encoding - String Output encoding (default "base64")

Examples

Take a look at my examples

License GPLv3

0.3.0

6 years ago

0.2.1

7 years ago

0.2.0

8 years ago

0.1.3

8 years ago

0.1.2

9 years ago

0.1.1

9 years ago

0.1.0

9 years ago

0.0.2

9 years ago

0.0.1

9 years ago