/// <summary> /// Checks if the password given when salted and hashed matches with the hash stored from the originally generated password. /// </summary> /// <param name="password">The password to check.</param> /// <param name="hash">A hash from the correct password.</param> /// <param name="salt">The Salt from the correct password store</param> /// <returns>True if the password is correct.</returns> public bool CheckPassword(string password, string hash, string salt) { var testHash = ComputeHash_ShaSalt(password, _stringHandler.GetBytes(salt)); //TODO Make more secure var testString = Convert.ToBase64String(testHash); //return _stringHandler.SecureByteArrayEquals(_stringHandler.GetBytes(hash), testHash); return(testString.Equals(hash)); }