Chapter 11 of 22 Part III: Trust, Cryptography & Security

The Art of Secret Messages

Difficulty: Applied Editorial estimate: ~55 min Prerequisites: Chapter 02, Chapter 08

Chapter Field Guide

Measurable Learning Outcomes

  • Demonstrate why simple substitution ciphers fall quickly to frequency analysis.
  • Trace modular exponentiation in a small Diffie-Hellman key exchange.
  • Explain why real systems use authenticated encryption (AES-GCM) with unique nonces instead of toy ciphers.

Core Scientific Intuition

Classical ciphers like Caesar shifts preserve letter frequencies, letting an analyst crack them in seconds. Modern cryptography separates public algorithms from secret keys: Diffie-Hellman uses modular exponentiation so two parties compute the same shared secret g^(ab) mod p without sending a or b. Real encrypted traffic then uses authenticated ciphers like AES-GCM, which provide both confidentiality and tamper detection.

S = (gᵇ mod p)ᵃ mod p = (gᵃ mod p)ᵇ mod p = gᵃᵇ mod p
In plain words: Both sides raise the other's public value to their own private exponent modulo p to arrive at the identical shared secret.
Units & assumptions: Educational small primes illustrate the algebra; production systems use 2048+ bit groups or elliptic curves (X25519/P-256).

Worked Example

With p = 23, g = 5, Alice picks a = 6 (sends 5^6 mod 23 = 8) and Bob picks b = 15 (sends 5^15 mod 23 = 19). Both compute 19^6 mod 23 = 8^15 mod 23 = 2.

Hands-On Exploration

Interactive Laboratory

Test the concepts directly with 4 interactive panels, live controls, and visual feedback.

Open Interactive Lab →

Three Guided Projects

Structured experiments with hypotheses, boundary tests, hints, and reflection prompts.

View 3 Projects →

Source Code (3 Snippets)

Inspect byte-identical printed JavaScript blocks, download `.js` files, or test runnable blocks in the isolated sandbox.

Browse Code →

Self-Check Quiz (5 Questions)

Immediate explanations for every choice, unlimited retries, and local-only score tracking.

Take Self-Check Quiz →

Book Chapter Outline (Reference Guide)

Section headings from Volume 1 for cross-referencing with the printed book.

Show all 39 book section headings
  1. A message through a glass tube
  2. PEOPLE BEHIND THE SCIENCE
  3. Julius Caesar (100-44 BCE)
  4. Ron Rivest (born 1947)
  5. PEOPLE BEHIND THE SCIENCE
  6. Adi Shamir (born 1952)
  7. Leonard Adleman (born 1945)
  8. A wheel that turns letters
  9. The mathematics
  10. How to break the classroom cipher
  11. Frequency analysis
  12. Meet the pioneer: Alan Turing
  13. The machine that changed its alphabet
  14. One secret key, two friends
  15. A new challenge
  16. A lock anyone can close
  17. Public keys and trust
  18. Meet the pioneers of public-key agreement
  19. Whitfield Diffie (born 1944)
  20. Martin Hellman (born 1945)
  21. A shared secret from public numbers
  22. Can a messaging company read your message?
  23. What encryption cannot hide by itself
  24. Project 1: build a secret alphabet
  25. Read the code
  26. Project 2: the pattern detective
  27. Read the code
  28. Project 3: a secret that was never sent
  29. Your secret-message laboratory
  30. Experiment A: change the alphabet
  31. Experiment B: count the clues
  32. Experiment C: share a result
  33. The case of the replaced invitation
  34. Your mission
  35. When the lock is not enough
  36. Invent your own classroom cipher game
  37. Design a responsible messaging interface
  38. Words to keep and sources to explore
  39. Sources and image credits

Primary Sources & Further Reading

External links are provided for independent verification and deeper study. Link availability can change over time; see the Resources page for verification notes.

Source Type Link
Read more reference https://penelope.uchicago.edu/Thayer/E/Roman/Texts/Suetonius/12Caesars/Julius%2A.html
Further reading reference https://www.nsf.gov/cise/turing-awardees
Historical portrait and rights information reference https://commons.wikimedia.org/wiki/File:Alan_Turing_(1912-1954)_in_1936_at_Princeton_University_(b%26w).jpg
Biography: King’s College, Cambridge, Turing Digital Archive reference https://turingarchive.kings.cam.ac.uk/about-alan-turing
Stanford: biographies and historical photo educational-archive https://news.stanford.edu/stories/2016/03/turing-hellman-diffie-030116
Wikimedia Commons: composite photograph and licensing reference https://commons.wikimedia.org/wiki/File:Diffie_and_Hellman.jpg
Science Museum: Breaking Enigma, a story of European co-operation reference https://blog.sciencemuseum.org.uk/breaking-enigma-a-story-of-european-co-operation/
NIST: symmetric-key cryptography primary-standard https://csrc.nist.gov/glossary/term/symmetric_key_cryptography
NIST: public-key cryptography primary-standard https://csrc.nist.gov/glossary/term/public_key_cryptography
IETF: TLS 1.3 specification primary-standard https://datatracker.ietf.org/doc/html/rfc8446
Signal: protocol documentation reference https://signal.org/docs/
MDN: Web Crypto encrypt method official-docs https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/encrypt