๐ŸŽ‰ ไปŽ330่ฝฌไธบWashUๅธฎๅŠฉๆ‰‹ๅ†Œๅ•ฆ!

CSE442
ๆจกๅ—
Cse442t L17

Lecture 17

Strength through Truth

Public key encryption scheme (1-bit)

Gen(1n):(fi,fiโˆ’1)Gen(1^n):(f_i, f_i^{-1})

fif_i is the trapdoor permutation. (eg. RSA)

Output((fi,hi),fiโˆ’1)Output((f_i, h_i), f_i^{-1}), where (fi,hi)(f_i, h_i) is the public key and fiโˆ’1f_i^{-1} is the secret key.

Encpk(m):rโ†{0,1}nEnc_{pk}(m):r\gets \{0, 1\}^n

Output(fi(r),hi(r)โŠ•m)Output(f_i(r), h_i(r)\oplus m)

where fi(r)f_i(r) is denoted as c1c_1 and hi(r)โŠ•mh_i(r)\oplus m is the tag c2c_2.

The decryption function is:

Decsk(c1,c2)Dec_{sk}(c_1, c_2):

r=fiโˆ’1(c1)r=f_i^{-1}(c_1)

m=c2โŠ•hi(r)m=c_2\oplus h_i(r)

Validity of the decryption

Proof of the validity of the decryption: Exercise.

Security of the encryption scheme

The encryption scheme is secure under this construction (Trapdoor permutation (TDP), Hardcore bit (HCB)).

Proof:

We proceed by contradiction. (Constructing contradiction with definition of hardcore bit.)

Assume that there exists a distinguisher D\mathcal{D} that can distinguish the encryption of 00 and 11 with non-negligible probability ฮผ(n)\mu(n).

{(pk,sk)โ†Gen(1n):(pk,Encpk(0))}v.s.{(pk,sk)โ†Gen(1n):(pk,Encpk(1))}โ‰ฅฮผ(n)\{(pk,sk)\gets Gen(1^n):(pk,Enc_{pk}(0))\} v.s.\{(pk,sk)\gets Gen(1^n):(pk,Enc_{pk}(1))\} \geq \mu(n)

By prediction lemma (the distinguisher can be used to create and adversary that can break the security of the encryption scheme with non-negligible probability ฮผ(n)\mu(n)).

P[mโ†{0,1};(pk,sk)โ†Gen(1n):A(pk,Encpk(m))=m]โ‰ฅ12+ฮผ(n)P[m\gets \{0,1\}; (pk,sk)\gets Gen(1^n):\mathcal{A}(pk,Enc_{pk}(m))=m]\geq \frac{1}{2}+\mu(n)

We will use this to construct an agent BB which can determine the hardcore bit hi(r)h_i(r) of the trapdoor permutation fi(r)f_i(r) with non-negligible probability.

fi,hif_i,h_i are determined.

BB is given fi(r)f_i(r) and hi(r)h_i(r) and outputs bโˆˆ{0,1}b\in \{0,1\}.

  • rโ†{0,1}nr\gets \{0,1\}^n is chosen uniformly at random.
  • y=fi(r)y=f_i(r) is given to BB.
  • b=hi(r)b=h_i(r) is given to BB.
  • Choose c2โ†{0,1}=hi(r)โŠ•mc_2\gets \{0,1\}= h_i(r)\oplus m uniformly at random.
  • Then use A\mathcal{A} with pk=(fi,hi),Encpk(m)=(fi(r),hi(r)โŠ•m)pk=(f_i, h_i),Enc_{pk}(m)=(f_i(r), h_i(r)\oplus m) to determine whether rr is 00 or 11.
  • Let mโ€ฒโ†A(pk,(y,c2))m'\gets \mathcal{A}(pk,(y,c_2)).
  • Since c2=hi(r)โŠ•mc_2=h_i(r)\oplus m, we have m=bโŠ•c2m=b\oplus c_2, b=mโ€ฒโŠ•c2b=m'\oplus c_2.
  • Output b=mโ€ฒโŠ•c2b=m'\oplus c_2.

The probability that BB correctly guesses bb given fi,hif_i,h_i is:

ย ย ย ย ย P[rโ†{0,1}n:y=fi(r),b=hi(r):B(fi,hi,y)=b]=P[rโ†{0,1}n,c2โ†{0,1}:y=fi(r),b=hi(r):A((fi,hi),(y,c2))=(c2+b)]=P[rโ†{0,1}n,mโ†{0,1}:y=fi(r),b=hi(r):A((fi,hi),(y,bโŠ•m))=m]>12+ฮผ(n)\begin{aligned} &~~~~~P[r\gets \{0,1\}^n: y=f_i(r), b=h_i(r): B(f_i,h_i,y)=b]\\ &=P[r\gets \{0,1\}^n,c_2\gets \{0,1\}: y=f_i(r), b=h_i(r):\mathcal{A}((f_i,h_i),(y,c_2))=(c_2+b)]\\ &=P[r\gets \{0,1\}^n,m\gets \{0,1\}: y=f_i(r), b=h_i(r):\mathcal{A}((f_i,h_i),(y,b\oplus m))=m]\\ &>\frac{1}{2}+\mu(n) \end{aligned}

This contradicts the definition of hardcore bit.

EOP

Public key encryption scheme (multi-bit)

Let mโˆˆ{0,1}km\in \{0,1\}^k.

We can choose random riโˆˆ{0,1}nr_i\in \{0,1\}^n, yi=fi(ri)y_i=f_i(r_i), bi=hi(ri),ci=miโŠ•bib_i=h_i(r_i),c_i=m_i\oplus b_i.

Encpk(m)=((y1,c1),โ‹ฏโ€‰,(yk,ck)),cโˆˆ{0,1}kEnc_{pk}(m)=((y_1,c_1),\cdots,(y_k,c_k)),c\in \{0,1\}^k

Decsk:rk=fiโˆ’1(yk),hi(rk)โŠ•ck=mkDec_{sk}:r_k=f_i^{-1}(y_k),h_i(r_k)\oplus c_k=m_k

Special public key cryptosystem: El-Gamal (based on Diffie-Hellman Assumption)

Definition: Decisional Diffie-Hellman Assumption (DDH)

Define the group of squares mod pp as follows:

p=2q+1p=2q+1, qโˆˆฮ nโˆ’1q\in \Pi_{n-1}, gโ†Zpโˆ—/{1}g\gets \mathbb{Z}_p^*/\{1\}, y=g2y=g^2

G={y,y2,โ‹ฏโ€‰,yq=1}modโ€‰โ€‰pG=\{y,y^2,\cdots,y^q=1\}\mod p

These two listed below are indistinguishable.

{pโ†ฮ n~;yโ†Genq;a,bโ†Zq:(p,y,ya,yb,yab)}n\{p\gets \tilde{\Pi_n};y\gets Gen_q;a,b\gets \mathbb{Z}_q:(p,y,y^a,y^b,y^{ab})\}_n

{pโ†ฮ n~;yโ†Genq;a,b,zโ†Zq:(p,y,ya,yb,yz)}n\{p\gets \tilde{\Pi_n};y\gets Gen_q;a,b,\bold{z}\gets \mathbb{Z}_q:(p,y,y^a,y^b,y^\bold{z})\}_n

Diffie-Hellman Assumption:

Hard to compute yaby^{ab} given p,y,ya,ybp,y,y^a,y^b.

So DDH assumption implies discrete logarithm assumption.

Idea:

If one can find a,ba,b from ya,yby^a,y^b, then one can find abab from yaby^{ab} and compare to z\bold{z} to check whether yzy^\bold{z} is a valid DDH tuple.

El-Gamal encryption scheme (public key cryptosystem)

Gen(1n)Gen(1^n):

pโ†ฮ n~,gโ†Zpโˆ—/{1},yโ†Genq,aโ†Zqp\gets \tilde{\Pi_n},g\gets \mathbb{Z}_p^*/\{1\},y\gets Gen_q,a\gets \mathbb{Z}_q

Output:

pk=(p,y,yamodโ€‰โ€‰p)pk=(p,y,y^a\mod p) (public key)

sk=(p,y,a)sk=(p,y,a) (secret key)

Message space: Gq={y,y2,โ‹ฏโ€‰,yq=1}G_q=\{y,y^2,\cdots,y^q=1\}

Encpk(m)Enc_{pk}(m):

bโ†Zqb\gets \mathbb{Z}_q

c1=ybmodโ€‰โ€‰p,c2=(yabโ‹…m)modโ€‰โ€‰pc_1=y^b\mod p,c_2=(y^{ab}\cdot m)\mod p

Output: (c1,c2)(c_1,c_2)

Decsk(c1,c2)Dec_{sk}(c_1,c_2):

Since c2=(yabโ‹…m)modโ€‰โ€‰pc_2=(y^{ab}\cdot m)\mod p, we have m=c2c1amodโ€‰โ€‰pm=\frac{c_2}{c_1^a}\mod p

Output: mm

Security of El-Gamal encryption scheme

Proof:

If not secure, then there exists a distinguisher D\mathcal{D} that can distinguish the encryption of m1,m2โˆˆGqm_1,m_2\in G_q with non-negligible probability ฮผ(n)\mu(n).

{(pk,sk)โ†Gen(1n):D(pk,Encpk(m1))}ย vs.ย {(pk,sk)โ†Gen(1n):D(pk,Encpk(m2))}โ‰ฅฮผ(n)\{(pk,sk)\gets Gen(1^n):D(pk,Enc_{pk}(m_1))\}\text{ vs. }\\ \{(pk,sk)\gets Gen(1^n):D(pk,Enc_{pk}(m_2))\}\geq \mu(n)

And proceed by contradiction. This contradicts the DDH assumption.

EOP