Provable Security 04: Encryption Definitions
Provable security notes / IV
Encryption definitions
Encryption security depends on what the adversary may query and what it has to distinguish.
An encryption theorem specifies a security game and the class of adversaries it covers. For a public-key scheme
\[\Pi=(\mathsf{KeyGen},\mathsf{Enc},\mathsf{Dec}),\]correctness is measured by the event \(\mathsf{Dec}_{sk}(\mathsf{Enc}_{pk}(m;r))=m\) for permitted messages and honestly generated keys and coins. Perfect correctness requires this equality for every such choice; correctness with error bounds its failure probability under the stated sampling distribution. Randomized encryption can be perfectly correct.
The Challenger must specify the exact attack interface. The same encryption algorithm can be secure in one game and insecure in another.
IND-CPA
In the IND-CPA game, the adversary receives \(pk\) and chooses equal-length messages \(m_0,m_1\). The challenger samples \(b\leftarrow\{0,1\}\) and returns
\[c^*=\mathsf{Enc}_{pk}(m_b).\]The adversary outputs \(b'\). Its advantage is
\[\operatorname{Adv}^{\mathsf{ind\text{-}cpa}}_\Pi(A) =\left|\Pr[b'=b]-\frac12\right|.\]For public-key encryption, chosen-plaintext access is implicit: anyone can encrypt under \(pk\).
IND-CPA game between \(\mathcal C\) and \(\mathcal A\)
- \(\mathcal C\) runs \((pk,sk)\leftarrow\mathsf{KeyGen}(1^\lambda)\) and sends \(pk\) to \(\mathcal A\).
- \(\mathcal A\) may compute encryptions on its own using \(pk\). In the symmetric-key version, \(\mathcal C\) provides an encryption oracle.
- \(\mathcal A\) submits two equal-length messages \((m_0,m_1)\).
- \(\mathcal C\) samples \(b\leftarrow\{0,1\}\) and returns \(c^*=\mathsf{Enc}_{pk}(m_b)\).
- \(\mathcal A\) may continue any allowed chosen-plaintext activity.
- \(\mathcal A\) outputs \(b'\) and wins if \(b'=b\).
The equal-length condition allows the scheme to reveal message length while requiring it to hide the remaining message content.
IND-CCA1 and IND-CCA2
Chosen-ciphertext security adds a decryption oracle. IND-CCA1 removes this oracle when the challenge is issued. IND-CCA2 retains it but rejects the challenge ciphertext itself, whose decryption would reveal the challenge message directly.
| Notion | Decryption access |
|---|---|
| IND-CCA1 | Before the challenge only. |
| IND-CCA2 | Before and after the challenge, except for \(c^*\). |
IND-CCA2 models an adversary that can obtain decryptions of adaptively chosen ciphertexts even after seeing the challenge. In particular, it may modify the challenge and query the resulting distinct ciphertexts.
IND-CCA2 game between \(\mathcal C\) and \(\mathcal A\)
- \(\mathcal C\) runs \((pk,sk)\leftarrow\mathsf{KeyGen}(1^\lambda)\) and sends \(pk\) to \(\mathcal A\).
- \(\mathcal A\) may query a decryption oracle \(O_{\mathsf{Dec}}(c)=\mathsf{Dec}_{sk}(c)\) before the challenge.
- \(\mathcal A\) submits equal-length messages \((m_0,m_1)\).
- \(\mathcal C\) samples \(b\leftarrow\{0,1\}\) and returns \(c^*=\mathsf{Enc}_{pk}(m_b)\).
- \(\mathcal A\) continues to query \(O_{\mathsf{Dec}}\). On input \(c=c^*\) the oracle returns \(\bot\) without decrypting; on every other input it returns \(\mathsf{Dec}_{sk}(c)\).
- \(\mathcal A\) outputs \(b'\) and wins if \(b'=b\).
IND-CCA1 is the same game except step 5 is removed: no decryption queries are allowed after the challenge.
Malleability kills CCA security
In a cyclic group \(G=\langle g\rangle\) with public key \(h=g^x\) and message \(m\in G\), ElGamal encryption has the form
\[(c_1,c_2)=(g^r,mh^r).\]Choose \(\alpha\in G\setminus\{1\}\). The ciphertext \((c_1,\alpha c_2)\) differs from \((c_1,c_2)\) and decrypts to \(\alpha m\). A CCA2 adversary submits this modified challenge to the decryption oracle and multiplies the answer by \(\alpha^{-1}\) to recover the challenge message. Thus ElGamal fails IND-CCA2, although it is IND-CPA secure under the decisional Diffie-Hellman assumption in \(G\).
Nonce-based symmetric encryption
For fixed-length messages \(M\in\{0,1\}^{\ell}\) and a PRF \(F_K:\mathcal N\to\{0,1\}^{\ell}\) on a nonce space \(\mathcal N\), consider
\[\mathsf{Enc}_K(N,M)=N\,\|\,(M\oplus F_K(N)).\]The challenge uses the same public nonce for either candidate message. A nonce-respecting caller supplies that nonce with the two challenge messages; in a randomized-nonce version, the encryptor samples it independently of the hidden bit.
An IND-CPA proof first replaces \(F_K\) by a random function. Compare this hybrid with a game that uses an independent one-time pad for the challenge: their transcripts can be coupled to agree up to the first reuse of the challenge nonce under the same key. Let \(\mathsf{nonce\ repeat}\) denote any nonce reuse among encryption calls, including the challenge, and measure its probability in the random-function hybrid, denoted \(\mathsf{RF}\). The independent-pad game has success probability \(1/2\), giving
\[\operatorname{Adv}^{\mathsf{ind\text{-}cpa}}_\Pi(A) \le 2\,\operatorname{Adv}^{\mathsf{prf}}_F(B)+\Pr_{\mathsf{RF}}[\mathsf{nonce\ repeat}].\]The factor \(2\) uses the success-bias convention of Part 03. A nonce-respecting adversary never repeats a nonce, so the last term is zero; randomly generated nonces instead require a collision bound. If a nonce is reused, the two masked payloads satisfy
\[C_1\oplus C_2=M_1\oplus M_2.\]Thus nonce reuse reveals a relation between plaintexts that the fresh-mask proof excludes.
Confidentiality is not authenticity
IND-CPA hides plaintexts against chosen-plaintext attacks. IND-CCA2 additionally protects confidentiality against adaptive decryption queries. Ciphertext integrity asks a different question: whether an adversary can produce a new ciphertext that the receiver accepts. Symmetric authenticated encryption provides both confidentiality and integrity. Public-key encryption alone cannot authenticate the sender, since anyone holding the public key can generate a valid ciphertext.
