日期:2014-05-17 浏览次数:20951 次
int count = cs.Read(decryptBytes, 0, decryptBytes.Length);
cs.Close();
ms.Close();
string s = Encoding.UTF8.GetString(decryptBytes, 0, count);
public static void AESDecrypt(byte[] cipherText, byte[] Key, byte[] IV)
{
SymmetricAlgorithm des = Rijndael.Create();
des.Key = Key;
des.IV = IV;
MemoryStream stream = new MemoryStream();
CryptoStream stream2 = new CryptoStream(stream, des.CreateDecryptor(), CryptoStreamMode.Write);
stream2.Write(cipherText, 0, cipherText.Length);
stream2.FlushFinalBlock();
string s = Encoding.UTF8.GetString(stream.ToArray());
File.WriteAllText("D:\\shiyan.txt", s, Encoding.UTF8);
System.Console.WriteLine("保存成功!");
bijiao();
}