Skip to content

Instantly share code, notes, and snippets.

@mclasson
Created July 13, 2013 05:40
Embed
What would you like to do?
public static bool Validate(string passwordHash, string saltHash, string enteredPassword)
{
byte[] _password = System.Text.Encoding.UTF8.GetBytes(enteredPassword);
Rfc2898DeriveBytes keyEntered = new Rfc2898DeriveBytes(_password, Convert.FromBase64String(saltHash), 10000);
return Convert.ToBase64String(keyEntered.GetBytes(24)) == passwordHash;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment