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

  1. The Challenger \(\mathcal C\) samples \(b\leftarrow\{0,1\}\).
  2. If \(b=1\), it samples a key \(K\leftarrow\mathcal K\) and prepares oracle \(O(x)=F_K(x)\).
  3. If \(b=0\), it prepares a lazy random-function oracle \(O(x)=\mathcal R(x)\). Repeated queries receive the same stored answer.
  4. The Adversary \(\mathcal A^O\) may query any \(x\in D\), adaptively, up to its query budget.
  5. \(\mathcal A\) outputs \(b'\).
  6. The game outputs \(1\) if \(b'=b\).

The PRF advantage is the distance between this success probability and random guessing.

Challenger \(\mathcal C\)
Adversary \(\mathcal A\)
\(\begin{aligned} b&\leftarrow\{0,1\},\ K\leftarrow\mathcal K,\\ \mathcal O_b(x)&=\begin{cases}F_K(x),& b=1,\\ \mathcal R(x),& b=0.\end{cases}\end{aligned}\)
\(\mathcal O_b\)
\(x_i\leftarrow\mathcal A^{\mathcal O_b}(\mathsf T_{i-1})\)
\(x_i\in D\)
\(y_i:=\mathcal O_b(x_i)\)
\(\mathsf T_i:=\mathsf T_{i-1}\,\|\,((x_i,y_i))\)
\(y_i\in R\)
\(b^{\prime}\leftarrow\mathcal A^{\mathcal O_b}(\mathsf T_q)\)
\(b^{\prime}\)
\(\mathsf{PRF}^{\mathcal A}_F(1^\lambda):=\mathbf 1[b^{\prime}=b]\)

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

  1. \(\mathcal C\) samples \(b\leftarrow\{0,1\}\).
  2. If \(b=1\), it samples \(K\) and answers forward queries by \(P_K(x)\).
  3. If \(b=0\), it answers by a uniformly random permutation on \(D\), sampled lazily while preserving one-to-one consistency.
  4. In the stronger PRP game, \(\mathcal A\) may also query an inverse oracle; \(\mathcal C\) must keep forward and inverse tables consistent.
  5. \(\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.

Challenger \(\mathcal C\)
Adversary \(\mathcal A\)
\(\begin{aligned} b&\leftarrow\{0,1\},\ K\leftarrow\mathcal K,\\ \Pi_b&=\begin{cases}P_K,& b=1,\\ \pi\leftarrow\mathrm{Perm}(D),& b=0.\end{cases}\end{aligned}\)
\((\Pi_b,\Pi_b^{-1})\)
\((s_i,u_i)\leftarrow\mathcal A^{\Pi_b,\Pi_b^{-1}}(\mathsf T_{i-1}),\ s_i\in\{+,-\}\)
\((s_i,u_i)\)
\(v_i:=\begin{cases}\Pi_b(u_i),&s_i=+,\\ \Pi_b^{-1}(u_i),&s_i=-.\end{cases}\)
\(v_i\)
\(b^{\prime}\leftarrow\mathcal A^{\Pi_b,\Pi_b^{-1}}(\mathsf T_q)\)
\(b^{\prime}\)
\(\mathsf{sPRP}^{\mathcal A}_P(1^\lambda):=\mathbf 1[b^{\prime}=b]\)

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

  1. \(\mathcal C\) samples \(x\leftarrow D\).
  2. It computes \(y=f(x)\) and sends \(y\), together with the public description of \(f\), to \(\mathcal A\).
  3. \(\mathcal A\) outputs \(x'\).
  4. \(\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.

Challenger \(\mathcal C\)
Adversary \(\mathcal A\)
\(x\leftarrow D_\lambda,\quad y:=f_\lambda(x)\)
\((f_\lambda,y)\)
\(x^{\prime}\leftarrow\mathcal A(f_\lambda,y)\)
\(x^{\prime}\)
\(\mathsf{OW}^{\mathcal A}_f(1^\lambda):=\mathbf 1[x^{\prime}\in D_\lambda\land f_\lambda(x^{\prime})=y]\)

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

  1. \(\mathcal C\) runs \((pk,td)\leftarrow\mathsf{TrapGen}(1^\lambda)\).
  2. It samples \(x\leftarrow D_{pk}\) and computes \(y=f_{pk}(x)\).
  3. It gives \((pk,y)\) to \(\mathcal A\), but keeps \(td\) secret.
  4. \(\mathcal A\) outputs \(x'\).
  5. \(\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.

Challenger \(\mathcal C\)
Adversary \(\mathcal A\)
\((pk,td)\leftarrow\mathsf{TrapGen}(1^\lambda),\ x\leftarrow D_{pk},\ y:=f_{pk}(x)\)
\((pk,y)\)
\(x^{\prime}\leftarrow\mathcal A(pk,y)\quad(td\not\to\mathcal A)\)
\(x^{\prime}\)
\(\mathsf{TOW}^{\mathcal A}_f(1^\lambda):=\mathbf 1[x^{\prime}\in D_{pk}\land f_{pk}(x^{\prime})=y]\)

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.