static public string 创建键与向量()
{
System.Security.Cryptography.RC2CryptoServiceProvider rc2CSP = new System.Security.Cryptography.RC2CryptoServiceProvider();
System.IO.DirectoryInfo dr = new System.IO.DirectoryInfo("键与向量目录");
if (!dr.Exists)
dr.Create();
System.IO.FileStream fs = new System.IO.FileStream( dr.FullName + @"\SetKey.dat", System.IO.FileMode.Create);
fs.Write(rc2CSP.Key, 0, 16);
fs.Flush();fs.Close();
fs = new System.IO.FileStream(dr.FullName + @"\SetIv.dat", System.IO.FileMode.Create);
fs.Write(rc2CSP.IV, 0, 8);
fs.Flush(); fs.Close();
{
System.Security.Cryptography.RC2CryptoServiceProvider rc2CSP = new System.Security.Cryptography.RC2CryptoServiceProvider();
System.IO.DirectoryInfo dr = new System.IO.DirectoryInfo("键与向量目录");
if (!dr.Exists)
dr.Create();
System.IO.FileStream fs = new System.IO.FileStream( dr.FullName + @"\SetKey.dat", System.IO.FileMode.Create);
fs.Write(rc2CSP.Key, 0, 16);
fs.Flush();fs.Close();
fs = new System.IO.FileStream(dr.FullName + @"\SetIv.dat", System.IO.FileMode.Create);
fs.Write(rc2CSP.IV, 0, 8);
fs.Flush(); fs.Close();