Esempio n. 1
0
        public bool VerifySourceValueWithCryptographicData(CryptographicData data, byte[] sourceValue)
        {
            var pbkdf2 = new Rfc2898DeriveBytes(sourceValue, data.Salt, SystemSettings.HashIterations);

            byte[] hash = pbkdf2.GetBytes(SystemSettings.HashSize);

            bool result = true;

            for (int i = 0; i < SystemSettings.HashSize; i++)
            {
                result = result && hash[i] == data.HashKey[i];
            }

            return(result);
        }
Esempio n. 2
0
 public bool VerifySourceValueWithCryptographicData(CryptographicData data, string sourceValue)
 {
     return(VerifySourceValueWithCryptographicData(data, Encoding.UTF8.GetBytes(sourceValue)));
 }