Cryptanalysis of Modern Symmetric-Key Block Ciphers [Based on “A Tutorial on Linear and Differential Cryptanalysis” by Howard Heys.] Modern block ciphers.

Slides:



Advertisements
Similar presentations
DES The Data Encryption Standard (DES) is a classic symmetric block cipher algorithm. DES was developed in the 1970’s as a US government standard The block.
Advertisements

CS 483 – SD SECTION BY DR. DANIYAL ALGHAZZAWI (3) Information Security.
1 CIS 5371 Cryptography 5b. Pseudorandom Objects in Practice Block Ciphers.
SBSeg 2007, NCE/UFRJ, Rio de Janeiro Linear Analysis of reduced- round CAST-128 and CAST-256 Jorge Nakahara Jr 1 Mads Rasmussen 2 1 UNISANTOS, Brazil 2.
Cryptography and Network Security Chapter 3
Rachana Y. Patil 1 Data Encryption Standard (DES) (DES)
Data Encryption Standard (DES)
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.
Block Ciphers: Workhorses of Cryptography COMP 1721 A Winter 2004.
Cryptography Course 2008 Lecture 4 Jesper Buus Nielsen Modern Block Ciphers 1/43 Contents Encryption modes –Cipher-Block Chaining (CBC) Mode –Counter mode.
1 The AES block cipher Niels Ferguson. 2 What is it? Block cipher: encrypts fixed-size blocks. Design by two Belgians. Chosen from 15 entries in a competition.
Session 6: Introduction to cryptanalysis part 2. Symmetric systems The sources of vulnerabilities regarding linearity in block ciphers are S-boxes. Example.
JLM :161 Homework 6 – Problem 1 S-box 4 is observed to have the indicated output xor when presented with the indicated inputs In1: 0x22, In2:
FEAL FEAL 1.
Akelarre 1 Akelarre Akelarre 2 Akelarre  Block cipher  Combines features of 2 strong ciphers o IDEA — “mixed mode” arithmetic o RC5 — keyed rotations.
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.
ICS 454: Principles of Cryptography
Session 6: Introduction to cryptanalysis part 1. Contents Problem definition Symmetric systems cryptanalysis Particularities of block ciphers cryptanalysis.
Lecture 23 Symmetric Encryption
Cryptanalysis on Substitution- Permutation Networks Jen-Chang Liu, 2005 Ref: Cryptography: Theory and Practice, D. R. Stinson.
CS555Spring 2012/Topic 91 Cryptography CS 555 Topic 9: Block Cipher Construction & DES.
CSE 651: Introduction to Network Security
ECE454/CS594 Computer and Network Security Dr. Jinyuan (Stella) Sun Dept. of Electrical Engineering and Computer Science University of Tennessee Fall 2011.
Cryptanalysis. The Speaker  Chuck Easttom  
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.
CSCI 5857: Encoding and Encryption
5.1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 5 Introduction to Modern Symmetric-key Ciphers.
Block ciphers 2 Session 4. Contents Linear cryptanalysis Differential cryptanalysis 2/48.
Differential Cryptanalysis - quite similar to linear cryptanalysis - exploits the relationship between the difference of two inputs and the difference.
Feistel Model Last Updated: Aug 27, Feistel Cipher Structure Described by Horst Feistel (IBM) in 1973 Many symmetric encryption algorithms use this.
Chapter 20 Symmetric Encryption and Message Confidentiality.
Block ciphers Structure of a multiround block cipher
30.1 Chapter 30 Cryptography Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Feistel Cipher Structure
13. Other Block Ciphers 13.1 LUCIFER 13.2 MADRYGA 13.3 NEWDES 13.4 FEAL 13.5 REDOC 13.6 LOKI.
Cryptography Team Presentation 2
DIFFERENTIAL CRYPTANALYSIS Chapter 3.4. Ciphertext only attack. The cryptanalyst knows the cryptograms. This happens, if he can eavesdrop the communication.
‘Baby DES’ cipher Alexei Vernitski. Block cipher A message is a sequence of bits: … We split the message in blocks of a fixed length.
Description of a New Variable-Length Key, 64-Bit Block Cipher (BLOWFISH) Bruce Schneier BY Sunitha Thodupunuri.
Le Trong Ngoc Security Fundamentals (2) Encryption mechanisms 4/2011.
Lecture 23 Symmetric Encryption
Symmetric Encryption Lesson Introduction ●Block cipher primitives ●DES ●AES ●Encrypting large message ●Message integrity.
Computer and Network Security Rabie A. Ramadan Lecture 3.
Block Ciphers and the Advanced Encryption Standard
DES Analysis and Attacks CSCI 5857: Encoding and Encryption.
Linear Cryptanalysis of DES
DATA & COMPUTER SECURITY (CSNB414) MODULE 3 MODERN SYMMETRIC ENCRYPTION.
CS519, © A.SelcukDifferential & Linear Cryptanalysis1 CS 519 Cryptography and Network Security Instructor: Ali Aydin Selcuk.
CS548_ ADVANCED INFORMATION SECURITY Jong Heon, Park / Hyun Woo, Cho Paper Presentation #1 Improved version of LC in attacking DES.
Linear Cryptanalysis of DES M. Matsui. 1.Linear Cryptanalysis Method for DES Cipher. EUROCRYPT 93, 1994.Linear Cryptanalysis Method for DES Cipher 2.The.
Computer Science and Engineering Computer System Security CSE 5339/7339 Lecture 7 September 9, 2004.
Module :MA3036NI Symmetric Encryption -3 Lecture Week 4.
Block Ciphers and the Data Encryption Standard. Modern Block Ciphers  One of the most widely used types of cryptographic algorithms  Used in symmetric.
CST 312 Pablo Breuer. A block of plaintext is treated as a whole and used to produce a ciphertext block of equal length Typically a block size of 64 or.
Information and Computer Security CPIS 312 Lab 6 & 7 1 TRIGUI Mohamed Salim Symmetric key cryptography.
1 CPCS425: Information Security (Topic 5) Topic 5  Symmetrical Cryptography  Understand the principles of modern symmetric (conventional) cryptography.
@Yuan Xue Announcement Project Release Team forming Homework 1 will be released next Tuesday.
CS480 Cryptography and Information Security
6b. Practical Constructions of Symmetric-Key Primitives.
Some of this slide set is from Section 2,
Introduction to Modern Symmetric-key Ciphers
Cryptography Lecture 17.
Cryptanalysis of Block Ciphers
Differential Cryptanalysis
Cryptography Lecture 16.
Florida State University
Advanced Encryption Standard
Presentation transcript:

Cryptanalysis of Modern Symmetric-Key Block Ciphers [Based on “A Tutorial on Linear and Differential Cryptanalysis” by Howard Heys.] Modern block ciphers (like DES and AES): - proceed in rounds - each round has its own round key or subkey - the subkeys are computed from the master key by the key schedule A simpler modern-type block cipher for now: the substitution-permutation network (similar to DES and AES but simplified structure)

Substitution-Permutation Networks (SPN) - consists of a number of rounds, each round (except the last), consists of XOR-ing the subkey (this is sometimes called key mixing), substitutions, and a permutation - typically subkeys are derived from the master key but here they are randomly generated and unrelated Let ℓ and m be positive integers. The block length of the cipher is ℓm. We will use one substitution (also called an S-box) ¼ S :{0,1} ℓ  {0,1} ℓ and one permutation ¼ P :{1,…, ℓm}  {1,…, ℓm}.

Substitution-Permutation Networks (SPN) In each round: - XOR with the round key, - split the current string into m strings of length ℓ, apply ¼ S to each of these m strings - if this is not the last round, perform permutation ¼ P ; if it is the last round, XOR with the round key K R+1 where R is the number of rounds For example, if ℓ=2, m=3, ¼ S and ¼ P (see below), suppose the string before the round is and the round key is – what is the resulting string after this round ? x0123 ¼ S (x)1302 x ¼ P (x)642135

More on SPNs - simple and very efficient, both in hardware and in software (assuming the S-boxes are not too large) - decryption analogous to encryption (reverse each operation) - very successful: DES and AES are variations on SPNs - the first and last operations are XORing with subkeys (called whitening) – makes attacks harder Figure 1 (Heys’ tutorial): an example SPN that we will cryptanalyze

Attacks on SPNs - linear cryptanalysis and differential cryptanalysis - both: known-plaintext, and they require a lot of plaintext- ciphertext pairs Linear cryptanalysis: Find a linear relationship between a subset of the plaintext bits and a subset of the ciphertext bits; this relationship should hold with probability bounded away from ½ (the further away from ½, the better). This probability, minus ½, is called the probability bias. Note: In SPNs, all computations are linear, except for the S-boxes. Also, recall that linear cryptosystems are vulnerable to known- plaintext attacks.

Linear Approximations of S-boxes The S-box from Figure 1: Understanding the table: ℓ=4, the possible 4-bit strings are given in HEX. Let X 1, X 2, X 3, X 4 be random variables for the input bits (independent, uniform), and let Y 1, Y 2, Y 3, Y 4 be random variables for the output bits ABCDEF E4D12FB83A6C5907

Linear Approximations of S-boxes The S-box from Figure 1: Consider the linear equation: X 2 © X 3 © Y 1 © Y 3 © Y 4 = 0, or, equivalently X 2 © X 3 = Y 1 © Y 3 © Y 4. This equation holds for 12 or the 16 possible input values X 1, X 2, X 3, X 4. What is the probability bias of this equation ? ABCDEF E4D12FB83A6C5907

Linear Approximations of S-boxes The S-box from Figure 1: Consider the linear equation: X 1 © X 4 = Y 2 What is the probability bias of this equation ? ABCDEF E4D12FB83A6C5907

Linear Approximations of S-boxes The S-box from Figure 1: Consider the linear equation: X 3 © X 4 = Y 1 © Y 4 What is the probability bias of this equation ? ABCDEF E4D12FB83A6C5907

Linear Approximations of S-boxes The S-box from Figure 1: We can compute the probability biases for all linear equations relating the X i ’s and the Y i ’s. I.e. for any a i,b i 2 {0,1}, we can compute the bias of the equation a 1 X 1 © a 2 X 2 © a 3 X 3 © a 4 X 4 = b 1 Y 1 © b 2 Y 2 © b 3 Y 3 © b 4 Y 4. See Tables 3 and 4 in Heys’s tutorial. Next task: combining the linear approximations of the S-boxes to get a linear approximation of the entire SPN ABCDEF E4D12FB83A6C5907

Piling-up Lemma We will combine S-box approximations… What happens to the biases ? Piling-up Lemma: For k independent random variables X 1,X 2,…,X k where X i =0 has bias ² i, the equation X 1 © … © X k =0 has bias 2 k-1 ¦ i=1,…,k ² i. Note: lemma by Matsui, inventor of linear cryptanalysis Proving the lemma for k=2:

Piling-up Lemma We will combine S-box approximations… What happens to the biases ? Piling-up Lemma: For k independent random variables X 1,X 2,…,X k where X i =0 has bias ² i, the equation X 1 © … © X k =0 has bias 2 k-1 ¦ i=1,…,k ² i. Note: lemma by Matsui, inventor of linear cryptanalysis Give a simple example that shows that the assumption that the X i ‘s are independent is necessary.

Linear Approximation for the Cipher Recall the SPN from Figure 1 (also see Figure 3; we do not do the last round on this slide). Our approximation will involve S-boxes S 12, S 22, S 32, and S 34. We call them the active S-boxes. We will use the following approximations of these S-boxes: S 12 :X 1 © X 3 © X 4 = Y 2 bias ¼ S 22 :X 2 = Y 2 © Y 4 bias –¼ S 32 :X 2 = Y 2 © Y 4 bias –¼ S 34 :X 2 = Y 2 © Y 4 bias –¼

Linear Approximation for the Cipher Let P i be the random variable for the i-th plaintext bit, let U r,i be the random variable for the i-th input bit to the round r S- boxes, let V r,i be the random variable for the i-th output bit of the round r S-boxes, and let K r,i be the i-th bit of the r-th subkey. Let T 1,T 2,T 3,T 4 be random variables such that T 1 = U 1,5 © U 1,7 © U 1,8 © V 1,6 T 2 = U 2,6 © V 2,6 © V 2,8 T 3 = U 3,6 © V 3,6 © V 3,8 T 4 = U 3,14 © V 3,14 © V 3,16 What are the biases of T i =0 for i 2 {1,2,3,4} ?

Linear Approximation for the Cipher Let P i be the random variable for the i-th plaintext bit, let U r,i be the random variable for the i-th input bit to the round r S- boxes, let V r,i be the random variable for the i-th output bit of the round r S-boxes, and let K r,i be the i-th bit of the r-th subkey. Let T 1,T 2,T 3,T 4 be random variables such that T 1 = U 1,5 © U 1,7 © U 1,8 © V 1,6 T 2 = U 2,6 © V 2,6 © V 2,8 T 3 = U 3,6 © V 3,6 © V 3,8 T 4 = U 3,14 © V 3,14 © V 3,16 Note: the T i ’s are not independent but pretending that they are works well in practice.

Linear Approximation for the Cipher Let P i be the random variable for the i-th plaintext bit, let U r,i be the random variable for the i-th input bit to the round r S- boxes, let V r,i be the random variable for the i-th output bit of the round r S-boxes, and let K r,i be the i-th bit of the r-th subkey. Let T 1,T 2,T 3,T 4 be random variables such that T 1 = U 1,5 © U 1,7 © U 1,8 © V 1,6 T 2 = U 2,6 © V 2,6 © V 2,8 T 3 = U 3,6 © V 3,6 © V 3,8 T 4 = U 3,14 © V 3,14 © V 3,16 Applying the Piling-up Lemma: what is the bias of T 1 © T 2 © T 3 © T 4 = 0 ?

Linear Approximation for the Cipher Expressing T 1 © T 2 © T 3 © T 4 as the XOR of plaintext bits, subkey bits, and bits of the input (straightforward but tedious): T 1 © T 2 © T 3 © T 4 = P 5 © P 7 © P 8 © U 4,6 © U 4,8 © U 4,14 © U 4,16 © K 1,5 © K 1,7 © K 1,8 © K 2,6 © K 3,6 © K 3,14 © K 4,6 © K 4,8 © K 4,14 © K 4,16 For fixed key bits, their XOR-sum is either 0 or 1. Then the bias of P 5 © P 7 © P 8 © U 4,6 © U 4,8 © U 4,14 © U 4,16 =0 is either -1/32 or 1/32.

Extracting Key Bits Recall: we are performing a known-plaintext attack, and we assume that we have a large pool of plaintext-ciphertext pairs (all encrypted with the same key). How to use our linear approximation to determine a part of subkey K 5 ? We will partially decrypt each ciphertext, and see if our linear approximation P 5 © P 7 © P 8 © U 4,6 © U 4,8 © U 4,14 © U 4,16 =0 holds or not.

Extracting Key Bits In particular, we will go through all possible 2 8 possibilities for the subkey bits K 5,5, K 5,6, K 5,7, K 5,8, K 5,13, K 5,14, K 5,15, K 5,16. For each candidate subkey, compute the bias of P 5 © P 7 © P 8 © U 4,6 © U 4,8 © U 4,14 © U 4,16 =0 (described on the next slide). We are looking for a subkey for which the bias is the closest to 1/32 or -1/32.

Extracting Key Bits How to compute the bias for a specific candidate subkey ? For each plaintext-ciphertext pair, partially decrypt the ciphertext (in our case, XOR with the candidate subkey, then invert the two S-boxes to get U 4,5, U 4,6, U 4,7, U 4,8, U 4,13, U 4,14, U 4,15, U 4,16 ), then compute the value of P 5 © P 7 © P 8 © U 4,6 © U 4,8 © U 4,14 © U 4,16. Determine the fraction of plaintext-ciphertext pairs for which this value is 0, subtract ½ to get the bias (see Table 5).

Extracting Key Bits How many plaintext-ciphertext pairs do we need ? If the bias is ² (for us | ² |=1/32), we need about c ² -2 pairs for some “small” constant c. For our example c=8 is sufficient. How many pairs do we need for our example ? Questions: - What are some disadvantages of linear cryptanalysis ? - How can you make your SPN more secure against linear cryptanalysis ?