Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Cracking the Code: From Caesar Ciphers to Whats...

Sponsored · Your Podcast. Everywhere. Effortlessly. Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.

Cracking the Code: From Caesar Ciphers to WhatsApp Encryption

Introductory presentation on Cryptography presented at the STEAM Club of an international school

Avatar for Kannan Murugapandian

Kannan Murugapandian

May 29, 2026

More Decks by Kannan Murugapandian

Other Decks in Research

Transcript

  1. Cracking the Code From Caesar Ciphers to WhatsApp Encryption Kannan

    Murugapandian STEAM Club May 2026 Kannan Murugapandian (DPS International School) Cracking the Code May 2026 1 / 18
  2. Today’s Agenda 1 Warm-up puzzle 2 What is a cipher?

    Key terms 3 The Caesar cipher — and why it fails 4 RSA: the padlock idea 5 RSA math — worked example 6 WhatsApp end-to-end encryption 7 WhatsApp vs. Signal 8 Myths, habits, and a final challenge Kannan Murugapandian (DPS International School) Cracking the Code May 2026 2 / 18
  3. Can You Crack This? 30-Second Challenge — Decode this message

    KHB, VWHDP FOXE! Hint: each letter has been shifted forward by 3 Pos 0 1 2 3 4 5 6 7 8 9 10 11 12 Plain A B C D E F G H I J K L M Pos 13 14 15 16 17 18 19 20 21 22 23 24 25 Plain N O P Q R S T U V W X Y Z Kannan Murugapandian (DPS International School) Cracking the Code May 2026 3 / 18
  4. Can You Crack This? 30-Second Challenge — Decode this message

    KHB, VWHDP FOXE! Hint: each letter has been shifted forward by 3 Answer HEY, STEAM CLUB! Shift each letter back by 3: K → H H → E B → Y . . . Kannan Murugapandian (DPS International School) Cracking the Code May 2026 4 / 18
  5. Can You Crack This? 30-Second Challenge — Decode this message

    KHB, VWHDP FOXE! Hint: each letter has been shifted forward by 3 Answer HEY, STEAM CLUB! Shift each letter back by 3: K → H H → E B → Y . . . You just performed decryption. That’s cryptography! Kannan Murugapandian (DPS International School) Cracking the Code May 2026 4 / 18
  6. Three Words You Need Plaintext “Hey, STEAM Club!” Ciphertext “Khb,

    Vwhdp Foxe!” Plaintext “Hey, STEAM Club!” Encrypt +3 shift Decrypt −3 shift Cipher A rule for scrambling a message. Encryption Turning readable text into unreadable ciphertext. Decryption Turning ciphertext back into readable text. Kannan Murugapandian (DPS International School) Cracking the Code May 2026 5 / 18
  7. The Caesar Cipher (100 BC) How it works: shift every

    letter by k positions. Plain A B C · · · Y Z Cipher D E F · · · B C Encrypt: E(x) = (x + k) mod 26 Decrypt: D(x) = (x − k) mod 26 Can you break it? Only 26 possible keys. A computer tries all 26 in milliseconds. This is a brute-force attack. Frequency analysis In English, E appears ≈13% of the time. The most common letter in the ciphertext is probably E — cipher broken! Kannan Murugapandian (DPS International School) Cracking the Code May 2026 6 / 18
  8. Why Simple Ciphers Fall Apart English letter frequency (most →

    least common) E (13%) > T (9%) > A (8%) > O (8%) > I (7%) > N (6.7%) > . . . Problems with substitution ciphers Too few keys to be secure Letter patterns leak information Common words (THE, AND) give hints Computers crack them instantly What we actually need Astronomically large key space No patterns in ciphertext A fresh key for every session Key exchange without ever meeting! How do two strangers agree on a secret key over a public network? Kannan Murugapandian (DPS International School) Cracking the Code May 2026 7 / 18
  9. RSA: The Padlock Analogy Think of it this way Alice

    sends Bob an open padlock — keeping the key herself. Anyone can lock a box with the padlock, but only Alice can unlock it. Public Key (Open Padlock) Anyone can have it Private Key (Padlock Key) Only you keep it Mathematically linked Encrypt (anyone can do this) Use the recipient’s public key to lock a message. Decrypt (only the owner can) Use your private key to unlock messages sent to you. Invented in 1977 by Rivest, Shamir & Adleman at MIT — hence RSA. Kannan Murugapandian (DPS International School) Cracking the Code May 2026 8 / 18
  10. RSA in Action — Key Generation (Tiny Numbers) Step 1:

    Pick two primes p = 3, q = 11 Step 2: Compute n and ϕ(n) n = p × q = 33 ϕ(n) = (p − 1)(q − 1) = 2 × 10 = 20 Step 3: Choose public exponent e e = 7, gcd(7, 20) = 1 ✓ Step 4: Find private exponent d Solve: d · e ≡ 1 (mod ϕ(n)) Your key pair Public Key: (e, n) = (7, 33) Private Key: (d, n) = (3, 33) Share the public key with everyone. Keep the private key secret. Kannan Murugapandian (DPS International School) Cracking the Code May 2026 9 / 18
  11. RSA in Action — Encrypt & Decrypt Message: M =

    2 (representing the letter “B”, say) Encrypt using Public Key (e = 7, n = 33) C = Me mod n = 27 mod 33 = 128 mod 33 = 29 Decrypt using Private Key (d = 3, n = 33) M = Cd mod n = 293 mod 33 = 24389 mod 33 = 2 ✓ We get our original message back! The math guarantees this. Kannan Murugapandian (DPS International School) Cracking the Code May 2026 10 / 18
  12. Why RSA Is (Almost) Unbreakable The Hard Problem: Prime Factorisation

    Easy: 17 × 19 = 323 — any calculator does this instantly. Hard: Given 323, find the two prime factors. Real RSA uses a number n that is 2048 bits long — a 617-digit decimal number. Factoring it would take billions of years with today’s best computers. One-way function Multiplication: instant Factorisation: computationally infeasible This asymmetry is the entire secret of RSA. Real-world key sizes Key size Status 1024-bit Weak today 2048-bit Current standard 4096-bit High security Kannan Murugapandian (DPS International School) Cracking the Code May 2026 11 / 18
  13. How WhatsApp End-to-End Encryption Works Alice’s phone Encrypts message using

    Bob’s pub key WhatsApp Server Sees only ciphertext Bob’s phone Decrypts using his private key Encrypted Encrypted What WhatsApp guarantees Message is encrypted on your device before sending The server cannot read your messages Only the recipient’s device can decrypt Uses the open-source Signal Protocol Protocols under the hood Curve25519 — key exchange AES-256 — bulk message encryption HMAC-SHA256 — integrity check RSA-style key exchange powers the handshake. Kannan Murugapandian (DPS International School) Cracking the Code May 2026 12 / 18
  14. If WhatsApp Is Encrypted — Why Move to Signal? E2EE

    ̸= Total Privacy Encryption protects message content, but not everything about you. Feature WhatsApp Signal Message content encrypted ✓ Yes ✓ Yes Metadata collected Yes (Meta/Facebook) Minimal Owned by Meta (for-profit) Non-profit foundation Fully open-source No ✓ Yes Disappearing messages Limited Default option Kannan Murugapandian (DPS International School) Cracking the Code May 2026 13 / 18
  15. Encryption Doesn’t Solve Everything What encryption cannot stop Someone screenshotting

    your chat A phone left unlocked Phishing — tricked into handing over credentials Malware or spyware running on your device Law enforcement with physical access to your device Good habits still matter Use a strong screen-lock PIN Enable disappearing messages Verify security codes with contacts Keep apps updated Be suspicious of unexpected links Cryptography protects data in transit. You protect everything else. Kannan Murugapandian (DPS International School) Cracking the Code May 2026 14 / 18
  16. Quick Myth-Busting “E2EE means no one can ever see my

    messages.” Reality: The other endpoint — and anyone who screenshots — can still expose them. “WhatsApp reads all my messages.” Reality: Message content is private; but metadata (who, when, where) is collected. “Hackers can easily break RSA.” Reality: Breaking 2048-bit RSA takes billions of years. Risks come from bad implementation, not the math. “Only criminals need encryption.” Reality: You use it every time you open a banking app or any HTTPS website. Spot the padlock Every HTTPS site uses TLS, which relies on RSA-style key exchange. The padlock in your browser is applied cryptography. Kannan Murugapandian (DPS International School) Cracking the Code May 2026 15 / 18
  17. The Journey We Took Today Caesar 26 keys easy to

    break Problem key sharing over public net RSA public key prime math WhatsApp E2EE via Signal Protocol Signal stronger privacy The maths that made this possible Modular arithmetic: a mod n One-way functions Prime factorisation hardness Your one takeaway Encryption works because some maths problems are trivially easy in one direction and practically impossible in reverse. Kannan Murugapandian (DPS International School) Cracking the Code May 2026 16 / 18
  18. Your Turn — Final Challenge! Tiny RSA Challenge Use the

    public key (e, n) = (7, 33) from our example. Encrypt the message M = 4: C = 47 mod 33 = ? Questions? Thanks for listening! Kannan Murugapandian (DPS International School) Cracking the Code May 2026 17 / 18