Cryptography Lecture 2: Classic Ciphers Piotr Faliszewski.

Slides:



Advertisements
Similar presentations
CLASSICAL ENCRYPTION TECHNIQUES
Advertisements

Using Cryptography to Secure Information. Overview Introduction to Cryptography Using Symmetric Encryption Using Hash Functions Using Public Key Encryption.
CS 483 – SD SECTION BY DR. DANIYAL ALGHAZZAWI (3) Information Security.
Cryptology Terminology and Early History. Cryptology Terms Cryptology –The science of concealing the meaning of messages and the discovery of the meaning.
CS 6262 Spring 02 - Lecture #7 (Tuesday, 1/29/2002) Introduction to Cryptography.
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.
Announcements: Please pass in Assignment 1 now. Please pass in Assignment 1 now. Assignment 2 posted (when due?) Assignment 2 posted (when due?)Questions?
Announcements: Matlab: tutorial available at Matlab: tutorial available at
Stream cipher diagram + + Recall: One-time pad in Chap. 2.
CMSC 414 Computer and Network Security Lecture 2 Jonathan Katz.
EEC 688/788 Secure and Dependable Computing Lecture 4 Wenbing Zhao Department of Electrical and Computer Engineering Cleveland State University
CSE331: Introduction to Networks and Security Lecture 17 Fall 2002.
1 Day 04- Cryptography Acknowledgements to Dr. Ola Flygt of Växjö University, Sweden for providing the original slides.
Overview of Cryptography and Its Applications Dr. Monther Aldwairi New York Institute of Technology- Amman Campus INCS741: Cryptography.
Chapter 2 Basic Encryption and Decryption (part B)
CS426Fall 2010/Lecture 21 Computer Security CS 426 Lecture 2 Cryptography: Terminology & Classic Ciphers.
Announcements: Assignment 1 due tomorrow in class. Assignment 1 due tomorrow in class.Questions? Roll Call Today: Vigenere ciphers Pronunciation? DTTF/NB479:
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.
Computer Security CS 426 Lecture 3
L1.1. An Introduction to Classical Cryptosystems Rocky K. C. Chang, February 2013.
Chapter 2 – Classical Encryption Techniques
CMSC 414 Computer and Network Security Lecture 3 Jonathan Katz.
Cryptography Week-6.
Cryptanalysis. The Speaker  Chuck Easttom  
8. Cryptography1 ISA 562 Information Security Theory & Practice Introduction to Cryptography.
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.
Cryptography Lecture 1: Introduction Piotr Faliszewski.
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.
Chapter 2 – Elementary Cryptography  Concepts of encryption  Cryptanalysis  Symmetric (secret key) Encryption (DES & AES)(DES & AES)  Asymmetric (public.
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.
ITIS 3200: Introduction to Information Security and Privacy Dr. Weichao Wang.
Lec. 5 : History of Cryptologic Research II
Section 2.1: Shift Ciphers and Modular Arithmetic Practice HW from Barr Textbook (not to hand in) p.66 # 1, 2, 3-6, 9-12, 13, 15.
1 Chapter 2-1 Conventional Encryption Message Confidentiality.
Symmetric-Key Cryptography
Module :MA3036NI Cryptography and Number Theory Lecture Week 3 Symmetric Encryption-2.
Announcements: Please pass in Assignment 1 now. Please pass in Assignment 1 now. Assignment 2 posted (when due?) Assignment 2 posted (when due?)Questions?
9/03/15UB Fall 2015 CSE565: S. Upadhyaya Lec 2.1 CSE565: Computer Security Lecture 2 Basic Encryption & Decryption Shambhu Upadhyaya Computer Science &
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.
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.
Elementary Cryptography  Concepts of encryption  Symmetric (secret key) Encryption (DES & AES)(DES & AES)  Asymmetric (public key) Encryption (RSA)(RSA)
Cryptography (Traditional Ciphers)
Data Security and Encryption (CSE348) 1. Lecture # 4 2.
Traditional Symmetric-Key Ciphers
Security in Computing Cryptography (Traditional Ciphers)
Computer Security Cryptography. Cryptography Now and Before  In the past – mainly used for confidentiality  Today –Still used for confidentiality –Data.
Data Security and Encryption (CSE348) 1. Lecture # 3 2.
CSCI 391: Practical Cryptology Substitution Monoalphabetic Ciphers.
Section 2.2: Affine Ciphers; More Modular Arithmetic Shift ciphers use an additive key. To increase security, we can add a multiplicative parameter. –For.
Introduction to Cryptography Lecture 8. Polyalphabetic Substitutions Definition: Let be different substitution ciphers. Then to encrypt the message apply.
Lecture 4 Page 1 CS 236 Online Basic Encryption Methods Substitutions –Monoalphabetic –Polyalphabetic Permutations.
CS526Topic 2: Classical Cryptography1 Information Security CS 526 Topic 2 Cryptography: Terminology & Classic Ciphers.
1 Introduction CS 303 Algorithmic Number Theory and Cryptography Jeremy R. Johnson.
Substitution Ciphers Reference –Matt Bishop, Computer Security, Addison Wesley, 2003.
Cryptography services Lecturer: Dr. Peter Soreanu Students: Raed Awad Ahmad Abdalhalim
Computer Security By Rubel Biswas. Introduction History Terms & Definitions Symmetric and Asymmetric Attacks on Cryptosystems Outline.
Department of Computer Science Chapter 5 Introduction to Cryptography Semester 1.
@Yuan Xue Quick Review.
Chapter 2 Basic Encryption and Decryption
Cryptography and Network Security
Symmetric Encryption or conventional / private-key / single-key
Crypto for CTFs.
Presentation transcript:

Cryptography Lecture 2: Classic Ciphers Piotr Faliszewski

Previous Class Highlights Last class  Historical perspective  Kerckhoff’s principle  Requirements for information security Confidentiality Data integrity Authentication Non-repuditation  Attacks on confidentiality Ciphertext only attack Plaintext only attack Chosen ciphertext attack Chosen plaintext attack Key-only attack

Convention Plaintext alphabet and ciphertext alphabet ABCDEFGHIJKLM NOPQRSTUVWXYZ

Modular Arithmetic Modulo arithmetic  Modulus m  “Clock”-like arithmetic – numbers “wrap around” after reaching m  Calculate in the world of remainders modulo m 2 = 14 mod (12) 26 = 0 (mod 26) 7*11 ≡ 77 (mod 5) ≡ 2 (mod 5) ≡ 2 * 1 (mod 5) -5 (mod 11) ≡ 6 (mod 11)

Monoalphabetic Substitution Each letter is replaced by another letter from the alphabet Key:  1-1 mapping of letters  How many keys are there? Various flavors  Shift cipher  Affine cipher  Atbash  Kama-sutra cipher

Shift Cipher Substitution cipher  Key k  N  Formula: y = (x + k) mod 26  26  size of the alphabet Cryptanalisis?  Brute force! Popular culture  2001: Space Odyssey  HAL 9000

Shift Cipher Substitution cipher  Key k  N  Formula: y = (x + k) mod 26  26  size of the alphabe Cryptanalisis?  Brute force! Popular culture  2001: Space Odyssey  HAL 9000 ABBCCDDEEFFGGHHIIJJKKLLMMNABBCCDDEEFFGGHHIIJJKKLLMMN

Shift Cipher Substitution cipher  Key k  N  Formula: y = (x + k) mod 26  26  size of the alphabe Cryptanalisis?  Brute force! Popular culture  2001: Space Odyssey  HAL 9000 ABBCCDDEEFFGGHHIIJJKKLLMMNABBCCDDEEFFGGHHIIJJKKLLMMN

Shift Cipher Substitution cipher  Key k  N  Formula: y = (x + k) mod 26  26  size of the alphabe Cryptanalisis?  Brute force! Popular culture  2001: Space Odyssey  IBM 9000 ABBCCDDEEFFGGHHIIJJKKLLMMNABBCCDDEEFFGGHHIIJJKKLLMMN

Affine Cipher Substitution cipher  Key ( ,  )  Formula: y = (  x +  ) mod 26 How to select keys? Cryptanalysis? A  0 B  1 C  2 D  3 E  4 F  5 G  6 H  7 I  8 J  9 K  10 L  11 M  12 N  13 O  14 P  15 Q  16 R  17 S  18 T  19 U  20 V  21 W  22 X  23 Y  24 Z  25

General Substitution Cipher Key  Permutation of the alphabet  Large key space! … but not used efficiently! Does not hide various properties of the underlying text!

General Substitution Cipher Key  Permutation of the alphabet  Large key space! … but not used efficiently! Does not hide various properties of the underlying text! How to attack a substitution cipher?  Frequency attack Digrams, trigrams  “fingerprint” of a language

Frequency Attack Frequencies of letters  Letters appear with different frequencies in natural texts  Exceptions: Gadsby by E.V. Wright Disparation by George Perec (A Void, translation G. Adair)  Breaking substitution ciphers A  0.082N  B  0.015O  C  0.028P  D  0.043Q  E  0.127R  F  0.022S  G  0.020T  H  0.061U  I  0.070V  J  0.002W  K  0.008X  L  0.040Y  M  0.024Z  0.001

Frequencies vs Subst’n Cipher Shift and affine cipher  usually enough to locate ‘E’  gives the key  for affine cipher: One more letter can be helpful Full substitution cipher  Might need digram and trigram frequencies A  0.082N  B  0.015O  C  0.028P  D  0.043Q  E  0.127R  F  0.022S  G  0.020T  H  0.061U  I  0.070V  J  0.002W  K  0.008X  L  0.040Y  M  0.024Z  0.001

Example: Shift Cipher The following frequencies were found:  Count the letters  Normalize the frequencies  Compare to the natural one A : 27 B : 6 C : 5 D : 12 E : 14 F : 1 G : 2 H : 8 I : 5 J : 14 K : 16 L : 5 M : 2 N : 13 O : 14 P : 19 Q : 6 R : 3 S : 5 T : 0 U : 4 V : 0 W : 17 X : 4 Y : 6 Z : 8

Example: Shift Cipher There are 216 letters  Divide counts by 216 A : B : C : D : E : F : G : H : I : J : K : L : M : 0.009

Example: Shift Cipher There are 216 letters  Divide counts by 216 Compare to natural frequencies  Natural guess: shift 4  Others plausible shift A : B : C : D : E : F : G : H : I : J : K : L : M : A : B : C : D : E : F : G : 0.02 H : I : 0.07 J : K : L : 0.04 M : 0.024

Example: Shift Cipher There are 216 letters  Divide counts by 216 Compare to natural frequencies  Natural guess: shift 4  Others plausible shift A : B : C : D : E : F : G : H : I : J : K : L : M : A : B : C : D : E : F : G : 0.02 H : I : 0.07 J : K : L : 0.04 M : 0.024

Example: Shift Cipher There are 216 letters  Divide counts by 216 Compare to natural frequencies  Natural guess: shift 4  Others plausible shift -2 but the rest of frequencies mismatch A : B : C : D : E : F : G : H : I : J : K : L : M : A : B : C : D : E : F : G : 0.02 H : I : 0.07 J : K : L : 0.04 M : 0.024

Example: Shift Cipher There are 216 letters  Divide counts by 216 Compare to natural frequencies  Natural guess: shift 4  Others plausible shift -2 but the rest of frequencies mismatch A : B : C : D : E : F : G : H : I : J : K : L : M : A : B : C : D : E : F : G : 0.02 H : I : 0.07 J : K : L : 0.04 M : 0.024

Dot-Product Method Treat the list of frequencies as vector  A 0 – list of frequencies  A i – list of frequencies shifted by i Example  A 0 = ( 0.82, 0.015, 0.028, 0.043,... )  A 2 = ( 0.20, 0.001, 0.082, 0.015,... ) Dot-product  A i · A j  multiply elements position wise and add

Dot-Product Method Property  A i · A j  largest when i = j Method  Compute frequency vector W for our text W approximates some A j  Compute W · A i for each i  Shift is the i that maximizes the value

Vigenere Cipher How to make the shift cipher more difficult to break?  Problem: each letter shifted by the same ammount  Solution: pick different shifts for different letters! Vigenere cipher  A sequence of shift ciphers

Vigenere Cipher Key  a vector (k 1,..., k n )  each k i is a letter (or equivalently, a small integer) Cipher:  plaintext: x 1 x 2... x m  ciphertext: y j = x j + k j mod n (mod 26)

Vigenere Cipher: Cryptanalisis Known ciphertext attack  dljhswbesidtyjfcqpjhrxfmdxipdabhordg itutnzfgiibhspzjcmovdlfkskfcovfrstit beosdlbigixxvpugixpqbibzsruwogmpcwsd yqkjcxudcifwyafpccuwswjh Finding the key:  Find the key length  displacement method  Break a sequence of shift ciphers

Displacement Method dljhswbesidtyjfcqpjhrxfmdxipdabhordgitutnzfgiibhsp 3 matches dljhswbesidtyjfcqpjhrxfmdxipdabhordgitutnzfgiibhsp 6 matches dljhswbesidtyjfcqpjhrxfmdxipdabhordgitutnzfgiibhsp 0 matches dljhswbesidtyjfcqpjhrxfmdxipdabhordgitutnzfgiibhsp 7 matches

Vigenere Cipher: Cryptanalisis After we get the key length  Break a series of shift ciphers... ... but we just have a sample of English letters for each cipher. Example: with key length 6, for each cipher we get every 6th letter of the message  Can still match the frequencies dot-product method

Unbreakable cipher Is it possible to create an unbreakable cipher?

Unbreakable cipher Is it possible to create an unbreakable cipher? One-time pad  Plaintext: x 1 x 2 x 3... x n  Random string: b 1 b 2 b 3... b n  Ciphertext: y i = x i  b i Cryptanalisis? Applications? This message is completely unreadable. I have encrypted it with the toughest cipher ever, one-time pad. TWICE! -- found in a cryptography discussion on the internet

One-Time Pad Keys Generate random sequence  Hardware generators Thermal noise from a semiconductor device Random fluctuations in disk sector latency times Etc.  Software generators Deterministic Initiated „randomly”  System clock  Elapsed time between keystrokes  Etc.

Pseudorandom Numbers Linear congruential generator  x i = ax i-1 + b (mod m)  Dangerous for cryptography! Blum-Blum-Shub generator  x i = x i-1 2 (mod n)  u i = x i (mod 2) Many others...