Provable security notes / VII

RSA, trapdoor permutations, and OAEP

OAEP combines the RSA permutation with randomized encoding; its CCA proof relies on the encoding structure and the RSA inversion assumption.

The RSA map, on a stated RSA domain such as the unit group \(\mathbb Z_N^*\),

\[f_{N,e}(x)=x^e\bmod N\]

is a permutation when \(N=pq\) for distinct primes \(p,q\) and \(e\) is invertible modulo \(\varphi(N)\). The exponent \(d=e^{-1}\bmod\varphi(N)\) provides efficient inversion. The RSA assumption asserts that inversion is hard without the trapdoor for honestly generated keys and random challenges. RSA-OAEP specifies how to encode bit strings as RSA inputs and how to reject invalid encodings.

Textbook failures

If public-key encryption is simply

\[c=m^e\bmod N,\]

then anyone can test a guessed message by encrypting it. The scheme is not IND-CPA secure.

If signatures are simply

\[\sigma=m^d\bmod N,\]

then multiplying signatures on \(m_1\) and \(m_2\) produces a valid signature on their product:

\[(\sigma_1\sigma_2)^e\equiv m_1m_2\pmod N.\]

When the product message was not previously submitted for signing, this pair is an existential forgery.

These attacks use the public algebraic structure without computing the secret exponent. Encoding must therefore address the encryption or signature game, in addition to preserving inversion hardness.

OAEP structure

The abstract OAEP encoding wraps a permutation with randomness and redundancy. To display the masking structure, suppose \(f\) is a permutation on \(\{0,1\}^{n+k_1+k_0}\), and let

\[G:\{0,1\}^{k_0}\to\{0,1\}^{n+k_1}, \qquad H:\{0,1\}^{n+k_1}\to\{0,1\}^{k_0}.\]

The random-oracle analysis models \(G\) and \(H\) as independent random functions on these domains. For message \(m\in\{0,1\}^n\) and a uniformly sampled seed \(r\in\{0,1\}^{k_0}\),

\[s=(m\,\|\,0^{k_1})\oplus G(r), \qquad t=r\oplus H(s),\]

and the ciphertext is

\[c=f(s\,\|\,t).\]

Decryption computes \(s\,\|\,t=f^{-1}(c)\), recovers \(r=t\oplus H(s)\) and \(m\,\|\,0^{k_1}=s\oplus G(r)\), and checks the final \(k_1\) bits. RSAES-OAEP uses a specified octet encoding, label hash, and mask-generation function rather than treating every bit string as an RSA residue; those details are given in RFC 8017, Section 7.1.

Proof anatomy

In the random oracle model, the simulator maintains lists of \(G\) and \(H\) queries. It searches for candidate encodings consistent with those queries and checks them by public evaluation of \(f\). A candidate that maps to the submitted ciphertext and has valid padding supplies the simulated plaintext. If no candidate is found, the simulator rejects, and the proof bounds the probability of rejecting a ciphertext that real decryption would accept.

The CCA theorem also needs the appropriate assumption on \(f\). Partial-domain one-wayness requires that an efficient adversary given \(f(s\,\|\,t)\) for uniform input \(s\,\|\,t\) cannot recover the designated component \(s\) with non-negligible probability. Fujisaki, Okamoto, Pointcheval, and Stern proved OAEP secure under this assumption and related it to ordinary inversion for RSA. Consequently RSA-OAEP has a random-oracle CCA proof under the RSA assumption; ordinary one-wayness of an arbitrary trapdoor permutation is not the corresponding general theorem. See RSA-OAEP Is Secure under the RSA Assumption.

What OAEP teaches

OAEP’s redundancy and masks let the reduction recognize valid encodings through oracle queries. The proof combines this simulation with the inversion assumption to bound the adversary’s CCA advantage.

Implementation condition

Encryption samples the specified seed distribution. Decryption recovers that seed from the ciphertext, validates lengths and encodings, and returns the prescribed plaintext or rejection result. If timing or error messages reveal which padding check failed, the observable interface contains information absent from the abstract decryption oracle.