easy-pbkdf2 instead as it uses node's built-in crypto.pbkdf2
method.
You should probably use crypto-PBKDF2
crypto.js' PBKDF2 standalone implementation for npm.
Usage (based on Stack Exchange's PBKDF2 implementation):
var CryptoJS = ; var DEFAULT_HASH_ITERATIONS = 4000; var SALT_SIZE = 192/8; var KEY_SIZE = 768/32; /** * Convenience wrapper around CryptoJS.lib.WordArray.random to grab a new salt value. * Treat this value as opaque, as it captures iterations. * * @param * @return */{ var defaultHashIterations = DEFAULT_HASH_ITERATIONS; ifexplicitIterations !== null && explicitIterations !== undefined // make sure explicitIterations is an integer if === explicitIterations throw "explicitIterations must be an integer"; // and that it is smaller than our default hash iterations if explicitIterations < DEFAULT_HASH_ITERATIONS throw "explicitIterations cannot be less than " + DEFAULT_HASH_ITERATIONS; // get some random bytes var bytes = CryptoJSlibWordArray; // convert iterations to Hexadecimal var iterations = explicitIterations || defaultHashIterations; // concat the iterations and random bytes together. return iterations + "." + bytes;} { var i = salt; var iters = ; var key = CryptoJS; return key;} { return === hashed;} /* Save BOTH the salt and the hashedPassword to your database so you can validate the password later */var salt = ;var hashedPassword = ;var isPassword = ; // true