主题:有關加密
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.Security.Cryptography;
using System.IO;
using System.Text ;
using System.Diagnostics;
UTF8Encoding utf8Encoding = new UTF8Encoding();
string aa=textBox1.Text;
byte[] inputByteArray = utf8Encoding.GetBytes(aa.ToCharArray());
// 方式一:调用默认的DES实现方法DES_CSP.
DES des = DES.Create();
// 方式二:直接使用DES_CSP()实现DES的实体
//DES_CSP DES = new DES_CSP();
// 初始化DES加密的密钥和一个随机的、8比特的初始化向量(IV)
Byte[] key = {0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef};
Byte[] IV = {0x12, 0x34, 0x56, 0x78, 0x90, 0xab, 0xcd, 0xef};
des.Key = key;
des.IV = IV;
[color=008000]// 建立加密流這裡報錯說(SymmetricStreamEncryptor和CryptoMemoryStream 這二個類的在上面的命名空間找不到,請問這二個類是屬於哪個命名空間[/color]
SymmetricStreamEncryptor sse = des.CreateEncryptor();
// 使用CryptoMemoryStream方法获取加密过程的输出
CryptoMemoryStream cms = new CryptoMemoryStream
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.Security.Cryptography;
using System.IO;
using System.Text ;
using System.Diagnostics;
UTF8Encoding utf8Encoding = new UTF8Encoding();
string aa=textBox1.Text;
byte[] inputByteArray = utf8Encoding.GetBytes(aa.ToCharArray());
// 方式一:调用默认的DES实现方法DES_CSP.
DES des = DES.Create();
// 方式二:直接使用DES_CSP()实现DES的实体
//DES_CSP DES = new DES_CSP();
// 初始化DES加密的密钥和一个随机的、8比特的初始化向量(IV)
Byte[] key = {0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef};
Byte[] IV = {0x12, 0x34, 0x56, 0x78, 0x90, 0xab, 0xcd, 0xef};
des.Key = key;
des.IV = IV;
[color=008000]// 建立加密流這裡報錯說(SymmetricStreamEncryptor和CryptoMemoryStream 這二個類的在上面的命名空間找不到,請問這二個類是屬於哪個命名空間[/color]
SymmetricStreamEncryptor sse = des.CreateEncryptor();
// 使用CryptoMemoryStream方法获取加密过程的输出
CryptoMemoryStream cms = new CryptoMemoryStream