53
111/03/30 EMB project 1 Breaking Classical Ciphers Cunsheng Ding Mordecai Golin HKUST, Hong Kong

2015/6/3EMB project1 Breaking Classical Ciphers Cunsheng Ding Mordecai Golin HKUST, Hong Kong

  • View
    221

  • Download
    0

Embed Size (px)

Citation preview

112/04/18 EMB project 1

Breaking Classical Ciphers

Cunsheng Ding Mordecai Golin

HKUST, Hong Kong

112/04/18 EMB project 2

Agenda for Today

• More on breaking monoalphabetic substitution ciphers

• Breaking Vigenere ciphers

112/04/18 EMB project 3

Breaking Monoalphabetic Substitution Ciphers

112/04/18 EMB project 4

Monoalphabetic Substitution Ciphers

• Assign to each plaintext letter a different coding letter to ensure correct decryption.

• 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 z • u v w c a b x y z q p o r s t e f g l m n d h i j

k

• Today we look into monoalphabetic substitution ciphers (plaintext)

• MTCUJ HA OTTP ZSMT RTSTUOEYUVAMZW LNVLMZMNMZTS WZEYAGL (ciphertext)

112/04/18 EMB project 5

Frequency of Letters

• Letters in order of frequency (highest to lowest):

• E T A O N R I S H D L F C M U G Y P W B V K X J Q Z

• The letters can be grouped further by their frequencies: – Very Common: E – Common: T– Next most common: A O N R I S– Less Common: H– Less Common Still: D L F C M U– Rare: V K X J Q Z

112/04/18 EMB project 6

Frequency of Digrams• Most common pairs of letters (digrams), in

order of frequency:• TH HE AN RE ER IN ON AT ND ST ES EN OF

TE ED OR TI HI AS TO AR OU IS IT LE NT RI SE HA AL DE EA NE RO OM IO WE VE TA TR CO ME NG MA CE RA IC NS UT US BE UN CH WA SI LA AD LI RT CA NC SO NC SO LL UR EL RS EM AC IM PR TT OT WI EC

• The most common words in English are:• THE OF AND TO IN A IS THAT FOR IT BY A

RE BE WAS AS HE WITH HIS

112/04/18 EMB project 7

Ciphertext from a Monoalphebetic Substitution Cipher

• WNWHXHPBJIHGXHNWFOUBXHUX QIJCODILNDBOLWONOLJBHA, UIFMGVBW MHBPXJOBNT XUIFIABONODWDBYHWXXGGMOXY, "AIHXWJX NDXAIIY IFYYWTOQDXH TIMUIMFYYIXUIFIAT EMONVXUWMOX BNQWOZMH." NDIOXBHDBO LJIZXOOBIHGBADN IHUXDWPX WHWFTSXYXUIOTONXGO LMJXFTZIJ NDXBHNXFFXUNMWF UDWFFXHAX, VMNNIYWTNDXBJQIJC DWOWHMJAXHUTNIBN. NDXTJXNMJH NIW ZIJXONNDXT DWYQIJCXYBH, IHFTNIZBHY BNUDILLXYYIQH; NDXTDXWJIFYXJUIFFXWAMXOJXGBHBOUX WVIMNVBJYOFWON OXXHYXUWYXOWAI; NDXTQWFCIHLXJGWZJION NMJHXYGMODT VTAFIVWFQWJGBHA.

• WOYXOUJBVXY BHNDBOOLXUBWFBOOMX, NDXQIJFYBOHIQ MHYXJ-AIBHA WJXGWJCWVFXOXN IZNJWHOBNBIHO: LILMFWNBIH AJIQNDDWO JXWUDXYWH BHZFXUNBIHLIBHN WHYBOONWJNBHA NIFXPXFIZZ, NDXYXPXFILBHA QIJFYBOVXUIGBHAYXPXFILXY, WHYXHPBJIHGXHNWF LJIVFXGONDWN MOXYNIVXFIUWF-BSXY WJXJWYBWNBHA XPXJTQDXJX. NDXBHNXJUIHHXUNXY UDWHAXOWJX, BHYXGIAJWLDXJ EIOXLDUDWGBX'OQIJYO, W "KMBXNJXPI-FMNBIH" NDWNJXWUDXO BHNIXPXJT UIJHXJIZFBZX. NDXTLIOXNDJXWNO VMNWFOIIZZXJ ILLIJNMHBNBXO. DWPBHAOXXH ZBJONDWHYQDWN BODWLLXHBHA, NDXWMNDIJO IZNDXWJNBUFXO DXJXDWPXNDJIQH NDXGOXFPXOBHNI NDXNWOCIZ DXFLBHAOIUBXNT HWPBAWNXNDX ODIWFOWDXWY.

112/04/18 EMB project 8

Our Task Today

• We shall break this cipher. • We were told that the original plaintext is in Englis

h and was encrypted with a one-to-one mapping from the English alphabet to itself.

• We can see that some spaces between words and punctuation were deleted, while other spaces between words and punctuation are kept.

• We shall use the tools at the URL:– http://cryptoclub.math.uic.edu/indexmain.html

112/04/18 EMB project 9

Step 1

Compute the frequency distributions of single letters and digrams using the online software at

the URL:http://cryptoclub.math.uic.edu/indexmain.html

112/04/18 EMB project 10

Frequency of Letters: Comparison

• In message In English • X: 13.0 e: 12.7

• I: 8.3 t: 9.1

• N: 8.3 a: 8.2

• W: 7.5 i: 7.0

• H: 7.0 n: 6.7

• O: 6.9 o: 6.3

• B: 6.7 h: 6.1

• J: 6.0 r: 6.0

• D: 5.8 d: 4.3

• F: 4.4 q: 4.3

• Y: 4.0 l: 4.0

• U: 3.1 c: 2.8

• M: 2.7 u: 2.8

• In message In English• A: 2.6 m: 2.4

• L: 2.4 w: 2.3

• T: 2.1 f: 2.2

• G: 1.8 s: 2.2

• Z: 1.8 g: 2.0

• Q: 1.7 y: 2.0

• P: 1.5 p: 1.9

• V: 1.4 b: 1.5

• C: 0.6 v: 1.0

• E: 0.2 k: 0.8

• S: 0.2 j: 0.2

• K: 0.1 x: 0.1

• R: 0.0 z: 0.1

112/04/18 EMB project 11

Most Common Digraphs

• In message: – ND, DX, BH, DW, JX, XJ, IH, HA, XY, XH

• In English: – th, he, in, er, ed, an, nd, ar, re, en

112/04/18 EMB project 12

Step 2

Look at specialities in the ciphertext(Since some spaces between words and some

punctuation symbols are kept, the most important thing is to look for special

indications)

112/04/18 EMB project 13

Looking for Indications in Ciphertext

• Read the ciphertext carefully, and write down any piece of valuable information you obtain from reading the ciphertext.

• Let me know what you have discovered.

112/04/18 EMB project 14

Looking for Indications in Ciphertext

• In the ciphertext we have the following: • BHYXGIAJWLDXJ EIOXLDUDWGBX'OQIJYO, W

"KMBXNJXPI-FMNBIH"

• What can you infer from it?

112/04/18 EMB project 15

Indications in Ciphertext

• In the ciphertext we have the following: • BHYXGIAJWLDXJ EIOXLDUDWGBX'OQIJYO, W

"KMBXNJXPI-FMNBIH"

• What can you infer from it? – “O s” or “X s” (not consistent with

the frequency distribution of single letters)

– “W a”

112/04/18 EMB project 16

Step 3

Looking at the frequency distributions of single letters and digrams

112/04/18 EMB project 17

Looking at Most Common Digraphs

• In message: – ND, DX, BH, DW, JX, XJ, IH, HA, XY, XH

• In English: – th, he, in, er, ed, an, nd, ar, re, en

• What can you tell from this statistics?

112/04/18 EMB project 18

Looking at Most Common Digraphs

• In message: – ND, DX, BH, DW, JX, XJ, IH, HA, XY, XH

• In English: – th, he, in, er, ed, an, nd, ar, re, en

• What can you tell from this statistics?– It is very likely that “Dh”, “Xe”, “Nt”

– This is more or less consistent with the frequency distribution of single letters.

112/04/18 EMB project 19

The first Guess

• Combining what we have on Page 15 and Page 18, we first guess the following: – W a

– Dh

– Xe

– Nt

– Os

112/04/18 EMB project 20

After the First Guess

• ataHeHPBJIHGeHtaFsUBeHUe QIJCshILthBsLastsLJBHA, UIFMGVBa MHBPeJsBtT eUIFIABstshahBYHaeeGGMseY, "AIHeaJe theAIIY IFYYaTsQheH TIMUIMFYYIeUIFIAT EMstVeUaMse BtQasZMH." thIseBHhBs LJIZessBIHGBAht IHUehaPe aHaFTSeYeUIsTsteGs LMJeFTZIJ theBHteFFeUtMaF UhaFFeHAe, VMttIYaTtheBJQIJC hasaHMJAeHUTtIBt. theTJetMJH tIa ZIJesttheT haYQIJCeYBH, IHFTtIZBHY BtUhILLeYYIQH; theTheaJIFYeJUIFFeaAMesJeGBHBsUe aVIMtVBJYsFast seeHYeUaYesaAI; theTQaFCIHLeJGaZJIst tMJHeYGMshT VTAFIVaFQaJGBHA.

• asYesUJBVeY BHthBssLeUBaFBssMe, theQIJFYBsHIQ MHYeJ-AIBHA aJeGaJCaVFeset IZtJaHsBtBIHs: LILMFatBIH AJIQthhas JeaUheYaH BHZFeUtBIHLIBHt aHYBsstaJtBHA tIFePeFIZZ, theYePeFILBHA QIJFYBsVeUIGBHAYePeFILeY, aHYeHPBJIHGeHtaF LJIVFeGsthat MseYtIVeFIUaF-BSeY aJeJaYBatBHA ePeJTQheJe. theBHteJUIHHeUteY UhaHAesaJe, BHYeGIAJaLheJ EIseLhUhaGBe'sQIJYs, a "KMBetJePI-FMtBIH" thatJeaUhes BHtIePeJT UIJHeJIZFBZe. theTLIsethJeats VMtaFsIIZZeJ ILLIJtMHBtBes. haPBHAseeH ZBJsthaHYQhat BshaLLeHBHA, theaMthIJs IZtheaJtBUFes heJehaPethJIQH theGseFPesBHtI thetasCIZ heFLBHAsIUBetT HaPBAatethe shIaFsaheaY.

112/04/18 EMB project 21

What Shell We do Now

• After the first guess and first replacement, we should check if there is anything wrong in the partially decrypted text.

• If YES, this means that some part in our first guess must be wrong. So modification of the first guess should be done.

• If the partially decrypted text looks okay, we should try to get information on the partially decrypted text.

112/04/18 EMB project 22

Anything Wrong in the Text: Page 20?

• If yes, tell me what is wrong? • If no, look for further information in the text of

Page 20.

112/04/18 EMB project 23

Seeking Information on Page 20

• The short phrase: “tIa” on page 20 – It cannot be “tea”,

because “Xe” already.

– Hence it should be two words, and thus “to a”.

– Thus “Io”

• Then look at the short phrase: “shoaFsaheaY” – The only possibility is

“shoals ahead” – Hence, “Fl”, “Yd”

• The second guess– Io– Fl– Yd

112/04/18 EMB project 24

The Second Guess

• The First guess– W a

– Dh– Xe– Nt– Os

• The second guess– Io– Fl– Yd

112/04/18 EMB project 25

After the Second Guess

• ataHeHPBJoHGeHtalsUBeHUe QoJCshoLthBsLastsLJBHA, UolMGVBa MHBPeJsBtT eUoloABstshahBdHaeeGGMsed, "AoHeaJe theAood olddaTsQheH ToMUoMlddoeUoloAT EMstVeUaMse BtQasZMH." thoseBHhBs LJoZessBoHGBAht oHUehaPe aHalTSedeUosTsteGs LMJelTZoJ theBHtelleUtMal UhalleHAe, VMttodaTtheBJQoJC hasaHMJAeHUTtoBt. theTJetMJH to a ZoJesttheT hadQoJCedBH, oHlTtoZBHd BtUhoLLeddoQH; theTheaJoldeJUolleaAMesJeGBHBsUe aVoMtVBJdslast seeHdeUadesaAo; theTQalCoHLeJGaZJost tMJHedGMshT VTAloValQaJGBHA.

• asdesUJBVed BHthBssLeUBalBssMe, theQoJldBsHoQ MHdeJ-AoBHA aJeGaJCaVleset oZtJaHsBtBoHs: LoLMlatBoH AJoQthhas JeaUhedaH BHZleUtBoHLoBHt aHdBsstaJtBHA tolePeloZZ, thedePeloLBHA QoJldBsVeUoGBHAdePeloLed, aHdeHPBJoHGeHtal LJoVleGsthat MsedtoVeloUal-BSed aJeJadBatBHA ePeJTQheJe. theBHteJUoHHeUted UhaHAesaJe, BHdeGoAJaLheJ EoseLhUhaGBe'sQoJds, a "KMBetJePo-lMtBoH" thatJeaUhes BHtoePeJT UoJHeJoZlBZe. theTLosethJeats VMtalsooZZeJ oLLoJtMHBtBes. haPBHAseeH ZBJsthaHdQhat BshaLLeHBHA, theaMthoJs oZtheaJtBUles heJehaPethJoQH theGselPesBHto thetasCoZ helLBHAsoUBetT HaPBAatethe shoals ahead.

112/04/18 EMB project 26

Anything Wrong in the Text: Page 25?

• If yes, tell me what is wrong? • If no, look for further information in the text of

Page 25.

112/04/18 EMB project 27

Any Indication on Page 25

• Look at the phrase “thetasCoZ” – It is most likely “the task of”

– Hence, “Ck”, “Zf”

– This is consistent with the frequency distribution of single letters.

112/04/18 EMB project 28

The Third Guess

• The First guess– W a

– Dh– Xe– Nt– Os

• The second guess– Io– Fl– Yd

• The third guess– Ck

– Zf

112/04/18 EMB project 29

After the Third Guess

• ataHeHPBJoHGeHtalsUBeHUe QoJkshoLthBsLastsLJBHA, UolMGVBa MHBPeJsBtT eUoloABstshahBdHaeeGGMsed, "AoHeaJe theAood olddaTsQheH ToMUoMlddoeUoloAT EMstVeUaMse BtQasfMH." thoseBHhBs LJofessBoHGBAht oHUehaPe aHalTSedeUosTsteGs LMJelTfoJ theBHtelleUtMal UhalleHAe, VMttodaTtheBJQoJk hasaHMJAeHUTtoBt. theTJetMJH to a foJesttheT hadQoJkedBH, oHlTtofBHd BtUhoLLeddoQH; theTheaJoldeJUolleaAMesJeGBHBsUe aVoMtVBJdslast seeHdeUadesaAo; theTQalkoHLeJGafJost tMJHedGMshT VTAloValQaJGBHA.

• asdesUJBVed BHthBssLeUBalBssMe, theQoJldBsHoQ MHdeJ-AoBHA aJeGaJkaVleset oftJaHsBtBoHs: LoLMlatBoH AJoQthhas JeaUhedaH BHfleUtBoHLoBHt aHdBsstaJtBHA tolePeloff, thedePeloLBHA QoJldBsVeUoGBHAdePeloLed, aHdeHPBJoHGeHtal LJoVleGsthat MsedtoVeloUal-BSed aJeJadBatBHA ePeJTQheJe. theBHteJUoHHeUted UhaHAesaJe, BHdeGoAJaLheJ EoseLhUhaGBe'sQoJds, a "KMBetJePo-lMtBoH" thatJeaUhes BHtoePeJT UoJHeJoflBfe. theTLosethJeats VMtalsooffeJ oLLoJtMHBtBes. haPBHAseeH fBJsthaHdQhat BshaLLeHBHA, theaMthoJs oftheaJtBUles heJehaPethJoQH theGselPesBHto thetaskof helLBHAsoUBetT HaPBAatethe shoals ahead.

112/04/18 EMB project 30

Anything Wrong in the Text: Page 29?

• If yes, tell me what is wrong? • If no, look for further information in the text of

Page 29.

112/04/18 EMB project 31

Any Indication on Page 29

• Look at the phrases “foJesttheT” and “VMttodaTtheBJQoJk”– It is very likely that “Jr”, “Ty”

– This is consistent with the frequency distribution of single letters.

112/04/18 EMB project 32

The Fourth Guess

• The First guess– W a

– Dh– Xe– Nt– Os

• The second guess– Io– Fl– Yd

• The third guess– Ck

– Zf • The fourth guess

– Jr – Ty

112/04/18 EMB project 33

After the Fourth Guess

• ataHeHPBroHGeHtalsUBeHUe QorkshoLthBsLastsLrBHA, UolMGVBa MHBPersBty eUoloABstshahBdHaeeGGMsed, "AoHeare theAood olddaysQheH yoMUoMlddoeUoloAy EMstVeUaMse BtQasfMH." thoseBHhBs LrofessBoHGBAht oHUehaPe aHalySedeUosysteGs LMrelyfor theBHtelleUtMal UhalleHAe, VMttodaytheBrQork hasaHMrAeHUytoBt. theyretMrH to a forestthey hadQorkedBH, oHlytofBHd BtUhoLLeddoQH; theyhearolderUolleaAMesreGBHBsUe aVoMtVBrdslast seeHdeUadesaAo; theyQalkoHLerGafrost tMrHedGMshy VyAloValQarGBHA.

• asdesUrBVed BHthBssLeUBalBssMe, theQorldBsHoQ MHder-AoBHA areGarkaVleset oftraHsBtBoHs: LoLMlatBoH AroQthhas reaUhedaH BHfleUtBoHLoBHt aHdBsstartBHA tolePeloff, thedePeloLBHA QorldBsVeUoGBHAdePeloLed, aHdeHPBroHGeHtal LroVleGsthat MsedtoVeloUal-BSed areradBatBHA ePeryQhere. theBHterUoHHeUted UhaHAesare, BHdeGoAraLher EoseLhUhaGBe'sQords, a "KMBetrePo-lMtBoH" thatreaUhes BHtoePery UorHeroflBfe. theyLosethreats VMtalsooffer oLLortMHBtBes. haPBHAseeH fBrsthaHdQhat BshaLLeHBHA, theaMthors oftheartBUles herehaPethroQH theGselPesBHto the task of helLBHAsoUBety HaPBAatethe shoals ahead.

112/04/18 EMB project 34

Anything Wrong in the Text: Page 33?

• If yes, tell me what is wrong? • If no, look for further information in the text of

Page 33.

112/04/18 EMB project 35

Any Indication from Page 33

• Look at the phrase “"AoHeare theAood olddaysQheH ” – It is very likely that “Ag”

– This is consistent with the frequency distribution of single letters.

• Look at the phrase “oftheartBUles”– It is very likely that “Bi” and “Uc”

112/04/18 EMB project 36

The Fifth Guess

• The First guess– W a

– Dh– Xe– Nt– Os

• The second guess– Io– Fl– Yd

• The third guess– Ck

– Zf • The fourth guess

– Jr – Ty

• The fifth guess– A g– Bi– Uc

112/04/18 EMB project 37

After the Fifth Guess

• ataHeHPiroHGeHtalscieHce QorkshoLthisLastsLriHg, colMGVia MHiPersity ecologistshahidHaeeGGMsed, "goHeare thegood olddaysQheH yoMcoMlddoecology EMstVecaMse itQasfMH." thoseiHhis LrofessioHGight oHcehaPe aHalySedecosysteGs LMrelyfor theiHtellectMal challeHge, VMttodaytheirQork hasaHMrgeHcytoit. theyretMrH to a forestthey hadQorkediH, oHlytofiHd itchoLLeddoQH; theyhearoldercolleagMesreGiHisce aVoMtVirdslast seeHdecadesago; theyQalkoHLerGafrost tMrHedGMshy VygloValQarGiHg.

• asdescriVed iHthissLecialissMe, theQorldisHoQ MHder-goiHg areGarkaVleset oftraHsitioHs: LoLMlatioH groQthhas reachedaH iHflectioHLoiHt aHdisstartiHg tolePeloff, thedePeloLiHg QorldisVecoGiHgdePeloLed, aHdeHPiroHGeHtal LroVleGsthat MsedtoVelocal-iSed areradiatiHg ePeryQhere. theiHtercoHHected chaHgesare, iHdeGograLher EoseLhchaGie'sQords, a "KMietrePo-lMtioH" thatreaches iHtoePery corHeroflife. theyLosethreats VMtalsooffer oLLortMHities. haPiHgseeH firsthaHdQhat ishaLLeHiHg, theaMthors ofthearticles herehaPethroQH theGselPesiHto the task of helLiHgsociety HaPigatethe shoals ahead.

112/04/18 EMB project 38

Anything Wrong in the Text: Page 37?

• If yes, tell me what is wrong? • If no, look for further information in the text of

Page 37.

112/04/18 EMB project 39

Any Indication from Page 37

• Look at the phrase “asdescriVed ” – “Vb”

• Look at the phrase “challeHge, ”– “Hn”

• Look at the phrase “iHthissLecialissMe”– “Lp”

– “Mu”

112/04/18 EMB project 40

After the Sixth Replacement on Page 39

• atanenPironGentalscience Qorkshopthispastspring, coluGbia uniPersity ecologistshahidnaeeGGused, "goneare thegood olddaysQhen youcoulddoecology Eustbecause itQasfun." thoseinhis professionGight oncehaPe analySedecosysteGs purelyfor theintellectual challenge, buttodaytheirQork hasanurgencytoit. theyreturn to a forestthey hadQorkedin, onlytofind itchoppeddoQn; theyhearoldercolleaguesreGinisce aboutbirdslast seendecadesago; theyQalkonperGafrost turnedGushy byglobalQarGing.

• asdescribed inthisspecialissue, theQorldisnoQ under-going areGarkableset oftransitions: population groQthhas reachedan inflectionpoint andisstarting tolePeloff, thedePeloping QorldisbecoGingdePeloped, andenPironGental probleGsthat usedtobelocal-iSed areradiating ePeryQhere. theinterconnected changesare, indeGographer EosephchaGie'sQords, a "KuietrePo-lution" thatreaches intoePery corneroflife. theyposethreats butalsooffer opportunities. haPingseen firsthandQhat ishappening, theauthors ofthearticles herehaPethroQn theGselPesinto the task of helpingsociety naPigatethe shoals ahead.

112/04/18 EMB project 41

Anything Wrong in the Text: Page 40?

• If yes, tell me what is wrong? • If no, look for further information in the text of

Page 40.

112/04/18 EMB project 42

Any Indication from Page 40

• Look at the phrase “Qorkshopthispastspring” – “Qw”

• Look at the phrase “thedePeloping”– “Pv”

• Look at the phrase “coluGbia university”– “Gm”

• Finally– “Sz”

– “EJ

– “Kq”

112/04/18 EMB project 43

Then We have

• atanenvironmentalscience workshopthispastspring, columbia university ecologistshahidnaeemmused, "goneare thegood olddayswhen youcoulddoecology justbecause itwasfun." thoseinhis professionmight oncehave analyzedecosystems purelyfor theintellectual challenge, buttodaytheirwork hasanurgencytoit. theyreturn to a forestthey hadworkedin, onlytofind itchoppeddown; theyhearoldercolleaguesreminisce aboutbirdslast seendecadesago; theywalkonpermafrost turnedmushy byglobalwarming.

• asdescribed inthisspecialissue, theworldisnow under-going aremarkableset oftransitions: population growthhas reachedan inflectionpoint andisstarting toleveloff, thedeveloping worldisbecomingdeveloped, andenvironmental problemsthat usedtobelocal-ized areradiating everywhere. theinterconnected changesare, indemographer josephchamie'swords, a "quietrevo-lution" thatreaches intoevery corneroflife. theyposethreats butalsooffer opportunities. havingseen firsthandwhat ishappening, theauthors ofthearticles herehavethrown themselvesinto the task of helpingsociety navigatethe shoals ahead.

112/04/18 EMB project 44

The Decrypted Text

• At an environmental science workshop this past spring, Columbia University ecologist Shahid Naeem mused, "Gone are the good old days when you could do ecology just because it was fun." Those in his profession might once have analyzed ecosystems purely for the intellectual challenge, but today their work has an urgency to it. They return to a forest they had worked in, only to find it chopped down; they hear older colleagues reminisce about birds last seen decades ago; they walk on permafrost turned mushy by global warming. As described in this special issue, the world is now under-going a remarkable set of transitions: population growth has reached an inflection point and is starting to level off, the developing world is becoming developed, and environmental problems that used to be local-ized are radiating everywhere. The interconnected changes are, in demographer Joseph Chamie's words, a "quiet revo-lution" that reaches into every corner of life. They pose threats but also offer opportunities. Having seen firsthand what is happening, the authors of the articles here have thrown themselves into the task of helping society navigate the shoals ahead.

112/04/18 EMB project 45

Summary of Part I

• In case of no spaces between words and no punctuation in the ciphertext, it may be hard to break a substitution cipher.

• It is very hard at the beginning. Special signs and short words should be investigated first.

• Statistics of single letter frequency and that of digrams should then be used.

• A guess could be wrong. Avoid wrong guesses. • Start and end of sentences are highest priority. • In the project assignment, we will keep some spaces betwee

n words, and some punctuation symbols, in order to reduce the difficulty.

112/04/18 EMB project 46

Breaking Vigenere Ciphers

112/04/18 EMB project 47

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 z---------------------------------------------------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 ZB C D E F G H I J K L M N O P Q R S T U V W X Y Z AC D E F G H I J K L M N O P Q R S T U V W X Y Z A BD E F G H I J K L M N O P Q R S T U V W X Y Z A B CE F G H I J K L M N O P Q R S T U V W X Y Z A B C DF G H I J K L M N O P Q R S T U V W X Y Z A B C D EG H I J K L M N O P Q R S T U V W X Y Z A B C D E FH I J K L M N O P Q R S T U V W X Y Z A B C D E F GI J K L M N O P Q R S T U V W X Y Z A B C D E F G HJ K L M N O P Q R S T U V W X Y Z A B C D E F G H IK L M N O P Q R S T U V W X Y Z A B C D E F G H I JL M N O P Q R S T U V W X Y Z A B C D E F G H I J KM N O P Q R S T U V W X Y Z A B C D E F G H I J K LN O P Q R S T U V W X Y Z A B C D E F G H I J K L MO P Q R S T U V W X Y Z A B C D E F G H I J K L M NP Q R S T U V W X Y Z A B C D E F G H I J K L M N OQ R S T U V W X Y Z A B C D E F G H I J K L M N O PR S T U V W X Y Z A B C D E F G H I J K L M N O P QS T U V W X Y Z A B C D E F G H I J K L M N O P Q RT U V W X Y Z A B C D E F G H I J K L M N O P Q R SU V W X Y Z A B C D E F G H I J K L M N O P Q R S TV W X Y Z A B C D E F G H I J K L M N O P Q R S T UW X Y Z A B C D E F G H I J K L M N O P Q R S T U VX Y Z A B C D E F G H I J K L M N O P Q R S T U V WY Z A B C D E F G H I J K L M N O P Q R S T U V W XZ 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

Vigenere T

able

112/04/18 EMB project 48

Example of Encryption

• Key: h o l d h o l d h o l d h o l d h o• Plaintext: t h i s i s t h e p l a i n t e x t • Ciphertext: a v t v p g e k l d w d p b e h d h• Demo for encryption using the tools in the URL• keyword: hold • keyword length: 4 • A Veginere cipher is a combination of a number of

Casesar ciphers• The main task of breaking a Veginere cipher is to d

etermine the keyword length.

112/04/18 EMB project 49

How to Find the Keyword Length

• YBRWY JFM N QCGYFR GIL SUZJX WJMFJ. NUJ VVL VBDM VS NUJ HRNAUGIEMIBI WBSMGFHGQS GJUFJX UNG. FTGRYCZJM GMYL TZSJLRI BVR U PMIVHY OJNJJYA F HVHERQ UAI U QNGR. OYFXY NQQNDM GTIX YBR SCPPYY-FZGJL NQF, VY QNX VVLARW. NUJ VVL VBDM YFOTMYQ FHQ QUHLBRI. IAJ XND USYYE OYFXY TWUOGYQ YBR SCPPYY, MCF KUGMYE YIBP BVR UFNXR FHQ XUVI, "DRXMR, YBBXY OTSF FLR RUXNHTKOA TZ LTO. GMYL YBVSE LTO QTH'G PHBB NUJ XVRY VX QBWNU RIEJ NUFH GMY ANWXJF." WJMFJ AENHAJX NSX FFCQ, "IIA'Y QBWLL IUQ. N EATQ JMCPM CF BIEYB ZTLR. GOG NZ V YIBP NUJ XVRY, GMYL BIHQX FYIC IIVSA VY. MB KUE N'PR HIYQYPYYQ $10 IIYQUEX."

112/04/18 EMB project 50

How to Find the Keyword Length

• If you can find strings of letters that repeat in a message, you can often figure out the key length.

• The distance between repeated strings is usually a multiple of the key length.

• A good guess for key length is a common factor of the distances between strings.

112/04/18 EMB project 51

• Repeated String Distance • WJMFJ 315 • NUJ 12, 129, 138,

93 • VVL 132, 9 • VBDM 141 • GMYL 204, 120 • BVR 147 • OYFXY 81 • YBR 141, 78 • SCPPYY 78 • PYY 78, 215 • FHQ 63 • YIBP 159 • LTO 12 • XVRY 93 • GMY 150, 54, 42,

78 • QBW 45 • IYQ 9

• What is the keyword length?

• Let us now get back for the decryption

112/04/18 EMB project 52

Here is the original plaintext

• There was a little boy named Jesse. The big boys in the neighborhood constantly teased him. Sometimes they offered him a choice between a nickel and a dime. Jesse always took the nickel, after all it was bigger. The big boys laughed and laughed. One day after Jesse grabbed the nickel, his father took him aside and said, Jesse, “Those boys are making fun of you. They think you don’t know the dime is worth more than the nickel.” Jesse grinned and said, “Don’t worry, dad. I know which is worth more. But if i took the dime, they would stop doing it. So far I’ve collected $10 dollars.”

112/04/18 EMB project 53

Summary of Part II

• Vigenere cipher is just a combination of Caesar cipher.

• Finding the keyword length is the main task. (We have the web-based computer program to find the repeated words and their distances.)

• This example of Vigenere cipher is easier to break than the first example, partly because spaces and punctuation are kept.