实验一 DES算法应用

上传人:我*** 文档编号:136408498 上传时间:2020-06-28 格式:DOC 页数:5 大小:65.50KB
返回 下载 相关 举报
实验一 DES算法应用_第1页
第1页 / 共5页
实验一 DES算法应用_第2页
第2页 / 共5页
实验一 DES算法应用_第3页
第3页 / 共5页
实验一 DES算法应用_第4页
第4页 / 共5页
实验一 DES算法应用_第5页
第5页 / 共5页
亲,该文档总共5页,全部预览完了,如果喜欢就下载吧!
资源描述

《实验一 DES算法应用》由会员分享,可在线阅读,更多相关《实验一 DES算法应用(5页珍藏版)》请在金锄头文库上搜索。

1、实验一 DES算法应用一、实验目的1. 学会并实现DES算法2. 理解对称密码体制的基本思想3. 掌握数据加密和解密的基本过程二、实验内容根据DES加密标准,用C+设计编写符合DES算法思想的加、解密程序,能够实现对字符串和数组的加密和解密。三、实验的原理美国IBM公司W. Tuchman 和 C. Meyer 1971-1972年研制成功。1967年美国Horst Feistel提出的理论。美国国家标准局(NBS)1973年5月到1974年8月两次发布通告,公开征求用于电子计算机的加密算法。经评选从一大批算法中采纳了IBM的LUCIFER方案。DES算法1975年3月公开发表,1977年1月

2、15日由美国国家标准局颁布为联邦数据加密标准(Data Encryption Standard),于1977年7月15日生效。为二进制编码数据设计的,可以对计算机数据进行密码保护的数学运算。DES的保密性仅取决于对密钥的保密,而算法是公开的。 64位明文变换到64位密文,密钥64位,实际可用密钥长度为56位。四、实验代码/ DES 加解密算法.cpp : Defines the class behaviors for the application./#include stdafx.h#include DES 加解密算法.h#include DES 加解密算法Dlg.h#ifdef _DEBU

3、G#define new DEBUG_NEW#undef THIS_FILEstatic char THIS_FILE = _FILE_;#endif/ CDESAppBEGIN_MESSAGE_MAP(CDESApp, CWinApp)/AFX_MSG_MAP(CDESApp)/ NOTE - the ClassWizard will add and remove mapping macros here./ DO NOT EDIT what you see in these blocks of generated code!/AFX_MSGON_COMMAND(ID_HELP, CWinAp

4、p:OnHelp)END_MESSAGE_MAP()/ CDESApp constructionCDESApp:CDESApp()/ TODO: add construction code here,/ Place all significant initialization in InitInstance/ The one and only CDESApp objectCDESApp theApp;/ CDESApp initializationBOOL CDESApp:InitInstance()AfxEnableControlContainer();/ Standard initiali

5、zation/ If you are not using these features and wish to reduce the size/ of your final executable, you should remove from the following/ the specific initialization routines you do not need.#ifdef _AFXDLLEnable3dControls();/ Call this when using MFC in a shared DLL#elseEnable3dControlsStatic();/ Cal

6、l this when linking to MFC statically#endifCDESDlg dlg;m_pMainWnd = &dlg;int nResponse = dlg.DoModal();if (nResponse = IDOK)/ TODO: Place code here to handle when the dialog is/ dismissed with OKelse if (nResponse = IDCANCEL)/ TODO: Place code here to handle when the dialog is/ dismissed with Cancel/ Since the dialog has been closed, return FALSE so that we exit the/ application, rather than start the applications message pump.return FALSE;五、运行结果是:六、思考1影响DES密码体制安全的因素主要是密钥的健壮性。2DES密码体制中加密算法和解密算法流程相同,区别在于解密使用的子密钥和加密的子密钥相反

展开阅读全文
相关资源
正为您匹配相似的精品文档
相关搜索

最新文档


当前位置:首页 > 办公文档 > 事务文书

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