Skip to content

Cannot specify LongPasswordStrategy on Verifier #21

@Indigo744

Description

@Indigo744

Hello,

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.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingenhancementNew feature or request

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions