Today we finish the analysis of a construction of a pseudorandom permutation (block cipher) given a pseudorandom function.
1. The Luby-Rackoff Construction
Recall that if F:{0,1}m→{0,1}m is a function, then we define the Feistel permutationDF:{0,1}2m→{0,1}2m associated with F as
DF(x,y):=y,x⊕F(y)(1)
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)
If F=F1,F2,F3,F4 are four functions, then PF is the same as the above construction but using the functions Fi:
PF(x):=DF4(DF3(DF2(DF1(x))))(3)
If A is an oracle algorithm, we define as S(A) the probabilistic process in which we run a simulation of A in which we reply to each query with a random answer.
2. Today’s Proof
The proof of the following result is what was missing from yesterday’s analysis.
Lemma 1For every non-repeating algorithm A of complexity ≤t we have
*
PF[APR,PR−1()=1]−P[S(A)=1]
≤2⋅22mt2+2mt2
*
Proof: The transcript of A‘s computation consists of all the oracle queries made by A. The notation (x,y,0) represents a query to the π oracle at point x while (x,y,1) is a query made to the π−1 oracle at y. The set T consists of all valid transcripts for computations where the output of A is 1 while T′⊂T consists of transcripts in T consistent with π being a permutation.
We write the difference in the probability of A outputting 1 when given oracles (PR,PR−1) and when given a random oracle as in S(A) as a sum over transcripts in T.
The first equality holds as a transcript obtained by running A using the oracle (PR,PR−1) is always consistent with a permutation. The transcript generated by querying an oracle is inconsistent with a permutation iff. points x,y with f(x)=f(y) are queried. S(A) makes at most t queries to an oracle that answers every query with an independently chosen random string from {0,1}2m. The probability of having a repetition is at most (∑i=1t−1i)/22m≤t2/22m+1.
Bounding the sum over transcripts in T′ will require looking into the workings of the construction. Fix a transcript τ∈T′ given by (xi,yi,bi),1≤i≤q, with the number of queries q≤t. Each xi can be written as (Li0,Ri0) for strings Li0,Ri0 of length m corresponding to the left and right parts of xi. The string xi goes through 4 iterations of D using the function Fk,1≤k≤4 for the kth iteration. The output of the construction after iteration k, 0≤k≤4 for input xi is denoted by (Lik,Rik).
Functions F1,F4 are said to be good for the transcript τ if the multisets {R11,R21,⋯,Rq1} and {L13,L23,⋯,Lq3} do not contain any repetitions. We bound the probability of F1 being bad for τ by analyzing what happens when Ri1=Rj1 for some i,j:
Ri1=Li0⊕F1(Ri0)
Rj1=Lj0⊕F1(Rj0)
0=Li0⊕Lj0⊕F1(Ri0)⊕F1(Rj0)(6)
The algorithm A does not repeat queries so we have (Li0,Ri0)=(Lj0,Rj0). We observe that Ri0=Rj0 as equality together with equation (6) above would yield xi=xj. This shows that equation (6) holds only if F1(Rj0)=s⊕F1(Ri0), for a fixed s and distinct strings Ri0 and Rj0. This happens with probability 1/2m as the function F1 takes values from {0,1}m independently and uniformly at random. Applying the union bound for all pairs i,j,
PrF1[∃i,j∈[q],Ri1=Rj1]≤2m+1t2(7)
We use a similar argument to bound the probability of F4 being bad. If Li3=Lj3 for some i,j we would have:
Li3Lj3==Ri4⊕F4(Li4)Rj4⊕F4(Lj4)
0=Ri4⊕Rj4⊕F4(Li4)⊕F4(Lj4)(8)
The algorithm A does not repeat queries so we have (Li4,Ri4)=(Lj4,Rj4). We observe that Li4=Lj4 as equality together with equation (8) above would yield yi=yj. This shows that equation (8) holds only if F4(Lj4)=s′⊕F4(Li4), for a fixed string s′ and distinct strings Li4 and Lj4. This happens with probability 1/2m as the function F4 takes values from {0,1}m independently and uniformly at random. Applying the union bound for all pairs i,j,
PrF1,F4[F1,F4 not good for transcript τ]≤2mt2(10)
Continuing the analysis, we fix good functions F1, F4 and the transcript τ. We will show that the probability of obtaining τ as a transcript in this case is the same as the probability of obtaining τ for a run of S(A). Let τ=(xi,yi,bi),1≤i≤q≤t. We calculate the probability of obtaining yi on query xi over the choice of F2 and F3 .
The values of the input xi are in bijection with pairs (Li1,Ri1) while the values of the output yi are in bijection with pairs (Li3,Ri3), after fixing F1 and F4. We have the relations (from (1)(3)):
These relations imply that (xi,yi) can be an input output pair if and only if we have F2(Ri1),F3(Li3)=(Li3⊕Li1,Ri3⊕Ri1). Since F2 and F3 are random functions with range {0,1}m, the pair (xi,yi) occurs with probability 2−2m. The values Ri1 and Li3,(i∈[q]) are distinct because the functions F1 and F4 are good. This makes the occurrence of (xi,yi) independent from the occurrence of (xj,yj) for i=j. We conclude that the probability of obtaining the transcript τ equals 2−2mq.
The probability of obtaining transcript τ equals 2−2mq in the simulation S(A) as every query is answered by an independent random number from {0,1}2m. Hence,
≤≤≤τ∈T′∑(PF[APR,PR−1()←τ]−P[S(A)←τ])τ∈T′∑PF2,F3[APR,PR−1()←τ∣F1,F4 not good for τ]2mt2τ∈T′∑PF2,F3[APR,PR−1()←τ]2mt2(11)
The statement of the lemma follows by adding equations (5) and (11) and using the triangle inequality. □
This concludes the analysis of the Luby-Rackoff scheme for constructing pseudorandom permutations from a family of pseudorandom functions.