<PackageReference Include="SSH.NET" Version="2023.0.0" />

BCrypt

sealed class BCrypt
BCrypt implementation.

Exception for signalling parse errors.

public BCrypt()

public static string GenerateSalt(int workFactor)

Generate a salt for use with the HashPassword method.

public static string GenerateSalt()

Generate a salt for use with the HashPassword method selecting a reasonable default for the number of hashing rounds to apply.

public static string HashPassword(string input)

Hash a password using the OpenBSD bcrypt scheme and a salt generated by GenerateSalt.

public static string HashPassword(string input, int workFactor)

Hash a password using the OpenBSD bcrypt scheme and a salt generated by GenerateSalt using the given workFactor.

public static string HashPassword(string input, string salt)

Hash a password using the OpenBSD bcrypt scheme.

public static string HashString(string source)

Hash a string using the OpenBSD bcrypt scheme and a salt generated by GenerateSalt.

public static string HashString(string source, int workFactor)

Hash a string using the OpenBSD bcrypt scheme and a salt generated by GenerateSalt.

public static bool Verify(string text, string hash)

Verifies that the hash of the given text matches the provided hash

public void Hash(byte[] hpass, byte[] hsalt, byte[] output)

public void Pbkdf(byte[] password, byte[] salt, int rounds, byte[] output)

Applies the Bcrypt kdf to derive a key and iv from the passphrase, the key/iv are returned in the output variable. Ported from the SSHJ library. https://github.com/hierynomus/sshj