Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const crypto = require('crypto');
- const fs = require('fs');
- const cipher = crypto.createCipher('aes192', 'a password');
- const encInput = fs.createReadStream('test.txt');
- const encOutput = fs.createWriteStream('test.encrypted');
- encInput.pipe(cipher).pipe(encOutput);
- const decipher = crypto.createDecipher('aes192', 'a password');
- const decInput = fs.createReadStream('test.encrypted');
- const decOutput = fs.createWriteStream('test.decrypted');
- decInput.pipe(decipher).pipe(decOutput);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement