internal bool ValidarDatosEncriptados(string username, string datosEncriptados, string datosHasheados)
        {
            string text = EncryptionService.DecryptAES(ConfigEnum.CryptoKeyUKSV, datosEncriptados);
            bool   result;

            try
            {
                string s = text.Split(new char[]
                {
                    '|'
                })[0];
                DateTime dateTime = DateTime.ParseExact(s, "yyyyMMddHHmmss", CultureInfo.InvariantCulture);
                string   text2    = text.Split(new char[]
                {
                    '|'
                })[1];
                string text3 = text.Split(new char[]
                {
                    '|'
                })[2];
                bool flag = text2.Equals(username);
                if (flag)
                {
                    string text4 = EncryptionService.EncryptWithSHA1(string.Concat(new object[]
                    {
                        dateTime,
                        "|",
                        username,
                        "|",
                        text3
                    }));
                    result = text4.Equals(datosHasheados);
                }
                else
                {
                    result = false;
                }
            }
            catch (Exception var_9_B3)
            {
                result = false;
            }
            return(result);
        }
Beispiel #2
0
 public static string EncryptWithSHA256(string inputText)
 {
     return(EncryptionService.EncryptWithSHA1(inputText, Encoding.Default));
 }
Beispiel #3
0
 public static string Encrypt(string inputText, EncryptionAlgorithmEnum encryptionAlgorithmEnum)
 {
     return(EncryptionService.Encrypt(inputText, encryptionAlgorithmEnum, Encoding.Default));
 }
Beispiel #4
0
 public static string EncryptAES(string Key, string PlainData)
 {
     return(EncryptionService.EncryptWithAES(EncryptionService.GetHashKey(Key), PlainData));
 }
Beispiel #5
0
 public static string DecryptAES(string Key, string CryptoText)
 {
     return(EncryptionService.DecryptWithAES(EncryptionService.GetHashKey(Key), CryptoText));
 }