Beispiel #1
0
        public static string DecryptTagValidationString(string TagValidationString)
        {
            string strKey = "FFFFFFFFFFFFFFFFFXXXXXXX";

            byte[] key = System.Text.Encoding.UTF8.GetBytes(strKey);
            string TagValidationStringUNENC = string.Empty;

            try
            {
                TagValidationStringUNENC = DESEncryption.Decrypt(TagValidationString, key);
            }
            catch (Exception)
            {
                return(string.Empty);
            }

            return(TagValidationStringUNENC);
        }
Beispiel #2
0
        public static string DecryptForWeb(string clearText)
        {
            byte[] key = new byte[] { 0x49, 0x76, 0x61, 0x6e, 0x20, 0x4d, 0x65, 0x64 };

            string dec = string.Empty;

            clearText = clearText.Replace("escape", "&");

            try
            {
                dec = DESEncryption.Decrypt(clearText, key);
            }
            catch (Exception)
            {
                return(string.Empty);
            }

            return(dec);
        }
Beispiel #3
0
        public static string EncryptForWeb(string clearText)
        {
            byte[] key = new byte[] { 0x49, 0x76, 0x61, 0x6e, 0x20, 0x4d, 0x65, 0x64 };

            string enc = string.Empty;

            try
            {
                enc = DESEncryption.Encrypt(clearText, key);
            }
            catch (Exception)
            {
                return(string.Empty);
            }

            enc = enc.Replace("&", "escape");

            return(enc);
        }