1WP to PRG
Adapted from the 2016 PUMaC power round (a team-based math competition at Princeton), written by Eric Neyman.
This note shows how to get pseudorandom generators from one-way permutations.
The main players
What we want: pseudorandom generators
A pseudorandom generator is a way to turn a small number of uniformly random bits into a larger number of bits which look for all intents and purposes like they’re uniformly random. Where here “all intents and purposes” means “polynomial-time algorithms trying to tell the difference”. More precisely,
is computable in polynomial time; is computationally indistinguishable from uniform: that is, for all PPT algorithms ,
where
Pseudorandom generators are great! They can take any application that normally requires a large number of random bits and make it require much fewer. One such application is private-key encryption. If you XOR a message with a uniformly random string of the same length, the result will be uniformly random. This means that, as long as you’re willing to exchange encryption keys that have the length as your messages, you can get perfect security: this is the “one-time pad”. Pseudorandom generators allow you to drastically reduce the size of the encryption key by turning short truly-random keys into very long pseudorandom “keys” that work just as well as uniform against PPT adversaries.
What we have: one-way permutations
Suppose you have a one-way permutation: a bijective function
Exponentiation modulo
is computable in polynomial time: if you know , you can compute (using repeated squaring); seems hard to compute: suppose you know , it’s not clear how to compute .
The discrete log hypothesis states that no PPT algorithm
The middle man: hardcore bits
Hardcore bits
Suppose you had a string
The issue, though, is that the only way to make
The reason why the above can’t work is that we’re giving
This leads us to the notion of a “hardcore bit”. A hardcore bit for a one-way permutation
Hardcore bits are good enough
We claim that a hardcore bit is all we need to get pseudorandom generators: that is, if
This will work via a hybrid argument. Denote by
We claim that the first two are computationally indistinguishable, and so are the last two. Therefore
First, let’s show that
Second, we need to show that
Hardcore bits exist
Looking for something unguessable
Suppose you have some one-way permutation
One very reasonable proposal would be that any bit of
A second natural attempt would be to take the parity of all bits
Intuitively, this last attempt failed because we picked a specific parity, which can be revealed by the one-way function if it’s feeling contrarian. But it seems like a random parity (a parity of a random subset of the variables
The way to make this intuition formal is cheat a little bit. We won’t give a hardcore bit for
(even though we’re giving the last
where
How can we show that
Attempt 1: wishfully hoping that things go right
Now, some of the difficulty in this is that
- receive
; - draw
different values for uniformly at random: ; - run
on inputs ; - if everything went well, this gives us
; - based on this “system” of
“equations”, find using Gaussian elimination.
For this, two things need to work well.
need to generate all of . This is true with high probability (I think something like ). needs to succeed on all queries that were made to it. Since all are uniform, each query has probability at least to succeed, so by a union bound, they all succeed simultaneously with probability at least .
Overall, we get probability of success at least
Attempt 2: getting strategic
If
But we still have the guarantee that most equations will be correct. Could we still recover
So what do you do? Well, if we can’t count on the problem being solvable given a random set of equations, you need to be more strategic about which equations you ask for. But you can’t just ask arbitrary equations and expect to get the right answer most of the time, because you only have the guarantee that
More precisely, we’ll assume that for this
Note that both
But if
Attempt 3: a bit of magical assistance
The previous attempt (along with all naive extensions I was able to come up with) is fundamentally limited by the fact that it needs two queries to
Let’s say that an angel decends from the sky and presents to us
In particular, say
Unfortunately, there is no magic in the world. If we tried to just randomly guess the values those
But is there a more “efficient” way to guess a lot of parities (maybe sacrificing a little bit of their independence)? It would never have occurred to be to ask this question, but it turns out the answer is yes! What you can do is generate a small number of random strings
Now, those strings
Overall, this gives us a way to recover
-
Think something like
, but here we’ll only prove (which is still nontrivial and cool but not as useful). ↩ -
That is,
modulo . ↩ -
In practice, you can just choose some
that’s very close to (but less than) a power of , and map any inputs greater than to themselves. Since there will be very few of those, it won’t undermine the one-wayness of the function by much. ↩ -
Since
is independent of the previous bits, the parity gives no information at all about . So all we know about is , and therefore it is hard to guess . ↩ -
Note that this technically only works for extending even-length strings by one. But given a pseudorandom generator
, it’s very easy to make a pseudorandom generator : just add a “dummy bit” that just gets copied from the input to the output: . It’s clear that if you can distinguish from , then you can also distinguish from . ↩ -
And assuming that the noise is chosen independently in each equation, which we shouldn’t assume here: we only know that
succeeds with probability greater than on average, not independently over each input (whatever that means). ↩ -
In fact, the natural generalization of this problem to
instead of is called “learning with errors” and many cryptographic schemes assume that it is hard! Also, please don’t quote me on this, I’ve only done some shallow googling; this Wikipedia article seems relevant if you want to look into it. ↩