Today we give a construction of a pseudorandom permutation (block cipher) given a pseudorandom function, and we begin its analysis.
1. Feistel Permutations
Let F:{0,1}m→{0,1}m be a function. We define the Feistel permutationDF:{0,1}2m→{0,1}2m associated with F as
DF(x,y):=y,x⊕F(y)(1)
Note that this is an injective (and hence bijective) function, because its inverse is given by
DF−1(z,w):=F(z)⊕w,z
Also, note that DF and DF−1 are efficiently computable given F.
Unfortunately, it is clear that, even if FK is a pseudorandom function, then DFK does not look like a random permutation: DFK(02m) is zero in half of its bits. (By 02m we mean a sequence of m zeroes.)
Also, even repeating the construction twice does not help. If we pick two random keys K1,K2, and consider the permutation P(x):=DFK2(DFK1(x)), then P does not look like a random permutation: consider P(02m) and P(1m,0m), and notice that the first m bits of the first string are the complement of the first m bits of the second string.
What happens if we repeat the construction three times? We still do not get a pseudorandom permutation.
Exercise 1 (Not Easy)Show that there is an efficient oracle algorithm A such that
*
PΠ:{0,1}2m→{0,1}2m[AΠ,Π−1()=1]=2−Ω(m)
where Π is a random permutation, but for every three functions F1,F2,F3, if we define P(x):=DF3(DF2(DF1(x))) we have
AP,P−1()=1
*
Finally, however, if we repeat the construction four times, with four independent pseudorandom functions, we get a pseudorandom permutation.
2. The Luby-Rackoff Construction
Let F:{0,1}k×{0,1}m→{0,1}m be a pseudorandom function, we define the following function P:{0,1}4k×{0,1}2m→{0,1}2m: given a key K(K1,…,K4) and an input x,
PK(x):=DFK4(DFK3(DFK2(DFK1(x))))(2)
Theorem 1 If F is a (O(tr),ϵ)-secure pseudorandom function computable in time r, then P is a (t,4ϵ+t2⋅2−m+t2⋅2−2m) secure pseudorandom permutation.
3. Analysis of the Luby-Rackoff Construction
Given four random functions R=(R1,…,R4), Ri:{0,1}m→{0,1}m, let PR be the analog of Construction (2) using the random function Ri instead of the pseudorandom functions FKi,
We say that an algorithm A is non-repeating if it never makes an oracle query to which it knows the answer. (That is, if A is interacting with oracles g,g−1 for some permutation g, then A will not ask twice for g(x) for the same x, and it will not ask twice for g−1(y) for the same y; also, after getting the value y=g(x) in an earlier query, it will not ask for g−1(y) later, and after getting w=g−1(z) it will not ask for g(w) later. )
We shall prove Lemma 3 for non-repeating algorithms. The proof can be extended to arbitrary algorithms with some small changes. Alternatively, we can argue that an arbitrary algorithm can be simulated by a non-repeating algorithm of almost the same complexity in such a way that the algorithm and the simulation have the same output given any oracle permutation.
In order to prove Lemma 3 we introduce one more probabilistic experiment: we consider the probabilistic algorithm S(A) that simulates A() and simulates every oracle query by providing a random answer. (Note that the simulated answers in the computation of SA may be incompatible with any permutation.)
We first prove the simple fact that S(A) is close to simulating what really happen when A interacts with a truly random permutation.
Lemma 4Let A be a non-repeating algorithm of complexity at most t. Then
P[S(A)=1]−PΠ[AΠ,Π−1()=1]≤2⋅22mt2
where Π:{0,1}2m→{0,1}2m is a random permutation.
Finally, it remains to prove:
Lemma 5 For every non-repating algorithm A of complexity ≤t we have