c#中des解密代码
private string Decrypt(string source){
string str = string.Empty;
DESCryptoServiceProvider provider = new DESCryptoServiceProvider();
byte[] buffer = new byte[] { 0x88, 0xb7, 0x8e, 0xd9, 0xaf, 0x47, 90, 0xef };
byte[] buffer2 = new byte[] { 0xe3, 0x69, 5, 40, 0xa2, 0x9e, 0x8f, 0x9c };
provider.Key = buffer;
provider.IV = buffer2;
if (source.Length > 0)
{
byte[] buffer3 = Convert.FromBase64String(source);
MemoryStream stream = new MemoryStream();
stream.Write(buffer3, 0, buffer3.Length);
stream.Seek(0L, SeekOrigin.Begin);
ICryptoTransform transform = provider.CreateDecryptor();
CryptoStream stream2 = new CryptoStream(stream, transform, CryptoStreamMode.Read);
str = new StreamReader(stream2, new UnicodeEncoding()).ReadToEnd();
stream2.Close();
}
return str;
}
补充:综合编程 , 安全编程 ,