Collisions for simplified variants of SHA-256 Krystian Matusiewicz - - PowerPoint PPT Presentation

collisions for simplified variants of sha 256
SMART_READER_LITE
LIVE PREVIEW

Collisions for simplified variants of SHA-256 Krystian Matusiewicz - - PowerPoint PPT Presentation

Collisions for simplified variants of SHA-256 Krystian Matusiewicz and Josef Pieprzyk kmatus@ics.mq.edu.au, josef@ics.mq.edu.au Centre For Advanced Computing, Algorithms and Cryptography, Department of Computing, Macquarie University


slide-1
SLIDE 1

Collisions for simplified variants of SHA-256

Krystian Matusiewicz and Josef Pieprzyk

kmatus@ics.mq.edu.au, josef@ics.mq.edu.au

Centre For Advanced Computing, Algorithms and Cryptography, Department of Computing, Macquarie University

Collisions for simplified variants of SHA-256 – p. 1/35

slide-2
SLIDE 2

Overview

  • Motivation: How secure is SHA-256?
  • Description of SHA-256
  • Collisions for a linear variant
  • Collisions for a linear variant with Boolean functions
  • About S-Boxes
  • Conclusions and open problems

Collisions for simplified variants of SHA-256 – p. 2/35

slide-3
SLIDE 3

Motivation: The family tree of MD functions

1990

MD4

Collisions for simplified variants of SHA-256 – p. 3/35

slide-4
SLIDE 4

Motivation: The family tree of MD functions

1990

MD4

1991

MD5

Collisions for simplified variants of SHA-256 – p. 3/35

slide-5
SLIDE 5

Motivation: The family tree of MD functions

1990

MD4

1991

MD5

1992

HAVAL 128,160,224,256 RIPEMD

Collisions for simplified variants of SHA-256 – p. 3/35

slide-6
SLIDE 6

Motivation: The family tree of MD functions

1990

MD4

1991

MD5

1992

HAVAL 128,160,224,256 RIPEMD

1993

SHA0

Collisions for simplified variants of SHA-256 – p. 3/35

slide-7
SLIDE 7

Motivation: The family tree of MD functions

1990

MD4

1991

MD5

1992

HAVAL 128,160,224,256 RIPEMD

1993

SHA0

1994

SHA1

Collisions for simplified variants of SHA-256 – p. 3/35

slide-8
SLIDE 8

Motivation: The family tree of MD functions

1990

MD4

1991

MD5

1992

HAVAL 128,160,224,256 RIPEMD

1993

SHA0

1994

SHA1

1995

RIPEMD-160

Collisions for simplified variants of SHA-256 – p. 3/35

slide-9
SLIDE 9

Motivation: The family tree of MD functions

1990

MD4

1991

MD5

1992

HAVAL 128,160,224,256 RIPEMD

1993

SHA0

1994

SHA1

1995

RIPEMD-160

. . . 2002

SHA-256 SHA-512,384

Collisions for simplified variants of SHA-256 – p. 3/35

slide-10
SLIDE 10

Motivation: The family tree of MD functions

1990

MD4

1991

MD5

1992

HAVAL 128,160,224,256 RIPEMD

1993

SHA0

1994

SHA1

1995

RIPEMD-160

. . . 2002

SHA-256 SHA-512,384

2004

SHA-224

Collisions for simplified variants of SHA-256 – p. 3/35

slide-11
SLIDE 11

Motivation: The family tree of MD functions

1990

MD4

1991

MD5

1992

HAVAL 128,160,224,256 RIPEMD

1993

SHA0

1994

SHA1

1995

RIPEMD-160

. . . 2002

SHA-256 SHA-512,384

2004

SHA-224

Collisions for simplified variants of SHA-256 – p. 3/35

slide-12
SLIDE 12

Motivation: The family tree of MD functions

1990

MD4

1991

MD5

1992

HAVAL 128,160,224,256 RIPEMD

1993

SHA0

1994

SHA1

1995

RIPEMD-160

. . . 2002

SHA-256 SHA-512,384

2004

SHA-224

Collisions for simplified variants of SHA-256 – p. 3/35

slide-13
SLIDE 13

Motivation: Security of SHA-256

  • What is the role of the components of SHA-256?
  • How do they contribute to the security of the function?

Collisions for simplified variants of SHA-256 – p. 4/35

slide-14
SLIDE 14

Overview

  • Motivation: How secure is SHA-256?
  • Description of SHA-256
  • Collisions for a linear variant
  • Collisions for a linear variant with Boolean functions
  • About S-Boxes
  • Conclusions and open problems

Collisions for simplified variants of SHA-256 – p. 5/35

slide-15
SLIDE 15

Description of SHA-256

Iterated hash function using a compression function f : {0, 1}512 × {0, 1}256 → {0, 1}256 IV M1 M2 M3

h(M)

f f f M1 M2 M3

Collisions for simplified variants of SHA-256 – p. 6/35

slide-16
SLIDE 16

SHA-256 compression function

IV M f(M, IV )

message expansion

. . . . . .

Collisions for simplified variants of SHA-256 – p. 7/35

slide-17
SLIDE 17

Message expansion of SHA-256

Wi =

  • Mi

for 0 ≤ i < 16, σ1(Wi−2) + Wi−7 + σ0(Wi−15) + Wi−16 for 16 ≤ i < 64. where σ0(x) = ROTR2(x) ⊕ ROTR18(x) ⊕ SHR3(x) σ1(x) = ROTR17(x) ⊕ ROTR19(x) ⊕ SHR10(x) σ0 σ1

W0 W15

Collisions for simplified variants of SHA-256 – p. 8/35

slide-18
SLIDE 18

Step transformation of SHA-256

Σ0 Maj Σ1 Ch Ki Wi Ai+1 Ei+1 Hi+1 Ai Bi Ci Di Ei Fi Gi Hi

Σ0(x) = ROTR2(x) ⊕ ROTR13(x) ⊕ ROTR22(x) Σ1(x) = ROTR6(x) ⊕ ROTR11(x) ⊕ ROTR25(x) Maj(A, B, C) = (A ∧ B) ∨ (A ∧ C) ∨ (B ∧ C) Ch(E, F, G) = (E ∧ F) ∨ (¬E ∧ G)

Collisions for simplified variants of SHA-256 – p. 9/35

slide-19
SLIDE 19

Overview

  • Motivation: How secure is SHA-256?
  • Description of SHA-256
  • Collisions for a linear variant
  • Collisions for a linear variant with Boolean functions
  • About S-Boxes
  • Conclusions and open problems

Collisions for simplified variants of SHA-256 – p. 10/35

slide-20
SLIDE 20

Linearized variant of SHA-256

SHA-256 contains three types of functions:

  • F2 – linear: σ0, σ1, Σ0, Σ1
  • Z232 – linear: addition modulo 232 : +
  • nonlinear in respect of both structures: bitwise Boolean functions

Simplified variant 1:

  • replace σ0, σ1, Σ0, Σ1 with id,

σ0(x) = σ1(x) = Σ0(x) = Σ1(x) = x,

  • replace Boolean functions with addition:

Maj(x, y, z) = Ch(x, y, z) = x + y + z We get fully Z232–linear function. Is it possible to use disturbance-corrections strategy to find collisions for this model?

Collisions for simplified variants of SHA-256 – p. 11/35

slide-21
SLIDE 21

Correcting single disturbance: steps 1 – 2

Ki+1 Σ0 Maj Σ1 Ch Ki ∆ Ai Bi Ci Di Ei Fi Gi Hi −4∆ Σ0 Maj ∆ ∆ Σ1 Ch ∆ ∆ −2∆

Collisions for simplified variants of SHA-256 – p. 12/35

slide-22
SLIDE 22

Correcting single disturbance: steps 3 – 4

2∆ 2∆ Ki+3 Σ0 Maj Ki+2 Maj −∆ ∆ ∆ −2∆ Σ0 ∆ ∆ −2∆ Ch Σ1 Ch Σ1 ∆ −∆−∆ ∆ −2∆

Collisions for simplified variants of SHA-256 – p. 13/35

slide-23
SLIDE 23

Correcting single disturbance: steps 5 – 6

Ch 2∆ 4∆ Ki+5 Σ0 Maj Ki+4 Σ0 Maj ∆ −∆−∆ −2∆ Σ1 ∆ −2∆ −∆−∆ Ch Σ1 ∆ −∆ −∆

Collisions for simplified variants of SHA-256 – p. 14/35

slide-24
SLIDE 24

Correcting single disturbance: steps 7 – 8

∆ Ki+7 Σ0 Maj Ki+6 Σ0 Maj Σ1 Ch Ch Σ1 ∆ −∆−∆ ∆ −∆ ∆

Collisions for simplified variants of SHA-256 – p. 15/35

slide-25
SLIDE 25

Correcting single disturbance: step 9

−∆ Ki+9 Σ0 Maj Ki+8 Σ0 Maj Σ1 Ch Σ1 Ch ∆

Collisions for simplified variants of SHA-256 – p. 16/35

slide-26
SLIDE 26

Single corrective pattern

Disturbance in i-th word ∆i is corrected by the following sequence ∆i, −4∆i, 2∆i, 2∆i, 4∆i, 2∆i, ∆i, 0, −∆i . −4 2 2 4 2 1 −1

∆i

disturbance

Collisions for simplified variants of SHA-256 – p. 17/35

slide-27
SLIDE 27

Conditions for a disturbance vector

We treat expanded messages as vectors W ∈ Z 64

232

A difference ∆ = W ′ − W is a valid disturbance pattern if two conditions are satisfied:

  • C1. the last 8 words of ∆ are zero,
  • C2. ∆ with prepended 8 zero block must also be the result of the

expansion process. C1 is necessary to allow enough time to correct the last difference as 8 steps are needed to correct each disturbance. C2 is necessary for constructing a corrective pattern as a linear combination of ∆ and “delayed” disturbance vectors.

Collisions for simplified variants of SHA-256 – p. 18/35

slide-28
SLIDE 28

More about condition C2

For disturbance pattern ∆ = [∆0, . . . , ∆63]T the full corrective pattern is computed as C = ∆ − 4 · [0, ∆0, . . . , ∆62]T + 2 · [0, 0, ∆0, . . . , ∆61]T + 2 · [0, 0, 0, ∆0, . . . , ∆60]T + . . . − 1 · [0, 0, 0, 0, 0, 0, 0, 0, ∆0, . . . , ∆55]T . „Delayed” pattern [0, 0, 0, 0, 0, 0, 0, 0, ∆0, . . . , ∆55]T has to be the result

  • f the expansion.

Collisions for simplified variants of SHA-256 – p. 19/35

slide-29
SLIDE 29

Message expansion as a linear transform

Message expansion with σ0 = σ1 = id is Z232–linear, so it can be represented as 64 × 16 matrix E =      I16 A A2 A3      , where A is a linear transform producing 16 new words out of 16 old

  • nes according to the recurrence relation.

Then we have W = E · M where M ∈ Z16

232 is the initial message and W ∈ Z64 232 is the expanded

message.

Collisions for simplified variants of SHA-256 – p. 20/35

slide-30
SLIDE 30

Finding disturbance patterns

We are looking for such message differences ∆M = M ′ − M that expanded differences ∆ = E(∆M) satisfy conditions C1 and C2. This can be written as 0 = A3[8 :: 16] · ∆M the last 8 elements of ∆ are zero 0 = A−1[8 :: 16] · ∆M 8 prepended elements of ∆ would be zero where M[a :: b] means a matrix consisting of rows of matrix M from a-th row to b-th row, inclusive. These two matrix equations form a linear system over the ring Z232.

Collisions for simplified variants of SHA-256 – p. 21/35

slide-31
SLIDE 31

Finding disturbance patterns: solving the system

The system 0 = A3[8 :: 16] · ∆M 0 = A−1[8 :: 16] · ∆M has one-dimensional solution space given by ∆M = [0x10000000, 0xA0000000, 0xC0000000, 0xA0000000, 0xE0000000, 0x20000000, 0x40000000, 0x40000000, 0x80000000, 0xD0000000, 0x10000000, 0x60000000, 0x50000000, 0x40000000, 0x70000000, 0x30000000]T . Any nonzero multiple of this vector constitutes a valid disturbance pattern for linearized version of SHA-256 – we can use it to find collisions.

Collisions for simplified variants of SHA-256 – p. 22/35

slide-32
SLIDE 32

Overview

  • Motivation: How secure is SHA-256?
  • Description of SHA-256
  • Collisions for a linear variant
  • Collisions for a linear variant with Boolean functions
  • About S-Boxes
  • Conclusions and open problems

Collisions for simplified variants of SHA-256 – p. 23/35

slide-33
SLIDE 33

The next step: Incorporating Boolean functions

Let us consider a variant still without S-boxes σ0, σ1, Σ0, Σ1 but with Boolean functions Maj and Ch. If we multiply the pattern by 8, we get a valid disturbance pattern with 1’s in the most significant bits only. 1000000001101011 1011100110100110 0000011100101111 1011100000000000 There are only 27 nonzero bits in this pattern. We can approximate Boolean functions with certain probabilities.

Collisions for simplified variants of SHA-256 – p. 24/35

slide-34
SLIDE 34

Approximation of Boolean functions

(δx, δy, δz) illustration (δx, δy, δz) illustration (0,0,0) (1,1,0) (1,0,0) (1,0,1) (0,1,0) (0,1,1) (0,0,1) (1,1,1)

Collisions for simplified variants of SHA-256 – p. 25/35

slide-35
SLIDE 35

Approximation of Boolean functions

We can approximate both Boolean functions with probability at least 1/2 by a “function” that produces output difference each time input difference is nonzero. input difference Ch function Maj function (δx, δy, δz) conditions Prob conditions Prob (1,0,0) y + z = 1 1/2 y + z = 1 1/2 (0,1,0) x = 1 1/2 x + z = 1 1/2 (0,0,1) x = 0 1/2 x + y = 1 1/2 (1,1,0) x + y + z = 0 1/2 x + y = 0 1/2 (1,0,1) x + y = 0 1/2 x + z = 0 1/2 (0,1,1) – 1 y + z = 0 1/2 (1,1,1) y + z = 0 1/2 – 1

Collisions for simplified variants of SHA-256 – p. 26/35

slide-36
SLIDE 36

Corrective pattern for this variant

For the variant with Boolean functions approximated by „always output difference” and disturbance pattern with nonzero bits in only the most significant position, single corrective sequence has the following form ∆i, 0, 0, ∆i, ∆i, 0, 0, 0, ∆i After obtaining the full corrective pattern we can estimate the probability of a successful correction.

Collisions for simplified variants of SHA-256 – p. 27/35

slide-37
SLIDE 37

Probabilities of successful corrections in each step

s Maj Ch e s Maj Ch e s Maj Ch e s Maj Ch e 000 000 16 110 010 2 32 011 100 2 48 111 110 1 1 100 100 2 17 111 101 1 33 001 010 2 49 111 011 2 010 010 2 18 011 010 2 34 000 001 1 50 011 101 2 3 001 101 2 19 101 001 2 35 000 100 1 51 101 010 2 4 000 110 1 20 110 100 2 36 000 010 1 52 110 101 2 5 000 111 1 21 111 110 1 37 000 001 1 53 111 110 1 6 000 011 22 011 011 1 38 100 100 2 54 011 011 1 7 000 001 1 23 001 101 2 39 110 110 2 55 001 101 2 8 000 000 24 100 110 2 40 111 011 56 000 010 1 9 000 000 25 110 011 1 41 011 001 2 57 000 101 1 10 100 100 2 26 011 101 2 42 001 100 2 58 000 010 1 11 110 110 2 27 101 110 2 43 100 110 2 59 000 001 1 12 011 111 2 28 010 011 1 44 010 111 2 60 000 000 13 101 111 2 29 001 001 2 45 101 011 1 61 000 000 14 010 011 1 30 100 000 1 46 110 001 2 62 000 000 15 101 101 2 31 110 000 1 47 111 100 1 63 000 000

Collisions for simplified variants of SHA-256 – p. 28/35

slide-38
SLIDE 38

Overall probability of a collision

Straightforward result e =

63

  • i=0

ei = 84 Prob[collision] = 2−e = 2−84 We can do better. By appropriate selection of message words in 16 first steps we can eliminate probabilistic behaviour in these steps and get better probability e′ =

63

  • i=16

ei = 64 Prob[collision] = 2−e′ = 2−64

Collisions for simplified variants of SHA-256 – p. 29/35

slide-39
SLIDE 39

Overview

  • Motivation: How secure is SHA-256?
  • Description of SHA-256
  • Collisions for a linear variant
  • Collisions for a linear variant with Boolean functions
  • About S-Boxes
  • Conclusions and open problems

Collisions for simplified variants of SHA-256 – p. 30/35

slide-40
SLIDE 40

The role of S-Boxes : the full SHA-256 structure

  • S-Boxes provide diffusion of differences
  • one bit input difference gives 2–3 bit output difference
  • still possible to use modular differentials

Prob[ Σ(x + δ) − Σ(x) = Σ(δ) ] = 2−3 for one-bit input differences δ,

  • we also need another difference

Prob[ Σ(x + γ) − Σ(x) = Σ(γ) ] ≈ 2−9 for input difference γ = Σ(δ),

  • using these differentials, single correction sequence for full round

structure has a probability of 2−42

  • Hawkes, Paddon, Rose using some additional optimizations

achieved 2−39

Collisions for simplified variants of SHA-256 – p. 31/35

slide-41
SLIDE 41

Overview

  • Motivation: How secure is SHA-256?
  • Description of SHA-256
  • Collisions for a linear variant
  • Collisions for a linear variant with Boolean functions
  • About S-Boxes
  • Conclusions and open problems

Collisions for simplified variants of SHA-256 – p. 32/35

slide-42
SLIDE 42

Conclusions and open problems

  • it is possible to use disturbance-corrections strategy for

SHA-256-like architecture

Collisions for simplified variants of SHA-256 – p. 33/35

slide-43
SLIDE 43

Conclusions and open problems

  • it is possible to use disturbance-corrections strategy for

SHA-256-like architecture

  • mixing provided by modular additions and Boolean functions

alone is not sufficient for building a secure hash function

Collisions for simplified variants of SHA-256 – p. 33/35

slide-44
SLIDE 44

Conclusions and open problems

  • it is possible to use disturbance-corrections strategy for

SHA-256-like architecture

  • mixing provided by modular additions and Boolean functions

alone is not sufficient for building a secure hash function

  • S-Boxes are vital for the security of SHA-256

Collisions for simplified variants of SHA-256 – p. 33/35

slide-45
SLIDE 45

Conclusions and open problems

  • it is possible to use disturbance-corrections strategy for

SHA-256-like architecture

  • mixing provided by modular additions and Boolean functions

alone is not sufficient for building a secure hash function

  • S-Boxes are vital for the security of SHA-256
  • can we force the full message expansion process to produce

differences that follow disturbance-corrections patterns?

Collisions for simplified variants of SHA-256 – p. 33/35

slide-46
SLIDE 46

Conclusions and open problems

  • it is possible to use disturbance-corrections strategy for

SHA-256-like architecture

  • mixing provided by modular additions and Boolean functions

alone is not sufficient for building a secure hash function

  • S-Boxes are vital for the security of SHA-256
  • can we force the full message expansion process to produce

differences that follow disturbance-corrections patterns?

  • are there any other high probability differentials for SHA-256?

Collisions for simplified variants of SHA-256 – p. 33/35

slide-47
SLIDE 47

The End

Thank you!

Collisions for simplified variants of SHA-256 – p. 34/35

slide-48
SLIDE 48

Misc

Lemma [Hawkes, Paddon, Rose] Let λ = ∆X = X′ ⊕ X and δX = X′ − X. Having ∆X we can determine δX if we know all X[i] for all i < 31 such that λ[i] = 1

Collisions for simplified variants of SHA-256 – p. 35/35