### Hash and verify passwords with CryptoHelper PasswordHasher Source: https://github.com/henkmollema/cryptohelper/blob/master/README.md Use PasswordHasher.HashPassword to hash a password and PasswordHasher.VerifyHashedPassword to verify a hash against a password. The class name Crypto has been changed to PasswordHasher. ```csharp using CryptoHelper; // Hash a password public string HashPassword(string password) { return PasswordHasher.HashPassword(password); } // Verify the password hash against the given password public bool VerifyPassword(string hash, string password) { return PasswordHasher.VerifyHashedPassword(hash, password); } ``` -------------------------------- ### PasswordHasher.HashPassword(string password) Source: https://github.com/henkmollema/cryptohelper/blob/master/README.md Hashes a plaintext password using a PBKDF2 implementation. Returns the hashed password as a string. ```APIDOC ## PasswordHasher.HashPassword(string password) ### Description Hashes a plaintext password using a PBKDF2 implementation. Returns the hashed password as a string. ### Method HashPassword ### Parameters - **password** (string) - Required - The plaintext password to hash. ### Returns - **string** - The hashed password. ### Example ```csharp string hash = PasswordHasher.HashPassword(password); ``` ``` -------------------------------- ### PasswordHasher.VerifyHashedPassword(string hash, string password) Source: https://github.com/henkmollema/cryptohelper/blob/master/README.md Verifies a password hash against a given plaintext password. Returns a boolean indicating whether the password matches the hash. ```APIDOC ## PasswordHasher.VerifyHashedPassword(string hash, string password) ### Description Verifies a password hash against a given plaintext password. Returns a boolean indicating whether the password matches the hash. ### Method VerifyHashedPassword ### Parameters - **hash** (string) - Required - The hashed password to verify against. - **password** (string) - Required - The plaintext password to verify. ### Returns - **bool** - True if the password matches the hash, otherwise false. ### Example ```csharp bool isValid = PasswordHasher.VerifyHashedPassword(hash, password); ``` ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.