THE DIGITAL WORLD | CHAPTER 11

The Art of Secret Messages

Explore, test and discover the science of cryptography.

A. The secret alphabet

Choose a shift. Try a fictional message and reverse the transformation.

Show all 26 candidate decryptions
Read and edit the code

B. The pattern detective

Frequency is a clue, not proof of a symbol's original meaning.
Read and edit the code

C. Agree on a secret

Public p = 23, g = 5. The small numbers are intentionally insecure.

This teaching model does not authenticate either participant, and it uses tiny parameters. Do not use it to secure real messages.

Read and edit the code

Bonus: authenticated encryption

Use a real browser cryptography API to encrypt toy text locally with a newly generated AES-GCM key. The test changes one ciphertext byte and checks that decryption rejects it.

Ready.Requires Web Crypto in a secure context (HTTPS or a supported local file context). Nothing is sent to any server.

Use only your own fictional messages. Educational ciphers and these isolated demonstrations are not production messaging protocols. Editable code is run locally; only run code you understand.

Return to the companion index | Use HTTPS for the Web Crypto experiments.