Skip to content

Instantly share code, notes, and snippets.

@shawnmclean
Created April 10, 2012 06:33
Show Gist options
  • Save shawnmclean/2348820 to your computer and use it in GitHub Desktop.
Save shawnmclean/2348820 to your computer and use it in GitHub Desktop.
SimpleCrypto.Net Basic PBKDF2 Hashing with Salt parameter
private ICryptoService cryptoService = new PBKDF2();
private bool ValidatePassword(User user, string password)
{
//hash the password with the saved salt for that user
string hashed = cryptoService.Compute(password, user.PasswordSalt);
//return true if both hashes are the same
return hashed == user.Password;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment