cryptography-substitution-cipher.html


* created: 2025-10-17T16:31
* modified: 2025-10-17T16:35

title

Substitution-Cipher

description

A basic cipher where you map every letter to another letter using a matrix.

related notes

Substitution-Cipher

The substitution cipher behaves basically like the Caesar cipher, but instead of shifting by a certain amount of letters, we map every letter to a random letter. This makes the Caesar cipher a special instance of the substitution cipher.

To illustrate: there are 26 different keys using the Caesar cipher and 26! using the substitution cipher.

Even if the key space is way bigger, there are still a couple of issues. First of all, since every letter maps to exactly one other letter, we can infer possible combinations.

Example: BUKKA, since there are not that many words that follow such a structure, we could just guess that the message is HELLO, which lets us map B\to H, U\to E,... and so on.

Another interesting property is that the distribution of letters is not uniform, so if we have a sufficiently long text, we could determine the frequency of each letter used and map this to the standard distribution in English texts.