Docsity

Random Variables - Introduction to Cryptography - Homework, Exercises of Cryptography and System Security

Toggle sidebar
bg1
COS 433/MAT 473 — Cryptography — Homework 1.
Due Wed Sep 25 (Print and hand in at the beginning of class. No email submissions please).
Please type up your solutions using L
A
T
EX.
See course homepage for collaboration policy and late submissions.
Problem 1 (20 pts) In the following problem X, Y denote random variables over the same prob-
ability space. V(·)denotes the variance.
1. Show that if Xand Yare independent then Pr[X=Y]is at most maxyPr[Y=y]. Where
the maximum is taken over all possible values of Y=y.
2. Prove that if Xand Yare independent random variables then V[X+Y] = V[X] + V[Y].
3. Give an example of random variables X, Y such that V[X+Y] = V[X] + V[Y]but Xand Y
are not independent.
4. Suppose X1, . . . , Xnare pairwise independent random variables taking real values. Show that
V(Pn
i=1 Xi) = Pn
i=1 V(Xi).
Problem 2 (10 pts) Suppose X1, . . . , Xnare i.i.d (independent, identically distributed) random
variables such that each Xitakes the value 0with probability 1/3and the value 1with probability
2/3. Let Z=Pn
i=1 Xibe their sum (so Ztakes integer values between 0and n).
1. What is the expectation of Z?
2. Use the Chernoff bound to find the smallest range [v1, v2]around the expectation so that Zis
between v1and v2with probability at least 1−1/n5.
Problem 3 (15 pts) Recall that two distributions Xand Ythat range over some set Sare iden-
tical if for every sin S,Pr[X=s] = Pr[Y=s]. Below nis some integer n≥3.
1. Let X1, ..., Xnbe random variables where Xi∈ {0,1}chosen such that each Xiis chosen to
equal 0with probability 1/2and equal 1with probability 1/2, and all of the Xi’s are independent.
Let Y1, ..., Ynbe random variables where Yi∈ {0,1}chosen as follows: first an nbit 0/1string
yis chosen uniformly at random from the set {0,1}nof all possible n-bit 0/1strings, and then
Yiis set to be the ith coordinate of y. Prove that the distributions (X1, ..., Xn)and (Y1, ..., Yn)
are identical.
2. Let zbe a fixed string in {0,1}n, and let Z1, ..., Znbe random variables chosen as follows: first
a string w∈ {0,1}nis chosen uniformly from {0,1}n, and then Ziis set to zi⊕wi, where ⊕is
the XOR operation (i.e., 0⊕1=1⊕0=1and 0⊕0=1⊕1=0). Prove that the distribution
(Z1, ..., Zn)is identically distributed to (X1, ..., Xn)and (Y1, ..., Yn)above.
1
pf3

Partial preview of the text

Download Random Variables - Introduction to Cryptography - Homework and more Exercises Cryptography and System Security in PDF only on Docsity!

COS 433/MAT 473 — Cryptography — Homework 1.

Due Wed Sep 25 (Print and hand in at the beginning of class. No email submissions please).

Please type up your solutions using LATEX.

See course homepage for collaboration policy and late submissions.

Problem 1 (20 pts) In the following problem X, Y denote random variables over the same prob- ability space. V (·) denotes the variance.

  1. Show that if X and Y are independent then Pr[X = Y ] is at most maxy Pr[Y = y]. Where the maximum is taken over all possible values of Y = y.
  2. Prove that if X and Y are independent random variables then V [X + Y ] = V [X] + V [Y ].
  3. Give an example of random variables X, Y such that V [X + Y ] = V [X] + V [Y ] but X and Y are not independent.
  4. Suppose X 1 ,... , Xn are pairwise independent random variables taking real values. Show that V (

∑n i=1 Xi) =^

∑n i=1 V^ (Xi).

Problem 2 (10 pts) Suppose X 1 ,... , Xn are i.i.d (independent, identically distributed) random variables such that each Xi takes the value 0 with probability 1 / 3 and the value 1 with probability 2 / 3. Let Z =

∑n i=1 Xi^ be their sum (so^ Z^ takes integer values between^0 and^ n).

  1. What is the expectation of Z?
  2. Use the Chernoff bound to find the smallest range [v 1 , v 2 ] around the expectation so that Z is between v 1 and v 2 with probability at least 1 − 1 /n^5.

Problem 3 (15 pts) Recall that two distributions X and Y that range over some set S are iden- tical if for every s in S, Pr[X = s] = Pr[Y = s]. Below n is some integer n ≥ 3.

  1. Let X 1 , ..., Xn be random variables where Xi ∈ { 0 , 1 } chosen such that each Xi is chosen to equal 0 with probability 1 / 2 and equal 1 with probability 1 / 2 , and all of the Xi’s are independent. Let Y 1 , ..., Yn be random variables where Yi ∈ { 0 , 1 } chosen as follows: first an n bit 0 / 1 string y is chosen uniformly at random from the set { 0 , 1 }n^ of all possible n-bit 0 / 1 strings, and then Yi is set to be the ith^ coordinate of y. Prove that the distributions (X 1 , ..., Xn) and (Y 1 , ..., Yn) are identical.
  2. Let z be a fixed string in { 0 , 1 }n, and let Z 1 , ..., Zn be random variables chosen as follows: first a string w ∈ { 0 , 1 }n^ is chosen uniformly from { 0 , 1 }n, and then Zi is set to zi ⊕ wi, where ⊕ is the XOR operation (i.e., 0 ⊕ 1 = 1 ⊕ 0 = 1 and 0 ⊕ 0 = 1 ⊕ 1 = 0). Prove that the distribution (Z 1 , ..., Zn) is identically distributed to (X 1 , ..., Xn) and (Y 1 , ..., Yn) above.
  1. Let W 1 , ..., Wn be random variables where Wi ∈ { 0 , 1 } chosen as follows: first a string w is chosen uniformly at random from the set of all n-bit 0 / 1 strings satisfying w 1 ⊕w 2 ⊕· · ·⊕wn = 0 , and then Wi is set to be wi. (a) Prove that W 1 and W 2 are independent. (b) Prove or disprove that the random variables W 1 , ..., Wn are mutually independent.

Problem 4 (25 pts) Let X, Y be two random variables taking values in some finite set A. The statistical distance between X and Y is

∆(X, Y ) = max S⊂A |Pr[X ∈ S] − Pr[Y ∈ S]|.

We say that X and Y are (statistically) ε-close if ∆(X, Y ) ≤ ε.

  1. Prove that ∆(X, Y ) = (^12)

a∈A |Pr[X^ =^ a]^ −^ Pr[Y^ =^ a]|^.^ (the statistical distance is equal to half the ` 1 distance).

  1. Show that if ∆(X, Y ) ≤ ε and ∆(Y, Z) ≤ ε then ∆(X, Z) ≤ 2 ε. Show that this bound (of 2 ε) is the best possible.
  2. Suppose that Pr[Y ∈ S] ≥ 1 / 9 for some set S ⊂ A. Show that there exists a value a ∈ A such that Pr[Y ∈ S|X = a] ≥ 1 / 9.
  3. Suppose X and Y are (statistically) ε-close. Say Bob flips a fair coin and then sends Alice a sample from either X or Y depending on the result of the coin flip (say, X if it lands ‘heads’ and Y otherwise). Alice is asked to guess from what random variable the sample was taken. Show that Alice cannot guess correctly with probability greater than 1 /2 + ε/ 2 (Hint: show first that we can assume Alice’s actions are deterministic).
  4. (Continued from previous item) Suppose ∆(X, Y ) ≥ ε. Describe a strategy for Alice so that she guesses correctly with probability at least 1 /2 + ε/ 2.

Problem 5 (20 pts) [Statistical Security] Recall that (G, E, D) has statistically ε-indistinguishable encryptions if for every two m 1 , m 2 ∈ P and every T ⊆ C, |Pr [EK (m 1 ) ∈ T ] − Pr [EK (m 2 ) ∈ T ]| ≤ ε,

where the probabilities are taken over K ←R G and the coin tosses of E.

  1. Show that statistical 0 -indistinguishability is equivalent to perfect indistinguishability.

For the remaining parts, suppose (G, E, D) has statistically ε-indistinguishable encryptions for message space P. Below you will prove that the number of keys must be at least (1 − ε) · |P|, so statistical security doesn’t help much to overcome the limitations of perfect secrecy.

  1. Call a ciphertext c decryptable to m ∈ P if there is a key k such that Dk(c) = m. Prove that for every two messages m, m′^ ∈ P,

Pr [EK (m) is decryptable to m′] ≥ 1 − ε,

where the probability is taken over K ←R G and the coin tosses of E.