Since the dawn of time, we humans have a secret and we just want to keep to ourself or share it only the closest people we know. So, let’s time travel, and see how humans handled it over the centuaries and how modern world implemented it and see how this “security” or “cryptography” evolved. But we focus one more technical stuff not the history itself (because we/I ain’t historian 🙃)

1. Uknown Era

Actually some historician says that first cryptography appears in Ancient Egypt around 1900 BCE, in the tomb of the Egyptian nobleman Khnumhotep II at Beni Hasan, but some says the first really convincing example of cryptography for secrecy appears about 1500 BCE in Mesopotamia.

So, we are not really sure if they were a cryptography so, let’s move on.

2. Caesar cipher - rise of the Roman Empire

This is the real secrecy. The idea is extremely simple: shift every letter by a fixed amount. For example, if we take a English alphabet and shift each letters to 3 step:

A → D
B → E
C → F
D → G
E → H
F → I
G → J
H → K
I → L
J → M
K → N
L → O
M → P
N → Q
O → R
P → S
Q → T
R → U
S → V
T → W
U → X
V → Y
W → Z
X → A
Y → B
Z → C

The secret number is basically 3 (but don’t tell anyone 🙃). And if we use that number: “HELLO WORLD” becames “KHOOR ZRUOG”

If we put that in formula:

$$ cipher text = (plaintext + key) mod 26 $$

But that technique isn’t strong, can be easly broken.

3. Arab cryptanalysis and al-Kindi — attack the statistics

Around the 9th century CE, the Arab scholar al-Kindi described one of the earliest known systematic methods of cryptanalysis: frequency analysis.

This is not actually a security but rather first brute force hacking. He said we don’t use letters in equal amount, some letters are used more than others. For example in english:

E  → very common
T  → common
A  → common
Q  → rare
Z  → rare
...

Every language has its own distributation. With enough ciphered text analysis we can break it

Basically his idea was like this:

You don't necessarily need to know the secret key. You can study patterns left behind by the language.

P.s: I didn’t want to pay too much attention to it, but you can always find more by searching “al-kindi frequency analysis”

4. Vigenère cipher — make the substitution keep changing