欢迎来到天天文库
浏览记录
ID:55633544
大小:65.50 KB
页数:5页
时间:2020-05-21
《实验一 DES算法应用.doc》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、实验一DES算法应用一、实验目的1.学会并实现DES算法2.理解对称密码体制的基本思想3.掌握数据加密和解密的基本过程二、实验内容根据DES加密标准,用C++设计编写符合DES算法思想的加、解密程序,能够实现对字符串和数组的加密和解密。三、实验的原理美国IBM公司W.Tuchman和C.Meyer1971-1972年研制成功。1967年美国HorstFeistel提出的理论。美国国家标准局(NBS)1973年5月到1974年8月两次发布通告,公开征求用于电子计算机的加密算法。经评选从一大批算法中采纳了IBM的LUCI
2、FER方案。DES算法1975年3月公开发表,1977年1月15日由美国国家标准局颁布为联邦数据加密标准(DataEncryptionStandard),于1977年7月15日生效。为二进制编码数据设计的,可以对计算机数据进行密码保护的数学运算。DES的保密性仅取决于对密钥的保密,而算法是公开的。64位明文变换到64位密文,密钥64位,实际可用密钥长度为56位。四、实验代码//DES加解密算法.cpp:Definestheclassbehaviorsfortheapplication.//#include"stdaf
3、x.h"#include"DES加解密算法.h"#include"DES加解密算法Dlg.h"#ifdef_DEBUG#definenewDEBUG_NEW#undefTHIS_FILEstaticcharTHIS_FILE[]=__FILE__;#endif///////////////////////////////////////////////////////////////////////////////CDESAppBEGIN_MESSAGE_MAP(CDESApp,CWinApp)//{{AFX_MSG
4、_MAP(CDESApp)//NOTE-theClassWizardwilladdandremovemappingmacroshere.//DONOTEDITwhatyouseeintheseblocksofgeneratedcode!//}}AFX_MSGON_COMMAND(ID_HELP,CWinApp::OnHelp)END_MESSAGE_MAP()///////////////////////////////////////////////////////////////////////////////C
5、DESAppconstructionCDESApp::CDESApp(){//TODO:addconstructioncodehere,//PlaceallsignificantinitializationinInitInstance}///////////////////////////////////////////////////////////////////////////////TheoneandonlyCDESAppobjectCDESApptheApp;////////////////////////
6、///////////////////////////////////////////////////////CDESAppinitializationBOOLCDESApp::InitInstance(){AfxEnableControlContainer();//Standardinitialization//Ifyouarenotusingthesefeaturesandwishtoreducethesize//ofyourfinalexecutable,youshouldremovefromthefollow
7、ing//thespecificinitializationroutinesyoudonotneed.#ifdef_AFXDLLEnable3dControls();//CallthiswhenusingMFCinasharedDLL#elseEnable3dControlsStatic();//CallthiswhenlinkingtoMFCstatically#endifCDESDlgdlg;m_pMainWnd=&dlg;intnResponse=dlg.DoModal();if(nResponse==IDOK
8、){//TODO:Placecodeheretohandlewhenthedialogis//dismissedwithOK}elseif(nResponse==IDCANCEL){//TODO:Placecodeheretohandlewhenthedialogis//dismissedwithCancel}//Sincethedialogh
此文档下载收益归作者所有