Created
April 10, 2012 06:33
-
-
Save shawnmclean/2348820 to your computer and use it in GitHub Desktop.
SimpleCrypto.Net Basic PBKDF2 Hashing with Salt parameter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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