Leftover hash lemma


The leftover hash lemma is a lemma in cryptography first stated by Russell Impagliazzo, Leonid Levin, and Michael Luby.
Imagine that you have a secret key that has uniform random bits, and you would like to use this secret key to encrypt a message. Unfortunately, you were a bit careless with the key, and know that an adversary was able to learn the values of some bits of that key, but you do not know which bits. Can you still use your key, or do you have to throw it away and choose a new key? The leftover hash lemma tells us that we can produce a key of about bits, over which the adversary has almost no knowledge. Since the adversary knows all but bits, this is almost optimal.
More precisely, the leftover hash lemma tells us that we can extract a length asymptotic to bits from a random variable that are almost uniformly distributed. In other words, an adversary who has some partial knowledge about, will have almost no knowledge about the extracted value. That is why this is also called privacy amplification.
Randomness extractors achieve the same result, but use less randomness.
Let be a random variable over and let. Let be a 2-universal hash function. If
then for uniform over and independent of, we have:
where is uniform over and independent of.
is the min-entropy of, which measures the amount of randomness has. The min-entropy is always less than or equal to the Shannon entropy. Note that is the probability of correctly guessing. Therefore, the min-entropy measures how difficult it is to guess.
is a statistical distance between and.