whisper.json

1.0.0 • Public • Published

whisper.json

A streaming interface that accepts a text stream representing JSON and encrypts/decrypts it based on the given type.

Install

npm i -g whisper.json

Usage

CLI

# encrypt configs 
cat my-unencrypted-config.json | whisper --secret-file path/to/my/key --encrypt > encrypted-config.json
# decrypt configs 
cat encrypted-config.json | whisper --secret-file path/to/my/key --decrypt > decrypted.json

Module

var fs = require('fs');
var Whisper = require('whisper.json');
var secret = fs.readFileSync('some/secret.key', 'utf8');
 
var encrypt = new Whisper('encrypt', { secret });
fs.createReadStream('some/config.json')
  .pipe(encrypt)
  .pipe(fs.createWriteStream('some/encrypted-config.json'));
 
 
var decrypt = new Whisper('decrypt', { secret });
fs.createReadStream('some/encrypted-config.json')
  .pipe(decrypt)
  .pipe(process.stdout);

Tests

npm test

Package Sidebar

Install

npm i whisper.json

Weekly Downloads

2

Version

1.0.0

License

MIT

Last publish

Collaborators

  • jcrugzz