Lecture 4. PKE with CCA1 Security


选择密文攻击安全 (Chosen Ciphertext Attack Security, CCA1/CCA2 Security). 对于任意 PPT 敌手 A=(A1,A2)\mathcal{A}=(\mathcal{A}_1,\mathcal{A}_2)

Pr[(pk,sk)Gen(1κ);(s,m0,m1)A1Dec(sk,)(pk);b{0,1},cEnc(pk,mb);bA2Decc(sk,)(s,c):b=b]=12±negl(κ)\begin{aligned}\text{Pr}\left[\begin{matrix}(pk,sk)\leftarrow\text{Gen}(1^\kappa);(s,m_0,m_1)\leftarrow\mathcal{A}_1^{\color{red}\text{Dec}(sk,\cdot)}(pk);\\b\leftarrow \{0,1\},c^*\leftarrow\text{Enc}(pk,m_b);b'\leftarrow\mathcal{A}_2^{\color{red}\text{Dec}_{\ne c^*}(sk,\cdot)}(s,c)\end{matrix}:b'=b\right]=\frac{1}{2}\pm\text{negl}(\kappa)\end{aligned}

对于 CCA1 Security,敌手在 A2\mathcal{A}_2 中不能访问 Dec Oracle,不能与挑战者 C\mathcal{C} 进行交互查询。

CCA1/CCA2 Game.

CA(pk,sk)Gen(1κ)pkcdec. queries c (Decryption Phase I)m/Dec(sk,c)m/cchoose m0,m1 (Challenge Phase)b{0,1}cEnc(pk,mb)cc(cc)dec. queries c (Decryption Phase II)m/Dec(sk,c)m/A wins iff b=bbcompute b (Guessing Phase)\color{darkblue}\begin{matrix}\mathcal{C}& &\mathcal{A}\\(pk,sk)\leftarrow\text{Gen}(1^\kappa) & \stackrel{pk}{\longrightarrow}&\\ & \color{red}\stackrel{c}{\longleftarrow} &\color{red}\text{dec. queries } c \text{ (Decryption Phase I)}\\\color{red}m/\perp \leftarrow\text{Dec}(sk,c) & \color{red}\stackrel{m/\perp}{\longrightarrow}&\\ & \stackrel{c}{\longleftarrow} &\text{choose } m_0,m_1\text{ (Challenge Phase)} \\ b\leftarrow\{0,1\}\\c^*\leftarrow\text{Enc}(pk,m_b) & \stackrel{c^*}{\rightarrow}\\ & \color{red}\stackrel{c(c\ne c^*)}{\longleftarrow} &\color{red}\text{dec. queries } c \text{ (Decryption Phase II)}\\\color{red}m/\perp \leftarrow\text{Dec}(sk,c) & \color{red}\stackrel{m/\perp}{\longrightarrow}&\\ \mathcal{A}\text{ wins iff }b'=b & \stackrel{b'}{\longleftarrow} & \text{compute }b'\text{ (Guessing Phase)}\end{matrix}

类似地,定义 bb 实验 ExpPKE,ACCA1/CCA2b(κ)\textbf{Exp}_{\text{PKE},\mathcal{A}}^{\text{CCA1/CCA2}-b}(\kappa):

CA(pk,sk)Gen(1κ)pkcdec. queries cm/Dec(sk,c)m/cchoose m0,m1cEnc(pk,mb)cc(cc)dec. queries cm/Dec(sk,c)m/return bbcompute b\color{darkblue}\begin{matrix}\mathcal{C}& &\mathcal{A}\\(pk,sk)\leftarrow\text{Gen}(1^\kappa) & \stackrel{pk}{\longrightarrow}&\\ & \color{red}\stackrel{c}{\longleftarrow} &\color{red}\text{dec. queries } c\\\color{red}m/\perp \leftarrow\text{Dec}(sk,c) & \color{red}\stackrel{m/\perp}{\longrightarrow}&\\ & \stackrel{c}{\longleftarrow} &\text{choose } m_0,m_1 \\c^*\leftarrow\text{Enc}(pk,m_b) & \stackrel{c^*}{\rightarrow}\\ & \color{red}\stackrel{c(c\ne c^*)}{\longleftarrow} &\color{red}\text{dec. queries } c \\\color{red}m/\perp \leftarrow\text{Dec}(sk,c) & \color{red}\stackrel{m/\perp}{\longrightarrow}&\\ \text{return }b' & \stackrel{b'}{\longleftarrow} & \text{compute }b'\end{matrix}

那么,CCA1 也可以定义为:

AdvPKE,ACCA1/CCA2(κ)=Pr[ExpPKE,ACCA1/CCA21(κ)=1]Pr[ExpPKE,ACCA1/CCA20(κ)=1]\begin{aligned}\textbf{Adv}_{\text{PKE},\mathcal{A}}^\text{CCA1/CCA2}(\kappa)=\left|\text{Pr}[\textbf{Exp}_{\text{PKE},\mathcal{A}}^{\text{CCA1/CCA2}-1}(\kappa)=1]-\text{Pr}[\textbf{Exp}_{\text{PKE},\mathcal{A}}^{\text{CCA1/CCA2}-0}(\kappa)=1]\right|\end{aligned}

交互式证明系统 (Interactive Proof, IP) 对语言 LL

💡
PNPIP=PSPACE\text{P}\subseteq \text{NP}\subseteq\text{IP}=\text{PSPACE}.

非交互式零知识证明系统 (Non-Interactive Zero-Knowledge, NIZK) (P,V)(P,V). 对 LNPL\in\text{NP}


自适应非交互式零知识证明系统 (adaptive NIZK, aNIZK). (P,V)(P,V). 对 LNPL\in\text{NP}


具有 CCA1 安全的 PKE: Noar-Yung 构造. 通过一个 CPA 安全的 PKE 和一个 aNIZK (P,V)(P,V) 构造一个具有 CCA1 安全的 PKE’ (NY-PKE)。主要思想:两把钥匙

正确性. 由 aNIZK 的完备性 和 CPA 安全的 PKE 本身保证。

💡
Theorem. 使用 Noar-Yung 构造的 PKE’ 具有 CCA1 安全。

【证明】

Game 0. 即 ExpPKE,ACCA1-0(κ)\textbf{Exp}_{\text{PKE}',\mathcal{A}}^{\text{CCA1-0}}(\kappa)。在游戏中我们对 Noar-Yung 构造进行了展开(小字体)。

CA(pk,sk)Gen(1κ)pkr{0,1}poly(κ);(pk1,sk1)Gen(1κ);(pk2,sk2)Gen(1κ);pk:=(pk1,pk2,r);sk:=sk1c=(c1,c2,π)decryption queriesm/Dec(sk,c)m/if V(r,(c1,c2),π)=0,m:=else,mDec(sk1,c1)(m0,m1)choose m0,m1cEnc(pk,m0;w)c=(c1,c2,π)c1Enc(pk1,m0;w1);c2Enc(pk2,m0;w2);πP(r,(c1,c2),(m0,w1,w2))return bbcompute b\color{darkblue}\begin{matrix}\mathcal{C}& &\mathcal{A}\\ (pk,sk)\leftarrow\text{Gen}'(1^\kappa) & \stackrel{pk}{\longrightarrow}\\ \scriptsize r \leftarrow \{0,1\}^{\text{poly}(\kappa)};\\ \scriptsize (pk_1,sk_1)\leftarrow\text{Gen}(1^\kappa);\\ \scriptsize (pk_2,sk_2)\leftarrow\text{Gen}(1^\kappa);\\\scriptsize pk:=(pk_1,pk_2,r);sk:=sk_1 \\ & \stackrel{c=(c_1,c_2,\pi)}{\longleftarrow}& \text{decryption queries}\\ m/\perp\leftarrow\text{Dec}'(sk,c) & \stackrel{m/\perp}{\longrightarrow}\\ \scriptsize \text{if } V(r,(c_1,c_2),\pi)=0, \quad m:=\perp \\\scriptsize \text{else,}\quad m\leftarrow \text{Dec}(sk_1,c_1) \\ & \stackrel{(m_0,m_1)}{\longleftarrow}& \text{choose }m_0,m_1\\ c^*\leftarrow \text{Enc}'(pk,m_0;w^*)& \stackrel{c^*=(c_1^*,c_2^*,\pi^*)}{\longrightarrow}& \\ \scriptsize c_1^*\leftarrow \text{Enc}(pk_1,m_0;w_1^*);\\ \scriptsize c_2^*\leftarrow \text{Enc}(pk_2,m_0;w_2^*);\\\scriptsize\pi^*\leftarrow P(r,(c_1^*,c_2^*),(m_0,w_1^*,w_2^*))\\ \text{return }b' & \stackrel{b'}{\longleftarrow} & \text{compute }b'\end{matrix}

Game 1. 修改 Game 0 中的 Gen\text{Gen}'Enc\text{Enc}',使用仿真器 Sim\text{Sim}

CA(pk,sk)Gen(1κ)pkrSim1(1κ);(pk1,sk1)Gen(1κ);(pk2,sk2)Gen(1κ);pk:=(pk1,pk2,r);sk:=sk1c=(c1,c2,π)decryption queriesm/Dec(sk,c)m/if V(r,(c1,c2),π)=0,m:=else,mDec(sk1,c1)(m0,m1)choose m0,m1cEnc(pk,m0;w)c=(c1,c2,π)c1Enc(pk1,m0;w1);c2Enc(pk2,m0;w2);πSim2(r,(c1,c2))return bbcompute b\color{darkblue}\begin{matrix}\mathcal{C}& &\mathcal{A}\\ (pk,sk)\leftarrow\text{Gen}'(1^\kappa) & \stackrel{pk}{\longrightarrow}\\ \color{red}\scriptsize r \leftarrow \text{Sim}_1(1^\kappa);\\\scriptsize (pk_1,sk_1)\leftarrow\text{Gen}(1^\kappa);\\ \scriptsize (pk_2,sk_2)\leftarrow\text{Gen}(1^\kappa);\\ \scriptsize pk:=(pk_1,pk_2,r);sk:=sk_1 \\ & \stackrel{c=(c_1,c_2,\pi)}{\longleftarrow}& \text{decryption queries}\\ m/\perp\leftarrow\text{Dec}'(sk,c) & \stackrel{m/\perp}{\longrightarrow}\\ \scriptsize \text{if } V(r,(c_1,c_2),\pi)=0, \quad m:=\perp \\\scriptsize \text{else,}\quad m\leftarrow \text{Dec}(sk_1,c_1) \\ & \stackrel{(m_0,m_1)}{\longleftarrow}& \text{choose }m_0,m_1\\ c^*\leftarrow \text{Enc}'(pk,m_0;w^*)& \stackrel{c^*=(c_1^*,c_2^*,\pi^*)}{\longrightarrow}& \\ \scriptsize c_1^*\leftarrow \text{Enc}(pk_1,m_0;w_1^*);\\ \scriptsize c_2^*\leftarrow \text{Enc}(pk_2,m_0;w_2^*);\\\color{red}\scriptsize\pi^*\leftarrow \text{Sim}_2(r,(c_1^*,c_2^*))\\ \text{return }b' & \stackrel{b'}{\longleftarrow} & \text{compute }b'\end{matrix}

接下来,我们假设敌手 A\mathcal{A} 拥有区分 Game 0Game 1 的能力(返回 1 的概率不可忽略的不同),我们运用其打破 aNIZK 的 Zero-Knowledge 性质。

CA/CAb{0,1}r0{0,1}poly(κ)r1Sim1(1κ)r:=rbr(pk1,sk1)Gen(1κ);(pk2,sk2)Gen(1κ);pk:=(pk1,pk2,r);sk:=sk1pkc=(c1,c2,π)cm/Dec(sk,c)m/c1Enc(pk1,m0;w1)(m0,m1)m0,m1π0P(r,(c1,c2),(m0,w1,w2))w1,2,c1,2,m0c2Enc(pk2,m0;w2)π1Sim2(r,(c1,c2))ππbπc:=(c1,c2,π)cbbb\color{darkblue}\begin{matrix}\mathcal{C}'& &\mathcal{A}'/\mathcal{C} & & \mathcal{A}\\ b\leftarrow \{0,1\} \\\tiny r_0\leftarrow \{0,1\}^{\text{poly}(\kappa)}\\\tiny r_1\leftarrow\text{Sim}_1(1^\kappa)\\r:=r_b & \stackrel{r}{\longrightarrow} & (pk_1,sk_1)\leftarrow\text{Gen}(1^\kappa);\\ & &(pk_2,sk_2)\leftarrow\text{Gen}(1^\kappa);\\ & & pk:=(pk_1,pk_2,r);\\ & &sk:=sk_1& \stackrel{pk}{\longrightarrow}\\ & & & \stackrel{c=(c_1,c_2,\pi)}{\longleftarrow}& c \\ & & m/\perp\leftarrow\text{Dec}'(sk,c) & \stackrel{m/\perp}{\longrightarrow} \\ & &c_1^*\leftarrow\text{Enc}(pk_1,m_0;w_1^*) & \stackrel{(m_0,m_1)}{\longleftarrow}& m_0,m_1\\ \tiny \pi^*_0\leftarrow P(r,(c_1^*,c_2^*),(m_0,w_1^*,w_2^*))&\stackrel{w_{1,2}^*,c_{1,2}^*,m_0}{\longleftarrow}&c_2^*\leftarrow\text{Enc}(pk_2,m_0;w_2^*)\\ \tiny\pi^*_1\leftarrow\text{Sim}_2(r,(c_1^*,c_2^*))\\\pi^*\leftarrow \pi_b^*&\stackrel{\pi^*}{\longrightarrow} & c^*:=(c_1,c_2,\pi^*) &\stackrel{c^*}{\longrightarrow} \\ &\stackrel{b'}{\leftarrow} & & \stackrel{b'}{\leftarrow}& b'\end{matrix}

于是,

Pr[Game 1=1]Pr[Game 0=1]= Pr[b=1b=0]Pr[b=1b=1]= AdvaNIZK,AZK(κ) AdvaNIZKZK(κ)\begin{aligned}&\left|\text{Pr}[\textbf{Game 1}=1]-\text{Pr}[\textbf{Game 0}=1]\right|\\ =\ &\left|\text{Pr}[b'=1|b=0]-\text{Pr}[b'=1|b=1]\right|\\=\ & \textbf{Adv}_{\text{aNIZK},\mathcal{A}'}^\text{ZK}(\kappa)\\ \leq \ &\textbf{Adv}_\text{aNIZK}^\text{ZK}(\kappa)\end{aligned}

Game 2. 修改 Game 1 中的 c2c_2^*,加密 m1m_1

  • 我们要逐渐把 m0m_0 改成 m1m_1,因此这里我们先改变一个。
CA(pk,sk)Gen(1κ)pkrSim1(1κ);(pk1,sk1)Gen(1κ);(pk2,sk2)Gen(1κ);pk:=(pk1,pk2,r);sk:=sk1c=(c1,c2,π)decryption queriesm/Dec(sk,c)m/if V(r,(c1,c2),π)=0,m:=else,mDec(sk1,c1)(m0,m1)choose m0,m1cEnc(pk,m0/m1;w)c=(c1,c2,π)c1Enc(pk1,m0;w1);c2Enc(pk2,m1;w2);πSim2(r,(c1,c2))return bbcompute b\color{darkblue}\begin{matrix}\mathcal{C}& &\mathcal{A}\\ (pk,sk)\leftarrow\text{Gen}'(1^\kappa) & \stackrel{pk}{\longrightarrow}\\ \scriptsize r \leftarrow \text{Sim}_1(1^\kappa);\\ \scriptsize (pk_1,sk_1)\leftarrow\text{Gen}(1^\kappa);\\ \scriptsize (pk_2,sk_2)\leftarrow\text{Gen}(1^\kappa);\\\scriptsize pk:=(pk_1,pk_2,r);sk:=sk_1 \\ & \stackrel{c=(c_1,c_2,\pi)}{\longleftarrow}& \text{decryption queries}\\ m/\perp\leftarrow\text{Dec}'(sk,c) & \stackrel{m/\perp}{\longrightarrow}\\ \scriptsize \text{if } V(r,(c_1,c_2),\pi)=0, \quad m:=\perp \\\scriptsize \text{else,}\quad m\leftarrow \text{Dec}(sk_1,c_1) \\ & \stackrel{(m_0,m_1)}{\longleftarrow}& \text{choose }m_0,m_1\\ c^*\leftarrow \text{Enc}'(pk,m_0/m_1;w^*)& \stackrel{c^*=(c_1^*,c_2^*,\pi^*)}{\longrightarrow}& \\ \scriptsize c_1^*\leftarrow \text{Enc}(pk_1,m_0;w_1^*);\\ \scriptsize c_2^*\leftarrow \text{Enc}(pk_2,{\color{red}m_1};w_2^*);\\\scriptsize\pi^*\leftarrow \text{Sim}_2(r,(c_1^*,c_2^*))\\ \text{return }b' & \stackrel{b'}{\longleftarrow} & \text{compute }b'\end{matrix}

如果存在敌手 A\mathcal{A} 拥有区分 Game 1Game 2 的能力(返回 1 的概率不可忽略的不同),那么我们可以利用其打破 PKE 的 CPA 安全性(挑战者接手 (pk2,sk2)(pk_2,sk_2) 这对公私钥,中间敌手模拟 (pk1,sk1)(pk_1,sk_1) 这对公私钥的结果,给敌手 A\mathcal{A} 创造环境,即可打破 CPA 安全性),即

CA/CAb{0,1}pk2,sk2)Gen(1κ)pk1(pk1,sk1)Gen(1κ)rSim1(1κ)pkpk:=(pk1,pk2)sk:=sk1c=(c1,c2,π)cm/Dec(sk,c)m/(m0,m1)c1Enc(pk1,m0;w1)(m0,m1)m0,m1c2Enc(pk2,mb;w2)c2πSim2(r,(c1,c2))c=(c1,c2,π)bbb\color{darkblue}\begin{matrix}\mathcal{C}'& &\mathcal{A}'/\mathcal{C} & & \mathcal{A}\\ b\leftarrow\{0,1\}\\(pk_2,sk_2)\leftarrow\text{Gen}(1^\kappa) &\stackrel{pk_1}{\longrightarrow} & (pk_1,sk_1)\leftarrow\text{Gen}(1^\kappa)\\ & & r\leftarrow\text{Sim}_1(1^\kappa) & \stackrel{pk}{\longrightarrow}\\ & & \scriptsize pk:=(pk_1,pk_2)\\ & & \scriptsize sk:=sk_1\\ & & &\stackrel{c=(c_1,c_2,\pi)}{\longleftarrow} & c\\& & m/\perp\leftarrow\text{Dec}'(sk,c) & \stackrel{m/\perp}{\longrightarrow} \\ &\stackrel{(m_0,m_1)}{\longleftarrow} & c_1^*\leftarrow\text{Enc}(pk_1,m_0;w_1^*)&\stackrel{(m_0,m_1)}{\longleftarrow} & m_0,m_1\\ c_2^*\leftarrow\text{Enc}(pk_2,m_b;w_2^*) & \stackrel{c_2^*}{\longrightarrow}& \pi^*\leftarrow\text{Sim}_2(r,(c_1^*,c_2^*)) & \stackrel{c^*=(c_1^*,c_2^*,\pi^*)}{\longrightarrow} \\ &\stackrel{b'}{\longleftarrow} & & \stackrel{b'}{\longleftarrow} & b'\end{matrix}

b=0b=0 时,模拟的即为 Game 1;当 b=1b=1 时,模拟的是 Game 2。因此,

Pr[Game 2=1]Pr[Game 1=1]= Pr[b=1b=1]Pr[b=1b=0]= AdvPKE,ACPA(κ) AdvPKECPA(κ)\begin{aligned}&\left|\text{Pr}[\textbf{Game 2}=1]-\text{Pr}[\textbf{Game 1}=1]\right|\\ =\ &\left|\text{Pr}[b'=1|b=1]-\text{Pr}[b'=1|b=0]\right|\\=\ & \textbf{Adv}_{\text{PKE},\mathcal{A}'}^\text{CPA}(\kappa)\\ \leq \ &\textbf{Adv}_\text{PKE}^\text{CPA}(\kappa)\end{aligned}

Game 3. 交换 Game 2 中的密钥,使用 sk2sk_2

  • 我们想要说明,换钥匙对敌手来说是看不出来的。
CA(pk,sk)Gen(1κ)pkrSim1(1κ);(pk1,sk1)Gen(1κ);(pk2,sk2)Gen(1κ);pk:=(pk1,pk2,r);sk:=sk2c=(c1,c2,π)decryption queriesm/Dec(sk,c)m/if V(r,(c1,c2),π)=0,m:=else,mDec(sk2,c2)(m0,m1)choose m0,m1cEnc(pk,m0/m1;w)c=(c1,c2,π)c1Enc(pk1,m0;w1);c2Enc(pk2,m1;w2);πSim2(r,(c1,c2))return bbcompute b\color{darkblue}\begin{matrix}\mathcal{C}& &\mathcal{A}\\ (pk,sk)\leftarrow\text{Gen}'(1^\kappa) & \stackrel{pk}{\longrightarrow}\\ \scriptsize r \leftarrow \text{Sim}_1(1^\kappa);\\ \scriptsize (pk_1,sk_1)\leftarrow\text{Gen}(1^\kappa);\\ \scriptsize (pk_2,sk_2)\leftarrow\text{Gen}(1^\kappa);\\\scriptsize pk:=(pk_1,pk_2,r);{\color{red}sk:=sk_2} \\ & \stackrel{c=(c_1,c_2,\pi)}{\longleftarrow}& \text{decryption queries}\\ m/\perp\leftarrow\text{Dec}'(sk,c) & \stackrel{m/\perp}{\longrightarrow}\\ \scriptsize \text{if } V(r,(c_1,c_2),\pi)=0, \quad m:=\perp \\\scriptsize \text{else,}\quad m\leftarrow \text{Dec}({\color{red}sk_2,c_2}) \\ & \stackrel{(m_0,m_1)}{\longleftarrow}& \text{choose }m_0,m_1\\ c^*\leftarrow \text{Enc}'(pk,m_0/m_1;w^*)& \stackrel{c^*=(c_1^*,c_2^*,\pi^*)}{\longrightarrow}& \\ \scriptsize c_1^*\leftarrow \text{Enc}(pk_1,m_0;w_1^*);\\ \scriptsize c_2^*\leftarrow \text{Enc}(pk_2,m_1;w_2^*);\\\scriptsize\pi^*\leftarrow \text{Sim}_2(r,(c_1^*,c_2^*))\\ \text{return }b' & \stackrel{b'}{\longleftarrow} & \text{compute }b'\end{matrix}

定义 Fakei\text{Fake}_i 表示 Game ii 中,敌手 A\mathcal{A} 提交了 (c1,c2,π)(c_1,c_2,\pi),该密文通过了 Verifier VV 的检测,但是用两把私钥解出来的结果不同;也就是说 (c1,c2)(c_1,c_2) 不在语言里,Verifier VV 却输出了 1 的情况;即

(Dec(sk1,c1)Dec(sk2,c2))(V(r,(c1,c2),π)=1)(\text{Dec}(sk_1,c_1)\ne\text{Dec}(sk_2,c_2))\wedge (V(r,(c_1,c_2),\pi)=1)

如果这个事件不发生(也就是说,不存在通过了 Verifier VV 的检测,但是用两把私钥解出来的结果不同的情况),那么 Game 2 和 Game 3 就完全一样,即 (Game 3=1¬Fake3)=(Game 2=1¬Fake2)(\textbf{Game 3}=1|\neg\text{Fake}_3)=(\textbf{Game 2}=1|\neg\text{Fake}_2).

🔑
Shoup, Difference Lemma. 设有事件 A,B,CA,B,C,且 Pr[A¬C]=Pr[B¬C]\text{Pr}[A|\neg C]=\text{Pr}[B|\neg C],那么 Pr[A]Pr[B]Pr[C]|\text{Pr}[A]-\text{Pr}[B]|\leq\text{Pr}[C]

【证明】

Pr[A]Pr[B]=Pr[AC]+Pr[A¬C]Pr[BC]Pr[B¬C]=Pr[AC]Pr[BC]=Pr[AC]Pr[C]Pr[BC]Pr[C]=Pr[C](Pr[AC]Pr[BC])Pr[C]Pr[AC]Pr[BC]Pr[C]\small\begin{aligned}|\text{Pr}[A]-\text{Pr}[B]| &= |\text{Pr}[A\wedge C]+\text{Pr}[A\wedge\neg C]-\text{Pr}[B\wedge C]-\text{Pr}[B\wedge\neg C]| \\&=|\text{Pr}[A\wedge C]-\text{Pr}[B\wedge C]|\\&=|\text{Pr}[A|C]\text{Pr}[C]-\text{Pr}[B|C]\text{Pr}[C]| \\ &=|\text{Pr}[C](\text{Pr}[A|C]-\text{Pr}[B|C])|\\ &\leq |\text{Pr}[C]|\cdot |\text{Pr}[A|C]-\text{Pr}[B|C]| \\ &\leq \text{Pr}[C]\end{aligned}

【推论】设有事件 A,B,A,BA,B,A',B',且 Pr[A¬A]=Pr[B¬B]\text{Pr}[A|\neg A']=\text{Pr}[B|\neg B']Pr[A]=Pr[B]=p\text{Pr}[A']=\text{Pr}[B']=p,那么 Pr[A]Pr[B]c|\text{Pr}[A]-\text{Pr}[B]| \leq c。(证明方法和上面完全相同)

那么,我们知道,对于 Game 2 Game 3 来说,Fake 事件发生的概率完全一样(因为只是换了两个一模一样的加密方法的钥匙,从敌手层面完全看不出来区别),即 Pr[Fake2]=Pr[Fake3]\text{Pr}[\text{Fake}_2]=\text{Pr}[\text{Fake}_3],那么根据上述 lemma 的推论,我们知道

Pr[Game 3=1]Pr[Game 2=1]Pr[Fake2]=Pr[Fake3]|\text{Pr}[\textbf{Game 3}=1]-\text{Pr}[\textbf{Game 2}=1]|\leq \text{Pr}[\text{Fake}_2]=\text{Pr}[\text{Fake}_3]

对于 Game 2 Game 1 来说,因为 Fake 事件发生在第一阶段 (Decryption Phase I),而这两个游戏的第一阶段完全一样,因此

Pr[Fake2]=Pr[Fake1]\text{Pr}[\text{Fake}_2]=\text{Pr}[\text{Fake}_1]

对于 Game 1 Game 0 来说,两个游戏的第一阶段的区别就是把 CRS 生成器换成了仿真的生成器,因此 Fake 事件发生的概率之差由 adaptive zero-knowledge 性质保证,即

Pr[Fake1]Pr[Fake0]AdvaNIZKZK(κ)|\text{Pr}[\text{Fake}_1]-\text{Pr}[\text{Fake}_0]|\leq\textbf{Adv}_\text{aNIZK}^\text{ZK}(\kappa)

对于 Game 0 来说,Fake 事件发生的概率由 adaptive soundness 性质保证,即

Pr[Fake0]AdvaNIZKsound(κ)\text{Pr}[\text{Fake}_0]\leq\textbf{Adv}_\text{aNIZK}^\text{sound}(\kappa)

综上,

Pr[Game 3=1]Pr[Game 2=1]Pr[Fake2]=Pr[Fake1]Pr[Fake0]+Pr[Fake1]Pr[Fake0]AdvaNIZKZK(κ)+AdvaNIZKsound(κ)\begin{aligned}|\text{Pr}[\textbf{Game 3}=1]-\text{Pr}[\textbf{Game 2}=1]| &\leq \text{Pr}[\text{Fake}_2] \\ &= \text{Pr}[\text{Fake}_1] \\ &\leq \text{Pr}[\text{Fake}_0]+|\text{Pr}[\text{Fake}_1]-\text{Pr}[\text{Fake}_0]| \\ &\leq \textbf{Adv}_\text{aNIZK}^\text{ZK}(\kappa) + \textbf{Adv}_\text{aNIZK}^\text{sound}(\kappa)\end{aligned}

Game 4. 类似 Game 2,把另一个 m0m_0 改成 m1m_1

CA(pk,sk)Gen(1κ)pkrSim1(1κ);(pk1,sk1)Gen(1κ);(pk2,sk2)Gen(1κ);pk:=(pk1,pk2,r);sk:=sk2c=(c1,c2,π)decryption queriesm/Dec(sk,c)m/if V(r,(c1,c2),π)=0,m:=else,mDec(sk2,c2)(m0,m1)choose m0,m1cEnc(pk,m1;w)c=(c1,c2,π)c1Enc(pk1,m1;w1);c2Enc(pk2,m1;w2);πSim2(r,(c1,c2))return bbcompute b\color{darkblue}\begin{matrix}\mathcal{C}& &\mathcal{A}\\ (pk,sk)\leftarrow\text{Gen}'(1^\kappa) & \stackrel{pk}{\longrightarrow}\\ \scriptsize r \leftarrow \text{Sim}_1(1^\kappa);\\ \scriptsize (pk_1,sk_1)\leftarrow\text{Gen}(1^\kappa);\\ \scriptsize (pk_2,sk_2)\leftarrow\text{Gen}(1^\kappa);\\\scriptsize pk:=(pk_1,pk_2,r);sk:=sk_2 \\ & \stackrel{c=(c_1,c_2,\pi)}{\longleftarrow}& \text{decryption queries}\\ m/\perp\leftarrow\text{Dec}'(sk,c) & \stackrel{m/\perp}{\longrightarrow}\\ \scriptsize \text{if } V(r,(c_1,c_2),\pi)=0, \quad m:=\perp \\\scriptsize \text{else,}\quad m\leftarrow \text{Dec}(sk_2,c_2) \\ & \stackrel{(m_0,m_1)}{\longleftarrow}& \text{choose }m_0,m_1\\ c^*\leftarrow \text{Enc}'(pk,m_1;w^*)& \stackrel{c^*=(c_1^*,c_2^*,\pi^*)}{\longrightarrow}& \\ \scriptsize c_1^*\leftarrow \text{Enc}(pk_1,{\color{red}m_1};w_1^*);\\ \scriptsize c_2^*\leftarrow \text{Enc}(pk_2,m_1;w_2^*);\\\scriptsize\pi^*\leftarrow \text{Sim}_2(r,(c_1^*,c_2^*))\\ \text{return }b' & \stackrel{b'}{\longleftarrow} & \text{compute }b'\end{matrix}

类似从 Game 1 Game 2 的推导,有

Pr[Game 4=1]Pr[Game 3=1]AdvPKECPA(κ)\begin{aligned}&\left|\text{Pr}[\textbf{Game 4}=1]-\text{Pr}[\textbf{Game 3}=1]\right|\leq \textbf{Adv}_\text{PKE}^\text{CPA}(\kappa)\end{aligned}

Game 5. 类似 Game 1 的逆操作,将仿真器变回原始情况。

CA(pk,sk)Gen(1κ)pkr{0,1}poly(κ);(pk1,sk1)Gen(1κ);(pk2,sk2)Gen(1κ);pk:=(pk1,pk2,r);sk:=sk2c=(c1,c2,π)decryption queriesm/Dec(sk,c)m/if V(r,(c1,c2),π)=0,m:=else,mDec(sk2,c2)(m0,m1)choose m0,m1cEnc(pk,m1;w)c=(c1,c2,π)c1Enc(pk1,m1;w1);c2Enc(pk2,m1;w2);πP(r,(c1,c2),(m1,w1,w2))return bbcompute b\color{darkblue}\begin{matrix}\mathcal{C}& &\mathcal{A}\\ (pk,sk)\leftarrow\text{Gen}'(1^\kappa) & \stackrel{pk}{\longrightarrow}\\ \color{red}\scriptsize r \leftarrow \{0,1\}^{\text{poly}(\kappa)};\\ \scriptsize (pk_1,sk_1)\leftarrow\text{Gen}(1^\kappa);\\ \scriptsize (pk_2,sk_2)\leftarrow\text{Gen}(1^\kappa);\\\scriptsize pk:=(pk_1,pk_2,r);sk:=sk_2 \\ & \stackrel{c=(c_1,c_2,\pi)}{\longleftarrow}& \text{decryption queries}\\ m/\perp\leftarrow\text{Dec}'(sk,c) & \stackrel{m/\perp}{\longrightarrow}\\ \scriptsize \text{if } V(r,(c_1,c_2),\pi)=0, \quad m:=\perp \\\scriptsize \text{else,}\quad m\leftarrow \text{Dec}(sk_2,c_2) \\ & \stackrel{(m_0,m_1)}{\longleftarrow}& \text{choose }m_0,m_1\\ c^*\leftarrow \text{Enc}'(pk,m_1;w^*)& \stackrel{c^*=(c_1^*,c_2^*,\pi^*)}{\longrightarrow}& \\ \scriptsize c_1^*\leftarrow \text{Enc}(pk_1,m_1;w_1^*);\\ \scriptsize c_2^*\leftarrow \text{Enc}(pk_2,m_1;w_2^*);\\\color{red}\scriptsize\pi^*\leftarrow P(r,(c_1^*,c_2^*),(m_1,w_1^*,w_2^*))\\ \text{return }b' & \stackrel{b'}{\longleftarrow} & \text{compute }b'\end{matrix}

类似从 Game 0 Game 1 的推导,有

Pr[Game 5=1]Pr[Game 4=1]AdvaNIZKZK(κ)\begin{aligned}&\left|\text{Pr}[\textbf{Game 5}=1]-\text{Pr}[\textbf{Game 4}=1]\right|\leq \textbf{Adv}_\text{aNIZK}^\text{ZK}(\kappa)\end{aligned}

Game 6. 交换 Game 5 中的密钥,用回 sk1sk_1;即为 ExpPKE,ACCA1-1(κ)\textbf{Exp}_{\text{PKE}',\mathcal{A}}^{\text{CCA1-1}}(\kappa)

CA(pk,sk)Gen(1κ)pkr{0,1}poly(κ);(pk1,sk1)Gen(1κ);(pk2,sk2)Gen(1κ);pk:=(pk1,pk2,r);sk:=sk1c=(c1,c2,π)decryption queriesm/Dec(sk,c)m/if V(r,(c1,c2),π)=0,m:=else,mDec(sk1,c1)(m0,m1)choose m0,m1cEnc(pk,m1;w)c=(c1,c2,π)c1Enc(pk1,m1;w1);c2Enc(pk2,m1;w2);πP(r,(c1,c2),(m1,w1,w2))return bbcompute b\color{darkblue}\begin{matrix}\mathcal{C}& &\mathcal{A}\\ (pk,sk)\leftarrow\text{Gen}'(1^\kappa) & \stackrel{pk}{\longrightarrow}\\ \scriptsize r \leftarrow \{0,1\}^{\text{poly}(\kappa)};\\ \scriptsize (pk_1,sk_1)\leftarrow\text{Gen}(1^\kappa);\\ \scriptsize (pk_2,sk_2)\leftarrow\text{Gen}(1^\kappa);\\\scriptsize pk:=(pk_1,pk_2,r);\color{red}sk:=sk_1 \\ & \stackrel{c=(c_1,c_2,\pi)}{\longleftarrow}& \text{decryption queries}\\ m/\perp\leftarrow\text{Dec}'(sk,c) & \stackrel{m/\perp}{\longrightarrow}\\ \scriptsize \text{if } V(r,(c_1,c_2),\pi)=0, \quad m:=\perp \\\scriptsize \text{else,}\quad m\leftarrow \text{Dec}({\color{red}sk_1,c_1}) \\ & \stackrel{(m_0,m_1)}{\longleftarrow}& \text{choose }m_0,m_1\\ c^*\leftarrow \text{Enc}'(pk,m_1;w^*)& \stackrel{c^*=(c_1^*,c_2^*,\pi^*)}{\longrightarrow}& \\ \scriptsize c_1^*\leftarrow \text{Enc}(pk_1,m_1;w_1^*);\\ \scriptsize c_2^*\leftarrow \text{Enc}(pk_2,m_1;w_2^*);\\\scriptsize\pi^*\leftarrow P(r,(c_1^*,c_2^*),(m_1,w_1^*,w_2^*))\\ \text{return }b' & \stackrel{b'}{\longleftarrow} & \text{compute }b'\end{matrix}

类似 Game 3 中的推导,我们有

Pr[Game 6=1]Pr[Game 5=1]Pr[Fake6]=Pr[Fake5]|\text{Pr}[\textbf{Game 6}=1]-\text{Pr}[\textbf{Game 5}=1]|\leq \text{Pr}[\text{Fake}_6]=\text{Pr}[\text{Fake}_5]

Game 6 中,Fake 事件发生的概率由 aNIZK 的 adaptive soundness 保证,因此

Pr[Game 6=1]Pr[Game 5=1]Pr[Fake6]AdvaNIZKsound(κ)|\text{Pr}[\textbf{Game 6}=1]-\text{Pr}[\textbf{Game 5}=1]|\leq \text{Pr}[\text{Fake}_6]\leq\textbf{Adv}_\text{aNIZK}^\text{sound}(\kappa)

综上

AdvPKE,ACCA-1(κ)= Pr[ExpPKE,ACCA1-1(κ)=1]Pr[ExpPKE,ACCA1-0(κ)=1]= Pr[Game 6=1]Pr[Game 0=1] i=05Pr[Game i+1=1]Pr[Game i=1] AdvaNIZKZK(κ)+AdvPKECPA(κ)+(AdvaNIZKZK(κ)+AdvaNIZKsound(κ))+AdvPKECPA(κ)+AdvaNIZKZK(κ)+AdvaNIZKsound(κ)= 2AdvPKECPA(κ)+2AdvaNIZKsound(κ)+3AdvaNIZKZK(κ)= 7negl(κ)= negl(κ)\begin{aligned}&\textbf{Adv}_{\text{PKE}',\mathcal{A}}^\text{CCA-1}(\kappa)\\=\ &\left|\text{Pr}[\textbf{Exp}_{\text{PKE}',\mathcal{A}}^{\text{CCA1-1}}(\kappa)=1]-\text{Pr}[\textbf{Exp}_{\text{PKE}',\mathcal{A}}^{\text{CCA1-0}}(\kappa)=1]\right| \\ =\ &\left|\text{Pr}[\textbf{Game 6}=1]-\text{Pr}[\textbf{Game 0}=1]\right|\\ \leq\ &\sum_{i=0}^5 \left|\text{Pr}[\textbf{Game }i+1=1]-\text{Pr}[\textbf{Game }i=1]\right|\\ \leq\ &\textbf{Adv}_\text{aNIZK}^\text{ZK}(\kappa) +\textbf{Adv}_\text{PKE}^\text{CPA}(\kappa)+ (\textbf{Adv}_\text{aNIZK}^\text{ZK}(\kappa) + \textbf{Adv}_\text{aNIZK}^\text{sound}(\kappa)) \\ &+\textbf{Adv}_\text{PKE}^\text{CPA}(\kappa)+\textbf{Adv}_\text{aNIZK}^\text{ZK}(\kappa) + \textbf{Adv}_\text{aNIZK}^\text{sound}(\kappa) \\ =\ & 2\textbf{Adv}_\text{PKE}^\text{CPA}(\kappa)+2\textbf{Adv}_\text{aNIZK}^\text{sound}(\kappa)+3\textbf{Adv}_\text{aNIZK}^\text{ZK}(\kappa)\\=\ & 7\text{negl}(\kappa)\\ =\ &\text{negl}(\kappa)\end{aligned}

于是,使用 Noar-Yung 构造的 PKE’ 具有 CCA1 安全。


一些疑问与解答:

  • 为什么要先在 Game 1 转换成仿真器,再在 Game 5 转换回来?因为不用仿真器的话, πP(r,(c1,c2),(m0,w1,w2))\pi^*\leftarrow P(r,(c_1^*,c_2^*),(m_0,w_1^*,w_2^*)) 会用到 m0m_0,没法直接替换成 m1m_1;而仿真器允许我们在不用到 m0m_0 的时候生成 π\pi^*,即 πSim2(r,(c1,c2))\pi^*\leftarrow \text{Sim}_2(r,(c_1^*,c_2^*)),方便后续替换。
  • 为什么要两把钥匙?因为在 Game 1 规约 Game 2 的时候,如果没有两把钥匙,没办法通过另一把已知的钥匙来回答 CCA1 的问题。因此规约无法进行下去。

Theorem. Noar-Yung scheme PKE’ 对自适应 CCA(即 CCA2)是不安全的。

【证明】考虑一个 aNIZK (P,V)(P',V')

  • P(r,(c1,c2),(m,w1,w2))P'(r,(c_1,c_2),(m,w_1,w_2)):返回 P(r,(c1,c2),(m,w1,w2))0P(r,(c_1,c_2),(m,w_1,w_2))\Vert0
  • V(r,(c1,c2),πb)V'(r,(c_1,c_2),\pi \Vert b):返回 V(r,(c1,c2),π)V(r,(c_1,c_2),\pi)

这样,当敌手拿到挑战密文 ???0???\Vert 0 时,其发送查询密文 ???1??? \Vert 1 给挑战者,挑战者检查发现其在语言中,且不等于挑战密文,即给解密,从而敌手可以直接得到挑战明文;故 PKE‘ 不是 CCA2 安全的。