I use password hashing using BCrypt, which should be fairly easy to use. However, when the password is verified against a hashed password, using
BCryptHelper.CheckPassword(Password, hashedDBPassword)
it always returns false.
Here is my hash class:
public static class BCryptHasher { public static string EncryptPassword(string password) { var passwordToHash = password; var hashedPassword = BCryptHelper.HashPassword(passwordToHash, BCryptHelper.GenerateSalt(6)); return hashedPassword; } public static bool CheckPasswordMatch(string userPassword, string hashedDBPassword) { return BCryptHelper.CheckPassword(userPassword, hashedDBPassword); } }
I debugged password validation and hashedPassword. There are not many other cases of this problem, so there must be something that I am doing wrong.
Here I found the same question: ASP.NET MVC 3 application , BCrypt.CheckPassword failed , but no solution found yet.
Perhaps there are other and better hashing solutions?
thanks
source share