cryptography

Definition

Stream Cipher

A stream cipher is a symmetric cipher that approximates the One-Time-Pad. The key is used as a seed to initialise the state of a pseudorandom generator (PRG), which produces a keystream that is combined with the plaintext (typically via bitwise XOR).

State Update

The PRG state is updated periodically, for example before the generation of each output:

Security

Dependence on the PRG

A stream cipher does not provide perfect secrecy; its security depends entirely on the quality of the PRG. If the next output is predictable from previous ones, the cipher can be broken when part of the plaintext is known or guessable.

Malleability

Stream ciphers are malleable. Given a ciphertext , an attacker can compute , which decrypts to .