-
-
Save roninhack/cadff7615f3379b3df2927251ed67206 to your computer and use it in GitHub Desktop.
Compress and encrypt the file. To decrypt, see decrypt.js
This file contains hidden or 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 hidden or 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