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.
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.