Example #1
0
        /// <summary>
        /// 使用3DES解密字符串
        /// </summary>
        public static string DecryptString(string encrypted, string key)
        {
            var buff = System.Text.Encoding.UTF8.GetBytes(encrypted);
            var res  = Des3Encryption.Decrypt(buff, key);

            return(System.Text.Encoding.UTF8.GetString(res));
        }
Example #2
0
        /// <summary>
        /// 使用3DES加密字符串
        /// </summary>
        public static string EncryptString(string origin, string key)
        {
            var buff = System.Text.Encoding.UTF8.GetBytes(origin);
            var res  = Des3Encryption.Encrypt(buff, key);

            return(System.Text.Encoding.UTF8.GetString(res));
        }
Example #3
0
        /// <summary>
        /// 使用3DES解密
        /// </summary>
        public static byte[] Decrypt(byte[] encrypted, string key)
        {
            Des3Encryption desEncryption = new Des3Encryption(key);

            return(desEncryption.Decrypt(encrypted));
        }
Example #4
0
        /// <summary>
        /// 使用3DES加密
        /// </summary>
        public static byte[] Encrypt(byte[] origin, string key)
        {
            Des3Encryption desEncryption = new Des3Encryption(key);

            return(desEncryption.Encrypt(origin));
        }
Example #5
0
 /// <summary>
 /// 使用3DES加密
 /// </summary>        
 public static byte[] Encrypt(byte[] origin, string key)
 {
     Des3Encryption desEncryption = new Des3Encryption(key);
     return desEncryption.Encrypt(origin);
 }
Example #6
0
 /// <summary>
 /// 使用3DES解密
 /// </summary> 
 public static byte[] Decrypt(byte[] encrypted, string key)
 {
     Des3Encryption desEncryption = new Des3Encryption(key);
     return desEncryption.Decrypt(encrypted);
 }