您好,欢迎访问三七文档
CryptographyMeasurestohidethestructureoftheplaintext隐藏明文的结构措施•Encryptmultiplelettersofplaintextatonetime,i.e.blockcipher(e.g.PlayfairCipher,HillCipher).•Usemultiplecipheralphabet(morethanonesubstitutioninencryptionanddecryption),e.g.VigenereCipher.••加密明文的多个字母,即分组密码(例如公平联盟密码,希尔密码)。•使用多个密码字母(不止一个替换加密和解密),例如Vigenere密码。2.2SubstitutionTechniques:PlayfairCipher•Thebest-knownmultiple-letterencryptioncipher.•Encryptspairsofletters(digrams)insteadofsinglelettersatatime.•ItwasinventedbyBritishscientistCharlesWheatstonein1854,butnamedafterhisfriendLyonPlayfair(BaronPlayfairofSt.Andrews)whopromoteditsuse.•最著名multiple-letter加密密码。•加密对字母(根据)而不是单个字母。•它是英国发明的科学家查尔斯·惠斯登在1854年,但他的朋友的名字命名的里昂公平联盟(男爵公平联盟圣安德鲁斯)晋升其使用。CharlesWheatstone(1802~1875)PlayfairCipher公平联盟密码•Thealgorithmisbasedontheuseofa5*5matrixoflettersconstructedusingakeyword.Thestepsofconstructingthematrixareasfollows:a)Chooseakeyword(bettertobelong)b)Fillinlettersofkeyword(no,duplicates,minusrepeatedones),e.g.“october”“octber”;c)Fillintherestspaceofthematrixwiththeremaininglettersinalphabeticorder;-lefttoright,toptodownd)ThelettersIandJcountasoneletter,(sometimesomitletter“Q”or“X”).•使用的算法是基于一个5*5矩阵构造使用关键字的字母。构建矩阵的步骤如下:)选择一个关键字(好长)b)填写关键字的字母(不,重复,减去重复的),例如“十月”“10月”;c)填写其余空间矩阵的剩下的字母在字母表顺序;——从左到右,从上到下来d)我和J算作一个字母的字母,(有时省略字母“Q”或“X”)。KeyMatrixForexample:keyword=MONARCHYMONARCHYBDEFGI/JKLPQSTUVWXZPlayfairCipherPlaintextisencryptedaccordingthefollowingrules:a)Dividetheplaintextintotwo-lettergroups.!Whenthenumberoflettersisodd,addan“x”totheend.明文加密根据以下规则:把明文分成两组。!当字母的数量是奇数,添加一个“x”。example:wearediscovered,saveyourself.wearediscoveredsaveyourselfx.!Whenrepeatingplaintextlettersappearsinthesamepair,theninsertafillerletter“x”betweenthem,e.g.balloonballoonxbalxloon;spellspellx;!当重复明文字母出现在相同的一对,然后插入一个填料字母“x”,PlayfairCipherb)ifbothlettersfallinthesamerowofmatrix,replaceeachbythelettertotheright(wrappingbacktostartfromend),e.g.oaNR,raMR.c)ifbothlettersfallinthesamecolumn,replaceeachwiththeletterbelowit(againwrappingtotopfrombottom),e.g.clEU,ulMU.2)如果两个字母下降矩阵的同一行,替换每个字母向右(包装结束),如oaaNRraaMR。c)如果两个字母下降同一列,取代再次与它下面的信包装上从下),例如claEUulaMU。MONARCHYBDEFGI/JKLPQSTUVWXZPlayfairCipherd)ifthelettersfallneitherinthesamerownorinthesamecolumn,replaceeachbytheletterliesinitsownrowbutthecolumnoccupiedbytheotherletterofthepair,e.g.hsBP,eaIM(orJM).d)如果字母下降在同一行或同一列,取代每个的在于自己的行,但列占用的其他信,如hsaBP,eaaIM(JM)。MONARCHYBDEFGI/JKLPQSTUVWXZExerciseExercise1:Usethekeyword“shandong”toencrypttheplaintext“wearediscovered,saveyourself”.练习1:使用关键字“山东”加密明文“我们被发现,拯救自己”。ExerciseDecryptionworksinthereversedirection.Exercise2:UsethekeyworkDEATHtodecrypttheciphertext解密在相反的方向。练习2:使用keywork死亡解密密文“MEIKQOTXCQTEZXCOMWQCTEHNFBIKMEHAKRQCUNGIKMAV”Answer:LaboulayeladywillleadtoCibolaTemplesofgold.SecurityofPlayfairCipher公平联盟安全密码•Isplayfaircipherimprovedthanmono-alphabeticcipher?answer:Yes!☆Therelativefrequencyofindividuallettersisequalityexhibitedinciphertext,whichmakingfrequencyanalysismuchmoredifficult.☆thereare26*26=676digrams☆Theidentificationofindividualdigramismoredifficult.Itneedstoanalyzefrequencyfor676digramsatmost(vs.26formonoalphabeticcipher).•比mono-alphabetic公平联盟密码改进密码吗?答:是的!☆个人信件是平等的相对频率在密文,使频率分析更加困难。☆有26*26=676根据所用☆个人连字的识别更为困难。它需要分析频率676根据(和26种单密码)。SecurityofPlayfairCipher•Itwasconsideredunbreakableforalongtime.•WidelyusedbyBritish&U.S.ArmyinWorldWarIandotheralliedforcesinWorldWarII.•BUTactually,PlayfairCiphercanbebroken(givenafewhundredlettersofciphertextaresufficient),becausethestructureoftheplaintextstillsurviveintheciphertext.••它长期被认为是牢不可破的。•广泛使用由英国和美国军队在第一次世界大战和其他盟军在第二次世界大战。•但实际上,公平联盟密码可以被打破(给定一个几百封密文就足够了),因为明文的结构仍然生存的密文。
本文标题:playfair
链接地址:https://www.777doc.com/doc-4920423 .html