node-pbkdf2
Wrapper to hash and check password with Node's crypto module's built-in pbkdf2.
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.
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.
npm install node-pbkdf2
make test
make testVersionSwitch
var NodePbkdf2 = require('node-pbkdf2')
, hasher = new NodePbkdf2({ iterations: 10000, saltLength: 12, derivedKeyLength: 30 });
hasher('supersecret', function (err, encryptedPassword) {
});
hasher('supersecret', encryptedPassword, function (err, passwordIsCorrect) {
});
License
MIT, do whatever you want with the code, just leave this message here
(c) 2013 Louis Chatriot (louis@tldr.io)