Skip to content

Instantly share code, notes, and snippets.

@saml
Created May 18, 2016 19:00
Show Gist options
  • Save saml/1e19da13d3a554d5fa8dc3c84dc562e7 to your computer and use it in GitHub Desktop.
Save saml/1e19da13d3a554d5fa8dc3c84dc562e7 to your computer and use it in GitHub Desktop.
'use strict';
const fs = require('fs');
const crypto = require('crypto');
const input = fs.createReadStream(__filename);
const encrypt = crypto.createCipher("aes-256-ctr", "iamapassword");
const decrypt = crypto.createDecipher("aes-256-ctr", "iamapassword");
input.pipe(encrypt).pipe(decrypt).pipe(process.stdout);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment