Skip to content

Instantly share code, notes, and snippets.

@wshaddix
Created March 26, 2014 00:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wshaddix/9774709 to your computer and use it in GitHub Desktop.
Save wshaddix/9774709 to your computer and use it in GitHub Desktop.
// get the password from the user
var clearTextPassword = "Passw0rd";
// create the password hash
var passwordHash = PasswordHash.CreateHash(clearTextPassword);
// store the password hash in a data store
// ...
// (later when the user tries to login)
// fetch the user's password hash from the data store
// ...
// validate the password
var isValid = PasswordHash.ValidatePassword(clearTextPassword, passwordHash);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment