A pseudorandom function (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 .
Security Game
A distinguisher is given oracle access to a function and must output a single bit guessing whether was drawn as for a random key , or as a uniformly random function .
A family is a secure PRF iff is negligible for every probabilistic polynomial-time (PPT) , over the random choice of or .
- 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.
Pseudorandom Permutations
A pseudorandom permutation (PRP) family restricts each to a bijection on , indistinguishable from a permutation chosen uniformly at random from all permutations on , rather than from all functions.
Block ciphers are designed to be PRP families: plays the role of , and must also be efficiently computable, a requirement a general PRF has no need for.
Construction from a Pseudorandom Generator
A pseudorandom generator (PRG) stretches a short seed into a longer pseudorandom string. 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