Docsity

Pseudorandom Generator - Introduction to Cryptography - Homework, Exercises of Cryptography and System Security

Toggle sidebar
bg1
COS 433/MAT 473 — Cryptography — Homework 3.
Due Wed Oct 9 (Print and hand in at the beginning of class).
Please type up your solutions using L
A
T
EX.
See course homepage for collaboration policy and late submissions.
Problem 1 (20 pts) Breaking 2-local PRG’s:
1. Define G(x) = y0. . . yn, where x=x0· · · xn−1,y0=x0,yi=xi−1⊕ximod nfor i= 1, . . . , n.
Show that Gis not a pseudorandom generator. Also show that the encryption scheme based on
G, where Ek(m) = m⊕G(k), is not computationally secure (i.e. does not have computationally
indistinguishable encryptions).
In the remainder of the problem, you will generalize the above to any pseudorandom generator
for which each bit of output depends on at most two bits of the seed. That is, for every nand
every i∈ {1, . . . , `(n)}(where `is the expansion function of G), there exist j, k ∈ {1, . . . , n}and a
function fsuch that G(x)i=f(xj, xk)for all x∈ {0,1}n. (In contrast, a remarkable result from
2004 shows how to convert essentially any pseudorandom generator into one where every output bit
depends on only four bits of the seed.)
2. Show that if Gis a pseudorandom generator such that each bit of the output depends on at
most two bits of the seed, then in fact each bit of the output is equal to either some bit of the
seed, the complement of some bit of the seed, the xor of two bits of the seed, or the complement
of the xor of two bits of the seed. That is, the functions f(xj, xk)must be one of xj,¬xj,
xk,¬xk,xj⊕xk, or ¬(xj⊕xk). (Hint: what property do all 2-bit functions other than these
have?)
3. Show that there does not exist a pseudorandom generator such that each bit of the output
depends on at most two bits of the seed. Also show that the encryption scheme based on G,
where Ek(m) = m⊕G(k), is not computationally secure. (Hint: After using Part 2, we can
define a set S={j:xjor its complement is an output bit of G}and a graph Hwith edge set
{(j, k) : xj⊕xkor its complement is an output bit of G}. Use the expansion of Gto argue
that either Hcontains a cycle or there are two elements of Sconnected by a path in H.)
Problem 2 (15 pts) Show that the existence of one way functions implies P6=NP .
Problem 3 (25 pts) Which of the following functions are one-way functions? For each, demon-
strate that it is not a one-way function by exhibiting a polynomial-time adversary which inverts with
non-negligible probability or argue that it is likely to be a one-way function by a reduction from the
factoring assumption
1
pf2

Partial preview of the text

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

COS 433/MAT 473 — Cryptography — Homework 3.

Due Wed Oct 9 (Print and hand in at the beginning of class).

Please type up your solutions using LATEX.

See course homepage for collaboration policy and late submissions.

Problem 1 (20 pts) Breaking 2-local PRG’s:

  1. Define G(x) = y 0... yn, where x = x 0 · · · xn− 1 , y 0 = x 0 , yi = xi− 1 ⊕ xi mod n for i = 1,... , n. Show that G is not a pseudorandom generator. Also show that the encryption scheme based on G, where Ek(m) = m⊕G(k), is not computationally secure (i.e. does not have computationally indistinguishable encryptions).

In the remainder of the problem, you will generalize the above to any pseudorandom generator for which each bit of output depends on at most two bits of the seed. That is, for every n and every i ∈ { 1 ,... , (n)} (where is the expansion function of G), there exist j, k ∈ { 1 ,... , n} and a function f such that G(x)i = f (xj , xk) for all x ∈ { 0 , 1 }n. (In contrast, a remarkable result from 2004 shows how to convert essentially any pseudorandom generator into one where every output bit depends on only four bits of the seed.)

  1. Show that if G is a pseudorandom generator such that each bit of the output depends on at most two bits of the seed, then in fact each bit of the output is equal to either some bit of the seed, the complement of some bit of the seed, the xor of two bits of the seed, or the complement of the xor of two bits of the seed. That is, the functions f (xj , xk) must be one of xj , ¬xj , xk, ¬xk, xj ⊕ xk, or ¬(xj ⊕ xk). (Hint: what property do all 2-bit functions other than these have?)
  2. Show that there does not exist a pseudorandom generator such that each bit of the output depends on at most two bits of the seed. Also show that the encryption scheme based on G, where Ek(m) = m ⊕ G(k), is not computationally secure. (Hint: After using Part 2, we can define a set S = {j : xj or its complement is an output bit of G} and a graph H with edge set {(j, k) : xj ⊕ xk or its complement is an output bit of G}. Use the expansion of G to argue that either H contains a cycle or there are two elements of S connected by a path in H.)

Problem 2 (15 pts) Show that the existence of one way functions implies P 6 = N P.

Problem 3 (25 pts) Which of the following functions are one-way functions? For each, demon- strate that it is not a one-way function by exhibiting a polynomial-time adversary which inverts with non-negligible probability or argue that it is likely to be a one-way function by a reduction from the factoring assumption

  1. f (x, y) = x + y, where |x| = |y|.
  2. f (x, y) = xy + 1, where |x| = |y|.
  3. f (x) = x^2 , where x is an integer
  4. f (x, y) = x · y + x · 2 m^ where |x| = |y| = k and m = d|x|/ 2 e.
  5. f (x 1 , · · · , xk, S) = (x 1 , · · · , xk, y mod k^2 ) where y =

i∈S xi^ and each^ xi^ ∈ {^1 ,^ · · ·^ , k

Problem 4 (20 pts) Length preserving OWF: Definitions:

  • The function f is length-regular if for every x, y ∈ { 0 , 1 }∗, |x| = |y| =⇒ |f (x)| = |f (y)|.
  • The function f is length-preserving if for every x ∈ { 0 , 1 }∗, |f (x)| = |x|.

Prove the following proposition: If there exists one-way functions, then there exists length- preserving one-way functions.

  1. Given a one-way function f , construct f ′^ which is length-regular.
  2. Modify f ′^ to obtain a function f ′′ which is length-preserving.
  3. Show by a reducibility argument that if f is one-way then so are f ′^ and f ′′.

Problem 5 (20 pts) In the following questions, show the steps in the computation (not just the answers).

  1. Read about the extended GCD algorithm in the Shoup’s book. Apply it to the primes 59 and
  2. What is the inverse of 59 modulo 67?
  3. Consider the product of primes 59 · 67 = 3953, and find the element of Z 3953 corresponding to (16, 3) ∈ Z 59 × Z 67. That is, find (using part 1 of the question) a number in Z 3953 that is equal to 16 modulo 59 and to 3 modulo 67.
  4. Find all square roots of 36 in Z 3953. (Hint: first find all the square roots of 36 in Z 59 and Z 67 .)
  5. Find all generators g of Z∗ 7 , and find logg(2) for each of them.