1.28k likes | 1.47k Views
CIS/TCOM 551 Computer and Network Security Slide Set 3. Carl A. Gunter Spring 2004. Basic Encryption. Monoalphabetic substitution ciphers Polyalphabetic substitution ciphers Transposition ciphers Other hiding techniques Stream versus block ciphers. Sender. Transmission Medium. Receiver.
E N D
CIS/TCOM 551Computer and Network SecuritySlide Set 3 Carl A. Gunter Spring 2004
Basic Encryption • Monoalphabetic substitution ciphers • Polyalphabetic substitution ciphers • Transposition ciphers • Other hiding techniques • Stream versus block ciphers
Sender Transmission Medium Receiver S T R O Interceptor Circumstances
What Can O Do to a Message? • Block it (availability) • Intercept it (confidentiality) • Modify it (integrity) • Fabricate another (integrity)
Terminology • Encryption / Decryption • Encode / Decode • Plaintext / Ciphertext • Cryptography: hidden writing. • Cryptanalysis: uncovering what is hidden.
Monoalphabetic Substitution • Substitute one letter for another • Creates “confusion”
Keyless Encryption • C = E(P) and P = D(C) • P = D(E(P)) • Transmit E(P), receiver applies D. • Select D and E so that • Without knowing D or E it is hard to discover P from E(P). • It is feasible to know and apply D and E.
Caesar Cipher (Original) • E(p) = p + 3 (mod 26) • D(p) = p - 3 (mod 26) • Easy to recall and calculate D and E. Create a table: T R E A T Y I M P O S S I B L E w u h d w b l p s r v v l e o h 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 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
Encryption Strategy: Confusion • The Caesar cipher confuses the letters of the alphabet, causing the result look like gibberish. • As we applied it in the previous example, a space is interpreted as a space, providing no confusion. • Note: changing one letter of plaintext changes exactly one letter of ciphertext.
Algorithm vs. Key • Moreover: • It is hard to keep D and E secret if they are much used, and • Cryptanalysis is possible. • To address the first of these problems assume: algorithm is known, but key is not known.
Encryption with a Key • Symmetric key • C = E(K, P) • P = D(K, C) • P = D(K, E(K, P)) • Asymetric key • C = E(Kpublic, P) • P = D(Kprivate, C) • P = D(Kprivate, E(Kpublic, P))
Permutation • Generalize Caesar cipher to allow other ways to permute the alphabet. • What is now called a Caesar cipher is any choice of an offset: () = (n + ) (mod 26). The number n is the key. • Generalize further: use any permutation as a key. • To encode, apply the key to each letter. • To decode, apply the inverse of the key to each letter.
Sample Permutations • Example: a passphrase like “this is a long key” can be a key. • Example: take every third letter. • () = (3 * ) (mod 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 t h i s a l o n g k e y b c d f j m p q r u v w x 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 Z a d g j m p s v y b e h k n q t w z c f i l o r u x
Cryptanalysis of Monoalphabetic Ciphers • There are 26! permutation keys, so it is not feasible to try all possible keys. • Mapping a space to itself is a big clue: try to guess short words. • Look for common English repeated letters like a “ss” or “oo” • Exploit frequency information wklv phvvdjh lv qrw wrr kdug wr euhdn T--- ------- -- -OT TOO ---- TO -----
Sample Ciphertext • hqfubswlrq lv d phdqv rl dwwdlqlqj vhfxuh frpsxwdwlrq ryhu lqvhfxuh fkdqqhov eb xvlqj hqfubswlrq zh glvjxlvh wkh phvvdjh vr wkdw hyhq li wkh wudqvplvvlrq lv glyhuwhg wkh phvvdjh zloo qrw eh uhyhdohg
Caesar Cipher Example • hqfubswlrq lv d phdqv rl dwwdlqlqj vhfxuh frpsxwdwlrq ryhu lqvhfxuh fkdqqhov eb xvlqj hqfubswlrq zh glvjxlvh wkh phvvdjh vr wkdw hyhq li wkh wudqvplvvlrq lv glyhuwhg wkh phvvdjh zloo qrw eh uhyhdohg • ENCRYPTION IS A MEANS OF ATTAINING SECURE COMMUNICATION OVER INSECURE CHANNELS BY USING ENCRYPTION WE DISGUISE THE MESSAGE SO THAT EVEN IF THE TRANSMISSION IS DIVERTED THE MESSAGE WILL NOT BE REVEALED
Polyalphabetic Cipher • To beat frequency analysis we need to break the connection between frequently occurring ciphertext letters and frequently occurring plaintext letters. • This could be done by varying the translation of letters. • Consider using one translation for letters in even positions and a different one for letters in odd positions.
Two Table Cipher First Table 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 d g j n o s v y b e h k n q t w z c f I l o r u x Second Table 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 n s x c h m r w b g l q v a f k p u z e j o t y d i Example Translation TREAT YIMPO SSIBL E fumnf dyvtv czysh h
Vigenere Tableaux • The distribution can be further flattened by picking complementary permutations. • Another approach: use more tables. • A Vigenere Tableaux is a collection of 26 permutations.
Sample Encryption Using a Vigenere Tableau Encrypt: but soft, what light through yonder window breaks? using keyword juliet julie tjuli etjul ietju lietj uliet julie tjuli e BUTSO FTWHA TLIGH TTHRO UGHYO NDERW INDOW BREAK S koeas ycqsi ...
One-Time Pad • Using a Vigenere tableau with more keys than letters in the message would defeat the techniques we have discussed. • Indeed, this is an unbreakable code. • It’s disadvantage is the long keys required.
History of the One Time Pad • G. Vernam patented an idea for telegraph encryption in 1919. This was based on punched tape from a teletype. 32 alphabets were used in no regular pattern. • W. Kunze, R. Schauffler, and E. Langlotz developed an approach to German diplomatic correspondence circa 1921-1923 from which the name “one time pad” derives. • Pads of 50 numbered sheets were used, with 48 five-digit groups on each. No sheets were used twice; they were destroyed after use.
Long Random Sequences • Middle digits from numbers in a phone book • Book of prose? Danger: frequency analysis possible!
Pseudo-random number generators • Linear congruential random number generator • Seed r(0), constants a, b, n • r(i+1) = (a * r(i) + b) mod n • Probable Word Attack • Solve a family of equations
Transpositions (Permutations) • The order of the letters can be altered. • Columnar transposition example • Memory issues. S M A L L E X A M P L E SMALL EXAMPLE slxpm lalae me
Larger Example THIS IS A MESSAGE TO SHOW HOW A COLUMNAR TRANSPOSITION WORKS This is encoded using 5 columns and 10 rows. T H I S I S A M E S S A G E T O S H O W H O W A C O L U M N A R T R A N S P O S I T I O N W O R K S
Other Encryption Ideas • Open code. • Stegonagraphy. • Fractionated Morse Code. • Foreign languages. • 1918 eight Choctaws in Company D, 141st Infantry. • 50,000 Navaho speakers in WWII. • Only 18 non-Navahos could speak it.
Stream and Block Ciphers • Stream ciphers convert one symbol of plaintext immediately into a symbol of ciphertext. • Polyalphabetic substitution cipher, and • Fractionated Morse, but • Not columnar transposition.
Advantages and Disadvantages • Advantages • Speed • Low error propogation • Disadvantages • Low diffusion • Susceptibility to attacks on integrity
Block Ciphers • Block ciphers encrypt a group of plaintext symbols as one block. • Columnar transposition is an example.
Advantages and Disadvantages • Advantages • Diffusion • Immunity to insertions • Disadvantages • Slowness • Error propogation
Confusion and Diffusion • Confusion: difficulty in determining how a change in the plaintext will affect the ciphertext. • Diffusion: spreading of the effect of a change in the plaintext to many parts of the ciphertext.
Attacks on Encryption • Ciphertext only • Known (or probable) plaintext • Chosen plaintext • Chosen sample of encrypted plaintext • Adaptive chosen plaintext • Ability to gain new chosen samples of encrypted plaintext based on existing samples • Chosen or adaptive chosen ciphertext • Temporary access to decryption
Encryption with a Key (Revision) • Symmetric key • C = E(K, P) • P = D(K, C) • P = D(K, E(K, P)) • Asymetric key • C = E(Kpublic, P) • P = D(Kprivate, C) • P = D(Kprivate, E(Kpublic, P))
Definitions • Trusted Third Party (TTP) • Unconditionally trusted TTP must be trusted completely • Functionally trusted TTP must be trusted for availability and integrity.
Advantages of Symmetric • Efficient encryption • Relatively short keys • Useful as primitives for various functions (pseudorandom number generators, hash functions, etc.) • Good composition properties • Extensive history
Disadvantages of Symmetric • Key must remain secret at both ends. • Many key pairs must be managed in a large network. May require unconditionally trusted TTP. • Keys must be changed frequently. • Large keys or TTP required for public verification function of digital signatures.