文件名称:C#文件夹加密有源代码!
文件大小:6KB
文件格式:RAR
更新时间:2013-11-11 16:58:25
加密 源码
深度剖析各种加密方法!源码可直接调试! ublic static void F加密UTF8文件(string sInputFilename, string sOutputFilename, string sKey) { FileStream fsInput = new FileStream(sInputFilename, FileMode.Open, FileAccess.Read); FileStream fsEncrypted = new FileStream(sOutputFilename, FileMode.Create, FileAccess.Write); DESCryptoServiceProvider DES = new DESCryptoServiceProvider(); DES.Key = System.Text.UTF8Encoding.Default.GetBytes(sKey); DES.IV = System.Text.UTF8Encoding.Default.GetBytes(sKey); ICryptoTransform desencrypt = DES.CreateEncryptor(); CryptoStream cryptostream = new CryptoStream(fsEncrypted, desencrypt, CryptoStreamMode.Write); byte[] bytearrayinput = new byte[fsInput.Length]; fsInput.Read(bytearrayinput, 0, bytearrayinput.Length); cryptostream.Write(bytearrayinput, 0, bytearrayinput.Length); cryptostream.Close(); fsInput.Close(); fsEncrypted.Close(); }
【文件预览】:
c#
----C#+文件加密解决类库.cs(6KB)
----文件夹加密方法.txt(21KB)