Keystream
A keystream is the sequence of values combined with successive plaintext units during encryption.
Definition
A keystream is an ordered sequence used one element at a time to transform a message. Classical ciphers may add letter shifts modulo the alphabet; digital stream ciphers usually combine bits or bytes with XOR.
Key versus keystream
The secret key is compact input to a cipher, while the keystream is the position-by-position sequence derived from it, often together with a nonce. In Vigenère, repeating the keyword produces a simple keystream; modern generators aim for a long unpredictable sequence.
Reuse and predictability
Reusing the same keystream for different messages can expose relations between their plaintexts, especially with XOR. A one-time pad is secure only when its keystream is truly random, as long as the message, secret, and never reused.
No. The key is an input; the keystream is the sequence consumed while encrypting or decrypting.
Secure designs impose strict nonce and reuse rules. Repeating the same stream across messages can reveal information or fully break confidentiality.