Fixed call of crypto.Cipheriv to take buffer instead of string

The `key` arg in crypto.createCipheriv() takes a buffer so no need here to convert to string
https://nodejs.org/api/crypto.html#crypto_crypto_createcipheriv_algorithm_key_iv
This commit is contained in:
Ferdinand Malcher 2017-01-19 22:37:34 +01:00
parent edc48e2b93
commit 0f067472a8
1 changed files with 1 additions and 2 deletions

View File

@ -43,8 +43,7 @@ function lmhashbuf(inputstr)
var buf = new Buffer(16);
var pos = 0;
var cts = halves.forEach(function(z) {
var key = z.toString('binary');
var des = crypto.createCipheriv('DES-ECB', key, '');
var des = crypto.createCipheriv('DES-ECB', z, '');
var str = des.update('KGS!@#$%', 'binary', 'binary');
buf.write(str, pos, pos + 8, 'binary');
pos += 8;