Table of Contents
Substitution ciphers are ciphers which map from one alphabet to another or to multiple alphabets. The simplest cases can be represented by an affine map, C = aP + b, where C is the cryptotext, P is the plaintext, and a and b are some constants. This is the basic transformation behind all of the following ciphers.
The Caesar cipher is a special case of the affine map, C = P + b. This preserves the ordering of the alphabet by simply rotating. The easiest way to use this cipher is by writing something similar to the following:
ABCDEFGHIJKLMNOPQRSTUVWXYZ
CDEFGHIJKLMNOPQRSTUVWXYZAB
The top line is the origonal alphabet, and the second line is the same thing rotated by 2 (b = 2). To use it, simply find the letter you want to encrypt on the first line, and substitute with the letter directly below. Decryption works with the same set of lines only in reverse - the second line is used as the origonal alphabet, and the top line substituted in.
Simple substition is a cipher which usually utilizes the complete affine map, and is specified by a pair of keys (a, b). Again this is a very simple cipher and can be represented like the Caesar cipher when doing encryption and decryption. The general formula for an affine map is C = a*P + b mod N, where N is the size of the alphabet. The substitution can be arbitrary however, using a key which specifies the new order of the letters in the alphabet.
Vigenere is a cipher which contains a set of Caesar rotations. To use thie cipher, a key must be decided on. Usually the key is a word or phrase. Once the key has been chosen, then each alphabet beginning with one of the key letters is rotated through while encrypting the message. For example, if our key is "WHITE", then we use the Caesar rotations:
ABCDEFGHIJKLMNOPQRSTUVWXYZ This line is for reference only. WXYZABCDEFGHIJKLMNOPQRSTUV HIJKLMNOPQRSTUVWXYZABCDEFG IJKLMNOPQRSTUVWXYZABCDEFGH TUVWXYZABCDEFGHIJKLMNOPQRS EFGHIJKLMNOPQRSTUVWXYZABCD
The first letter of the text would be encrypted with the line beginning with W, the second with H, and so on. When the end of the key is reached, start over and loop through the key again.
Enigma was the name of the cipher machine which the Germans used on their U-Boats during WWII. It consisted of rotors (simple substitution) and a plug board (another simple substitution). Each day the rotor settings would be changed depending on the code of the day. There were multiple diffferent versions of the Enigma during WWII, consisting of differnt numbers of rotors, different rotors, more plugs, and other modifications to make it more complicated.
![]() | Note |
|---|---|
| Add more here | |
All of the ciphers on this page are very simple to implement, and also very easy to attack. The plaintext of a message encrypted with any of these ciphers can be recovered from the given cyphertext with no prior knowledge of the key. The magic to doing this is frequency analysis. (for Vigenere, this is only true when the key is significantly shorter than the message). Given statistical properties of English, certain letters appear with a higher frequency than others (E is the most common). When the cryptotext is examined, a pattern will appear, allowing (a, b) from the affine map to be recovered. Sometimes this is as easy as looking at the graph, and sometimes some simple algebra is required.