In a Spring Boot 2 project I use the bcrypt password encoder to authenticate users against LDAP directory. The passwords are stored in the LDIF file, hence in the directory, in a hashed form, with bcrypt. In order to determine the hash for each password that I need to store in the LDIF file, such that to be loaded in the directory, I'm using this generator: https://bcrypt-generator.com.
So, I generate the hashes for the users passwords and I store the generated values in the LDIF file. Then, I'm trying to perform authentication using the Spring LDAP password compare. But the authentication fails as Spring and the mentioned site calculate a different bcrypt hash for the same password.
Using the hash one calculated by the Spring encode() function works, of course. So my questions are:
- How come using the same algorithm with the same input value and the same parameters, two implementations supposed to be equivalent provide different results ?
- How is one supposed to generate the hash values since Spring doesn't seem to provide any generator and the value generated by public generators don't match with the Spring calculated ones ?
Many thanks in advance.
Nicolas