Created
November 28, 2014 17:18
-
-
Save calvinmetcalf/2bcb9d7e552a2fbdba08 to your computer and use it in GitHub Desktop.
This file contains 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 data = new Buffer(64); | |
data.fill(0); | |
var key = crypto.randomBytes(16); | |
var iv1 = new Buffer(16); | |
iv1.fill(255); | |
var iv2 = new Buffer(''); | |
var cipher = crypto.createCipheriv('aes-128-ctr', key, iv1); | |
var decipher = crypto.createDecipheriv('aes-128-ecb', key, iv2); | |
var out = decipher.update(cipher.update(data)); | |
console.log(out.toString('hex')); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment