No history yet

Introduction to Cryptography

The Art of Secret Writing

Cryptography is the practice of securing communication so that only the sender and the intended recipient can understand the message. The word comes from Greek, meaning “hidden writing.” At its core, it’s about transforming readable information, called plaintext, into a scrambled, unreadable format known as ciphertext. The process of converting plaintext to ciphertext is called encryption, and turning it back is decryption.

Plaintext → Encryption → Ciphertext → Decryption → Plaintext

For centuries, cryptography has been essential for spies, generals, and diplomats. In the modern world, it's everywhere. It protects your credit card details when you shop online, secures your private messages, and keeps your bank account safe. It’s the invisible shield of the digital age.

Simple Substitutions

One of the earliest and most famous methods is the Caesar cipher, named after Julius Caesar, who used it for his military correspondence. It’s a type of substitution cipher, where each letter in the plaintext is replaced by a letter some fixed number of positions down the alphabet.

The secret information needed to decrypt the message is the key, which in this case is the number of positions to shift. Let's say the key is 3. To encrypt a message, you shift every letter forward by 3 places.

A becomes D B becomes E C becomes F ... and so on.

If you reach the end of the alphabet, you just wrap around. So, with a key of 3, X becomes A, Y becomes B, and Z becomes C. To encrypt the word "HELLO," you'd get "KHOOR."

Lesson image

To decrypt the message, the recipient simply shifts the letters back by 3. The Caesar cipher is simple, but also simple to break. There are only 25 possible keys (shifting by 26 gets you back where you started). You could try every single one by hand in minutes. Even without trying all the keys, an attacker could use frequency analysis—counting how often each letter appears in the ciphertext—to crack the code. In English, 'E' is the most common letter, so if 'H' appears most often in the ciphertext, the key is probably 5.

A Stronger Cipher

To counter frequency analysis, cryptographers developed more complex systems. The Vigenère cipher, invented in the 16th century, was a significant improvement. For a long time, it was considered unbreakable and was nicknamed le chiffrage indéchiffrable—French for "the indecipherable cipher."

Instead of using a single shift for the entire message, the Vigenère cipher uses a keyword to create a series of different shifts. Each letter of the keyword determines the shift for the corresponding letter in the plaintext.

Let's use the plaintext "ATTACK AT DAWN" and the keyword "LEMON." We repeat the keyword until it matches the length of the plaintext (ignoring spaces).

PlaintextATTACKATDAWN
KeywordLEMONLEMONLE
CiphertextLXFOPVEFRNHR

The first 'A' in "ATTACK" is shifted by 'L' (the 12th letter, if A=1), the first 'T' is shifted by 'E' (the 5th letter), and so on. Because the shift value changes for each letter, simple frequency analysis won't work. The same plaintext letter, like 'A', is encrypted into different ciphertext letters ('L' and 'E' in our example), flattening the frequency distribution of the final message.

The Vigenère cipher remained secure for about 300 years. Its eventual cracking in the 19th century was a major milestone, showing that even seemingly complex ciphers could have hidden patterns and weaknesses. This constant battle between code makers and code breakers has driven cryptographic innovation for centuries.

Ready to check your understanding?

Quiz Questions 1/5

What is the process of converting readable plaintext into unreadable ciphertext called?

Quiz Questions 2/5

Using a Caesar cipher with a key of 5, what would the plaintext "APPLE" be encrypted as?

These early ciphers laid the groundwork for the complex cryptographic systems that followed, introducing the core concepts of keys, substitution, and the ongoing struggle to create truly secure communication.