towards a unifying view of block cipher cryptanalysis david wagner university of california,...

28
Towards a unifying view of block cipher cryptanalysis David Wagner University of California, Berkeley

Post on 19-Dec-2015

223 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Towards a unifying view of block cipher cryptanalysis David Wagner University of California, Berkeley

Towards a unifying view of block cipher cryptanalysis

David Wagner

University of California, Berkeley

Page 2: Towards a unifying view of block cipher cryptanalysis David Wagner University of California, Berkeley

In this talk:

• Survey of cryptanalysis of block ciphers• Steps towards a unifying view of this field• Algebraic attacks

How do we tell if a block cipher is secure? How do we design good ones?

Page 3: Towards a unifying view of block cipher cryptanalysis David Wagner University of California, Berkeley

x

Ek(x)

k

What’s a block cipher?

Ek : X → X bijective for all k

Page 4: Towards a unifying view of block cipher cryptanalysis David Wagner University of California, Berkeley

When is a block cipher secure?

x

(x)randompermutation

k E

x

Ek(x)

blockcipher

Answer: when these two black boxes are indistinguishable.

Page 5: Towards a unifying view of block cipher cryptanalysis David Wagner University of California, Berkeley

So many cryptanalytic attacks…

truncated d.c.

differential crypt.

complementation props.

linear factors

linear crypt.

l.c. with multiple approximations

impossible d.c.

higher-order d.c.

boomerangyo-yo

sliding

integrals

interpolation attacks

MITM interpolation

rational interpol.probabilistic interpol.

prob. rational interpol.

How do we unify them?

Page 6: Towards a unifying view of block cipher cryptanalysis David Wagner University of California, Berkeley

How to attack a product cipher

1. Identify local properties of its round functions

2. Piece these together into global properties of the whole cipher

X

X

Ek

X

X

X

X

f1

fn

=

Page 7: Towards a unifying view of block cipher cryptanalysis David Wagner University of California, Berkeley

Motif #1: projection

Identify local properties using commutative diagrams:

X

X

fk

where:

fk = original round function

Y

Y

gk’ gk’ = reduced round function

and:gk’ ○ = ’ ○ fk

Page 8: Towards a unifying view of block cipher cryptanalysis David Wagner University of California, Berkeley

Composing local properties

Build global commutative diagrams out of local ones:

X

X

f1

Y

Y

g1

X

X

f2

Y

Y

g2+

X Y

’X

f1

Y

g1

”X

f2

Y

g2

=

Page 9: Towards a unifying view of block cipher cryptanalysis David Wagner University of California, Berkeley

Exploiting global properties

Use global properties to build a known-text attack:

X

X

Ek

Y

Y

g

The distinguisher: Let (x, y) be a

plaintext/ciphertext pair If g((x)) =’(y), it’s

probably from Ek

Otherwise, it’s from

Page 10: Towards a unifying view of block cipher cryptanalysis David Wagner University of California, Berkeley

Example: linearity in Madryga

• Madryga leaves parity unchanged– Let (x) = parity of x

– We see (Ek(x)) = (x)

• This yields a distinguisher– Pr[((x)) = (x)] = ½

– Pr[(Ek(x)) = (x)] = 1

GF(2)64

GF(2)64

GF(2)64

GF(2)64

f1

fn

GF(2)

GF(2)

GF(2)

GF(2)

id

id

Page 11: Towards a unifying view of block cipher cryptanalysis David Wagner University of California, Berkeley

Motif #2: statistics

• Suffices to find a property that holds with large enough probability

• A first attempt: probabilistic commutative diagrams?– Turns out to be too weak

X

X

Ek

Y

Y

gProb. p

where p = Pr[(Ek(x)) = g((x))]

Page 12: Towards a unifying view of block cipher cryptanalysis David Wagner University of California, Berkeley

A more general formulation:Markov processes

Stochastic commutative diagrams:

• Ek , , ’ induce a Markov process M, M(i,j) = Pr[’(Ek(x)) = j | (x) = i]

, , ’ induce M’

• Pick a distance measure, e.g.,d(M, M’) = ||M – M’||∞

• Best distinguisher of Ek from has advantage 0.5 ||M – M’||∞ [Vaudenay]

• Also, ~ 1/(||M – M’||∞)2 known texts suffice for a distinguishing attack

X

X

Ek

Y

Y

M

X

X

Y

Y

M’

stochastic

stochastic

Page 13: Towards a unifying view of block cipher cryptanalysis David Wagner University of California, Berkeley

Example: Linear cryptanalysis

• Matsui’s linear cryptanalysis– Set X = GF(2)64, Y = GF(2)

– Cryptanalyst chooses linear maps , ’ cleverly to make ||M – M’||∞ as large as possible

– Note: M is a 2×2 matrix of the form shown to the right, and 1/2 known texts break the cipher

X

X

Ek

Y

Y

M

½+ ½–

½– ½+[ ]M =

and ||M – M’||∞ = 2

stochastic

Page 14: Towards a unifying view of block cipher cryptanalysis David Wagner University of California, Berkeley

Motif #3: higher-order attacks

Use many encryptions to find better properties:

X ×X

X ×X

Êk

Y

Y

M

Here we’ve definedÊk(x,x’) = (Ek(x), Ek(x’))stochastic

Page 15: Towards a unifying view of block cipher cryptanalysis David Wagner University of California, Berkeley

Example: Complementation

Complementation properties are a simple example:

X ×X

X ×X

Êk

X

X

M

Take (x,x’) = x’ – x Suppose M(Δ,Δ) = 1 for

some cleverly chosen Δ Then we obtain a

complementation property We can distinguish with

just 2 chosen texts, since||M – M’||∞ ≈ 1

stochastic

Page 16: Towards a unifying view of block cipher cryptanalysis David Wagner University of California, Berkeley

Example: Differential cryptanalysis

Differential cryptanalysis:

X ×X

X ×X

Êk

X

X

M

Set X = GF(2)n, and take (x,x’) = x’ – x

If p = M(Δ,Δ’) >> 2-n for some clever choice of Δ,Δ’, we can distinguish with 2/p chosen plaintexts

stochastic

Page 17: Towards a unifying view of block cipher cryptanalysis David Wagner University of California, Berkeley

Example: Impossible differentials

Impossible differential cryptanalysis:

X ×X

X ×X

Êk

X

X

M

Set X = GF(2)n, and take (x,x’) = x’ – x

If M(Δ,Δ’) = 0 for some clever choice of Δ,Δ’, we can distinguish with 2n chosen texts

stochastic

Page 18: Towards a unifying view of block cipher cryptanalysis David Wagner University of California, Berkeley

Example: Truncated diff. crypt.

Truncated differential cryptanalysis:

1

2

X ×X

X ×X

Êk

Y

Y

M

Set X = GF(2)n, Y = GF(2)m, cleverly choose linear maps φ1, φ2 : X → Y, and take i(x,x’) = φi(x’ – x)

If M(Δ,Δ) >> 2-m for some clever choice of Δ, Δ’, we can distinguish

stochastic

Page 19: Towards a unifying view of block cipher cryptanalysis David Wagner University of California, Berkeley

Generalized truncated d.c.

Generalized truncated differential cryptanalysis:

1

2

X ×X

X ×X

Êk

Y1

Y2

M

Take X, Yi, i as before; then ||M – M’||∞ measures the distinguishing advantage of the attack

Generalizes d.c., trunc d.c., l.c., diff-linear crypt., ...

stochastic

Page 20: Towards a unifying view of block cipher cryptanalysis David Wagner University of California, Berkeley

The attacks, compared

generalized truncated diff. crypt.

truncated d.c.

differential crypt.

complementation props.

linear factors

linear crypt.

l.c. with multiple approximations

impossible d.c.

higher-order d.c.

boomerangyo-yo

sliding

integrals

Page 21: Towards a unifying view of block cipher cryptanalysis David Wagner University of California, Berkeley

Summary (1)

• A few leitmotifs generate many known attacks– Many other attack methods can also be viewed this way

(higher-order d.c., slide attacks, mod n attacks, d.c. over other groups, diff.-linear attacks, algebraic attacks, etc.)

– Are there other powerful attacks in this space?– Can we prove security against all commutative diagram

attacks?

• We’re primarily exploiting linearities in ciphers– E.g., the closure properties of GL(Y, Y) Perm(X)– Are there other subgroups with useful closure properties?– Are there interesting “non-linear’’ attacks?– Can we prove security against all “linear” comm.

diagram attacks?

Page 22: Towards a unifying view of block cipher cryptanalysis David Wagner University of California, Berkeley

Part 2: Algebraic attacks

Page 23: Towards a unifying view of block cipher cryptanalysis David Wagner University of California, Berkeley

Example: Interpolation attacks

Express cipher as a polynomial in the message & key:

id

id

X

X

Ek

X

X

p

Write Ek(x) = p(x), then interpolate from known texts

Generalization: MITM interpolation: p’(Ek(x)) = p(x)

Generalization: probabilistic interpolation attacks They use noisy polynomial

reconstruction, decoding Reed-Solomon codes

Page 24: Towards a unifying view of block cipher cryptanalysis David Wagner University of California, Berkeley

Example: Rational inter. attacks

Express the cipher as a rational polynomial:

id

id

X

X

Ek

X

X

p/q

If Ek(x) = p(x)/q(x), then:

Write Ek(x) × q(x) = p(x), and apply linear algebra

Note: rational poly’s are closed under composition

Q: Are probabilistic rational interpolation attacks feasible?

Page 25: Towards a unifying view of block cipher cryptanalysis David Wagner University of California, Berkeley

A generalization: resultants

A possible direction: bivariate polynomials:

The small diagrams commute ifpi(x, fi(x)) = 0 for all x

X

X

f1 Xp1

Xp2

X

f2

The small diagrams can be composed, yielding a large diagram q(.,.) = 0

Let q(x, z) = Resy(p1(x, y), p2(y, z));then we have q(x, f2(f1(x))) = 0, i.e., the large diagram commutes

X q

Page 26: Towards a unifying view of block cipher cryptanalysis David Wagner University of California, Berkeley

Bivariate attacks generalize polynomial & rational interpolation

id

id

X

X

Ek

X

X

p Xq1

X

X

Ek

where q1(x, y) = p(x) – y

id

id

X

X

Ek

X

X

p/p’ Xq2

X

X

Ek

q2(x, y) = p’(x) × y – p(x)

Page 27: Towards a unifying view of block cipher cryptanalysis David Wagner University of California, Berkeley

Algebraic attacks, compared

probabilistic bivariate attacks

bivariate attacks

interpolation attacks

MITM interpolation

rational interpol.probabilistic interpol.

prob. rational interpol.

Page 28: Towards a unifying view of block cipher cryptanalysis David Wagner University of California, Berkeley

Summary (2)

• Many cryptanalytic methods can be understood, and compared, by expressing them as a combination of only a few basic ideas

• Commutative diagrams are a powerful way to think about cryptanalysis

• Questions?