keystream
In cryptography, a keystream is a stream of random or pseudorandom characters that are combined with a plaintext message to produce an encrypted message (the ciphertext). The "characters" in the keystream can be bits, bytes, numbers or actual characters like A-Z depending on the usage case. Usually each character in the keystream is either added, subtracted or XORed with a character in the plaintext to produce the ciphertext, using modular arithmetic. Keystreams are used in the one-time pad cipher and in most stream ciphers. Block ciphers can also be used to produce keystreams. For instance, CTR mode is a block mode that makes a block cipher produce a keystream and thus turns the block cipher into a stream cipher.
In cryptography, a keystream is a stream of random or pseudorandom characters that are combined with a plaintext message to produce an encrypted message (the ciphertext). The "characters" in the keystream can be bits, bytes, numbers or actual characters like A-Z depending on the usage case. Usually each character in the keystream is either added, subtracted or XORed with a character in the plaintext to produce the ciphertext, using modular arithmetic. Keystreams are used in the one-time pad cipher and in most stream ciphers. Block ciphers can also be used to produce keystreams. For instance, CTR mode is a block mode that makes a block cipher produce a keystream and thus turns the block cipher into a stream cipher.
References
No reference rows published for this article.
Cite this article
MLA
"keystream." encyclopegia.org, 2023, https://encyclopegia.org/wiki/keystream. Accessed 24 November 2026.
Chicago
"keystream." encyclopegia.org. Accessed November 24, 2026. https://encyclopegia.org/wiki/keystream.
APA
encyclopegia.org. (2023). keystream. Retrieved November 24, 2026, from https://encyclopegia.org/wiki/keystream
Accessed November 24, 2026 · CC BY-SA 4.0 · citation page · JSON