///
文件加密类 使用DES加密文件流///
desKey: DES的密钥;desIV: DES向量
class encrypfile{
public byte[] desKey;
public byte[] desIV;
public encrypfile(byte[] inputKey,byte[] inputIV){
desKey=inputKey;
desIV=inputIV;
}
///
加密主方法 ///
inName:被加密文件名;outName: 加密后文件名
public void begintoencry(string inName,string outName){
FileStream fin = new FileStream(inName, FileMode.Open, FileAccess.Read);
FileStream fout = new FileStream(outName, FileMode.OpenOrCreate, FileAccess.Write);
fout.SetLength(0);
byte[] bin = new byte[100]; //This is intermediate storage for the encryption.
long rdlen = 0; //This is the total number of bytes written.
long totlen = fin.Length; //This is the total length of the input file.
int len; //This is the number of bytes to be written at a time.