DocumentManager/Utils/PasswordHash.cs
/// <summary>
/// Creates a salted PBKDF2 hash of the password.
/// </summary>
/// <param name="password">The password to hash.</param>
/// <returns>The hash of the password.</returns>
Creates a salted PBKDF2 hash of the password.
Creates a salted PBKDF2 hash of the password .
public static string CreateHash(string password) {
			RNGCryptoServiceProvider csprng = new RNGCryptoServiceProvider();
			byte[] salt = new byte[SALT_BYTE_SIZE];
			csprng.GetBytes(salt);
			byte[] hash = PBKDF2(password, salt, 1024, HASH_BYTE_SIZE);
			return Convert.ToBase64String(salt) + ":" + Convert.ToBase64String(hash);
		}
public static string CreateHash ( string password ) { RNGCryptoServiceProvider csprng = new RNGCryptoServiceProvider ( ) ; byte [ ] salt = new byte [ SALT_BYTE_SIZE ] ; csprng . GetBytes ( salt ) ; byte [ ] hash = PBKDF2 ( password , salt , 1024 , HASH_BYTE_SIZE ) ; return Convert . ToBase64String ( salt ) + " " + Convert . ToBase64String ( hash ) ; }
Creates a salted PBKDF2 hash of the password.
Creates a salted PBKDF2 hash of the password .
// Generate a random salt // Hash the password and encode the parameters
The hash of the password.
The hash of the password .
password
string
The password to hash.
The password to hash .