Stream cipher attacks, malleability, and real constructions
- •
The Two-Time Pad attack
- •
- •
- •
Algorithmic recovery
- •
Historic and protocol vulnerabilities
- •
Venona Project (1940s) -> Soviet intelligence accidentally duplicated one-time pad sheets, enabling US intelligence to decrypt thousands of diplomatic transmissions over decades
- •
Microsoft PPTP -> Point-to-Point Tunneling Protocol initialized separate client and server communication channels using the exact same RC4 key and direction counter, allowing eavesdroppers to XOR opposing traffic streams
- •
Disk encryption vulnerability -> stream ciphers should never be used for sector-level disk encryption: modifying a document and saving it re-encrypts the sector under the same key, revealing the exact diff ()
- •
- •
- •
Malleability and lack of integrity
- •
RC4 stream cipher and its cryptanalytic failure
- •
Architecture (Ron Rivest 1987)
- •
- •
Key Scheduling Algorithm (KSA) -> initializes , then scrambles the array based on key :
- •
j = 0 for i in range(256): j = (j + S[i] + k[i % key_len]) % 256 S[i], S[j] = S[j], S[i]
- •
- •
Pseudo-Random Generation Algorithm (PRGA) -> generates output stream byte-by-byte:
- •
i = (i + 1) % 256 j = (j + S[i]) % 256 S[i], S[j] = S[j], S[i] output = S[(S[i] + S[j]) % 256]
- •
- •
Cryptanalytic biases
- •
Initial byte biases (Fluhrer-Mantin-Shamir / Roos) -> the 2nd output byte equals 0 with probability , twice the expected probability of . The 1st and 3rd bytes also exhibit significant non-uniformity
- •
Digram bias (Fluhrer-McGrew) -> the consecutive byte sequence
00appears with probability , detectable after several gigabytes of stream output - •
Related-key vulnerabilities (FMS attack) -> when keys share common prefixes (as in WEP's ), internal state correlation leaks key bytes directly from early keystream bytes
- •
- •
Current status -> banned by IETF for TLS (RFC 7465); completely deprecated for all modern cryptographic engineering
- •
- •
- •
Content Scrambling System (CSS)
- •
Achitecture
- •
Cryptanalysis and complete collapse
- •
a 40-bit key space allows exhaustive brute-force search in operations.
- •
Stevenson attack (known-plaintext attack)
- •
guess the 16 secret bits of LFSR-17 ( possibilities)
- •
run LFSR-17 to produce candidate output bytes
- •
subtract candidate bytes from known MPEG packet header keystream bytes to deduce the required output of LFSR-25
- •
check whether the deduced stream satisfies the linear recurrence of LFSR-25
- •
fully recovers the complete 40-bit key in under 1 second on a personal computer
- •
- •
- •
Cryptographic lesson -> proprietary algorithms and security through obscurity cannot compensate for short key lengths and linear algebraic structures.
- •
- •
Salsa20 modern stream cipher
- •
Origin and standardization
- •
designed by Daniel J. Bernstein for the European eSTREAM project (concluded 2008; selected for the final software portfolio). Precursor to ChaCha20
- •
- •
Core architecture
- •
- •
ARX primitive -> uses only Addition modulo , bitwise Rotation, and XOR (
a ^= (b + c) <<< d). - •
eliminates data-dependent table lookups, rendering the implementation immune to cache-timing side-channel attacks.
- •
20 rounds -> 10 double-rounds alternating between column-rounds and row-rounds.
- •
Feed-forward addition -> final state is word-wise added to the initial state (), preventing backward inversion of the permutation.
- •
- •
- •



