Created
May 28, 2017 10:57
-
-
Save mekicha/32d23f9dd9a7e5cfa63cd8a3a4c6eddf to your computer and use it in GitHub Desktop.
Compress and encrypt the file. To decrypt, see decrypt.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fs.createReadStream(file) | |
.pipe(crypto.createDecipher('aes192', 'a_secret')) | |
.pipe(zlib.createGunzip()) | |
.pipe(reportProgress) | |
.pipe(fs.createWriteStream(file.slice(0, -3))) | |
.on('finish', () => console.log('Done')); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const crypto = require('crypto'); | |
fs.createReadStream(file) | |
.pipe(zlib.createGzip()) | |
.pipe(crypto.createCipher('aes192', 'a_secret')) | |
.pipe(reportProgress) | |
.pipe(fs.createWriteStream(file + '.zz')) | |
.on('finish', () => console.log('Done')); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment