Created
April 10, 2012 06:26
-
-
Save shawnmclean/2348795 to your computer and use it in GitHub Desktop.
SimpleCrypto.Net Basic PBKDF2 Hashing
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 void SetNewPassword(User user, string newPassword) | |
{ | |
//a new password hash is generated from a generated salt with the default settings | |
user.Password = cryptoService.Compute(newPassword); | |
//assigning the generated salt to the user | |
user.PasswordSalt = cryptoService.Salt; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment