encryption-stream
✓ Published0🌍 Public
Aalessioalex
Last edited Nov 22, 2014
Created on Nov 22, 2014
This example demonstrates a file-processing pipeline that compresses and encrypts a plain-text document, then reverses the process. It shows how Node.js streams chain together to transform data through successive stages: reading a file, compressing it with zlib's createGzip, encrypting it with crypto's createCipher using AES-256, and writing the result. A companion script decrypts the file by piping it through createDecipher and createGunzip, then outputs the restored text. The code uses the built-in `fs`, `zlib`, and `crypto` modules with the pipe method.
AI-generated description