Last active
August 29, 2015 14:01
-
-
Save jamlfy/b4f5b91a05910d5dd9bc 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 crypto = require('crypto'); | |
| var spawn = require('child_process').spawn; | |
| var hashes = spawn('openssl', ['list-message-digest-algorithms']); | |
| var hass = []; | |
| var msg = 'tpfccdlfdtte pcaccplircdt dklpcfrp?qeiq lhpqlipqeodf gpwafopwprti izxndkiqpkii krirrifcapnc dxkdciqcafmd vkfpcadf.'; | |
| hashes.stdout.on('data', function (data) { | |
| hass.push(data); | |
| }); | |
| hashes.stderr.on('data', console.error); | |
| hashes.on('close', function (code) { | |
| for (var i = hass.length - 1; i >= 0; i--) { | |
| try { | |
| var decipher = crypto.createDecipher(hass[i]); | |
| var text = decipher.update(msg, 'utf8'); | |
| text += decipher.final('utf8'); | |
| console.log(text); | |
| }catch(e){ | |
| console.error(e); | |
| } | |
| } | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment