Cryptanalysis of C2 Lee, Jae-song 2019-02-23 Cryptanalysis of C2.

Slides:



Advertisements
Similar presentations
6.1.2 Overview DES is a block cipher, as shown in Figure 6.1.
Advertisements

Lee Jae-song 1.  How to cryptanalysis DES?  C = E K (P)  E is DES encryption funtion  K is a key, 56-bit.  P is a plaintext, C is a ciphertext, both.
1 CIS 5371 Cryptography 5b. Pseudorandom Objects in Practice Block Ciphers.
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.
Session 6: Introduction to cryptanalysis part 2. Symmetric systems The sources of vulnerabilities regarding linearity in block ciphers are S-boxes. Example.
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.
Announcements: Quizzes returned at end of class Quizzes returned at end of class This week: Mon-Thurs: Data Encryption Standard (DES) Mon-Thurs: Data Encryption.
Chapter 3 – Block Ciphers and the Data Encryption Standard Jen-Chang Liu, 2004 Adopted from lecture slides by Lawrie Brown.
Session 6: Introduction to cryptanalysis part 1. Contents Problem definition Symmetric systems cryptanalysis Particularities of block ciphers cryptanalysis.
Cryptanalysis. The Speaker  Chuck Easttom  
Hellman’s TMTO 1 Hellman’s TMTO Attack. Hellman’s TMTO 2 Popcnt  Before we consider Hellman’s attack, consider simpler Time-Memory Trade-Off  “Population.
Linear Fault Analysis of Block Ciphers Zhiqiang Liu 1, Dawu Gu 1, Ya Liu 1, Wei Li 2 1. Shanghai Jiao Tong University 2. Donghua University ACNS 2012 June.
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.
1 Lect. 10 : Cryptanalysis. 2 Block Cipher – Attack Scenarios  Attacks on encryption schemes  Ciphertext only attack: only ciphertexts are given  Known.
13. Other Block Ciphers 13.1 LUCIFER 13.2 MADRYGA 13.3 NEWDES 13.4 FEAL 13.5 REDOC 13.6 LOKI.
Cryptanalysis of 256-Bit Key HyRAL via Equivalent Keys Nagoya University, Japan Yuki Asano, Shingo Yanagihara, and Tetsu Iwata ACNS2012, June 28, 2012,
DIFFERENTIAL CRYPTANALYSIS Chapter 3.4. Ciphertext only attack. The cryptanalyst knows the cryptograms. This happens, if he can eavesdrop the communication.
Description of a New Variable-Length Key, 64-Bit Block Cipher (BLOWFISH) Bruce Schneier BY Sunitha Thodupunuri.
Block Ciphers and the Advanced Encryption Standard
DES Analysis and Attacks CSCI 5857: Encoding and Encryption.
David Evans CS551: Security and Privacy University of Virginia Computer Science Lecture 4: Dissin’ DES The design took.
CS519, © A.SelcukDifferential & Linear Cryptanalysis1 CS 519 Cryptography and Network Security Instructor: Ali Aydin Selcuk.
Lecture 4 Data Encryption Standard (DES) Dr. Nermin Hamza
CS480 Cryptography and Information Security
Computer and Information Security Chapter 6 Advanced Cryptanalysis 1.
Provides Confidentiality
Chapter3: Block Ciphers and the Data Encryption Standard
CH15 –Security & Crypto.
School of Computer Science and Engineering Pusan National University
Hellman’s TMTO Attack Hellman’s TMTO 1.
6b. Practical Constructions of Symmetric-Key Primitives.
Introduction to Modern Symmetric-key Ciphers
SYMMETRIC KEY ALGORITHMS
Lecture 2.2: Private Key Cryptography II
NET 311 Information Security
Cryptography after DES
Cryptography Lecture 18.
December 4--8, Nonlinear Invariant Attack Practical Attack on Full SCREAM, iSCREAM, and Midori64 Name: Position: My research topics.
مروري برالگوريتمهاي رمز متقارن(كليد پنهان)
AES Objectives ❏ To review a short history of AES
DES supplement.
Some of this slide set is from Section 2,
Block cipher & Fiestel Structure
ICS 454: Principles of Cryptography
Introduction to Modern Symmetric-key Ciphers
Block Ciphers and the Data Encryption Standard (DES)
Chapter -2 Block Ciphers and the Data Encryption Standard
Classical Ciphers – I Terminology CSCI284 Spring 2004 GWU Shift Cipher
SYMMETRIC KEY ALGORITHMS
Block Ciphers: DES and AES
SYMMETRIC ENCRYPTION.
Homework #1 Chap. 1, 3, 4 J. H. Wang Oct. 2, 2018.
BlowFish Algorithm.
Cryptanalysis of Block Ciphers
Differential Cryptanalysis
Lecture 5: DES Use and Analysis Background just got here last week
Cryptography and Network Security Chapter 5 Fifth Edition by William Stallings Lecture slides by Lawrie Brown.
Cryptography Lecture 3.
Cryptography Lecture 16.
Cryptanalysis Network Security.
Florida State University
ICS 555: Block Ciphers & DES Sultan Almuhammadi.
Cryptography Lecture 15.
Feistel Cipher Structure
Blowfish Encryption Algorithm
Presentation transcript:

Cryptanalysis of C2 Lee, Jae-song 2019-02-23 Cryptanalysis of C2

Table of Contents Intro: Structure of C2 Recovering S-box Intro to Boomerang Attack Recovering Key Recovering Both S-box and Key 2019-02-23 Cryptanalysis of C2

C2 is... Feistel-like block cipher 64-bit input 54-bit key 10-round Xi Zi Ui Feistel-like block cipher ADD instead of ⊕ 64-bit input 54-bit key 10-round Used in DVD DRM 2019-02-23 Cryptanalysis of C2

Subkey Generation 10-round → 32-bit 10 subkeys 2019-02-23 Cryptanalysis of C2

Cryptanalysis Points Only ADD and S-box are nonlinear S-box is trade secret! We even don’t know any subkey S-box as part of key: (28)^(28) = 22048 possibilities 2019-02-23 Cryptanalysis of C2

Three Attack Scenarios Unknown S-box (brute-force: 22048) Chosen-plaintext, Chosen-key (224) Known S-box, Unknown Key (256) Chosen-plaintext (248) Unknown S-box and Key (22104) Chosen-plaintext (253.5) 2019-02-23 Cryptanalysis of C2

Basic of Chosen-key Attack Generally, Choose “weak key” so each subkey has little encryption effect However, We don’t know subkeys! 2019-02-23 Cryptanalysis of C2

Finding a Weak Master Key rki = K[a] + ( S[b] << 4 ) Make only few inputs for S 2019-02-23 Cryptanalysis of C2

Master Key Master Key = Inputs of S-box: 0x40, 0x84, 0x88, 0x40, 0x02, 0x80, 0x09. Inputs of S-box: 0x88, 0x04, 0x27, 0x27, 0x04, 0x04, 0x27, 0x27, 0x88, 0x88. If we know S[0x04], S[0x27], S[0x88], we can compute all subkeys 2019-02-23 Cryptanalysis of C2

First Attack Scenario Let S’ = {0x04, 0x27, 0x88} Xi Zi Ui Let S’ = {0x04, 0x27, 0x88} 3 S-box entries: (28)3 possibilities For each possibility, precompute “good” plaintext test if plaintext is encrypted as expected 2019-02-23 Cryptanalysis of C2

First Attack Scenario If guess is right: If guess is wrong: Xi Zi Ui If guess is right: Passes test If guess is wrong: Wrongly passes with probability 2-29 Totally 224 computation to recover subkeys 2019-02-23 Cryptanalysis of C2

First Attack Scenario Now we know all subkeys Xi Zi Ui Now we know all subkeys Recover remaining S-box entries Requires <224 computations 2019-02-23 Cryptanalysis of C2

Precomputing Good Plaintext Finding a “good” plaintext is done at precomputation step It must not trigger any unknown S-box entry in 7 rounds How to find them efficiently? 2019-02-23 Cryptanalysis of C2

Precomputing Good Plaintext Fix X1[0..7], X2[0..7], X3[0..7], X4[0..7] as some arbitrary values of S’ Now, we know R1[0..7] ~ R4[0..7] L2[0..7] ~ L5[0..7] (Li+1 = Ri) U2[0..7] ~ U4[0..7] (Ri+1 = Ui+Li) Xi Zi Ui 2019-02-23 Cryptanalysis of C2

Precomputing Good Plaintext Let Ui = F(Xi) For 8-bit z, F(X⊕(z << 23))[0..7] = F(X)[0..7]⊕z Useful to “adjust” Xi values 2019-02-23 Cryptanalysis of C2

Precomputing Good Plaintext Choose X2[8..31] and X3[8..31] randomly Adjust X’2, X’3 s.t. X’2 = X2 ⊕ (x << 23) X’3 = X3 ⊕ (y << 23) F(X2)[0..7] ⊕ x = R1[0..7] + R3[0..7] (= F(X’2)[0..7]) F(X3)[0..7] ⊕ y = R2[0..7] - R4[0..7] (= F(X’3)[0..7]) 2019-02-23 Cryptanalysis of C2

Precomputing Good Plaintext Compute L’0, R’0 from X’2, X’3 This safisties the condition for round 2 ~ 5 Compute many values to find the value which satisfies the condition for round 1, 6, 7 Complexity: (256/3)^3 = 2^19.25 2019-02-23 Cryptanalysis of C2

Recovering S-box Now we know three entries of S-box Recover last 3 subkeys and corresponding S-box entries Now 3~6 entries recovered 2019-02-23 Cryptanalysis of C2

Recovering S-box Generate plaintext which only trigger known S-box entries in 7 rounds (same as previous method) Recover S-box of round 8 ~ 10 Do it again until all values are recovered Complexity = 2^20.2 2019-02-23 Cryptanalysis of C2

Boomerang Attack In the second and third attacks, we will use an extended diffential attack called Boomerang attack Chosen-plaintext & chosen-ciphertext 2019-02-23 Cryptanalysis of C2

Boomerang Attack Let P, P’, Q, Q’ four plaintext C = E(P), C’ = E(P’), D = E(Q), D’ = E(Q’) Break whole cipher into two parts: E(P) = E1(E0(P)) Ex) n/2 rounds each 2019-02-23 Cryptanalysis of C2

Boomerang Attack Δ = P⊕P’, E0(P’)=E0(P)⊕Δ’ ∇ = C⊕D, E1-1(D)=E1-1(C)⊕∇’ Suppose (Δ, Δ’) and (∇, ∇’) are two characteristics for E0 and E1-1 2019-02-23 Cryptanalysis of C2

Boomerang Attack E0(Q) ⊕ E0(Q’) = B ⊕ B’ = E1-1(D) ⊕ E1-1(D’) = E1-1(C⊕∇) ⊕ E1-1(C’⊕∇) = A⊕∇’ ⊕ A’⊕∇’ = A ⊕ A’ = Δ’ Then Q ⊕ Q’ = Δ 2019-02-23 Cryptanalysis of C2

Differential Characteristic of C2 Xi Zi Ui We need differntial characteristic independent to S-box. Δ[0..7] = Ri[0..7] ⊕ R’i[0..7] = 0 2019-02-23 Cryptanalysis of C2

Differential Characteristic of C2 Xi Zi Ui The best diffential for 5-round is Δ = (α, β) = (00020800, 80200100) Δ‘ = (β, α) = (80200100, 00020800) with p > 2-12 2019-02-23 Cryptanalysis of C2

Second Attack Scenario* For a semi-fixed plaintext, Some keys have boomerang The others don’t Try to find boomerang Its existence gives key bit information 2019-02-23 Cryptanalysis of C2

Second Attack Scenario* Let (L0, R0), (L0⊕α, R0⊕β) two plaintext where Δ = (α, β) → Δ’ = (β, α) with p > 2-12 If diffential holds, difference of L1 is β = (R0 + rk0) ⊕ ((R0 ⊕ β) + rk0) Let c(a,b) the carry bits of a+b a+b = a ⊕ b ⊕ c(a,b) 2019-02-23 Cryptanalysis of C2

Second Attack Scenario* β = (R0 + rk0) ⊕ ((R0 ⊕ β) + rk0) = (R0 ⊕ rk0 ⊕ c(R0, rk0)) ⊕ ((R0 ⊕ β) ⊕ rk0 ⊕ c(R0 ⊕ β, rk0)) = c(R0, rk0) ⊕ β ⊕ c(R0 ⊕ β, rk0) c(R0, rk0) = c(R0 ⊕ β, rk0) β[i] rk0[i] = β[i] c(R0, rk0)[i-1] Whenever β[i] = 1, rk0[i] = c(R0, rk0)[i-1] 2019-02-23 Cryptanalysis of C2

Second Attack Scenario* Whenever β[i] = 1, rk0[i] = c(R0, rk0)[i-1] β[7] = 1. Fix R0[0..7] = 0 then c[7] = 0 Therefore, rk0[8] = 0 if and only if diffential holds if boomerang works Try to find boomerang and conclude value of rk0[8] 2019-02-23 Cryptanalysis of C2

Second Attack Scenario* Now we know rk0[8] let R0[0..7] = 0100 0000 If rk0[8] = 0, c[7] = 0 iff rk0[7] = 0 If rk0[8] = 1, c[7] = 0 iff rk0[7] = 1 Recursively find rk0[0..7] and similarily rk0[21..8] We can’t recover rk0[22] since β[23..] = 0 2019-02-23 Cryptanalysis of C2

Second Attack Scenario Mount Boomerang to recover 22 bits of first round key (Complexity: 248, probability 0.5) Recover 8 bits of master key Brute-force remaining 48 bits (248) 2019-02-23 Cryptanalysis of C2

Third Attack Scenario Combine previous two attacks! Recover key Recover S-box 2019-02-23 Cryptanalysis of C2

Third Attack Scenario Mount Boomerang to recover 22 bits of first round key (250.59, probability 0.99) Mount Boomerang upside down to recover 22 bits of last round key (250.59) Recover remaining bits of two round keys and one S-box entry (2*252) 2019-02-23 Cryptanalysis of C2

Third Attack Scenario Recover second round key (245.3) Recover master key from 3 subkeys Recover 4 more S-box entries (4*244) Recover whole S-box (214 * 224) Overall complexity: 253.5 2019-02-23 Cryptanalysis of C2

Closing S-box did not helped diffusion well If Add is changed to XOR, the diffential has probability 1 (!) Placing secret value inside cipher is not very useful Consider Longer key instead Questions? 2019-02-23 Cryptanalysis of C2

References Cryptanalysis of C2. Julia Borghoff et al. CRYPTO 2009. Cryptanalysis of C2 (slides). The Boomerang Attack. David Wagner. 2019-02-23 Cryptanalysis of C2