What is Stream cipher?
{{jargon|date=January 2024}} [[Image:A5-1 GSM cipher.svg|280px|thumbnail|The operation of the [[keystream]] generator in [[A5/1]], a LFSR-based stream cipher used to encrypt mobile phone conversations.]] In [[cryptography]], a '''stream cipher''' is a [[Symmetric-key algorithm|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]] [[Numerical digit|digits]] are encrypted one at a time, and the transformation of successive [[Numerical digit|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 [[bit]]s or [[byte]]s. Stream ciphers represent a different approach to [[Symmetric-key algorithm|symmetric]] [[encryption]] from [[block cipher]]s. Block ciphers operate on large blocks of fixed length. Stream ciphers typically execute at a higher speed than block ciphers and have lower [[Computer hardware|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 [[Key (cryptography)|cryptographic key]], for example [[Key size|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. ==Types of stream ciphers== A stream cipher generates successive elements of the [[keystream]] based on an internal state. This state is updated in two ways: # If the ''state'' changes independently of the [[plaintex