Created
June 27, 2014 19:23
-
-
Save alanhoff/6c7cd17a944618c4d115 to your computer and use it in GitHub Desktop.
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
var rsa = require('rsa-stream'); | |
var fs = require('fs'); | |
var privkey = fs.readFileSync('./minhaPrivKey.key', 'utf8'); | |
var encStream = rsa.dencrypt(privkey); | |
var inStream = fs.createReadStream('./foto.enc'); | |
var outStream = fs.createWriteStream('./minhafotolocodedoida.jpg'); | |
inStream.pipe(encStream).pipe(outStream); |
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
var rsa = require('rsa-stream'); | |
var fs = require('fs'); | |
var pubkey = fs.readFileSync('./minhaPubKey.pub', 'utf8'); | |
var encStream = rsa.encrypt(pubkey); | |
var inStream = fs.createReadStream('./minhafotolocodedoida.jpg'); | |
var outStream = fs.createWriteStream('./foto.enc'); | |
inStream.pipe(encStream).pipe(outStream); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment