So I know many people ask why their encrypted password doesn't match with the input, but I couldn't find any specific case as for my situation.
I am using the Bcrypt Library of https://github.com/patrickfav/bcrypt in my Android Sqlite project.
When I use his example as follow:
it logs fine and says that it the passwords match. But, when I call this verification from another method with the same password, it always says "false". Can somebody explain me why it happens and how can I fix it ?
String bcryptHashString = BCrypt.withDefaults().hashToString(12, password.toCharArray());
// $2a$12$US00g/uMhoSBm.HiuieBjeMtoN69SN.GE25fCpldebzkryUyopws6
...
BCrypt.Result result = BCrypt.verifyer().verify(password.toCharArray(), bcryptHashString);
// result.verified == true