Skip to content

Instantly share code, notes, and snippets.

www.google.com
@GoNode5
GoNode5 / gist:769af0d0fd2309fff7ab
Last active February 14, 2016 13:07
nodejs encrypt files
var fs = require('fs');
var crypto = require('crypto');
var password = new Buffer('{cCQ3d^b&5/Wfp}MV%@Dhy;N)qvTu@?!h:eXL#;A?xS=wZb[w(Z>H^FyK%/P*3aB=_(~A%]f[)LjMVuH(s!Kw%fJwL');
var items=['file1','file2','file3']
for (var i=0;i<items.length;i++) {
var aes = crypto.createCipher('aes-256-ctr', password);