280 likes | 480 Views
Fundamentals of Computer Security. More Classical Ciphers. Attacks on Cryptosystems. Ciphertext Only Attack Chosen-Plaintext Attack Known-Plaintext Attack Rubber-hose Attack. Cryptanalysis.
E N D
Fundamentals of Computer Security More Classical Ciphers CSCI 379 Fundamentals of Computer Security
Attacks on Cryptosystems • Ciphertext Only Attack • Chosen-Plaintext Attack • Known-Plaintext Attack • Rubber-hose Attack CSCI 379 Fundamentals of Computer Security
Cryptanalysis The science of recovering the plaintext of a message without knowledge of the encryption key. Successful cryptanalysis may result in the recovery of a message or an encryption key. Definition:Compromise is the disclosure of a key without the use of any cryptanalysis. Definition: An attack on a cryptosystem is an attempt to recover plaintext or key from a collection of enciphered messages. Kerchoffs’ Principle: Secrecy must rely on the encryption key (the attacker may more easily obtain detailed information on algorithms than key values). CSCI 379 Fundamentals of Computer Security
Ciphertext-Only Attack by Frequency Analysis English Language Affine Cipher k=(m=11,a=5) CSCI 379 Fundamentals of Computer Security
Limitations of Frequency Analysis Mr. Zoliparia laffs. Whare did u get yoor litl pal? he askz. She crold out thi woodwurk, I sez, n he laffs agen an Im evin moar embrasd n getting qwite swety now. Dat dahn ant! Makin a full ov me. N makin mah fais awl beeg an bloted in dat bust shees wukin on now n stew not going bak in hir box Ither. This is a slightly modified passage from Feersum Endjinn, by Iain M. Banks Is it possible to write mangled but understandable English (or any other language) and purposefully alter the relative frequencies of individual characters and perhaps even of digrams, trigrams, etc? Is it possible to write large chunks of text avoiding one specific letter? Ultimately, what we are asking ourselves is: can we create plaintext that distorts the language signature so much that it makes ciphertext frequency analysis hard? Does frequency analysis work on short texts? How large do texts need to be for it to work well? CSCI 379 Fundamentals of Computer Security
Homophonic Substitution Cipher • Use a larger ciphertext alphabet. Then, to each plaintext letter, map a number of ciphertext symbols that is proportional to the relative frequency of the original letter in the language of the plaintext. • h • For instance: • (A): represented by 8 symbols • (B): represented by 2 symbols • (C): represented by 2 symbols • (D): represented by 4 symbols • (E): represented by 12 symbols • ... The goal is to create a cipher more resistant to frequency analysis by equalizing relative frequencies. Question: How does one break this cipher? CSCI 379 Fundamentals of Computer Security
Secret Writing Codes Steganography Ciphers Public Key Symmetric Key Unkeyed Classical Stream Block Transposition Substitution Polyalphabetic Monoalphabetic Vigenère Autokey Polygraphic Playfair Additive Multiplicative Affine Random Multiliteral Homophonic CSCI 379 Fundamentals of Computer Security
Polyalphabetic Ciphers CSCI 379 Fundamentals of Computer Security
The Vigenère Cipher Key = king PLAINTEXT: HERE BE DRAGONS ciphertext: xwey rw qlqybhi Each character from the plaintext is enciphered using a different alphabet, which is determined by the corresponding character in the key. This is a polyalphabetic cipher. POSSIBLE KEY VALUES: ? WEAK KEYS: ? QUESTIONS CSCI 379 Fundamentals of Computer Security
Breaking VigenèreFrequency Analysis Ideally, a cipher would completely flatten the single letter frequencies bars. The Vigenère cipher doesn’t quite meet this goal, but it does a better job than other ciphers we’ve seen. Now, what? CSCI 379 Fundamentals of Computer Security
Breaking Vigenère CSCI 379 Fundamentals of Computer Security
Breaking Vigenère Assume that the ciphertext has n symbols. We can now define an Index of Coincidence, a metric that tells us the probability that two letters randomly chosen from a text are identical: CSCI 379 Fundamentals of Computer Security
Breaking Vigenère The Friedman Test For a monoalphabetic cipher: IC = 0.066. Given a ciphertext, compute its IC. If it is near 0.066, the cipher is probably monoalphabetic. If it is much smaller than 0.066, the cipher is probably polyalphabetic. From the IC, you can also determine the length of the key word. Another helpful tool in this test is the Kasiski test. CSCI 379 Fundamentals of Computer Security
Breaking Vigenère The Kasiski Test • Find groups of symbols that appear repeatedly in the ciphertext. • Count the number of symbols between the repetitions (you’re computing the distance between repetitions). • Find the prime factors of the numbers discovered above. • The most common factor is likely to be the length of the keyword. CSCI 379 Fundamentals of Computer Security
The Vigenère Tableau 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 CSCI 379 Fundamentals of Computer Security
Vigenère as a Stream Cipher practically since humans began writing, they have been writing in code, and ciphers have decided the fates of empires… Vigenère Tableau ciphertext …yllacitcarp …emkrwrasfgh plaintext Think of the plaintext as a stream of characters. Now, instead of repeatedly using the same key value, use a key stream, an array of characters as long as the plaintext. Encipher each character from the plaintext using the Vignere tableau with the corresponding character in the key stream. …wqtriwhgfd dfghwirtqwqqxcmloppgjlqerjimaqcxxnhlorxcqaghikplorrethudaloextgrtewcklpoasejdqqtyredkvythjeukdw… key stream CSCI 379 Fundamentals of Computer Security
The Autokey Cipher practically since humans began writing, they have been writing in code, and ciphers have decided the fates of empires… Vigenère Tableau ciphertext …yllacitcarp …emkrwrasfgh plaintext …wqtriwhgfd key stream: starts off with a sequence of letters, a key value used to prime the key stream. royal flags wave kings above practically since humans began writing, they have been writing in code, and ciphers have decided the fates of empires… CSCI 379 Fundamentals of Computer Security
One Time Pads practically since humans began writing, they have been writing in code, and ciphers have decided the fates of empires… (p+k) % 26 ciphertext …yllacitcarp …emkrwrasfgh plaintext If each message is encrypted with a key stream built as a nonrepeating set of truly random letters that is used only once, we have a perfect encryption scheme. …wqtriwhgfd dfghwirtqwqqxcmloppgjlqerjimaqcxxnhlorxcqaghikplorrethudaloextgrtewcklpoasejdqqtyredkvythjeukdw… Question: If this is the perfect cryptosystem, why isn’t it used? key stream CSCI 379 Fundamentals of Computer Security
Transposition Ciphers CSCI 379 Fundamentals of Computer Security
A Simple Transposition Cipher • The “key” information for enciphering and deciphering is: • number of rows • number of columns • write in order • take off order take off (rows) write in (columns) CSCI 379 Fundamentals of Computer Security
A Simple Transposition Cipher PLAINTEXT:…EVENTHOSETHATAREBORNINENGLANDBECOME… ciphertext: …esrndveeebetbnenhogctarlohtnamoaine… • Questions: • Can frequency analysis help one break a transposition cipher? • What is the effect of transposition on the encipherment? CSCI 379 Fundamentals of Computer Security
Transposition as a Block Cipher plaintext cipher text practica llysince humansbe ganwriti ngtheyha vebeenwr itinginc odeandci phershav edecided thefates ofempire s… patcrcia lyiclsne hmnbuase gnrtawii ntehghya vbeweenr itinginc oencdadi pesahrhv eeiedcdd teaehfts oeprfmie s… transposition 8-letter blocks 8-letter blocks CSCI 379 Fundamentals of Computer Security
Polygraphic Ciphers CSCI 379 Fundamentals of Computer Security
The Playfair Cipher First step: Condition the text by replacing all occurrences of “j” with “i”. Second step: Divide the plaintext into pairs. Where there are double letters, separate them with an “x”. Add a “z” to the final text if the last group has a single letter. Example: “LORD GRANVILLE” becomes “ lo rd gr an vi lx le sl et te rz.” Third step: Encipher the plaintext one pair at a time. If the two letters are in the same row or column, replace them by the succeeding letters (“AM” becomes “le”). If the two letters stand at the corners of a rectangle in the table, replace them with the letters at the other two corners (“LO” becomes “mt”). Sir Charles Wheatstone, 1854 Key = palmerston CSCI 379 Fundamentals of Computer Security