Exemplo n.º 1
0
        /// <summary>
        ///     加密
        /// </summary>
        /// <param name="param"></param>
        /// <returns></returns>
        public static string RC4Encrypt(string param)
        {
            var rc4 = new RC4();

            param = HttpUtility.UrlEncode(rc4.Encrypt(param, "wine"));
            return(param);
        }
Exemplo n.º 2
0
        /// <summary>
        ///     解密
        /// </summary>
        /// <param name="param"></param>
        /// <returns></returns>
        public static string RC4Decrypt(string param)
        {
            var rc4 = new RC4();

            try
            {
                param = rc4.Decrypt(param, "wine");
            }
            catch
            {
                param = rc4.Decrypt(HttpUtility.UrlDecode(param), "wine");
            }
            return(param);
        }