1 Codes, Ciphers, and Cryptography-Ch 2.2 Michael A. Karls Ball State University.

Slides:



Advertisements
Similar presentations
CAP Cryptographic Analysis Program
Advertisements

1 Codes, Ciphers, and Cryptography-Ch 2.3 Michael A. Karls Ball State University.
1 Codes, Ciphers, and Cryptography-Ch 2.1 Michael A. Karls Ball State University.
Cryptography Cryptography: art or science of keeping messages secret Cryptology: branch of mathematics that studies the mathematical foundations of cryptographic.
Introduction to Cryptography and Security Mechanisms Dr Keith Martin McCrea
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.
CYPHER INDEX n Introduction n Background n Demo INTRODUCTION n Cypher is a software toolkit designed to aid in the decryption of standard (historical)
CS526Topic 2: Classical Cryptography1 Information Security CS 526 Topic 2 Cryptography: Terminology & Classic Ciphers.
1 Codes, Ciphers, and Cryptography-Ch 3.1 Michael A. Karls Ball State University.
Chapter 2 – Classical Encryption Techniques
Section 2.4 Transposition Ciphers Definition: A Transposition Cipher is a cipher in which the plaintext message is rearranged by some means agreed upon.
3.1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 3 Traditional Symmetric-Key Ciphers.
3.1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 3 Traditional Symmetric-Key Ciphers.
1 Introduction to Codes, Ciphers, and Cryptography Michael A. Karls Ball State University.
Section 2.3: Substitution Ciphers Practice HW from Barr Textbook (not to hand in) p. 92 # 1, 2 # 3-5 (Use Internet Site)Use Internet Site.
Polyalphabetic Substitution Ciphers. First Steps Towards Complexity  If one alphabet is good, then two alphabets must be better!  By doubling the number.
Classical Monoalphabetic Ciphers Day 2. Keyword cipher Select a keyword, if the keyword has any repeated letters, drop all but the first occurrence. Write.
Cryptanalysis of the Vigenere Cipher Using Signatures and Scrawls To break a Vigenere cipher you need to know the keyword length. – The Kasiski and Friedman.
Section 2.4 Transposition Ciphers Practice HW (not to hand in) From Barr Text p. 105 #
Chapter 2 Basic Encryption and Decryption. csci5233 computer security & integrity 2 Encryption / Decryption encrypted transmission AB plaintext ciphertext.
Cryptography Programming Lab
Section 2.2: Affine Ciphers; More Modular Arithmetic Practice HW (not to hand in) From Barr Textbook p. 80 # 2a, 3e, 3f, 4, 5a, 7, 8 9, 10 (Use affinecipherbreaker.
1 University of Palestine Information Security Principles ITGD 2202 Ms. Eman Alajrami 2 nd Semester
Week 2 - Wednesday.  What did we talk about last time?  Encryption  Shift ciphers  Transposition ciphers.
CS110: Computers and the Internet Encryption and Certificates.
Section 2.1: Shift Ciphers and Modular Arithmetic The purpose of this section is to learn about modular arithmetic, which is one of the fundamental mathematical.
Topic 21 Cryptography CS 555 Topic 2: Evolution of Classical Cryptography CS555.
Bit Cipher 1. Example of bit Cipher 2 Practical Stream Cipher 3.
Section 2.7: The Friedman and Kasiski Tests Practice HW (not to hand in) From Barr Text p. 1-4, 8.
Rather than just shifting the alphabet Could shuffle (jumble) the letters arbitrarily Each plaintext letter maps to a different random cipher text letter.
Symmetric-Key Cryptography
Module :MA3036NI Cryptography and Number Theory Lecture Week 3 Symmetric Encryption-2.
Polyalphabetic CIPHERS Linguistics 484. Summary The idea How to recognize: index of coincidence How many alphabets: Kasiski.
Classic Cryptography History. Some Basic Terminology plaintext - original message ciphertext - coded message cipher - algorithm for transforming plaintext.
1 University of Palestine Information Security Principles ITGD 2202 Ms. Eman Alajrami.
Introduction to Ciphers Breno de Medeiros. Cipher types From “Cipher”, Wikipedia article.
Abstract: Cryptology is a combination of the processes of keeping a message secret (cryptography) and trying to break the secrecy of that message (cryptoanalysis).
© G. Dhillon, IS Department Virginia Commonwealth University Principles of IS Security Cryptography and Technical IS Security.
Data Security and Encryption (CSE348) 1. Lecture # 4 2.
1 Cryptanalysis Four kinds of attacks (recall) The objective: determine the key ( Herckhoff principle ) Assumption: English plaintext text Basic techniques:
Section 2.5: Polyalphabetic Substitutions Practice HW (not to hand in) From the Barr Text p. 118 # 1-6.
Traditional Symmetric-Key Ciphers
Web Tools for Classical Cryptology Tristan Beeble.
Vigenere Cipher For example, choose a word “GOLD” for a key. And, add “GOLDGOLDGOLD….” to your plaintext Plaintext: t o o m u c h h y p e Key : GOLDGOLDGOLD.
Section 2.2: Affine Ciphers; More Modular Arithmetic Shift ciphers use an additive key. To increase security, we can add a multiplicative parameter. –For.
Section 2.5 Polyaphabetic Substitutions
Section 2.3: Substitution Ciphers
Vigenére Cipher Kimberly Chiffens & Maria Jannelli.
Encryption CS110: Computer Science and the Internet.
Introduction to Cryptography Lecture 8. Polyalphabetic Substitutions Definition: Let be different substitution ciphers. Then to encrypt the message apply.
Vigenére Cipher Kimberly Chiffens & Maria Jannelli.
Network Security Lecture 13 Presented by: Dr. Munam Ali Shah.
CS526Topic 2: Classical Cryptography1 Information Security CS 526 Topic 2 Cryptography: Terminology & Classic Ciphers.
Encryption. LEARNING OBJECTIVES: BY THE END OF THE LESSON YOU SHOULD KNOW. What encryption is and why it is important The basics of encryption techniques.
@Yuan Xue CS 285 Network Security Cryptography Overview and Classical Encryption Algorithms Fall 2012 Yuan Xue.
CS480 Cryptography and Information Security Huiping Guo Department of Computer Science California State University, Los Angeles 4. Traditional and Modern.
3.1 Chapter 3 Traditional Symmetric-Key Ciphers Part2.
Substitution Ciphers.
Chapter 2 Basic Encryption and Decryption
CAP Cryptographic Analysis Program
Asad Gondal Ali Haider Mansoor
By: Mohsin Tahir waqas Akram Numan-Ul-Haq Ali Asghar Rao Arslan
Section 2.7 The Friedman and Kasiski Tests
Computer and Data Security 4th Class
Polyalphabetic Ciphers
Outline Some Basic Terminology Symmetric Encryption
Classical Polyalphabetic Ciphers
Kasiski Method Reference
Cryptanalysis of Vigenere Cipher
Traditional Symmetric-Key Ciphers
Presentation transcript:

1 Codes, Ciphers, and Cryptography-Ch 2.2 Michael A. Karls Ball State University

2 Breaking the Vigenère Cipher Suppose we have intercepted the following ciphertext (handout):  DBZMG AOIYS OPVFH OWKBW XZPJL VVRFG NBKIX DVUIM OPFQL VVPUD KPRVW OARLW DVLMW AWINZ DAKBW MMRLW QIICG PAKYU CVZKM ZARPS DTRVD ZWEYG ABYYE YMGYF YAFHL CMWLW LVCHL MMGYL DBZIF JNCYL OMIAJ JCGMA IBVRL OPVFW OBVLK OPVUJ ZDVLQ XWDGG IQEYF BTZMZ DVRMM ANZWA ZVKFQ GWEAL ZFKNZ ZZVCK VDVLQ BWFXU CIEWW OPRMU JZIYK KWEXA IOIYH ZIKYV GMKNW MOIIM KADUQ WMWIM ILZHL CMTCH CMINW SBRHV OPVSO DTCMGHMKCE ZASYD JKRNW YIKCF OMIPS GAFZK JUVGM GBZJD ZWWNZ ZVLGT ZZFZS GXYUT ZBJCF PAVNZ ZAVWS IJVZG PVUVQ NKRHF DVXNZ ZKZJZ ZZKYP OIEXX MWDNZ ZQIMH VKZHY DVKYD GQXYF OOLYK NMJGS YMRML JBYYF PUSYJ JNRFH CISYL N We suspect that this message may have been enciphered using a Vigenère cipher. How can we decipher the message?

3 Breaking the Vigenère Cipher (cont.) In order to get an idea of what to do, consider the following example. In this example, the keyword VENUS is used with our Vigenère square handout to encipher a message!

4 Breaking the Vigenère Cipher (cont.) Example 3: Use the keyword VENUS and the Vigenère square to encipher “the cat in the hat is near the mat”. Solution: VENUSVENUSVENU thecatinthehat OLRWSOMANZZLNN SVENUSVENUSV isnearthemat ANRRUJOLRGSO plaintext ciphertext plaintext ciphertext

5 Breaking the Vigenère Cipher (cont.) How is the word “the” enciphered? “the”  OLR, NZZ, and OLR VENUSVENUSVENU thecatinthehat OLRWSOMANZZLNN SVENUSVENUSV isnearthemat ANRRUJOLRGSO plaintext ciphertext plaintext ciphertext

6 Breaking the Vigenère Cipher (cont.) How is the word “the” enciphered? “the”  OLR, NZZ, and OLR VENUSVENUSVENU thecatinthehat OLRWSOMANZZLNN SVENUSVENUSV isnearthemat ANRRUJOLRGSO plaintext ciphertext plaintext ciphertext

7 Breaking the Vigenère Cipher (cont.) The third occurrence of “the” is the same as the first because the same key letters are used to encrypt the t, h, and e. Different key letters are used for the second “the”. VENUSVENUSVENU thecatinthehat OLRWSOMANZZLNN SVENUSVENUSV isnearthemat ANRRUJOLRGSO plaintext ciphertext plaintext ciphertext

8 Breaking the Vigenère Cipher (cont.) Notice that the distance between the “t” in the first “the” and the “t” in the third “the” is 20 letters. 20 is a multiple of the length of the keyword VENUS, which has 5 letters! VENUSVENUSVENU thecatinthehat OLRWSOMANZZLNN SVENUSVENUSV isnearthemat ANRRUJOLRGSO plaintext ciphertext plaintext ciphertext

9 Breaking the Vigenère Cipher (cont.) This is true for Vigenère ciphers in general! If a plaintext sequence is repeated at a distance that is a multiple of the length of the keyword, then the corresponding ciphertext sequences are also repeated. Handout example (Fig. 2.3 from Beutelspacher).

10 Breaking the Vigenère Cipher (cont.) In 1854, Charles Babbage used this idea to guess the length of a keyword for a Vigenère cipher!  John Hall Brock Thwaites claimed to have invented a new cipher.  Babbage told Thwaites that his cipher was the Vigenère cipher.  Thwaites challenged Babbage to break his cipher.  Babbage never published this idea—why? In 1863 Friedrich Wilhelm Kasiski independently discovered the idea of looking for repeated ciphertext sequences to find a Vigenère cipher’s key length.

11 The Kasiski Test 1. Look for repeated sequences of three or more letters in a ciphertext.  Equal pairs can occur too often to be of use. 2. Find the distances between these repeated sequences and list the factors of each distance.  For example, if the distance is d = 18 letters, then the factors are 1, 2, 3, 6, 9, and 18.

12 The Kasiski Test (cont.) 3. Look for the most commonly occurring factors greater than 1.  A keyword of length 1 corresponds to a monoalphabetic cipher!  The most commonly occurring factors are candidates for the length L of the keyword.

13 The Kasiski Test (cont.) When using the Kasiski Test, keep the following in mind:  Ciphertext sequences may repeat accidentally at a distance that is not a multiple of the keyword length.  The most commonly occurring factors found in in Step 3 of the Kasiski Test may be a factor of the keyword length!  Therefore, one may need to consider multiples of possible keyword lengths as potential keyword lengths!

14 The Kasiski Test (cont.) Example 4: Apply the Kasiski Test to the following ciphertext, which is suspected of being a Vigenere cipher!  ZRZNSPCWQGFWLWQGFRGRZNSTZBGTRM NEOXCXRPUBSEYWQGHLSIJKGWDSXSSLSI XKKUJPHKBWHW For Step 1 of the test, see Simon Singh's Vigenère Cipher Cracking Tool.Simon Singh's Vigenère Cipher Cracking Tool

15 The Kasiski Test (cont.) Other ways to find distances between repeated sequences of ciphertext:  Use a program on the web – check with Google, but watch out for viruses!  Use Microsoft Word’s Find and Replace feature. The only drawback is you have to find the repeated sequences “by hand”.

16 The Kasiski Test (cont.) Step 2: Make a table of the distances and their factors greater than or equal to two. Distance Factors of Distances

17 The Kasiski Test (cont.) Step 2: Make a table of the distances and their factors greater than or equal to two. Distance xxx Factors of Distances

18 The Kasiski Test (cont.) Step 2: Make a table of the distances and their factors greater than or equal to two. Distance xxx 12xxxxx Factors of Distances

19 The Kasiski Test (cont.) Step 2: Make a table of the distances and their factors greater than or equal to two. Distance xxx 12xxxxx 18xxxxx 30 Factors of Distances

20 The Kasiski Test (cont.) Step 2: Make a table of the distances and their factors greater than or equal to two. Factors of Distances Distance xxx 12xxxxx 18xxxxx 30xxxxxxx

21 The Kasiski Test (cont.) Step 3: The most commonly occurring factors in the table are 2, 3, and 6. Distance xxx 12xxxxx 18xxxxx 30xxxxxxx Factors of Distances

22 The Kasiski Test (cont.) The greatest common divisor of all distances between repeated sequences of ciphertext is 6.  Guess that the keyword length is L = 6.  Note that L = 12, 18, or 30 could be possible (these are multiples of 6). Distance xxx 12xxxx? 18xxxx? 30xxxxxx? Factors of Distances

23 Using Frequency Analysis to Attack the Vigenère Cipher As Example 4 shows, we can use the Kasiski Test to get an idea of the keyword length for a Vigenère cipher. Now that we “know” the keyword length, how do we use this information to break the cipher?  Note that each time a certain keyword letter is used to encrypt, the same row of the Vigenere square is used, i.e. the same cipher alphabet is used!  Therefore, we can apply frequency analysis to the subsets of the ciphertext encrypted with each keyword letter!

24 Using Frequency Analysis to Attack the Vigenère Cipher (cont.) For example, suppose the keyword in the cipher of Example 4 is six letters long. Write the keyword as S 1 S 2 S 3 S 4 S 5 S 6, with unknown letters S i to be determined. Split up the ciphertext in the following way:

25 Using Frequency Analysis to Attack the Vigenère Cipher (cont.) S1S1 S2S2 S3S3 S4S4 S5S5 S6S6 ZRZNSP CWQGFW LWQGFR GRZNST ZBGTRM ……………… Letter S i of keyword Position of letter in keyword i i+6 i+12 i+18 i+24

26 Using Frequency Analysis to Attack the Vigenère Cipher (cont.) S1S1 S2S2 S3S3 S4S4 S5S5 S6S6 ZRZNSP CWQGFW LWQGFR GRZNST ZBGTRM ……………… Letter S i of keyword Position of letter in keyword i i+6 i+12 i+18 i+24 Column 1 is encrypted by S 1

27 Using Frequency Analysis to Attack the Vigenère Cipher (cont.) S1S1 S2S2 S3S3 S4S4 S5S5 S6S6 ZRZNSP CWQGFW LWQGFR GRZNST ZBGTRM ……………… Letter S i of keyword Position of letter in keyword i i+6 i+12 i+18 i+24 Column 2 is encrypted by S 2

28 Using Frequency Analysis to Attack the Vigenère Cipher (cont.) S1S1 S2S2 S3S3 S4S4 S5S5 S6S6 ZRZNSP CWQGFW LWQGFR GRZNST ZBGTRM ……………… Letter S i of keyword Position of letter in keyword i i+6 i+12 i+18 i+24 Column 3 is encrypted by S 3

29 Using Frequency Analysis to Attack the Vigenère Cipher (cont.) S1S1 S2S2 S3S3 S4S4 S5S5 S6S6 ZRZNSP CWQGFW LWQGFR GRZNST ZBGTRM ……………… Letter S i of keyword Position of letter in keyword i i+6 i+12 i+18 i+24 Column 4 is encrypted by S 4

30 Using Frequency Analysis to Attack the Vigenère Cipher (cont.) S1S1 S2S2 S3S3 S4S4 S5S5 S6S6 ZRZNSP CWQGFW LWQGFR GRZNST ZBGTRM ……………… Letter S i of keyword Position of letter in keyword i i+6 i+12 i+18 i+24 Column 5 is encrypted by S 5

31 Using Frequency Analysis to Attack the Vigenère Cipher (cont.) S1S1 S2S2 S3S3 S4S4 S5S5 S6S6 ZRZNSP CWQGFW LWQGFR GRZNST ZBGTRM ……………… Letter S i of keyword Position of letter in keyword i i+6 i+12 i+18 i+24 Column 6 is encrypted by S 6

32 Using Frequency Analysis to Attack the Vigenère Cipher (cont.) Since the letters in column 1 are encrypted by the same cipher alphabet, we can use frequency analysis on this set of cipher letters to figure out keyword letter S 1. Repeat with column 2 letters to find S 2, etc. In this way, frequency analysis is used to crack a Vigenere cipher!

33 Using Frequency Analysis to Attack the Vigenère Cipher (cont.) Example 5: The Kasiski Test has been applied to the Vigenère ciphertext below. Assuming that the keyword has length 5, find the subsets of ciphertext encrypted with each letter. Use frequency analysis to determine each keyword letter!  DBZMG AOIYS OPVFH OWKBW XZPJL VVRFG NBKIX DVUIM OPFQL VVPUD KPRVW OARLW DVLMW AWINZ DAKBW MMRLW QIICG PAKYU CVZKM ZARPS DTRVD ZWEYG ABYYE YMGYF YAFHL CMWLW LVCHL MMGYL DBZIF JNCYL OMIAJ JCGMA IBVRL OPVFW OBVLK OPVUJ ZDVLQ XWDGG IQEYF BTZMZ DVRMM ANZWA ZVKFQ GWEAL ZFKNZ ZZVCK VDVLQ BWFXU CIEWW OPRMU JZIYK KWEXA IOIYH ZIKYV GMKNW MOIIM KADUQ WMWIM ILZHL CMTCH CMINW SBRHV OPVSO DTCMGHMKCE ZASYD JKRNW YIKCF OMIPS GAFZK JUVGM GBZJD ZWWNZ ZVLGT ZZFZS GXYUT ZBJCF PAVNZ ZAVWS IJVZG PVUVQ NKRHF DVXNZ ZKZJZ ZZKYP OIEXX MWDNZ ZQIMH VKZHY DVKYD GQXYF OOLYK NMJGS YMRML JBYYF PUSYJ JNRFH CISYL N Solution: Simon Singh's Vigenère Cipher Cracking Tool.Simon Singh's Vigenère Cipher Cracking Tool