I am trying to verify the user password at login.
I take the entered password and get the saved hashed passwords and password from the users.
Then I use the entered password with the saved salt to find out if it matches the saved password.
However, although the byte [] saved by Password is exactly the same as the byte [] entered by Password, it does not return true in bool and therefore does not validate the user. Why is this?
public static bool VerifyPassword(byte[] newPassword, byte[] storedPassword, byte[] storedSalt) { byte[] password = CreateHashedPassword(newPassword, storedSalt); if (!password.Equals(storedPassword)) return false; return true; }
c # passwords byte
Jova
source share