密码学-关键词加密法.ppt
《密码学-关键词加密法.ppt》由会员分享,可在线阅读,更多相关《密码学-关键词加密法.ppt(53页珍藏版)》请在淘文阁 - 分享文档赚钱的网站上搜索。
1、经典单码加密法经典单码加密法KeywordCipherv1.selectakeyword-ifanylettersarerepeateddropthesecondandallotheroccurrencesfromthekeywordv1.选择一个关键词,如果这个关键词中有重复的字母,则去除第一次出现之外的所有相同字母。v2.writethekeywordbelowthealphabet,fillintherestofthespacewiththeremaininglettersinthealphabetintheirstandardorderv2.将关键词写在字母表的下方,并用字母表中除了关
2、键词之外的其他字母按标准的顺序填写余下的空间。ExamplevThekeywordisMAGICNETABCDEFGHIJKLMNOPQRSTUVWXYZplaintextplaintextciphertextciphertextCNETBFDJHLKPORQUSWVXZYIMAG这样的话这样的话,明文字母明文字母A就由密文字母就由密文字母M来替换来替换,B则由则由A来替换,来替换,.明文:明文:HELPIAMLOST密文:密文:TCHOBMJHLRSExercisevThekeywordisCOUNTABCDEFGHIJKLMNOPQRSTUVWXYZplaintextplaintextci
3、phertextciphertextTABDEGFIHKJMLQPSRWVXZYNCOUStartingPositionvThekeyworddoesnothavetostartatthebeginningoftheplaintextalphabet(关键词不从第一字母开始)itcouldstartatanyletterforexample,“count”couldstartat“k”ciphertextciphertextTABDEGFIHKJLMQPSRWVXZYNCOUABCDEFGHIJKLMNOPQRSTUVWXYZplaintextplaintextExamplevIfthekey
4、wordis“visit”(note,thesecond“i”invisitisdroppedbelow)startingat“a”andtheplaintextis“next”,theapplicationis:ABCDEFGHIJKLMNOPQRSTUVWXYZplaintextplaintextciphertextciphertextLMNOPRQWUYXZVSIATCBDFEKGHJN E X TN E X TK K A A X XQ QKeywordinCAPv运行CAP软件,输入一些明文,然后从Cipher菜单选取Keyword菜单项,将弹出一个KeywordCipher窗口。关键
5、词加密法的分析法关键词加密法的分析法v关键词加密法当然比简单移位加密法功能更强,因为要尝试所有的关键词及其位置,显然比所有25种移位加密密钥要困难得多。v这种攻击法的原理就是计算机用字典中的每个词进行尝试,直至找到一个能破解该加密法的为止。v用穷举查找攻击法(即尝试所有可能的关键词)在今天也是可行的,但不是可取的。BreakingaKeywordvThekeywordcipherisnotsecure,infactitiseasytobreakvOnereasonwhyitisusefultostudysuchacipheristhatinordertobreakthiscipheryoumu
6、stusesomeofthemostfundamentaltoolsofcryptanalysis(破译关键词密码需要一些密码分析基本工具)ChallengevConsiderasimplemonoalphabetickeywordsubstitutionciphersuchasthefollowing:GJXXNGGOTZNUCOTWMOHYJTKTAMTXOBYNFGOGINUGJFNZVQHYNGNEAJFHYOTWGOTHYNAFZNFTUINZBNFGNLNFUTXNXUFNEJCINHYAZGAEUTUCQGOGOTHJOHOATCJXKHYNUVOCOHQUHCNUGHHAFNU
7、ZHYNCUTWJUWNAEHYNAFOWOTUCHNPHOGLNFQZNGOFUVCNZJHTAHNGGNTHOUCGJXYOGHYNABNTOTWGNTHNTXNAEBUFKNFYOHHGIUTJUCEAFHYNGACJHOATAEIOCOHUFQXOBYNFGBasicCryptanalysisvThemostbasicobservationofcryptanalysisisthateveryletterofalanguagehasapersonalityofitsownifeveryplaintexttischangedtoaciphertextm,thenintheciphertex
8、t,massumesthepersonalityofttothetrainedobserver,thepersonalityofalettergivesawayitsidentity对训练有素的观察者来说,字母的特性揭示了其真实面目。vSomeofthesepersonalitycharacteristicsare:frequencyofoccurrencecontactwithotherletterspositionwithinwords字母的特性主要有:出现的频率、与其他字母的联系、在单词中的位置。LetterFrequencyvWhatisthemostfrequentletterinE
9、nglish?vActuallythefrequencydependsonthetypeoftext.Awidelyusedfrequencytableof400lettersofstandardEnglish(英文字母的频率)Letter:A B C D E F G H I J K L M N O P Q Count:32 6 12 16 42 8 6 24 26 2 2 14 12 28 32 8 1 Letter:R S T U V W X Y Z Count:26 24 36 12 4 6 2 8 1 In Order:ETAONIRSH DLUCMPFYWGB VJKQXZLette
10、rFrequencyvThefrequencycountforthechallengetextis:A B C D E F G H I J K L M N O P Q R S T U V W X Y Z17 4 13 0 7 17 23 26 5 12 3 2 2 36 25 1 5 0 0 23 20 3 6 9 13 8 We could compare this with the expected frequency:Standard:ETAONIRSHDLUCMPFYWGBVJKQXZ Cipher:NHOGTUAFCYJXZEWIQBKVLMPDRS(密文)(密文)Result:OL
11、UUE OOANC EIHAN PJATD.However,while relative frequencies may shift slightly,(i may be more frequent than a),they do not stray far from their area in the frequency tableLetterFrequencyv当然,这只是个概数,不会与每篇文章的字母出现频率完全一样,通常越短的信息的字母频率与上面的相比就越不相符,越短的信息也就越难破解了。如:John,ajazzist,willgotoJapaninJunetojoinajazzpart
12、y.其中,J的百分比是12.8,出现6次,而E的百分比是0,对其进行频率分析就毫无意义。又如:UOCTXH.若明码表ABCDEFGHIJKLMNOPQRSTUVWXYZ密码表QWERTYUIOPASDFGHJKLZXCVBNM则它被翻译为GIVEUP.但若明码表ABCDEFGHIJKLMNOPQRSTUVWXYZ密码表QWUETRYIXPASCHOMDFGJKLZVBN则它被翻译为COMEIN.究竟哪个是真的,不得而知。但当它放进一篇文章里,就可从前后推知它应怎样翻译了。FrequencyGroupsvHighFrequencyGroupETAONIRSHvMediumFrequencyGro
13、upDLUCMvLowFrequencyGroupPFYWGBVvRareGroupJKQXZ字母在分组中的位置可能会字母在分组中的位置可能会字母在分组中的位置可能会字母在分组中的位置可能会发生变化,但很少会出现在发生变化,但很少会出现在发生变化,但很少会出现在发生变化,但很少会出现在其他的分组中去。其他的分组中去。其他的分组中去。其他的分组中去。SingleFrequencyReasoningvThingstolookforinafrequencyreportIftherearehillsandvalleyssimilartostandardEnglishthenthecipherismos
14、tlikelyasubstitution,so(密文字母频率的高峰低谷部分)Findthebreakbetweenhighfrequencyandmediumfrequency(lookfora2%dropbetweentwoletters)Themostfrequentletterisprobably“e”oratleast“t”or“a”WARNING:this is only useful if you have enough text to maintain the“average”picture of frequency distributionsFrequencyReportvAg
15、ainconsiderthefrequencycountforthechallenge:N H O G T U A F C Y J X Z E W I Q B K V L M P D R S36 26 25 23 23 20 17 17 13 13 12 9 8 7 6 5 5 4 3 3 2 2 1 0 0 0Where is the break-that is,which set of characters are in the Where is the break-that is,which set of characters are in the high frequency grou
16、p?high frequency group?Out of the possible high frequency group which is e?Out of the possible high frequency group which is e?ChallengeDigramsvThischartliststhedigramsformedbythemostfrequentlettersintheciphertext:First task-identify(or confirm)eFirst task-identify(or confirm)eN is a good possibilit
17、y by frequency countsN also contacts more characters than any other(17-look at the full digram table)N H O G T U A FN 0 3 0 4 1 0 1 3H 1 2 4 2 4 1 1 2O 0 4 0 6 1 0 0 1G 5 1 4 2 0 2 0 3T 4 2 7 0 0 4 2 1U 5 1 1 0 3 0 0 2A 5 1 2 2 3 0 0 0F 7 0 1 0 0 3 4 0确定字母EConsonants(辅音)(辅音)vTheeasiesttospotisNbecau
18、se80%ofthelettersthatprecedenarevowels(字母N前的字母80%为元音字母)lookforahighfrequencyletterwhichmostoftenfollowsavowelforthechallengetext,Tfollowsoneofthevowels(N,O,U,A)17outof23timesvhfrequentlyappearsbeforeeandalmostneverafterit(h通常在e前)inthechallenge,thepairYNoccursfrequentlybutNYneveroccursvthiscommonifYi
19、sreallyh,thenHmustbetbecausethiscommon有用的经验有用的经验ththhehe组合非常常见组合非常常见组合非常常见组合非常常见CurrentStatus(当前状态)(当前状态)vUsingourbestguess,thekeylookslike plain:A B C D E F G H I J K L M N O P Q R S T U V W X Y Zcipher:UNY OT AH1.ht,yh,ne二连三连2.Tn(ot,nt较多)3.otin还是oton?4.Ua,A-oChallengeTextG J X X N G G O T Z N U C
20、O T W M O H Y J T K T A M T X O B Y N F G O G I N U G E I N E A I N I T H N N O N I H E I E AJ F N Z V Q H Y N G N E A J F H Y O T W G O T H Y N A F Z N F T U I N Z A N F G E T H E E O T H I N I N T H E O E N A E O EN L N F U T X N X U F N E J C I N H Y A Z G A E U T U C Q G O G O T H J O H O AE E A
21、 E A E E T H O O A N A I I N T I T I OT C J X K H Y N U V O C O H Q U H C N U G H H A F N U Z H YN T H E A I I T A T E A T T O E A T HWheel of Fortune Time-are there any words?Update plain:A B C D E F G H I J K L M N O P Q R S T U V W X Y Zcipher:U N Y O T A HG J X X N G G O T Z N U C O T W M O H Y
22、J T K T A M T X O B Y N F G O G I N U G E I N E A I N I T H N N O N I H E I E AJ F N Z V Q H Y N G N E A J F H Y O T W G O T H Y N A F Z N F T U I N Z A N F G E T H E E O T H I N I N T H E O E N A E O EN L N F U T X N X U F N E J C I N H Y A Z G A E U T U C Q G O G O T H J O H O AE E A E A E E T H O
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 密码学 关键词 加密
限制150内