A new criterion for avoiding the propagation of linear relations - - PowerPoint PPT Presentation

a new criterion for avoiding the propagation of linear
SMART_READER_LITE
LIVE PREVIEW

A new criterion for avoiding the propagation of linear relations - - PowerPoint PPT Presentation

A new criterion for avoiding the propagation of linear relations through an Sbox Christina Boura and Anne Canteaut INRIA Paris-Rocquencourt DTU Compute March 13, 2013 1 / 23 Outline Introduction 1 The notion of ( v, w ) -linearity 2


slide-1
SLIDE 1

A new criterion for avoiding the propagation

  • f linear relations through an Sbox

Christina Boura and Anne Canteaut

INRIA Paris-Rocquencourt DTU Compute

March 13, 2013

1 / 23

slide-2
SLIDE 2

Outline

1

Introduction

2

The notion of (v, w)-linearity

3

Analysis of 4-bit optimal Sboxes

4

Application to Hamsi

5

Conclusion

2 / 23

slide-3
SLIDE 3

Introduction

Outline

1

Introduction

2

The notion of (v, w)-linearity

3

Analysis of 4-bit optimal Sboxes

4

Application to Hamsi

5

Conclusion

3 / 23

slide-4
SLIDE 4

Introduction

Introduction

Investigate SPN primitives using small Sboxes. Ideally, after several rounds, all output bits should be expessed as non-linear functions of all input bits.

4 / 23

slide-5
SLIDE 5

Introduction

Introduction

Investigate SPN primitives using small Sboxes. Ideally, after several rounds, all output bits should be expessed as non-linear functions of all input bits. This is not always so.

4 / 23

slide-6
SLIDE 6

Introduction

The need for a new linearity measure

Some output bits can be expressed as affine functions of some input bits (when the other input bits are fixed to a constant). The sizes of the input and output sets are important. Large sets can lead to a big number of affine relations between input and output bits. Possibly lead to cryptanalysis (Attack against Hamsi 2010, cube-like attacks). We show that the number of affine relations depends on a new linearity measure of the Sbox, that we call (v, w)-linearity.

5 / 23

slide-7
SLIDE 7

Introduction

An example

ANF of the Hamsi Sbox y0 = x0x2 + x1 + x2 + x3 y1 = x0x1x2 + x0x1x3 + x0x2x3 + x1x2 + x0x3 + x2x3 + x0 + x1 + x2 y2 = x0x1x3 + x0x2x3 + x1x2 + x1x3 + x2x3 + x0 + x1 + x3 y3 = x0x1x2 + x1x3 + x0 + x1 + x2 + 1.

6 / 23

slide-8
SLIDE 8

Introduction

An example

ANF of the Hamsi Sbox y0 = x0x2 + x1 + x2 + x3 y1 = x0x1x2 + x0x1x3 + x0x2x3 + x1x2 + x0x3 + x2x3 + x0 + x1 + x2 y2 = x0x1x3 + x0x2x3 + x1x2 + x1x3 + x2x3 + x0 + x1 + x3 y3 = x0x1x2 + x1x3 + x0 + x1 + x2 + 1. If we fix all-but-one variables to a constant value then all the coordinates of the Sbox are affine with respect to the input variable.

6 / 23

slide-9
SLIDE 9

Introduction

An example

ANF of the Hamsi Sbox y0 = x0x2 + x1 + x2 + x3 y1 = x0x1x2 + x0x1x3 + x0x2x3 + x1x2 + x0x3 + x2x3 + x0 + x1 + x2 y2 = x0x1x3 + x0x2x3 + x1x2 + x1x3 + x2x3 + x0 + x1 + x3 y3 = x0x1x2 + x1x3 + x0 + x1 + x2 + 1. If we fix two variables to a constant value then two coordinates

  • f the Sbox are affine with respect to the input variables.

6 / 23

slide-10
SLIDE 10

Introduction

An example

ANF of the Hamsi Sbox y0 = x0x2 + x1 + x2 + x3 y1 = x0x1x2 + x0x1x3 + x0x2x3 + x1x2 + x0x3 + x2x3 + x0 + x1 + x2 y2 = x0x1x3 + x0x2x3 + x1x2 + x1x3 + x2x3 + x0 + x1 + x3 y3 = x0x1x2 + x1x3 + x0 + x1 + x2 + 1. If we fix one variable to a constant value then one coordinate

  • f the Sbox is affine with respect to the input variables.

6 / 23

slide-11
SLIDE 11

The notion of (v, w)-linearity

Outline

1

Introduction

2

The notion of (v, w)-linearity

3

Analysis of 4-bit optimal Sboxes

4

Application to Hamsi

5

Conclusion

7 / 23

slide-12
SLIDE 12

The notion of (v, w)-linearity

Definition of (v, w)-linearity

  • Definition. Let S be a function from Fn

2 into Fm 2 . Then,

S is (v, w)-linear if there exist two linear subspaces V ⊂ Fn

2 and W ⊂ Fm 2

with dim V = v and dim W = w such that, for all λ ∈ W, Sλ : x → λ · S(x) has degree at most 1 on all cosets of V .

8 / 23

slide-13
SLIDE 13

The notion of (v, w)-linearity

Example

y0 = x0x2 + x1 + x2 + x3 y1 = x0x1x2 + x0x1x3 + x0x2x3 + x1x2 + x0x3 + x2x3 + x0 + x1 + x2 y2 = x0x1x3 + x0x2x3 + x1x2 + x1x3 + x2x3 + x0 + x1 + x3 y3 = x0x1x2 + x1x3 + x0 + x1 + x2 + 1. S is (2, 2)-linear for V = 1, 8 and W = 1, 8.

9 / 23

slide-14
SLIDE 14

The notion of (v, w)-linearity

Example

y0 = x0x2 + x1 + x2 + x3 y1 = x0x1x2 + x0x1x3 + x0x2x3 + x1x2 + x0x3 + x2x3 + x0 + x1 + x2 y2 = x0x1x3 + x0x2x3 + x1x2 + x1x3 + x2x3 + x0 + x1 + x3 y3 = x0x1x2 + x1x3 + x0 + x1 + x2 + 1. S is (3, 1)-linear for V = 1, 2, 8 and W = 1.

9 / 23

slide-15
SLIDE 15

The notion of (v, w)-linearity

Link with the Maiorana-McFarland Construction

An Example: Let f : F4

2 → F2 with

f(x1, x2, x3, x4) = x1x3x4 + x1x4 + x2x3 + x3x4 + x2 + x4. Let V = 1, 2. Then f is (2, 1)-linear w.r.t. V .

10 / 23

slide-16
SLIDE 16

The notion of (v, w)-linearity

Link with the Maiorana-McFarland Construction

An Example: Let f : F4

2 → F2 with

f(x1, x2, x3, x4) = x1x3x4 + x1x4 + x2x3 + x3x4 + x2 + x4. Let V = 1, 2. Then f is (2, 1)-linear w.r.t. V .

10 / 23

slide-17
SLIDE 17

The notion of (v, w)-linearity

Link with the Maiorana-McFarland Construction

An Example: Let f : F4

2 → F2 with

f(x1, x2, x3, x4) = x1x3x4 + x1x4 + x2x3 + x3x4 + x2 + x4. Let V = 1, 2. Then f is (2, 1)-linear w.r.t. V . f(x1, x2, x3, x4) = x1x3x4 + x1x4 + x2x3 + x3x4 + x2 + x4 = (x3x4 + x4)x1 + (x3 + 1)x2 + x3x4 + x4 = (x3x4 + x4, x3 + 1) · (x1, x2) + x3x4 + x4

10 / 23

slide-18
SLIDE 18

The notion of (v, w)-linearity

Link with the Maiorana-McFarland Construction

An Example: Let f : F4

2 → F2 with

f(x1, x2, x3, x4) = x1x3x4 + x1x4 + x2x3 + x3x4 + x2 + x4. Let V = 1, 2. Then f is (2, 1)-linear w.r.t. V . f(x1, x2, x3, x4) = x1x3x4 + x1x4 + x2x3 + x3x4 + x2 + x4 = (x3x4 + x4)x1 + (x3 + 1)x2 + x3x4 + x4 = (x3x4 + x4, x3 + 1) · (x1, x2) + x3x4 + x4 In general, any f : Fn

2 → F2 that is (v, 1)-linear w.r.t. V can be written as

f(x, y) = π(x)·y+h(x), with (x, y) ∈ U×V.

10 / 23

slide-19
SLIDE 19

The notion of (v, w)-linearity

Link with the Maiorana-McFarland Construction

An Example: Let f : F4

2 → F2 with

f(x1, x2, x3, x4) = x1x3x4 + x1x4 + x2x3 + x3x4 + x2 + x4. Let V = 1, 2. Then f is (2, 1)-linear w.r.t. V . f(x1, x2, x3, x4) = x1x3x4 + x1x4 + x2x3 + x3x4 + x2 + x4 = (x3x4 + x4)x1 + (x3 + 1)x2 + x3x4 + x4 = (x3x4 + x4, x3 + 1) · (x1, x2) + x3x4 + x4 In general, any f : Fn

2 → F2 that is (v, 1)-linear w.r.t. V can be written as

f(x, y) = π(x)·y+h(x), with (x, y) ∈ U×V. Generalisation of the Maiorana-McFarland construction for bent functions.

10 / 23

slide-20
SLIDE 20

The notion of (v, w)-linearity

Link with the Maiorana-McFarland Construction

  • Proposition. S is (v, w)-linear w.r.t. (V, W) if and only if its

components Sλ, λ ∈ W, can be written as SW : U ⊕ V → Fw

2

(u, v) → M(u)v + G(u) where M(u) is a w × v binary matrix. Equivalently, all second-order derivatives DαDβSW , with α, β ∈ V , vanish.

11 / 23

slide-21
SLIDE 21

The notion of (v, w)-linearity

General Properties

  • Proposition. If S is (v, w)-linear w.r.t. (V, W), then all its compo-

nents Sλ, λ ∈ W have degree at most n + 1 − v and L(S) ≥ 2v. Equivalence holds for v = n − 1 and w = 1.

12 / 23

slide-22
SLIDE 22

Analysis of 4-bit optimal Sboxes

Outline

1

Introduction

2

The notion of (v, w)-linearity

3

Analysis of 4-bit optimal Sboxes

4

Application to Hamsi

5

Conclusion

13 / 23

slide-23
SLIDE 23

Analysis of 4-bit optimal Sboxes

4-bit optimal Sboxes

Many symmetric primitives are based on 4-bit balanced Sboxes. Optimal Sbox: Sbox with optimal resistance against differential and linear cryptanalysis [Leander-Poschmann07]: 16 classes of optimal 4-bit balanced Sboxes upon affine equivalence.

14 / 23

slide-24
SLIDE 24

Analysis of 4-bit optimal Sboxes

4-bit optimal Sboxes

Many symmetric primitives are based on 4-bit balanced Sboxes. Optimal Sbox: Sbox with optimal resistance against differential and linear cryptanalysis [Leander-Poschmann07]: 16 classes of optimal 4-bit balanced Sboxes upon affine equivalence. Study these 16 classes under the spectrum of (v, w)-linearity. # (V, W) such that an Sbox is (v, w)-linear w.r.t. (V, W) → invariant under affine equivalence.

14 / 23

slide-25
SLIDE 25

Analysis of 4-bit optimal Sboxes

Analysis of 4-bit optimal Sboxes

Number of V such that S is (v, w)-linear w.r.t. (V, W) for some W.

(v, w) Q (2,1) (2,2) (2,3) (2,4) (3,1) (3,2) (3,3) (3,4) G0 3 35 19 5 7 1 G1 3 35 23 3 7 1 G2 3 35 23 3 7 1 G3 35 5 G4 35 5 G5 35 5 G6 35 5 G7 35 5 G8 3 35 19 5 7 1 G9 1 35 13 3 G10 1 35 13 3 G11 35 5 G12 35 5 G13 35 5 G14 1 35 13 3 G15 1 35 11 1 3 15 / 23

slide-26
SLIDE 26

Application to Hamsi

Outline

1

Introduction

2

The notion of (v, w)-linearity

3

Analysis of 4-bit optimal Sboxes

4

Application to Hamsi

5

Conclusion

16 / 23

slide-27
SLIDE 27

Application to Hamsi

Hamsi Hash Function

Designed by ¨ Ozg¨ ul K¨ u¸ c¨ uk in 2008 for the SHA-3 competition. Compression function of Hamsi-256

message block chain value message block 256-bit 256-bit chain value

Concatenation

32-bit

Permutation P

Permutation P: 3 SPN rounds based on a 4-bit Sbox.

17 / 23

slide-28
SLIDE 28

Application to Hamsi

Second-preimage attack for Hamsi-256

Presented by Thomas Fuhr in Asiacrypt 2010. Idea of the attack: Find affine relations between some input bits and some output bits of the compression function when the other input bits are fixed to a well chosen value. → Preimages for the compression function. → Second-preimages for the hash function.

18 / 23

slide-29
SLIDE 29

Application to Hamsi

Finding affine relations

Choose the variables to go linearly through the first round. For the second and the third round: y0 = x0x2 + x1 + x2 + x3 y1 = x0x1x2 + x0x1x3 + x0x2x3 + x1x2 + x0x3 + x2x3 + x0 + x1 + x2 y2 = x0x1x3 + x0x2x3 + x1x2 + x1x3 + x2x3 + x0 + x1 + x3 y3 = x0x1x2 + x1x3 + x0 + x1 + x2 + 1. y0 is of degree at most 1 if x0x2 is of degree at most 1. y3 is of degree at most 1 if x1x3 and x0x1x2 are of degree at most 1.

19 / 23

slide-30
SLIDE 30

Application to Hamsi

Finding affine relations

Choose the variables to go linearly through the first round. For the second and the third round: y0 = x0x2 + x1 + x2 + x3 y1 = x0x1x2 + x0x1x3 + x0x2x3 + x1x2 + x0x3 + x2x3 + x0 + x1 + x2 y2 = x0x1x3 + x0x2x3 + x1x2 + x1x3 + x2x3 + x0 + x1 + x3 y3 = x0x1x2 + x1x3 + x0 + x1 + x2 + 1. y0 is of degree at most 1 if x0x2 is of degree at most 1. y3 is of degree at most 1 if x1x3 and x0x1x2 are of degree at most 1.

19 / 23

slide-31
SLIDE 31

Application to Hamsi

Finding affine relations

Choose the variables to go linearly through the first round. For the second and the third round: y0 = x0x2 + x1 + x2 + x3 y1 = x0x1x2 + x0x1x3 + x0x2x3 + x1x2 + x0x3 + x2x3 + x0 + x1 + x2 y2 = x0x1x3 + x0x2x3 + x1x2 + x1x3 + x2x3 + x0 + x1 + x3 y3 = x0x1x2 + x1x3 + x0 + x1 + x2 + 1. y0 is (3, 1)-linear for three hyperplanes. y3 is (2, 1)-linear for three 2-dimensional subspaces V .

19 / 23

slide-32
SLIDE 32

Application to Hamsi

Automatic search for affine relations

There are 23 subspaces V , with dim V = 2 for which the Sbox of Hamsi is (2, 2)-linear. There are 3 subspaces V , with dim V = 2 for which the Sbox of Hamsi is (2, 3)-linear. Exploit this to propagate more relations through the second and the third round. Results: Nvar = 9: 13 affine relations (two more than in [Fuhr ’10]) Nvar = 10: 11 affine relations (two more than in [Fuhr ’10])

20 / 23

slide-33
SLIDE 33

Application to Hamsi

What if replacing the Sbox?

Replace the Hamsi Sbox by some other 4-bit Sbox JH Sboxes Sboxes in the classes G3-G7, G11-G13. Keep the other parameters unchanged and repeat the attack.

21 / 23

slide-34
SLIDE 34

Application to Hamsi

What if replacing the Sbox?

Replace the Hamsi Sbox by some other 4-bit Sbox JH Sboxes Sboxes in the classes G3-G7, G11-G13. Keep the other parameters unchanged and repeat the attack. The attack does not work anymore!

21 / 23

slide-35
SLIDE 35

Conclusion

Outline

1

Introduction

2

The notion of (v, w)-linearity

3

Analysis of 4-bit optimal Sboxes

4

Application to Hamsi

5

Conclusion

22 / 23

slide-36
SLIDE 36

Conclusion

Conclusion and Open Questions

We have introduced a new cryptographic property for vectorial Boolean functions. Leads to a new measure of linearity for Sboxes. We have showed that the success of Fuhr’s attack against Hamsi depends on the choice of the Sbox. Open question: “Are such attacks related to other recently proposed attacks (e.g. invariant subspace attack)”?

23 / 23

slide-37
SLIDE 37

Conclusion

Conclusion and Open Questions

We have introduced a new cryptographic property for vectorial Boolean functions. Leads to a new measure of linearity for Sboxes. We have showed that the success of Fuhr’s attack against Hamsi depends on the choice of the Sbox. Open question: “Are such attacks related to other recently proposed attacks (e.g. invariant subspace attack)”?

Thanks for your attention!

23 / 23