信息安全实验报告信息安全概论课程设计

上传人:M****1 文档编号:490925462 上传时间:2023-08-14 格式:DOCX 页数:13 大小:166.58KB
返回 下载 相关 举报
信息安全实验报告信息安全概论课程设计_第1页
第1页 / 共13页
信息安全实验报告信息安全概论课程设计_第2页
第2页 / 共13页
信息安全实验报告信息安全概论课程设计_第3页
第3页 / 共13页
信息安全实验报告信息安全概论课程设计_第4页
第4页 / 共13页
信息安全实验报告信息安全概论课程设计_第5页
第5页 / 共13页
点击查看更多>>
资源描述

《信息安全实验报告信息安全概论课程设计》由会员分享,可在线阅读,更多相关《信息安全实验报告信息安全概论课程设计(13页珍藏版)》请在金锄头文库上搜索。

1、郑州轻工业学院课程设计报告名称: 信息安全概论指导教师:吉星、程立辉姓名:符豪学号:541307030112班级: 网络工程13-011. 目的数据加密技术要求只有在指定的用户或网络下,才能解除密码而 获得原来的数据,这就需要给数据发送方和接受方以一些特殊的信息 用于加解密,这就是所谓的密钥。其密钥的值是从大量的随机数中选 取的。按加密算法分为专用密钥和公开密钥两种。数据加密技术是网 络中最基本的安全技术,主要是通过对网络中传输的信息进行数据加 密来保障其安全性,这是一种主动安全防御策略,用很小的代价即可 为信息提供相当大的安全保护。2. 题目使用C#编程语言,进行数据的加密与解密。系统基本功

2、能描述如下:1、实现 DES 算法加密与解密功能。2、实现TripleDES算法加密与解密功能。3、实现MD5算法加密功能。4、实现 RC2 算法加密与解密功能。5、实现 TripleDES 算法加密与解密功能。6、实现 RSA 算法加密与解密功能。3. 功能描述使用该软件在相应的文本框中输入明文,然后点击加密就会立即 转化成相应的密文,非常迅速和方便,而且操作简单加流畅,非常好 用。4. 需求分析加密软件发展很快,目前最常见的是透明加密,透明加密是一种 根据要求在操作系统层自动地对写入存储介质的数据进行加密的技 术。透明加密软件作为一种新的数据保密手段,自2005年上市以来, 得到许多软件公

3、司特别是制造业软件公司和传统安全软件公司的热 捧,也为广大需要对敏感数据进行保密的客户带来了希望。加密软件 上市以来,市场份额逐年上升,同时,经过几年的实践,客户对软件 开发商提出了更多的要求。与加密软件产品刚上市时前一两年各软件 厂商各持一词不同,经过市场的几番磨炼,客户和厂商对透明加密软 件有了更加统一的认识。5. 设计说明传统的周边防御,比如防火墙、入侵检测和防病毒软件,已经不 再能够解决很多今天的数据保护问题。为了加强这些防御措施并且满 足短期相关规范的要求,许多公司对于数据安全纷纷采取了执行多点 产品的战术性措施。这种片面的部署计划确实可以为他们的数据提供 一点点额外的保护,但是在管

4、理上花费昂贵并且操作困难,这种做法 并不能为未来的发展提供一个清晰的框架。加密是确保数据安全最重 要的环节。必须确保数据加密而不是仅仅依赖一个防护基础架构。对 数据进行加密可以让数据不论是在网络中活动、在数据库和电脑中静 止或者在工作站中被使用的时候都能防患于未然。6. 源代码主窗体:using System;using Sys tem.Collec ti ons.Generic;using Sys tem.Componen tM odel;using Sys tem.Da ta;using Sys tem.Drawing;using Sys tem.Linq;using Sys tem.Te

5、x t;using Sys tem.Windows.Forms;namespace WindowsFormsApplication1publicpartialclassForm1 : Formpublic Form1()Initi alizeComponen t();privatevoid md5ToolStripMenuItem_Click(object sender, EventArgs e)md5 md51 = newmd5 ();md51.Show();privatevoid dES加密解密ToolStripMenuItem_Click(object sender, EventArgs

6、 e)des des1 = newdes ();des1.Show();privatevoid rSA加密解密ToolstripMenuItem_Click(object sender, EventArgs e)rsa rsa1 = newrsa();rsa1.Show();privatevoid帮助ToolStripMenuItem_Click(object sender, EventArgs e)help h = newhelp ();h.Show();Cryp to graph y类:using System;using Sys tem.Secu rity .Cryp to graphy

7、;using Sys tem.IO;using Sys tem.Tex t;using Sys tem.Globaliza ti on;using Sys tem.Xml.Linq;using Sys tem.Collec ti ons.Generic;namespace WindowsFormsApplication1classEncrypter/DES默认密钥向量priva tes tati cby te DES _IV = 0x12, 0x34, 0x56, 0x7 8, 0x90, 0xAB, 0xCD, 0xEF ;publicstaticstring EncryptByMD5(st

8、ring input)MD5 md5Hasher = MD5.Crea te();byte data = md5Hasher.Comp ute Hash(Encoding.UTF8.G etByt es(inp ut);Str ingBuilder sBuilder = newS tr ingBuilder();for (in t i = 0; i dat a.Leng th; i+)sBuilder.Append(da tai.ToS tr ing(x2);return sBuilder.ToS tr ing();publicstaticstring EncryptByDES(string

9、input, string key) byt e inp utBytes = Encoding.UTF8.Ge tByt es(inp ut);byte keyBytes = ASCIIEncoding.UTF8.GetBytes(key);byte encryptBytes = EncryptByDES(inputBytes, keyBytes, keyBytes);using (DES des = newDESCryptoServiceProvider()using (MemoryS tr eam ms = newMemoryS tr eam()using (Cryp toStr eam

10、cs = newCryp toStr eam(ms, des.Crea te Encryp tor(), Cryp toStr eamMode.Wr ite)using (StreamWriter writer = newStreamWriter(cs) writ er.Wr it e(inp utByt es);string result = Convert .ToBase64String(encryptBytes);return result;publics tat icby te Encryp tByDES(b yte inp utByt es, byte key, byte IV) D

11、ES des = newDESCryptoServiceProvider();des.Key = key; des.IV = IV;str ing resu lt = str ing.Emp ty;using (MemoryS tr eam ms = newMemoryS tr eam()using (Cryp toStr eam cs = newCryp toStr eam(ms, des.Crea te Encryp tor(), Cryp toStr eamMode.Wr ite) cs.Wr it e(inp utByt es, 0, inp utByt es.Leng th);ret

12、urn ms.ToArray();publicstaticstring DecryptByDES(string input, string key)byte inp utBytes = Conv ert.Fr omBase64S tr ing(inp ut);byte keyBytes = ASCIIEncoding.UTF8.GetBytes(key);byte resultBytes = DecryptByDES(inputBytes, keyBytes, keyBytes);str ing resu lt = Encoding.UTF8.Ge tStr ing(resu ltByt es

13、);return result;publics tat icby te Decryp tByDES(b yte inp utByt es, byte key, byte iv)DESCryptoServiceProvider des = newDESCryptoServiceProvider();des.Key = key;des.IV = iv;using (MemoryStream ms = newMemoryStream(inputBytes)using (Cryp toStr eam cs = newCryp toStr eam(ms, des.Crea te Decryp tor()

14、, Cryp toS treamMode.Read)using (StreamReader reader = newStreamReader(cs)str ing resu lt = reader.ReadToEnd();retu rnEncoding.UTF8.Ge tByt es(resu lt);publicstaticstring EncryptString(string input, string sKey)byte data = Encoding.UTF8.G etByt es(inp ut);using (DESCryptoServiceProvider des = newDES

15、CryptoServiceProvider() des.Key = ASCIIEncoding.ASCII.Ge tBy tes(sKey);des.IV = ASCIIEncoding.ASCII.Ge tBy tes(sKey);ICryp toTransform desencryp t = des.Crea teEncryp tor();byt e resu lt = desencryp t.TransformFinalBlock(da ta, 0, dat a.Leng th); retu rnB it Conve rt er.ToS tr ing(resu lt);publicstaticstring DecryptString(string input, string sKey)str ing

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 学术论文 > 其它学术论文

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号