public static byte[] DeriveKey(byte[] password, byte[] salt, PasswordHash.Strength strength = Sodium.PasswordHash.Strength.Interactive) { //hash the salt to ensure that it's the expected size of 32 bytes var hashedSalt = FastHash(salt); return Sodium.PasswordHash.ScryptHashBinary(password, hashedSalt, strength); }
public static byte[] DeriveKey(byte[] password, byte[] salt, PasswordHash.Strength strength = PasswordHash.Strength.Interactive) { return Hashing.DeriveKey(password, salt, strength); }
public static byte[] DeriveKey(string password, byte[] salt, PasswordHash.Strength strength = PasswordHash.Strength.Interactive) { return DeriveKey(Encoding.UTF8.GetBytes(password), salt, strength); }
public static string PasswordHash(string password, PasswordHash.Strength strength = Sodium.PasswordHash.Strength.Interactive) { return Sodium.PasswordHash.ScryptHashString(password, strength); }