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:
parent
edc48e2b93
commit
0f067472a8
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue