Presentation is loading. Please wait.

Presentation is loading. Please wait.

Computer Science 101 Cryptography Part I. Notes based on S. Singh, The Code Book: The Evolution of Secrecy from Mary, Queen of Scots to Quantum Cryptography.

Similar presentations


Presentation on theme: "Computer Science 101 Cryptography Part I. Notes based on S. Singh, The Code Book: The Evolution of Secrecy from Mary, Queen of Scots to Quantum Cryptography."— Presentation transcript:

1 Computer Science 101 Cryptography Part I

2 Notes based on S. Singh, The Code Book: The Evolution of Secrecy from Mary, Queen of Scots to Quantum Cryptography. New York: Doubleday (1999)‏

3 Terminology Steganography – Hiding the message –Under wax of wooden tablets –Shaved heads –Within hardboiled eggs – special ink –Invisible ink –Embedded in pictures or tunes

4 Crypto: The Problem ALICE How do I love thee? Let me count the ways. I love thee to the depth and breadth and height My soul can reach, when feeling out of sight For the ends of Being and ideal Grace. I love thee to the level of every day's Most quiet need, by sun and candlelight. abca adf adCIFASFDSF adfafdasf daf pua,kjpui 8978*&( aadb adae-898 adsf9898b @!!l;kjadsfdsa *()_*()kasjdf*(abac 3(*_*,DAD0-89adfafj &(D()8asdkljfasd;f(_cas adfdasfA(()*Aafdafdfas*( ADFSF9-898DFDFS ASFDFSDF(*DFSCDFS*(_*( DFS*(adfdsaf(*_)dafdas* ASFD9898-08DFSFDSad*(A(* BOB How do I love thee? Let me count the ways. I love thee to the depth and breadth and height My soul can reach, when feeling out of sight For the ends of Being and ideal Grace. I love thee to the level of every day's Most quiet need, by sun and candlelight. abca adf adCIFASFDSF adfafdasf daf pua,kjpui 8978*&( aadb adae-898 adsf9898b @!!l;kjadsfdsa *()_*()kasjdf*(abac 3(*_*,DAD0-89adfafj &(D()8asdkljfasd;f(_cas adfdasfA(()*Aafdafdfas*( ADFSF9-898DFDFS ASFDFSDF(*DFSCDFS*(_*( DFS*(adfdsaf(*_)dafdas* ASFD9898-08DFSFDSad*(A(* EVE

5 Terminology Cryptography – Hiding the meaning –Transposition – letters rearranged Rail fence Wrap around wooden staff –Substitution – substitute letter for letter, etc. Caesar cypher – shift Key in front (remove repeats – example next)

6 Example – Key at front Suppose we used GEORGE BOOLE as key. Then our encoding would be ABCDEFGHIJKLMNOPQRSTUVWXYZ GEORBLMNPQSTUVWXYZACDFHIJK Encoding "TOM WHALEY" would give CWUHNGTBJ This worked for a few centuries (1 st millenium AD)

7 Muslim Scholars Mathematics, statistics, linguistics Abu Ja' far Muhammad ibn Musa Al-Khowasrizmi (algorithm) Algebra Cryptanalysis techniques described by al Kindi in 9 th century

8 Frequency Analysis For a given language (e.g., English), it is known how often each letter occurs: LetterPercentage a8.2 b1.5 c2.8 d4.3 e12.7... z0.1

9 Frequency Analysis So Eve just counts percentages in ciphertext message, and decrypts it: EncryptedPercentageDecoded x8.2a c1.5b p2.8c t4.3d f12.7e... b0.1z

10 Frequency Analysis Only have to encrypt part of the message, and then play “Wheel of Fortune”: _ o _ d_ I _ _ _e _ _ee _ _et _e _ _ _ _t t_e _ _ _s. As length of ciphertext message increases, statistics become more applicable (less so for shorter messages)‏

11 Frequency Analysis Encrypting pairs helps a lot, but then we just use pairwise frequencies instead: PairPercentage aa0.0001 ab0.002 ac0.003... zz0.0005

12 Vigenère Ciphers (1586)‏ 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... 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 –Alice uses a different row to encrypt each letter –She and Bob use a keyword to switch rows....

13 Vigenère Ciphers –E.g., keyword FADE: Keyword F A D E F A D E F A D E F A D Plaintext h o w d o i l o v e t h e e l Ciphertext m 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 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 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

14 Vigenère Ciphers –E.g., keyword FADE: Keyword F A D E F A D E F A D E F A D Plaintext h o w d o i l o v e t h e e l Ciphertext m o 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 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 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

15 Vigenère Ciphers –E.g., keyword FADE: Keyword F A D E F A D E F A D E F A D Plaintext h o w d o i l o v e t h e e l Ciphertext m o 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 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 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 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

16 Vigenère Ciphers –E.g., keyword FADE: Keyword F A D E F A D E F A D E F A D Plaintext h o w d o i l o v e t h e e l Ciphertext m o z 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 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 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

17 Vigenère Ciphers –E.g., keyword FADE: Keyword F A D E F A D E F A D E F A D Plaintext h o w d o i l o v e t h e e l Ciphertext m o z h t 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 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 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

18 Vigenère Ciphers –Now the code for a word is different each time. –Alice must send Bob a new key often, or Eve may figure it out – weakness! –Babbage (1854) : two instances of a common word (the, and,...) will occasionally look the same: Keyword K I N G K I N G K I N G K I N G K I N G K I N G Plaintext t h e s u n a n d t h e m a n i n t h e m o o n Ciphertext D P R Y E V N T N B U K W I A O X B U K W W B T –Then use W-o-F techniques to decode.

19 Vigenère Ciphers –Solution: Use a key the length of the whole message: Keyword P L M O E Z Q K I J Z L R T E A V C R C B Y N N Plaintext t h e s u n a n d t h e m a n i n t h e m o o n Ciphertext I S Q G Y M Q X L C G P D T R I I V Y G N M B A –Problem: making lots of truly random keys People are lazy and will make patterns in keys Truly random numbers are difficult to generate automatically (a huge field)‏ –Bob & Alice share a “one-time-pad” of keys, one for each new message (or new day, week,...)‏

20 Vigenère Ciphers Cracked by Charles Babbage in 1854 Common word will occasionally be encrypted the same way.

21 The Enigma Machine (1926-1945)‏ –Alice types on keyboard. –Scramblers (rotors) randomly wire keyboard to lamps. –Lamp shows encrypted letter. –Scrambler rotates as Alice types. –Scramblers can be removed and swapped with each other. –Add a plugboard to randomize some of the keyboard/scrambler connections.

22 The Enigma Machine –If Eve doesn't have an Enigma machine, she'll never decode a message. –Assuming she has an exact copy of the machine, there are: 26*26*26 = 17,576 possible configurations of three scramblers Six possible orders of three scramblers for each such config Millions or billions of ways of wiring plugboard Therefore over 10,000,000,000,000,000 possible ways of setting up the machine –So Eve must get an Enigma machine, and intercept the updated Bob/Alice scrambler/plugboard settings.

23 Cracking the Enigma: Rejewski, Turing A combination of espionage, genius, and brute force: –Get hold of an enigma machine or blueprints –Obtain some knowledge about what's being transmitted to eliminate most possibilities for initial setup: Part of initial setup was sometimes specified in message itself Early-morning messages had the word weather in specific places (crib: AXQEPAZ = weather )‏ Military messages are more rigidly structured (predictable) than everyday language.

24 Cracking the Enigma: Rejewski, Turing A combination of espionage, genius, and brute force: –Build a model of how the machine operates, to eliminate more possibilities Isolate components; e.g., ignore the plugboard, and build a model of the scramblers. Check correlations between input and output: –Put in M1, get C1 –Put in M2, get C2 –M1 is to C1 as M2 is to C2 –Check every remaining possibility.

25


Download ppt "Computer Science 101 Cryptography Part I. Notes based on S. Singh, The Code Book: The Evolution of Secrecy from Mary, Queen of Scots to Quantum Cryptography."

Similar presentations


Ads by Google