Created
August 17, 2015 23:20
-
-
Save kessler/68c2c206b2cec0902ff6 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 cipher1 = crypto.createCipheriv('aes-128-ctr', key, iv) | |
var cipher2 = crypto.createCipheriv('aes-128-ctr', key, iv) | |
var enc = cipher1.update('123abcd', 'utf8', 'hex') | |
enc += cipher1.final('hex') | |
console.log(enc) | |
var dec = cipher2.update(enc, 'hex', 'utf8') | |
console.log(dec) | |
// prints: | |
// 74bd8f49ca6979 | |
// 123abcd |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment