# Why are stream ciphers computationally secure?

In case multiple stream ciphers exist, I'm refering to this specific instance in which you generate a key that is just as long as the msg, M, as a function of a nonce and a smaller key K.

My textbook classifies this as computational secure. But why is that?

I would say that it was unconditionally secure since assuming the adversary is able to find a long key O_2 that when XOR'ed with the ciphertext produces a sensible M="sensible text", the adversary still has no clue whether that was the original message or not (it could have been the case the sender's actual msg was pure garbage).

• Basically, the keystreams aren't purely random. They can't be, because you feed limited entropy into them. If your generator creating O takes 128 bits of key data, then at most 2^128 unique keystreams are possible. If an attacker could, for instance distinguish between a keystream created by O and genuine random data then that would reduce the searchspace a lot. Dec 19, 2021 at 14:05
• Also, look at real life examples of stream ciphers being broken to understand their weaknesses. Dec 19, 2021 at 14:08
• Could you rewrite your first sentence? It seems like you are saying that from a short key $K$, producing a stream equal to message size is unconditionally secure. Dec 19, 2021 at 18:28
• I believe OP has confused the keystream, which is as long as the message, with a key. There's only one key in a stream cipher, it's short and gets combined with a nonce to produce the keystream. The keystream gets XORed (or otherwise reversibly combined) with the plaintext to produce the ciphertext. Using the right words is important to avoid confusion. Dec 20, 2021 at 3:44
• Please note that the comments and answers here are interpreting "unconditionally secure" as information theoretically secure. If that is not your intent please clarify what you mean by "unconditionally secure". Dec 21, 2021 at 0:16

If I understand the question right, it's about whether a truncated stream cipher $$X(K,N)$$ is unconditionally secure.
First, for a single message per key (and so, one fixed nonce $$N$$), the stream cipher is unconditionally secure if and only if the stream generator $$X(\cdot,N)$$ is a bijection, for the chosen nonce. Then, it is equivalent to using a fresh uniformly random key, which achieves perfect secrecy.