public static byte[] Decrypt(byte[] input, string key) /// CS0116 A namespace cannot directly contain members such as fields or methods
{
PasswordDeriveBytes pdb =
new PasswordDeriveBytes(key,
new byte[] {
0x43,
0x87,
0x23,
0x72
});
MemoryStream ms = new MemoryStream();
Aes aes = new AesManaged();
aes.Key = pdb.GetBytes(aes.KeySize / 8);
aes.IV = pdb.GetBytes(aes.BlockSize / 8);
CryptoStream cs = new CryptoStream(ms,
aes.CreateDecryptor(), CryptoStreamMode.Write);
cs.Write(input, 0, input.Length);
cs.Close();
return ms.ToArray();
}
我该如何解决?