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

CSE442
ๆจกๅ—
Cse442t L11

Lecture 11

Exam info posted tonight.

Pseudo-randomness

Idea: Efficiently produce many bits

which "appear" truly random.

One-time pad

mโˆˆ{0,1}nm\in\{0,1\}^n

Gen(1n):kโ†{0,1}NGen(1^n):k\gets \{0,1\}^N

Enck(m)=mโŠ•kEnc_k(m)=m\oplus k

Deck(c)=cโŠ•kDec_k(c)=c\oplus k

Advantage: Perfectly secret

Disadvantage: Impractical

The goal of pseudo-randomness is to make the algorithm, computationally secure, and practical.

Let {Xn}\{X_n\} be a sequence of distributions over {0,1}l(n)\{0,1\}^{l(n)}, where l(n)l(n) is a polynomial of nn.

"Probability ensemble"

Example:

Let UnU_n be the uniform distribution over {0,1}n\{0,1\}^n

For all xโˆˆ{0,1}nx\in \{0,1\}^n

P[xโ†Un]=12nP[x\gets U_n]=\frac{1}{2^n}

For 1โ‰คiโ‰คn1\leq i\leq n, P[xi=1]=12P[x_i=1]=\frac{1}{2}

For 1โ‰คi<jโ‰คn,P[xi=1ย andย xj=1]=141\leq i<j\leq n,P[x_i=1 \textup{ and } x_j=1]=\frac{1}{4} (by independence of different bits.)

Let {Xn}n\{X_n\}_n and {Yn}n\{Y_n\}_n be probability ensembles (separate of dist over {0,1}l(n)\{0,1\}^{l(n)})

{Xn}n\{X_n\}_n and {Yn}n\{Y_n\}_n are computationally in-distinguishable if for all non-uniform p.p.t adversary DD ("distinguishers")

โˆฃP[xโ†Xn:D(x)=1]โˆ’P[yโ†Yn:d(y)=1]โˆฃ<ฮต(n)|P[x\gets X_n:D(x)=1]-P[y\gets Y_n:d(y)=1]|<\varepsilon(n)

this basically means that the probability of finding any pattern in the two array is negligible.

If there is a DD such that

โˆฃP[xโ†Xn:D(x)=1]โˆ’P[yโ†Yn:d(y)=1]โˆฃโ‰ฅฮผ(n)|P[x\gets X_n:D(x)=1]-P[y\gets Y_n:d(y)=1]|\geq \mu(n)

then DD is distinguishing with probability ฮผ(n)\mu(n)

If ฮผ(n)โ‰ฅ1p(n)\mu(n)\geq\frac{1}{p(n)}, then DD is distinguishing the two โ€…โ€ŠโŸนโ€…โ€ŠXnโ‰ˆYn\implies X_n\cancel{\approx} Y_n

Prediction lemma

Xn0X_n^0 and Xn1X_n^1 ensembles over {0,1}l(n)\{0,1\}^{l(n)}

Suppose โˆƒ\exists distinguisher DD which distinguish by โ‰ฅฮผ(n)\geq \mu(n). Then โˆƒ\exists adversary A\mathcal{A} such that

P[bโ†{0,1};tโ†Xnb]:A(t)=b]โ‰ฅ12+ฮผ(n)2P[b\gets\{0,1\};t\gets X_n^b]:\mathcal{A}(t)=b]\geq \frac{1}{2}+\frac{\mu(n)}{2}

Proof:

Without loss of generality, suppose

P[tโ†Xn1:D(t)=1]โˆ’P[tโ†Xn0:D(t)=1]โ‰ฅฮผ(n)P[t\gets X^1_n:D(t)=1]-P[t\gets X_n^0:D(t)=1]\geq \mu(n)

A=D\mathcal{A}=\mathcal{D} (Outputs 1 if and only if DD outputs 1, otherwise 0.)

ย ย ย ย ย P[bโ†{0,1};tโ†Xnb:A(t)=b]=P[tโ†Xn1;A=1]โ‹…P[b=1]+P[tโ†Xn0;A(t)=0]โ‹…P[b=0]=12P[tโ†Xn1;A(t)=1]+12(1โˆ’P[tโ†Xn0;A(t)=1])=12+12(P[tโ†Xn1;A(t)=1]โˆ’P[tโ†Xn0;A(t)=1])โ‰ฅ12+12ฮผ(n)\begin{aligned} &~~~~~P[b\gets \{0,1\};t\gets X_n^b:\mathcal{A}(t)=b]\\ &=P[t\gets X_n^1;\mathcal{A}=1]\cdot P[b=1]+P[t\gets X_n^0;\mathcal{A}(t)=0]\cdot P[b=0]\\ &=\frac{1}{2}P[t\gets X_n^1;\mathcal{A}(t)=1]+\frac{1}{2}(1-P[t\gets X_n^0;\mathcal{A}(t)=1])\\ &=\frac{1}{2}+\frac{1}{2}(P[t\gets X_n^1;\mathcal{A}(t)=1]-P[t\gets X_n^0;\mathcal{A}(t)=1])\\ &\geq\frac{1}{2}+\frac{1}{2}\mu(n)\\ \end{aligned}

Pseudo-random

{Xn}\{X_n\} over {0,1}l(n)\{0,1\}^{l(n)} is pseudorandom if {Xn}โ‰ˆ{Ul(n)}\{X_n\}\approx\{U_{l(n)}\}. i.e. indistinguishable from the true randomness.

Example:

Building distinguishers

  1. XnX_n: always outputs 0n0^n, DD: [outputs 11 is t=0nt=0^n] โˆฃP[tโ†Xn:D(t)=1]โˆ’P[tโ†Un:D(t)=1]โˆฃ=1โˆ’12nโ‰ˆ1\vert P[t\gets X_n:D(t)=1]-P[t\gets U_n:D(t)=1]\vert=1-\frac{1}{2^n}\approx 1
  2. XnX_n: 1st nโˆ’1n-1 bits are truly random โ†Unโˆ’1\gets U_{n-1} nth bit is 11 with probability 0.50001 and 00 with 0.49999, DD: [outputs 11 if Xn=1X_n=1] โˆฃP[tโ†Xn:D(t)=1]โˆ’P[tโ†Un:D(t)=1]โˆฃ=0.5001โˆ’0.5=0.001โ‰ 0\vert P[t\gets X_n:D(t)=1]-P[t\gets U_n:D(t)=1]\vert=0.5001-0.5=0.001\neq 0
  3. XnX_n: For each bit xiโ†{0,1}x_i\gets\{0,1\} unless there have been 1 million 00's. in a row. Then outputs 11, DD: [outputs 11 if x1=x2=...=x1000001=0x_1=x_2=...=x_{1000001}=0] โˆฃP[tโ†Xn:D(t)=1]โˆ’P[tโ†Un:D(t)=1]โˆฃ=โˆฃ0โˆ’121000001โˆฃโ‰ 0 \vert P[t\gets X_n:D(t)=1]-P[t\gets U_n:D(t)=1]\vert=|0-\frac{1}{2^{1000001}}|\neq 0