Introductionto Modern Cryptograph 第十三章部分課後題答案

Acknowledge
致敬Katz J, Lindell Y. Introduction to modern cryptography[M]. Chapman and Hall/CRC, 2014. 推薦該書正版。

該書第12章的內容是數字簽名,具體推薦Katz J的另一本書:
Katz J. Digital signatures[M]. Springer Science & Business Media, 2010.
有興趣的人可以自己進行擴展閱讀,這裏不再貼出第12章的課後題解。


13.2 In this exercise we show a scheme that can be proven secure in the random oracle model, but is insecure when the random oracle is instantiated with SHA-1. (This exercise is a bit informal since SHA-1 is only defined for a fixed output length. Nevertheless, it illustrates the main idea.) Let Π\Pi be a signature scheme that is secure in the standard model. Construct a signature scheme Πy\Pi_y where signing is carried out as follows: if H(0)=yH(0) = y, then output the4 secret key; if H(0)yH(0) \neq y, then return a signature computed using Π\Pi.

  • Prove that for any\it{any} value yy, the scheme Πy\Pi_y is secure in the random oracle model.
  • Show that there exists a particular yy for which Πy\Pi_y is not secure when the random oracle is instantiated using SHA-1.

(a)概率分析如下:
Pr[A wins]=Pr[A winsy=H(0)]+Pr[A winsyH(0)]Pr[y=H(0)]+Pr[yH(0)A wins]Pr[A wins]=negl(λ)+Pr[yH(0)A wins]Pr[A wins] \begin{aligned} \mathrm{Pr} [ \mathscr{A} ~ \text{wins} ] &= \mathrm{Pr} [ \mathscr{A} ~ \text{wins} \land y = H(0)] + \mathrm{Pr} [ \mathscr{A} ~ \text{wins} \land y \neq H(0) ] \\ &\leq \mathrm{Pr} [ y = H(0) ] + \mathrm{Pr} [ y \neq H(0) | \mathscr{A} ~ \text{wins}] \cdot \mathrm{Pr} [ \mathscr{A} ~ \text{wins} ] \\ &= \mathsf{negl}(\lambda) + \mathrm{Pr} [ y \neq H(0) | \mathscr{A} ~ \text{wins}] \cdot \mathrm{Pr} [ \mathscr{A} ~ \text{wins} ] \end{aligned}
假設A\mathscr{A}可以破解方案Πy\Pi_y,那麼可以構造AΠ\mathscr{A}_{\Pi}來破解方案Π\Pi,其編碼如下:

  • CΠ\mathscr{C}_\Pi處獲取pkpk,隨機挑選y{0,1}λy \gets \{0, 1\}^\lambda,(表示猜測未來隨機諭言機開始運作時H(0)yH(0) \neq y),將(pk,y)(pk, y)交給A\mathscr{A},同時給A\mathscr{A}模擬出諭言機OSign\mathcal{O}_{\mathsf{Sign}}OH\mathcal{O}_H
    • 諭言機OSign(m)\mathcal{O}_{\mathsf{Sign}}(m)工作如下:從A\mathscr{A}處獲取消息mm,直接將其交給CΠ\mathscr{C}_{\Pi},得到對應的簽名σ\sigma,將σ\sigma返回給A\mathscr{A}
    • 諭言機OH(x)\mathcal{O}_H(x)工作如下:若記錄(x,yx)(x, y_x)存在則直接返回yxy_x,否則,隨機挑選yx{0,1}λy_x \gets \{0, 1\}^\lambda,若x=0x = 0yx=yy_x = y,直接中斷遊戲,否則,生成記錄(x,yx)(x, y_x)並返回yxy_x
  • A\mathscr{A}處獲取僞造(m,σ)(m^*, \sigma^*),將其直接發送給CΠ\mathscr{C}_{\Pi}

易知Pr[yH(0)A wins]=11/2λ\mathrm{Pr} [ y \neq H(0) | \mathscr{A} ~ \text{wins}] = 1 - 1 / 2^\lambda,假設A\mathscr{A}以不可忽略概率破解Πy\Pi_y,有
negl(λ)Pr[AΠ wins](11/2λ)Pr[A wins] \mathsf{negl}(\lambda) \geq \mathrm{Pr} [ \mathscr{A}_\Pi ~ \text{wins} ] \geq (1 - 1 / 2^\lambda) \cdot \mathrm{Pr} [ \mathscr{A} ~ \text{wins} ],
上述式子與假設互相矛盾,故假設不成立,方案在隨機諭言機模型下是安全的。
(b)HH換成SHA-1後,H(0)H(0)恆等於SHA-1(0){\it SHA}\text{-} 1(0),對於y=SHA-1(0)y = {\it SHA}\text{-} 1(0)的簽名方案,消息mm恆輸出一個常數,故不再安全。


13.3 Consider a message authentication cod Π=(Gen,Mac,Vrfy)\Pi = ( \mathsf{Gen}, \mathsf{Mac}, \mathsf{Vrfy}) where Mack(m):=H(km)\mathsf{Mac}_k(m) := H(k \| m) for a function H:{0,1}{0,1}λH : \{0, 1\}^* \to \{0, 1\}^\lambda (note that k{0,1}λk \gets \{0, 1\}^\lambda and verification is carried out in the natural way). Show that if HH is modeled as a random oracle, then Π\Pi is secure message authentication code. Show that if HH is any concrete hash function that is constructed via the Merkle-Damgard transform, then Π\Pi is not\it{not} a secure message authentication code.

HH是隨機諭言機時,mm^*對應的標籤H(km)H(k \| m^*)是不確定的,敵手所給僞造有效的概率爲可忽略函數,即1/2λ1/2^\lambda。後面小題在第4章課後題出現過,這裏不再詳述。


13.5 Say a public-key encryption scheme (Gen,Enc,Dec)(\mathsf{Gen}, \mathsf{Enc}, \mathsf{Dec}) is oneway\it{one-way} if any PPT adversary A\mathscr{A} has negligible probability of success in the following experiment:

  • Gen(1λ)\mathsf{Gen}(1^\lambda) is run to obtain keys (pk,sk)(pk, sk).
  • A\mathscr{A} message m{0,1}λm \gets \{0, 1\}^\lambda is chosen uniformly at random, and a ciphertext cEncpk(m)c \gets \mathsf{Enc}_{pk}(m) is computed.
  • A\mathscr{A} is given pkpk and cc, and outputs a message mm^*. We say A\mathscr{A} succeeds if m=mm^* = m.

(a) Show that a construction of a CPA-secure public-key encryption scheme in the random oracle model based on any one-way public-key encryption scheme.
(b) Can a public-key encryption scheme where encryption is deterministic\it{deterministic} be one-way? If not, give a proof; if so, show a construction based on any of the assumptions introduced in this book.

(a)方案構造如下:

  • SGen(1λ)(pk,sk):\mathsf{SGen}(1^\lambda) \to (pk, sk): 輸入安全參數1λ1^\lambda,生成(pk,sk)Gen(1λ)(pk, sk) \gets \mathsf{Gen}(1^\lambda),設置<pk:=pk,sk:=sk>\big< pk:=pk, sk:=sk \big>並輸出。
  • SEnc(pk,m)c:\mathsf{SEnc}(pk, m) \to c: 輸入消息m{0,1}m \in \{0, 1\},隨機挑選xMx \gets \mathcal{M},其中M\mathcal{M}是公鑰加密方案(Gen,Enc,Dec)(\mathsf{Gen}, \mathsf{Enc}, \mathsf{Dec})的消息域,計算c1Encpk(x)c_1 \gets \mathsf{Enc}_{pk}(x),若m=0m=0,設置c2{0,1}λ\H(x)c_2 \gets \{0, 1\}^\lambda \backslash H(x),若m=1m=1,設置c2:=H(x)c_2 := H(x),輸出密文c=<c1,c2>c = \big<c_1, c_2\big>
  • SDec(sk,c)m\mathsf{SDec}(sk, c) \to m:拆分c=<c1,c2>c = \big<c_1, c_2\big>,計算x:=Decsk(c1)x := \mathsf{Dec}_{sk}(c_1),若H(x)=c2H(x) = c_2,則輸出m:=1m:=1,否則輸出m:=0m:=0

(b)詳見第10章,The “textbook RSA” encryption scheme。


13.7 Let Π=Gen,Enc,Dec)\Pi = \mathsf{Gen}, \mathsf{Enc}, \mathsf{Dec}) be a public-key encryption scheme having indistinguishable encryptions under a chosen-plaintext attack, and let Π=(Gen,Enc,Dec)\Pi' = (\mathsf{Gen}', \mathsf{Enc}', \mathsf{Dec}') be a private-key encryption scheme having indistinguishable encryptions under a chosen-ciphertext attack. Consider the following construction of a public-key encryption scheme Π\Pi^*.
Construction 13.12
Let H:{0,1}λ{0,1}λH:\{0, 1\}^\lambda \to \{0, 1\}^\lambda be a function. Construction a public-key encryption scheme as follows:

  • Gen:\mathsf{Gen}^*: on input 1λ1^\lambda, run Gen(1λ)\mathsf{Gen}(1^\lambda) to obtain (pk,sk)(pk, sk). Output these as the public and private keys,respectively.
  • Enc:\mathsf{Enc}^*: on input a public key pkpk and a message m{0,1}λm \in \{0, 1\}^\lambda, choose a random r{0,1}λr \gets \{0, 1\}^\lambda and output the ciphertext <Encpk(r),EncH(r)(m)>\big< \mathsf{Enc}_{pk}(r), \mathsf{Enc}'_{H(r)}(m) \big>.
  • Dec:\mathsf{Dec}^*: on input a private key sksk and ciphertext <c1,c2>\big< c_1, c_2 \big>, compute r:=Decsk(c1)r:= \mathsf{Dec}_{sk}(c_1) and set k:=H(r)k := H(r). Then output Deck(c2)\mathsf{Dec}'_k(c_2).

Does the above construction have indistinguishable encryptions under a chosen-ciphertext attack, if HH is modeled as a random oracle? If yes, provide a proof. If not, where does the approach used to prove Theorem 13.6 break down?

Construction 13.5可以看作是使用了單向安全的公鑰加密方案,而題述方案使用了CPA-安全的公鑰加密方案,已知一個CPA-安全的公鑰加密方案一定是單向安全的公鑰加密方案,既然Theorem 13.6已證Construction 13.5安全,那麼題述構造是安全的。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章