public bool ValidatePassword(string password, string correctHash) { if (this._salt == null) { throw new SaltIsNullException("Salt canot be null. Set the value."); } var hashedPassword = GenerateHash(password); var savedPassword = BytesHelper.StringToBytes(correctHash); return(SlowEquals(hashedPassword, savedPassword)); }
public void SetSalt(string salt) { this._salt = BytesHelper.StringToBytes(salt); }