Lecture14
Lecture14
Lecture 14 (Notes)
Lecturer: Ola Svensson Scribes: Ola Svensson
Disclaimer: These notes were written for the lecturer only and may contain inconsistent notation,
typos, and they do not cite relevant works. They also contain extracts from the two main inspirations
of this course:
1. The book Computational Complexity: A Modern Approach by Sanjeev Arora and Boaz Barak;
2. The course http://theory.stanford.edu/ trevisan/cs254-14/index.html by Luca Trevisan.
1 Introduction
Recall last lecture:
• Connection between PCP-Theorem and (hardness of) approximation algorithms.
• Things changed in 1970s, when modern cryptography was born, whereby computational complex-
ity was used to argue about the security of encryption schemes. Common assumptions are e.g.
that factoring is a hard problem. It remains an important research problem to rely on weaker
assumptions such as P 6= NP to devise cryptography schemes. A difficulty is that crypto relies on
a problem to be hard on “average” and not only in the worst case.
• Cryptography is a huge topic, and so naturally we will only cover a tiny bit of it. See e.g. textbook
for further references.
• Today we do: perfect secrecy and its limitations, define one-way functions and pseudo-random
generators, and see some of their applications.
• Thus Alice will “scramble” the plaintext x using an encryption algorithm E to obtain a ciphertext
y = E(x). And she sends y to Bob instead of x.
• Bob will then decode x from the ciphertext y using a decryption algorithm D.
1
The goal is of course that the encryption is good enough so as to make it impossible for Eve to decode
the message. However, Bob is seeing the same information that Eve is, so in order to do something that
Eve cannot, Bob has to know something that Eve does not. In the setting of private key encryption we
assume that Alice and Bob share some secret string k (known as the key) that is chosen at random and
shared secretly before hand.
The encryption scheme is thus defined by a pair of algorithms (E, D), each taking a key and a message
(where we write the key input as a subscribpt), such that for every key k and plaintext x
The above says that the scheme is correct in the sense that Bob can decode the message given the
ciphertext. However, it does not say anything about the security. How can we define security? A first
attempt may be to say that Eve should not be able to find x from y. However, this is often insufficient
as this doesn’t rule out the possiblity that Eve can find partial information about x. For example, if x
is a top secret document consisting of 10 pages we should not allow Eve to recover a single page from
this document. Shannon gave the following definition of secure private key encryption that ensures that
Eve does not learn anything about x:
Definition 1 (Perfect secrecy) Let (E, D) be an encryption scheme for messages of length m and with
a key of length n satisfying (1). We say that (E, D) is perfectly secret if for every pair of messages x, x0 ∈
{0, 1}m , the distributions EUn (x) and EUn (x0 ) are identical, where Un denotes the uniform distribution
over {0, 1}n .
Notice the above definition captures perfect secrecy as the ciphertext that Eve sees always has the
same distribution, regardless of the plaintext and so she gets no information on the plaintext. There is
a very simple scheme called one-time pad scheme to achieve perfect secrecy:
• To encrypt a message x ∈ {0, 1}m , Alice and Bob decides on a random key k ∈ {0, 1}m .
• As the name (one-time pad) suggests, a key k can only be used once. If k us used twice for messages
x and x0 then Eve can calculate E(x) ⊕ E(x0 ) = x ⊕ x0 which reveals nontrivial information about
x and x0 .
• The key is huge (as large as the message we want to communicate).
These drawbacks make the one-time pad impractical to use in modern settings. Moreover, one can show
(homework) that no perfectly secret encryption scheme can use a key size shorter than the message size!
We thus have to relax the perfect secrecy condition somehow.
2
Lemma 2 Suppose that P = NP. Let (E, D) be any polynomial-time computable encryption scheme
satisfying (1) with key shorter than the message. Then, there is a polynomial time algorithm A such
that for every input length m, there is a pair of messages x0 , x1 ∈ {0, 1}m satisfying:
where the last inequality follows from the fact that, for any fixed k, Ek is one-to-one and hence at
most 2n ≤ 2m /2 of the x’s can be mapped to the set S of size 2n .
• Hence there must exist an x1 such that Ek∈{0,1}n [S(x1 , k)] ≤ 1/2 which is equivalent to Pr[Dx1 ∈
S] ≤ 1/2.
Hence, it will be necessary to assume P 6= NP. We will relay on stronger assumptions (that one-way
functions exist) and, as aforementioned, it is an important research problem to weaken the assumption.
Before we define one-way functions we introduce a notation that simplifies notation:
Definition 4 (One-way functions) A polynomial-time computable function f : {0, 1}∗ → {0, 1}∗ is
a one-way function if for every probabilistic polynomial-time algorithm A, there is a negligible function
: N → [0, 1] such that for every n:
3
In the exercise session, you will show that the existence of one-way functions implies P 6= NP. There
are several candidate one-way functions that no one has yet been able to invert (see book for examples),
and it is conjectured that they exist.
One reason that we are interested in one-way functions is because they can be used to design secure
encryption schemes with keys much shorter than the message length.
Theorem 5 (Encryption from one-way function) Suppose that one-way functions exist. Then for
every c ∈ N, there exists a computationally secure encryption scheme (E, D) using n-length keys for
nc -length messages.
With computational secure, we informally mean that the ciphertext should not reveal any partial infor-
mation about the plaintext to a polynomial-time eavesdropper. The formal definition turns out to be a
little cumbersome and we omit it here (see the book, Exercise 9.9). A key component of the proof of
Theorem 5 is the concept of pseudorandom generators that we introduce next.
for every n ∈ N.
It is easy to see that the existence of pseudorandom generators imply the existence of one-way functions
(an exercise). The other direction require much more work:
Theorem 7 (HILL’99) If one-way functions exist, then for every c ∈ N, there exists a secure pseudo-
random generator with stretch `(n) = nc .
The next lecture will be devoted to the proof of a slight simplification of the above theorem. Here,
we now describe how it implies Theorem 5 and then we also explain some other cool applications of
pseudorandom generators.
The above definition states that it’s infeasible for polynomial-time adversaries to distinguish between
a completely random string of length `(n) and a string that was generated by applying G to a much
shorter random string of length n. Thus it’s not hard to verify that Theorem 7 implies Theorem 5. An
informal argument is as follows:
4
• If we modify the one-time pad encryption to generate its nc -length random key by applying a
secure pseudorandom generator with stretch nc to a shorter key of length n, then a polynomial-
time eavesdropper would not be able to tell the difference (without contradicting the security of
the generator as per Definition 6).
• Therefore, since XORing the message with a random bit string is perfectly secure (one-time pad
protocol) a polynomial-timeo eavesdropper cannot get any information about the message.
4.1.1 Derandomization
The existence of pseudorandom generators implies subexponential deterministic algorithms for BPP.
Consider a language L ∈ BPP and let A be a randomized algorithm that decides L. We now reduce the
number of random bits that A requires to obtain a deterministic algorithm D. Specifically, the algorithm
D works by simply reducing the randomness requirement of A to n by using a pseudorandom generator,
and then enumerating over all the possible inputs for the pseudorandom generator.
• First A chooses two strings xA and rA of length n and sends a message (f (xA ), rA ).
• Then B selects a random bit b and sends it to A.
J
• Finally, A reveals xA and they agree to use the XOR of b and (xA rA ) as their coin toss.
Note that B can verify that XA is the same as in the first message by applying f ; therefore, A cannot
J her mind after learning B’s bit. (A’s first message
change J is a cryptographic commitment to the bit
(xA rA ). On the other hand, B cannot predict xA rA from A’s first message (assuming the Jf is
one-way as we will prove next lecture) and so she cannot bias her bit according to the choice of xA rA .
5
4.1.3 Lower bounds for machine learning
In machine learning the goal is to learn a succinct function f : {0, 1}n → {0, 1} from a sequence
(x1 , f (x1 )), (x2 , f (x2 )), . . . , where the xi ’s are randomly chosen examples from a distribution. This
problem is hard if we assume a pseudorandom generator G: suppose f is the function that takes value
1 on strings generated by G and 0 on other strings. Then f should be hard to learn since we cannot
distinguish G’s output from truly random in polynomial-time.
This is the idea on a high level but we are still not completely satisfied with the result: clearly a
random function f is also hard to learn. So in order to get a convincing hardness result for learning
we would like f to be very easy to evaluate/describe but hard to learn. This is possible to achieve by
using trapdoor pseudorandom generators and a function f that can be evaluated in parallel time cannot
be learned in polynomial time. See e.g. the paper “Cryptographic Limitations on Learning Boolean
Formulae and Finite Automata” by Kearns and Valiant.