1.3 A Discrete Probability Toolbox
Why probability in cryptography? Because “secure” is a claim about what an attacker can do, and the precise version of that claim is a bound on how often she succeeds: every definition we will use (perfect secrecy, pseudorandomness, unforgeability) bounds the chance of some bad event, such as the attacker guessing the key. This section collects the tools the rest of the tutorial needs: distributions, events, the union bound, random variables, independence, one lemma about XOR, and the birthday paradox.
Throughout,
1.3.1 Probability distributions
Think of a probability distribution as a set of weights, one for each outcome. Each weight is between 0 and 1, and together they add up to 1. A fair die gives each face weight 1/6; a loaded die gives one face more. Formally:
Definition (probability distribution)
A probability distribution
Two extremes matter:
- Uniform distribution:
for every . - Point distribution at
: and for all .
Concretely, for
whose entries sum to
1.3.2 Events and the union bound
An event is a yes/no question about the outcome. “The last two bits are 11” selects some outcomes and excludes the rest; its probability is the total weight of the selected outcomes. Formally, for a subset
and call
Example: on
has probability 11).
If either of two bad events would sink an experiment, the chance that at least one occurs is no larger than the sum of the two chances, because that sum counts the overlap twice. The one inequality you will use in every security proof:
Theorem (union bound)
For events
The proof is one line: summing over
Example: on
(Here the true value is
1.3.3 Random variables
Think of a random variable as a numerical label attached to each outcome. Toss two coins and let
Definition (random variable)
A random variable
Given a distribution on
Example:
The mental picture:
Quiz: Let be uniform on and define to be the number of 1-bits of . Find .
1.3.4 The uniform random variable and sampling notation
To say “we draw an element of
meaning:
Formally,
1.3.5 Independence
Two events are independent when learning that one happened does not change the chance of the other. For random variables, independence means that no event about
Definition (independence)
Events
Random variables
Example:
and the same check works for the other three pairs, so
1.3.6 Randomized algorithms
A randomized algorithm is allowed to toss fresh coins while it runs, so two runs on the same input may differ. Formally, a deterministic algorithm takes an input
and its output is a random variable. Encryption is the familiar example,
1.3.7 XOR and the masking lemma
The bitwise XOR of two strings in
For every fixed
Theorem (masking lemma)
Let
is uniform on
Proof for
where the second equality is independence. But
Since
Read the theorem as a security statement: with
1.3.8 The birthday paradox
The birthday phenomenon is a statement about pairs rather than samples: the chance of a collision grows roughly like
Theorem (birthday bound)
Let
the probability that some pair collides,
Derivation: work with the complement. “No collision” means
Each factor satisfies
and therefore
which is the familiar
The proof assumes a uniform distribution; for non-uniform distributions collisions are only more likely, so the guarantee still holds.
The name comes from birthdays: with
A worked table for
| collision probability | |
|---|---|
With
With the notation in place, Chapter 2 asks what is a secure cipher, and answers it exactly, once: the one-time pad.