node-pbkdf2
Advanced tools
Comparing version 0.1.0 to 0.1.1
@@ -11,2 +11,4 @@ var crypto = require('crypto'); | ||
function NodePbkdf2 (options) { | ||
options = options || {}; | ||
this.iterations = options.iterations || 10000; | ||
@@ -75,3 +77,3 @@ this.saltLength = options.saltLength || 12; | ||
, derivedKeyLength: self.derivedKeyLength | ||
, derivedKey: new Buffer(derivedKey).toString('base64') })); | ||
, derivedKey: new Buffer(derivedKey, 'binary').toString('base64') })); | ||
}); | ||
@@ -98,3 +100,3 @@ }; | ||
if (new Buffer(derivedKey).toString('base64') === encryptedPassword.derivedKey) { | ||
if (new Buffer(derivedKey, 'binary').toString('base64') === encryptedPassword.derivedKey) { | ||
return callback(null, true); | ||
@@ -108,3 +110,4 @@ } else { | ||
// Interface | ||
module.exports = NodePbkdf2; |
{ | ||
"name": "node-pbkdf2", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"author": { | ||
@@ -5,0 +5,0 @@ "name": "Louis Chatriot", |
@@ -6,3 +6,4 @@ node-pbkdf2 | ||
It abstracts the API change between Node v0.8 and v0.10, you can begin using this module with one of the versions and it will also work on the other. | ||
It abstracts the API change between Node v0.8 and v0.10, you can begin | ||
using this module with any version and it will also work on the others. | ||
@@ -18,2 +19,6 @@ It is future-proof, meaning that you can change the parameters to arbitrarily increase the strength of new password encryption and it will still be able to check against passwords encrypted with the old method. | ||
// You can also test it works across the API change between Node v0.8 and v0.10 | ||
// You need to have nvm, node v0.8 and node v0.10 for this test | ||
make testVersionSwitch | ||
// Create a new password hasher with standard strength parameters | ||
@@ -20,0 +25,0 @@ var NodePbkdf2 = require('node-pbkdf2') |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
13352
9
226
41
2