Cryptography Lab: Codes, Ciphers & Secret Messages
Hide messages in plain sight
Hide messages in plain sight
Julius Caesar encrypted military messages by shifting each letter by 3 positions. A becomes D, B becomes E, Z wraps to C. Type a message and adjust the shift to see encryption happen letter by letter.
Every language has a fingerprint: the frequency of each letter. In English, E is the most common (~13%), followed by T, A, O, I, N. This pattern survives Caesar encryption. Match the most common cipher letter to E and you can guess the shift.
The cipher text from Section 1. Click Auto-Crack to break it using frequency analysis.
Modern encryption uses XOR (exclusive or) at its core. XOR a message with a key to encrypt. XOR the result with the same key to decrypt. The magic: XOR is its own inverse.
The ciphers you just explored are the ancestors of the encryption protecting your data right now.
Every website with a padlock icon uses TLS encryption. Your browser and the server negotiate a shared key, then encrypt all traffic with AES. No one in between can read it.
Signal, WhatsApp, and iMessage encrypt messages so that even the company running the servers cannot read them. Only your device and the recipient's device have the key.
Passwords are stored as hashes (one-way encryption). The server never knows your actual password. It hashes what you type and compares the hash.
The Enigma machine used in WWII was essentially a polyalphabetic substitution cipher with 158,962,555,217,826,360,000 possible settings. Alan Turing's team at Bletchley Park broke it by exploiting patterns in German military messages. That effort is considered the birth of modern computing.
You've learned how ciphers transform readable text into unbreakable secrets. From Caesar's simple shift to modern encryption, the core idea is the same: a key that only the sender and receiver know.
Encryption transforms readable text (plaintext) into scrambled text (ciphertext) using a key. Without the key, the message is meaningless.
The algorithm can be public. The security comes from the key. A Caesar cipher with a known shift is trivially broken. AES-256 with a random key is unbreakable.
In English, "E" appears ~13% of the time. If "X" appears 13% in ciphertext, X probably maps to E. This breaks any single-substitution cipher.
AES, RSA, and elliptic curve cryptography rely on mathematical problems that are easy in one direction but practically impossible to reverse.
Put your new knowledge into practice!