# Decrypting ciphertext produced by the Trivium stream cipher

Given a message that is encrypted using a Trivium and the key that was used to encrypt it, how does the receiver decrypt the message?

• That's two rather different questions, please split the question in two separate questions (I can easily answer one of them, the other not so easy). – Maarten Bodewes Feb 15 '17 at 2:23
• Edited out "I am also wondering why the three registers in a Trivium were chosen to be of different lengths."... – Maarten Bodewes Feb 15 '17 at 2:24

## 1 Answer

Trivium is a synchronous stream cipher. For synchronous stream ciphers the key stream is independent of the plaintext and ciphertext.

The key stream (which is not the key itself, but the output of the cipher construction) is then combined in a reversible way with the plaintext to for the ciphertext (commonly byte-by-byte). The reverse operation with the same key stream and the ciphertext brings back the plaintext.

Usually XOR is used, which allows you to use the exact same construction for both encryption and decryption (as $PT \oplus KS = CT$ and therefore $CT \oplus KS = PT$).