I am trying to update the authentication system of an old application that used to run on node 4.5, but I am getting this error every time I try to login.
TypeError [ERR_INVALID_ARG_TYPE]: The "digest" argument must be one of type string or null. Received type undefined
at check (internal/crypto/pbkdf2.js:56:13)
Here is what I tried to solve the issue
The old version of the code is:
crypto.pbkdf2Sync(password, new Buffer(this.salt, 'base64'), 10000, 64).toString('base64');
And I am trying to update to this:
pbkdf2Sync(password, new Buffer(this.salt, 'base64'), 10000, 64,'sha512').toString('base64');
This doesn't work however as the previously stored hashed passwords don't match the hashes created by the update I implemented.
Any suggestions on what I can do?