/// <summary> /// 解密,采用TripleDES加密算法 /// </summary> /// <param name="encryptedText">密文</param> /// <param name="key">密钥</param> /// <param name="iv">向量</param> /// <returns>明文</returns> public static string Decrypt(string encryptedText, string key, string iv) { SymmetricCrypto helper = new SymmetricCrypto(key, iv); return(helper.Decrypt(encryptedText)); }
/// <summary> /// 加密,采用TripleDES加密算法 /// </summary> /// <param name="clearText">明文</param> /// <param name="key">密钥</param> /// <param name="iv">向量</param> /// <returns>密文</returns> public static string Encrypt(string clearText, string key, string iv) { SymmetricCrypto helper = new SymmetricCrypto(key, iv); return(helper.Encrypt(clearText)); }