This article uses too much jargon, which needs explaining or simplifying. (January 2024) |
In cryptography, a stream cipher is a symmetric key cipher where plaintext bits are combined with a pseudorandom cipher bit stream (keystream) using an exclusive-or (xor) operation. In a stream cipher the Plaintext digits are encrypted one at a time, and the transformation of successive digits varies during the encryption state. An alternative name is a state cipher, as the encryption of each digit is dependent on the current state. In practice, the digits are typically single bits or bytes.
Stream ciphers represent a different approach to symmetric encryption from block ciphers. Block ciphers operate on large blocks of fixed length. Stream ciphers typically execute at a higher speed than block ciphers and have lower hardware requirements. However, stream ciphers can have serious security problems if used incorrectly; in particular, the same starting state must never be used twice.
A stream cipher makes use of a much smaller and more convenient cryptographic key, for example 128 bits keys. Based on this key, it generates a pseudorandom keystream which can be combined with the plaintext digits in a similar way to the one-time pad encryption algorithm. However, because the keystream is pseudorandom, and not truly random, the security associated with the one-time pad cannot be applied and it is quite possible for a stream cipher to be completely insecure.