资源描述:
《-it实验9-统计分析攻击实验》由会员上传分享,免费在线阅读,更多相关内容在学术论文-天天文库。
1、云南大学数学与与统计学院上机实践报告一、实验目的理解古典密码学、统计分析攻击、信息熵与密码体制的关系二、实验内容1.古典密码体制Caesar密码的编程(参阅数据结构与算法主讲课教材的3.1.4节)2.任取一段较长的且有意义的英文片段,计算其明文熵。3.用Caesar密码加密上述英文片段,计算其密文熵。4.奔阅英文字母的频度分介规律,对上述密文进行统计分析攻击。三、实验环境个人计算机,Java平台对于非信息与汁算科学专业的宁生,可以选择任意编程平台四、实验记录与实验结果分析Caesar密码基本思想:通过把字母移动一定的位数来实现加密和解密。明文中的
2、所有字母都在字母表上向后(或向前)按照一个固定数H进行偏移后被替换成密文。例如,当偏移量是3的时候,所有的字母A将被替换成D,B变成E,以此类推X将变成A,Y变成B,Z变成C。由此可见,位数就是凯撒密码加密和解密的密钥。所选英文八段:Xi’anwasoncecalled‘‘Chang’an”intheHanDynasty.Theconnotationofthisnameis“permanentpeace”.Xi’anmarkedthestartingpointoftheworldfamousSilkRoad.Itobtaineditspresen
3、tnameintheyear1369.Xi’anranksfirstonthelistofthecountry’ssevenlargestancientcapitals.From11thcenturyB.C.onwards,andforaslongasmorethan1100years,Xi’anwassuccessivelyestablishedasthecapitalcityby15kingdomsorfeudaldynasties,includingtheWesternZhou,theQin,theHan,theSuiandtheTang.
4、Itservesasanancientcapitalcitybeyondcomparisonwithregardtothenumberofdynastiesandspanoftime.Anditwasregardedasoneofthe“FourAncientCapitalsoftheWorld”,theotherthreebeingRome,Athens,andIstanbul.运行结果:加密输入0,解密输入1:0明文字符串:Xi'anwasoncecalled‘‘Chang’an”intheHanDynasty.Theconnotationo
5、fthisnameis“permanentpeace”•Xi’anmarkedthestartingpointoftheworldfamousSilkRoad.Itobtaineditspresentnameintheyear1369.Xi’anranksfirstonthelistofthecountry’ssevenlargestancientcapitals.From11thcenturyB.C.onwards,andforaslongasmorethan1100years,Xi’anwassuccessivelyestablishedas
6、thecapitalcityby15kingdomsorfeudaldynasties,includingtheWesternZhou,theQin,theHan,theSuiandtheTang.Itservesasanancientcapitalcitybeyondcomparisonwithregardtothenumberofdynastiesandspanoftime.Anditwasregardedasoneofthe“FourAncientCapitalsoftheWorld”,theotherthreebeingRome,Athe
7、ns,andIstanbul.移动位数:3所得密文为:str=ATdqzdvrqfhfdoohg“Fkdqj’dq”lqwkhKdqGbqdvwb.Wkhfrqqrwdwlrqriwklvqdphlv“shupdqhqwshdfh”•ATdqpdunhgwkhvwduwlqjsrlqwriwkhzruogidprxvVIonUrdg.Lwrewdlqhglwvsuhvhqwqdphlqwkhbhdu1369.Al’dqudqnviluvwrqwkholvwriwkhfrxqwub’vvhyhqodujhvwdqflhqwfdslwdov.Iurp
8、1lwkfhqwxubE.F.rqzdugv,dqgirudvorqjdvpruhwkdq1100bhduv,Al'dqzdvvxffh