-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
needRehash function to check if password parameters are up to date #102
Comments
Hi @realkarmakun thanks for the suggestion. |
@firaja Not sure about handling updates between algorithms in this case though. Is it possible to check what algorithm was used in original hash after the check call? |
Hi @realkarmakun, the feature requested is in You can check if there have been an update with a boolean flag like in this example: HashUpdate update = Password.check(password, hash.getResult())
.andUpdate().with(...);
update.isUpdated() // true or false Using a different algoritmh even with different parameters, using If you need to force for any reason the update, you can use HashUpdate updated5 = Password.check(password, hash.getResult())
.andUpdate().forceUpdate().with(...);
update.isUpdated() // true |
Hi @realkarmakun , version 1.7.0 is now public. |
Is your feature request related to a problem? Please describe.
Would like to check if hash actually need rehashing before wasting resources on recalculating it
Describe the solution you'd like
A
needRehash
method returning boolean (perhaps on HashChecker object) that shows if parameters are up to date without necessarily callingHashChecker#update
.I'm guessing that in current state, calling this method on hash with same parameters would generate new hash anyway, even if it's parameters are the same as before
Describe alternatives you've considered
Right now we are reading paramters from the encoded hash itself (e.g. $argon2id$t=...), but it sounds like a job that can be done by the library not the developer.
The text was updated successfully, but these errors were encountered: