Skip to content

Instantly share code, notes, and snippets.

@abstractj
Forked from bobmcwhirter/gist:0a0170b2450cf99a0bef
Last active August 29, 2015 14:06
Show Gist options
  • Save abstractj/95fdf5b13e622cd67c43 to your computer and use it in GitHub Desktop.
Save abstractj/95fdf5b13e622cd67c43 to your computer and use it in GitHub Desktop.
var crypto = require('crypto');
var cipher = crypto.createCipher( process.argv[2], 'tacos' );
//aes-gcm 256
//key size must be 32
var cipher = crypto.createCipheriv('aes-256-gcm', '3zTvzr3p67VC61jmV54rIYu1545x4TlY', 'X6sIq117H0vR');
var cipher = crypto.createCipher('aes-256-gcm', '3zTvzr3p67VC61jmV54rIYu1545x4TlY');
//aes-gcm 128
//key size must be 16
var cipher = crypto.createCipheriv('aes-128-gcm', '3zTvzr3p67VC61jm', 'X6sIq117H0vR');
var cipher = crypto.createCipher('aes-128-gcm', '3zTvzr3p67VC61jm');
cipher.write('bob');
console.log( cipher.final() );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment