Top Banner
CRYPTOGRAPHY Lecture 5
24

CRYPTOGRAPHY Lecture 5. 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 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 D E F G H I J K L M.

Dec 21, 2015

Download

Documents

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: CRYPTOGRAPHY Lecture 5. 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 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 D E F G H I J K L M.

CRYPTOGRAPHY

Lecture 5

Page 2: CRYPTOGRAPHY Lecture 5. 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 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 D E F G H I J K L 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 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 D E F G H I J K L M N O P Q R S T U V W X Y Z A BD E F G H I J K L M N O P Q R S T U V W X Y Z A B CE F G H I J K L M N O P Q R S T U V W X Y Z A B C DF G H I J K L M N O P Q R S T U V W X Y Z A B C D EG H I J K L M N O P Q R S T U V W X Y Z A B C D E FH I J K L M N O P Q R S T U V W X Y Z A B C D E F GI J K L M N O P Q R S T U V W X Y Z A B C D E F G HJ K L M N O P Q R S T U V W X Y Z A B C D E F G H IK L M N O P Q R S T U V W X Y Z A B C D E F G H I JL 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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

SAVEMEPLEASE plain text

CRYPTOGRAMCR keyword

URTTFSVCEMUV enciphered

The first letter, S is encrypted using the row beginning with CThe second letter, A is encryted using the row beginning with RThe third letter, V is encrypted using the row beginning with YThe fourth letter, E, is encrypted using the row beginning with P.And so on . . .

You can use http://www.simonsingh.net/The_Black_Chamber/v_square.html

Page 3: CRYPTOGRAPHY Lecture 5. 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 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 D E F G H I J K L M.

Breaking the Vigenere cipher

• It wasn't until 1854, over two hundred years later, that the Vigenère Cipher was finally cracked by the British cryptographer Charles Babbage. Babbage employed a mix of cryptographic genius, intuition and sheer cunning to break the Vigenère Cipher. Amazingly, his work was never published in his lifetime, and it was over a hundred years later, in the 1970's, that his technique was finally made public.

This slide and the next few copied directly from Simon Singh’s website.

Page 4: CRYPTOGRAPHY Lecture 5. 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 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 D E F G H I J K L M.

Vigenere cipher: the unbreakable code

The strength of the Vigenère Cipher is that the same letter can be encrypted in different ways. For example, if the keyword is KING, then every plaintext letter can be encrypted in 4 ways, because the keyword contains 4 letters. Each letter of the keyword defines a different cipher alphabet in the Vigenère Square. Whole words will be enciphered in different ways - the word 'the' could be enciphered as DPR, BUK, GNO and ZRM depending on its position relative to the keyword. Although this makes cryptanalysis difficult, it is not impossible.

This slide and the next few copied directly from Simon Singh’s website.

Page 5: CRYPTOGRAPHY Lecture 5. 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 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 D E F G H I J K L M.

Breaking the Vigenere cipher: the unbreakable code

The important point to note is that if there are only four ways to encipher the word 'the', and the original message contains several uses of the word 'the', then it is inevitable that some of the four possible encipherments will be repeated in the ciphertext. This is demonstrated in the following example, in which the line "The Sun and the Man in the Moon", has been enciphered using the Vigenere cipher and the keyword KING.

This slide and the next few copied directly from Simon Singh’s website.

Page 6: CRYPTOGRAPHY Lecture 5. 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 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 D E F G H I J K L M.

Breaking the Vigenere cipher

KINGKINGKINGKINGKINGKING keyword

THESUNANDTHEMANINTHEMOON plaintext

DPRYEVNTNBUKWIAOXBUKWWBT cipher

The letters BUK repeat after 8 letters. This suggests that the number of letters in the keyword is a factor of 8. So, the keyword has 2, 4, or 8 letters.

Page 7: CRYPTOGRAPHY Lecture 5. 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 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 D E F G H I J K L M.

Breaking the Vigenere cipher

The word 'the' is enciphered as DPR in the first instance, and then as BUK on the second and third occasions. The reason for the repetition of BUK is that the second 'the' is displaced by 8 letters with respect to the third 'the', and 8 is a multiple of the length of the keyword. In other words, the second 'the' was enciphered according to its relationship to the keyword, and by the time we reach the third 'the', the keyword has cycled round exactly twice, to repeat the relationship.

This slide and the next few copied directly from Simon Singh’s website.

Page 8: CRYPTOGRAPHY Lecture 5. 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 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 D E F G H I J K L M.

Breaking the Vigenere cipher

Babbage's vital breakthrough was to realize that repetitions in the ciphertext indicated repetitions in the plaintext and that the space between such repetitions hinted at the length of the keyword.

Page 9: CRYPTOGRAPHY Lecture 5. 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 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 D E F G H I J K L M.

Breaking the Vigenere cipher

Once the length of the keyword is determined, the message can be broken up into the corresponding number of messages, each one is a caesar shifted cipher, and amenable to frequency analysis.

This is how Babbage cracked the Vigènere Cipher.

Page 10: CRYPTOGRAPHY Lecture 5. 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 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 D E F G H I J K L M.

Breaking the Vigenere cipher

This slide and the next few copied directly from Simon Singh’s website.

Babbage defined a series of steps to crack the Vigenère Cipher. Let us try to decipher a sample ciphertext.

We know that it is enciphered using the Vigenère Cipher, but we know nothing about the original message or the keyword.

http://www.simonsingh.net/The_Black_Chamber/cracking_example.html

Page 11: CRYPTOGRAPHY Lecture 5. 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 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 D E F G H I J K L M.

Breaking the Vigenere cipher

RIKVBIYBITHUSEVAZMMLTKASRNHPNPZICSWDSVMBIYFQEZUBZPBRGYNTBURMBECZQKBMBPAWIXSOFNUZECNRAZFPHIYBQEOCTTIOXKUNOHMRGCNDDXZWIRDVDRZYAYYICPUYDHCKXQIECIEWUICJNNACSAZZZGACZHMRGXFTILFNNTSDAFGYWLNICFISEAMRMORPGMJLUSTAAKBFLTIBYXGAVDVXPCTSVVRLJENOWWFINZOWEHOSRMQDGYSDOPVXXGPJNRVILZNAREDUYBTVLIDLMSXKYEYVAKAYBPVTDHMTMGITDZRTIOVWQIECEYBNEDPZWKUNDOZRBAHEGQBXURFGMUECNPAIIYURLRIPTFOYBISEOEDZINAISPBTZMNECRIJUFUCMMUUSANMMVICNRHQJMNHPNCEPUSQDMIVYTSZTRGXSPZUVWNORGQJMYNLILUKCPHDBYLNELPHVKYAYYBYXLERMMPBMHHCQKBMHDKMTDMSSJEVWOPNGCJMYRPYQELCDPOPVPBIEZALKZWTOPRYFARATPBHGLWWMXNHPHXVKBAANAVMNLPHMEMMSZHMTXHTFMQVLILOVVULNIWGVFUCGRZZKAUNADVYXUDDJVKAYUYOWLVBEOZFGTHHSPJNKAYICWITDARZPVU

Page 12: CRYPTOGRAPHY Lecture 5. 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 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 D E F G H I J K L M.

Breaking the Vigenere cipher

RIKVBIYBITHUSEVAZMMLTKASRNHPNPZICSWDSVMBIYFQEZUBZPBRGYNTBURMBECZQKBMBPAWIXSOFNUZECNRAZFPHIYBQEOCTTIOXKUNOHMRGCNDDXZWIRDVDRZYAYYICPUYDHCKXQIECIEWUICJNNACSAZZZGACZHMRGXFTILFNNTSDAFGYWLNICFISEAMRMORPGMJLUSTAAKBFLTIBYXGAVDVXPCTSVVRLJENOWWFINZOWEHOSRMQDGYSDOPVXXGPJNRVILZNAREDUYBTVLIDLMSXKYEYVAKAYBPVTDHMTMGITDZRTIOVWQIECEYBNEDPZWKUNDOZRBAHEGQBXURFGMUECNPAIIYURLRIPTFOYBISEOEDZINAISPBTZMNECRIJUFUCMMUUSANMMVICNRHQJMNHPNCEPUSQDMIVYTSZTRGXSPZUVWNORGQJMYNLILUKCPHDBYLNELPHVKYAYYBYXLERMMPBMHHCQKBMHDKMTDMSSJEVWOPNGCJMYRPYQELCDPOPVPBIEZALKZWTOPRYFARATPBHGLWWMXNHPHXVKBAANAVMNLPHMEMMSZHMTXHTFMQVLILOVVULNIWGVFUCGRZZKAUNADVYXUDDJVKAYUYOWLVBEOZFGTHHSPJNKAYICWITDARZPVU

Page 13: CRYPTOGRAPHY Lecture 5. 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 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 D E F G H I J K L M.

Breaking the Vigenere cipher

Figure out the frequency tables for this message (show file) See what length the keyword is: 7 is a good guess.

Page 14: CRYPTOGRAPHY Lecture 5. 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 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 D E F G H I J K L M.

Breaking the Vigenere cipher

It seems probable that the keyword is 7 letters long. For the time being let us call the keyword L1-L2-L3-L4-L5-L6-L7. The letter L1 defines one row of the Vigenère square, and effectively provides a monoalphabetic substitution cipher alphabet for the first letter of the plaintext, and also the 8th 15th 22nd  letters, etc. So if we take the corresponding letters in the ciphertext, we know they have been encrypted using the same row of the Vigenère square, and we can work out which row by using frequency analysis, because each row of the square is equivalent to one monoalphabetic cipher. This polyalphabetic cipher consists of cycling between  7 monoalphabetic ciphers.

Page 15: CRYPTOGRAPHY Lecture 5. 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 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 D E F G H I J K L M.

Breaking the Vigenere cipher

Now we perform a frequency analysis of the portion of the ciphertext corresponding to each of the shifts. This should give us a good idea of the keyword.

Page 16: CRYPTOGRAPHY Lecture 5. 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 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 D E F G H I J K L M.

HW#5a: breaking a Vigenere cipher message

Use the Vigenere cipher to encrypt a longish message. Then swap with other groups and try to break the code. Remember that you will need some computational help . . . Or a lot of time and brain power.

Page 17: CRYPTOGRAPHY Lecture 5. 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 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 D E F G H I J K L M.

Ciphers

• Monoalphabetic ciphers are easy to encode, but also easy to break.

• Polyalphabetic ciphers are hard to break, but also hard to use.

• Something in the middle:– Homophonic substitution ciphers

Page 18: CRYPTOGRAPHY Lecture 5. 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 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 D E F G H I J K L M.

Ciphers• Monoalphabetic ciphers: each letter in the

plaintext is encoded by only one letter from the cipher alphabet, and each letter in the cipher alphabet represents only one letter in the plaintext.

• Polyalphabetic ciphers: each letter in the plaintext can be encoded by any letter in the cipher alphabet, and each letter in the cipher alphabet may represent different letters from the plaintext each time it appears.

Page 19: CRYPTOGRAPHY Lecture 5. 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 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 D E F G H I J K L M.

Example: Homophonic CiphersA 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

09 48 13 01 14 10 06 23 32 15 04 26 22 18 00 38 94 29 11 17 08 34 60 28 21 02

12 81 41 03 16 31 25 39 70 37 27 58 05 95 35 19 20 61 89 52

33 62 45 24 50 73 51 59 07 40 36 30 63 47 79 44 56 83 84 66 54 42 76 4353 46 65 88 71 72 77 86 4967 55 68 93 91 90 80 96 6978 57 99 7592 64 85 74 97 82 87 98

Encode letters which are more frequent by more possible numbers. We therefore need more than 26 cipher symbols. Each letter in plaintext has several ciphertext representations, but each ciphertext letter only represents one plaintext letter. So this is still a type of monoalphabetic cipher, but it is not amenable to frequency analysis.

Page 20: CRYPTOGRAPHY Lecture 5. 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 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 D E F G H I J K L M.

Homophonic CiphersThe homophonic cipher is still a type of monoalphabetic cipher, mainly because once the cipher alphabet is set, it does not change.It is not amenable to frequency analysis, but it is breakable by digraph analysis. For example, the letter Q is a funny letter – in English it always appears in combination with a uQU, so if we find a letter which is only ever followed by a small number (2-4) of letters, we can assume they make a QU pair.

Page 21: CRYPTOGRAPHY Lecture 5. 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 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 D E F G H I J K L M.

HW#6b: Homophonic Ciphers

97 68 55 65 99 22 99 95 23 90 59 88 13 62 83 38 56 44 77 88 19 22 63 62 56 27 00 29 82 11 82 62 61 80 57 30 50 12 91 67 35 24 06 08 51 09 77 27 99 58 99 33 84 38 56 12 48 24 75 88 62 62 88 95 39 98 35 48 63 43 83 49 88 19 58 99 43 38 87 40 31 82 13 85 24 83 97 23 16 29

Page 22: CRYPTOGRAPHY Lecture 5. 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 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 D E F G H I J K L M.

Digraph ciphers

A digraph cipher encrypts by substituting each digraph (i.e. pair of letters) in the message with a different digraph or symbol. In the digraph cipher shown here, each plaintext digraph is substituted with a digraph from the square. For example, 'as' is encrypted by finding the intersection of the column headed by 'a' with the row headed by 's', which gives us NO. So, the plaintext digraph 'as' is substituted with the ciphertext digraph NO. This digraph cipher much harder to break than a single letter cipher, because the codebreaker has to identify the true value of 676 digraphs, as opposed to struggling with just 26 letter substitutions.

Page 23: CRYPTOGRAPHY Lecture 5. 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 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 D E F G H I J K L M.

Digraph ciphersThe Great Cipher of the Rossingols

A digraph cipher encrypts by substituting each digraph (i.e. pair of letters) in the message with a different digraph or symbol. In the digraph cipher shown here, each plaintext digraph is substituted with a digraph from the square. For example, 'as' is encrypted by finding the intersection of the column headed by 'a' with the row headed by 's', which gives us NO. So, the plaintext digraph 'as' is substituted with the ciphertext digraph NO. This digraph cipher much harder to break than a single letter cipher, because the codebreaker has to identify the true value of 676 digraphs, as opposed to struggling with just 26 letter substitutions.

Page 24: CRYPTOGRAPHY Lecture 5. 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 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 D E F G H I J K L M.

Digraph ciphersThe Great Cipher of the Rossingols

This cipher was only broken 200 years later, by Etiemme Bazeries. He used frequency analysis to figure out what the most common digraphs were in the messages and compared them to the most common digraphs. But this did not lead him far. The code was not all digraphs, some letters were used too. And the Rossingols were sneaky – they introduced pitfalls such as a number that represented neither a letter nor a digraph, only an instruction to delete the previous letter. Bazeries managed to make headway by identifying the cluster 124-22-125-46-345 several times and postulating that this represented les-en-ne-mi-s. This crucial breakthough allowed him to complete new words by knowing parts, thus identifying more symbols and in turn figuring out more words.