Beispiel #1
0
        /// <summary>
        ///     Расшифровать строку для Url
        /// </summary>
        /// <param name="text"></param>
        /// <returns></returns>
        public static string DecryptStringUrl(string text)
        {
            if (text == null)
            {
                return(null);
            }

            foreach (var kvpchar in InvalidUrlChar)
            {
                text = text.Replace(kvpchar.Value, kvpchar.Key);
            }

            string res = TripleDesEncryption.DecryptString(text, TripleDesEncryption.KeySize128, PrivateKeyManager.GetUrlEncodingKey());

            return(res);
        }
Beispiel #2
0
        /// <summary>
        ///     Шифрует строку для Url
        /// </summary>
        /// <param name="text"></param>
        /// <returns></returns>
        public static string EncryptStringUrl(string text)
        {
            string res = TripleDesEncryption.EncryptString(text, TripleDesEncryption.KeySize128, PrivateKeyManager.GetUrlEncodingKey());

            foreach (var kvpchar in InvalidUrlChar)
            {
                res = res.Replace(kvpchar.Key, kvpchar.Value);
            }
            return(res);
        }