Pseudorandomness is the property that an efficiently computable deterministic construction is indistinguishable from an ideal random object to every efficient adversary.
Purely deterministic computer programs cannot produce true randomness. They require entropy from physical events. Pseudorandom constructions expand a short true-random seed into values that look random to efficient adversaries.
PRFs and PRPs use a short secret key to select a deterministic efficient function. Both are secure when no efficient distinguisher can distinguish the keyed function from its ideal random object.
Distinguisher
A distinguisher is an algorithm that receives a value or oracle and outputs 1 bit to guess which of 2 distributions produced it.
A probabilistic polynomial-time (PPT) distinguisher uses random bits and runs in time polynomial in the security parameter .
Computational Indistinguishability
Distributions and are computationally indistinguishable iff every PPT distinguisher has negligible advantage:
- first distribution at security parameter
- second distribution at security parameter
- PPT distinguisher
-
probability that outputs for a sample from
-
probability that outputs for a sample from
- security parameter
Both probabilities include the random sample and the random choices made by . As increases, no efficient distinguisher gains a useful way to tell the 2 distributions apart.
Pseudorandom Generators
Also known as PRG. A function that stretches a short seed into a longer pseudorandom string. The output is computationally indistinguishable from a uniformly random -bit string when is chosen uniformly.
Pseudorandom Functions
Also known as PRF. A PRF family is a set of efficiently computable functions , indexed by a key , that no efficient adversary can distinguish from a function chosen uniformly at random from all functions on .
Key Space
The definition uses an -bit key, so the family has candidate keys. This is the number of selectable keyed functions before accounting for any distinct keys that happen to define the same function. It is much smaller than the functions from bits to bits.
Security Game
A distinguisher is an efficient attacker program. It receives blackbox access to a hidden function. can query the blackbox for any input and receive the function’s output for .
The challenger secretly gives 1 of 2 possible oracles.
- PRF oracle
The challenger chooses uniformly and uses . Once is chosen, is deterministic. - Random oracle
The challenger chooses a truly random function . Every input has an independently chosen random output. Repeated queries for the same input produce the same output.
may make queries adaptively. Each new query may depend on earlier answers. The challenger never reveals or .
After making its queries, outputs 1 bit. Output means that guesses the PRF oracle. Output means that guesses the random oracle.
The first probability is the chance that says PRF when it receives . The second is the chance that says PRF when it receives . The difference is ‘s distinguishing advantage.
A family is a secure PRF iff is negligible for every probabilistic polynomial-time (PPT) , over the random choice of or . is pseudorandom because it looks like the truly random function to every efficient distinguisher.
- The number of oracle queries may make is polynomial in , since itself runs in polynomial time.
- never sees , only input-output pairs of the oracle it queries.
Construction from a Pseudorandom Generator
Write and for the first and second -bit halves of .
The Goldreich-Goldwasser-Micali (GGM) construction builds a PRF from . To evaluate for an -bit input , walk a binary tree of depth rooted at , taking the left half at each bit of and the right half at each bit.
- Every leaf of the tree corresponds to a distinct input , reached by a distinct sequence of PRG calls.
- A secure PRG makes each level indistinguishable from random, so the composed function is indistinguishable from random overall.
This shows a PRF exists whenever a PRG does, and a PRG exists whenever a one-way function does.
Uses
- Message authentication
A MAC over a fixed-length message under key can be computed directly as . - Counter mode encryption
CTR mode, in block encryption schemes, uses evaluated at a counter as the keystream. Only the PRF property is needed, not the PRP’s invertibility. - Key derivation
A single master key produces many independent-looking sub-keys
Pseudorandom Permutations
Also known as PRP. A PRP family restricts each to a bijection on . It is indistinguishable from a permutation chosen uniformly at random from all permutations on .
Different inputs of a PRP always have different outputs. A PRF allows repeated outputs. A PRP is bijective, so its inverse exists and is efficiently computable. A PRF need not be bijective. It need not have an inverse.
Block ciphers are designed to be PRP families. plays the role of . provides the reverse transformation.