Skip to content

Instantly share code, notes, and snippets.

@geNAZt
Created March 13, 2013 08:53
Show Gist options
  • Save geNAZt/5150357 to your computer and use it in GitHub Desktop.
Save geNAZt/5150357 to your computer and use it in GitHub Desktop.
Decrypter
process.stdin.resume();
process.stdin.on('data', function stdinPass(data) {
process.stdin.removeListener('data', stdinPass);
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 decipher = crypto.createDecipheriv('aes-256-cbc', key, iv.slice(0,16));
var crypted = decipher.update(fs.readFileSync("./configs.aes"),'hex','utf8');
crypted += decipher.final('utf8');
console.log(crypted);
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment