Skip to content

Instantly share code, notes, and snippets.

@geNAZt
Created March 13, 2013 08:52
Show Gist options
  • Save geNAZt/5150353 to your computer and use it in GitHub Desktop.
Save geNAZt/5150353 to your computer and use it in GitHub Desktop.
Crypter
process.stdin.resume();
process.stdin.on("data", function(data) {
process.stdin.pause();
var pass = data.toString("utf8").trim();
var m = crypto.createHash('md5');
m.update(pass, "utf8");
var key = m.digest('hex');
m = crypto.createHash('md5');
m.update(pass + key);
var iv = m.digest('hex');
var cipher = crypto.createCipheriv('aes-256-cbc', key, iv.slice(0,16));
var crypted = cipher.update(JSON.stringify(results),'utf8','hex');
crypted += cipher.final('hex');
fs.writeFileSync("configs.aes", crypted);
console.log("Done");
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment