62
Graz University of Technology Institute of Applied Information Processing and Communications slide number Lukas Prokop 22 th of Sept 2016 1 MegoSAT project Dierential cryptanalysis with SAT solvers Today: “master thesis presentation” Lukas Prokop Advisors: Florian Mendel, Maria Eichlseder Institute of Applied Information Processing and Communications

Differential cryptanalysis with SAT solvers€¦ · Today: “master thesis presentation” Lukas Prokop Advisors: Florian Mendel, Maria Eichlseder Institute of Applied Information

  • Upload
    others

  • View
    4

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Differential cryptanalysis with SAT solvers€¦ · Today: “master thesis presentation” Lukas Prokop Advisors: Florian Mendel, Maria Eichlseder Institute of Applied Information

Graz University of TechnologyInstitute of Applied Information Processing and Communications

slide numberLukas Prokop 22th of Sept 2016 1

MegoSAT projectDifferential cryptanalysis

with SAT solversToday: “master thesis presentation”

Lukas ProkopAdvisors: Florian Mendel, Maria Eichlseder

Institute of Applied Information Processing and Communications

Page 2: Differential cryptanalysis with SAT solvers€¦ · Today: “master thesis presentation” Lukas Prokop Advisors: Florian Mendel, Maria Eichlseder Institute of Applied Information

Graz University of TechnologyInstitute of Applied Information Processing and Communications

slide numberLukas Prokop 22th of Sept 2016 2

Goal

• Find hash collisions . . .

• for MD4 and SHA-256 . . .

• using SAT solvers

Page 3: Differential cryptanalysis with SAT solvers€¦ · Today: “master thesis presentation” Lukas Prokop Advisors: Florian Mendel, Maria Eichlseder Institute of Applied Information

Graz University of TechnologyInstitute of Applied Information Processing and Communications

slide numberLukas Prokop 22th of Sept 2016 3

Outline• Differential cryptanalysis

• SHA-256 and MD4

• Satisfiability

• Example hash collision (Wang et al.)

• MD4 testcases & results

• Tweaks to SAT encoding

• SHA-256 testcases & results

Page 4: Differential cryptanalysis with SAT solvers€¦ · Today: “master thesis presentation” Lukas Prokop Advisors: Florian Mendel, Maria Eichlseder Institute of Applied Information

Graz University of TechnologyInstitute of Applied Information Processing and Communications

slide numberLukas Prokop 22th of Sept 2016 4

Differential cryptanalysis

Page 5: Differential cryptanalysis with SAT solvers€¦ · Today: “master thesis presentation” Lukas Prokop Advisors: Florian Mendel, Maria Eichlseder Institute of Applied Information

Graz University of TechnologyInstitute of Applied Information Processing and Communications

slide numberLukas Prokop 22th of Sept 2016 5

Differential cryptanalysis

We use two slightlydifferent inputmessages

Page 6: Differential cryptanalysis with SAT solvers€¦ · Today: “master thesis presentation” Lukas Prokop Advisors: Florian Mendel, Maria Eichlseder Institute of Applied Information

Graz University of TechnologyInstitute of Applied Information Processing and Communications

slide numberLukas Prokop 22th of Sept 2016 6

Differential cryptanalysis

We apply thecryptographicalgorithm to bothinstances

Page 7: Differential cryptanalysis with SAT solvers€¦ · Today: “master thesis presentation” Lukas Prokop Advisors: Florian Mendel, Maria Eichlseder Institute of Applied Information

Graz University of TechnologyInstitute of Applied Information Processing and Communications

slide numberLukas Prokop 22th of Sept 2016 7

Differential cryptanalysis

Differences cancel out

Page 8: Differential cryptanalysis with SAT solvers€¦ · Today: “master thesis presentation” Lukas Prokop Advisors: Florian Mendel, Maria Eichlseder Institute of Applied Information

Graz University of TechnologyInstitute of Applied Information Processing and Communications

slide numberLukas Prokop 22th of Sept 2016 8

Differential cryptanalysis

Equality is given

Page 9: Differential cryptanalysis with SAT solvers€¦ · Today: “master thesis presentation” Lukas Prokop Advisors: Florian Mendel, Maria Eichlseder Institute of Applied Information

Graz University of TechnologyInstitute of Applied Information Processing and Communications

slide numberLukas Prokop 22th of Sept 2016 9

Differential cryptanalysis

A hash collision is apair (x1, x2) such that

x1 , x2 withf (x1) = f (x2).

Page 10: Differential cryptanalysis with SAT solvers€¦ · Today: “master thesis presentation” Lukas Prokop Advisors: Florian Mendel, Maria Eichlseder Institute of Applied Information

Graz University of TechnologyInstitute of Applied Information Processing and Communications

slide numberLukas Prokop 22th of Sept 2016 10

Differential cryptanalysis

Differentialcryptanalysis focuses

on the behavior ofdifferences when f is

progressing.

A hash collision is apair (x1, x2) such that

x1 , x2 withf (x1) = f (x2).

Equality is given

Differences cancel out

We use two slightlydifferent inputmessages

We apply thecryptographicalgorithm to bothinstances

Page 11: Differential cryptanalysis with SAT solvers€¦ · Today: “master thesis presentation” Lukas Prokop Advisors: Florian Mendel, Maria Eichlseder Institute of Applied Information

Graz University of TechnologyInstitute of Applied Information Processing and Communications

slide numberLukas Prokop 22th of Sept 2016 11

Differential cryptanalysisWang et al. defined signed differences.De Canniere and Rechberger [01] definedgeneralized bit conditions.

(xi, x∗i ) (0, 0) (1, 0) (0, 1) (1, 1)? 3 3 3 3- 3 3x 3 30 3u 3n 31 3#

(xi, x∗i ) (0, 0) (1, 0) (0, 1) (1, 1)3 3 35 3 37 3 3 3A 3 3B 3 3 3C 3 3D 3 3 3E 3 3 3

Page 12: Differential cryptanalysis with SAT solvers€¦ · Today: “master thesis presentation” Lukas Prokop Advisors: Florian Mendel, Maria Eichlseder Institute of Applied Information

Graz University of TechnologyInstitute of Applied Information Processing and Communications

slide numberLukas Prokop 22th of Sept 2016 12

Differential cryptanalysis

A: 0100B: 1x-1S: ??-1

addition A + B = S

Page 13: Differential cryptanalysis with SAT solvers€¦ · Today: “master thesis presentation” Lukas Prokop Advisors: Florian Mendel, Maria Eichlseder Institute of Applied Information

Graz University of TechnologyInstitute of Applied Information Processing and Communications

slide numberLukas Prokop 22th of Sept 2016 13

Differential cryptanalysis0100

1101

0001

0100

1001

1101

A: 0100

B: 1001

S: 1101

A: 0100

B: 1101

S: 0001

0100

1011

1111

0100

1111

0011

0100

1001

1111

0100

1101

1011

A: 0100B: 1x-1S: ??-1

. . .

. . .

addition A + B = S

Page 14: Differential cryptanalysis with SAT solvers€¦ · Today: “master thesis presentation” Lukas Prokop Advisors: Florian Mendel, Maria Eichlseder Institute of Applied Information

Graz University of TechnologyInstitute of Applied Information Processing and Communications

slide numberLukas Prokop 22th of Sept 2016 14

Differential cryptanalysis0100

1101

0001

0100

1001

1101

A: 0100

B: 1001

S: 1101

A: 0100

B: 1101

S: 0001

0100

1011

1111

0100

1111

0011

0100

1001

1111

0100

1101

1011

A: 0100B: 1x-1S: ??-1

. . .

. . .

addition A + B = S

Page 15: Differential cryptanalysis with SAT solvers€¦ · Today: “master thesis presentation” Lukas Prokop Advisors: Florian Mendel, Maria Eichlseder Institute of Applied Information

Graz University of TechnologyInstitute of Applied Information Processing and Communications

slide numberLukas Prokop 22th of Sept 2016 15

Differential cryptanalysis0100

1101

0001

0100

1001

1101

A: 0100

B: 1001

S: 1101

A: 0100

B: 1101

S: 0001

0100

1011

1111

0100

1111

0011

0100

1001

1111

0100

1101

1011

A: 0100B: 1x-1S: ?x-1

. . .

. . .⇐

addition A + B = S

Page 16: Differential cryptanalysis with SAT solvers€¦ · Today: “master thesis presentation” Lukas Prokop Advisors: Florian Mendel, Maria Eichlseder Institute of Applied Information

Graz University of TechnologyInstitute of Applied Information Processing and Communications

slide numberLukas Prokop 22th of Sept 2016 16

Differential cryptanalysis

A: 0011B: 0101S: 1000

A: ---xB: ---xS: ????

A: ---xB: ---xS: ???-

A: ---xB: ---xS: x???

Valid 4-bit addition differential characteristics:

A: 0011B: 0101S: 0000

A: ---xB: ---xS: ???x

A: ----B: ---xS: x-??

Invalid 4-bit addition differential characteristics:

0100

1101

0001

0100

1001

1101

A: 0100

B: 1001

S: 1101

A: 0100

B: 1101

S: 0001

0100

1011

1111

0100

1111

0011

0100

1001

1111

0100

1101

1011

A: 0100B: 1x-1S: ?x-1

. . .

. . .

addition A + B = S

Page 17: Differential cryptanalysis with SAT solvers€¦ · Today: “master thesis presentation” Lukas Prokop Advisors: Florian Mendel, Maria Eichlseder Institute of Applied Information

Graz University of TechnologyInstitute of Applied Information Processing and Communications

slide numberLukas Prokop 22th of Sept 2016 17

Differential cryptanalysis

• bit conditions (differential characteristic).

• the operation applied.

We have constraints due to

Page 18: Differential cryptanalysis with SAT solvers€¦ · Today: “master thesis presentation” Lukas Prokop Advisors: Florian Mendel, Maria Eichlseder Institute of Applied Information

Graz University of TechnologyInstitute of Applied Information Processing and Communications

slide numberLukas Prokop 22th of Sept 2016 18

Our f is MD4 or SHA-256

MD4:• Ronald Rivest, 1990

• RFC 1320

• broken since 1995

• 128 bits internal state size

Page 19: Differential cryptanalysis with SAT solvers€¦ · Today: “master thesis presentation” Lukas Prokop Advisors: Florian Mendel, Maria Eichlseder Institute of Applied Information

Graz University of TechnologyInstitute of Applied Information Processing and Communications

slide numberLukas Prokop 22th of Sept 2016 19

Our f is MD4 or SHA-256

SHA-256:• NSA, 2001

• NIST publication 180-4

• best practical pseudo-collision attack breaks38 rounds [02]

• 256 bits internal state size

Page 20: Differential cryptanalysis with SAT solvers€¦ · Today: “master thesis presentation” Lukas Prokop Advisors: Florian Mendel, Maria Eichlseder Institute of Applied Information

Graz University of TechnologyInstitute of Applied Information Processing and Communications

slide numberLukas Prokop 22th of Sept 2016 20

Our f is MD4 or SHA-256

Merkle-Damgård constructions:

IV

M1 M2

post hashvalue

MD4: 48 stepsSHA-256: 64 steps

update . . .update

Page 21: Differential cryptanalysis with SAT solvers€¦ · Today: “master thesis presentation” Lukas Prokop Advisors: Florian Mendel, Maria Eichlseder Institute of Applied Information

Graz University of TechnologyInstitute of Applied Information Processing and Communications

slide numberLukas Prokop 22th of Sept 2016 21

Our f is MD4 or SHA-256

MD4 update function

Page 22: Differential cryptanalysis with SAT solvers€¦ · Today: “master thesis presentation” Lukas Prokop Advisors: Florian Mendel, Maria Eichlseder Institute of Applied Information

Graz University of TechnologyInstitute of Applied Information Processing and Communications

slide numberLukas Prokop 22th of Sept 2016 22

Our f is MD4 or SHA-256

SHA-256 update function

Page 23: Differential cryptanalysis with SAT solvers€¦ · Today: “master thesis presentation” Lukas Prokop Advisors: Florian Mendel, Maria Eichlseder Institute of Applied Information

Graz University of TechnologyInstitute of Applied Information Processing and Communications

slide numberLukas Prokop 22th of Sept 2016 23

And nowfor something completely different

Page 24: Differential cryptanalysis with SAT solvers€¦ · Today: “master thesis presentation” Lukas Prokop Advisors: Florian Mendel, Maria Eichlseder Institute of Applied Information

Graz University of TechnologyInstitute of Applied Information Processing and Communications

slide numberLukas Prokop 22th of Sept 2016 24

Satisfiability• A Boolean function is a mapping h : X→ Y

with X = {0, 1}n for n ∈N≥1 and Y = {0, 1}.

• AND maps X = {0, 1}2 to 1 iff X = (1, 1).

x1 x2 f (x1, x2)1 1 11 0 00 1 00 0 0

x1 x2 f (x1, x2)1 1 11 0 00 1 00 0 0

Page 25: Differential cryptanalysis with SAT solvers€¦ · Today: “master thesis presentation” Lukas Prokop Advisors: Florian Mendel, Maria Eichlseder Institute of Applied Information

Graz University of TechnologyInstitute of Applied Information Processing and Communications

slide numberLukas Prokop 22th of Sept 2016 25

Satisfiability

A Boolean function f is satisfiable iff there existssome assignment m such that f (m) = 1.

f (x1, x2) = (x1 ∨ ¬x2) ∧ (¬x1)

A SAT solver is a tool to evaluate whether acertain Boolean function is satisfiable or not.

f is satisfiable because m = (0, 0) evaluates to 1.

Page 26: Differential cryptanalysis with SAT solvers€¦ · Today: “master thesis presentation” Lukas Prokop Advisors: Florian Mendel, Maria Eichlseder Institute of Applied Information

Graz University of TechnologyInstitute of Applied Information Processing and Communications

slide numberLukas Prokop 22th of Sept 2016 26

Satisfiabilityf (x1, x2) =(x1 ∨ ¬x2)∧(¬x1)

c Lingeling SAT Solver

c

s SATISFIABLE

v -1 -2 0

c

c 0 decisions, 0.0 decisions/sec

c 0 conflicts, 0.0 conflicts/sec

c 2 propagations, 0.0 megaprops/sec

c 0.0 seconds, 0.0 MB

p cnf 2 2

1 -2 0

-1 0

m = (0, 0)

Page 27: Differential cryptanalysis with SAT solvers€¦ · Today: “master thesis presentation” Lukas Prokop Advisors: Florian Mendel, Maria Eichlseder Institute of Applied Information

Graz University of TechnologyInstitute of Applied Information Processing and Communications

slide numberLukas Prokop 22th of Sept 2016 27

Satisfiability

Our strategy: We write a boolean equationsystem such that a hash collision is given iffthe formula is satisfiable (constraints by bitconditions & operation).

Page 28: Differential cryptanalysis with SAT solvers€¦ · Today: “master thesis presentation” Lukas Prokop Advisors: Florian Mendel, Maria Eichlseder Institute of Applied Information

Graz University of TechnologyInstitute of Applied Information Processing and Communications

slide numberLukas Prokop 22th of Sept 2016 28

Example hash collision

Recall . . .• how bit conditions

propagated

• how MD4 andSHA-256 worked

Page 29: Differential cryptanalysis with SAT solvers€¦ · Today: “master thesis presentation” Lukas Prokop Advisors: Florian Mendel, Maria Eichlseder Institute of Applied Information

Graz University of TechnologyInstitute of Applied Information Processing and Communications

slide numberLukas Prokop 22th of Sept 2016 29

Example hash collision

Wang, Lai, Feng, Chen, Yu

“Cryptanalysis of the HashFunctions MD4 andRIPEMD”

EUROCRYPT 2005

Page 30: Differential cryptanalysis with SAT solvers€¦ · Today: “master thesis presentation” Lukas Prokop Advisors: Florian Mendel, Maria Eichlseder Institute of Applied Information

Graz University of TechnologyInstitute of Applied Information Processing and Communications

slide numberLukas Prokop 22th of Sept 2016 30

Example hash collision

Page 31: Differential cryptanalysis with SAT solvers€¦ · Today: “master thesis presentation” Lukas Prokop Advisors: Florian Mendel, Maria Eichlseder Institute of Applied Information

Graz University of TechnologyInstitute of Applied Information Processing and Communications

slide numberLukas Prokop 22th of Sept 2016 31

Example hash collision

inputmessage

Page 32: Differential cryptanalysis with SAT solvers€¦ · Today: “master thesis presentation” Lukas Prokop Advisors: Florian Mendel, Maria Eichlseder Institute of Applied Information

Graz University of TechnologyInstitute of Applied Information Processing and Communications

slide numberLukas Prokop 22th of Sept 2016 32

Example hash collision

initial vectorsinput

message

Page 33: Differential cryptanalysis with SAT solvers€¦ · Today: “master thesis presentation” Lukas Prokop Advisors: Florian Mendel, Maria Eichlseder Institute of Applied Information

Graz University of TechnologyInstitute of Applied Information Processing and Communications

slide numberLukas Prokop 22th of Sept 2016 33

Example hash collision

initial vectors

output words

inputmessage

Page 34: Differential cryptanalysis with SAT solvers€¦ · Today: “master thesis presentation” Lukas Prokop Advisors: Florian Mendel, Maria Eichlseder Institute of Applied Information

Graz University of TechnologyInstitute of Applied Information Processing and Communications

slide numberLukas Prokop 22th of Sept 2016 34

Example hash collision

initial vectors

output words

intermediatevalues

inputmessage

Page 35: Differential cryptanalysis with SAT solvers€¦ · Today: “master thesis presentation” Lukas Prokop Advisors: Florian Mendel, Maria Eichlseder Institute of Applied Information

Graz University of TechnologyInstitute of Applied Information Processing and Communications

slide numberLukas Prokop 22th of Sept 2016 35

Example hash collision

underspecified

Page 36: Differential cryptanalysis with SAT solvers€¦ · Today: “master thesis presentation” Lukas Prokop Advisors: Florian Mendel, Maria Eichlseder Institute of Applied Information

Graz University of TechnologyInstitute of Applied Information Processing and Communications

slide numberLukas Prokop 22th of Sept 2016 36

Attack!

Attacking MD4 & SHA-256

Page 37: Differential cryptanalysis with SAT solvers€¦ · Today: “master thesis presentation” Lukas Prokop Advisors: Florian Mendel, Maria Eichlseder Institute of Applied Information

Graz University of TechnologyInstitute of Applied Information Processing and Communications

slide numberLukas Prokop 22th of Sept 2016 37

MD4 testcases & resultsTestcase A [03]All differences set. Justdetermine actual bits inboth instances.

Page 38: Differential cryptanalysis with SAT solvers€¦ · Today: “master thesis presentation” Lukas Prokop Advisors: Florian Mendel, Maria Eichlseder Institute of Applied Information

Graz University of TechnologyInstitute of Applied Information Processing and Communications

slide numberLukas Prokop 22th of Sept 2016 38

MD4 testcases & resultsTestcase A [03]All differences set. Justdetermine actual bits inboth instances.

solver version runtimeMiniSat 2.2.0 3CryptoMiniSat 4.5.3 26

5 29Lingeling ats1 23Plingeling ats1 88Treengeling ats1 64Glucose 4.0 8Glucose Syrup 4.0 14

always seconds

Page 39: Differential cryptanalysis with SAT solvers€¦ · Today: “master thesis presentation” Lukas Prokop Advisors: Florian Mendel, Maria Eichlseder Institute of Applied Information

Graz University of TechnologyInstitute of Applied Information Processing and Communications

slide numberLukas Prokop 22th of Sept 2016 39

MD4 testcases & results

Interesting fact:In 2006, Mironov andZhang [04] evaluated suchtestcases within 10 minutes.

Page 40: Differential cryptanalysis with SAT solvers€¦ · Today: “master thesis presentation” Lukas Prokop Advisors: Florian Mendel, Maria Eichlseder Institute of Applied Information

Graz University of TechnologyInstitute of Applied Information Processing and Communications

slide numberLukas Prokop 22th of Sept 2016 40

MD4 testcases & resultsTestcase B [03]Words in rounds 0–11completely undetermined.

Page 41: Differential cryptanalysis with SAT solvers€¦ · Today: “master thesis presentation” Lukas Prokop Advisors: Florian Mendel, Maria Eichlseder Institute of Applied Information

Graz University of TechnologyInstitute of Applied Information Processing and Communications

slide numberLukas Prokop 22th of Sept 2016 41

MD4 testcases & resultsTestcase B [03]Words in rounds 0–11completely undetermined.

∼ 20 minutes

Page 42: Differential cryptanalysis with SAT solvers€¦ · Today: “master thesis presentation” Lukas Prokop Advisors: Florian Mendel, Maria Eichlseder Institute of Applied Information

Graz University of TechnologyInstitute of Applied Information Processing and Communications

slide numberLukas Prokop 22th of Sept 2016 42

MD4 testcases & resultsTestcase C [03]Words in rounds 0–20completely undetermined.Collision still given inround 32.

Page 43: Differential cryptanalysis with SAT solvers€¦ · Today: “master thesis presentation” Lukas Prokop Advisors: Florian Mendel, Maria Eichlseder Institute of Applied Information

Graz University of TechnologyInstitute of Applied Information Processing and Communications

slide numberLukas Prokop 22th of Sept 2016 43

MD4 testcases & resultsTestcase C [03]Words in rounds 0–20completely undetermined.Collision still given inround 32.

∼ 18 minutes

Page 44: Differential cryptanalysis with SAT solvers€¦ · Today: “master thesis presentation” Lukas Prokop Advisors: Florian Mendel, Maria Eichlseder Institute of Applied Information

Graz University of TechnologyInstitute of Applied Information Processing and Communications

slide numberLukas Prokop 22th of Sept 2016 44

MD4 testcases & resultsTestcase C [03]Words in rounds 0–20completely undetermined.Collision still given inround 32.

∼ 18 minutes

Nice, but we want to attackSHA-256, which is muchmore difficult.

Page 45: Differential cryptanalysis with SAT solvers€¦ · Today: “master thesis presentation” Lukas Prokop Advisors: Florian Mendel, Maria Eichlseder Institute of Applied Information

Graz University of TechnologyInstitute of Applied Information Processing and Communications

slide numberLukas Prokop 22th of Sept 2016 45

Tweaking SAT encoding

Definition. Given two CNFs A and B, theyare called equisatisfiable iff A is satisfiable iff B.

CNF simplification is done to transform theCNF into a representation which improvesthe performance of the SAT solver.

cmsat

minisat

satelitelingeling

Page 46: Differential cryptanalysis with SAT solvers€¦ · Today: “master thesis presentation” Lukas Prokop Advisors: Florian Mendel, Maria Eichlseder Institute of Applied Information

Graz University of TechnologyInstitute of Applied Information Processing and Communications

slide numberLukas Prokop 22th of Sept 2016 46

Tweaking SAT encoding

Simplification reduces the problem size.

simplification variables percent of none clauses percent of nonenone 48,704 100 % 253,984 100 %

cmsat 24,503 50 % 111,931 44 %lingeling 48,704 100 % 106,626 42 %

minisat 20,895 43 % 118,236 47 %satelite 27,495 56 % 153,262 60 %

for Testcase C

Page 47: Differential cryptanalysis with SAT solvers€¦ · Today: “master thesis presentation” Lukas Prokop Advisors: Florian Mendel, Maria Eichlseder Institute of Applied Information

Graz University of TechnologyInstitute of Applied Information Processing and Communications

slide numberLukas Prokop 22th of Sept 2016 47

Tweaking SAT encoding

Simplification as preprocessing step does notsignificantly improve the runtime of SATsolvers.

solver version none cmsat lingeling minisat sateliteMiniSat 2.2.0 4,519 7,649 1,337 1,476 1,293

CryptoMiniSat 5 1,064 973 1,201 4,470 3,920Lingeling ats1 1,492 906 356 860 1,297

Treengeling ats1 1,281 13,401 20,903 13,790 10,840Plingeling ats1 2,310 1,232 955 1,384 2,030

for Testcase C

Page 48: Differential cryptanalysis with SAT solvers€¦ · Today: “master thesis presentation” Lukas Prokop Advisors: Florian Mendel, Maria Eichlseder Institute of Applied Information

Graz University of TechnologyInstitute of Applied Information Processing and Communications

slide numberLukas Prokop 22th of Sept 2016 48

Tweaking SAT encoding

Definition. Differential description

Boolean function IF returns the secondargument, if the first is true, otherwise thethird argument.

Differential behavior:(0, 1, 1) =⇒ 1 (0, 0, 0) =⇒ 0

(¬a ∧ b ∧ c) =⇒ r ⇐⇒ a ∨ ¬b ∨ ¬c ∨ r(¬a ∧ ¬b ∧ ¬c) =⇒ ¬r ⇐⇒ a ∨ b ∨ c ∨ ¬r

Page 49: Differential cryptanalysis with SAT solvers€¦ · Today: “master thesis presentation” Lukas Prokop Advisors: Florian Mendel, Maria Eichlseder Institute of Applied Information

Graz University of TechnologyInstitute of Applied Information Processing and Communications

slide numberLukas Prokop 22th of Sept 2016 49

Tweaking SAT encoding

Idea. Assigning false first

Few differences are more likely to cancel out.=⇒ Guess all difference variables false first.

Basic idea of differential cryptanalysis:Assign all difference variables first.

Page 50: Differential cryptanalysis with SAT solvers€¦ · Today: “master thesis presentation” Lukas Prokop Advisors: Florian Mendel, Maria Eichlseder Institute of Applied Information

Graz University of TechnologyInstitute of Applied Information Processing and Communications

slide numberLukas Prokop 22th of Sept 2016 50

Tweaking SAT encoding

Definition. Preference variables

Assume x∗ is assigned (Boolean false) first.Assume ∆x is assigned first. Worked well in aprevious, non-SAT tool.

Let ∆x be the difference variable of pair (x, x′).We introduce a new Boolean variable x∗ calledpreference variable. We add clause

x∗ = (∆x ∧ x)

Page 51: Differential cryptanalysis with SAT solvers€¦ · Today: “master thesis presentation” Lukas Prokop Advisors: Florian Mendel, Maria Eichlseder Institute of Applied Information

Graz University of TechnologyInstitute of Applied Information Processing and Communications

slide numberLukas Prokop 22th of Sept 2016 51

SHA-256 testcases

Testcase 18 [05]

Page 52: Differential cryptanalysis with SAT solvers€¦ · Today: “master thesis presentation” Lukas Prokop Advisors: Florian Mendel, Maria Eichlseder Institute of Applied Information

Graz University of TechnologyInstitute of Applied Information Processing and Communications

slide numberLukas Prokop 22th of Sept 2016 52

SHA-256 testcases

Testcase 21 [05]

Page 53: Differential cryptanalysis with SAT solvers€¦ · Today: “master thesis presentation” Lukas Prokop Advisors: Florian Mendel, Maria Eichlseder Institute of Applied Information

Graz University of TechnologyInstitute of Applied Information Processing and Communications

slide numberLukas Prokop 22th of Sept 2016 53

SHA-256 testcases

Testcase 23 [05]

Page 54: Differential cryptanalysis with SAT solvers€¦ · Today: “master thesis presentation” Lukas Prokop Advisors: Florian Mendel, Maria Eichlseder Institute of Applied Information

Graz University of TechnologyInstitute of Applied Information Processing and Communications

slide numberLukas Prokop 22th of Sept 2016 54

SHA-256 testcases

Testcase 24 [05]

Page 55: Differential cryptanalysis with SAT solvers€¦ · Today: “master thesis presentation” Lukas Prokop Advisors: Florian Mendel, Maria Eichlseder Institute of Applied Information

Graz University of TechnologyInstitute of Applied Information Processing and Communications

slide numberLukas Prokop 22th of Sept 2016 55

SHA-256 results

A differential description encoding improvesthe runtime compared to a missingdifferential description.

CryptoMiniSat 5 lingeling-ats1testcase w/o dd w/ dd w/o dd w/ ddMD4, C 1,064 231 798 53SHA-256, 18 37 37 31 160SHA-256, 21 > 7,855 28,621 5,513SHA-256, 23 > 26,212 76,196 1,450SHA-256, 24 > 37,194 78,017 1,235

Page 56: Differential cryptanalysis with SAT solvers€¦ · Today: “master thesis presentation” Lukas Prokop Advisors: Florian Mendel, Maria Eichlseder Institute of Applied Information

Graz University of TechnologyInstitute of Applied Information Processing and Communications

slide numberLukas Prokop 22th of Sept 2016 56

SHA-256 results

Lingeling option --phase=-1 improves itsruntime for our testcases.

Option --phase=-1 of lingeling is describedas “default phase” set to −1 (negative), 0(default, Jeroslow-Wang strategy [06]) or 1(positive).

testcase 18 21 23 24phase 0 −1 0 −1 0 −1 0 −1

runtime 31 22 28,621 19,717 76,196 71,677 85,774 70,259

Page 57: Differential cryptanalysis with SAT solvers€¦ · Today: “master thesis presentation” Lukas Prokop Advisors: Florian Mendel, Maria Eichlseder Institute of Applied Information

Graz University of TechnologyInstitute of Applied Information Processing and Communications

slide numberLukas Prokop 22th of Sept 2016 57

SHA-256 results

Evaluating difference variables false firstimproves the runtime.

testcase C 18 21 23 24basic approach (ats1) 798 31 28,621 76,196 85,774diff-first-false (ats1o1) 652 29 27,599 59,312 66,052

Page 58: Differential cryptanalysis with SAT solvers€¦ · Today: “master thesis presentation” Lukas Prokop Advisors: Florian Mendel, Maria Eichlseder Institute of Applied Information

Graz University of TechnologyInstitute of Applied Information Processing and Communications

slide numberLukas Prokop 22th of Sept 2016 58

SHA-256 results

Adding preference variables dramaticallyworsens performance.

testcase A B C 18 21 23 24CNF with diff-desc 11 133 155 49 2,282 1,314 2,632

pref variables added 8 50 62 > > > >

Page 59: Differential cryptanalysis with SAT solvers€¦ · Today: “master thesis presentation” Lukas Prokop Advisors: Florian Mendel, Maria Eichlseder Institute of Applied Information

Graz University of TechnologyInstitute of Applied Information Processing and Communications

slide numberLukas Prokop 22th of Sept 2016 59

SHA-256 results

Adding preference variables dramaticallyworsens performance.

testcase A B C 18 21 23 24CNF with diff-desc 11 133 155 49 2,282 1,314 2,632

pref variables added 8 50 62 > > > >

Page 60: Differential cryptanalysis with SAT solvers€¦ · Today: “master thesis presentation” Lukas Prokop Advisors: Florian Mendel, Maria Eichlseder Institute of Applied Information

Graz University of TechnologyInstitute of Applied Information Processing and Communications

slide numberLukas Prokop 22th of Sept 2016 60

Conclusion

We found full-round hash collisions in MD4.

We found a hash collisionin 24 rounds-reduced SHA-256.

• 1 very successful tweak (diff-desc)• 2 promising tweaks• 1 insignificant tweak (CNF simplification)• 1 worsening tweak (preference variables)

Page 61: Differential cryptanalysis with SAT solvers€¦ · Today: “master thesis presentation” Lukas Prokop Advisors: Florian Mendel, Maria Eichlseder Institute of Applied Information

Graz University of TechnologyInstitute of Applied Information Processing and Communications

slide numberLukas Prokop 22th of Sept 2016 61

References01 Christophe De Canniere and Christian Rechberger.

“Finding SHA-1 Characteristics: General Results and Applications”

02 Florian Mendel, Tomislav Nad, Martin Schlaffer.“Improving Local Collisions: New Attacks on Reduced SHA-256”

03 Noboru Kunihiro, Kazuo Ohta, Yu Sasaki and Lei Wang.“New message difference for MD4” (MD4 testcases)

04 Ilya Mironov and Lintao Zhang.“Applications of SAT solvers to cryptanalysis of hash functions”

05 Alex Biryukov and Ivica Nikolic.“Collisions for step-reduced SHA-256” (SHA-256 testcases)

06 Robert G. Jeroslow and Jinchang Wang.“Solving Propositional Satisfiability Problems”

Silly walk image Leo Antunes Knight image Springfield Punx

Page 62: Differential cryptanalysis with SAT solvers€¦ · Today: “master thesis presentation” Lukas Prokop Advisors: Florian Mendel, Maria Eichlseder Institute of Applied Information

Graz University of TechnologyInstitute of Applied Information Processing and Communications

slide numberLukas Prokop 22th of Sept 2016 62

どうもありがとうございました

http://lukas-prokop.at/proj/megosat

All resources available online at:

Acknowledgements: Florian Mendel,Maria Eichlseder, Armin Biere, RoderickBloem, Mate Soos, Martina, my parentsand many others . . .