예제 #1
0
        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);
        }
예제 #2
0
 public static string EncryptWithSHA256(string inputText)
 {
     return(EncryptionService.EncryptWithSHA1(inputText, Encoding.Default));
 }
예제 #3
0
 public static string Encrypt(string inputText, EncryptionAlgorithmEnum encryptionAlgorithmEnum)
 {
     return(EncryptionService.Encrypt(inputText, encryptionAlgorithmEnum, Encoding.Default));
 }
예제 #4
0
 public static string EncryptAES(string Key, string PlainData)
 {
     return(EncryptionService.EncryptWithAES(EncryptionService.GetHashKey(Key), PlainData));
 }
예제 #5
0
 public static string DecryptAES(string Key, string CryptoText)
 {
     return(EncryptionService.DecryptWithAES(EncryptionService.GetHashKey(Key), CryptoText));
 }