Reusing the same keystream for two messages is safe if the messages differ.
- C1 ⊕ C2 = P1 ⊕ P2 leaks information.
Random vs. pseudorandom numbers, PRNGs, stream ciphers and RC4 (key schedule, encryption, security), then the modes of operation: ECB, CBC, CFB, OFB and CTR with their advantages and limitations.
Every original slide is shown unchanged. Yellow marks on a slide point to a numbered note: hover or tap a mark to jump to its note, and hover a note to see its marks. Questions tagged Past exam appeared on a real paper; Prediction questions are likely angles, not confirmed. Pick an answer to each question: a wrong pick tells you why it is wrong, so you can try again.
PRNG: a deterministic algorithm that produces random-looking numbers from a seed.
Stream cipher: keystream XOR plaintext. Never reuse a keystream (same key + IV).
Reusing the same keystream for two messages is safe if the messages differ.
RC4: variable-length key, byte-oriented stream cipher, simple and fast. Used in WEP and old TLS; now considered broken.
RC4 key schedule (KSA) permutes the 256-byte state S using the key; the PRGA then outputs keystream bytes.
ECB: each block encrypted independently. Identical plaintext blocks → identical ciphertext blocks (patterns leak).
Trap ECB leaks patterns (the "ECB penguin"); never use it for more than one block.
Which mode produces identical ciphertext for identical plaintext blocks?
CBC: each plaintext block is XORed with the previous ciphertext block (first with an IV) before encryption. Sequential encryption; an error affects two blocks.
In CBC, the first plaintext block is XORed with:
CFB: turns a block cipher into a self-synchronizing stream cipher.
OFB: keystream from repeatedly encrypting the IV; bit errors don’t propagate.
CTR: encrypt a counter for each block and XOR. Parallel, random access, needs a unique nonce per message.
Which mode allows parallel encryption and random access to blocks?