Share
Embed
Crypto: 500 BC - Present (sorta)
A 60-minute overview of content from The Code Book by Simon Singh, covering secrecy from ancient Greece to Enigma machines used in World War II. This is a cursory, high-level, mostly-non-mathematical survey of centuries of crypto - good as an intro to crypto for developers and non-devs alike.
luke crouch
March 24, 2017
Transcript
250 slides
-
Math I don’t like it It’s too easy to get
wrong DO NOT TRY TO MAKE YOUR OWN CRYPTO BE EXTRA CAREFUL WITH HOW YOU USE CRYPTO -
499 BCE Histiaeus of Miletus shaves head of messengers to
write to Aristagoras re: revolt against Persians -
480 BCE Demaratus writes into wood covered with wax re:
Xerxes’ pending attack -
First “Invisible Ink”, 1st c. AD Pliny the Elder Milk
of tithymalus plant Heat-activated -
Strength of a transpositional cipher For example, consider this short
sentence 35 letters 50,000,000,000,000,000,000,000,000,000,000 distint arrangements 1 check/second = 1,500,000,000,000,000,000,000,000 years (1 trillion billion years) -
Drawbacks of random transpositional cipher Impossible for intended recipient too
False positives: which anagram is right? -
Rail fence cipher Algorithm: Message written diagonally Key: Across N
rows http://crypto.interactive-maths.com/rail-fence-cipher.html -
Rail fence cipher http://crypto.interactive-maths.com/rail-fence-cipher.html They are attacking from the north
TEKOOHRACIRMNREATANFTETYTGHH -
Breaking rail fence cipher http://crypto.interactive-maths.com/rail-fence-cipher.html Key Search/“Brute Force” T ry
a bunch of numbers of rows by hand -
Scytale, ~700 BCE - 120 AD Cylinder with parchment wound
around it T ranspositional cipher or Partial/Hidden writing -
Scytale, ~700 BCE - 120 AD Algorithm Wrap message around
a cylinder Key Diameter of cylinder -
Breaking a Scytale Key Search/“Brute Force” T ry a bunch
of cylinders Re-arrange lines -
Hebrew “Atbash” Cipher Plain alphabet: תשרקצפעסנמלכיטחזוהדגבא Cipher alphabet: אבגדהוזחטיכלמנסעפצקרשת Aleph
(first) T av (last) Beth (second) Shin (second-to-last) -
Atbash Cipher “and the king of Sheshach shall drink after
them” –Jeremiah 25:26 “Behold, I will raise up against Babylon…” –Jeremiah 51:1 “How Sheshach is taken…” –Jeremiah 51:41 -
Caesar Cipher, 49 - 44 BC Algorithm Replace each letter
with another letter K positions down the alphabet K Julius = 3 Augustus = 1 -
Non-shifted/Random Caesar Cipher Algorithm Replace each letter with another letter
K Any Cipher Alphabet -
Non-shifted Substitutional Cipher 26 letters to re-arrange 400,000,000,000,000,000,000,000,000 possible re-arrangements
120,000,000,000,000,000,000 years at 1 check/s Key = easy to implement; hard to break -
Easy to memorize key Plain alphabet: abcdefghijklmnopqrstuvwxyz Cipher alphabet: JULISCAERTVWXYZBDFGHKMNOPQ
Key phrase JULIUS CAESAR JULISCAER Note: slightly fewer possible keys -
ةامعملا بتكلا جارختسا يف ةلاسر (On Decrypting Encrypted Correspondence) يدنكلا
حاّبصلا قاحسإ نب بوقعي فسوي وبأ (Abu Yūsuf Yaʻqūb ibn ʼIsḥāq aṣ-Ṣabbāḥ al-Kindī) Al-Kindi 801-873 AD -
“Rqh zdb wr vroyh dq hqfubswhg phvvdjhv, li zh nqrz
lwv odqjxdjh, lv wr ilqg d gliihuhqw sodlqwhaw ri wkh vdph odqjxdjh orqj hqrxjk wr iloo rqh vkhhw ru vr, dqg wkhq zh frxqw wkh rffxuuhqfhv ri hdfk oetteu. Zh fdoo wkh prvw iuhtxhqwob rffxuulqj oetteu wkh ‘iluvw’, wkh qhaw prvw rffxuulqj oetteu wkh ‘vhfrqg’, wkh iroorzlqj prvw rffxuulqj oetteu wkh ‘wklug’, dqg vr rq, xqwlo zh dffrxqw iru doo wkh gliihuhqw oetteuv lq wkh sodlqwhaw vdpsoh. Wkhq zh orrn dw wkh flskhu whaw zh zdqw wr vroyh dqg zh dovr fodvvlib lwv vbperov. Zh ilqg wkh prvw rffxuulqj vbpero dqg fkdqjh lw wr wkh irup ri wkh ‘iluvw’ oetteu ri wkh sodlqwhaw vdpsoh, wkh qhaw prvw frpprq vbpero lv fkdqjhg wr wkh irup ri wkh ‘vhfrqg’ oetteu, dqg wkh iroorzlqj prvw frpprq vbpero lv fkdqjhg wr wkh irup ri wkh ‘wklug’ oetteu, dqg vr rq, xqwlo zh dffrxqw iru doo vbperov ri wkh fubswrjudp zh zdqw wr vroyh.” -
“Rqh zdb wr vroyh dq hqfubswhg phvvdjhv, li zh nqrz
lwv odqjxdjh, lv wr ilqg d gliihuhqw sodlqwhaw ri wkh vdph odqjxdjh orqj hqrxjk wr iloo rqh vkeet ru vr, dqg wkhq zh frxqw wkh rffxuuhqfhv ri hdfk oetteu. Zh fdoo wkh prvw iuhtxhqwob rffxuulqj oetteu wkh ‘iluvw’, wkh qhaw prvw rffxuulqj oetteu wkh ‘vhfrqg’, wkh iroorzlqj prvw rffxuulqj oetteu wkh ‘wklug’, dqg vr rq, xqwlo zh dffrxqw iru doo wkh gliihuhqw oetteuv lq wkh sodlqwhaw vdpsoh. Wkhq zh orrn dw wkh flskhu whaw zh zdqw wr vroyh dqg zh dovr fodvvlib lwv vbperov. Zh ilqg wkh prvw rffxuulqj vbpero dqg fkdqjh lw wr wkh irup ri wkh ‘iluvw’ oetteu ri wkh sodlqwhaw vdpsoh, wkh qhaw prvw frpprq vbpero lv fkdqjhg wr wkh irup ri wkh ‘vhfrqg’ oetteu, dqg wkh iroorzlqj prvw frpprq vbpero lv fkdqjhg wr wkh irup ri wkh ‘wklug’ oetteu, dqg vr rq, xqwlo zh dffrxqw iru doo vbperov ri wkh fubswrjudp zh zdqw wr vroyh.” -
“Rqe zdb tr vrlye dq eqfrbsteg pevvdjev, li ze nqrz
ltv ldqjxdje, lv tr ilqg d gliiereqt sldlqteat ri tke vdpe ldqjxdje lrqj eqrxjk tr illl rqe vkeet rr vr, dqg tkeq ze frxqt tke rffxrreqfev ri edfk letter. Ze fdll tke prvt iretxeqtlb rffxrrlqj letter tke ‘ilrvt’, tke qeat prvt rffxrrlqj letter tke ‘vefrqg’, tke irllrzlqj prvt rffxrrlqj letter tke ‘tklrg’, dqg vr rq, xqtll ze dffrxqt irr dll tke gliiereqt letterv lq tke sldlqteat vdpsle. Wkeq ze lrrn dt tke flsker teat ze zdqt tr vrlye dqg ze dlvr fldvvlib ltv vbperlv. Ze ilqg tke prvt rffxrrlqj vbperl dqg fkdqje lt tr tke irrp ri tke ‘ilrvt’ letter ri tke sldlqteat vdpsle, tke qeat prvt frpprq vbperl lv fkdqjeg tr tke irrp ri tke ‘vefrqg’ letter, dqg tke irllrzlqj prvt frpprq vbperl lv fkdqjeg tr tke irrp ri tke ‘tklrg’ letter, dqg vr rq, xqtll ze dffrxqt irr dll vbperlv ri tke frbstrjrdp ze zdqt tr vrlye.” -
“One way to solve an encrypted messages, if we know
its language, is to find a different plaintext of the same language long enough to fill one sheet or so, and then we count the occurrences of each letter. We call the most frequently occurring letter the ‘first’, the next most occurring letter the ‘second’, the following most occurring letter the ‘third’, and so on, until we account for all the different letters in the plaintext sample. Then we look at the cipher text we want to solve and we also classify its symbols. We find the most occurring symbol and change it to the form of the ‘first’ letter of the plaintext sample, the next most common symbol is changed to the form of the ‘second’ letter, and the following most common symbol is changed to the form of the ‘third’ letter, and so on, until we account for all symbols of the cryptogram we want to solve.” –يدنكلا حاّبصلا قاحسإ نب بوقعي فسوي وبأ (Al-Kindi) -
“PCQ VMJYPD LBYK LYSO KBXBJXWXV BXV ZCJPO EYPD KBXBJYUXJ LBJOO
KCPK. CP LBO LBCMKXPV XPV IYJKL PYDBL, QBOP KBO BXV OPVOV LBO LXRO CI SX’XJMI, KBO JCKO XPV EYKKOV LBO DJCMPV ZOICJO BYS, KXUYPD: “DJOXL EYPD, ICJ X LBCMKXPV XPV CPO PYDBLK Y BXNO ZOOP JOACMPLYPD LC UCM LBO IXZROK CI FXKL XDOK XPV LBO RODOPVK CI XPAYOPL EYPDK. SXU Y SXEO KC ZCRV XK LC AJXNO X IXNCMJ CI UCMJ SXGOKLU?” –OFYRCDMO, LXROK IJCS LBO LBCMKXPV XPV CPO PYDBLK -
“PCQ” “XPV” “CPO” “aov” “tar” “oae” Plain alphabet: abcdefghijklmnopqrstuvwxyz Cipher
alphabet: P???O??YK????LC??VJX?Q???? -
Focus O = e, t, or a X = e,
t, or a P = e, t, or a -
More English frequency rules Vowels appear before and after most
other letters Consonants avoid many letters E.g., ‘e’ appears before/after virtually every other letter; while ’t’ is rarely seen before or after ‘b’, ‘d’, ‘g’, ‘j’, ‘k’, ‘m’, ‘q’, ‘v’ -
1 9 0 3 1 1 1 0 1 4
6 0 1 2 2 8 0 4 1 0 0 3 0 1 1 2 0 7 0 1 1 1 1 0 2 4 6 3 0 3 1 9 0 2 4 0 3 3 2 0 0 1 1 0 5 6 0 0 0 0 0 1 1 2 2 0 8 0 0 0 0 0 0 11 0 9 9 0 A B CDE F G H I J K LMNOPQR S TU V W X Y Z O X P “Neighbor” Frequency -
1 9 0 3 1 1 1 0 1 4
6 0 1 2 2 8 0 4 1 0 0 3 0 1 1 2 0 7 0 1 1 1 1 0 2 4 6 3 0 3 1 9 0 2 4 0 3 3 2 0 0 1 1 0 5 6 0 0 0 0 0 1 1 2 2 0 8 0 0 0 0 0 0 11 0 9 9 0 A B CDE F G H I J K LMNOPQR S TU V W X Y Z O X P Neighbor “Avoidance” i.e., Anti-Frequency so … -
O avoids 7 other letters completely X avoids 8 completely
P avoids 15 completely Neighbor “Avoidance” i.e., Anti-Frequency -
Cipher O = e or a X = e or
a P = t ? -
“PCQ VMJYPD LBYK LYSO KBXBJXWXV BXV ZCJPO EYPD KBXBJYUXJ LBJOO
KCPK. CP LBO LBCMKXPV XPV IYJKL PYDBL, QBOP KBO BXV OPVOV LBO LXRO CI SX’XJMI, KBO JCKO XPV EYKKOV LBO DJCMPV ZOICJO BYS, KXUYPD: “DJOXL EYPD, ICJ X LBCMKXPV XPV CPO PYDBLK Y BXNO ZOOP JOACMPLYPD LC UCM LBO IXZROK CI FXKL XDOK XPV LBO RODOPVK CI XPAYOPL EYPDK. SXU Y SXEO KC ZCRV XK LC AJXNO X IXNCMJ CI UCMJ SXGOKLU?” “OO” twice; “XX” never -
Cipher O = e X = a Y = i
P = t ? -
More English frequency rules ‘h’ frequently goes before ‘e’ but
rarely after ‘e’ -
1 0 0 1 0 1 0 0 1 0
4 0 0 0 2 5 0 0 0 0 0 2 0 1 0 0 0 9 0 2 1 0 1 0 0 4 2 0 1 2 2 3 0 4 1 0 0 1 0 0 1 2 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 after O/e before O/e “Neighbor” Frequency so … -
Cipher O = e X = a Y = i
B = h P = t ? -
“PCQ VMJiPD LhiK LiSe KhahJaWaV haV ZCJPe EiPD KhahJiUaJ LhJee
KCPK. CP Lhe LhCMKaPV aPV IiJKL PiDhL, QheP Khe haV ePVeV Lhe LaRe CI Sa’aJMI, Khe JCKe aPV EiKKeV Lhe DJCMPV ZeICJe hiS, KaUiPD: “DJeaL EiPD, ICJ a LhCMKaPV aPV CPe PiDhLK i haNe ZeeP JeACMPLiPD LC UCM Lhe IaZReK CI FaKL aDeK aPV Lhe ReDePVK CI aPAiePL EiPDK. SaU i SaEe KC ZCRV aK LC AJaNe a IaNCMJ CI UCMJ SaGeKLU?” –eFiRCDMe, LaReK IJCS Lhe LhCMKaPV aPV CPe PiDhLK -
“PCQ VMJiPD LhiK LiSe KhahJaWaV haV ZCJPe EiPD KhahJiUaJ LhJee
KCPK. CP Lhe LhCMKaPV aPV IiJKL PiDhL, QheP Khe haV ePVeV Lhe LaRe CI Sa’aJMI, Khe JCKe aPV EiKKeV Lhe DJCMPV ZeICJe hiS, KaUiPD: “DJeaL EiPD, ICJ a LhCMKaPV aPV CPe PiDhLK i haNe ZeeP JeACMPLiPD LC UCM Lhe IaZReK CI FaKL aDeK aPV Lhe ReDePVK CI aPAiePL EiPDK. SaU i SaEe KC ZCRV aK LC AJaNe a IaNCMJ CI UCMJ SaGeKLU?” –eFiRCDMe, LaReK IJCS Lhe LhCMKaPV aPV CPe PiDhLK “Lhe” 6 times -
“PCQ VMJiPD thiK tiSe KhahJaWaV haV ZCJPe EiPD KhahJiUaJ thJee
KCPK. CP the thCMKaPV aPV IiJKt PiDht, QheP Khe haV ePVeV the taRe CI Sa’aJMI, Khe JCKe aPV EiKKeV the DJCMPV ZeICJe hiS, KaUiPD: “DJeat EiPD, ICJ a thCMKaPV aPV CPe PiDhtK i haNe ZeeP JeACMPtiPD tC UCM the IaZReK CI FaKt aDeK aPV the ReDePVK CI aPAiePt EiPDK. SaU i SaEe KC ZCRV aK tC AJaNe a IaNCMJ CI UCMJ SaGeKtU?” –eFiRCDMe, taReK IJCS the thCMKaPV aPV CPe PiDhtK “aPV” 5 times -
“nCQ dMJinD thiK tiSe KhahJaWad had ZCJne EinD KhahJiUaJ thJee
KCnK. Cn the thCMKand and IiJKt niDht, Qhen Khe had ended the taRe CI Sa’aJMI, Khe JCKe and EiKKed the DJCMnd ZeICJe hiS, KaUinD: “DJeat EinD, ICJ a thCMKand and Cne niDhtK i haNe Zeen JeACMntinD tC UCM the IaZReK CI FaKt aDeK and the ReDendK CI anAient EinDK. SaU i SaEe KC ZCRd aK tC AJaNe a IaNCMJ CI UCMJ SaGeKtU?” –eFiRCDMe, taReK IJCS the thCMKand and Cne niDhtK “Cn” word needs vowel: ‘u’ or ‘o’ left -
“noQ dMJinD thiK tiSe KhahJaWad had ZoJne EinD KhahJiUaJ thJee
KonK. on the thoMKand and IiJKt niDht, Qhen Khe had ended the taRe oI Sa’aJMI, Khe JoKe and EiKKed the DJoMnd ZeIoJe hiS, KaUinD: “DJeat EinD, IoJ a thoMKand and one niDhtK i haNe Zeen JeAoMntinD to UoM the IaZReK oI FaKt aDeK and the ReDendK oI anAient EinDK. SaU i SaEe Ko ZoRd aK to AJaNe a IaNoMJ oI UoMJ SaGeKtU?” –eFiRoDMe, taReK IJoS the thoMKand and one niDhtK “Khe”; ’t’ already used -
“noQ dMJinD this tiSe shahJaWad had ZoJne EinD shahJiUaJ thJee
sons. on the thoMsand and IiJst niDht, Qhen she had ended the taRe oI Sa’aJMI, she Jose and Eissed the DJoMnd ZeIoJe hiS, saUinD: “DJeat EinD, IoJ a thoMsand and one niDhts i haNe Zeen JeAoMntinD to UoM the IaZRes oI Fast aDes and the ReDends oI anAient EinDs. SaU i SaEe so ZoRd as to AJaNe a IaNoMJ oI UoMJ SaGestU?” –eFiRoDMe, taRes IJoS the thoMsand and one niDhts “thoMsand and one niDhts” -
“noQ duJing this tiSe shahJaWad had ZoJne Eing shahJiUaJ thJee
sons. on the thousand and IiJst night, Qhen she had ended the taRe oI Sa’aJuI, she Jose and Eissed the gJound ZeIoJe hiS, saUing: “gJeat Eing, IoJ a thousand and one nights i haNe Zeen JeAounting to Uou the IaZRes oI Fast ages and the Regends oI anAient Eings. SaU i SaEe so ZoRd as to AJaNe a IaNouJ oI UouJ SaGestU?” –eFiRogue, taRes IJoS the thousand and one nights Rapid progress now … -
“duJing” “Qhen” “haNe” “Zeen” “anAient” Plain alphabet: abcdefghijklmnopqrstuvwxyz Cipher alphabet:
XZAVO?DBY????PC??JKLMNQ??? “during” “when” “have” “been” “ancient” -
“now during this tiSe shahraWad had borne Eing shahriUar three
sons. on the thousand and Iirst night, when she had ended the taRe oI Sa’aruI, she rose and Eissed the ground beIore hiS, saUing: “great Eing, Ior a thousand and one nights i have been recounting to Uou the IabRes oI Fast ages and the Regends oI ancient Eings. SaU i SaEe so boRd as to crave a Iavour oI Uour SaGestU?” –eFiRogue, taRes IroS the thousand and one nights -
“tiSe” “Iirst” “Eissed” “beIore” “saUing” “Fast” “Regends” Plain alphabet: abcdefghijklmnopqrstuvwxyz
Cipher alphabet: XZAVOIDBY?ERSPCF?JKLMNQ?U? “time” “first” “kissed” “before” “saying” “past” “legends” -
“now during this time shahraWad had borne king shahriyar three
sons. on the thousand and first night, when she had ended the tale of ma’aruf, she rose and kissed the ground before him, saying: “great king, for a thousand and one nights i have been recounting to you the fables of past ages and the legends of ancient kings. may i make so bold as to crave a favour of your maGesty?” –epilogue, tales from the thousand and one nights -
“now during this time shahra[qxzj]ad had borne king shahriyar three
sons. on the thousand and first night, when she had ended the tale of ma’aruf, she rose and kissed the ground before him, saying: “great king, for a thousand and one nights i have been recounting to you the fables of past ages and the legends of ancient kings. may i make so bold as to crave a favour of your ma[qxzj]esty?” –epilogue, tales from the thousand and one nights Plain alphabet: abcdefghijklmnopqrstuvwxyz Cipher alphabet: XZAVOIDBY?ERSPCF?JKLMNQ?U? -
Homophonic Substitution Cipher 1401 - Present (?) Multiple cipher symbols
per plaintext letter -
Homophonic Substitution Cipher Each cipher letter makes up ~1% of
the text Still vulnerable to some frequency analysis E.g., ’q’ is 1 letter usually followed by ‘u’ which is 3 letters Still more secure than mono-alphabetic substitution Key hard to memorize -
D M B X K I V A S Z
N P L Y F C J O R T E Q H WG U Z J D P A I Q H T WL F B G O X N H U K R C Y V S E 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 Polyalphabetic Substitution Cipher -
D M B X K I V A S Z
N P L Y F C J O R T E Q H WG U Z J D P A I Q H T WL F B G O X N H U K R C Y V S E 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 “secret” “R?????” Polyalphabetic Substitution Cipher -
D M B X K I V A S Z
N P L Y F C J O R T E Q H WG U Z J D P A I Q H T WL F B G O X N H U K R C Y V S E 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 “secret” “RA????” Polyalphabetic Substitution Cipher -
D M B X K I V A S Z
N P L Y F C J O R T E Q H WG U Z J D P A I Q H T WL F B G O X N H U K R C Y V S E 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 “secret” “RAB???” Polyalphabetic Substitution Cipher -
D M B X K I V A S Z
N P L Y F C J O R T E Q H WG U Z J D P A I Q H T WL F B G O X N H U K R C Y V S E “RABH??” 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 “secret” Polyalphabetic Substitution Cipher -
D M B X K I V A S Z
N P L Y F C J O R T E Q H WG U Z J D P A I Q H T WL F B G O X N H U K R C Y V S E “RABHK?” 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 “secret” Polyalphabetic Substitution Cipher -
D M B X K I V A S Z
N P L Y F C J O R T E Q H WG U Z J D P A I Q H T WL F B G O X N H U K R C Y V S E 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 “secret” “RABHKK” Polyalphabetic Substitution Cipher -
False frequencies ‘e’ is enciphered as both ‘A’ and ‘K’
‘K’ is deciphered as both ‘e’ and ‘t’ “secret” “RABHKK” -
Polyalphabetic ciphers are complex D M B X K I
V A S Z N P L Y F C J O R T E Q H WG U Z J D P A I Q H T WL F B G O X N H U K R C Y V S E 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 D M B X K I V A S Z N P L Y F C J O R T E Q H WG U Z J D P A I Q H T WL F B G O X N H U K R C Y V S E D M B X K I V A S Z N P L Y F C J O R T E Q H WG U Z J D P A I Q H T WL F B G O X N H U K R C Y V S E -
Machines to the rescue! Alberti Cipher Disk Outer disk stationary
Inner disk rotates Ciphertext contains key letters to control rotation -
Machine-Implemented Polyalphabetic Substitution Positives Unbreakable by (human) frequency analysis Easy
Negatives “Tricks”: e.g., ‘R2R’ needed to defend against double-letter frequencies expose those frequencies Switching logic contained in ciphertext -
How to apply an easy-to-memorize keyword to polyalphabetic cipher? Keyword
SECRET D M B X K I V A S Z N P L Y F C J O R T E Q H WG U Z J D P A I Q H T WL F B G O X N H U K R C Y V S E 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 -
Le Chiffre Indéchiffrable created by Blaise de Vigenère 1523 -
1596 Created new polyalphabetic encryption system -
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 1 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 2 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 3 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 4 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 5 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 6 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 7 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 8 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 9 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 10 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 11 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 12 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 13 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 14 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 15 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 16 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 17 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 18 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 19 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 20 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 21 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 22 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 23 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 24 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 25 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 26 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 -
Repeat keyword for all of text Plaintext: AttackFromTheSouthAtDawn Ciphertext: ????????????????????????
Keyword: SECRETSECRETSECRETSECRET -
Start with cipher at 1st letter of keyword Encrypt first
letter of plaintext Move to cipher at 2nd letter of keyword Encrypt second letter of plaintext etc. -
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 1 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 2 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 3 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 4 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 5 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 6 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 7 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 8 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 9 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 10 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 11 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 12 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 13 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 14 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 15 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 16 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 17 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 18 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 19 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 20 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 21 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 22 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 23 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 24 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 25 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 26 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 Ciphertext: S??????????????????????? Plaintext: AttackFromTheSouthAtDawn Keyword: SECRETSECRETSECRETSECRET -
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 1 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 2 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 3 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 4 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 5 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 6 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 7 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 8 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 9 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 10 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 11 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 12 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 13 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 14 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 15 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 16 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 17 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 18 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 19 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 20 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 21 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 22 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 23 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 24 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 25 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 26 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 Ciphertext: SX?????????????????????? Plaintext: AttackFromTheSouthAtDawn Keyword: SECRETSECRETSECRETSECRET -
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 1 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 2 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 3 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 4 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 5 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 6 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 7 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 8 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 9 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 10 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 11 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 12 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 13 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 14 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 15 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 16 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 17 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 18 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 19 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 20 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 21 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 22 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 23 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 24 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 25 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 26 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 Ciphertext: SXV????????????????????? Plaintext: AttackFromTheSouthAtDawn Keyword: SECRETSECRETSECRETSECRET -
The Great Cipher of Louis XIV created by Rossignol family
Antoine Rossignol (1600–1682) Bonaventure Rossignol Antoine-Bonaventure Rossignol After deaths, became un-used, and indecipherable -
The Great Cipher of Louis XIV Each number represents a
syllable 587 distinct numbers -
Who was the Man in the Iron Mask? 1890: Étienne
Bazeries deciphered a Great Cipher letter from Louis XIV’s Minister of War naming General Bulonde “to be conducted to the fortress of Pignerole, where he will be locked in a cell under guard at night, and permitted to walk the battlements during the day with a mask.” -
“Black Chambers” • 1700s • “Assembly-line” Cryptanalysis • Each European
power had one • Breaking all mono-alphabetic ciphers • Encouraged adoption of Vigenère Square for polyalphabetic ciphers -
Electric Telegraphs • 1800s • 29km b/w West Drayton &
Paddington railway stations • 60km b/w Baltimore & Washington DC -
Charles Babbage • 1791 - 1871 • 1854: Broke Vigenère
Cipher • Without machinery -
False SYMBOL frequencies • ‘e’ is enciphered as both ‘A’
and ‘K’ • ‘K’ is deciphered as both ‘e’ and ‘t’ “secret” “RABHKK” -
WORD FREQUENCIES • ‘the’ is enciphered as: • ‘DPR’ first
• ‘BUK’ next • ‘BUK’ next • i.e., repeated when word is displaced by a multiple of the key length -
Deciphering Vigenère • Look for repeated sequences of letters •
4 or more letters to filter out coincidences • Measure spacing between repetitions • Identify most likely length of key: L • Divide the cipher text into L individual sets of cipher text • Break each set by frequency analysis to find keyword -
REPETITIONS EFIQ, PSDLP, WCXYM, ETRL WUBEFIQLZURMVOFEHMYMWTIXCQTMPIFKRZUPMVOIRQMM WOZMPULMBNYVQQQMVMVJLEYMHFEFNZPSDLPPSDLPEVQM WCXYMDAVQEEFIQCAYTQOWCXYMWMSEMEFCFWYEYQETRLI QYCGMTWCWFBSMYFPLRXTQYEEXMRULUKSGWFPTLRQAERL UVPMVYQYCXTWFQLMTELSFJPQEHMOZCIWCIWFPZSLMAEZ
IQVLQMZVPPXAWCSMZMORVGVVQSZETRLQZPBJAZVQIYXE WWOICCGDWHQMMVOWSGNTJPFPPAYBIYBJUTWRLQKLLLMD PYVACDCFQNZPIFPPKSDVPTIDGXMQQVEBMQALKEZMGCVK UZKIZBZLIUAMMVZ -
spacing between repetitions Repetition Spacing Possible Length of Key 2
3 4 5 6 7 8 9 10 11 121314 15 1617181920 EFIQ 95 ✓ ✓ PSDLP 5 ✓ WCXYM 20 ✓ ✓ ✓ ✓ ✓ ETRL 120 ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ -
5 separate cipher texts WIREWQFPROLVVEESSV XVITXSCYLGWYXELWRL VXLSECWLQPSRQRBQCH OTPYWLCNPVGVAMZUZ WIREWQFPROLVVEESSV XVITXSCYLGWYXELWRL
VXLSECWLQPSRQRBQCH OTPYWLCNPVGVAMZUZ WIREWQFPROLVVEESSV XVITXSCYLGWYXELWRL VXLSECWLQPSRQRBQCH OTPYWLCNPVGVAMZUZ WIREWQFPROLVVEESSV XVITXSCYLGWYXELWRL VXLSECWLQPSRQRBQCH OTPYWLCNPVGVAMZUZ WIREWQFPROLVVEESSV XVITXSCYLGWYXELWRL VXLSECWLQPSRQRBQCH OTPYWLCNPVGVAMZUZ Break each with frequency analysis -
To decrypt it, one finds the word corresponding to the
number (e.g., the first number is 115, and the 115th word in the Declaration of Independence is "instituted"), and takes the first letter of that word (in the case of the example, "I"). -
-Beale Paper #2 “I have deposited in the county of
Bedford, about four miles from Buford's, in an excavation or vault, six feet below the surface of the ground, the following articles, belonging jointly to the parties whose names are given in number three, herewith: The first deposit consisted of ten hundred and fourteen pounds of gold, and thirty-eight hundred and twelve pounds of silver, deposited Nov. eighteen nineteen. The second was made Dec. eighteen twenty-one, and consisted of nineteen hundred and seven pounds of gold, and twelve hundred and eighty-eight of silver; also jewels, obtained in St. Louis in exchange to save transportation, and valued at thirteen thousand dollars. The above is securely packed in iron pots, with iron covers. The vault is roughly lined with stone, and the vessels rest on solid stone, and are covered with others. Paper number one describes the exact locality of the vault, so that no difficulty will be had in finding it.” -
Beale Ciphers • Papers 1 & 3 have never been
deciphered • Or have they been? • NSA? • Or can they be? • Hoax? -
Pin-Prick “Steganography” • Tiny prick/dots under words/letters in other text
to spell a message • 19th century British letters • Letters cost 1 shilling/100 miles • Newspapers post for free -
Radio, 1899-1901 • 3,000 km from Cornwall to to Newfoundland
• Trans-atlantic communication • Instant military commands • All messages reach enemy too -
Georges Painvin • Lieutenant with French Bureau de Chiffre •
June 2, 1918 Broke ADFGVX message indicating location of German offensive against Paris • Lost 15kg -
One-time Pad Ciphers • Major General Joseph Mauborgne & Gilbert
Vernam of Bell Labs • Generate key: • same length as message • random -
Vigenère Keyword Length • 1,000 letters of plain text •
5 = 5 sets of 200 letters • Easy to break • 20 = 20 sets of 50 letters • Hard to break • 1,000 = 1,000 sets of 1 letter • Impossible to break -
Guesses for “the” Plaintext: the???the?????the???? Ciphertext: VHRMHEUZNFQDEZRWXFIDK Keyphrase: CAN???BSJ?????YPT???? ‘CAN’
too common, ‘BSJ’ not in any words ‘YPT’ uncommon, but possible -
So, Need Random Key • Natural, non-deterministic sources • Radioactive
decay • Geiger counter • Electron tunneling • Zener Diodes -
If the key is • truly random • at least
as long as the plaintext • never reused in whole or in part • kept completely secret then the resulting ciphertext will be impossible to break.* * Assuming a sane cryptographic algorithm (e.g., XOR) -
But one-time pads are logistical nightmare • How to make
large quantities of random keys? • messages * characters per day • How to distribute the keys/books securely? • Hardest problem of 20th-century crypto Un-used, because … -
26 Cipher Alphabets 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 1 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 2 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 3 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 4 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 5 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 6 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 7 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 8 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 9 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 10 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 11 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 12 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 13 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 14 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 15 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 16 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 17 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 18 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 19 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 20 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 21 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 22 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 23 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 24 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 25 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 26 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 -
Enigma: Electrical Encryption • Arthur Scherbius, 1918 • Mass Production
in 1925 • Keyboard for plaintext • “Magic” • Rotors + Reflector • Plugboard • Lamp-board for ciphertext CC BY-SA 3.0, https://commons.wikimedia.org/w/index.php?curid=497329 -
By MesserWoland - Own work based on Image:Enigma-action.pnj by Jeanot;
original diagram by Matt Crypto, CC BY-SA 3.0, https://commons.wikimedia.org/w/index.php?curid=1794494 Enigma's security came from using several rotors in series (usually three or four) and the regular stepping movement of the rotors, thus implementing a polyalphabetic substitution cipher. -
3 rotors of 26 wirings 26 x 26 x 26
= 17,576 Cipher Alphabets KEY = Starting Position of each -
17,576 is crack-able • A new key was used every
day • Assume 1 orientation check per minute • Simply type ciphertext and look at plaintext • 1 enigma machine = 12 days to crack • 12 enigma machines = 1 day to crack • 24 enigma machines = .5 day to crack -
Rotors could be Re-arranged 26 x 26 x 26 =
17,576 orientations x 6 arrangements = 105,456 Cipher Alphabets -
105,456 is really hard • Assume 1 check per minute
• 1 enigma machine = 73 days to crack • 12 enigma machines = 6 days to crack • 24 enigma machines = 3 days to crack • 48 enigma machines = 1.5 days to crack • 96 enigma machines = .75 days to crack -
Plugboard By Bob Lord - German Enigma Machine, uploaded in
english wikipedia on 16. Feb. 2005 by en:User:Matt Crypto, CC BY-SA 3.0, https://commons.wikimedia.org/w/index.php?curid=258976 Swap up to 6 of 26 letters -
Total Possible Keys 17,576 orientations x 6 arrangements x 100,391,791,500
Swaps = 10,586,916,711,696 -
10,586,916,711,696 • Assume 1 check per minute • 1 enigma
machine = 20,142,535 years to crack • 12 enigma machines = 1,678,544 years • 24 enigma machines = 839,272 years • 48 enigma machines = 419,636 years • 96 enigma machines = 209,818 years • 38,291,799 enigma machines = 1 day to crack -
By MesserWoland - own work by user:HandigeHarry based on previous
version based on Image:Enigma wiring kleur.png by Matt Crypto originally nl:Afbeelding:Enigma_wiring_kleur.png by nl:User:Drdefcom, CC BY-SA 3.0, https://commons.wikimedia.org/w/index.php?curid=1790479 The current flows from the battery [1] through the depressed bi-directional letter- switch [2] to the plugboard [3]. The plugboard allows rewiring the connections between keyboard [2] and fixed entry wheel [4]. Next, the current proceeds through the - unused, and therefore closed - socket [3] via the entry wheel [4] through the cross-wirings of the three (Wehrmacht Enigma) or four (Kriegmarine M4) rotors [5] and enters the reflector [6]. The reflector returns the current, via a different path, back through the rotors [5] and entry wheel [4], and proceeds through the plugboard again and through the plug 'S' connected with a cable [8] to plug 'D', and another bi-directional switch [9] to light-up the lamp. https://en.wikipedia.org/wiki/Enigma_machine#Electrical_pathway -
Enigma Codebooks (Key Distribution) • Monthly books with a key
for each day; e.g., • Plugboard: Q/W, E/R, T/Y, U/I, O/P, A/S • Rotor Arrangement: III, I, II • Initial Rotor Orientations: Q, C, W -
Per-Message Keys • Using day key, send a message rotor
orientation first. E.g., A, S, D • Send it at the beginning, twice for integrity. E.g., ‘asdasd’ = QWERTY • Receiver types QWERTY, sees ‘asdasd’ • Re-orients their rotors to A, S, D for the rest of the message • Minimizes amount of ciphertext created by day key -
Is cracking Enigma possible? • New key used every message
• Assume 1 check per minute • 38,291,799 enigma machines =1 day to crack 1 message -
Polish Biuro Szyfrów • Established after WWI to protect Poland
from Russian & Germany • Received photographs of Enigma instruction manual from French espionage • Deduced rotor wirings • Explained usage of codebook A. Jankowski "Warszawa" Publisher:Wydawnictwo Polskie, Poznań, Public Domain, https://commons.wikimedia.org/w/index.php?curid=1514113 -
Marian Rejewski • Focused on repeated message keys By Unknown
- Rejewski's daughter's private archive, CC BY-SA 2.5, https://commons.wikimedia.org/w/index.php?curid=216461 -
Message Keys reveal Letter Relationships • LOKRGM… • MVTXZE… •
JKTMPE… • DVYPZX… • (L,R) • (M,X) • (J,M) • (D,P) -
Start building table 4th Letter: P M RX 1st Letter:
ABCDEFGHIJKLMNOPQRSTUVWXYZ -
Intercept tons of messages • LOKRGM… • MVTXZE… • JKTMPE…
• DVYPZX… • LOKRGM… • MVTXZE… • JKTMPE… • DVYPZX… • LOKRGM… • MVTXZE… • JKTMPE… • DVYPZX… • LOKRGM… • MVTXZE… • JKTMPE… • DVYPZX… • LOKRGM… • MVTXZE… • JKTMPE… • DVYPZX… • LOKRGM… • MVTXZE… • JKTMPE… • DVYPZX… • LOKRGM… • MVTXZE… • JKTMPE… • DVYPZX… • LOKRGM… • MVTXZE… • JKTMPE… • DVYPZX… • LOKRGM… • MVTXZE… • JKTMPE… • DVYPZX… • LOKRGM… • MVTXZE… • JKTMPE… • DVYPZX… • LOKRGM… • MVTXZE… • JKTMPE… • DVYPZX… • LOKRGM… • MVTXZE… • JKTMPE… • DVYPZX… • LOKRGM… • MVTXZE… • JKTMPE… • DVYPZX… • LOKRGM… • MVTXZE… • JKTMPE… • DVYPZX… • LOKRGM… • MVTXZE… • JKTMPE… • DVYPZX… • LOKRGM… • MVTXZE… • JKTMPE… • DVYPZX… • LOKRGM… • MVTXZE… • JKTMPE… • DVYPZX… • LOKRGM… • MVTXZE… • JKTMPE… • DVYPZX… • LOKRGM… • MVTXZE… • JKTMPE… • DVYPZX… • LOKRGM… • MVTXZE… • JKTMPE… • DVYPZX… • LOKRGM… • MVTXZE… • JKTMPE… • DVYPZX… • LOKRGM… • MVTXZE… • JKTMPE… • DVYPZX… • LOKRGM… • MVTXZE… • JKTMPE… • DVYPZX… • LOKRGM… • MVTXZE… • JKTMPE… • DVYPZX… • LOKRGM… • MVTXZE… • JKTMPE… • DVYPZX… • LOKRGM… • MVTXZE… • JKTMPE… • DVYPZX… • LOKRGM… • MVTXZE… • JKTMPE… • DVYPZX… • LOKRGM… • MVTXZE… • JKTMPE… • DVYPZX… • LOKRGM… • MVTXZE… • JKTMPE… • DVYPZX… • LOKRGM… • MVTXZE… • JKTMPE… • DVYPZX… • LOKRGM… • MVTXZE… • JKTMPE… • DVYPZX… • LOKRGM… • MVTXZE… • JKTMPE… • DVYPZX… • LOKRGM… • MVTXZE… • JKTMPE… • DVYPZX… • LOKRGM… • MVTXZE… • JKTMPE… • DVYPZX… • LOKRGM… • MVTXZE… • JKTMPE… • DVYPZX… • LOKRGM… • MVTXZE… • JKTMPE… • DVYPZX… • LOKRGM… • MVTXZE… • JKTMPE… • DVYPZX… • LOKRGM… • MVTXZE… • JKTMPE… • DVYPZX… • LOKRGM… • MVTXZE… • JKTMPE… • DVYPZX… • LOKRGM… • MVTXZE… • JKTMPE… • DVYPZX… -
After enough messages per day 4th Letter: FQHPLWOGBMVRXUYCZITNJEASDK 1st Letter:
ABCDEFGHIJKLMNOPQRSTUVWXYZ 5th Letter: XUYCZITNJEASDKFQHPLWOGBMVR 2nd Letter: ABCDEFGHIJKLMNOPQRSTUVWXYZ 6th Letter: GBMVRXFQHPLWOUYCEASDKZITNJ 3rd Letter: ABCDEFGHIJKLMNOPQRSTUVWXYZ -
After looking at enough days … • Day 1 Chains:
• AD: 13 • BE: 10 3 • CF: 10 2 1 • Day 2 Chains: • AD: 9 • BE: 6 3 • CF: 6 2 1 • Day 1 Chains: • AD: 11 • BE: 9 2 • CF: 5 3 2 1 -
Marian Rejewski • Realized the # links in the chain
were only caused by the rotor settings • Could try to break the 105,456 possible rotor settings, not all 10,000,000,000,000,000 possible day keys • 100,000,000,000 times easier By Unknown - Rejewski's daughter's private archive, CC BY-SA 2.5, https://commons.wikimedia.org/w/index.php?curid=216461 -
After looking at enough days … • Rotor Setting 1
Chains: • AD: 13 • BE: 10 3 • CF: 10 2 1 • Rotor Setting 2 Chains: • AD: 9 • BE: 6 3 • CF: 6 2 1 • Rotor Setting 3 Chains: • AD: 11 • BE: 9 2 • CF: 5 3 2 1 -
Cyclometer • Team checked each of 105,456 possible settings on
replica Enigma machines and recorded what chains were generated by each • Took 1 year to complete • Could look up rotor settings by # of links in chains found in ciphertext http://www.cryptomuseum.com/crypto/cyclometer/index.htm -
How to find the plugboard settings out of 100,391,791,500? •
Plugboard: Un-plug all • Rotor Arrangement: III, I, II • Initial Rotor Orientations: Q, C, W • Type in ciphertext, see: • “Hlie Hitelr” • Swap E/L = Heil Hitler • “rettew” • Swap R/W = Wetter (weather) -
1938 Enigma Updates • Germans changed the method for enciphering
message keys • Existing catalog became useless • In new repeated message keys, sometimes the same plaintext letter enciphered to the same ciphertext letter 3 positions later • “females” -
Polish Cryptographic Bombs • 6 machines for the 6 possible
rotor arrangements • Each with 6 full Enigma rotor sets at top for the 6 characters of the repeated message key • Given a number of “females” to find, Bomba could recover settings in less than 2 hours -
1939 Enigma Updates • Added 2 rotors = 60 (25)
possible arrangements • Added 10 plugboard cables • 159,000,000,000,000,000,000 (267) possible keys • Up from 242 • Poland did not have resources to build enough bombs • Aug 16: Poland smuggled an Enigma & their research to the Allies • 2 weeks later, Hitler invaded Poland -
Bletchley Park • More staff & resources than Biuro Szyfrów
• New techniques • Try short-cuts like “cillies” - i.e., message keys commonly re-used by bad German Enigma operators • Rotors never used in same position 2 days in a row; eliminates half of rotor arrangements • Plugboard letters never swapped with neighbors By Draco2008 from UK - Bletchley Park, CC BY 2.0 https://commons.wikimedia.org/w/index.php?curid=19410523 -
Alan Turing • Mathematician & Professor & King’s College, Cambridge
• Joined Bletchley Park Sep 4, 1939 - the day after Chamberlain declared war on Germany • Focused on what would happen if Germans stopped repeating day keys -
“Cribs” • E.g., same weather report every day at 6am
always contains “wetter” in the same position • See ciphertext of “ETJWPX” where “wetter” is • Try Engima settings to find which settings match -
British Bombes • 36 rotors arrange in 3 banks of
12 • 210 bombes by the end of the war • Operated by 2,000 members of Women’s Royal Navy Service -
US Bombes • 16 4-rotor Enigma equivalents • Spun 34x
faster • 20 minutes running time for 4-rotor mode • 50 seconds running time for 3-rotor mode -
• Multiple Enigmas • Air Force, Intelligence, Army, Navy •
Broken Enigma kept quiet for 50 years • 九七式欧⽂印字機 “Purple” Cipher used by Japanese foreign office • Lorenz Cipher used by German High Command More WWII Crypto -
Colossus • Inspired by Turings ideas and his bombe •
1,500 electronic valves - faster than electromechanical relay switches • Programmable -
Computer Crypto Machines have to be built; software can be
written Electronics faster than mechanics Binary numbers; not alphabets -
Binary transposition For example, consider this short sentence. 01000110011011110111001000100000011001010111100001100001011011010111000001101100011001010010110000100000011000110 11011110110111001110011011010010110010001100101011100100010000001110100011010000110100101110011001000000111001101
101000011011110111001001110100001000000111001101100101011011100111010001100101011011100110001101100101 328 bits, 328! = 2.6 x 10684 possible bit re- arrangements Rail fence cipher with 2 rails 00010111010101000100011001000110010001100100011001000101011101110101011001000100010101000100011001100101010001010 11001110101010001000101010001110100010001110101010010101011110000001011110010011011110010101011001000001001101110 101101100110101011110000001110100010011101000011011000101111001110000011011011101011101011101010011011 -
Binary substitution (XOR) The XOR operator outputs a 1 whenever
the inputs do not match, which occurs when one of the two inputs is exclusively true 0 XOR 0 = 0 0 XOR 1 = 1 1 XOR 0 = 1 1 XOR 1 = 0 -
Binary substitution (XOR) For example, consider this short sentence. 01000110011011110111001000100000011001010111100001100001011011010111000001101100011001010010110000100000011000110
11011110110111001110011011010010110010001100101011100100010000001110100011010000110100101110011001000000111001101 101000011011110111001001110100001000000111001101100101011011100111010001100101011011100110001101100101 Key: “Julius Caesar” 01001010011101010110110001101001011101010111001100100000010000110110000101100101011100110110000101110010 Output 10001100110111101110010001000000110010101111000011000010110110101110000011011000110010100101100001000000110001101 10111101101110011100110110100101100100011001010111001000100000011101000110100001101001011100110010000001110011001 00010000110100001111000011101010101010000000001000101001011010001010100000000000111010000001000010111 -
Binary substitution (XOR) For example, consider this short sentence. 010001100110111101110010001000000110010101111000011000010110110101110000011011000110010100101100001000000110001101
101111011011100111001101101001011001000110010101110010001000000111010001101000011010010111001100100000011100110110 1000011011110111001001110100001000000111001101100101011011100111010001100101011011100110001101100101 Key: “random” 1|0’s length of plaintext 000000111010001101000011010010111001100100000011100110110100001101111011100100111010000100000011100110110010101101 110011101000110010101101110011000110110010101000110011011110111001000100000011001010111100001100001011011010111000 0011011000110010100101100001000000110001101101111011011100111001101101001011001000110010101110010001 Output 100011001101111011100100010000001100101011110000110000101101101011100000110110001100101001011000010000001100011011 011110110111001110011011010010110010001100101011100100010000001110100011010000110100101110011001000000111001100100 010000110100001111000011101010101010000000001000101001011010001010100000000000111010000001000010111 -
Horst Feistel Immigrated from Germany in 1934 Placed under house
arrest until 1944 during the war Invented “Lucifer” cipher for computer encryption Harassed by NSA to block his research until he went to IBM research lab -
Lucifer Cipher Break message into 128-bit blocks 128-bit key In
each of 16 rounds Break block in half the f-function is calculated using that round's subkey and the left half of the block. The result is then XORed to the right half of the block, which is the only part of the block altered for that round. After every round except the last one, the right and left halves of the block are swapped. -
Generate 72-bit sub-key awesomepassword! 01100001011101110110010101110011011011110110110101100101011100000110000101110011011100110111011101101111011100100110010000100001 a a 01100001 01100001 wesomep
01110111011001010111001101101111011011010110010101110000 -
XOR right half of block with last 8 bytes of
subkey NSA stor 0100111001010011010000010010000001110011011101000110111101110010 awesomep 0110000101110111011001010111001101101111011011010110010101110000 0010111100100100001001000101001100011100000110010000101000000010 -
DES: 56-bit Lucifer* Possible key space limited to 72,000,000,000,000,000 (256)
so the NSA could break it if they needed to First standard for commercial computer cryptography The biggest issue remains: key distribution -
Whitfield Diffie MIT 1965 1965 - 1974: MITRE, Stanford AI
Lab 1974: met with Martin Hellman -
Martin Hellman NYU 1966 Stanford 1967-1969 IBM Watson Research Center
1968-1969 Encountered Horst Feistel -
Alice, Bob, and Eve Alice and Bob need to communicate
securely They need to share a secret They only have public channels between them “Eve is always listening” How can they share a secret without sharing it with Eve? -
Mailing lock-boxes Alice locks a box with a pad-lock, keeps
the key, sends box to Bob Bob adds his own pad-lock to the box, keeps the key, sends box back to Alice Alice removes her pad-lock, sends box back to Bob Bob removes his pad-lock Lock & unlock order is un-important, but for encryption & decryption, order is important -
Diffie-Hellman keys Used to generate a shared secret in public
for later symmetric ("private-key") encryption Key identity: (gens1)s2 = (gens2)s1 = shared secret (mod prime) gen is an integer whose powers generate all integer in [1, prime) (mod prime) s1 and s2 are the individuals' "secrets", only used to generate the symmetric key Discrete logs are hard https://crypto.stackexchange.com/questions/2867/whats-the-fundamental-difference-between-diffie-hellman-and-rsa#2868 -
RSA Used to come up with a public/private key pair
for asymmetric ("public-key") encryption Key identity: (m e ) d = m (mod n) (lets you recover the encrypted message) n = prime1 × prime2 (n is publicly used for encryption) φ = (prime1 - 1) × (prime2 - 1) e is such that 1 < e < φ, and (e, φ) are coprime (e is publicly used for encryption) d × e = 1 (mod φ) (the modular inverse d is privately used for decryption) Prime factorization is hard https://crypto.stackexchange.com/questions/2867/whats-the-fundamental-difference-between-diffie-hellman-and-rsa#2868 -
Quantum Analogy By !KrzysiekBu! - Own work, CC BY-SA 4.0
https://commons.wikimedia.org/w/index.php?curid=36293346 -
Math I don’t like it It’s too easy to get
wrong DO NOT TRY TO MAKE YOUR OWN CRYPTO BE EXTRA CAREFUL WITH HOW YOU USE CRYPTO