Provable Security 03: PRFs, PRPs, One-Wayness, and Trapdoors
Provable security notes / III
PRFs, PRPs, one-wayness, and trapdoors
Before encryption and signature theorems can be proved, the primitive assumptions have to be stated as games.
Many security proofs reduce a scheme-level attack to an attack on a simpler primitive. The primitive may be a pseudorandom function, a pseudorandom permutation, a one-way function, or a trapdoor one-way permutation. Each has its own game. All families below depend on the security parameter \(\lambda\); security means that every probabilistic polynomial-time adversary has negligible advantage. We suppress \(\lambda\) where it is not needed in the formulas.
PRFs
A pseudorandom function family is a keyed family
\[F:\mathcal K\times D\to R, \qquad F_K(x)=F(K,x),\]that is efficiently computable and whose oracle behavior, for a uniformly sampled key \(K\in\mathcal K\), is computationally indistinguishable from a uniformly sampled function from \(D\) to \(R\).
PRF advantage
For oracle distinguisher \(A\),
\[\operatorname{Adv}^{\mathsf{prf}}_F(A) = \frac12\left|\Pr_K[A^{F_K}=1]-\Pr_{\mathcal R}[A^{\mathcal R}=1]\right|,\]where \(\mathcal R:D\to R\) is a random function, usually simulated by lazy sampling. This matches the success-bias convention used in these notes. Texts that use the doubled convention omit the factor \(1/2\).
A PRF proof often has a standard first move: replace \(F_K\) by \(\mathcal R\). If the adversary notices, it becomes a PRF distinguisher.
PRF security game
- The Challenger \(\mathcal C\) samples \(b\leftarrow\{0,1\}\).
- If \(b=1\), it samples a key \(K\leftarrow\mathcal K\) and prepares oracle \(O(x)=F_K(x)\).
- If \(b=0\), it prepares a lazy random-function oracle \(O(x)=\mathcal R(x)\). Repeated queries receive the same stored answer.
- The Adversary \(\mathcal A^O\) may query any \(x\in D\), adaptively, up to its query budget.
- \(\mathcal A\) outputs \(b'\).
- The game outputs \(1\) if \(b'=b\).
The PRF advantage is the distance between this success probability and random guessing.
PRPs
A pseudorandom permutation family consists of efficiently computable bijections \(P_K:D\to D\) with efficient inverses given \(K\). For a hidden uniform key, its forward oracle is computationally indistinguishable from a uniformly random permutation. A block cipher is commonly analyzed as a PRP family.
For at most \(q\) forward queries, the PRP-PRF switching lemma bounds the difference between a random-permutation experiment and a random-function experiment by \(q(q-1)/(2\vert D\vert )\). Applying the reverse triangle inequality to the success-bias advantages gives
\[\left|\operatorname{Adv}^{\mathsf{prf}}(A;q)-\operatorname{Adv}^{\mathsf{prp}}(A;q)\right| \le \frac{q(q-1)}{4\,|D|}.\]The factor \(1/2\) in our advantage convention accounts for the denominator \(4\). This forward-query bound is the source of birthday terms in many block-cipher mode proofs; inverse-oracle access belongs to the separate strong-PRP game below. See Bellare and Rogaway’s game-playing analysis.
PRP security game
- \(\mathcal C\) samples \(b\leftarrow\{0,1\}\).
- If \(b=1\), it samples \(K\) and answers forward queries by \(P_K(x)\).
- If \(b=0\), it answers by a uniformly random permutation on \(D\), sampled lazily while preserving one-to-one consistency.
- In the stronger PRP game, \(\mathcal A\) may also query an inverse oracle; \(\mathcal C\) must keep forward and inverse tables consistent.
- \(\mathcal A\) outputs \(b'\) and wins if \(b'=b\).
The key detail is consistency. In the random-permutation branch, two distinct inputs must never receive the same output.
One-way functions
Assume that uniform elements of the domain \(D\) can be sampled efficiently. A family of functions \(f:D\to C\) is one-way if evaluation is efficient and every probabilistic polynomial-time inverter has negligible probability of finding a preimage of \(f(x)\) for uniform \(x\in D\). The challenge distribution is induced by sampling \(x\); it need not be uniform on the image of \(f\).
\[\operatorname{Adv}^{\mathsf{ow}}_f(A) =\Pr_{x\leftarrow D,\,A}\left[x'\in D\ \land\ f(x')=f(x)\;:\;x'\leftarrow A(f(x))\right].\]The discrete logarithm map \(x\mapsto g^x\) is a canonical example: evaluation is easy, inversion is assumed hard in appropriate groups.
One-way-function game
- \(\mathcal C\) samples \(x\leftarrow D\).
- It computes \(y=f(x)\) and sends \(y\), together with the public description of \(f\), to \(\mathcal A\).
- \(\mathcal A\) outputs \(x'\).
- \(\mathcal A\) wins if \(x'\in D\) and \(f(x')=y\).
The adversary can evaluate \(f\) itself from its public description. The challenge is inversion of the image of a sampled input.
Trapdoor one-way permutations
A trapdoor one-way permutation has efficient public evaluation and efficient inversion given the secret trapdoor.
\[(pk,td)\leftarrow\mathsf{TrapGen}(1^\lambda), \qquad y=f_{pk}(x).\]The holder of \(td\) can invert every image. Without \(td\), every probabilistic polynomial-time adversary has negligible probability of inverting a uniformly sampled challenge.
Trapdoor one-wayness game
- \(\mathcal C\) runs \((pk,td)\leftarrow\mathsf{TrapGen}(1^\lambda)\).
- It samples \(x\leftarrow D_{pk}\) and computes \(y=f_{pk}(x)\).
- It gives \((pk,y)\) to \(\mathcal A\), but keeps \(td\) secret.
- \(\mathcal A\) outputs \(x'\).
- \(\mathcal A\) wins if \(x'\in D_{pk}\) and \(f_{pk}(x')=y\).
Correctness says the trapdoor holder can invert. Security says the adversary without the trapdoor cannot invert with non-negligible probability.
RSA as primitive
For distinct primes \(p,q\), \(N=pq\), and \(\gcd(e,\varphi(N))=1\),
\[f_{N,e}(x)=x^e\bmod N\]is inverted by \(d=e^{-1}\bmod \varphi(N)\) on \(\mathbb Z_N^*\), and also on all of \(\mathbb Z_N\) by the Chinese remainder theorem. Its one-wayness under the RSA key-generation distribution is the RSA assumption. Encryption and signature constructions combine this permutation with encodings whose security is analyzed in the corresponding games.
Hard bits
For a given one-way family \(f\), a hard-core predicate \(h:D\to\{0,1\}\) is efficiently computable from \(x\), while every probabilistic polynomial-time predictor given \(f(x)\) has success probability at most \(1/2+\operatorname{negl}(\lambda)\) for uniform \(x\). One-wayness alone does not guarantee that a specified input bit is hidden. For example, if \(g\) is one-way, then \(f(x,b)=(g(x),b)\) remains one-way while revealing \(b\).
A hard-core theorem supplies a specific prediction guarantee. For a one-way function \(g\) on bit strings, the Goldreich-Levin construction extends the input by an independent uniform string \(r\) of the same length:
\[f(x,r)=(g(x),r), \qquad h(x,r)=\langle x,r\rangle\bmod2.\]Predicting this inner-product bit with non-negligible bias yields an inverter for \(g\). The theorem concerns the sampled pair \((x,r)\) and the extended function \(f\); it does not assert that an arbitrary coordinate of \(x\) is hidden. See Goldreich and Levin’s theorem.
