信息安全實(shí)驗(yàn)報(bào)告信息安全概論課程設(shè)計(jì).doc_第1頁(yè)
信息安全實(shí)驗(yàn)報(bào)告信息安全概論課程設(shè)計(jì).doc_第2頁(yè)
信息安全實(shí)驗(yàn)報(bào)告信息安全概論課程設(shè)計(jì).doc_第3頁(yè)
信息安全實(shí)驗(yàn)報(bào)告信息安全概論課程設(shè)計(jì).doc_第4頁(yè)
信息安全實(shí)驗(yàn)報(bào)告信息安全概論課程設(shè)計(jì).doc_第5頁(yè)
已閱讀5頁(yè),還剩8頁(yè)未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

鄭州輕工業(yè)學(xué)院課程設(shè)計(jì)報(bào)告名稱:信息安全概論指導(dǎo)教師:吉星、程立輝姓名:符豪學(xué)號(hào):541307030112班級(jí):網(wǎng)絡(luò)工程13-011. 目的 數(shù)據(jù)加密技術(shù)要求只有在指定的用戶或網(wǎng)絡(luò)下,才能解除密碼而獲得原來(lái)的數(shù)據(jù),這就需要給數(shù)據(jù)發(fā)送方和接受方以一些特殊的信息用于加解密,這就是所謂的密鑰。其密鑰的值是從大量的隨機(jī)數(shù)中選取的。按加密算法分為專(zhuān)用密鑰和公開(kāi)密鑰兩種。數(shù)據(jù)加密技術(shù)是網(wǎng)絡(luò)中最基本的安全技術(shù),主要是通過(guò)對(duì)網(wǎng)絡(luò)中傳輸?shù)男畔⑦M(jìn)行數(shù)據(jù)加密來(lái)保障其安全性,這是一種主動(dòng)安全防御策略,用很小的代價(jià)即可為信息提供相當(dāng)大的安全保護(hù)。2. 題目使用C#編程語(yǔ)言,進(jìn)行數(shù)據(jù)的加密與解密。系統(tǒng)基本功能描述如下:1、 實(shí)現(xiàn)DES算法加密與解密功能。2、 實(shí)現(xiàn)TripleDES算法加密與解密功能。3、 實(shí)現(xiàn)MD5算法加密功能。4、 實(shí)現(xiàn)RC2算法加密與解密功能。5、 實(shí)現(xiàn)TripleDES算法加密與解密功能。6、 實(shí)現(xiàn)RSA算法加密與解密功能。3. 功能描述使用該軟件在相應(yīng)的文本框中輸入明文,然后點(diǎn)擊加密就會(huì)立即轉(zhuǎn)化成相應(yīng)的密文,非常迅速和方便,而且操作簡(jiǎn)單加流暢,非常好用。4. 需求分析加密軟件發(fā)展很快,目前最常見(jiàn)的是透明加密,透明加密是一種根據(jù)要求在操作系統(tǒng)層自動(dòng)地對(duì)寫(xiě)入存儲(chǔ)介質(zhì)的數(shù)據(jù)進(jìn)行加密的技術(shù)。透明加密軟件作為一種新的數(shù)據(jù)保密手段,自2005年上市以來(lái),得到許多軟件公司特別是制造業(yè)軟件公司和傳統(tǒng)安全軟件公司的熱捧,也為廣大需要對(duì)敏感數(shù)據(jù)進(jìn)行保密的客戶帶來(lái)了希望。加密軟件上市以來(lái),市場(chǎng)份額逐年上升,同時(shí),經(jīng)過(guò)幾年的實(shí)踐,客戶對(duì)軟件開(kāi)發(fā)商提出了更多的要求。與加密軟件產(chǎn)品剛上市時(shí)前一兩年各軟件廠商各持一詞不同,經(jīng)過(guò)市場(chǎng)的幾番磨煉,客戶和廠商對(duì)透明加密軟件有了更加統(tǒng)一的認(rèn)識(shí)。5. 設(shè)計(jì)說(shuō)明傳統(tǒng)的周邊防御,比如防火墻、入侵檢測(cè)和防病毒軟件,已經(jīng)不再能夠解決很多今天的數(shù)據(jù)保護(hù)問(wèn)題。為了加強(qiáng)這些防御措施并且滿足短期相關(guān)規(guī)范的要求,許多公司對(duì)于數(shù)據(jù)安全紛紛采取了執(zhí)行多點(diǎn)產(chǎn)品的戰(zhàn)術(shù)性措施。這種片面的部署計(jì)劃確實(shí)可以為他們的數(shù)據(jù)提供一點(diǎn)點(diǎn)額外的保護(hù),但是在管理上花費(fèi)昂貴并且操作困難,這種做法并不能為未來(lái)的發(fā)展提供一個(gè)清晰的框架。加密是確保數(shù)據(jù)安全最重要的環(huán)節(jié)。必須確保數(shù)據(jù)加密而不是僅僅依賴一個(gè)防護(hù)基礎(chǔ)架構(gòu)。對(duì)數(shù)據(jù)進(jìn)行加密可以讓數(shù)據(jù)不論是在網(wǎng)絡(luò)中活動(dòng)、在數(shù)據(jù)庫(kù)和電腦中靜止或者在工作站中被使用的時(shí)候都能防患于未然。6. 源代碼主窗體: using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms;namespace WindowsFormsApplication1 public partial class Form1 : Form public Form1() InitializeComponent(); private void md5ToolStripMenuItem_Click(object sender, EventArgs e) md5 md51 = new md5(); md51.Show(); private void dES加密解密ToolStripMenuItem_Click(object sender, EventArgs e) des des1 = new des(); des1.Show(); private void rSA加密解密ToolStripMenuItem_Click(object sender, EventArgs e) rsa rsa1 = new rsa(); rsa1.Show(); private void 幫助ToolStripMenuItem_Click(object sender, EventArgs e) help h = new help(); h.Show(); Cryptography類(lèi):using System;using System.Security.Cryptography;using System.IO;using System.Text;using System.Globalization;using System.Xml.Linq;using System.Collections.Generic;namespace WindowsFormsApplication1 class Encrypter /DES默認(rèn)密鑰向量 private static byte DES_IV = 0x12, 0x34, 0x56, 0x78, 0x90, 0xAB, 0xCD, 0xEF ; public static string EncryptByMD5(string input) MD5 md5Hasher = MD5.Create(); byte data = md5Hasher.ComputeHash(Encoding.UTF8.GetBytes(input); StringBuilder sBuilder = new StringBuilder(); for (int i = 0; i data.Length; i+) sBuilder.Append(datai.ToString(x2); return sBuilder.ToString(); public static string EncryptByDES(string input, string key) byte inputBytes = Encoding.UTF8.GetBytes(input); byte keyBytes = ASCIIEncoding.UTF8.GetBytes(key); byte encryptBytes = EncryptByDES(inputBytes, keyBytes, keyBytes); using (DES des = new DESCryptoServiceProvider() using (MemoryStream ms = new MemoryStream() using (CryptoStream cs = new CryptoStream(ms, des.CreateEncryptor(), CryptoStreamMode.Write) using (StreamWriter writer = new StreamWriter(cs) writer.Write(inputBytes); string result = Convert.ToBase64String(encryptBytes); return result; public static byte EncryptByDES(byte inputBytes, byte key, byte IV) DES des = new DESCryptoServiceProvider(); des.Key = key; des.IV = IV; string result = string.Empty; using (MemoryStream ms = new MemoryStream() using (CryptoStream cs = new CryptoStream(ms, des.CreateEncryptor(), CryptoStreamMode.Write) cs.Write(inputBytes, 0, inputBytes.Length); return ms.ToArray(); public static string DecryptByDES(string input, string key) byte inputBytes = Convert.FromBase64String(input); byte keyBytes = ASCIIEncoding.UTF8.GetBytes(key); byte resultBytes = DecryptByDES(inputBytes, keyBytes, keyBytes); string result = Encoding.UTF8.GetString(resultBytes); return result; public static byte DecryptByDES(byte inputBytes, byte key, byte iv) DESCryptoServiceProvider des = new DESCryptoServiceProvider(); des.Key = key; des.IV = iv; using (MemoryStream ms = new MemoryStream(inputBytes) using (CryptoStream cs = new CryptoStream(ms, des.CreateDecryptor(), CryptoStreamMode.Read) using (StreamReader reader = new StreamReader(cs) string result = reader.ReadToEnd(); return Encoding.UTF8.GetBytes(result); public static string EncryptString(string input, string sKey) byte data = Encoding.UTF8.GetBytes(input); using (DESCryptoServiceProvider des = new DESCryptoServiceProvider() des.Key = ASCIIEncoding.ASCII.GetBytes(sKey); des.IV = ASCIIEncoding.ASCII.GetBytes(sKey); ICryptoTransform desencrypt = des.CreateEncryptor(); byte result = desencrypt.TransformFinalBlock(data, 0, data.Length); return BitConverter.ToString(result); public static string DecryptString(string input, string sKey) string sInput = input.Split(-.ToCharArray(); byte data = new bytesInput.Length; for (int i = 0; i sInput.Length; i+) datai = byte.Parse(sInputi, NumberStyles.HexNumber); using (DESCryptoServiceProvider des = new DESCryptoServiceProvider() des.Key = ASCIIEncoding.ASCII.GetBytes(sKey); des.IV = ASCIIEncoding.ASCII.GetBytes(sKey); ICryptoTransform desencrypt = des.CreateDecryptor(); byte result = desencrypt.TransformFinalBlock(data, 0, data.Length); return Encoding.UTF8.GetString(result); public static string EncryptByRSA(string plaintext, string publicKey) UnicodeEncoding ByteConverter = new UnicodeEncoding(); byte dataToEncrypt = ByteConverter.GetBytes(plaintext); using (RSACryptoServiceProvider RSA = new RSACryptoServiceProvider() RSA.FromXmlString(publicKey); byte encryptedData = RSA.Encrypt(dataToEncrypt, false); return Convert.ToBase64String(encryptedData); public static string DecryptByRSA(string ciphertext, string privateKey) UnicodeEncoding byteConverter = new UnicodeEncoding(); using (RSACryptoServiceProvider RSA = new RSACryptoServiceProvider() RSA.FromXmlString(privateKey); byte encryptedData = Convert.FromBase64String(ciphertext); byte decryptedData = RSA.Decrypt(encryptedData, false); return byteConverter.GetString(decryptedData); public static string HashAndSignString(string plaintext, string privateKey) UnicodeEncoding ByteConverter = new UnicodeEncoding(); byte dataToEncrypt = ByteConverter.GetBytes(plaintext); using (RSACryptoServiceProvider RSAalg = new RSACryptoServiceProvider() RSAalg.FromXmlString(privateKey); /使用SHA1進(jìn)行摘要算法,生成簽名 byte encryptedData = RSAalg.SignData(dataToEncrypt, new SHA1CryptoServiceProvider(); return Convert.ToBase64String(encryptedData); public static bool VerifySigned(string plaintext, string SignedData, string publicKey) using (RSACryptoServiceProvider RSAalg = new RSACryptoServiceProvider() RSAalg.FromXmlString(publicKey); UnicodeEncoding ByteConverter = new UnicodeEncoding(); byte dataToVerifyBytes = ByteConverter.GetBytes(plaintext); byte signedDataBytes = Convert.FromBase64String(SignedData); return RSAalg.VerifyData(dataToVerifyBytes, new SHA1CryptoServiceProvider(), signedDataBytes); public static KeyValuePair CreateRSAKey() RSACryptoServiceProvider RSA = new RSACryptoServiceProvider(); string privateKey = RSA.ToXmlString(true); string publicKey = RSA.ToXmlString(false); return new KeyValuePair(publicKey, privateKey); public static byte GetBytes(string input) string sInput = input.Split(-.ToCharArray(); byte inputBytes = new bytesInput.Length; for (int i = 0; i sInput.Length; i+) inputBytesi = byte.Parse(sInputi, NumberStyles.HexNumber); return inputBytes; using System;using System.Collections.Gen

溫馨提示

  • 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

最新文檔

評(píng)論

0/150

提交評(píng)論