1、3Des两种加密方式
//3DES的cbc加密[24位密钥对应192位加密]
public static string TripleDesEncryptorCBC(string text, string key, string iv)
{
var tripleDESCipher = new TripleDESCryptoServiceProvider();
tripleDESCipher.Mode = CipherMode.CBC;
tripleDESCipher.Padding = PaddingMode.PKCS7;
byte[] pwdBytes = System.Text.Encoding.UTF8.GetBytes(key);
byte[] keyBytes = new byte[24];
int len = pwdBytes.Length;
if (len > keyBytes.Length)
len = keyBytes.Length;
System.Array.Copy(pwdBytes, keyBytes, len);
tripleDESCipher.Key = keyBytes;
tripleDESCipher.IV = Encoding.ASCII.GetBytes(iv);
ICryptoTransform transform = tripleDESCipher.CreateEncryptor();
byte[] plainText = Encoding.UTF8.GetBytes(text);
byte[] cipherBytes = transform.TransformFinalBlock(p