Exemplo n.º 1
0
        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));
        }
Exemplo n.º 2
0
 public void SetSalt(string salt)
 {
     this._salt = BytesHelper.StringToBytes(salt);
 }