making (near) optimal choices for the design of block ciphers

93
Making (near) Optimal Choices for the Design of Block Ciphers Making (near) Optimal Choices for the Design of Block Ciphers Baptiste Lambin Horst G¨ ortz Institute for IT Security, Ruhr University Bochum 26/02/2020 Baptiste Lambin Making (near) Optimal Choices for the Design of Block Ciphers 1 / 47

Upload: others

Post on 12-Jul-2022

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Making (near) Optimal Choices for the Design of Block Ciphers

Making (near) Optimal Choices for the Design of Block Ciphers

Making (near) Optimal Choices for the Design of BlockCiphers

Baptiste Lambin

Horst Gortz Institute for IT Security, Ruhr University Bochum

26/02/2020

Baptiste Lambin Making (near) Optimal Choices for the Design of Block Ciphers 1 / 47

Page 2: Making (near) Optimal Choices for the Design of Block Ciphers

Making (near) Optimal Choices for the Design of Block Ciphers

1 Introduction

2 Efficient Search for Optimal Diffusion Layers of GFNs

3 Variants of the AES Key-Schedule for Better Truncated DifferentialBounds

4 Perspectives

Baptiste Lambin Making (near) Optimal Choices for the Design of Block Ciphers 2 / 47

Page 3: Making (near) Optimal Choices for the Design of Block Ciphers

Making (near) Optimal Choices for the Design of Block Ciphers Introduction

1 Introduction

2 Efficient Search for Optimal Diffusion Layers of GFNs

3 Variants of the AES Key-Schedule for Better Truncated Differential Bounds

4 Perspectives

Baptiste Lambin Making (near) Optimal Choices for the Design of Block Ciphers 3 / 47

Page 4: Making (near) Optimal Choices for the Design of Block Ciphers

Making (near) Optimal Choices for the Design of Block Ciphers Introduction

Cryptography and Encryption

plaintext

ciphertext ciphertext

plaintext

Encrypt

unsecure channel

Decrypt

Baptiste Lambin Making (near) Optimal Choices for the Design of Block Ciphers 4 / 47

Page 5: Making (near) Optimal Choices for the Design of Block Ciphers

Making (near) Optimal Choices for the Design of Block Ciphers Introduction

Symmetric Encryption

plaintext

ciphertext ciphertext

plaintext

unsecure channel

Ekey E−1key

same keyEkey E−1key

Baptiste Lambin Making (near) Optimal Choices for the Design of Block Ciphers 5 / 47

Page 6: Making (near) Optimal Choices for the Design of Block Ciphers

Making (near) Optimal Choices for the Design of Block Ciphers Introduction

Symmetric Encryption

plaintext

ciphertext ciphertext

plaintext

unsecure channel

Ekey E−1key

same keyEkey E−1key

Baptiste Lambin Making (near) Optimal Choices for the Design of Block Ciphers 5 / 47

Page 7: Making (near) Optimal Choices for the Design of Block Ciphers

Making (near) Optimal Choices for the Design of Block Ciphers Introduction

Block Ciphers

Ep

k

c

Block Cipher

A block cipher is a family of permutations

E : Fs2 × Fn

2 → Fn2

such that for any k ∈ Fs2, Ek = E (k, ·) : Fn

2 → Fn2 is a permutation.

k is called the key

s is called the key length

n is called the block length

Baptiste Lambin Making (near) Optimal Choices for the Design of Block Ciphers 6 / 47

Page 8: Making (near) Optimal Choices for the Design of Block Ciphers

Making (near) Optimal Choices for the Design of Block Ciphers Introduction

Distinguishers

⇒ Behavior of the block cipher that a random function does not have.

Random Block cipher

f (x)⊕ f (x ⊕ 0x13) = 0x37 f (x)⊕ f (x ⊕ 0x13) = 0x37

f f

true with probability 2−(n−1) true with probability p

p � 2−(n−1) ⇒ we have a distinguisher

Baptiste Lambin Making (near) Optimal Choices for the Design of Block Ciphers 7 / 47

Page 9: Making (near) Optimal Choices for the Design of Block Ciphers

Making (near) Optimal Choices for the Design of Block Ciphers Introduction

Substitution-Permutation Networks

p

k0

S-box layer S S S S. . .

LLinear layer

k1

S S S S. . .

...

L

kr

c

Key-Schedule k

Baptiste Lambin Making (near) Optimal Choices for the Design of Block Ciphers 8 / 47

Page 10: Making (near) Optimal Choices for the Design of Block Ciphers

Making (near) Optimal Choices for the Design of Block Ciphers Introduction

A partial example

k : 0111011010101110 . . .

Key-Schedule

k0 : 0111011010101110

k1 : 1011101001011100

k2 : 0111010100000111

k3 : 1111111100010110...

Baptiste Lambin Making (near) Optimal Choices for the Design of Block Ciphers 9 / 47

Page 11: Making (near) Optimal Choices for the Design of Block Ciphers

Making (near) Optimal Choices for the Design of Block Ciphers Introduction

A partial example

0101 1010 0111 0101p = x0 :

0010 1100 1101 1011y0 :

0111 0110 1010 1110 : k0

1000 1101 0001 0011z0 :

S S S S

1010 1000 1100 1001x1 :

L

0001 0010 1001 0101y1 :

1011 1010 0101 1100 : k1

...

Baptiste Lambin Making (near) Optimal Choices for the Design of Block Ciphers 10 / 47

Page 12: Making (near) Optimal Choices for the Design of Block Ciphers

Making (near) Optimal Choices for the Design of Block Ciphers Introduction

A partial example

0101 1010 0111 0101p = x0 :

0010 1100 1101 1011y0 :

0111 0110 1010 1110 : k0

1000 1101 0001 0011z0 :

S S S S

1010 1000 1100 1001x1 :

L

0001 0010 1001 0101y1 :

1011 1010 0101 1100 : k1

...

Baptiste Lambin Making (near) Optimal Choices for the Design of Block Ciphers 10 / 47

Page 13: Making (near) Optimal Choices for the Design of Block Ciphers

Making (near) Optimal Choices for the Design of Block Ciphers Introduction

A partial example

0101 1010 0111 0101p = x0 :

0010 1100 1101 1011y0 :

0111 0110 1010 1110 : k0

1000 1101 0001 0011z0 :

S S S S

1010 1000 1100 1001x1 :

L

0001 0010 1001 0101y1 :

1011 1010 0101 1100 : k1

...

Baptiste Lambin Making (near) Optimal Choices for the Design of Block Ciphers 10 / 47

Page 14: Making (near) Optimal Choices for the Design of Block Ciphers

Making (near) Optimal Choices for the Design of Block Ciphers Introduction

A partial example

0101 1010 0111 0101p = x0 :

0010 1100 1101 1011y0 :

0111 0110 1010 1110 : k0

1000 1101 0001 0011z0 :

S S S S

1010 1000 1100 1001x1 :

L

0001 0010 1001 0101y1 :

1011 1010 0101 1100 : k1

...

Baptiste Lambin Making (near) Optimal Choices for the Design of Block Ciphers 10 / 47

Page 15: Making (near) Optimal Choices for the Design of Block Ciphers

Making (near) Optimal Choices for the Design of Block Ciphers Introduction

A partial example

0101 1010 0111 0101p = x0 :

0010 1100 1101 1011y0 :

0111 0110 1010 1110 : k0

1000 1101 0001 0011z0 :

S S S S

1010 1000 1100 1001x1 :

L

0001 0010 1001 0101y1 :

1011 1010 0101 1100 : k1

...

Baptiste Lambin Making (near) Optimal Choices for the Design of Block Ciphers 10 / 47

Page 16: Making (near) Optimal Choices for the Design of Block Ciphers

Making (near) Optimal Choices for the Design of Block Ciphers Introduction

Feistel Networks

p

F

k0

F

kr

c

Key-Schedule k

Baptiste Lambin Making (near) Optimal Choices for the Design of Block Ciphers 11 / 47

Page 17: Making (near) Optimal Choices for the Design of Block Ciphers

Making (near) Optimal Choices for the Design of Block Ciphers Introduction

p

k0

S S S S. . .

L

k1

S S S S. . .

...

L

kr

c

KS k

p

F

k0

F

kr

c

KS k

Baptiste Lambin Making (near) Optimal Choices for the Design of Block Ciphers 12 / 47

Page 18: Making (near) Optimal Choices for the Design of Block Ciphers

Making (near) Optimal Choices for the Design of Block Ciphers Introduction

Finding Optimal Components

Naıve algorithm : exhaustive search

Pros :

(Relatively) easy to implement

Optimality is easy to prove

Cons (non-exclusive) :

The search space can be very largee.g. From 252 up to 275 in the first part of this presentation

Testing one candidate can be expensivee.g. In the second part of this presentation, ”only” 244 candidates buttesting each of them is expensive

Baptiste Lambin Making (near) Optimal Choices for the Design of Block Ciphers 13 / 47

Page 19: Making (near) Optimal Choices for the Design of Block Ciphers

Making (near) Optimal Choices for the Design of Block Ciphers Introduction

Finding Optimal Components

Naıve algorithm : exhaustive searchPros :

(Relatively) easy to implement

Optimality is easy to prove

Cons (non-exclusive) :

The search space can be very largee.g. From 252 up to 275 in the first part of this presentation

Testing one candidate can be expensivee.g. In the second part of this presentation, ”only” 244 candidates buttesting each of them is expensive

Baptiste Lambin Making (near) Optimal Choices for the Design of Block Ciphers 13 / 47

Page 20: Making (near) Optimal Choices for the Design of Block Ciphers

Making (near) Optimal Choices for the Design of Block Ciphers Introduction

Finding Optimal Components

Naıve algorithm : exhaustive searchPros :

(Relatively) easy to implement

Optimality is easy to prove

Cons (non-exclusive) :

The search space can be very largee.g. From 252 up to 275 in the first part of this presentation

Testing one candidate can be expensivee.g. In the second part of this presentation, ”only” 244 candidates buttesting each of them is expensive

Baptiste Lambin Making (near) Optimal Choices for the Design of Block Ciphers 13 / 47

Page 21: Making (near) Optimal Choices for the Design of Block Ciphers

Making (near) Optimal Choices for the Design of Block Ciphers Introduction

Tools for Optimization

(Mixed) Integer Linear Programming (and some other variants)

Constraint Programming

Metaheuristics (near optimality)

SAT (somewhat)

Dedicated algorithms

In this talk :

Part 1 : Dedicated algorithm (∼ Branch-and-Bound) + efficienttesting for the small cases

Part 2 : Metaheuristics + Constraint Programming

Baptiste Lambin Making (near) Optimal Choices for the Design of Block Ciphers 14 / 47

Page 22: Making (near) Optimal Choices for the Design of Block Ciphers

Making (near) Optimal Choices for the Design of Block Ciphers Introduction

Tools for Optimization

(Mixed) Integer Linear Programming (and some other variants)

Constraint Programming

Metaheuristics (near optimality)

SAT (somewhat)

Dedicated algorithms

In this talk :

Part 1 : Dedicated algorithm (∼ Branch-and-Bound) + efficienttesting for the small cases

Part 2 : Metaheuristics + Constraint Programming

Baptiste Lambin Making (near) Optimal Choices for the Design of Block Ciphers 14 / 47

Page 23: Making (near) Optimal Choices for the Design of Block Ciphers

Making (near) Optimal Choices for the Design of Block Ciphers Efficient Search for Optimal Diffusion Layers of GFNs

1 Introduction

2 Efficient Search for Optimal Diffusion Layers of GFNs

3 Variants of the AES Key-Schedule for Better Truncated Differential Bounds

4 Perspectives

Baptiste Lambin Making (near) Optimal Choices for the Design of Block Ciphers 15 / 47

Page 24: Making (near) Optimal Choices for the Design of Block Ciphers

Making (near) Optimal Choices for the Design of Block Ciphers Efficient Search for Optimal Diffusion Layers of GFNs

Generalized Feistel Network

F key0 F key

1 F keyk−2 F key

k−1

π

State composed of 2k blocks

k Feistels in parallel followed by a permutation π

Easier to design but slower diffusion

Baptiste Lambin Making (near) Optimal Choices for the Design of Block Ciphers 16 / 47

Page 25: Making (near) Optimal Choices for the Design of Block Ciphers

Making (near) Optimal Choices for the Design of Block Ciphers Efficient Search for Optimal Diffusion Layers of GFNs

Generalized Feistel Network

S S S S

π

State composed of 2k blocks

k Feistels in parallel followed by a permutation π

Easier to design but slower diffusion

In this work, the key and the definition of the F-functions don’t matter

Baptiste Lambin Making (near) Optimal Choices for the Design of Block Ciphers 16 / 47

Page 26: Making (near) Optimal Choices for the Design of Block Ciphers

Making (near) Optimal Choices for the Design of Block Ciphers Efficient Search for Optimal Diffusion Layers of GFNs

Diffusion Round

S S S S

6 5 6 5 6 5 6 5

S S S S

S S S S

S S S S

S S S S

S S S S

5 6 5 6 5 6 5 6

Depends only on π

Tied to impossibledifferential and integralattacks

For encryption

...anddecryption

DR(π) = 6 here

Baptiste Lambin Making (near) Optimal Choices for the Design of Block Ciphers 17 / 47

Page 27: Making (near) Optimal Choices for the Design of Block Ciphers

Making (near) Optimal Choices for the Design of Block Ciphers Efficient Search for Optimal Diffusion Layers of GFNs

Diffusion Round

S S S S

6 5 6 5 6 5 6 5

S S S S

S S S S

S S S S

S S S S

S S S S

5 6 5 6 5 6 5 6

Depends only on π

Tied to impossibledifferential and integralattacks

For encryption

...anddecryption

DR(π) = 6 here

Baptiste Lambin Making (near) Optimal Choices for the Design of Block Ciphers 17 / 47

Page 28: Making (near) Optimal Choices for the Design of Block Ciphers

Making (near) Optimal Choices for the Design of Block Ciphers Efficient Search for Optimal Diffusion Layers of GFNs

Diffusion Round

S S S S

6 5 6 5 6 5 6 5

S S S S

S S S S

S S S S

S S S S

S S S S

5 6 5 6 5 6 5 6

Depends only on π

Tied to impossibledifferential and integralattacks

For encryption

...anddecryption

DR(π) = 6 here

Baptiste Lambin Making (near) Optimal Choices for the Design of Block Ciphers 17 / 47

Page 29: Making (near) Optimal Choices for the Design of Block Ciphers

Making (near) Optimal Choices for the Design of Block Ciphers Efficient Search for Optimal Diffusion Layers of GFNs

Diffusion Round

S S S S

6 5 6 5 6 5 6 5

S S S S

S S S S

S S S S

S S S S

S S S S

5 6 5 6 5 6 5 6

Depends only on π

Tied to impossibledifferential and integralattacks

For encryption

...anddecryption

DR(π) = 6 here

Baptiste Lambin Making (near) Optimal Choices for the Design of Block Ciphers 17 / 47

Page 30: Making (near) Optimal Choices for the Design of Block Ciphers

Making (near) Optimal Choices for the Design of Block Ciphers Efficient Search for Optimal Diffusion Layers of GFNs

Diffusion Round

S S S S

6

5 6 5 6 5 6 5

S S S S

S S S S

S S S S

S S S S

S S S S

5 6 5 6 5 6 5 6

Depends only on π

Tied to impossibledifferential and integralattacks

For encryption

...anddecryption

DR(π) = 6 here

Baptiste Lambin Making (near) Optimal Choices for the Design of Block Ciphers 17 / 47

Page 31: Making (near) Optimal Choices for the Design of Block Ciphers

Making (near) Optimal Choices for the Design of Block Ciphers Efficient Search for Optimal Diffusion Layers of GFNs

Diffusion Round

S S S S

6 5

6 5 6 5 6 5

S S S S

S S S S

S S S S

S S S S

S S S S

5 6 5 6 5 6 5 6

Depends only on π

Tied to impossibledifferential and integralattacks

For encryption

...anddecryption

DR(π) = 6 here

Baptiste Lambin Making (near) Optimal Choices for the Design of Block Ciphers 17 / 47

Page 32: Making (near) Optimal Choices for the Design of Block Ciphers

Making (near) Optimal Choices for the Design of Block Ciphers Efficient Search for Optimal Diffusion Layers of GFNs

Diffusion Round

S S S S

6 5 6 5 6 5 6 5

S S S S

S S S S

S S S S

S S S S

S S S S

5 6 5 6 5 6 5 6

Depends only on π

Tied to impossibledifferential and integralattacks

For encryption...

anddecryption

DR(π) = 6 here

Baptiste Lambin Making (near) Optimal Choices for the Design of Block Ciphers 17 / 47

Page 33: Making (near) Optimal Choices for the Design of Block Ciphers

Making (near) Optimal Choices for the Design of Block Ciphers Efficient Search for Optimal Diffusion Layers of GFNs

Diffusion Round

S S S S

6 5 6 5 6 5 6 5

S S S S

S S S S

S S S S

S S S S

S S S S

5

6 5 6 5 6 5 6

Depends only on π

Tied to impossibledifferential and integralattacks

For encryption

...

anddecryption

DR(π) = 6 here

Baptiste Lambin Making (near) Optimal Choices for the Design of Block Ciphers 17 / 47

Page 34: Making (near) Optimal Choices for the Design of Block Ciphers

Making (near) Optimal Choices for the Design of Block Ciphers Efficient Search for Optimal Diffusion Layers of GFNs

Diffusion Round

S S S S

6 5 6 5 6 5 6 5

S S S S

S S S S

S S S S

S S S S

S S S S

5 6 5 6 5 6 5 6

Depends only on π

Tied to impossibledifferential and integralattacks

For encryption

...

anddecryption

DR(π) = 6 here

Baptiste Lambin Making (near) Optimal Choices for the Design of Block Ciphers 17 / 47

Page 35: Making (near) Optimal Choices for the Design of Block Ciphers

Making (near) Optimal Choices for the Design of Block Ciphers Efficient Search for Optimal Diffusion Layers of GFNs

Previous Work

Suzaki and Minematsu at FSE’10

Lower bound on DR(π) depending only on kExhaustive search for 2k ≤ 16Observed that all optimal permutations in these cases are even-oddGeneric construction with DR(π) = 2 log2 k (not optimal in general)

Cauchois et al. at FSE’19

Equivalence relation for even-odd permutationsOptimal even-odd permutations for 18 ≤ 2k ≤ 26Good candidate for 2k = 32 (already known from FSE’10) and2k = 64, 128

Open problem : is the permutation on 32 blocks optimal ?Diffusion round of 10 but lower bound at 9 rounds.

Baptiste Lambin Making (near) Optimal Choices for the Design of Block Ciphers 18 / 47

Page 36: Making (near) Optimal Choices for the Design of Block Ciphers

Making (near) Optimal Choices for the Design of Block Ciphers Efficient Search for Optimal Diffusion Layers of GFNs

Previous Work

Suzaki and Minematsu at FSE’10

Lower bound on DR(π) depending only on kExhaustive search for 2k ≤ 16Observed that all optimal permutations in these cases are even-oddGeneric construction with DR(π) = 2 log2 k (not optimal in general)

Cauchois et al. at FSE’19

Equivalence relation for even-odd permutationsOptimal even-odd permutations for 18 ≤ 2k ≤ 26Good candidate for 2k = 32 (already known from FSE’10) and2k = 64, 128

Open problem : is the permutation on 32 blocks optimal ?Diffusion round of 10 but lower bound at 9 rounds.

Baptiste Lambin Making (near) Optimal Choices for the Design of Block Ciphers 18 / 47

Page 37: Making (near) Optimal Choices for the Design of Block Ciphers

Making (near) Optimal Choices for the Design of Block Ciphers Efficient Search for Optimal Diffusion Layers of GFNs

Previous Work

Suzaki and Minematsu at FSE’10

Lower bound on DR(π) depending only on kExhaustive search for 2k ≤ 16Observed that all optimal permutations in these cases are even-oddGeneric construction with DR(π) = 2 log2 k (not optimal in general)

Cauchois et al. at FSE’19

Equivalence relation for even-odd permutationsOptimal even-odd permutations for 18 ≤ 2k ≤ 26Good candidate for 2k = 32 (already known from FSE’10) and2k = 64, 128

Open problem : is the permutation on 32 blocks optimal ?Diffusion round of 10 but lower bound at 9 rounds.

Baptiste Lambin Making (near) Optimal Choices for the Design of Block Ciphers 18 / 47

Page 38: Making (near) Optimal Choices for the Design of Block Ciphers

Making (near) Optimal Choices for the Design of Block Ciphers Efficient Search for Optimal Diffusion Layers of GFNs

This Work

We solve this 10-year-old problem

New characterization for the diffusion round⇒ Efficient algorithm to search for an optimal permutation

Results for 28 ≤ 2k ≤ 42

Security evaluation for all permutations found

Baptiste Lambin Making (near) Optimal Choices for the Design of Block Ciphers 19 / 47

Page 39: Making (near) Optimal Choices for the Design of Block Ciphers

Making (near) Optimal Choices for the Design of Block Ciphers Efficient Search for Optimal Diffusion Layers of GFNs

Even-odd Permutations

S S S S

π = (3, 0, 5, 6, 1, 2, 7, 4)

p = (1, 2, 0, 3) π(2i) = 2p(i) + 1

q = (0, 3, 1, 2) π(2i + 1) = 2q(i)

Baptiste Lambin Making (near) Optimal Choices for the Design of Block Ciphers 20 / 47

Page 40: Making (near) Optimal Choices for the Design of Block Ciphers

Making (near) Optimal Choices for the Design of Block Ciphers Efficient Search for Optimal Diffusion Layers of GFNs

Even-odd Permutations

S S S S

π = (3, 0, 5, 6, 1, 2, 7, 4)

p = (1, 2, 0, 3) π(2i) = 2p(i) + 1

q = (0, 3, 1, 2) π(2i + 1) = 2q(i)

Baptiste Lambin Making (near) Optimal Choices for the Design of Block Ciphers 20 / 47

Page 41: Making (near) Optimal Choices for the Design of Block Ciphers

Making (near) Optimal Choices for the Design of Block Ciphers Efficient Search for Optimal Diffusion Layers of GFNs

Even-odd Permutations

S S S S

π = (3, 0, 5, 6, 1, 2, 7, 4)

p = (1, 2, 0, 3) π(2i) = 2p(i) + 1

q = (0, 3, 1, 2) π(2i + 1) = 2q(i)

Baptiste Lambin Making (near) Optimal Choices for the Design of Block Ciphers 20 / 47

Page 42: Making (near) Optimal Choices for the Design of Block Ciphers

Making (near) Optimal Choices for the Design of Block Ciphers Efficient Search for Optimal Diffusion Layers of GFNs

Ideal Diffusion

2j50 2j5

0 + 1 2j51 2j5

2 2j52 + 1 2j5

3 2j53 + 1 2j5

4

2j40 2j4

0 + 1

p q

2j41

p

2j42 2j4

2 + 1

p q

2j30 2j3

0 + 1

p q

2j31

p

2j20 2j2

0 + 1

p q

2j10

p

2j

S

2j

2j10

p

S

2p(j10 ) + 1

2j20 + 12j20

2j 50

p

p

p

p

j50 = p ◦ p ◦ p ◦ p(j)

2j 51

p

p

p

q

j51 = q ◦ p ◦ p ◦ p(j)

2j 54

p

q

p

q

j52 = p ◦ q ◦ p ◦ p(j)

j53 = p ◦ p ◦ q ◦ p(j)

j54 = q ◦ p ◦ q ◦ p(j)

J5j

Baptiste Lambin Making (near) Optimal Choices for the Design of Block Ciphers 21 / 47

Page 43: Making (near) Optimal Choices for the Design of Block Ciphers

Making (near) Optimal Choices for the Design of Block Ciphers Efficient Search for Optimal Diffusion Layers of GFNs

Ideal Diffusion

2j50 2j5

0 + 1 2j51 2j5

2 2j52 + 1 2j5

3 2j53 + 1 2j5

4

2j40 2j4

0 + 1

p q

2j41

p

2j42 2j4

2 + 1

p q

2j30 2j3

0 + 1

p q

2j31

p

2j20 2j2

0 + 1

p q

2j10

p

2jS

2j

2j10

p

S

2p(j10 ) + 1

2j20 + 12j20

2j 50

p

p

p

p

j50 = p ◦ p ◦ p ◦ p(j)

2j 51

p

p

p

q

j51 = q ◦ p ◦ p ◦ p(j)

2j 54

p

q

p

q

j52 = p ◦ q ◦ p ◦ p(j)

j53 = p ◦ p ◦ q ◦ p(j)

j54 = q ◦ p ◦ q ◦ p(j)

J5j

Baptiste Lambin Making (near) Optimal Choices for the Design of Block Ciphers 21 / 47

Page 44: Making (near) Optimal Choices for the Design of Block Ciphers

Making (near) Optimal Choices for the Design of Block Ciphers Efficient Search for Optimal Diffusion Layers of GFNs

Ideal Diffusion

2j50 2j5

0 + 1 2j51 2j5

2 2j52 + 1 2j5

3 2j53 + 1 2j5

4

2j40 2j4

0 + 1

p q

2j41

p

2j42 2j4

2 + 1

p q

2j30 2j3

0 + 1

p q

2j31

p

2j20 2j2

0 + 1

p q

2j10

2j

S

2j

2j10

p

S

2p(j10 ) + 1

2j20 + 12j20

2j 50

p

p

p

p

j50 = p ◦ p ◦ p ◦ p(j)

2j 51

p

p

p

q

j51 = q ◦ p ◦ p ◦ p(j)

2j 54

p

q

p

q

j52 = p ◦ q ◦ p ◦ p(j)

j53 = p ◦ p ◦ q ◦ p(j)

j54 = q ◦ p ◦ q ◦ p(j)

J5j

Baptiste Lambin Making (near) Optimal Choices for the Design of Block Ciphers 21 / 47

Page 45: Making (near) Optimal Choices for the Design of Block Ciphers

Making (near) Optimal Choices for the Design of Block Ciphers Efficient Search for Optimal Diffusion Layers of GFNs

Ideal Diffusion

2j50 + 1 2j5

1 2j52 2j5

2 + 1 2j53 2j5

3 + 1 2j54

2j40 2j4

0 + 1

q

2j41

p

2j42 2j4

2 + 1

p q

2j30 2j3

0 + 1

q

2j31

p

2j20 2j2

0 + 1

q

2j10

2j

S

2j

2j10

p

S

2p(j10 ) + 1

2j20 + 12j20

2j 50

p

p

p

p

j50 = p ◦ p ◦ p ◦ p(j)

2j 51

p

p

p

q

j51 = q ◦ p ◦ p ◦ p(j)

2j 54

p

q

p

q

j52 = p ◦ q ◦ p ◦ p(j)

j53 = p ◦ p ◦ q ◦ p(j)

j54 = q ◦ p ◦ q ◦ p(j)

J5j

Baptiste Lambin Making (near) Optimal Choices for the Design of Block Ciphers 21 / 47

Page 46: Making (near) Optimal Choices for the Design of Block Ciphers

Making (near) Optimal Choices for the Design of Block Ciphers Efficient Search for Optimal Diffusion Layers of GFNs

Ideal Diffusion

2j50 2j5

0 + 1 2j52 2j5

2 + 1 2j53 2j5

3 + 1 2j54

2j40 2j4

0 + 1

p

2j41

p

2j42 2j4

2 + 1

p q

2j30 2j3

0 + 1

q

2j31

p

2j20 2j2

0 + 1

q

2j10

2j

S

2j

2j10

p

S

2p(j10 ) + 1

2j20 + 12j20

2j 50

p

p

p

p

j50 = p ◦ p ◦ p ◦ p(j)

2j 51

p

p

p

q

j51 = q ◦ p ◦ p ◦ p(j)

2j 54

p

q

p

q

j52 = p ◦ q ◦ p ◦ p(j)

j53 = p ◦ p ◦ q ◦ p(j)

j54 = q ◦ p ◦ q ◦ p(j)

J5j

Baptiste Lambin Making (near) Optimal Choices for the Design of Block Ciphers 21 / 47

Page 47: Making (near) Optimal Choices for the Design of Block Ciphers

Making (near) Optimal Choices for the Design of Block Ciphers Efficient Search for Optimal Diffusion Layers of GFNs

Ideal Diffusion

2j50 2j5

0 + 1 2j51 2j5

2 2j52 + 1 2j5

3 2j53 + 1

2j40 2j4

0 + 1

p q

2j41

p

2j42 2j4

2 + 1

p

2j30 2j3

0 + 1

p q

2j31

2j20 2j2

0 + 1

p

2j10

2j

S

2j

2j10

p

S

2p(j10 ) + 1

2j20 + 12j20

2j 50

p

p

p

p

j50 = p ◦ p ◦ p ◦ p(j)

2j 51

p

p

p

q

j51 = q ◦ p ◦ p ◦ p(j)

2j 54

p

q

p

q

j52 = p ◦ q ◦ p ◦ p(j)

j53 = p ◦ p ◦ q ◦ p(j)

j54 = q ◦ p ◦ q ◦ p(j)

J5j

Baptiste Lambin Making (near) Optimal Choices for the Design of Block Ciphers 21 / 47

Page 48: Making (near) Optimal Choices for the Design of Block Ciphers

Making (near) Optimal Choices for the Design of Block Ciphers Efficient Search for Optimal Diffusion Layers of GFNs

A Visualization of This Characterization

x 0 1 2 3 4 5 6 7

p5 3 4 5 6 7 0 1 2

p4q 4 5 6 7 0 1 2 3

p3qp 4 5 6 7 0 1 2 3

p2qp2 4 5 6 7 0 1 2 3

pqp3 4 5 6 7 0 1 2 3

qp4 4 5 6 7 0 1 2 3

p2qpq 5 6 7 0 1 2 3 4

pqp2q 5 6 7 0 1 2 3 4

qp3q 5 6 7 0 1 2 3 4

pqpqp 5 6 7 0 1 2 3 4

qp2qp 5 6 7 0 1 2 3 4

qpqp2 5 6 7 0 1 2 3 4

qpqpq 6 7 0 1 2 3 4 5

diff 4 4 4 4 4 4 4 4

J7j

Cyclic Shiftp = (7, 0, 1, 2, 3, 4, 5, 6)q = (0, 1, 2, 3, 4, 5, 6, 7)

Baptiste Lambin Making (near) Optimal Choices for the Design of Block Ciphers 22 / 47

Page 49: Making (near) Optimal Choices for the Design of Block Ciphers

Making (near) Optimal Choices for the Design of Block Ciphers Efficient Search for Optimal Diffusion Layers of GFNs

A Visualization of This Characterization

x 0 1 2 3 4 5 6 7

p5 3 4 5 6 7 0 1 2

p4q 4 5 6 7 0 1 2 3

p3qp 4 5 6 7 0 1 2 3

p2qp2 4 5 6 7 0 1 2 3

pqp3 4 5 6 7 0 1 2 3

qp4 4 5 6 7 0 1 2 3

p2qpq 5 6 7 0 1 2 3 4

pqp2q 5 6 7 0 1 2 3 4

qp3q 5 6 7 0 1 2 3 4

pqpqp 5 6 7 0 1 2 3 4

qp2qp 5 6 7 0 1 2 3 4

qpqp2 5 6 7 0 1 2 3 4

qpqpq 6 7 0 1 2 3 4 5

diff 4 4 4 4 4 4 4 4

J70

Cyclic Shiftp = (7, 0, 1, 2, 3, 4, 5, 6)q = (0, 1, 2, 3, 4, 5, 6, 7)

Baptiste Lambin Making (near) Optimal Choices for the Design of Block Ciphers 22 / 47

Page 50: Making (near) Optimal Choices for the Design of Block Ciphers

Making (near) Optimal Choices for the Design of Block Ciphers Efficient Search for Optimal Diffusion Layers of GFNs

A Visualization of This Characterization

x 0 1 2 3 4 5 6 7

p5 3 4 5 6 7 0 1 2

p4q 4 5 6 7 0 1 2 3

p3qp 4 5 6 7 0 1 2 3

p2qp2 4 5 6 7 0 1 2 3

pqp3 4 5 6 7 0 1 2 3

qp4 4 5 6 7 0 1 2 3

p2qpq 5 6 7 0 1 2 3 4

pqp2q 5 6 7 0 1 2 3 4

qp3q 5 6 7 0 1 2 3 4

pqpqp 5 6 7 0 1 2 3 4

qp2qp 5 6 7 0 1 2 3 4

qpqp2 5 6 7 0 1 2 3 4

qpqpq 6 7 0 1 2 3 4 5

diff 4 4 4 4 4 4 4 4

J71

Cyclic Shiftp = (7, 0, 1, 2, 3, 4, 5, 6)q = (0, 1, 2, 3, 4, 5, 6, 7)

Baptiste Lambin Making (near) Optimal Choices for the Design of Block Ciphers 22 / 47

Page 51: Making (near) Optimal Choices for the Design of Block Ciphers

Making (near) Optimal Choices for the Design of Block Ciphers Efficient Search for Optimal Diffusion Layers of GFNs

A Visualization of This Characterization

x 0 1 2 3 4 5 6 7

p5 4 3 5 1 6 7 0 2

p4q 3 2 1 4 0 6 7 5

p3qp 2 6 7 5 1 3 4 0

p2qp2 6 7 4 0 5 2 3 1

pqp3 1 4 3 2 0 6 7 5

qp4 2 5 7 6 3 1 4 0

p2qpq 7 1 0 6 3 5 2 4

pqp2q 4 5 2 1 7 0 6 3

qp3q 5 0 6 2 4 3 1 7

pqpqp 5 0 6 3 2 4 1 7

qp2qp 0 3 1 7 6 5 2 4

qpqp2 3 1 2 4 7 0 5 6

qpqpq 1 6 4 3 5 7 0 2

diff 8 8 8 8 8 8 8 8

J7j

Optimal Permutationp = (6, 3, 7, 1, 0, 2, 4, 5)q = (3, 5, 1, 6, 4, 0, 2, 7)

Baptiste Lambin Making (near) Optimal Choices for the Design of Block Ciphers 23 / 47

Page 52: Making (near) Optimal Choices for the Design of Block Ciphers

Making (near) Optimal Choices for the Design of Block Ciphers Efficient Search for Optimal Diffusion Layers of GFNs

A Visualization of This Characterization

x 0 1 2 3 4 5 6 7

p5 4 3 5 1 6 7 0 2

p4q 3 2 1 4 0 6 7 5

p3qp 2 6 7 5 1 3 4 0

p2qp2 6 7 4 0 5 2 3 1

pqp3 1 4 3 2 0 6 7 5

qp4 2 5 7 6 3 1 4 0

p2qpq 7 1 0 6 3 5 2 4

pqp2q 4 5 2 1 7 0 6 3

qp3q 5 0 6 2 4 3 1 7

pqpqp 5 0 6 3 2 4 1 7

qp2qp 0 3 1 7 6 5 2 4

qpqp2 3 1 2 4 7 0 5 6

qpqpq 1 6 4 3 5 7 0 2

diff 8 8 8 8 8 8 8 8

J70

Optimal Permutationp = (6, 3, 7, 1, 0, 2, 4, 5)q = (3, 5, 1, 6, 4, 0, 2, 7)

Baptiste Lambin Making (near) Optimal Choices for the Design of Block Ciphers 23 / 47

Page 53: Making (near) Optimal Choices for the Design of Block Ciphers

Making (near) Optimal Choices for the Design of Block Ciphers Efficient Search for Optimal Diffusion Layers of GFNs

Searching for an optimal permutation

(k!)2 even-odd permutations, reduced to Nk .k! with an equivalencerelation.Nk := number of partitions of the integer k .⇒ For 2k = 32, ∼ 252 permutations instead of (16!)2 ' 288.

Main idea : partially compute some Jrj + Branch-and-Bound

J8j

J8p(j)

Baptiste Lambin Making (near) Optimal Choices for the Design of Block Ciphers 24 / 47

Page 54: Making (near) Optimal Choices for the Design of Block Ciphers

Making (near) Optimal Choices for the Design of Block Ciphers Efficient Search for Optimal Diffusion Layers of GFNs

Results and Summary

New characterization for the diffusion round in a GFN

Very efficient search algorithm, highly parallelizable (< 1h for eachcase with 72 threads)

For 2k = 28, 30, 32 and 36, the optimal number of rounds for fulldiffusion is 9.

For 2k = 34, the optimal number of rounds for full diffusion is 10.

For 2k = 38, 40 and 42, the optimal number of rounds for fulldiffusion is at least 10 and at most 11.

Baptiste Lambin Making (near) Optimal Choices for the Design of Block Ciphers 25 / 47

Page 55: Making (near) Optimal Choices for the Design of Block Ciphers

Making (near) Optimal Choices for the Design of Block Ciphers Efficient Search for Optimal Diffusion Layers of GFNs

Results and Summary

New characterization for the diffusion round in a GFN

Very efficient search algorithm, highly parallelizable (< 1h for eachcase with 72 threads)

For 2k = 28, 30, 32 and 36, the optimal number of rounds for fulldiffusion is 9.

For 2k = 34, the optimal number of rounds for full diffusion is 10.

For 2k = 38, 40 and 42, the optimal number of rounds for fulldiffusion is at least 10 and at most 11.

Baptiste Lambin Making (near) Optimal Choices for the Design of Block Ciphers 25 / 47

Page 56: Making (near) Optimal Choices for the Design of Block Ciphers

Making (near) Optimal Choices for the Design of Block Ciphers Efficient Search for Optimal Diffusion Layers of GFNs

Results and Summary

New characterization for the diffusion round in a GFN

Very efficient search algorithm, highly parallelizable (< 1h for eachcase with 72 threads)

For 2k = 28, 30, 32 and 36, the optimal number of rounds for fulldiffusion is 9.

For 2k = 34, the optimal number of rounds for full diffusion is 10.

For 2k = 38, 40 and 42, the optimal number of rounds for fulldiffusion is at least 10 and at most 11.

Baptiste Lambin Making (near) Optimal Choices for the Design of Block Ciphers 25 / 47

Page 57: Making (near) Optimal Choices for the Design of Block Ciphers

Making (near) Optimal Choices for the Design of Block Ciphers Efficient Search for Optimal Diffusion Layers of GFNs

Results and Summary

New characterization for the diffusion round in a GFN

Very efficient search algorithm, highly parallelizable (< 1h for eachcase with 72 threads)

For 2k = 28, 30, 32 and 36, the optimal number of rounds for fulldiffusion is 9.

For 2k = 34, the optimal number of rounds for full diffusion is 10.

For 2k = 38, 40 and 42, the optimal number of rounds for fulldiffusion is at least 10 and at most 11.

Baptiste Lambin Making (near) Optimal Choices for the Design of Block Ciphers 25 / 47

Page 58: Making (near) Optimal Choices for the Design of Block Ciphers

Making (near) Optimal Choices for the Design of Block CiphersVariants of the AES Key-Schedule for Better TruncatedDifferential Bounds

1 Introduction

2 Efficient Search for Optimal Diffusion Layers of GFNs

3 Variants of the AES Key-Schedule for Better Truncated Differential Bounds

4 Perspectives

Baptiste Lambin Making (near) Optimal Choices for the Design of Block Ciphers 26 / 47

Page 59: Making (near) Optimal Choices for the Design of Block Ciphers

Making (near) Optimal Choices for the Design of Block CiphersVariants of the AES Key-Schedule for Better TruncatedDifferential Bounds

Security model

Attacker

Ekey

p E (key , p)

Standard model

Can only ask the encryption ofsome plaintexts p.

Attacker

Ekey

f , p E (f (key), p)

Related-key model

Can ask the encryption of someplaintexts p with a modified key.

Baptiste Lambin Making (near) Optimal Choices for the Design of Block Ciphers 27 / 47

Page 60: Making (near) Optimal Choices for the Design of Block Ciphers

Making (near) Optimal Choices for the Design of Block CiphersVariants of the AES Key-Schedule for Better TruncatedDifferential Bounds

(Related-key) Differentials attacks

Given an n-bit block cipher E , can we find a tuple (∆in,∆out ,∆k) ∈ F3n2

such that for any message p,

E (k ⊕∆k , p ⊕∆in) = E (k , p)⊕∆out

holds independently from the value of the key with high probability ?

Baptiste Lambin Making (near) Optimal Choices for the Design of Block Ciphers 28 / 47

Page 61: Making (near) Optimal Choices for the Design of Block Ciphers

Making (near) Optimal Choices for the Design of Block CiphersVariants of the AES Key-Schedule for Better TruncatedDifferential Bounds

AES

SB

x0

L

y0 z0

k0

KS

SB

x1

L

y1 z1

k1

. . .

x2

128-bit block cipher, {128, 192, 256}-bit key

Round function :

- SubBytes (SB,non-linear)- L = MixColumns ◦ ShiftRows (linear)- AddRoundKey (⊕)

Round keys are derived from the master key using a key schedule KS(non-linear)

Baptiste Lambin Making (near) Optimal Choices for the Design of Block Ciphers 29 / 47

Page 62: Making (near) Optimal Choices for the Design of Block Ciphers

Making (near) Optimal Choices for the Design of Block CiphersVariants of the AES Key-Schedule for Better TruncatedDifferential Bounds

Truncated differential characteristic

SB

x0

L

y0 z0

k0

KS

SB

x1

L

y1 z1

k1

. . .

x2

Only consider whether a difference is zero or not (active byte).⇒ Easier to search than regular differentials⇒ Can still give some security results for differential attacks

May be impossible to instantiate with regular differentials⇒ We can consider some additional information to avoid this !

(Induced equations !)

Baptiste Lambin Making (near) Optimal Choices for the Design of Block Ciphers 30 / 47

Page 63: Making (near) Optimal Choices for the Design of Block Ciphers

Making (near) Optimal Choices for the Design of Block CiphersVariants of the AES Key-Schedule for Better TruncatedDifferential Bounds

Truncated differential characteristic

SB

x0

L

y0 z0

k0

KS

SB

x1

L

y1 z1

k1

. . .

x2

Only consider whether a difference is zero or not (active byte).⇒ Easier to search than regular differentials⇒ Can still give some security results for differential attacks

May be impossible to instantiate with regular differentials⇒ We can consider some additional information to avoid this !

(Induced equations !)

Baptiste Lambin Making (near) Optimal Choices for the Design of Block Ciphers 30 / 47

Page 64: Making (near) Optimal Choices for the Design of Block Ciphers

Making (near) Optimal Choices for the Design of Block CiphersVariants of the AES Key-Schedule for Better TruncatedDifferential Bounds

Equations induced by MixColumns (MDS property)

MC

y0

y1

y2

y3

z0

z1

z2

z3

k0

k1

k2

k3

Let z = MC(y) with y , z ∈(F8

2

)4. Then there is a linear equation between

any 5 bytes in y and z .

5.y0 ⊕ 7.y1 ⊕ y3 = 2.z0 ⊕ z2

But y0, y1 and y3 are zero differences, and (z0, z2) is cancelled by (k0, k2).Hence 2.k0 ⊕ k2 = 0.

Baptiste Lambin Making (near) Optimal Choices for the Design of Block Ciphers 31 / 47

Page 65: Making (near) Optimal Choices for the Design of Block Ciphers

Making (near) Optimal Choices for the Design of Block CiphersVariants of the AES Key-Schedule for Better TruncatedDifferential Bounds

Active S-Boxes

SB

x0

L

y0 z0

k0

KS

SB

x1

L

y1 z1

k1

. . .

x2

Number of active S-boxes ⇒ maximal probability of the (truncated)differential characteristic.

The higher the minimal number of active S-boxes is, the better.

How to choose the key schedule to maximize the minimal number ofactive S-Boxes ?

⇒ What if we use a byte-permutation instead of the original KS ?

Baptiste Lambin Making (near) Optimal Choices for the Design of Block Ciphers 32 / 47

Page 66: Making (near) Optimal Choices for the Design of Block Ciphers

Making (near) Optimal Choices for the Design of Block CiphersVariants of the AES Key-Schedule for Better TruncatedDifferential Bounds

Active S-Boxes

SB

x0

L

y0 z0

k0

KS

SB

x1

L

y1 z1

k1

. . .

x2

Number of active S-boxes ⇒ maximal probability of the (truncated)differential characteristic.

The higher the minimal number of active S-boxes is, the better.

How to choose the key schedule to maximize the minimal number ofactive S-Boxes ?

⇒ What if we use a byte-permutation instead of the original KS ?

Baptiste Lambin Making (near) Optimal Choices for the Design of Block Ciphers 32 / 47

Page 67: Making (near) Optimal Choices for the Design of Block Ciphers

Making (near) Optimal Choices for the Design of Block CiphersVariants of the AES Key-Schedule for Better TruncatedDifferential Bounds

Active S-Boxes

SB

x0

L

y0 z0

k0

KS

SB

x1

L

y1 z1

k1

. . .

x2

Number of active S-boxes ⇒ maximal probability of the (truncated)differential characteristic.

The higher the minimal number of active S-boxes is, the better.

How to choose the key schedule to maximize the minimal number ofactive S-Boxes ?

⇒ What if we use a byte-permutation instead of the original KS ?

Baptiste Lambin Making (near) Optimal Choices for the Design of Block Ciphers 32 / 47

Page 68: Making (near) Optimal Choices for the Design of Block Ciphers

Making (near) Optimal Choices for the Design of Block CiphersVariants of the AES Key-Schedule for Better TruncatedDifferential Bounds

Active S-Boxes

SB

x0

L

y0 z0

k0

KS

SB

x1

L

y1 z1

k1

. . .

x2

Number of active S-boxes ⇒ maximal probability of the (truncated)differential characteristic.

The higher the minimal number of active S-boxes is, the better.

How to choose the key schedule to maximize the minimal number ofactive S-Boxes ?

⇒ What if we use a byte-permutation instead of the original KS ?

Baptiste Lambin Making (near) Optimal Choices for the Design of Block Ciphers 32 / 47

Page 69: Making (near) Optimal Choices for the Design of Block Ciphers

Making (near) Optimal Choices for the Design of Block CiphersVariants of the AES Key-Schedule for Better TruncatedDifferential Bounds

Changing the key schedule for a permutation

Using a permutation as key schedule :

Efficient in both hardware and software

Easier to analyze

Better security with simpler design ?

Khoo et al.1 gave an example of a permutation for AES-128 reaching22 S-boxes in 7 rounds at FSE’18

1Khoo, K., Lee, E., Peyrin, T., Sim, S.M.: Human-readable Proof of the Related-KeySecurity of AES-128, FSE’18

Baptiste Lambin Making (near) Optimal Choices for the Design of Block Ciphers 33 / 47

Page 70: Making (near) Optimal Choices for the Design of Block Ciphers

Making (near) Optimal Choices for the Design of Block CiphersVariants of the AES Key-Schedule for Better TruncatedDifferential Bounds

About Khoo et al. ’s permutation

Built according to some results in their paper and two criteria :

Only having one cycle (of length 16)Minimizing the ”overlap” between the Key Schedule and the roundfunction

Reach 14, 18 and 21 active S-boxes over respectively 5, 6 and 7rounds

But actually...

Reach 22 S-boxes over 7 rounds when considering equations

Easy to generate randomly (∼ 100 trials)

Goal : Find a permutation to use instead of the key schedule reaching 22S-Boxes in 6 rounds (or less ?)

Baptiste Lambin Making (near) Optimal Choices for the Design of Block Ciphers 34 / 47

Page 71: Making (near) Optimal Choices for the Design of Block Ciphers

Making (near) Optimal Choices for the Design of Block CiphersVariants of the AES Key-Schedule for Better TruncatedDifferential Bounds

About Khoo et al. ’s permutation

Built according to some results in their paper and two criteria :

Only having one cycle (of length 16)Minimizing the ”overlap” between the Key Schedule and the roundfunction

Reach 14, 18 and 21 active S-boxes over respectively 5, 6 and 7rounds

But actually...

Reach 22 S-boxes over 7 rounds when considering equations

Easy to generate randomly (∼ 100 trials)

Goal : Find a permutation to use instead of the key schedule reaching 22S-Boxes in 6 rounds (or less ?)

Baptiste Lambin Making (near) Optimal Choices for the Design of Block Ciphers 34 / 47

Page 72: Making (near) Optimal Choices for the Design of Block Ciphers

Making (near) Optimal Choices for the Design of Block CiphersVariants of the AES Key-Schedule for Better TruncatedDifferential Bounds

About Khoo et al. ’s permutation

Built according to some results in their paper and two criteria :

Only having one cycle (of length 16)Minimizing the ”overlap” between the Key Schedule and the roundfunction

Reach 14, 18 and 21 active S-boxes over respectively 5, 6 and 7rounds

But actually...

Reach 22 S-boxes over 7 rounds when considering equations

Easy to generate randomly (∼ 100 trials)

Goal : Find a permutation to use instead of the key schedule reaching 22S-Boxes in 6 rounds (or less ?)

Baptiste Lambin Making (near) Optimal Choices for the Design of Block Ciphers 34 / 47

Page 73: Making (near) Optimal Choices for the Design of Block Ciphers

Making (near) Optimal Choices for the Design of Block CiphersVariants of the AES Key-Schedule for Better TruncatedDifferential Bounds

About Khoo et al. ’s permutation

Built according to some results in their paper and two criteria :

Only having one cycle (of length 16)Minimizing the ”overlap” between the Key Schedule and the roundfunction

Reach 14, 18 and 21 active S-boxes over respectively 5, 6 and 7rounds

But actually...

Reach 22 S-boxes over 7 rounds when considering equations

Easy to generate randomly (∼ 100 trials)

Goal : Find a permutation to use instead of the key schedule reaching 22S-Boxes in 6 rounds (or less ?)

Baptiste Lambin Making (near) Optimal Choices for the Design of Block Ciphers 34 / 47

Page 74: Making (near) Optimal Choices for the Design of Block Ciphers

Making (near) Optimal Choices for the Design of Block CiphersVariants of the AES Key-Schedule for Better TruncatedDifferential Bounds

Generic Bounds on 2, 3 and 4 rounds

Formally proven [Our paper]

The optimal bounds for 2, 3 and 4 rounds are respectively 1, 5 and 10active S-boxes, even when considering induced equations

SB SR

MC

x0 y0

P

SB SR

MC

x1 y1

1 P

1 SB SR

MC

x2

4

y2

1

345

x3

2 rounds

3 rounds

Baptiste Lambin Making (near) Optimal Choices for the Design of Block Ciphers 35 / 47

Page 75: Making (near) Optimal Choices for the Design of Block Ciphers

Making (near) Optimal Choices for the Design of Block CiphersVariants of the AES Key-Schedule for Better TruncatedDifferential Bounds

Generic Bounds on 5, 6 and 7 rounds

Formally proven [Our paper]

The optimal bounds for 5, 6 and 7 rounds are respectively 14, 18 and 21active S-boxes, without considering equations

5 rounds

6 rounds

Baptiste Lambin Making (near) Optimal Choices for the Design of Block Ciphers 36 / 47

Page 76: Making (near) Optimal Choices for the Design of Block Ciphers

Making (near) Optimal Choices for the Design of Block CiphersVariants of the AES Key-Schedule for Better TruncatedDifferential Bounds

More precise bound over 5 rounds

Computer aided [Our paper]

There is no permutation that, when used as key schedule, can reach aminimal number of active S-boxes of 18 or higher over 5 rounds.There is at least one permutation that can reach 16 S-boxes over 5 rounds.

Main idea to search for s S-boxes:

Build a list of cycles which don’t lead to any characteristicof weight < s.

Combine all of them to see if we can find a permutationreaching s S-boxes.

Baptiste Lambin Making (near) Optimal Choices for the Design of Block Ciphers 37 / 47

Page 77: Making (near) Optimal Choices for the Design of Block Ciphers

Making (near) Optimal Choices for the Design of Block CiphersVariants of the AES Key-Schedule for Better TruncatedDifferential Bounds

Iteratively building cycles

(x0 x1 x2 ? ? . . . )

(x0 x1 x2)

Keep ifno characteristic

of weight < s

Closed cycle

(x0 x1 x2 x3 ? ? . . . )

Guess x3

∃ characteristicof weight < s

No new characteristicof weight < s

(x0 x1 x2 x3)

Keep ifno characteristic

of weight < s

Closed cycle

(x0 x1 x2 x3 x4 ? . . . )

Guess x4

Baptiste Lambin Making (near) Optimal Choices for the Design of Block Ciphers 38 / 47

Page 78: Making (near) Optimal Choices for the Design of Block Ciphers

Making (near) Optimal Choices for the Design of Block CiphersVariants of the AES Key-Schedule for Better TruncatedDifferential Bounds

Iteratively building cycles

(x0 x1 x2 ? ? . . . )

(x0 x1 x2)

Keep ifno characteristic

of weight < s

Closed cycle

(x0 x1 x2 x3 ? ? . . . )

Guess x3

∃ characteristicof weight < s

No new characteristicof weight < s

(x0 x1 x2 x3)

Keep ifno characteristic

of weight < s

Closed cycle

(x0 x1 x2 x3 x4 ? . . . )

Guess x4

Baptiste Lambin Making (near) Optimal Choices for the Design of Block Ciphers 38 / 47

Page 79: Making (near) Optimal Choices for the Design of Block Ciphers

Making (near) Optimal Choices for the Design of Block CiphersVariants of the AES Key-Schedule for Better TruncatedDifferential Bounds

Iteratively building cycles

(x0 x1 x2 ? ? . . . )

(x0 x1 x2)

Keep ifno characteristic

of weight < s

Closed cycle

(x0 x1 x2 x3 ? ? . . . )

Guess x3

∃ characteristicof weight < s

No new characteristicof weight < s

(x0 x1 x2 x3)

Keep ifno characteristic

of weight < s

Closed cycle

(x0 x1 x2 x3 x4 ? . . . )

Guess x4

Baptiste Lambin Making (near) Optimal Choices for the Design of Block Ciphers 38 / 47

Page 80: Making (near) Optimal Choices for the Design of Block Ciphers

Making (near) Optimal Choices for the Design of Block CiphersVariants of the AES Key-Schedule for Better TruncatedDifferential Bounds

Iteratively building cycles

(x0 x1 x2 ? ? . . . )

(x0 x1 x2)

Keep ifno characteristic

of weight < s

Closed cycle

(x0 x1 x2 x3 ? ? . . . )

Guess x3

∃ characteristicof weight < s

No new characteristicof weight < s

(x0 x1 x2 x3)

Keep ifno characteristic

of weight < s

Closed cycle

(x0 x1 x2 x3 x4 ? . . . )

Guess x4

Baptiste Lambin Making (near) Optimal Choices for the Design of Block Ciphers 38 / 47

Page 81: Making (near) Optimal Choices for the Design of Block Ciphers

Making (near) Optimal Choices for the Design of Block CiphersVariants of the AES Key-Schedule for Better TruncatedDifferential Bounds

Iteratively building cycles

(x0 x1 x2 ? ? . . . )

(x0 x1 x2)

Keep ifno characteristic

of weight < s

Closed cycle

(x0 x1 x2 x3 ? ? . . . )

Guess x3

∃ characteristicof weight < s

No new characteristicof weight < s

(x0 x1 x2 x3)

Keep ifno characteristic

of weight < s

Closed cycle

(x0 x1 x2 x3 x4 ? . . . )

Guess x4

Baptiste Lambin Making (near) Optimal Choices for the Design of Block Ciphers 38 / 47

Page 82: Making (near) Optimal Choices for the Design of Block Ciphers

Making (near) Optimal Choices for the Design of Block CiphersVariants of the AES Key-Schedule for Better TruncatedDifferential Bounds

Iteratively building cycles

(x0 x1 x2 ? ? . . . )

(x0 x1 x2)

Keep ifno characteristic

of weight < s

Closed cycle

(x0 x1 x2 x3 ? ? . . . )

Guess x3

∃ characteristicof weight < s

No new characteristicof weight < s

(x0 x1 x2 x3)

Keep ifno characteristic

of weight < s

Closed cycle

(x0 x1 x2 x3 x4 ? . . . )

Guess x4

Baptiste Lambin Making (near) Optimal Choices for the Design of Block Ciphers 38 / 47

Page 83: Making (near) Optimal Choices for the Design of Block Ciphers

Making (near) Optimal Choices for the Design of Block CiphersVariants of the AES Key-Schedule for Better TruncatedDifferential Bounds

Over 6 rounds

More than 244 possible permutations + cost of finding the minimalnumber of active S-boxes⇒ Too expensive to try them all !

We have an optimization problem :

Maximize the minimal number of active S-boxes over 6 rounds

Get a high enough minimal number of active S-boxes over 6 rounds

Metaheuristic Constraint Programming+

Baptiste Lambin Making (near) Optimal Choices for the Design of Block Ciphers 39 / 47

Page 84: Making (near) Optimal Choices for the Design of Block Ciphers

Making (near) Optimal Choices for the Design of Block CiphersVariants of the AES Key-Schedule for Better TruncatedDifferential Bounds

Over 6 rounds

More than 244 possible permutations + cost of finding the minimalnumber of active S-boxes⇒ Too expensive to try them all !

We have an optimization problem :

Get a high enough minimal number of active S-boxes over 6 rounds

Metaheuristic Constraint Programming+

Baptiste Lambin Making (near) Optimal Choices for the Design of Block Ciphers 39 / 47

Page 85: Making (near) Optimal Choices for the Design of Block Ciphers

Making (near) Optimal Choices for the Design of Block CiphersVariants of the AES Key-Schedule for Better TruncatedDifferential Bounds

Over 6 rounds

More than 244 possible permutations + cost of finding the minimalnumber of active S-boxes⇒ Too expensive to try them all !

We have an optimization problem :

Get a high enough minimal number of active S-boxes over 6 rounds

Metaheuristic Constraint Programming+

Baptiste Lambin Making (near) Optimal Choices for the Design of Block Ciphers 39 / 47

Page 86: Making (near) Optimal Choices for the Design of Block Ciphers

Making (near) Optimal Choices for the Design of Block CiphersVariants of the AES Key-Schedule for Better TruncatedDifferential Bounds

We used a meta-heuristic called simulated annealing2. Main idea :

Generate a sequence x0, x1, . . . where xi and xi+1 are ”close”

If f (xi ) > f (xi−1), accept xi and search for the next one

Otherwise only accept xi with a certain (decreasing) probability

Choose another xi if it was rejected

Stop when f (xi ) reach a certain threshold

2Nikolic, How to use metaheuristics for design of symmetric-key primitives -ASIACRYPT’17

Baptiste Lambin Making (near) Optimal Choices for the Design of Block Ciphers 40 / 47

Page 87: Making (near) Optimal Choices for the Design of Block Ciphers

Making (near) Optimal Choices for the Design of Block CiphersVariants of the AES Key-Schedule for Better TruncatedDifferential Bounds

Constraint Programming

Sudoku’s rules :

All values in a row are different

All values in a column are different

All values in a square are different

You have knowledge of a few values to start with

Claimed to be the ”World’s Hardest Sudoku”

Baptiste Lambin Making (near) Optimal Choices for the Design of Block Ciphers 41 / 47

Page 88: Making (near) Optimal Choices for the Design of Block Ciphers

Making (near) Optimal Choices for the Design of Block CiphersVariants of the AES Key-Schedule for Better TruncatedDifferential Bounds

Constraint Programming

allDifferent(x[i][0],...,x[i][8]) for i in {0,...,8}allDifferent(x[0][i],...,x[8][i]) for i in {0,...,8}allDifferent(s[i][0],...,s[i][8]) for i in {0,...,8}Initial values : x[0][0] = 8, x[1][2] = 3, etc.

Constraint Solver

Solution

(Previous sudoku solved in less than 0.1 seconds)

Baptiste Lambin Making (near) Optimal Choices for the Design of Block Ciphers 42 / 47

Page 89: Making (near) Optimal Choices for the Design of Block Ciphers

Making (near) Optimal Choices for the Design of Block CiphersVariants of the AES Key-Schedule for Better TruncatedDifferential Bounds

Efficient evaluation of f

Efficiency of the meta-heuristic= Efficiency of evaluating the minimal number of active S-boxes !

Candidate permutation Ps = Target number of S-boxes

Quick searcha = weight of a valid characteristic

Return aP cannot reach

our target

a < s

Full search withConstraint Programming model

We manage equations here!

a ≥ s

Return the true minimal weight

Baptiste Lambin Making (near) Optimal Choices for the Design of Block Ciphers 43 / 47

Page 90: Making (near) Optimal Choices for the Design of Block Ciphers

Making (near) Optimal Choices for the Design of Block CiphersVariants of the AES Key-Schedule for Better TruncatedDifferential Bounds

Summary of the search over 6 rounds

We used a meta-heuristic for an efficient search.

We proposed a new CP model which directly manages inducedequations.

We found a permutation reaching 20 active S-boxes over 6 rounds,and no characteristic with a probability better than 2−128 exists !

Baptiste Lambin Making (near) Optimal Choices for the Design of Block Ciphers 44 / 47

Page 91: Making (near) Optimal Choices for the Design of Block Ciphers

Making (near) Optimal Choices for the Design of Block CiphersVariants of the AES Key-Schedule for Better TruncatedDifferential Bounds

Conclusion

Number of rounds 2 3 4 5 6 7

Original key schedule 1 3 9 11 13† 15†

Khoo et al.’s permutation 1 5 10 14 18† 22†

Our permutation 1 5 10 15 20† 23†

We cannot reach 18 S-boxes over 5 rounds, and 17 is still an openquestion.

Modifying the ShiftRows operation, we can reach 21† S-boxes over 6rounds.

22 S-boxes is an open question

† no characteristic with probability > 2−128

Baptiste Lambin Making (near) Optimal Choices for the Design of Block Ciphers 45 / 47

Page 92: Making (near) Optimal Choices for the Design of Block Ciphers

Making (near) Optimal Choices for the Design of Block Ciphers Perspectives

1 Introduction

2 Efficient Search for Optimal Diffusion Layers of GFNs

3 Variants of the AES Key-Schedule for Better Truncated Differential Bounds

4 Perspectives

Baptiste Lambin Making (near) Optimal Choices for the Design of Block Ciphers 46 / 47

Page 93: Making (near) Optimal Choices for the Design of Block Ciphers

Making (near) Optimal Choices for the Design of Block Ciphers Perspectives

Long term goal : The ”Ultimate” GFN⇒ Probably not unique, need to consider trade-offs (harder thanfocusing on optimality)⇒ Would lead to a nice generic tool for evaluating the security of anyGFN (to some extend)

”Provable” key-schedules ⇒ Adding concrete and well definedsecurity arguments for the key-schedule⇒ In the end, I would like to show that using a very simplekey-schedule is enough, i.e. convoluted key-schedules are not betterthan a carefully crafted simple one

Automatic tools for cryptanalysis⇒ Improving the current ones⇒ New tools for new attacks

Baptiste Lambin Making (near) Optimal Choices for the Design of Block Ciphers 47 / 47