sciandu
Computer science

Computer science

Modern encryption

Why Caesar falls in seconds and your messenger is still secure.

Every time you write a message, pay online, or log in somewhere, is working for you in the background. Without it, anyone on the same Wi-Fi could read what you type. But why isn't a simple secret code like Caesar's good enough for that? And what do modern methods do better?

Why Caesar falls in seconds

In the , every letter is shifted a fixed number of places in the alphabet. The key is that shift, and there are only 25 sensible ones. An attacker simply tries them all and checks which variant produces readable text. A computer does that in under a second. The lesson: a cipher is only as strong as the number of its possible keys.

Caesar wheel
Shift3
PlainABCDEFGHIJKLMNOPQRSTUVWXYZ
CipherDEFGHIJKLMNOPQRSTUVWXYZABC

SECRET

VHFUHW

SECRET VHFUHW (key 3)
Try it: move the slider through every shift. At 0 the word stays unchanged, the other 25 each produce a different cipher text. Those 25 are exactly what an attacker works through, only in a fraction of a second.

Huge key spaces

Modern methods make trying everything hopeless. Their keys are long bit sequences, and every bit is a slot that can only be 0 or 1. With 1 bit there are 2 possible keys, with 2 bits there are 4, with 3 bits already 8: every additional bit doubles the count. With 128 bits there are more keys than grains of sand on all the beaches on Earth: every single grain would still get more than a billion times a billion keys of its own. Even if all the computers in the world guessed together, they would be busy longer than the universe is old. Instead of 25 doors, an attacker has to open an unimaginable number.

Key pairs and your messenger

There is a second brilliant idea: key pairs. Every person has a public key and a private key. Think of the public key as a letterbox: anyone may drop something in, meaning anyone can encrypt a message for you. But only you hold the private key that opens the letterbox and decrypts the message. That is exactly what end-to-end encryption in messengers is built on: the message is locked on the sender's phone and only opened again on yours. Even the operator of the service sees nothing but scrambled data along the way.

Exercises

0 of 6 solved

Time to try it yourself. You can't break anything, every attempt counts.

Why is the Caesar cipher so easy to crack?

How many shifts does an attacker have to try at most with Caesar? A shift of 0 does not count, it leaves the text unchanged.

A combination lock has 3 digits, each from 0 to 9. How many combinations are there in total?

Match each term to its property.

public key
private key
Caesar cipher
128-bit key

The combination lock gets a fourth digit, again from 0 to 9. How many combinations are there now?

In modern methods, every additional bit the number of possible keys.

Where this leads