20. Substitution Cipher
How to break a substitution cipher.
You have to know the basic definition of a substitution cipher. You permute the meaning of letters, so for examples “H” will mean “E”, then “T” will mean “H”, and “E” will mean “T”. Every encrypted letter stands for exactly one plaintext letter, and no encrypted letter stands for more than one plaintext letter.
- Find the frequency of each individual letter in a large file. This gives you an estimate of how often each letter occurs.
- Find the frequency of each letter in the encrypted text (see below).
- Match the frequencies and try to decrypt the text.
Sample texts
- Easy encrypted text - just shifted by a constant amount.
- Harder encrypted text