Stream Cipher
Cheat sheet · https://pcornel.dk/topic.php?topic=4692
Answer
A stream cipher encrypts data by combining it with a keystream generated from a key and nonce, such as ChaCha20. Reusing a key and nonce pair breaks security completely.
Remember
- Stream ciphers XOR data with a keystream.
- Reusing a key and nonce pair breaks security completely.
- Combine with a MAC or use an AEAD construction.
First checks
- Keystream reuse checks — never reuse key+nonce
- Integrity added (Poly1305/HMAC) — authentication
- RC4 usage — must be none
Verify in this order
key + nonce → keystream ⊕ plaintext
Where it usually breaks
First mismatch in key/secret generation → storage/rotation → trust/certificate validation → protocol negotiation → cryptographic operation → peer/application verification; preserve identity/policy/pre-state before mutation.
Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=4692