Cannot specify LongPasswordStrategy on Verifier
See original GitHub issueHello,
First of all, thanks for this library.
In my code, I need to be able to specify the LongPasswordStrategy
to TruncateStrategy
so the lib behave like others (in others softwares in different languages).
It all works well when saving the hash, I can do BCrypt.with(LongPasswordStrategies.truncate()).hash(...)
just fine.
But when I want to verify a hash, I can’t specify the strategy!
One would expect BCrypt.with(LongPasswordStrategies.truncate()).verifyer().verify(pw, hashData);
to works, but alas no.
Looking quickly in the code, I can see that you simply use the withDefaults()
without offering any choice to the user: https://github.com/patrickfav/bcrypt/blob/master/modules/bcrypt/src/main/java/at/favre/lib/crypto/bcrypt/BCrypt.java#L551
Is there something I’m missing? I would think the library should be able to verify its own generated hash depending on the strategy used…
Thanks.
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (3 by maintainers)
Top GitHub Comments
Will be released with v0.9.0
Thank you. I reviewed it, looks good!