Pseudorandom generators, indistinguishability, and stream ciphers
- •
Pseudorandom generators (PRGs)
- •
Statistical tests and PRG security
- •
Statistical test
- •
an efficient algorithm taking an -bit candidate string and outputting 1 ("looks random") or 0 ("does not look random")
- •
Examples -> testing whether 0s and 1s are balanced (), counting "00" substrings, or measuring longest consecutive runs.
- •
Limitation of fixed test batteries -> passing empirical statistical suites (e.g. NIST SP 800-22) does not establish cryptographic security; an adversary can devise a custom polynomial-time test not included in the battery.
- •
- •
- •
Cryptographically secure PRG
- •
- •
Predictability and Yao's Next-Bit Theorem
- •
- •
Why predictability ruins cipher security
- •
Yao's Next-Bit Theorem (Yao 1982)
- •
a generator is unpredictable at every bit position if and only if is a cryptographically secure PRG
- •
Universality of next-bit predictors -> although statistical tests can evaluate arbitrary global properties, next-bit predictability is mathematically complete: if no efficient algorithm can predict the next bit, no efficient statistical test can distinguish from uniform randomness.
- •
easy direction: a next-bit predictor readily forms a statistical test. surprising direction: indistinguishability from all tests follows from next-bit unpredictability alone.
- •
- •
Stream cipher construction and security reduction
- •
- •
let be a cryptographically secure PRG
- •
- •
Shannon limitation
- •
since key length , Shannon's Theorem dictates the cipher cannot have perfect security
- •
- •
Security Theorem -> If is a secure PRG, the resulting stream cipher is semantically secure.
- •
The "Swap-to-Random" security reduction (Game-hopping proof)
- •
Game 0 (Real Game) -> challenger samples , computes challenge ciphertext , and sends to adversary .
- •
Game 1 (Ideal Game) -> challenger samples truly random string , computes challenge , and sends to .
- •
Step 1 (Ideal Game analysis) -> in game 1, the encryption is an actual One-Time Pad. By the XOR Uniformity Lemma , is strictly uniform and independent of bit . Therefore, the adversary's advantage in Game 1 is identically zero:
- •
Step 2 (Distinguisher construction) -> if adversary 's behavior changes between Game 0 and Game 1, serves as an efficient distinguisher against the PRG :
- •
Conclusion -> .
- •
- •
- •
Multi-message security and Nonces
- •
The single-message restriction -> basic stream cipher keys must never encrypt more than one message, otherwise keystreams collide.
- •
- •
Security requirement
- •
WEP's structural failure -> IEEE 802.11b WEP used a 24-bit IV prepended to the key. After transmitting frames, the Birthday Paradox ensures IV collisions, leading to complete keystream reuse.
- •

