Encodes text by replacing each letter with a different letter according to a fixed pattern.
Example
| Cipher text | A | B | C | D | E | F | G | … |
|---|---|---|---|---|---|---|---|---|
| Plain text | D | H | E | J | O | L | M | … |
Encoded message BCFFE then decodes to HELLO
A letter substitution cipher can be either n Aristocrat or Patristocrat.
In an Aristocrat cipher, spaces and punctuation are preserved so it’s easier to solve.
A Patristocrat cipher removes these hints by running all letters together without spaces.
The plain text is the cipher text shifted by a certain number.
Caesar cipher example:
| Cipher text | A | B | C | D | E | F | … | X | Y | Z |
|---|---|---|---|---|---|---|---|---|---|---|
| Plain text | D | E | F | G | H | I | … | A | B | C |
When you see encoded word EF, the plain text is HI, as every letter is shifted by 3 positions in this case.
Similar to Caesar, but in addition to shifting, a key word (known by allies but not outsiders) is inserted in the conversion table.
K1: the keyword is inserted in the plain text row of the conversion table. Example:
FAKE, location is 2| Cipher text | A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | … |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Plain text | Y | Z | F | A | K | E | B | C | D | G | H | I | J | L | M | N | O | … |
In the original letters row, the keyword FAKE starts at location 2 and is followed by the rest of the letters in A-Z order.
HELLO encodes to KFNNQ
K2: the keyword is inserted in the cipher text row of the conversion table. Example:
CAT, location is 3| Cipher text | X | Y | Z | C | A | T | B | D | E | F | G | H | I | J | K | … |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Plain text | A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | … |
In the cipher letter row, the keyword CAT starts at location 3 and is followed by the rest of the letters in A-Z order.
Hello encodes to DHHAK
In all cases, each cipher letter cannot be the same as the original letter.
<aside> 💡
As a code breaker, you don’t know the keyword or the shift position. You only know the encoded text, and your task is to find out the original message.
</aside>