预览加载中,请您耐心等待几秒...
1/4
2/4
3/4
4/4

在线预览结束,喜欢就下载吧,查找使用更方便

如果您无法下载资料,请参考说明:

1、部分资料下载需要金币,请确保您的账户上有足够的金币

2、已购买过的文档,再次下载不重复扣费

3、资料包下载后请先用软件解压,在使用对应软件打开

HYPERLINK"http://blog.vckbase.com/wangjun/archive/2006/10/18/22802.html".NET中的3DES加密 如果编码有问题,可以尝试Encoding.GetEncoding("gb2312") usingSystem.Text;usingSystem.Security.Cryptography;publicstaticstringDES3Encrypt(stringstrString,stringstrKey) { TripleDESCryptoServiceProviderDES=newTripleDESCryptoServiceProvider();MD5CryptoServiceProviderhashMD5=newMD5CryptoServiceProvider();DES.Key=hashMD5.ComputeHash(Encoding.Default.GetBytes(strKey));DES.Mode=CipherMode.ECB;ICryptoTransformDESEncrypt=DES.CreateEncryptor();byte[]Buffer=Encoding.Default.GetBytes(strString);returnConvert.ToBase64String(DESEncrypt.TransformFinalBlock(Buffer,0,Buffer.Length));}publicstaticstringDES3Decrypt(stringstrString,stringstrKey){TripleDESCryptoServiceProviderDES=newTripleDESCryptoServiceProvider();MD5CryptoServiceProviderhashMD5=newMD5CryptoServiceProvider();DES.Key=hashMD5.ComputeHash(Encoding.Default.GetBytes(strKey));DES.Mode=CipherMode.ECB;ICryptoTransformDESDecrypt=DES.CreateDecryptor();stringresult="";try{byte[]Buffer=Convert.FromBase64String(strString);result=Encoding.Default.GetString(DESDecrypt.TransformFinalBlock(Buffer,0,Buffer.Length));}catch(System.Exceptione){throw(newSystem.Exception("null",e));}returnresult;} C#实现3DES加密解密 usingSystem; usingSystem.Collections.Generic; usingSystem.Text; usingSystem.IO; usingSystem.Security.Cryptography; namespaceConsoleApplication1 { classProgram { publicstaticstringEncrypt3DES(stringa_strString,stringa_strKey) { TripleDESCryptoServiceProviderDES=newTripleDESCryptoServiceProvider(); DES.Key=ASCIIEncoding.ASCII.GetBytes(a_strKey); DES.Mode=CipherMode.ECB; ICryptoTransformDESEncrypt=DES.CreateEncryptor(); byte[]Buffer=ASCIIEncoding.ASCII.GetBytes(a_strString); returnConvert.ToBase64String(DESEncrypt.TransformFinalBlock(Buffer,0,Buffer.Length)); } publicstaticstringDecrypt3DES(stringa_strString,stringa_strKey) { TripleDESCryptoServiceProviderDES=newTripleDESCryptoServiceProvider(); DES.Key=ASCIIEncoding.ASCII.GetBytes(a_strKey); DES.Mode=CipherMo