Docsity

Pseudorandom Permutations - Luca Trevisan, UC Berkeley, Lecture notes of Mathematics

Toggle sidebar
bg1
U.C. Berkeley — CS276: Cryptography Handout N15
Luca Trevisan March 10, 2009
Notes for Lecture 15
Scribed by Siu-Man Chan, posted March 12, 2009
Summary
Given one way permutations (of which discrete logarithm is a candidate), we know
how to construct pseudorandom functions. Today, we are going to construct pseudo-
random permutations (block ciphers) from pseudorandom functions.
1 Pseudorandom Permutations
Recall that a pseudorandom function Fis an efficient function : {0,1}k× {0,1}n→
{0,1}n, such that every efficient algorithm Acannot distinguish well FK(·) from R(·),
for a randomly chosen key K∈ {0,1}kand a random function R:{0,1}n→ {0,1}n.
That is, we want that AFK(·)behaves like AR(·).
F
x
K
FK(x)
A pseudorandom permutation Pis an efficient function : {0,1}k× {0,1}n→ {0,1}n,
such that for every key K, the function PKmapping x7→ PK(x) is a bijection.
Moreover, we assume that given K, the mapping x7→ PK(x) is efficiently invertible
(i.e. P−1
Kis efficient). The security of Pstates that every efficient algorithm Acannot
distinguish well hPK(·), P −1
K(·)ifrom hΠ(·),Π−1(·)i, for a randomly chosen key K∈
{0,1}kand a random permutation Π: {0,1}n→ {0,1}n. That is, we want that
APK(·),P −1
K(·)behaves like AΠ(·),Π−1(·).
We note that the algorithm Ais given access to both an oracle and its (supposed)
inverse.
1
pf3
pf4
pf5

Partial preview of the text

Download Pseudorandom Permutations - Luca Trevisan, UC Berkeley and more Lecture notes Mathematics in PDF only on Docsity!

U.C. Berkeley — CS276: Cryptography Handout N

Luca Trevisan March 10, 2009

Notes for Lecture 15

Scribed by Siu-Man Chan, posted March 12, 2009

Summary

Given one way permutations (of which discrete logarithm is a candidate), we know

how to construct pseudorandom functions. Today, we are going to construct pseudo-

random permutations (block ciphers) from pseudorandom functions.

1 Pseudorandom Permutations

Recall that a pseudorandom function F is an efficient function : { 0 , 1 }

k × { 0 , 1 }

n →

n , such that every efficient algorithm A cannot distinguish well FK (·) from R(·),

for a randomly chosen key K ∈ { 0 , 1 }

k and a random function R : { 0 , 1 }

n → { 0 , 1 }

n .

That is, we want that A

FK (·) behaves like A

R(·) .

x F

K

FK (x)

A pseudorandom permutation P is an efficient function : { 0 , 1 }

k × { 0 , 1 }

n → { 0 , 1 }

n ,

such that for every key K, the function PK mapping x 7 → PK (x) is a bijection.

Moreover, we assume that given K, the mapping x 7 → PK (x) is efficiently invertible

(i.e. P

− 1 K

is efficient). The security of P states that every efficient algorithm A cannot

distinguish well 〈PK (·), P

− 1 K (·)〉^ from^ 〈Π(·),^ Π

− 1 (·)〉, for a randomly chosen key K ∈

{ 0 , 1 }

k and a random permutation Π : { 0 , 1 }

n → { 0 , 1 }

n

. That is, we want that

A

PK (·),P

− 1 K (·)^ behaves like AΠ(·),Π

− (^1) (·) .

We note that the algorithm A is given access to both an oracle and its (supposed)

inverse.

x P

K

PK (x) y P −^1

K

P

− 1 K (y)

2 Feistel Permutations

Given any function F : { 0 , 1 }

m → { 0 , 1 }

m , we can construct a permutation DF : { 0 , 1 }

2 m →

{ 0 , 1 }

2 m using a technique named after Horst Feistel. The definition of DF is given

by

DF (x, y) := y, F (y) ⊕ x, (1)

where x and y are m-bit strings. Note that this is an injective (and hence bijective)

function, because its inverse is given by

D

− 1 F (z, w) :=^ F^ (z)^ ⊕^ w, z.^ (2)

F

L

R

⊕ R

F (R) ⊕ L

F

L

R

Also, note that DF and D

− 1 F are efficiently computable given^ F^.

However, DF needs not be a pseudorandom permutation even if F is a pseudorandom

function, because the output of DF (x, y) must contain y, which is extremely unlikely

for a truly random permutation.

To avoid the above pitfall, we may want to repeat the construction twice. We pick

two independent random keys K 1 and K 2 , and compose the permutations P (·) :=

DFK 2

(DFK

1

Indeed, the output does not always contain part of the input. However, this construc-

tion is still insecure, no matter whether F is pseudorandom or not, as the following

example shows.

Here, 0 denotes the all-zero string of length m, 1 denotes the all-one string of length

m, and F (·) is FK 1 (·). This shows that, restricting to the first half, P (00) is the

complement of P (10), regardless of F.

What happens if we repeat the construction three times? We still do not get a

pseudorandom permutation.

FK 1

L

0

R

0

FK 2

L

1

R

1

FK 3

L

2

R

2

FK 4

L

3

R

3

⊕ L^4

R

4

It is easy to construct the inverse permutation by composing their inverses backwards.

Theorem 1 (Pseudorandom Permutations from Pseudorandom Functions)

If F is a (O(tr), )-secure pseudorandom function computable in time r, then P is a

(t, 4  + t

2 · 2

−m

  • t

2 · 2

− 2 m ) secure pseudorandom permutation.

4 Analysis of the Luby-Rackoff Construction

Given four random functions R = 〈R 1 ,... , R 4 〉, Ri : { 0 , 1 }

m → { 0 , 1 }

m , let P R

be the

analog of Construction (3) using the random function Ri instead of the pseudorandom

functions FKi ,

PR(x) = DR 4 (DR 3 (DR 2 (DR 1 (x)))) (4)

We prove Theorem 1 by showing that

  1. PK is indistinguishable from PR or else we can break the pseudorandom function
  2. PR is indistinguishable from a random permutation

The first part is given by the following lemma, which we prove via a standard hybrid

argument.

Lemma 2 If F is a (O(tr), )-secure pseudorandom function computable in time r,

then for every algorithm A of complexity ≤ t we have

P

K

[A

PK ,P

− 1 K (^) () = 1] − (^) P

R

[A

PR,P

− 1 R (^) () = 1]

And the second part is given by the following lemma:

Lemma 3 For every algorithm A of complexity ≤ t we have

∣P

R

[A

PR,P

− 1 R (^) () = 1] − (^) P Π

[A

Π,Π−^1 () = 1]

t

2

22 m^

t

2

2 m

where Π : { 0 , 1 }

2 m → { 0 , 1 }

2 m is a random permutation.

We now prove Lemma 2 using a hybrid argument.

Proof: Consider the following five algorithms from { 0 , 1 }

2 m to { 0 , 1 }

2 m :

  • H 0 : pick random keys K 1 , K 2 , K 3 , K 4 ,

H 0 (·) := DFK

4

(DFK

3

(DFK

2

(DFK

1

  • H 1 : pick random keys K 2 , K 3 , K 4 and a random function F 1 : { 0 , 1 }

m →

{ 0 , 1 }

m ,

H 1 (·) := DFK

4

(DFK

3

(DFK

2

(DF 1 (·))));

  • H 2 : pick random keys K 3 , K 4 and random functions F 1 , F 2 : { 0 , 1 }

m → { 0 , 1 }

m ,

H 2 (·) := DFK

4

(DFK

3

(DF 2 (DF 1 (·))));

  • H 3 : pick a random key K 4 and random functions F 1 , F 2 , F 3 : { 0 , 1 }

m → { 0 , 1 }

m ,

H 3 (·) := DFK 4

(DF 3 (DF 2 (DF 1 (·))));

  • H 4 : pick random functions F 1 , F 2 , F 3 , F 4 : { 0 , 1 }

m → { 0 , 1 }

m ,

H 4 (·) := DF 4 (DF 3 (DF 2 (DF 1 (·)))).

Clearly, referring to (5), H 0 gives the first probability of using all pseudorandom func-

tions in the construction, and H 4 gives the second probability of using all completely

random functions. By triangle inequality, we know that

∃i

∣P[A

Hi,H− i 1 = 1] − (^) P[A

Hi+1,H i−+1^1 = 1]

∣ > .^ (6)

We now construct an algorithm A

′G(·) of complexity O(tr) that distinguishes whether

the oracle G(·) is FK (·) or a random function R(·).

  • The algorithm A

′ picks i keys K 1 , K 2 ,... , Ki and initialize 4 − i − 1 data struc-

tures Si+2,... , S 4 to ∅ to store pairs.

  • The algorithm A

′ simulates A

O,O−^1

. Whenever A queries O (or O

− 1 ), the sim-

ulating algorithm A

′ uses the four compositions of Feistel permutations, where

  • On the first i layers, run the pseudorandom function F using the i keys

K 1 , K 2 ,... , Ki;

  • On the i-th layer, run an oracle G;

It is clear that Lemma 3 follows Lemma 4 and Lemma 5.

We now prove Lemma 4.

∣P

[S(A) = 1] − P

Π

[A

Π,Π−^1 () = 1]

(^6) P[when simulating S, get answers inconsistent with any permutation]

22 m^

(1 + 2 + · · · + t − 1)

t

2 m

t

2

2 m

We shall prove Lemma 5 next time.