Lecture 4: Striving for Confusion

Slides:



Advertisements
Similar presentations
CS 483 – SD SECTION BY DR. DANIYAL ALGHAZZAWI (3) Information Security.
Advertisements

1 CIS 5371 Cryptography 5b. Pseudorandom Objects in Practice Block Ciphers.
Cryptography and Network Security Chapter 3
The Advanced Encryption Standard (AES) Simplified.
Symmetric Encryption Example: DES Weichao Wang. 2 Overview of the DES A block cipher: – encrypts blocks of 64 bits using a 64 bit key – outputs 64 bits.
David Evans CS588: Security and Privacy University of Virginia Computer Science Lecture 4: Captain Ridley’s Shooting Party.
Modern Cryptography.
1 Overview of the DES A block cipher: –encrypts blocks of 64 bits using a 64 bit key –outputs 64 bits of ciphertext A product cipher –basic unit is the.
1 Chapter 3 – Block Ciphers and the Data Encryption Standard Modern Block Ciphers  now look at modern block ciphers  one of the most widely used types.
1 Chapter 3 – Block Ciphers and the Data Encryption Standard Modern Block Ciphers  now look at modern block ciphers  one of the most widely used types.
Introduction to Symmetric Block Cipher Jing Deng Based on Prof. Rick Han’s Lecture Slides Dr. Andreas Steffen’s Security Tutorial.
Cryptography in World War II
Lecture 23 Symmetric Encryption
Lecture 2.2: Private Key Cryptography II CS 436/636/736 Spring 2012 Nitesh Saxena.
Chapter 3 – Block Ciphers and the Data Encryption Standard
CSE 651: Introduction to Network Security
The Data Encryption Standard - see Susan Landau’s paper: “Standing the test of time: the data encryption standard.” DES - adopted in 1977 as a standard.
Lec. 5 : History of Cryptologic Research II
David Evans CS588: Security and Privacy University of Virginia Computer Science Lecture 6: Striving for Confusion Structures.
CSCI 5857: Encoding and Encryption
1 Lect. 7 : Data Encryption Standard. 2 Data Encryption Standard (DES)  DES - History 1976 – adopted as a federal standard 1977 – official publication.
1 University of Palestine Information Security Principles ITGD 2202 Ms. Eman Alajrami 2 nd Semester
Le Trong Ngoc Security Fundamentals (2) Encryption mechanisms 4/2011.
David Evans CS551: Security and Privacy University of Virginia Computer Science Lecture 3: Striving for Confusion Structures.
Computer and Network Security Rabie A. Ramadan Lecture 3.
K. Salah1 Cryptography Module I. K. Salah2 Cryptographic Protocols  Messages should be transmitted to destination  Only the recipient should see it.
Cryptography and Network Security Third Edition by William Stallings Lecture slides by Lawrie Brown.
© Information Security Group, ICU1 Block Cipher- introduction  DES Description: Feistel, S-box Exhaustive Search, DC and LC Modes of Operation  AES Description:
DES Analysis and Attacks CSCI 5857: Encoding and Encryption.
Block Cipher- introduction
David Evans CS551: Security and Privacy University of Virginia Computer Science Lecture 4: Dissin’ DES The design took.
DES: Data Encryption Standard
Block Ciphers and the Data Encryption Standard. Modern Block Ciphers  One of the most widely used types of cryptographic algorithms  Used in symmetric.
Lecture 5 Page 1 CS 236 Online More on Cryptography CS 236 On-Line MS Program Networks and Systems Security Peter Reiher.
@Yuan Xue CS 285 Network Security Block Cipher Principle Fall 2012 Yuan Xue.
Lecture 4 Data Encryption Standard (DES) Dr. Nermin Hamza
CS480 Cryptography and Information Security
Lecture 4: Metacircles Eval Apply David Evans
Provides Confidentiality
Chapter3: Block Ciphers and the Data Encryption Standard
6b. Practical Constructions of Symmetric-Key Primitives.
Understanding Cryptography – A Textbook for Students and Practitioners by Christof Paar and Jan Pelzl Chapter 3 – The Data Encryption.
Outline Desirable characteristics of ciphers Uses of cryptography
Classical Encryption techniques
History and Background Part 3: Polyalphabetic Ciphers
Outline Desirable characteristics of ciphers Uses of cryptography
Lecture 3: Symmetric Key Encryption
NET 311 Information Security
Cryptography Lecture 18.
Cryptography and Network Security Chapter 3
Lecture 9: Hash House Harriers Background just got here last week
Lecture 5: Enigma Concluded Bletchley Park (June 2004)
PART VII Security.
Block cipher & Fiestel Structure
ICS 454: Principles of Cryptography
Block Ciphers and the Data Encryption Standard (DES)
Rotors and Secret-Key Encryption
Lecture 10: The Return of Paco Background just got here last week
Chapter -2 Block Ciphers and the Data Encryption Standard
SYMMETRIC ENCRYPTION.
Differential Cryptanalysis
Lecture 5: DES Use and Analysis Background just got here last week
Cryptography Lecture 16.
Cryptography Lecture 17.
Modern Cryptography.
Florida State University
ICS 555: Block Ciphers & DES Sultan Almuhammadi.
Data Encryption Standard (DES)
Presentation transcript:

David Evans http://www.cs.virginia.edu/~evans Lecture 4: Striving for Confusion Structures have been found in DES that were undoubtedly inserted to strengthen the system against certain types of attack. Structures have also been found that appear to weaken the system. Lexar Corporation, “An Evalution of the DES”, 1976. Background just got here last week finished degree at MIT week before Philosophy of advising students don’t come to grad school to implement someone else’s idea can get paid more to do that in industry learn to be a researcher important part of that is deciding what problems and ideas are worth spending time on grad students should have their own project looking for students who can come up with their own ideas for research will take good students interested in things I’m interested in – systems, programming languages & compilers, security rest of talk – give you a flavor of the kinds of things I am interested in meant to give you ideas (hopefully even inspiration!) but not meant to suggest what you should work on CS588: Security and Privacy University of Virginia Computer Science David Evans http://www.cs.virginia.edu/~evans

University of Virginia CS 588 Menu Projects Enigma Continued Block Ciphers 10 Sept 2001 University of Virginia CS 588

University of Virginia CS 588 Operation Day key (distributed in code book) Each message begins with message key (“randomly” choosen by sender) encoded using day key Message key sent twice to check After receiving message key, re-orient rotors according to key 10 Sept 2001 University of Virginia CS 588

University of Virginia CS 588 Letter Permutations Symmetry of Enigma: if Epos (x) = y we know Epos (y) = x Given message openings DMQ VBM E1(m1) = D E4(m1) = V VON PUY E1(m2) = V E4(m2) = P PUC FMQ With enough message openings, we can build complete cycles for each position pair: E1E4 = (DVPFKXGZYO) (EIJMUNQLHT) (BC) (RW) (A) (S) Note: Cycles must come in pairs of equal length (Examples in Code Book had pairs of unequal length) 10 Sept 2001 University of Virginia CS 588

Composing Involutions E1 and E4 are involutions (x  y  y  x) Without loss of generality, we can write: E1 contains (a1a2) (a3a4) … (a2k-1a2k) E2 contains (a2a3) (a4a5) … (a2ka1) E1 E2 a1  a2 a2  x = a3 or x = a1 a3  a4 a4  x = a5 or x = a1 10 Sept 2001 University of Virginia CS 588

University of Virginia CS 588 Rejewski’s Theorem E1 contains (a1a2) (a3a4) … (a2k-1a2k) E4 contains (a2a3) (a4a5) … (a2ka1) E1E4 contains (a1a3a5…a2k-1) (a2ka2k-2… a4a2) The product of two involutions consists of pairs cycles of the same length For cycles of length n, there are n possible factorizations 10 Sept 2001 University of Virginia CS 588

Factoring Permutations E1E4 = (DVPFKXGZYO) (EIJMUNQLHT) (BC) (RW) (A) (S) (A) (S) = (AS) o (SA) (BC) (RW) = (BR)(CW) o (BW)(CR) or = (BW)(RC) o (WC) (BR) 10 Sept 2001 University of Virginia CS 588

How many factorizations? (DVPFKXGZYO) (EIJMUNQLHT) E1 E2 D  a2 a2  V V  a4 a4  P Once we guess a2 everything else must follow! So, only n possible factorizations for an n-letter cycle Total to try = 2 * 10 = 20 E2E5 and E3E6 likely to have about 20 to try also About 203 (8000) factorizations to try (still too many in pre-computer days) 10 Sept 2001 University of Virginia CS 588

University of Virginia CS 588 Luckily… Operators picked guessable message keys (“cillies”) Identical letters Easy to type (e.g., QWE) If we can guess P1 = P2 = P3 (or known relationships) can reduce number of possible factorizations If we’re lucky – this leads to E1 …E6 10 Sept 2001 University of Virginia CS 588

University of Virginia CS 588 1939 Early 1939 – Germany changes scamblers and adds extra plugboard cables, stop double-transmissions Poland unable to cryptanalyze July 1939 – Rejewski invites French and British cryptographers It is actually breakable Gives England replica Enigma machine constructed from plans 10 Sept 2001 University of Virginia CS 588

University of Virginia CS 588 Bletchley Park Alan Turing leads British effort to crack Enigma Use cribs (“WETTER” transmitted every day at 6am) Still needed to brute force check ~1M keys. Built “bombes” to automate testing How many people worked on breaking Enigma? 30,000 people worked at Bletchley Park on breaking Enigma – 100,000 for Manhattan Project 10 Sept 2001 University of Virginia CS 588

University of Virginia CS 588 Enigma Cryptanalysis Relied on combination of sheer brilliance, mathematics, espionage, operator errors, and hard work Huge impact on WWII Britain knew where German U-boats were Advance notice of bombing raids But...keeping code break secret more important than short-term uses 10 Sept 2001 University of Virginia CS 588

End of classical ciphers A billion billion is a large number, but it's not that large a number. — Whitfield Diffie 10 Sept 2001 University of Virginia CS 588

Goals of Cipher: Diffusion and Confusion Claude Shannon [1945] Diffussion: Small change in plaintext, changes lots of ciphertext Statistical properties of plaintext hidden in ciphertext Confusion: Statistical relationship between key and ciphertext as complex as possible So, need to design functions that produce output that is diffuse and confused 10 Sept 2001 University of Virginia CS 588

University of Virginia CS 588 Block Ciphers Stream Ciphers Encrypts small (bit or byte) units one at a time Block Ciphers Encrypts large chunks (64 bits) at once Ciphers we have seen so far: Changing one letter of message only changes one letter of ciphertext There were classical ciphers that had some diffusion: Vigenère autokey, Hill cipher (2-letter chunks) 10 Sept 2001 University of Virginia CS 588

University of Virginia CS 588 Ideal Block Cipher 64 bit blocks 264 possible plaintext blocks, must have at least 264 corresponding ciphertext blocks There are 264! possible mappings Why not just create a random mapping? Need a 264 * 64-bit table  1021 bits $14 quadrillion Need to distribute new table if compromised Approximate ideal random mapping using components controlled by a key 10 Sept 2001 University of Virginia CS 588

Feistel Cipher Structure Plaintext L0 = left half of plaintext R0 = right half of plaintext Li = Ri - 1 Ri = Li - 1  F (Ri - 1, Ki ) C = Rn || Ln n is number of rounds (undo last permutation) L0 R0 K1 Substitution  F Round Permutation L1 R1 10 Sept 2001 University of Virginia CS 588

University of Virginia CS 588 One Round Feistel Li = Ri - 1 Ri = Li - 1  F (Ri - 1, Ki ) E (L0 || R0): L1 = R0 R1 = L0  F (R0, K1)) C = R1 || L1 = L0  F (R0, K1)) || R0 10 Sept 2001 University of Virginia CS 588

University of Virginia CS 588 Decryption Ciphertext LD0 = left half of ciphertext RD0 = right half of ciphertext LDi = RDi - 1 RDi = LDi - 1  F (RDi - 1, Kn – i + 1) P = RDn || LDn n is number of rounds LD0 RD0 Kn Substitution  F Permutation L1 R1 10 Sept 2001 University of Virginia CS 588

University of Virginia CS 588 LDi = RDi - 1 RDi = LDi - 1  F (RDi - 1, Kn – i + 1) Decryption D (L0  F (R0, K1)) || R0) LD0 = L0  F (R0, K1) RD0 = R0 LD1 = R0 RD1 = LD0  F (RD0, K1) = L0  F (R0, K1)  F (RD0, K1)) = L0 P = RD1 || LD1 = L0 || R0 Yippee! 10 Sept 2001 University of Virginia CS 588

University of Virginia CS 588 Multiple Rounds The entire round is a function: fK (L || R) = R || L  F (R, K)) swap (L || R) = R || L E = swap ° swap ° fKr ° swap ° fKr-1 ° ... ° fK2 ° swap ° fK1 D = fK1 ° swap ° fK2 ° ... ° fKr-1 ° swap ° fKr ° swap ° swap 10 Sept 2001 University of Virginia CS 588

University of Virginia CS 588 Decryption swap (fK (swap (fK (L || R)) = swap (fK (swap (R || L  F (R, K)))) = swap (fK (L  F (R, K) || R)) = swap (R || (L  F (R, K))  F (R, K)) = swap (R || L) = L || R So swap ° fK its own inverse! 10 Sept 2001 University of Virginia CS 588

University of Virginia CS 588 What are the requirements on F? For decryption to work: none! For security: Hide patterns in plaintext Hide patterns in key Coming up with a good F is hard 10 Sept 2001 University of Virginia CS 588

University of Virginia CS 588 DES NIST (then NBS) sought standard for data security (1973) IBM’s Lucifer only reasonable proposal Modified by NSA Changed S-Boxes Reduced key from 128 to 56 bits Adopted as standard in 1976 More bits have been encrypted using DES than any other cipher 10 Sept 2001 University of Virginia CS 588

University of Virginia CS 588 DES Algorithm Feistel cipher with added initial permutation Complex choice of F 16 rounds 56-bit key, shifts and permutations produce 48-bit subkeys for each round 10 Sept 2001 University of Virginia CS 588

University of Virginia CS 588 DES’s F 32 bits Expand and Permute (using E table) 48 bits  Kn Substitute (using S boxes) 32 bits Permutation The goal is confusion! 10 Sept 2001 University of Virginia CS 588

University of Virginia CS 588 S-Boxes 6 bits Example: 110011 S-Box 64 entry lookup table 4 bits 1001 Critical to security NSA changed choice of S-Boxes Only non-linear step in DES E(11)  E(01) + E(10) 10 Sept 2001 University of Virginia CS 588

University of Virginia CS 588 DES Avalanche Input: ...............................................................* 1 Permuted: .......................................*........................ 1 Round 1: .......*........................................................ 1 Round 2: .*..*...*.....*........................*........................ 5 Round 3: .*..*.*.**..*.*.*.*....**.....**.*..*...*.....*................. 18 Round 4: ..*.*****.*.*****.*.*......*.....*..*.*.**..*.*.*.*....**.....** 28 Round 5: *...**..*.*...*.*.*.*...*.***..*..*.*****.*.*****.*.*......*.... 29 Round 6: ...*..**.....*.*..**.*.**...*..**...**..*.*...*.*.*.*...*.***..* 26 Round 7: *****...***....**...*..*.*..*......*..**.....*.*..**.*.**...*..* Round 8: *.*.*.*.**.....*.*.*...**.*...*******...***....**...*..*.*..*... Round 9: ***.*.***...**.*.****.....**.*..*.*.*.*.**.....*.*.*...**.*...** Round 10: *.*..*.*.**.*..*.**.***.**.*...****.*.***...**.*.****.....**.*.. Round 11: ..******......*..******....*....*.*..*.*.**.*..*.**.***.**.*...* Round 12: *..***....*...*.*.*.***...****....******......*..******....*.... Round 13: **..*....*..******...*........*.*..***....*...*.*.*.***...****.. Round 14: *.**.*....*.*....**.*...*..**.****..*....*..******...*........*. Round 15: **.*....*.*.*...*.**.*..*.*.**.**.**.*....*.*....**.*...*..**.** Round 16: .*..*.*..*..*.**....**..*..*..****.*....*.*.*...*.**.*..*.*.**.* Output: ..*..**.*.*...*....***..***.**.*...*..*..*.*.*.**.*....*.*.*.**. Source: Willem de Graaf, http://www-groups.dcs.st-and.ac.uk/~wdg/slides/node150.html 10 Sept 2001 University of Virginia CS 588

University of Virginia CS 588 Key Schedule Need 16 48-bit keys Best security: just use 16 independent keys 768 key bits 56-bit key used (64 bits for parity checking) Produce 48-bit round keys by shifting and permuting 10 Sept 2001 University of Virginia CS 588

University of Virginia CS 588 DES Keys 56 bits Key Next round 28 bits 28 bits Shift (1 or 2 bits) Shift (1 or 2 bits) Compress/Permute Ki = PC (Shift (Left (Ki-1)) || Shift (Right (Ki-1))) Kn Are there any weak keys? 10 Sept 2001 University of Virginia CS 588

University of Virginia CS 588 Is DES a perfect cipher? No: more messages than keys Even for 1 64-bit block 264 messages > 256 keys 10 Sept 2001 University of Virginia CS 588

Attacking DES: Brute Force Key is 56 bits 256 = 7.2 * 1016 = 72 quadrillion Try 1 per second = 9 Billion years to search entire space Distributed attacks Steal/borrow idle cycles on networked PCs Search half of key space with 100000 PCs * 1M keys/second in 25 days 10 Sept 2001 University of Virginia CS 588

University of Virginia CS 588 Cracking DES 90B keys per second Cost < $250K (in 1998) 56 hours to solve RSA DES Challenge 10 Sept 2001 University of Virginia CS 588

University of Virginia CS 588 Brute Force Attacks RSA DES challenges: 1997: 96 days (using 70,000 machines) Feb 1998: 41 days (distributed.net) July 1998: 56 hours (custom hardware) January 1999: 22 hours (EFF + distributed.net) 245 Billion keys per second NSA can probably crack DES routinely (but they won’t admit it) 10 Sept 2001 University of Virginia CS 588

University of Virginia CS 588 Charge Next time: Better than brute force DES attacks 3-DES Modes of Operation Find your project teammates Start thinking about projects 10 Sept 2001 University of Virginia CS 588