CYS406 · Chapter 6 · Annotated SlidesPRNGs, RC4 and Block-Cipher Modes of Operation
Original
Overview

PRNGs, RC4 and Block-Cipher Modes of Operation

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.

How to read this page

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.

All 40 slides
  1. 1 Slide 1
  2. 2 Outline
  3. 3 Pseudorandom
  4. 4 Random Numbers
  5. 5 Pseudorandom Number Generators (PRNGs)
  6. 6 Random & Pseudorandom Number Generators
  7. 7 Stream Ciphers and
  8. 8 Stream Cipher Structure
  9. 9 Stream Cipher Properties
  10. 10 3. RC4
  11. 11 RC4 Key Schedule
  12. 12 RC4 Encryption
  13. 13 RC4 Example
  14. 14 RC4 Example
  15. 15 RC4 Example
  16. 16 RC4 Example
  17. 17 RC4 Example
  18. 18 RC4 Overview
  19. 19 RC4 Security
  20. 20 Modes of
  21. 21 Modes of Operation
  22. 22 Message Padding
  23. 23 Electronic Codebook Book (ECB)
  24. 24 Slide 24
  25. 25 Advantages and Limitations of ECB
  26. 26 Cipher Block Chaining (CBC)
  27. 27 Slide 27
  28. 28 Advantages and Limitations of CBC
  29. 29 Stream Modes of Operation
  30. 30 Using Block Ciphers as PRNGs
  31. 31 Cipher FeedBack (CFB)
  32. 32 s-bit
  33. 33 Advantages and Limitations of CFB
  34. 34 Output FeedBack (OFB)
  35. 35 Slide 35
  36. 36 Advantages and Limitations of OFB
  37. 37 Counter (CTR)
  38. 38 Slide 38
  39. 39 Advantages and Limitations of CTR
  40. 40 References
Slide 1 / 40

Slide 1

Slide 1: Slide 1
Slide 2 / 40

Outline

Slide 2: Outline
Slide 3 / 40

Pseudorandom

Slide 3: Pseudorandom
Slide 4 / 40

Random Numbers

Slide 4: Random Numbers
Slide 5 / 40

Pseudorandom Number Generators (PRNGs)

Slide 5: Pseudorandom Number Generators (PRNGs)

Notes

  1. PRNG: a deterministic algorithm that produces random-looking numbers from a seed.

Slide 6 / 40

Random & Pseudorandom Number Generators

Slide 6: Random & Pseudorandom Number Generators
Slide 7 / 40

Stream Ciphers and

Slide 7: Stream Ciphers and
Slide 8 / 40

Stream Cipher Structure

Slide 8: Stream Cipher Structure

Notes

  1. Stream cipher: keystream XOR plaintext. Never reuse a keystream (same key + IV).

Exam angle

PredictionQ1

Reusing the same keystream for two messages is safe if the messages differ.

Slide 9 / 40

Stream Cipher Properties

Slide 9: Stream Cipher Properties
Slide 10 / 40

3. RC4

Slide 10: 3. RC4

Notes

  1. RC4: variable-length key, byte-oriented stream cipher, simple and fast. Used in WEP and old TLS; now considered broken.

Slide 11 / 40

RC4 Key Schedule

Slide 11: RC4 Key Schedule

Notes

  1. RC4 key schedule (KSA) permutes the 256-byte state S using the key; the PRGA then outputs keystream bytes.

Slide 12 / 40

RC4 Encryption

Slide 12: RC4 Encryption
Slide 13 / 40

RC4 Example

Slide 13: RC4 Example
Slide 14 / 40

RC4 Example

Slide 14: RC4 Example
Slide 15 / 40

RC4 Example

Slide 15: RC4 Example
Slide 16 / 40

RC4 Example

Slide 16: RC4 Example
Slide 17 / 40

RC4 Example

Slide 17: RC4 Example
Slide 18 / 40

RC4 Overview

Slide 18: RC4 Overview
Slide 19 / 40

RC4 Security

Slide 19: RC4 Security
Slide 20 / 40

Modes of

Slide 20: Modes of
Slide 21 / 40

Modes of Operation

Slide 21: Modes of Operation
Slide 22 / 40

Message Padding

Slide 22: Message Padding
Slide 23 / 40

Electronic Codebook Book (ECB)

Slide 23: Electronic Codebook Book (ECB)

Notes

  1. ECB: each block encrypted independently. Identical plaintext blocks → identical ciphertext blocks (patterns leak).

  2. Trap ECB leaks patterns (the "ECB penguin"); never use it for more than one block.

Exam angle

PredictionQ1

Which mode produces identical ciphertext for identical plaintext blocks?

Slide 24 / 40

Slide 24

Slide 24: Slide 24
Slide 25 / 40

Advantages and Limitations of ECB

Slide 25: Advantages and Limitations of ECB
Slide 26 / 40

Cipher Block Chaining (CBC)

Slide 26: Cipher Block Chaining (CBC)

Notes

  1. CBC: each plaintext block is XORed with the previous ciphertext block (first with an IV) before encryption. Sequential encryption; an error affects two blocks.

Exam angle

PredictionQ1

In CBC, the first plaintext block is XORed with:

Slide 27 / 40

Slide 27

Slide 27: Slide 27
Slide 28 / 40

Advantages and Limitations of CBC

Slide 28: Advantages and Limitations of CBC
Slide 29 / 40

Stream Modes of Operation

Slide 29: Stream Modes of Operation
Slide 30 / 40

Using Block Ciphers as PRNGs

Slide 30: Using Block Ciphers as PRNGs
Slide 31 / 40

Cipher FeedBack (CFB)

Slide 31: Cipher FeedBack (CFB)

Notes

  1. CFB: turns a block cipher into a self-synchronizing stream cipher.

Slide 32 / 40

s-bit

Slide 32: s-bit
Slide 33 / 40

Advantages and Limitations of CFB

Slide 33: Advantages and Limitations of CFB
Slide 34 / 40

Output FeedBack (OFB)

Slide 34: Output FeedBack (OFB)

Notes

  1. OFB: keystream from repeatedly encrypting the IV; bit errors don’t propagate.

Slide 35 / 40

Slide 35

Slide 35: Slide 35
Slide 36 / 40

Advantages and Limitations of OFB

Slide 36: Advantages and Limitations of OFB
Slide 37 / 40

Counter (CTR)

Slide 37: Counter (CTR)

Notes

  1. CTR: encrypt a counter for each block and XOR. Parallel, random access, needs a unique nonce per message.

Exam angle

PredictionQ1

Which mode allows parallel encryption and random access to blocks?

Slide 38 / 40

Slide 38

Slide 38: Slide 38
Slide 39 / 40

Advantages and Limitations of CTR

Slide 39: Advantages and Limitations of CTR
Slide 40 / 40

References

Slide 40: References