Stream Cifrador Referencia Guía
General referencia para stream cifrador design principios, modos de operación, y seguridad requirements.
Design Principles
A stream cipher generates a pseudorandom keystream that is XORed with the plaintext to produce ciphertext. The keystream must be computationally indistinguishable from random for security. Most modern stream ciphers use ARX (add-rotate-xor) or NLFSR constructions for speed and side-channel resistance. The nonce must never be reused with the same key, or security is catastrophically lost.
- keystream
- Pseudorandom output XORed with data
- nonce
- Must be unique per key
- state
- Updated each block
C = P XOR KS reuse is fatal counter or LFSR Security Requirements
Stream ciphers require unique nonces and sufficiently long key sizes to resist brute force. The keystream period must exceed the maximum message length. Modern designs like ChaCha20 and AES-CTR provide provable security reductions to the underlying primitive. Initialization vectors must be generated with a cryptographically secure random source.
- nonce reuse
- Causes two-time-pad attack
- key length
- At least 128 bits
- period
- Must exceed message length
XOR of plaintexts leaks 256 recommended 2^128 typical