Exemplo n.º 1
0
 /// <summary>
 /// 使用3DES解密字符串
 /// </summary>
 public static string DecryptString(string encrypted, string key)
 {
     byte[] buff = System.Text.Encoding.UTF8.GetBytes(encrypted);
     byte[] res  = Des3EncryptionHelper.Decrypt(buff, key);
     return(System.Text.Encoding.UTF8.GetString(res));
 }
Exemplo n.º 2
0
        /// <summary>
        /// 使用3DES解密
        /// </summary>
        public static byte[] Decrypt(byte[] encrypted, string key)
        {
            Des3EncryptionHelper desEncryption = new Des3EncryptionHelper(key);

            return(desEncryption.Decrypt(encrypted));
        }
Exemplo n.º 3
0
 /// <summary>
 /// 使用3DES加密字符串
 /// </summary>
 public static string EncryptString(string origin, string key)
 {
     byte[] buff = System.Text.Encoding.UTF8.GetBytes(origin);
     byte[] res  = Des3EncryptionHelper.Encrypt(buff, key);
     return(System.Text.Encoding.UTF8.GetString(res));
 }
Exemplo n.º 4
0
        /// <summary>
        /// 使用3DES加密
        /// </summary>
        public static byte[] Encrypt(byte[] origin, string key)
        {
            Des3EncryptionHelper desEncryption = new Des3EncryptionHelper(key);

            return(desEncryption.Encrypt(origin));
        }