I'm trying to verify someone's password when logging in.
I take the entered password and retrieve the users saved hashed password and password salt.
Then I hash the entered password with the saved salt to see if it's equal to the saved password.
However, even though the byte[] storedPassword is exactly like the byte[] enteredPassword, it doesn't return true in a bool and therefore doesn't verify the user. Why is that?
public static bool VerifyPassword(byte[] newPassword, byte[] storedPassword, byte[] storedSalt)
{
byte[] password = CreateHashedPassword(newPassword, storedSalt);
if (!password.Equals(storedPassword))
return false;
return true;
}