Topic 21 Cryptography CS 555 Topic 2: Evolution of Classical Cryptography CS555.

Slides:



Advertisements
Similar presentations
Classical Encryption Techniques Week 6-wend. One-Time Pad if a truly random key as long as the message is used, the cipher will be secure called a One-Time.
Advertisements

Cryptology  Terminology  plaintext - text that is not encrypted.  ciphertext - the output of the encryption process.  key - the information required.
Fubswrjudskb Frxuvh qxpehu: / Lqvwuxfwru:Lyrqd Ehcdnryd Wrgdb’v Wrslfv: 1.Orjlvwlfv: -Fodvv olvw -Vboodexv 2. Wkh Pdwk 3. Zkdw lv Fubswrjudskb.
Lecture 2.1: Private Key Cryptography -- I CS 436/636/736 Spring 2013 Nitesh Saxena.
1 Codes, Ciphers, and Cryptography-Ch 2.3 Michael A. Karls Ball State University.
Enigma Meghan Emilio Faculty Sponsor: Ralph Morelli (Computer Science)
CS 555Topic 11 Cryptography CS 555 Topic 1: Overview of the Course & Introduction to Encryption.
Ref. Cryptography: theory and practice Douglas R. Stinson
Classical Cryptography
CSE331: Introduction to Networks and Security Lecture 17 Fall 2002.
Index of Coincidence Meghan Emilio Professor Ralph Morelli February 18, 2004.
Shannon ’ s theory part II Ref. Cryptography: theory and practice Douglas R. Stinson.
CYPHER INDEX n Introduction n Background n Demo INTRODUCTION n Cypher is a software toolkit designed to aid in the decryption of standard (historical)
CryptographyPerfect secrecySlide 1 Today What does it mean for a cipher to be: –Computational secure? Unconditionally secure? Perfect secrecy –Conditional.
CS426Fall 2010/Lecture 21 Computer Security CS 426 Lecture 2 Cryptography: Terminology & Classic Ciphers.
Enigma Meghan Emilio Advisor: Professor Ralph Morelli April 2004.
Information Theory and Security
CS526Topic 2: Classical Cryptography1 Information Security CS 526 Topic 2 Cryptography: Terminology & Classic Ciphers.
Computer Security CS 426 Lecture 3
L1.1. An Introduction to Classical Cryptosystems Rocky K. C. Chang, February 2013.
Chapter 2 – Classical Encryption Techniques
3.1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 3 Traditional Symmetric-Key Ciphers.
History and Background Part 1: Basic Concepts and Monoalphabetic Substitution CSCI 5857: Encoding and Encryption.
CS526Topic 3: One-time Pad and Perfect Secrecy 1 Information Security CS 526 Topic 3 Cryptography: One-time Pad, Information Theoretic Security, and Stream.
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.
Introduction to Information Security Chapter II : Classical Ciphers.
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.
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.
Hill Cipher Developed by the mathematician Lester Hill in The encryption algorithm takes m successive plain text and substitute for them m cipher.
Cryptography Data communications and networks Momina Tariq: Ambreen Sohail: Data Communications and Networks.
CS555Spring 2012/Topic 51 Cryptography CS 555 Topic 5: Pseudorandomness and Stream Ciphers.
ITIS 3200: Introduction to Information Security and Privacy Dr. Weichao Wang.
Lec. 5 : History of Cryptologic Research II
Day 18. Concepts Plaintext: the original message Ciphertext: the transformed message Encryption: transformation of plaintext into ciphertext Decryption:
13. BETTER SYMMETRIC CIPHER STREAM CIPHERS 1. SOME TRICKS FOR SUBSTITUTION CIPHER There are some tricks to make substitution cipher safer: Nulls: insert.
Section 2.7: The Friedman and Kasiski Tests Practice HW (not to hand in) From Barr Text p. 1-4, 8.
Symmetric-Key Cryptography
Introduction to cryptography by konrad. Introduction to cryptography Cryptography is the process of encrypting/decrypting data streams using some E(M)/D(M)
Module :MA3036NI Cryptography and Number Theory Lecture Week 3 Symmetric Encryption-2.
Terminology and classical Cryptology
CSCI 5857: Encoding and Encryption
1 University of Palestine Information Security Principles ITGD 2202 Ms. Eman Alajrami.
Introduction to Ciphers Breno de Medeiros. Cipher types From “Cipher”, Wikipedia article.
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.
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.
Traditional Symmetric-Key Ciphers
Computer Security Cryptography. Cryptography Now and Before  In the past – mainly used for confidentiality  Today –Still used for confidentiality –Data.
1 Information Theory Nathanael Paul Oct. 09, 2002.
Introduction to Cryptography Lecture 8. Polyalphabetic Substitutions Definition: Let be different substitution ciphers. Then to encrypt the message apply.
CS555Spring 2012/Topic 31 Cryptography CS 555 Topic 3: One-time Pad and Perfect Secrecy.
Network Security Lecture 13 Presented by: Dr. Munam Ali Shah.
CS526Topic 2: Classical Cryptography1 Information Security CS 526 Topic 2 Cryptography: Terminology & Classic Ciphers.
Substitution Ciphers Reference –Matt Bishop, Computer Security, Addison Wesley, 2003.
CS480 Cryptography and Information Security Huiping Guo Department of Computer Science California State University, Los Angeles 4. Traditional and Modern.
@Yuan Xue Quick Review.
Substitution Ciphers.
Chapter 2 Basic Encryption and Decryption
Asad Gondal Ali Haider Mansoor
Section 2.7 The Friedman and Kasiski Tests
History and Background Part 3: Polyalphabetic Ciphers
Taehyung Kim HPC Lab. POSTECH
Topic 13: Message Authentication Code
Information Security CS 526 Topic 3
Traditional Symmetric-Key Ciphers
Presentation transcript:

Topic 21 Cryptography CS 555 Topic 2: Evolution of Classical Cryptography CS555

Topic 22 Lecture Outline Basics of probability Vigenere cipher. Attacks on Vigenere: Kasisky Test and Index of Coincidence Cipher machines: The Enigma machine. Required readings: –Katz & Lindell: 1.1 to 1.3 Recommended readings –The Code Book by Simon Singh CS555

Topic 23 Begin Math CS555

Topic 24 Random Variable Definition A discrete random variable, X, consists of a finite set X, and a probability distribution defined on X. The probability that the random variable X takes on the value x is denoted Pr[ X =x]; sometimes, we will abbreviate this to Pr[x] if the random variable X is fixed. It must be that CS555

Topic 25 Example of Random Variables Let random variable D 1 denote the outcome of throw one dice (with numbers 0 to 5 on the 6 sides) randomly, then D ={0,1,2,3,4,5} and Pr[ D 1 =i] = 1/6 for 0  i  5 Let random variable D 2 denote the outcome of throw a second such dice randomly Let random variable S 1 denote the sum of the two dices, then S ={0,1,2,…,10}, and Pr[ S 1 =0] = Pr[ S 1 =10] = 1/36 Pr[ S 1 =1] = Pr[ S 1 =9] = 2/36 = 1/18 … Let random variable S 2 denote the sum of the two dices modulo 6, what is the distribution of S 2 CS555

Topic 26 Relationships between Two Random Variables Definitions Assume X and Y are two random variables, then we define: - joint probability: Pr[x, y] is the probability that X takes value x and Y takes value y. - conditional probability: Pr[x|y] is the probability that X takes on the value x given that Y takes value y. Pr[x|y] = Pr[x, y] / Pr[y] - independent random variables: X and Y are said to be independent if Pr[x,y] = Pr[x]P[y], for all x  X and all y  Y. CS555

Topic 27 Examples Joint probability of D 1 and D 2 for 0  i, j  5, Pr[ D 1 =i, D 2 =j] = ? What is the conditional probability Pr[ D 1 =i | D 2 =j] for 0  i, j  5? Are D 1 and D 2 independent? Suppose D 1 is plaintext and D 2 is key, and S 1 and S 2 are ciphertexts of two different ciphers, which cipher would you use? CS555

Topic 28 Examples to think after class What is the joint probability of D 1 and S 1 ? What is the joint probability of D 2 and S 2 ? What is the conditional probability Pr[ S 1 =s | D 1 =i] for 0  i  5 and 0  s  10? What is the conditional probability Pr[ D 1 =i | S 2 =s] for 0  i  5 and 0  s  5? Are D 1 and S 1 independent? Are D 1 and S 2 independent? CS555

Topic 29 Bayes’ Theorem If P[y] > 0 then Corollary X and Y are independent random variables iff P[x|y] = P[x], for all x  X and all y  Y. CS555

Topic 210 End Math CS555

Topic 211 Ways to Enhance the Substitution Cipher against Frequency Analysis Using nulls –e.g., using numbers from 1 to 99 as the ciphertext alphabet, some numbers representing nothing and are inserted randomly Deliberately misspell words –e.g., “Thys haz thi ifekkt off diztaughting thi ballans off frikwenseas” Homophonic substitution cipher –each letter is replaced by a variety of substitutes These make frequency analysis more difficult, but not impossible CS555

Topic 212 Towards the Polyalphabetic Substitution Ciphers Main weaknesses of monoalphabetic substitution ciphers –In ciphertext, different letters have different frequency each letter in the ciphertext corresponds to only one letter in the plaintext letter Idea for a stronger cipher (1460’s by Alberti) –Use more than one cipher alphabet, and switch between them when encrypting different letters As result, frequencies of letters in ciphertext are similar Developed into a practical cipher by Vigenère (published in 1586) CS555

Topic 213 The Vigenère Cipher Treat letters as numbers: [A=0, B=1, C=2, …, Z=25] Number Theory Notation: Z n = {0, 1, …, n-1} Definition: Given m, a positive integer, P = C = (Z 26 ) n, and K = (k 1, k 2, …, k m ) a key, we define: Encryption: e k (p 1, p 2 … p m ) = (p 1 +k 1, p 2 +k 2 …p m +k m ) (mod 26) Decryption: d k (c 1, c 2 … c m ) = (c 1 -k 1, c 2 -k 2 … c m - k m ) (mod 26) Example: Plaintext: C R Y P T O G R A P H Y Key: L U C K L U C K L U C K Ciphertext: N L A Z E I I B L J J I CS555

Topic 214 Security of Vigenere Cipher Vigenere masks the frequency with which a character appears in a language: one letter in the ciphertext corresponds to multiple letters in the plaintext. Makes the use of frequency analysis more difficult. Any message encrypted by a Vigenere cipher is a collection of as many shift ciphers as there are letters in the key. CS555

Topic 215 Vigenere Cipher: Cryptanalysis Find the length of the key. Divide the message into that many simple substitution encryptions. Solve the resulting simple substitutions. –how? CS555

Topic 216 How to Find the Key Length? For Vigenere, as the length of the keyword increases, the letter frequency shows less English-like characteristics and becomes more random. Two methods to find the key length: –Kasisky test –Index of coincidence (Friedman) CS555

Topic 217 Kasisky Test Note: two identical segments of plaintext, will be encrypted to the same ciphertext, if the they occur in the text at the distance , (  0 (mod m), m is the key length). Algorithm: –Search for pairs of identical segments of length at least 3 –Record distances between the two segments:  1,  2, … –m divides gcd(  1,  2, …) CS555

Topic 218 Example of the Kasisky Test Key K I N G K I N G K I N G K I N G K I N G K I N G PT t h e s u n a n d t h e m a n i n t h e m o o n CT D P R Y E V N T N B U K W I A O X B U K W W B T CS555

Topic 219 Index of Coincidence (Friedman) Informally: Measures the probability that two random elements of the n-letters string x are identical. Definition: Suppose x = x 1 x 2 …x n is a string of n alphabetic characters. Then I c (x), the index of coincidence is: when i and j are uniformly randomly chosen from [1..n] CS555

Topic 220 Consider the plaintext x, and f 0, f 1, … f 25 are the frequencies with which A, B, … Z appear in x and p 0, p 1, … p 25 are the probabilities with which A, B, … Z appear in x. That is p i = f i / n where n is the length of x We want to compute I c (x). Given frequencies of all letters in an alphabet, index of coincidence is a feature of the frequencies It does not change under substitution Index of Coincidence (cont.) CS555

Topic 221 We can choose two elements out of the string of size n in ways For each i, there are ways of choosing the elements to be i Index of Coincidence (cont.) CS555

Topic 222 Index of Coincidence of English For English, S = 25 and p i can be estimated Letter p i Letter p i Letter p i Letter p i A.082H.061O.075V.010 B.015I.070P.019W.023 C.028J.002Q.001X D.043K.008R.060Y.020 E.127L.040S.063Z.001 F.022M.024T.091 G.020N.067U.028 CS555

Topic 223 Finding the Key Length y = y 1 y 2 …y n,, assum m is the key length, write y vertically in an m-row array y1y1 y2y2 ymym … CS555

Topic 224 Finding out the Key Length If m is the key length, then the text ``looks like’’ English text If m is not the key length, the text ``looks like’’ random text and: CS555

Topic 225 Rotor Machines Basic idea: if the key in Vigenere cipher is very long, then the attacks won’t work Implementation idea: multiple rounds of substitutions A machine consists of multiple cylinders –Each character is encrypted by multiple cylinders –Each cylinder has 26 states, at each state it is a substitution cipher –Each cylinder rotates to change states according to different schedule CS555

Topic 226 Rotor Machines A m-cylinder rotor machine has –26 m different substitution ciphers 26 3 = = 456, = 11,881,376 CS555

Topic 227 Earliest Enigma Machine Use 3 scramblers (motors): substitutions 3 scramblers can be used in any order: 6 combinations Plug board: allowed 6 pairs of letters to be swapped before the encryption process started and after it ended. CS555

Topic 228 Using Enigma Machine A day key has the form –Plugboard setting:A/L–P/R–T/D–B/W–K/F–O/Y –Scrambler arrangement:2-3-1 –Scrambler starting position: Q-C-W Sender and receiver set up the machine the same way for each message Use of message key: a new scrambler starting position, e.g., PGH –first encrypt and send the message key, then set the machine to the new position and encrypt the message –initially the message key is encrypted twice CS555

Topic 229 History of the Enigma Machine Patented by Scherius in 1918 Widely used by the Germans from 1926 to the end of second world war First successfully broken by the Polish’s in the thirties by exploiting the repeating of the message key Then broken by the UK intelligence during the WW II CS555

Topic 230 Coming Attractions … Information-Theoretic secrecy (Perfect secrecy), One-Time Pad Recommended reading for next lecture: Katz and Lindell: Chapter 2 CS555