Skip to content

Instantly share code, notes, and snippets.

@shawnmclean
Created April 10, 2012 06:26
Show Gist options
  • Save shawnmclean/2348795 to your computer and use it in GitHub Desktop.
Save shawnmclean/2348795 to your computer and use it in GitHub Desktop.
SimpleCrypto.Net Basic PBKDF2 Hashing
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