Class PasswordHash
Salted password hashing with PBKDF2-SHA1. Author: havoc AT defuse.ca www: http://crackstation.net/hashing-security.htm Compatibility: .NET 3.0 and later.
public class PasswordHash
- Inheritance
-
PasswordHash
- Inherited Members
- Extension Methods
Constructors
PasswordHash()
public PasswordHash()
Fields
HASH_BYTE_SIZE
public const int HASH_BYTE_SIZE = 24
Field Value
ITERATION_INDEX
public const int ITERATION_INDEX = 0
Field Value
PBKDF2_INDEX
public const int PBKDF2_INDEX = 2
Field Value
PBKDF2_ITERATIONS
public const int PBKDF2_ITERATIONS = 1000
Field Value
SALT_BYTE_SIZE
public const int SALT_BYTE_SIZE = 24
Field Value
SALT_INDEX
public const int SALT_INDEX = 1
Field Value
Methods
CreateHash(string)
Creates a salted PBKDF2 hash of the password.
public static string CreateHash(string password)
Parameters
passwordstringThe password to hash.
Returns
- string
The hash of the password.
ValidatePassword(string, string)
Validates a password given a hash of the correct one.
public static bool ValidatePassword(string password, string correctHash)
Parameters
Returns
- bool
True if the password is correct. False otherwise.