Documente Academic
Documente Profesional
Documente Cultură
Chapter 5. Cryptography
5.1 Introduction
Security Engineering
Chapter 5. Cryptography
by Ross Anderson
Cryptography Provides the Tools that Are the Foundation For Security Protocols. Where Security Engineering Meets Mathematics.
Plaintext vs Ciphertext
Plaintext
Original Message Often Denoted by Lower Case Letters E.g., tobeornottobethatisthequestion N.B.: Might Not Be Plain Or Text
Computer Generated Text E.g., mpeg, PostScript, pdf, dll, etc
Encryption vs Decryption
Encryption
5-3
Algorithm That Maps Plaintext to Ciphertext May Use Second Input Called a (Secret) Key May Or May Not Be Reversible (Invertible) AKA Enciphering Algorithm That Maps Ciphertext to Plaintext May Use Second Input Called a (Secret) Key Reverse (Inverse) of the Encryption Algorithm AKA Deciphering
5-4
Decryption
Ciphertext
Coded Message Often Denoted by Upper Case Letters E.g., KIOVIEEIGKIOVNURNVJNUVKHVMGZIA
May Depend on Plain Text and a (Secret) Key
Encryption Illustrated
Encryption Motivation
Shared Key Shared Key
Key
Key
Plain Text
Encryption Algorithm
Cipher Text
Decryption Algorithm
Plain Text
Plain Text
Encryption Algorithm
Cipher Text
Decryption Algorithm
Plain Text
Sender
Transmission
Receiver
5-5
5-6
5-1
Chapter 5. Cryptography
Cryptography
Study of Encryption/Decryption Cryptographic System
Particular Encryption/Decryption Scheme E.g., DES AKA Crypto System, Cipher
Cryptanalysis
Study of Deciphering Ciphertext Without
Key Algorithm? Lots of Ciphertext? Particular Ciphertext? Any Plaintext, Lots of Plaintext? Etc?
Cryptographic Suite
Set of Cryptographic Systems E.g., WEP and WPA for Wi-Fi AKA Crypto Suite
Desires
Decipher One Particular Ciphertext? Decipher Any/All Ciphertexts? (The Key?) Etc?
Cryptology
Study of
Cryptography Cryptanalysis Whos-on-first? Problem
Cryptographic Systems
Three Characteristics Types of (E/D) Operations Number of Keys Number of Elements Per (E/D) Operation (E/D = Encryption/Decryption) (Element = Letter, Bit, Byte, Etc)
5-9 5-10
Is
very mathematical very hard
Your Goal
Learn Terminology Gain Intuition
Number of Keys
One Key or One Set of Keys
Same for Encryption and Decryption AKA
Symmetric Single-Key Secret-Key
Permutation (Transposition)
Rearrange Elements E.g., 0 7, 1 3, 2 5, 3 0, 4 2, 5 6, 6 1, 7 4 Word Scramble
Product Systems
Combination of Substitutions and Transpositions Really Composition Systems
5-2
Chapter 5. Cryptography
Processed As a Stream
Round 2
Key?
Block Cipher
N Elements At A Time
N Letters N Bits N Bytes Etc
Round N
: :
Key?
Processed In Blocks
5-13
CIPHERTEXT
5-14
Cryptanalysis
Two Fundamental Approaches Brute Force
Know E/D Algorithms Try
Every Possible Key On Average Must Try All Possible Keys
Number of Keys
232 4.3 x 109 256 7.2 x 1016 2128 3.4 x 1038 2168 3.7 x 1050 26! 4 x 1026
Time 1 / s
(1 Encryption/s) 231 s 35.8 mins 255 s 1142 yrs 2127 s 5.4 x 1024 yrs 2167 s 5.9 x 1036 yrs 26!/2 s 6.4 x 1012 yrs
Time 106 / s
(106 Encryptions/s) 2.15 ms 600 hrs 5.4 x 1018 yrs 5.9 x 1030 yrs 6.4 x 106 yrs
Analysis (Cyptanalysis)
Know
Nature of E/D Algorithms? Characteristics of Plaintext? Some Plaintext-Ciphertext Pairs? Etc?
5-15
Does this mean that an encryption scheme with an 128-bit key would take 5.4 x 1018 years to crack?
5-16
Big Numbers
One Million (106) Seconds In a Year Global Population Age of the Universe 1 MIPS Year (MY) Protons In the Universe 220 225 232 234 Years 246 Operations 2256
5-17
Encryption/Decryption Key
Input to Encryption/Decryption Independent of Plaintext Require (Desire)
Secret Are Many (to Chose From) Different Keys Very Different Ciphertext
5-3
Chapter 5. Cryptography
Characteristics of Plaintext
Statistical Characteristics
Letter Frequencies: e, t, a, i, Digram Frequencies: th, he, in, Trigram Frequencie: the, and, tha,
Probable Words
%PDF-1.1, /Type, /Name, /Filter, /ColorSpace, %!PS-Adobe-3.0, %%Creator, %%BeginProlog, Michigan State University Transfer Funds Etc
e t a o i n s h r d l c u
0.12702 0.09056 0.08167 0.07507 0.06966 0.06749 0.06327 0.06094 0.05987 0.04253 0.04025 0.02782 0.02758
m w f g y p b v k j x q z
0.02406 0.02360 0.02228 0.02015 0.01974 0.01929 0.01492 0.00978 0.00772 0.00153 0.00150 0.00095 0.00074
5-20
Start/End-of-Word Letters
Start Word (Top Ten) t 0.1594 a 0.1550 i 0.0823 s 0.0775 o 0.0712 c 0.0597 m 0.0426 f 0.0408 p 0.040 w 0.0382
5-21
End Word (Top Ten) e 0.1917 s 0.1435 d 0.0923 t 0.0864 n 0.0786 y 0.0730 r 0.0693 o 0.0467 l 0.0456 f 0.0408
5-22
Ciphertext Revisited
Coded Message Often Denoted by Upper Case Letters E.g., KIOVIEEIGKIOVNURNVJNUVKHVMGZIA
May Depend on Plain Text and a (Secret) Key Require (Desire)
Unintelligible Undecipherable Unbreakable Appear Random
No Detectable Patterns Its not random. Why not?
5-23
Ciphertext Attacks (1 of 3)
Ciphertext Only
Cryptanalyst Knows Encryption Algorithm Ciphertext To Be Deciphered
Known Plaintext
Cryptanalyst Knows Encryption Algorithm Ciphertext To Be Deciphered One or More Plaintext-Cipher Text Pairs
5-24
5-4
Chapter 5. Cryptography
Ciphertext Attacks (2 of 3)
Chosen Plaintext
Cryptanalyst Knows Encryption Algorithm Ciphertext To Be Deciphered Plaintext-Cipher Text Pair with Plaintext Chosen
Ciphertext Attacks (3 of 3)
Chosen Text
Cryptanalyst Knows Encryption Algorithm Ciphertext To Be Deciphered Plaintext-Cipher Text Pair with Plaintext Chosen Plaintext-Cipher Text Pair with Ciphertext Chosen
Known Ciphertext
Cryptanalyst Knows Encryption Algorithm Ciphertext To Be Deciphered Plaintext-Cipher Text Pair with Ciphertext Chosen
5-25
How do you get your chosen plaintext encrypted since you dont know the key? Hmm
5-26
Strong Encryption
Cryptanalyst Can NOT
Decipher the Ciphertext Figure Out the Key
Secure Encryption
Unconditionally Secure
CanNOT Deduce Plaintext from Ciphertext (In Any Amount of Time) Only One Such Known Encryption Algorithm (But Not Practical For Most Applications)
Even If Cryptanalyst
Knows the Algorithm Has the Ciphertext Has One Or More Ciphertexts Has A Number of Plaintext-Ciphertext Pairs
Computationally Secure
Cost of Deciphering > Value of Plaintext Time to Decipher > Useful Lifetime of Plaintext
5-27
5-28
Cryptosystem Requirements
Encryption/Decryption Algorithm
Strong Computationally Secure Plus
Fast? Cheap? Etc?
Conventional Cryptosystem
~P Cryptanalyst ~K
Key
Strong Shared Secure Plus
Transmitted K P = Plaintext
Secure Channel
Key Source
5-5
Chapter 5. Cryptography
Example
plain: attack the enemy on friday CIPHER: DWWDFN WKH HQHPB RQ IULGDB
Cipher Characteristics
Substitution Monoalphabetic (Single Cipher Alphabet Used)
5-31 5-32
Modular Arithmetic (1 of 5)
Definition For integers a and b, we define r = a mod b if there exist integers n and 0 r < b such that a = b * n + r. Intuitively a mod b is the remainder after dividing a by b
Modular Arithmetic (2 of 5)
a mod b = r
a div b = n with remainder r a=b*n+r
14 mod 4 = 2
14 div 4 = 3 with remainder 2 14 = 4 * 3 + 2
1095 mod 10 = 5
1095 div 10 = 109 with remainder 5 1095 = 10 * 109 + 5
(b * n) mod b = 0
(b * n) div b = n with remainder 0 (b * n) = b * n + 0
5-33 5-34
Modular Arithmetic (3 of 5)
What if a < 0?
Note that 0 a mod b < b. Be careful!
Modular Arithmetic (4 of 5)
5-35
a mod b = r
a=b*n+r
( 7) mod 26 = 19
7 = 26 * ( 1) + 19
Be Careful
(7) mod 26 = 19 (7 mod 26) = 7 7 mod 26 = ?
Integers mod 5 0 mod 5 = 0 1 mod 5 = 1 2 mod 5 = 2 3 mod 5 = 3 4 mod 5 = 4 5 mod 5 = 0 6 mod 5 = 1 7 mod 5 = 2 8 mod 5 = 3 9 mod 5 = 4
Integers mod 5 10 mod 5 = 0 11 mod 5 = 1 12 mod 5 = 2 13 mod 5 = 3 14 mod 5 = 4 15 mod 5 = 0 16 mod 5 = 1 17 mod 5 = 2 18 mod 5 = 3 19 mod 4 = 4
5-36
5-6
Chapter 5. Cryptography
Modular Arithmetic (5 of 5)
Integers mod n
Only n digits 0, 1,,n-1 Denoted by Zn n Prime
Special Case Use p instead of n Zp
5-37
Let a = 0, b = 1, c = 2, d = 3, , z = 25 Cipher
plain: CIPHER: plain: 0 3 1 4 2 5 3 6 4 7 5 8 6 7 8 9 10 11 12 9 10 11 12 13 14 15
13 14 15 16 17 18 19 20 21 22 23 24 25 CIPHER: 16 17 18 19 20 21 22 23 24 25 0 1 2
5-38
Hmm
( 0 + 3) mod 26 = 3 ( 1 + 3) mod 26 = 4 ( 2 + 3) mod 26 = 5 ( 3 + 3) mod 26 = 6 ( 4 + 3) mod 26 = 7 ( 5 + 3) mod 26 = 8 ( 6 + 3) mod 26 = 9 ( 7 + 3) mod 26 = 10 ( 8 + 3) mod 26 = 11 ( 9 + 3) mod 26 = 12 (10 + 3) mod 26 = 13 (11 + 3) mod 26 = 14 (12 + 3) mod 26 = 15 (13 + 3) mod 26 = 16 (14 + 3) mod 26 = 17 (15 + 3) mod 26 = 18 (16 + 3) mod 26 = 19 (17 + 3) mod 26 = 10 (18 + 3) mod 26 = 21 (19 + 3) mod 26 = 22 (20 + 3) mod 26 = 23 (21 + 3) mod 26 = 24 (22 + 3) mod 26 = 25 (23 + 3) mod 26 = 0 (24 + 3) mod 26 = 1 (25 + 3) mod 26 = 2
5-39
Decryption
P = (C k) mod 26
Example
plain: attack the enemy on friday CIPHER: CVVCEM VJG GPGOA QP HTKFCA
Visual Basic
k = Asc(key) - Asc("a") Caesar_Encrypt = "" For i = 1 To Len(plain) p = Asc(Mid(plain, i, 1)) - Asc("a") c = (p + k) Mod 26 Caesar_Encrypt = Caesar_Encrypt & Chr(c + Asc("A")) Next i
5-41 5-42
5-7
Chapter 5. Cryptography
Observations
Algorithm Is Known Plaintext Easily Recognizable Only 26 Keys
Attack Ideas?
5-43
5-44
Improvements?
Increase Number of Keys Allow Any Substitution Ordering An Idea
Key: Set of Unique Letters Substitution: Key & (Alphabet Minus Key Letters)
Example
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 z CIPHER: S E C U R I T Y A B D F G H J K L M N O P Q V W X Z
Analysis?
26! Keys
but
(Say For English Text) Single Letter Frequency Digram, Trigram Frequency Start/End-of-Word Letters Probable Words Etc
5-46
5-48
5-8
Chapter 5. Cryptography
Analyzing Ciphertext (1 of 6)
VRYJFUOYRNROMPOYNOJERNRFIRQAURHOOYSOSFFGRHSMRCMRSO RURLPSFOYSOOYRXSMRRHUJVRUEXOYRAMCMRSOJMVAOYCRMOSAH PHSFARHSEFRMATYONOYSOSGJHTOYRNRSMRFAIRFAERMOXSHUOY RKPMNPAOJIYSKKAHRNN
Analyzing Ciphertext (2 of 6)
Cipher: Plain: Cipher: Plain: Cipher: Plain: Cipher: Plain: VRYJFUOYRNROMPOYNOJERNRFIRQAURHOOYSOSFFGRHSMRCMRSO -------------------------------------------------RURLPSFOYSOOYRXSMRRHUJVRUEXOYRAMCMRSOJMVAOYCRMOSAH -------------------------------------------------PHSFARHSEFRMATYONOYSOSGJHTOYRNRSMRFAIRFAERMOXSHUOY -------------------------------------------------RKPMNPAOJIYSKKAHRNN ------------------Map from Cipher to Plain
Cryptanalysis
Plain Cipher Freq. Plain Cipher Freq. Plain Cipher Freq. Plain Cipher Freq. R 28 F 9 I 3 Q 1 O 22 N 8 K 3 B 0 S 16 J 6 V 3 D 0 Y 13 U 6 X 3 W 0 M 12 P 5 G 2 Z 0 A 10 E 4 T 2 H 9 C 3 L 1 OY YR 10 5 OYR OYS 5 3
5-49
5-50
Analyzing Ciphertext (3 of 6)
Cipher: Plain: Cipher: Plain: Cipher: Plain: Cipher: Plain: VRYJFUOYRNROMPOYNOJERNRFIRQAURHOOYSOSFFGRHSMRCMRSO -eh---the-et--th-t--e-e--e---e-tthata---e-a-e--eat RURLPSFOYSOOYRXSMRRHUJVRUEXOYRAMCMRSOJMVAOYCRMOSAH e-e--a-thatthe-a-ee----e---the----eat----th-e-ta-PHSFARHSEFRMATYONOYSOSGJHTOYRNRSMRFAIRFAERMOXSHUOY --a--e-a--e---ht-thata----the-ea-e---e---e-t-a--th RKPMNPAOJIYSKKAHRNN e------t--ha----e-Map from Cipher to Plain
Analyzing Ciphertext (4 of 6)
Cipher: Plain: Cipher: Plain: Cipher: Plain: Cipher: Plain: VRYJFUOYRNROMPOYNOJERNRFIRQAURHOOYSOSFFGRHSMRCMRSO -ehol-thesetr-thsto-esel-e-i-entthatall-enare-reat RURLPSFOYSOOYRXSMRRHUJVRUEXOYRAMCMRSOJMVAOYCRMOSAH e-e--althatthe-areen-o-e---their-reator-ith-ertain PHSFARHSEFRMATYONOYSOSGJHTOYRNRSMRFAIRFAERMOXSHUOY -naliena-leri-htsthata-on-theseareli-eli-ert-an-th RKPMNPAOJIYSKKAHRNN e--rs-ito-ha--iness Map from Cipher to Plain
5-51
5-52
Analyzing Ciphertext (5 of 6)
Cipher: Plain: Cipher: Plain: Cipher: Plain: Cipher: Plain: VRYJFUOYRNROMPOYNOJERNRFIRQAURHOOYSOSFFGRHSMRCMRSO weholdthesetruthstobeselfevidentthatallmenarecreat RURLPSFOYSOOYRXSMRRHUJVRUEXOYRAMCMRSOJMVAOYCRMOSAH edequalthattheyareendowedbytheircreatorwithcertain PHSFARHSEFRMATYONOYSOSGJHTOYRNRSMRFAIRFAERMOXSHUOY unalienablerightsthatamongthesearelifelibertyandth RKPMNPAOJIYSKKAHRNN epursuitofhappiness Map from Cipher to Plain
Analyzing Ciphertext (6 of 6)
VR YJFU OYRNR OMPOYN OJ ER NRFI RQAURHO OYSO SFF we hold these truths to be self evident that all GRH SMR CMRSORU RLPSF OYSO OYRX SMR RHUJVRU EX men are created equal that they are endowed by OYRAM CMRSOJM VAOY CRMOSAH PHSFARHSEFR MATYON their creator with certain unalienable rights OYSO SGJHT OYRNR SMR FAIR FAERMOX SHU OYR that among these are life liberty and the KPMNPAO JI YSKKAHRNN pursuit of happiness
5-53
5-54
5-9
Chapter 5. Cryptography
5-56
S I/J D L Q
Plaintext
Group in Pairs Separate Double Letters (If Needed, Say With x) Pad Last Pair (If Needed, say With x) E.g. attack the enemy on
Friday becomes at ta ck th ex en em yo nf ri da yx
Letter To Right SC t EU NP t OL (Circular) Letter Below EF t TM AX t HU (Circular) Letter In Same Row, In Column of Pair TH t AF WB t ZY
Same Column?
Otherwise
5-57
5-58
Letter To Right SC t EU NP t OL (Circular) Letter Below EF t TM AX t HU (Circular) Letter In Same Row, In Column of Pair TH t AF WB t ZY
Letter To Right SC t EU NP t OL (Circular) Letter Below EF t TM AX t HU (Circular) Letter In Same Row, In Column of Pair TH t AF WB t ZY
Same Column?
Same Column?
Otherwise
Otherwise
5-59
5-60
5-10
Chapter 5. Cryptography
Letter To Right SC t EU NP t OL (Circular) Letter Below EF t TM AX t HU (Circular) Letter In Same Row, In Column of Pair TH t AF WB t ZY
Letter To Right SC t EU NP t OL (Circular) Letter Below EF t TM AX t HU (Circular) Letter In Same Row, In Column of Pair TH t AF WB t ZY
Same Column?
Same Column?
Otherwise
Otherwise
5-61
5-62
Letter To Right SC t EU NP t OL (Circular) Letter Below EF t TM AX t HU (Circular) Letter In Same Row, In Column of Pair TH t AF WB t ZY
Letter To Right SC t EU NP t OL (Circular) Letter Below EF t TM AX t HU (Circular) Letter In Same Row, In Column of Pair TH t AF WB t ZY
Same Column?
Same Column?
Otherwise
Otherwise
5-63
5-64
Letter To Right SC t EU NP t OL (Circular) Letter Below EF t TM AX t HU (Circular) Letter In Same Row, In Column of Pair TH t AF WB t ZY
Letter To Right SC t EU NP t OL (Circular) Letter Below EF t TM AX t HU (Circular) Letter In Same Row, In Column of Pair TH t AF WB t ZY
Same Column?
Same Column?
Otherwise
Otherwise
5-65
5-66
5-11
Chapter 5. Cryptography
Analysis of Playfair
Improvements
E T F M V C Y G N W U A H O X R B K P Z Increases Number of Keys (From 26 to 26 x 26 = 676) Flattens Out Frequencies of Letter
S I/J
History
Considered Unbreakable For a Long Time Used By
British Army in World War I U.S. Army and Allies in World War II
Ciphertext
attackthexenemyonfridayx BYYBRGAFUVCMTVANMGSBHIAW
D L Q
Strength?
Much of Plaintext Structure Survives Broken With Few Hundred Letters Of Ciphertext
5-67 5-68
Hill Cipher
Invented by Lester Hill Characteristics
Key is a Matrix Process Letters in Vectors (Block Cipher) Monoalphabetic
Hill Cipher (n = 3)
Idea
Process 3 Plaintext Characters At A Time (Block Cipher With Block Size 3) Use 9 Keys (Or Generate 9 Keys From One Key) Ciphertext Is Linear Combination of Plaintext Mod 26
Mathematically
c1 c2 c3
r r c = K p mod 26
5-72
5-12
Chapter 5. Cryptography
22 17 + 4 17 + 7 5 = 22 21 + 4 18 + 7 21 mod 26 22 2 + 4 2 + 7 19
5-73 5-74
5-75
5-76
The Inverse of K: K -1
17 Let K = 21 2 17 Then KK 1 = 21 2 17 5 4 9 15 18 21 and K 1 = 15 17 6 . 2 19 24 0 17 17 5 4 9 15 18 21 15 17 6 mod 26 2 19 24 0 17
Hill Decryption
r r Let c = K p mod 26 and K K 1 mod 26 = I .
Then r r K 1c mod 26 = K 1 (K p mod 26 ) mod 26 r = K 1 K p mod 26 r = p mod 26 r =p
5-78
5-13
Chapter 5. Cryptography
Hill Cipher
r r n n n Let p, c Z 26 , K Z 26 .
Analysis of Hill
Letter Distributions
Hides Completely 3 x 3 Hill Hides Digrams 4 x 4 Hill Hides Trigrams n x n Hill Hides (n - 1) x (n - 1)-Letter Groups
Strength?
Strong Against Ciphertext-Only Attack Easily Broken With Known Plaintext Attack (Why?)
5-80
Then
w o t Z S B H M G = K e l h mod 26 h d e F T F
5-82
25 18 1 22 14 19 7 12 6 4 11 7 mod 26 = K 5 19 5 7 3 4
5-83
5-14
Chapter 5. Cryptography
5-86
5-87
5-88
Vigenre Illustrated
p w e h o l d t h e k m s u b b m s u b c ('w' ('e' ('h' ('o' ('l' ('d' ('t' ('h' ('e' + + + + + + + + + 'm') 's') 'u') 'b') 'b') 'm') 's') 'u') 'b') mod mod mod mod mod mod mod mod mod 26 26 26 26 26 26 26 26 26
5-89
Vigenre Tableau
Key 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 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 b 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 c 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 d 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 e 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 f 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 g 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 h 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 i 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 j 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 k 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 Plaintext l m n o L M N O M N O P N O P Q O P Q R P Q R S Q R S T R S T U S T U V T U V W U V W X V W X Y W X Y Z X Y Z A Y Z A B Z A B C A B C D B C D E C D E F D E F G E F G H F G H I G H I J H I J K I J K L J K L M K L M N p 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 q 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 r 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 s 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 t 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 u 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 v 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 w 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 x 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 y 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 z 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
5-90
5-15
Chapter 5. Cryptography
Vigenre Example
Plain: Key: Cipher: Plain: Key: Cipher: Plain: Key: Cipher: Plain: Key: Cipher: weholdthesetruthstobeselfevidentthatallmenarecreat msubbmsubbmsubbmsubbmsubbmsubbmsubbmsubbmsubbmsubb IWBPMPLBFTQLLVUTKNPCQKYMGQNCEFZLNIBFSFMNQFUSFOJYBU edequalthattheyareendowedbytheircreatorwithcertain msubbmsubbmsubbmsubbmsubbmsubbmsubbmsubbmsubbmsubb QVYRVMDNIBFLBFZMJYFOPGQFENQNIFUJWSFMLISXULBDFDLUJO unalienablerightsthatamongthesearelifelibertyandth msubbmsubbmsubbmsubbmsubbmsubbmsubbmsubbmsubbmsubb GFUMJQFUCMQJCHIFKNIBFSGPOSLBFTQSLFMUXYMJNWLUZMFXUI epursuitofhappiness msubbmsubbmsubbmsubbmsubbmsubbmsubbmsubbmsubbmsubb QHOSTGANPGTSJQJZWMT
Cracking Vigenre (1 of 4)
NoteHmm
weh..entthatallualthatthehtsthatamo msu..bmsubbmsubbmsubbmsubbmsubbmsub IWB..FZLNIBFSFMVMDNIBFLBFIFKNIBFSGP
Observation
Key Repeats Key Repeats Key Repeats Any Repeating Plaintext Sequence Has 1 Out of Length(Key) Chance of Being Encrypted With the Same Key Sequence Repeating Plaintext Sequence Might Be Encrypted Into Repeating Ciphertext Sequence Distance Between Repeating Plaintext-Key Sequences Must Be An Integer Multiple of the Key Length
5-91 5-92
Cracking Vigenre (2 of 4)
We see that
weh..entthatallualthatthehtsthatamo msu..bmsubbmsubbmsubbmsubbmsubbmsub IWB..FZLNIBFSFMVMDNIBFLBFIFKNIBFSGP
33 58 118
Cracking Vigenre (3 of 4)
What do we have?
IWBPMPLBFTQLLVUTKNPCQKYMGQNCEFZLNIBFSFMNQFUSFOJYBU 12345123451234512345123451234512345123451234512345
What do we do?
Group Ciphertext Letters By Key Position Analyze Ciphertext by Group
Frequency Analysis
Etc
5-94
Cracking Vigenre (4 of 4)
Historical Note Scientific American 1917 Vigenre impossible of translation Remember
Vigenre Twist
Autokey System
Proposed by Vigenre Eliminate Repeating Key Key: Keyword & Plaintext Recover Key While Decrypting
Example
weholdthesetruthstobeselfevidentthatallmenarecreat msubbweholdthesetruthstobeselfevidentthatallmenare IWBPMZXOSDHMYYLLLKIULKXZGINMOJROBKEGTESMXNLCQGEERX
ButStill Crackable
5-95 5-96
5-16
Chapter 5. Cryptography
Vernam Cipher (1 of 3)
Gilbert Vernam, 1918 Key
Random How Long?
Long As Plaintext? Long (But Shorter than Plaintext) and Repeating
Vernam Cipher (2 of 3)
Exclusive-Or (xor) Recall
a 0 0 1 1 b a xor b 0 0 1 1 0 1 1 0
Notes
Vernam Cipher (3 of 3)
Encryption ci = pi xor ki where
pi i-th binary digit of plaintext ki i-th binary digit of key ci i-th binary digit of cihpertext
5-100
Example
p: weholdthesetruthstobeselfevidentthatallmenarecreat k: iwbpmplbftqllvutknpcqkymgqncefzlnibfsfmnqfusfojybu c: EAIDXSEIJLUECPNACGDDUCCXLUIKHJMEGPBYSQXZUSUJJQACBN
So what?
5-101
5-102
5-17
Chapter 5. Cryptography
Transposition Techniques
Permute Plaintext Letters Rail Fence Technique
Plaintext
w h l t e e r t s o e e f v d n t a a l e a e r a e o d h s t u h t b s l e i e t h t l m n r c e t
Transposition Cipher
Key: Plaintext: 43512 wehol dthes etrut hstob eself evide nttha tallm enare creat
Ciphertext
WHLTEERTSOEEFVDNTAALEAERAEODHSTUHTBSLEIETHTLMNRCET
Ciphertext: OEUOLDHLRALSTBFEAMETETTSSVTANRWDEHEENTECHHRTEITLAE
1
5-105
5
5-106
Repeated Transposition
Key: Plaintext: 43512 oeuol dhlra lstbf eamet ettss vtanr wdehe entec hhrte itlae
Round 2
Key?
: :
Ciphertext: ORBESNHETALAFTSRECEEEHSATTDNHTODLEEVWEHIULTMTAETRL
Ciphertext After Round 2
5-107
Round N
Key?
CIPHERTEXT
5-108
5-18
Chapter 5. Cryptography
Rotor Machines
Rotor Machines
26 x 26 x 26 = 17,576 Substitution Alphabets Frequency Analysis
Would Require Unrealistic Amounts of Ciphertext Not Practically Possible
World War II
Germany: Enigma Japan: Purple
Motivation For
DES AES
5-109 5-110
Steganography
Conceal Message
Character Marking Invisible Ink Pin Punctures Typewriter Correction Ribbon Etc Digital Color Image 2,048 x 3,072 x 24 (8 Bits of Red, Green, Blue) Change Last Bit of Red, Green, Blue 2,048 x 3,072 x 3 =18,874,368 Bits (~2.3 MByte)
5-111
Example
5-19