on reverse-engineering s-boxes · biryukov, perrin, udovenko on reverse-engineering s-boxes 15 /...

64
On Reverse-Engineering S-Boxes Alex Biryukov 1 , Léo Perrin 1 , Aleksei Udovenko 1 1 SnT, University of Luxembourg https://www.cryptolux.org March 28, 2017 CryptoAction Symposium 2017

Upload: others

Post on 18-Jul-2020

7 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: On Reverse-Engineering S-Boxes · Biryukov, Perrin, Udovenko On Reverse-Engineering S-Boxes 15 / 28. Introduction Mathematical Background Detailed Analysis of the Two Tables TU-Decomposition

On Reverse-Engineering S-Boxes

Alex Biryukov1, Léo Perrin1, Aleksei Udovenko1

1SnT, University of Luxembourg

https://www.cryptolux.org

March 28, 2017CryptoAction Symposium 2017

Page 2: On Reverse-Engineering S-Boxes · Biryukov, Perrin, Udovenko On Reverse-Engineering S-Boxes 15 / 28. Introduction Mathematical Background Detailed Analysis of the Two Tables TU-Decomposition

Introduction

S-Box?

An S-Box is a small non-linear function mapping m bits to nusually specified via its look-up table.

Typically, m = n, n ∈ {4, 8}

Used by many block ciphers/hash functions/stream ciphers.

Necessary for the wide trail strategy.

Biryukov, Perrin, Udovenko On Reverse-Engineering S-Boxes 1 / 28

Page 3: On Reverse-Engineering S-Boxes · Biryukov, Perrin, Udovenko On Reverse-Engineering S-Boxes 15 / 28. Introduction Mathematical Background Detailed Analysis of the Two Tables TU-Decomposition

Introduction

S-Box?

An S-Box is a small non-linear function mapping m bits to nusually specified via its look-up table.

Typically, m = n, n ∈ {4, 8}

Used by many block ciphers/hash functions/stream ciphers.

Necessary for the wide trail strategy.

Biryukov, Perrin, Udovenko On Reverse-Engineering S-Boxes 1 / 28

Page 4: On Reverse-Engineering S-Boxes · Biryukov, Perrin, Udovenko On Reverse-Engineering S-Boxes 15 / 28. Introduction Mathematical Background Detailed Analysis of the Two Tables TU-Decomposition

Introduction

Example

Screen capture from [GOST, 2015].

Biryukov, Perrin, Udovenko On Reverse-Engineering S-Boxes 2 / 28

Page 5: On Reverse-Engineering S-Boxes · Biryukov, Perrin, Udovenko On Reverse-Engineering S-Boxes 15 / 28. Introduction Mathematical Background Detailed Analysis of the Two Tables TU-Decomposition

Introduction

S-Box Design

AES→←Whirlpool

← Scream

Biryukov, Perrin, Udovenko On Reverse-Engineering S-Boxes 3 / 28

Page 6: On Reverse-Engineering S-Boxes · Biryukov, Perrin, Udovenko On Reverse-Engineering S-Boxes 15 / 28. Introduction Mathematical Background Detailed Analysis of the Two Tables TU-Decomposition

Introduction

S-Box Design

AES→←Whirlpool

← Scream

Biryukov, Perrin, Udovenko On Reverse-Engineering S-Boxes 3 / 28

Page 7: On Reverse-Engineering S-Boxes · Biryukov, Perrin, Udovenko On Reverse-Engineering S-Boxes 15 / 28. Introduction Mathematical Background Detailed Analysis of the Two Tables TU-Decomposition

Introduction

S-Box Design

AES→←Whirlpool

← Scream

Biryukov, Perrin, Udovenko On Reverse-Engineering S-Boxes 3 / 28

Page 8: On Reverse-Engineering S-Boxes · Biryukov, Perrin, Udovenko On Reverse-Engineering S-Boxes 15 / 28. Introduction Mathematical Background Detailed Analysis of the Two Tables TU-Decomposition

Introduction

S-Box Reverse-Engineering

s

Biryukov, Perrin, Udovenko On Reverse-Engineering S-Boxes 4 / 28

Page 9: On Reverse-Engineering S-Boxes · Biryukov, Perrin, Udovenko On Reverse-Engineering S-Boxes 15 / 28. Introduction Mathematical Background Detailed Analysis of the Two Tables TU-Decomposition

Introduction

S-Box Reverse-Engineering

s?

?

?

Biryukov, Perrin, Udovenko On Reverse-Engineering S-Boxes 4 / 28

Page 10: On Reverse-Engineering S-Boxes · Biryukov, Perrin, Udovenko On Reverse-Engineering S-Boxes 15 / 28. Introduction Mathematical Background Detailed Analysis of the Two Tables TU-Decomposition

Talk Outline

Outline

1 Introduction

2 Mathematical Background

3 Detailed Analysis of the Two Tables

4 TU-Decomposition

5 Conclusion

Biryukov, Perrin, Udovenko On Reverse-Engineering S-Boxes 5 / 28

Page 11: On Reverse-Engineering S-Boxes · Biryukov, Perrin, Udovenko On Reverse-Engineering S-Boxes 15 / 28. Introduction Mathematical Background Detailed Analysis of the Two Tables TU-Decomposition

Introduction Mathematical Background Detailed Analysis of the Two Tables TU-Decomposition Conclusion

Plan

1 Introduction

2 Mathematical BackgroundThe Two TablesCoe�icients Distribution

3 Detailed Analysis of the Two Tables

4 TU-Decomposition

5 Conclusion

Biryukov, Perrin, Udovenko On Reverse-Engineering S-Boxes 5 / 28

Page 12: On Reverse-Engineering S-Boxes · Biryukov, Perrin, Udovenko On Reverse-Engineering S-Boxes 15 / 28. Introduction Mathematical Background Detailed Analysis of the Two Tables TU-Decomposition

Introduction Mathematical Background Detailed Analysis of the Two Tables TU-Decomposition Conclusion

The Two Tables

Let S : Fn2 → F

n2 be an S-Box.

Definition (DDT)

The Di�erence Distribution Table of f is a matrix of size 2n × 2n suchthat

DDT[a, b] = #{x ∈ Fn2 | S (x ⊕ a) ⊕ S (x ) = b}.

Definition (LAT)

The Linear Approximations Table of S is a matrix of size 2n × 2n suchthat

LAT[a, b] = #{x ∈ Fn2 | x · a = S (x ) · b} − 2n−1.

Biryukov, Perrin, Udovenko On Reverse-Engineering S-Boxes 6 / 28

Page 13: On Reverse-Engineering S-Boxes · Biryukov, Perrin, Udovenko On Reverse-Engineering S-Boxes 15 / 28. Introduction Mathematical Background Detailed Analysis of the Two Tables TU-Decomposition

Introduction Mathematical Background Detailed Analysis of the Two Tables TU-Decomposition Conclusion

The Two Tables

Let S : Fn2 → F

n2 be an S-Box.

Definition (DDT)

The Di�erence Distribution Table of f is a matrix of size 2n × 2n suchthat

DDT[a, b] = #{x ∈ Fn2 | S (x ⊕ a) ⊕ S (x ) = b}.

Definition (LAT)

The Linear Approximations Table of S is a matrix of size 2n × 2n suchthat

LAT[a, b] = #{x ∈ Fn2 | x · a = S (x ) · b} − 2n−1.

Biryukov, Perrin, Udovenko On Reverse-Engineering S-Boxes 6 / 28

Page 14: On Reverse-Engineering S-Boxes · Biryukov, Perrin, Udovenko On Reverse-Engineering S-Boxes 15 / 28. Introduction Mathematical Background Detailed Analysis of the Two Tables TU-Decomposition

Introduction Mathematical Background Detailed Analysis of the Two Tables TU-Decomposition Conclusion

The Two Tables

Let S : Fn2 → F

n2 be an S-Box.

Definition (DDT)

The Di�erence Distribution Table of f is a matrix of size 2n × 2n suchthat

DDT[a, b] = #{x ∈ Fn2 | S (x ⊕ a) ⊕ S (x ) = b}.

Definition (LAT)

The Linear Approximations Table of S is a matrix of size 2n × 2n suchthat

LAT[a, b] = #{x ∈ Fn2 | x · a = S (x ) · b} − 2n−1.

Biryukov, Perrin, Udovenko On Reverse-Engineering S-Boxes 6 / 28

Page 15: On Reverse-Engineering S-Boxes · Biryukov, Perrin, Udovenko On Reverse-Engineering S-Boxes 15 / 28. Introduction Mathematical Background Detailed Analysis of the Two Tables TU-Decomposition

Introduction Mathematical Background Detailed Analysis of the Two Tables TU-Decomposition Conclusion

Example

S = [4, 2, 1, 6, 0, 5, 7, 3]

The DDT of S.

8 0 0 0 0 0 0 00 0 0 0 2 2 2 20 0 0 0 2 2 2 20 0 4 4 0 0 0 00 0 0 0 2 2 2 20 4 4 0 0 0 0 00 4 0 4 0 0 0 00 0 0 0 2 2 2 2

The LAT of S.

4 0 0 0 0 0 0 00 0 2 2 0 0 2 −20 2 2 0 0 2 −2 00 2 0 2 0 −2 0 20 2 0 −2 0 −2 0 −20 −2 2 0 0 −2 −2 00 0 −2 2 0 0 −2 −20 0 0 0 −4 0 0 0

Biryukov, Perrin, Udovenko On Reverse-Engineering S-Boxes 7 / 28

Page 16: On Reverse-Engineering S-Boxes · Biryukov, Perrin, Udovenko On Reverse-Engineering S-Boxes 15 / 28. Introduction Mathematical Background Detailed Analysis of the Two Tables TU-Decomposition

Introduction Mathematical Background Detailed Analysis of the Two Tables TU-Decomposition Conclusion

Coe�icient Distribution in the DDT

If an n-bit S-Box is bijective, then its DDT coe�icients behave likeindependent and identically distributed random variables followinga Poisson distribution:

Pr [DDT[a, b] = 2z] =e−1/2

2zz.

Biryukov, Perrin, Udovenko On Reverse-Engineering S-Boxes 8 / 28

Page 17: On Reverse-Engineering S-Boxes · Biryukov, Perrin, Udovenko On Reverse-Engineering S-Boxes 15 / 28. Introduction Mathematical Background Detailed Analysis of the Two Tables TU-Decomposition

Introduction Mathematical Background Detailed Analysis of the Two Tables TU-Decomposition Conclusion

Coe�icient Distribution in the LAT

If an n-bit S-Box is bijective, then its LAT coe�icients behave likeindependent and identically distributed random variables followingthis distribution:

Pr [LAT[a, b] = 2z] =

(2n−1

2n−2+z

)(2n

2n−1

) .

Biryukov, Perrin, Udovenko On Reverse-Engineering S-Boxes 9 / 28

Page 18: On Reverse-Engineering S-Boxes · Biryukov, Perrin, Udovenko On Reverse-Engineering S-Boxes 15 / 28. Introduction Mathematical Background Detailed Analysis of the Two Tables TU-Decomposition

Introduction Mathematical Background Detailed Analysis of the Two Tables TU-Decomposition Conclusion

Plan

1 Introduction

2 Mathematical Background

3 Detailed Analysis of the Two TablesMaximum Values in the TablesApplication to Skipjack

4 TU-Decomposition

5 Conclusion

Biryukov, Perrin, Udovenko On Reverse-Engineering S-Boxes 9 / 28

Page 19: On Reverse-Engineering S-Boxes · Biryukov, Perrin, Udovenko On Reverse-Engineering S-Boxes 15 / 28. Introduction Mathematical Background Detailed Analysis of the Two Tables TU-Decomposition

Introduction Mathematical Background Detailed Analysis of the Two Tables TU-Decomposition Conclusion

Looking Only at the Maximum

δ log2 (Pr [max(D) ≤ δ ])

4 -1359.530

6 -164.466

8 -16.148

10 -1.329

12 -0.094

14 -0.006

DDT

` log2 (Pr [max(L) ≤ `])

22 -371.60924 -161.90026 -66.41528 -25.62330 -9.28832 -3.16034 -1.00836 -0.30238 -0.084

LATProbability that the maximum coe�icient in the DDT/LAT of an

8-bit permutation is at most equal to a certain threshold.

Biryukov, Perrin, Udovenko On Reverse-Engineering S-Boxes 10 / 28

Page 20: On Reverse-Engineering S-Boxes · Biryukov, Perrin, Udovenko On Reverse-Engineering S-Boxes 15 / 28. Introduction Mathematical Background Detailed Analysis of the Two Tables TU-Decomposition

Introduction Mathematical Background Detailed Analysis of the Two Tables TU-Decomposition Conclusion

Taking Number of Maximum Values into Account

−160

−140

−120

−100

−80

−60

−40

−20

0

N30

0 5 10 15

Probability (log2)

−160

−140

−120

−100

−80

−60

−40

−20

0

N26

0 10 20 30 40 50 60 70

2

3

4

5

6

−160

−140

−120

−100

−80

−60

−40

−20

0

N28

0 10 20 30

Pr [max(LAT) = 24], Pr [max(LAT) = 26], Pr [max(LAT) = 28], Pr [max(LAT) = 30]

Biryukov, Perrin, Udovenko On Reverse-Engineering S-Boxes 11 / 28

Page 21: On Reverse-Engineering S-Boxes · Biryukov, Perrin, Udovenko On Reverse-Engineering S-Boxes 15 / 28. Introduction Mathematical Background Detailed Analysis of the Two Tables TU-Decomposition

Introduction Mathematical Background Detailed Analysis of the Two Tables TU-Decomposition Conclusion

What is Skipjack? (1/2)

Type Block cipher

Bloc 64 bits

Key 80 bits

Authors NSA

Publication 1998

Biryukov, Perrin, Udovenko On Reverse-Engineering S-Boxes 12 / 28

Page 22: On Reverse-Engineering S-Boxes · Biryukov, Perrin, Udovenko On Reverse-Engineering S-Boxes 15 / 28. Introduction Mathematical Background Detailed Analysis of the Two Tables TU-Decomposition

Introduction Mathematical Background Detailed Analysis of the Two Tables TU-Decomposition Conclusion

What is Skipjack? (2/2)

Skipjack was supposed to be secret...

... but eventually published in 1998 [National Security Agency, 1998],

It uses a 8 × 8 S-Box (F ) specified only by its LUT,

Skipjack was to be used by the Clipper Chip.

Biryukov, Perrin, Udovenko On Reverse-Engineering S-Boxes 13 / 28

Page 23: On Reverse-Engineering S-Boxes · Biryukov, Perrin, Udovenko On Reverse-Engineering S-Boxes 15 / 28. Introduction Mathematical Background Detailed Analysis of the Two Tables TU-Decomposition

Introduction Mathematical Background Detailed Analysis of the Two Tables TU-Decomposition Conclusion

What is Skipjack? (2/2)

Skipjack was supposed to be secret...

... but eventually published in 1998 [National Security Agency, 1998],

It uses a 8 × 8 S-Box (F ) specified only by its LUT,

Skipjack was to be used by the Clipper Chip.

Biryukov, Perrin, Udovenko On Reverse-Engineering S-Boxes 13 / 28

Page 24: On Reverse-Engineering S-Boxes · Biryukov, Perrin, Udovenko On Reverse-Engineering S-Boxes 15 / 28. Introduction Mathematical Background Detailed Analysis of the Two Tables TU-Decomposition

Introduction Mathematical Background Detailed Analysis of the Two Tables TU-Decomposition Conclusion

What is Skipjack? (2/2)

Skipjack was supposed to be secret...

... but eventually published in 1998 [National Security Agency, 1998],

It uses a 8 × 8 S-Box (F ) specified only by its LUT,

Skipjack was to be used by the Clipper Chip.

Biryukov, Perrin, Udovenko On Reverse-Engineering S-Boxes 13 / 28

Page 25: On Reverse-Engineering S-Boxes · Biryukov, Perrin, Udovenko On Reverse-Engineering S-Boxes 15 / 28. Introduction Mathematical Background Detailed Analysis of the Two Tables TU-Decomposition

Introduction Mathematical Background Detailed Analysis of the Two Tables TU-Decomposition Conclusion

What is Skipjack? (2/2)

Skipjack was supposed to be secret...

... but eventually published in 1998 [National Security Agency, 1998],

It uses a 8 × 8 S-Box (F ) specified only by its LUT,

Skipjack was to be used by the Clipper Chip.

Biryukov, Perrin, Udovenko On Reverse-Engineering S-Boxes 13 / 28

Page 26: On Reverse-Engineering S-Boxes · Biryukov, Perrin, Udovenko On Reverse-Engineering S-Boxes 15 / 28. Introduction Mathematical Background Detailed Analysis of the Two Tables TU-Decomposition

Introduction Mathematical Background Detailed Analysis of the Two Tables TU-Decomposition Conclusion

Reverse-Engineering F

For Skipjack, max(LAT) = 28 and #28 = 3.

−160

−140

−120

−100

−80

−60

−40

−20

0

N30

0 5 10 15

−160

−140

−120

−100

−80

−60

−40

−20

0

N28

0 10 20 30

Probability (log2)

−160

−140

−120

−100

−80

−60

−40

−20

0

N26

0 10 20 30 40 50 60 70

2

3

4

5

6

Pr [max(LAT) = 28 and #28 = 3] ≈ 2−55

Biryukov, Perrin, Udovenko On Reverse-Engineering S-Boxes 14 / 28

Page 27: On Reverse-Engineering S-Boxes · Biryukov, Perrin, Udovenko On Reverse-Engineering S-Boxes 15 / 28. Introduction Mathematical Background Detailed Analysis of the Two Tables TU-Decomposition

Introduction Mathematical Background Detailed Analysis of the Two Tables TU-Decomposition Conclusion

Reverse-Engineering F

For Skipjack, max(LAT) = 28 and #28 = 3.

−160

−140

−120

−100

−80

−60

−40

−20

0

N30

0 5 10 15

Probability (log2)

−160

−140

−120

−100

−80

−60

−40

−20

0

N26

0 10 20 30 40 50 60 70

2

3

4

5

6

−160

−140

−120

−100

−80

−60

−40

−20

0

N28

0 10 20 30

−160

−140

−120

−100

−80

−60

−40

−20

0

N30

0 5 10 15

−160

−140

−120

−100

−80

−60

−40

−20

0

N28

0 10 20 30

Probability (log2)

−160

−140

−120

−100

−80

−60

−40

−20

0

N26

0 10 20 30 40 50 60 70

2

3

4

5

6

Pr [max(LAT) = 28 and #28 = 3] ≈ 2−55

Biryukov, Perrin, Udovenko On Reverse-Engineering S-Boxes 14 / 28

Page 28: On Reverse-Engineering S-Boxes · Biryukov, Perrin, Udovenko On Reverse-Engineering S-Boxes 15 / 28. Introduction Mathematical Background Detailed Analysis of the Two Tables TU-Decomposition

Introduction Mathematical Background Detailed Analysis of the Two Tables TU-Decomposition Conclusion

Reverse-Engineering F

For Skipjack, max(LAT) = 28 and #28 = 3.

−160

−140

−120

−100

−80

−60

−40

−20

0

N30

0 5 10 15

−160

−140

−120

−100

−80

−60

−40

−20

0

N28

0 10 20 30

Probability (log2)

−160

−140

−120

−100

−80

−60

−40

−20

0

N26

0 10 20 30 40 50 60 70

2

3

4

5

6

Pr [max(LAT) = 28 and #28 = 3] ≈ 2−55

Biryukov, Perrin, Udovenko On Reverse-Engineering S-Boxes 14 / 28

Page 29: On Reverse-Engineering S-Boxes · Biryukov, Perrin, Udovenko On Reverse-Engineering S-Boxes 15 / 28. Introduction Mathematical Background Detailed Analysis of the Two Tables TU-Decomposition

Introduction Mathematical Background Detailed Analysis of the Two Tables TU-Decomposition Conclusion

Reverse-Engineering F

For Skipjack, max(LAT) = 28 and #28 = 3.

−160

−140

−120

−100

−80

−60

−40

−20

0

N30

0 5 10 15

−160

−140

−120

−100

−80

−60

−40

−20

0

N28

0 10 20 30

Probability (log2)

−160

−140

−120

−100

−80

−60

−40

−20

0

N26

0 10 20 30 40 50 60 70

2

3

4

5

6

Pr [max(LAT) = 28 and #28 = 3] ≈ 2−55

Biryukov, Perrin, Udovenko On Reverse-Engineering S-Boxes 14 / 28

Page 30: On Reverse-Engineering S-Boxes · Biryukov, Perrin, Udovenko On Reverse-Engineering S-Boxes 15 / 28. Introduction Mathematical Background Detailed Analysis of the Two Tables TU-Decomposition

Introduction Mathematical Background Detailed Analysis of the Two Tables TU-Decomposition Conclusion

What Can We Deduce?

F has not been picked uniformly at random.

F has not been picked among a feasibly large set of randomS-Boxes.

Its linear properties were optimized (though poorly).

The S-Box of Skipjack was builtusing a dedicated algorithm.

Biryukov, Perrin, Udovenko On Reverse-Engineering S-Boxes 15 / 28

Page 31: On Reverse-Engineering S-Boxes · Biryukov, Perrin, Udovenko On Reverse-Engineering S-Boxes 15 / 28. Introduction Mathematical Background Detailed Analysis of the Two Tables TU-Decomposition

Introduction Mathematical Background Detailed Analysis of the Two Tables TU-Decomposition Conclusion

What Can We Deduce?

F has not been picked uniformly at random.

F has not been picked among a feasibly large set of randomS-Boxes.

Its linear properties were optimized (though poorly).

The S-Box of Skipjack was builtusing a dedicated algorithm.

Biryukov, Perrin, Udovenko On Reverse-Engineering S-Boxes 15 / 28

Page 32: On Reverse-Engineering S-Boxes · Biryukov, Perrin, Udovenko On Reverse-Engineering S-Boxes 15 / 28. Introduction Mathematical Background Detailed Analysis of the Two Tables TU-Decomposition

Introduction Mathematical Background Detailed Analysis of the Two Tables TU-Decomposition Conclusion

Conclusion for Skipjack

F

Biryukov, Perrin, Udovenko On Reverse-Engineering S-Boxes 16 / 28

Page 33: On Reverse-Engineering S-Boxes · Biryukov, Perrin, Udovenko On Reverse-Engineering S-Boxes 15 / 28. Introduction Mathematical Background Detailed Analysis of the Two Tables TU-Decomposition

Introduction Mathematical Background Detailed Analysis of the Two Tables TU-Decomposition Conclusion

Plan

1 Introduction

2 Mathematical Background

3 Detailed Analysis of the Two Tables

4 TU-DecompositionPrincipleResults on Kuznyechik/Streebog

5 Conclusion

Biryukov, Perrin, Udovenko On Reverse-Engineering S-Boxes 16 / 28

Page 34: On Reverse-Engineering S-Boxes · Biryukov, Perrin, Udovenko On Reverse-Engineering S-Boxes 15 / 28. Introduction Mathematical Background Detailed Analysis of the Two Tables TU-Decomposition

Introduction Mathematical Background Detailed Analysis of the Two Tables TU-Decomposition Conclusion

TU-Decomposition in a Nutshell

1 Identify linear pa�erns in zeroes ofLAT;

2 Deduce linear layers µ,η such thatπ is decomposed as in right picture;

3 Decompose U, T ;

4 Put it all together.

T

U

µ

η

Biryukov, Perrin, Udovenko On Reverse-Engineering S-Boxes 17 / 28

Page 35: On Reverse-Engineering S-Boxes · Biryukov, Perrin, Udovenko On Reverse-Engineering S-Boxes 15 / 28. Introduction Mathematical Background Detailed Analysis of the Two Tables TU-Decomposition

Introduction Mathematical Background Detailed Analysis of the Two Tables TU-Decomposition Conclusion

TU-Decomposition in a Nutshell

1 Identify linear pa�erns in zeroes ofLAT;

2 Deduce linear layers µ,η such thatπ is decomposed as in right picture;

3 Decompose U, T ;

4 Put it all together.

T

U

µ

η

Biryukov, Perrin, Udovenko On Reverse-Engineering S-Boxes 17 / 28

Page 36: On Reverse-Engineering S-Boxes · Biryukov, Perrin, Udovenko On Reverse-Engineering S-Boxes 15 / 28. Introduction Mathematical Background Detailed Analysis of the Two Tables TU-Decomposition

Introduction Mathematical Background Detailed Analysis of the Two Tables TU-Decomposition Conclusion

TU-Decomposition in a Nutshell

1 Identify linear pa�erns in zeroes ofLAT;

2 Deduce linear layers µ,η such thatπ is decomposed as in right picture;

3 Decompose U, T ;

4 Put it all together.

T

U

µ

η

Biryukov, Perrin, Udovenko On Reverse-Engineering S-Boxes 17 / 28

Page 37: On Reverse-Engineering S-Boxes · Biryukov, Perrin, Udovenko On Reverse-Engineering S-Boxes 15 / 28. Introduction Mathematical Background Detailed Analysis of the Two Tables TU-Decomposition

Introduction Mathematical Background Detailed Analysis of the Two Tables TU-Decomposition Conclusion

TU-Decomposition in a Nutshell

1 Identify linear pa�erns in zeroes ofLAT;

2 Deduce linear layers µ,η such thatπ is decomposed as in right picture;

3 Decompose U, T ;

4 Put it all together.

T

U

µ

η

Biryukov, Perrin, Udovenko On Reverse-Engineering S-Boxes 17 / 28

Page 38: On Reverse-Engineering S-Boxes · Biryukov, Perrin, Udovenko On Reverse-Engineering S-Boxes 15 / 28. Introduction Mathematical Background Detailed Analysis of the Two Tables TU-Decomposition

Introduction Mathematical Background Detailed Analysis of the Two Tables TU-Decomposition Conclusion

Kuznyechik/Stribog

Stribog

Type Hash function

Publication [GOST, 2012]

Kuznyechik

Type Block cipher

Publication [GOST, 2015]

Common ground

Both are standard symmetric primitives in Russia.

Both were designed by the FSB (TC26).

Both use the same 8 × 8 S-Box, π .

Biryukov, Perrin, Udovenko On Reverse-Engineering S-Boxes 18 / 28

Page 39: On Reverse-Engineering S-Boxes · Biryukov, Perrin, Udovenko On Reverse-Engineering S-Boxes 15 / 28. Introduction Mathematical Background Detailed Analysis of the Two Tables TU-Decomposition

Introduction Mathematical Background Detailed Analysis of the Two Tables TU-Decomposition Conclusion

Kuznyechik/Stribog

Stribog

Type Hash function

Publication [GOST, 2012]

Kuznyechik

Type Block cipher

Publication [GOST, 2015]

Common ground

Both are standard symmetric primitives in Russia.

Both were designed by the FSB (TC26).

Both use the same 8 × 8 S-Box, π .

Biryukov, Perrin, Udovenko On Reverse-Engineering S-Boxes 18 / 28

Page 40: On Reverse-Engineering S-Boxes · Biryukov, Perrin, Udovenko On Reverse-Engineering S-Boxes 15 / 28. Introduction Mathematical Background Detailed Analysis of the Two Tables TU-Decomposition

Introduction Mathematical Background Detailed Analysis of the Two Tables TU-Decomposition Conclusion

The LAT of π

Biryukov, Perrin, Udovenko On Reverse-Engineering S-Boxes 19 / 28

Page 41: On Reverse-Engineering S-Boxes · Biryukov, Perrin, Udovenko On Reverse-Engineering S-Boxes 15 / 28. Introduction Mathematical Background Detailed Analysis of the Two Tables TU-Decomposition

Introduction Mathematical Background Detailed Analysis of the Two Tables TU-Decomposition Conclusion

The LAT of η ◦ π ◦ µ

Biryukov, Perrin, Udovenko On Reverse-Engineering S-Boxes 20 / 28

Page 42: On Reverse-Engineering S-Boxes · Biryukov, Perrin, Udovenko On Reverse-Engineering S-Boxes 15 / 28. Introduction Mathematical Background Detailed Analysis of the Two Tables TU-Decomposition

Introduction Mathematical Background Detailed Analysis of the Two Tables TU-Decomposition Conclusion

Final Decomposition Number 1

ω

σ

ϕ �

ν1ν0

I�

α

� Multiplication inF24

α Linear permutation

I Inversion in F24

ν0,ν1,σ 4 × 4 permutations

ϕ 4 × 4 function

ω Linear permutation

P[ν1 (x ⊕ 0x9) ⊕ ν1 (x ) = 0x2] = 1

Biryukov, Perrin, Udovenko On Reverse-Engineering S-Boxes 21 / 28

Page 43: On Reverse-Engineering S-Boxes · Biryukov, Perrin, Udovenko On Reverse-Engineering S-Boxes 15 / 28. Introduction Mathematical Background Detailed Analysis of the Two Tables TU-Decomposition

Introduction Mathematical Background Detailed Analysis of the Two Tables TU-Decomposition Conclusion

Final Decomposition Number 1

ω

σ

ϕ �

ν1ν0

I�

α

� Multiplication inF24

α Linear permutation

I Inversion in F24

ν0,ν1,σ 4 × 4 permutations

ϕ 4 × 4 function

ω Linear permutation

P[ν1 (x ⊕ 0x9) ⊕ ν1 (x ) = 0x2] = 1Biryukov, Perrin, Udovenko On Reverse-Engineering S-Boxes 21 / 28

Page 44: On Reverse-Engineering S-Boxes · Biryukov, Perrin, Udovenko On Reverse-Engineering S-Boxes 15 / 28. Introduction Mathematical Background Detailed Analysis of the Two Tables TU-Decomposition

Introduction Mathematical Background Detailed Analysis of the Two Tables TU-Decomposition Conclusion

Conclusion for Kuznyechik/Stribog?

The Russian S-Box was built like astrange Feistel...

... or was it?

Belarussian inspiration

The last standard of Belarus [STB 34.101.31-2011, 2011] uses an8-bit S-box,

somewhat similar to π ...

... based on a finite field exponential!

Exponential in π

π ◦ exp

has max(DDT ) = 128 (Pr < 2−340) and a TU-decomposition!

Biryukov, Perrin, Udovenko On Reverse-Engineering S-Boxes 22 / 28

Page 45: On Reverse-Engineering S-Boxes · Biryukov, Perrin, Udovenko On Reverse-Engineering S-Boxes 15 / 28. Introduction Mathematical Background Detailed Analysis of the Two Tables TU-Decomposition

Introduction Mathematical Background Detailed Analysis of the Two Tables TU-Decomposition Conclusion

Conclusion for Kuznyechik/Stribog?

The Russian S-Box was built like astrange Feistel...

... or was it?

Belarussian inspiration

The last standard of Belarus [STB 34.101.31-2011, 2011] uses an8-bit S-box,

somewhat similar to π ...

... based on a finite field exponential!

Exponential in π

π ◦ exp

has max(DDT ) = 128 (Pr < 2−340) and a TU-decomposition!

Biryukov, Perrin, Udovenko On Reverse-Engineering S-Boxes 22 / 28

Page 46: On Reverse-Engineering S-Boxes · Biryukov, Perrin, Udovenko On Reverse-Engineering S-Boxes 15 / 28. Introduction Mathematical Background Detailed Analysis of the Two Tables TU-Decomposition

Introduction Mathematical Background Detailed Analysis of the Two Tables TU-Decomposition Conclusion

Conclusion for Kuznyechik/Stribog?

The Russian S-Box was built like astrange Feistel...

... or was it?

Belarussian inspiration

The last standard of Belarus [STB 34.101.31-2011, 2011] uses an8-bit S-box,

somewhat similar to π ...

... based on a finite field exponential!

Exponential in π

π ◦ exp

has max(DDT ) = 128 (Pr < 2−340) and a TU-decomposition!

Biryukov, Perrin, Udovenko On Reverse-Engineering S-Boxes 22 / 28

Page 47: On Reverse-Engineering S-Boxes · Biryukov, Perrin, Udovenko On Reverse-Engineering S-Boxes 15 / 28. Introduction Mathematical Background Detailed Analysis of the Two Tables TU-Decomposition

Introduction Mathematical Background Detailed Analysis of the Two Tables TU-Decomposition Conclusion

Conclusion for Kuznyechik/Stribog?

The Russian S-Box was built like astrange Feistel...

... or was it?

Belarussian inspiration

The last standard of Belarus [STB 34.101.31-2011, 2011] uses an8-bit S-box,

somewhat similar to π ...

... based on a finite field exponential!

Exponential in π

π ◦ exp

has max(DDT ) = 128 (Pr < 2−340) and a TU-decomposition!

Biryukov, Perrin, Udovenko On Reverse-Engineering S-Boxes 22 / 28

Page 48: On Reverse-Engineering S-Boxes · Biryukov, Perrin, Udovenko On Reverse-Engineering S-Boxes 15 / 28. Introduction Mathematical Background Detailed Analysis of the Two Tables TU-Decomposition

Introduction Mathematical Background Detailed Analysis of the Two Tables TU-Decomposition Conclusion

Conclusion for Kuznyechik/Stribog?

The Russian S-Box was built like astrange Feistel...

... or was it?

Belarussian inspiration

The last standard of Belarus [STB 34.101.31-2011, 2011] uses an8-bit S-box,

somewhat similar to π ...

... based on a finite field exponential!

Exponential in π

π ◦ exp

has max(DDT ) = 128 (Pr < 2−340) and a TU-decomposition!

Biryukov, Perrin, Udovenko On Reverse-Engineering S-Boxes 22 / 28

Page 49: On Reverse-Engineering S-Boxes · Biryukov, Perrin, Udovenko On Reverse-Engineering S-Boxes 15 / 28. Introduction Mathematical Background Detailed Analysis of the Two Tables TU-Decomposition

Introduction Mathematical Background Detailed Analysis of the Two Tables TU-Decomposition Conclusion

Final Decomposition Number 2 (!)

ω ′

⊗−1

q′

logw,16

T

0 1 2 3 4 5 6 7 8 9 a b c d e fT0 0 1 2 3 4 5 6 7 8 9 a b c d e fT1 0 1 2 3 4 5 6 7 8 9 a b c d e fT2 0 1 2 3 4 5 6 7 8 9 a b c d f eT3 0 1 2 3 4 5 6 7 8 9 a b c f d eT4 0 1 2 3 4 5 6 7 8 9 a b f c d eT5 0 1 2 3 4 5 6 7 8 9 a f b c d eT6 0 1 2 3 4 5 6 7 8 9 f a b c d eT7 0 1 2 3 4 5 6 7 8 f 9 a b c d eT8 0 1 2 3 4 5 6 7 f 8 9 a b c d eT9 0 1 2 3 4 5 6 f 7 8 9 a b c d eTa 0 1 2 3 4 5 f 6 7 8 9 a b c d eTb 0 1 2 3 4 f 5 6 7 8 9 a b c d eTc 0 1 2 3 f 4 5 6 7 8 9 a b c d eTd 0 1 2 f 3 4 5 6 7 8 9 a b c d eTe 0 1 f 2 3 4 5 6 7 8 9 a b c d eTf 0 f 1 2 3 4 5 6 7 8 9 a b c d e

Biryukov, Perrin, Udovenko On Reverse-Engineering S-Boxes 23 / 28

Page 50: On Reverse-Engineering S-Boxes · Biryukov, Perrin, Udovenko On Reverse-Engineering S-Boxes 15 / 28. Introduction Mathematical Background Detailed Analysis of the Two Tables TU-Decomposition

Introduction Mathematical Background Detailed Analysis of the Two Tables TU-Decomposition Conclusion

Conclusion on Kuznyechik/Stribog

πFeistel-like

Exponential-like

Biryukov, Perrin, Udovenko On Reverse-Engineering S-Boxes 24 / 28

Page 51: On Reverse-Engineering S-Boxes · Biryukov, Perrin, Udovenko On Reverse-Engineering S-Boxes 15 / 28. Introduction Mathematical Background Detailed Analysis of the Two Tables TU-Decomposition

Introduction Mathematical Background Detailed Analysis of the Two Tables TU-Decomposition Conclusion

Conclusion on Kuznyechik/Stribog

πFeistel-like

Exponential-like

Biryukov, Perrin, Udovenko On Reverse-Engineering S-Boxes 24 / 28

Page 52: On Reverse-Engineering S-Boxes · Biryukov, Perrin, Udovenko On Reverse-Engineering S-Boxes 15 / 28. Introduction Mathematical Background Detailed Analysis of the Two Tables TU-Decomposition

Introduction Mathematical Background Detailed Analysis of the Two Tables TU-Decomposition Conclusion

Conclusion on Kuznyechik/Stribog

πFeistel-like

Exponential-like

Biryukov, Perrin, Udovenko On Reverse-Engineering S-Boxes 24 / 28

Page 53: On Reverse-Engineering S-Boxes · Biryukov, Perrin, Udovenko On Reverse-Engineering S-Boxes 15 / 28. Introduction Mathematical Background Detailed Analysis of the Two Tables TU-Decomposition

Introduction Mathematical Background Detailed Analysis of the Two Tables TU-Decomposition Conclusion

Conclusion on Kuznyechik/Stribog

Feistel-like

Exponential-like ?? ???

Biryukov, Perrin, Udovenko On Reverse-Engineering S-Boxes 24 / 28

Page 54: On Reverse-Engineering S-Boxes · Biryukov, Perrin, Udovenko On Reverse-Engineering S-Boxes 15 / 28. Introduction Mathematical Background Detailed Analysis of the Two Tables TU-Decomposition

Introduction Mathematical Background Detailed Analysis of the Two Tables TU-Decomposition Conclusion

Plan

1 Introduction

2 Mathematical Background

3 Detailed Analysis of the Two Tables

4 TU-Decomposition

5 Conclusion

Biryukov, Perrin, Udovenko On Reverse-Engineering S-Boxes 24 / 28

Page 55: On Reverse-Engineering S-Boxes · Biryukov, Perrin, Udovenko On Reverse-Engineering S-Boxes 15 / 28. Introduction Mathematical Background Detailed Analysis of the Two Tables TU-Decomposition

Introduction Mathematical Background Detailed Analysis of the Two Tables TU-Decomposition Conclusion

For More Information (1/2)

Theoretical background + S-Box of Skipjack

Biryukov, A. and Perrin, L. (2015). On Reverse-Engineering S-Boxes with HiddenDesign Criteria or Structure.In Advances in Cryptology – CRYPTO 2015, pages 116–140

S-Box of Stribog/Kuznechik (Feistel)

Biryukov, A., Perrin, L., and Udovenko, A. (2016). Reverse-Engineering the S-Box ofStreebog, Kuznyechik and STRIBOBr1.In Advances in Cryptology – EUROCRYPT 2016, pages 372–402

S-Box of Stribog/Kuznechik (Exponential)

Perrin, L. and Udovenko, A. (2017). Exponential S-boxes: a link between the S-boxesof BelT and Kuznyechik/Streebog.IACR Transactions on Symmetric Cryptology, 2016(2):99–124

Biryukov, Perrin, Udovenko On Reverse-Engineering S-Boxes 25 / 28

Page 56: On Reverse-Engineering S-Boxes · Biryukov, Perrin, Udovenko On Reverse-Engineering S-Boxes 15 / 28. Introduction Mathematical Background Detailed Analysis of the Two Tables TU-Decomposition

Introduction Mathematical Background Detailed Analysis of the Two Tables TU-Decomposition Conclusion

For More Information (2/2)

APN Permutation

Perrin, L., Udovenko, A., and Biryukov, A. (2016). Cryptanalysis of a Theorem:Decomposing the Only Known Solution to the Big APN Problem.In Advances in Cryptology – CRYPTO 2016, pages (93–122)

Online

1 https://eprint.iacr.org/2015/976 (Skipjack)

2 https://eprint.iacr.org/2016/071 (Stribog/Kuznechik 1)

3 https://eprint.iacr.org/2016/539 (6-bit APN)

4 http://tosc.iacr.org/index.php/ToSC/article/view/567/509

(Stribog/Kuznechik 2)

Biryukov, Perrin, Udovenko On Reverse-Engineering S-Boxes 26 / 28

Page 57: On Reverse-Engineering S-Boxes · Biryukov, Perrin, Udovenko On Reverse-Engineering S-Boxes 15 / 28. Introduction Mathematical Background Detailed Analysis of the Two Tables TU-Decomposition

Introduction Mathematical Background Detailed Analysis of the Two Tables TU-Decomposition Conclusion

Conclusion

We can recover a lot from an LUT

white-box crypto is all the hardest,

we can use cryptanalysis to discover new math results,

secret services’ algorithms are all the more suspicious!

Nothing-up-my-sleeve

Always justify your constants!

Biryukov, Perrin, Udovenko On Reverse-Engineering S-Boxes 27 / 28

Page 58: On Reverse-Engineering S-Boxes · Biryukov, Perrin, Udovenko On Reverse-Engineering S-Boxes 15 / 28. Introduction Mathematical Background Detailed Analysis of the Two Tables TU-Decomposition

Introduction Mathematical Background Detailed Analysis of the Two Tables TU-Decomposition Conclusion

Conclusion

We can recover a lot from an LUT

white-box crypto is all the hardest,

we can use cryptanalysis to discover new math results,

secret services’ algorithms are all the more suspicious!

Nothing-up-my-sleeve

Always justify your constants!

Biryukov, Perrin, Udovenko On Reverse-Engineering S-Boxes 27 / 28

Page 59: On Reverse-Engineering S-Boxes · Biryukov, Perrin, Udovenko On Reverse-Engineering S-Boxes 15 / 28. Introduction Mathematical Background Detailed Analysis of the Two Tables TU-Decomposition

Introduction Mathematical Background Detailed Analysis of the Two Tables TU-Decomposition Conclusion

Open Positions @ uni.lu

post-doc in real-world crypto/blockchain/ privacy

post-doc in lightweight crypto and side-channel a�acks (FDISCproject)

PhDs in applied crypto (PRIDE project)

https://www.cryptolux.org/index.php/Home

Thank you!

Biryukov, Perrin, Udovenko On Reverse-Engineering S-Boxes 28 / 28

Page 60: On Reverse-Engineering S-Boxes · Biryukov, Perrin, Udovenko On Reverse-Engineering S-Boxes 15 / 28. Introduction Mathematical Background Detailed Analysis of the Two Tables TU-Decomposition

Introduction Mathematical Background Detailed Analysis of the Two Tables TU-Decomposition Conclusion

Open Positions @ uni.lu

post-doc in real-world crypto/blockchain/ privacy

post-doc in lightweight crypto and side-channel a�acks (FDISCproject)

PhDs in applied crypto (PRIDE project)

https://www.cryptolux.org/index.php/Home

Thank you!

Biryukov, Perrin, Udovenko On Reverse-Engineering S-Boxes 28 / 28

Page 61: On Reverse-Engineering S-Boxes · Biryukov, Perrin, Udovenko On Reverse-Engineering S-Boxes 15 / 28. Introduction Mathematical Background Detailed Analysis of the Two Tables TU-Decomposition

Appendix

Details About SkipjackN

um

ber o

f occu

rren

ces

100

200

300

Absolute value of the coe�cients in the LAT

22 23 24 25 26 27 28

Biryukov, Perrin, Udovenko On Reverse-Engineering S-Boxes 1 / 4

Page 62: On Reverse-Engineering S-Boxes · Biryukov, Perrin, Udovenko On Reverse-Engineering S-Boxes 15 / 28. Introduction Mathematical Background Detailed Analysis of the Two Tables TU-Decomposition

Appendix

Bibliography I

Biryukov, A. and Perrin, L. (2015).On Reverse-Engineering S-Boxes with Hidden Design Criteriaor Structure.In Advances in Cryptology – CRYPTO 2015, pages 116–140.

Biryukov, A., Perrin, L., and Udovenko, A. (2016).Reverse-Engineering the S-Box of Streebog, Kuznyechik andSTRIBOBr1.In Advances in Cryptology – EUROCRYPT 2016, pages 372–402.

GOST (2012).Gost r 34.11-2012: Streebog hash function.https://www.streebog.net/.

Biryukov, Perrin, Udovenko On Reverse-Engineering S-Boxes 2 / 4

Page 63: On Reverse-Engineering S-Boxes · Biryukov, Perrin, Udovenko On Reverse-Engineering S-Boxes 15 / 28. Introduction Mathematical Background Detailed Analysis of the Two Tables TU-Decomposition

Appendix

Bibliography II

GOST (2015).(GOST R 34.12–2015) information technology – cryptographicdata security – block ciphers.http:

//tc26.ru/en/standard/gost/GOST_R_34_12_2015_ENG.pdf.

National Security Agency, N. S. A. (1998).SKIPJACK and KEA Algorithm Specifications.

Perrin, L. and Udovenko, A. (2017).Exponential S-boxes: a link between the S-boxes of BelT andKuznyechik/Streebog.IACR Transactions on Symmetric Cryptology, 2016(2):99–124.

Biryukov, Perrin, Udovenko On Reverse-Engineering S-Boxes 3 / 4

Page 64: On Reverse-Engineering S-Boxes · Biryukov, Perrin, Udovenko On Reverse-Engineering S-Boxes 15 / 28. Introduction Mathematical Background Detailed Analysis of the Two Tables TU-Decomposition

Appendix

Bibliography III

Perrin, L., Udovenko, A., and Biryukov, A. (2016).Cryptanalysis of a Theorem: Decomposing the Only KnownSolution to the Big APN Problem.In Advances in Cryptology – CRYPTO 2016, pages (93–122).

STB 34.101.31-2011 (2011).“Information technologies. Data protection. Cryptographicalgorithms for encryption and integrity control.”.State Standard of Republic of Belarus (STB 34.101.31-2011).http://apmi.bsu.by/assets/files/std/belt-spec27.pdf.

Biryukov, Perrin, Udovenko On Reverse-Engineering S-Boxes 4 / 4