Classical Cryptography

Slides:



Advertisements
Similar presentations
Cryptology  Terminology  plaintext - text that is not encrypted.  ciphertext - the output of the encryption process.  key - the information required.
Advertisements

Fubswrjudskb Frxuvh qxpehu: / Lqvwuxfwru:Lyrqd Ehcdnryd Wrgdb’v Wrslfv: 1.Orjlvwlfv: -Fodvv olvw -Vboodexv 2. Wkh Pdwk 3. Zkdw lv Fubswrjudskb.
Classical Cryptography 1. Introduction: Some Simple Cryptosystems.
Cryptography Cryptography: art or science of keeping messages secret Cryptology: branch of mathematics that studies the mathematical foundations of cryptographic.
Cryptography Kinder Garden Number theory and Classical Cryptosystems Dr. Monther Aldwairi New York Institute of Technology- Amman Campus 10/10/2010 INCS.
Classical Cryptography 2. Cryptanalysis. p2. Cryptanalysis [2] Cryptanalysis Assumption:(Kerckhoffs’ principle) The opponent knows the cryptosystem being.
Classical Cryptography. p2. Outline [1] Introduction: Some Simple Cryptosystems The Shift Cipher The Substitution Cipher The Affine Cipher The Vigen è.
CSE331: Introduction to Networks and Security Lecture 17 Fall 2002.
Index of Coincidence Meghan Emilio Professor Ralph Morelli February 18, 2004.
Session 6: Introduction to cryptanalysis part 1. Contents Problem definition Symmetric systems cryptanalysis Particularities of block ciphers cryptanalysis.
Chapter 2 Basic Encryption and Decryption (part B)
CS526Topic 2: Classical Cryptography1 Information Security CS 526 Topic 2 Cryptography: Terminology & Classic Ciphers.
Cryptographic Algorithms Course information General Concepts Introductory examples Terminology Classical cryptography Cryptanalysis.
L1.1. An Introduction to Classical Cryptosystems Rocky K. C. Chang, February 2013.
Chapter 2 – Classical Encryption Techniques
Cryptanalysis. The Speaker  Chuck Easttom  
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.
Chapter 2 Basic Encryption and Decryption. csci5233 computer security & integrity 2 Encryption / Decryption encrypted transmission AB plaintext ciphertext.
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.
Diffusion and Confusion Two properties that a good cryptosystem should have: Diffusion: change of one character in the plaintext results in several characters.
Week 2 - Wednesday.  What did we talk about last time?  Encryption  Shift ciphers  Transposition ciphers.
ITIS 3200: Introduction to Information Security and Privacy Dr. Weichao Wang.
Lec. 5 : History of Cryptologic Research II
Topic 21 Cryptography CS 555 Topic 2: Evolution of Classical Cryptography CS555.
Cryptography and Network Security (CS435) Part Two (Classic Encryption Techniques)
CIT 380: Securing Computer SystemsSlide #1 CIT 380: Securing Computer Systems Classical Cryptography.
Section 2.7: The Friedman and Kasiski Tests Practice HW (not to hand in) From Barr Text p. 1-4, 8.
Announcements: Please pass in Assignment 1 now. Please pass in Assignment 1 now. Assignment 2 posted (when due?) Assignment 2 posted (when due?)Questions?
Cryptography Lecture 2: Classic Ciphers Piotr Faliszewski.
1 Cryptanalysis With thanks to Professor Sheridan Houghten.
Introduction to Ciphers Breno de Medeiros. Cipher types From “Cipher”, Wikipedia article.
Some Number Theory Modulo Operation: Question: What is 12 mod 9?
11 The evolution of cryptologic machines. TOP: The oldest known cipher wheel, of the type described by Francis Bacon as early as 1605 and later by Thomas.
Cryptography Part 1: Classical Ciphers Jerzy Wojdyło May 4, 2001.
© G. Dhillon, IS Department Virginia Commonwealth University Principles of IS Security Cryptography and Technical IS Security.
Cryptography (Traditional Ciphers)
1 Cryptanalysis Four kinds of attacks (recall) The objective: determine the key ( Herckhoff principle ) Assumption: English plaintext text Basic techniques:
Part 9, Basic Cryptography 1. Introduction A cryptosystem is a tuple: ( M,K,C, E,D) where M is the set of plaintexts K the set of keys C the set of ciphertexts.
CRYPTANALYSIS OF STREAM CIPHER Bimal K Roy Cryptology Research Group Indian Statistical Institute Kolkata.
Security in Computing Cryptography (Traditional Ciphers)
1 Information Theory Nathanael Paul Oct. 09, 2002.
Section 2.2: Affine Ciphers; More Modular Arithmetic Shift ciphers use an additive key. To increase security, we can add a multiplicative parameter. –For.
Vigenére Cipher Kimberly Chiffens & Maria Jannelli.
Introduction to Cryptography Lecture 8. Polyalphabetic Substitutions Definition: Let be different substitution ciphers. Then to encrypt the message apply.
CS526Topic 2: Classical Cryptography1 Information Security CS 526 Topic 2 Cryptography: Terminology & Classic Ciphers.
Substitution Ciphers Reference –Matt Bishop, Computer Security, Addison Wesley, 2003.
Introduction to Cryptography Hyunsung Kim, PhD University of Malawi, Chancellor College Kyungil University February, 2016.
@Yuan Xue CS 285 Network Security Block Cipher Principle Fall 2012 Yuan Xue.
@Yuan Xue Quick Review.
Substitution Ciphers.
CSE565: Computer Security Lecture 2 Basic Encryption & Decryption
Chapter 2 Basic Encryption and Decryption
CAP Cryptographic Analysis Program
Asad Gondal Ali Haider Mansoor
Section 2.7 The Friedman and Kasiski Tests
Cryptography and Network Security
Taehyung Kim HPC Lab. POSTECH
Lecture 1 Introduction to Cryptography Lecturer: Meysam Alishahi Design By: Z. Faraji and H. Hajiabolhassan Modified by: F. Moazami 11/13/2018.
Cryptography Lecture 16.
ICS 454: Principles of Cryptography
Classical Cryptography
Classical Polyalphabetic Ciphers
Kasiski Method Reference
Cryptanalysis of Vigenere Cipher
Conventional Cryptosystem(I)
Cryptography: Cesar Cipher
Traditional Symmetric-Key Ciphers
Symmetric Encryption or conventional / private-key / single-key
Meghan Emilio Professor Ralph Morelli February 18, 2004
Presentation transcript:

Classical Cryptography 2. Cryptanalysis

Cryptanalysis [2] Cryptanalysis Assumption:(Kerckhoffs’ principle) The opponent knows the cryptosystem being used Attack models: ciphertext only attack known plaintext attack chosen plaintext attack chosen ciphertext attack

Cryptanalysis Statistical properties of the English language: (see Table 1.1) E: probability about 0.120 T, A, O, I, N, S, H, R: between 0.06 and 0.09 D, L: 0.04 C, U, M, W, F, G, Y, P, B: between 0.015 and 0.028 V, K, J, X, Q, Z: 0.01 Most common digrams: TH, HE, IN, ER, AN, ND, … Most common trigrams: THE, ING, AND, END, …

Cryptanalysis Table 1.1 letter probability A .082 N .067 B .015 O .075 .028 P .019 D .043 Q .001 E .127 R .060 F .022 S .063 G .020 T .091 H .061 U I .070 V .010 J .002 W .023 K .008 X L .040 Y M .024 Z Table 1.1

Cryptanalysis <1> Cryptanalysis of the Affine Cipher Ciphertext obtained form an Affine Cipher: FMXVEDKAPHFERBNDKRXRSREFMORUDSDKDVSHVUFEDKAPRKDLYEVLRHHRH Frequency analysis: Table 1.2 Most frequent ciphertext characters: R: 8 occurrences D: 7 occurrences E,H,K: 5 occurrences We now guess the mapping and solve the equation eK(x)=ax+b mod 26

Cryptanalysis Table 1.2 letter frequency A 2 N 1 B O C P D 7 Q E 5 R 8 P D 7 Q E 5 R 8 F 4 S 3 G T H U I V J W K X L Y M Z Table 1.2

Cryptanalysis Guess e→R,t→D eK(4)=17, eK(19)=3 a=6, b=19 ILLEGAL (gcd(a,26)>1) Guess e→R,t→E eK(4)=17, eK(19)=4 a=13, b=17 Guess e→R,t→H eK(4)=17, eK(19)=7 a=8, b=11

Cryptanalysis Guess e→R,t→K eK(4)=17, eK(19)=10 a=3, b=5 LEGAL dK(y)=9y-19 Plaintext: algorithmsarequitegeneraldefinitionsofarithmeticprocesses

Cryptanalysis <2> Crytanalysis of the Substitution Cipher Ciphertext obtained from a Substitution Cipher YIFQFMZRWQFYVECFMDZPCVMRZWNMDZVEJBTXCDDUMJNDIFEFMDZCDMQZKCEYFCJMYRNCWJCSZREXCHZUNMXZNZUCDRJXYYSMRTMEYIFZWDYVZVYFZUMRZCRWNZDZJJXZWGCHSMRNMDHNCMFQCHZJMXJZWIEJYUCFWDJNZDIR Frequency analysis: Table 1.3 Z occurs most: guess dK(Z)=e occur at least 10 times: C,D,F,J,M,R,Y These are encryptions of {t,a,o,i,n,s,h,r} But the frequencies do not vary enough to guess

Cryptanalysis Table 1.3 letter frequency A N 9 B 1 O C 15 P D 13 Q 4 E N 9 B 1 O C 15 P D 13 Q 4 E 7 R 10 F 11 S 3 G T 2 H U 5 I V J W 8 K X 6 L Y M 16 Z 20 Table 1.3

Cryptanalysis We now look at digrams: -Z or Z- 4 times: DZ,ZW Guess dK(W)=d: ed→ZW 3 times: NZ,ZU Guess dk(N)=h: he→NZ We have ZRW: guess dk(R)=n, end→ZRW We have CRW: guess dk(C)=a, and→CRW We have RNM, which decrypts to nh- Suggest h- begins a word: M should be a vowel We have CM: guess dk(M)=i (ai is more likely than ao)

- i e n d a Y I F Q M Z R W V E C D P h N J B T X U K S H G

Cryptanalysis We have DZ(4 times) and ZD(2 times) Guess dK(D)∈{r,s,t} Since o is a common letter Guess eK(o)∈{F,J,Y} We have CFM and CJM: guess dK(Y)=o (aoi is impossible) Guess NMD→his : dK(D)=s Guess HNCMF→chair: dK(H)=c, dK(F)=r dK(J)=t: the→JNZ

o - r i e n d a s Y I F Q M Z R W V E C D P h t N J B T X U K c S H G

Cryptanalysis Now easy to determine the others dK(I)=u dK(Q)=f dK(V)=m dK(E)=p dK(P)=x dK(B)=y dK(T)=g dK(X)=l dK(U)=w dK(K)=v dK(S)=k dK(G)=b

o u r f i e n d m p a s x Y I F Q M Z R W V E C D P h t y g l w N J B T X U v K k c S H b G

Cryptanalysis <3> Cryptanalysis of the Vigenère Cipher Kasiski test (1863): Search the ciphertext for pairs of identical segments (length at least 3) Record the distance between the starting positions of the 2 segments If we obtain several such distances d1,d2,…, we would conjecture that the key length m divides all of the di’s m divides the gcd of the di’s

Cryptanalysis Friedman’s index of coincidence (1920) Suppose X=x1x2…xn is a string of n alphabetic characters Index of coincidence of X, denoted IC(X): the probability that 2 random elements of X are identical We denote the frequencies of A,B,..,Z in X by f0,f1,…,f25

Cryptanalysis Using the expected probabilities in Table 1.1 p0,…,p25: the expected probability of A,…,Z Suppose a ciphertext Y=y1y2…yn Define m substrings of Y1,…,Ym of Y Each value IC(Yi) should be roughly equal to 0.065

Cryptanalysis If m is not the keyword length Yi will look much more random A completely random string will have

Cryptanalysis Ciphertext obtained from a Vigenere Cipher CHREEVOAHMAERATBIAXXWTNXBEEOPHBSBQMQEQERBWRVXUOAKXAOSXXWEAHBWGJMMQMNKGRFVGXWTRZXWIAKLXFPSKAUTEMNDCMGTSXMXBTUIADNGMGPSRELXNJELXVRVPRTULHDNQWTWDTYGBPHXTFALJHASVBFXNGLLCHRZBWELEKMSJIKNBHWRJGNMGJSGLXFEYPHAGNRBIEQJTAMRVLCRREMNDGLXRRIMGNSNRWCHRQHAEYEVTAQEBBIPEEWEVKAKOEWADREMXMTBHHCHRTKDNVRZCHRCLQOHPWQAIIWXNRMGWOIIFKEE CHR occurs in 5 places: 1,166,236,276,286 The distances from the 1st one: 165,235,275,285 g.c.d. is 5: we guess m=5

Cryptanalysis We check the indices of coincidences: m=1: IC(Y)=0.045 m=2: IC(Y1)=0.046, IC(Y2)=0.041 m=3: IC=0.043, 0.050, 0.047 m=4: IC=0.042, 0.039, 0.046, 0.040 m=5: IC=0.063, 0.068, 0.069, 0.061, 0.072 We sure m=5

Cryptanalysis Now we want to determine the key K=(k1,k2,…,km) f0,f1,…f25: the frequencies of A,B,…,Z n’=n/m: the length of the string Yi The probability distribution of the 26 letters in Yi: Yi is obtained by shift encryption using a shift ki We hope that the shifted probability distribution would be close to p0,…,p25

Cryptanalysis Define the quantity Mg: For each ki, i=1, …, m for 0 ≤ g ≤ 25 If g=ki: If g≠ki, Mg will smaller than 0.065 Return to the previous example: Computes the values Mg, for 1≤i≤5 (Table 1.4) For each i, look for a value of Mg close to 0.065 From Table 1.4: K=(9,0,13,4,19) The keyword is JANET

i Value of Mg(Yi) 1 0.35 0.31 0.36 0.37 0.39 0.28 0.48 0.61 0.32 0.40 0.38 0.44 0.30 0.42 0.43 0.33 0.49 0.41 2 0.69 0.34 0.45 0.46 0.26 0.47 3 0.29 0.65 0.27 4 0.60 0.50 5 0.72 Table 1.4

Cryptanalysis <4> Cryptanalysis of the Hill Cipher Hill Cipher is difficult to break with a ciphertext-only attack We use a known plaintext attack Suppose the unknown key is an m╳m matrix and we have at least m distinct plaintext-ciphertext pairs xj=(x1,j,x2,j,…,xm,j) yj=(y1,j,y2,j,…,ym,j) yj=eK(xj), for 1≤j≤m

Cryptanalysis We define 2 m╳m matrices X=(xi,j) and Y=(yi,j) Y=XK K=X-1Y e.g.: m=2, plaintext: friday, ciphertext: PQCFKU eK(5,17)=(15,16) eK(8,3)=(2,5) eK(0,24)=(10,20)

Cryptanalysis e.g. (cont.)

Cryptanalysis <5> Cryptanalysis of the LFSR Stream Cipher Recall this system is mudulo 2 yi=(xi+zi) mod 2 (z1,…,zm)=(k1,…km) i≥1, c0,…,cm-1∈Z2

Cryptanalysis We use a known-plaintext attack here If plaintext length ≥ 2m We can solve the system of m linear equations:

Cryptanalysis e.g.: suppose the system uses a 5-stage LFSR Plaintext: 101101011110010 Ciphertext: 011001111111000 Keystream bits: 110100100001010

Cryptanalysis e.g. (cont.) zi+5=(zi+zi+3) mod 2