private static SaltHashCombo EncryptPassword(string salt, string password) { var output = new SaltHashCombo(); output.salt = salt; var hashArray = crypter.ComputeHash(Encoding.UTF8.GetBytes(salt + password)); output.hash = ByteArrayToHexString(hashArray); return(output); }
public static bool VerifyPassword(string attempt, SaltHashCombo saltHashCombo) { var toTest = EncryptPassword(saltHashCombo.salt, attempt); return(toTest.hash == saltHashCombo.hash); }