Purdue University Caesar Ciphers
Online Vigenere Cipher encoding
These classic ciphers are certainly not secure for modern communications. However, they provide an excellent place to start learning cryptography.
ATBASH
Hebrew scribes copying the book of Jeremiah used this cipher. It is very simple, just reverse the alphabet.
This is, by modern standards, a very primitive and easy to break cipher.
But it will help you get a feel for how cryptography works.
The ATBASH cipher is a Hebrew code which substitutes the first letter of
the alphabet for the last and the second letter for the second to the
last, etc. It simply reverses the alphabet.
In English this would be A becomes Z, B becomes Y, C becomes X, etc.
Caesar
This cipher was first used by Julius Caesar.
Every letter is shifted a fixed number of spaces to the left or the
right in the alphabet. Caesar purportedly shifted 3 to the right, but
you can apply this with any type of shift you prefer.
The shifting is the ‘key’ for this algorithm
The shift is often called the ‘alphabet’ being used. So the Caesar
Cipher is an example of a single alphabet substitution since all letters
are shifted the same amount.
So if you choose a shift of two the the right
"A CAT" becomes "C ECV"
Rail Cipher
The rail fence cipher may be the most widely known transposition cipher. You simply take the message you wish to encrypt and alter each letter on a different row. So “attack at dawn” is written as:
A t c a d w
t a k t a n
Next you write down the text reading from left to right as one normally would, thus producing:
atcadwtaktan
Most books and courses use the two row rail fence cipher, but there is no reason at all that you cannot use more rows.
Polybius Cipher
The Polybius cipher (also known as the Polybius square) was invented by the Greek historian Polybius, who lived around 200 to 118 BCE. Obviously his work used the Greek alphabet, but we will use it with English here
|
1 |
2 |
3 |
4 |
5 |
|
|
1 |
A |
B |
C |
D |
E |
|
2 |
F |
G |
H |
I/J |
K |
|
3 |
L |
M |
N |
O |
P |
|
4 |
Q |
R |
S |
T |
U |
|
5 |
V |
W |
X |
Y |
Z |
Each letter is represented by two numbers. Those two numbers being the x and y coordinate of that letter on the grid. For example A is 1 1, D is 1 4, and R is 4 2. So to write the word attack you would write:
114444111325
This is still a substitution cipher and still maintains the letter and word frequencies found in the underlying language of the plain text. If one uses the standard Polybius square, shown above, then it is a widely known cipher and would be easily cracked, even without any frequency analysis. If one wishes to use a different encoding for letters, that would also require that the two parties share the Polybius square in advance, so that they can exchange messages.
Poly-Alphabet Substitution
Tabula Recta was one of the earliest major poly-alphabet substitution ciphers. It was invented by Johannes Trithemius. A tabular recta is a square of alphabets made by shifting the previous alphabet to the right. This creates 26 different Caesar ciphers. Johannes Trithemius described this in his book Polygraphia, which is presumed to be the first published book on cryptology. You can see that here:

This was the basis for many poly alphabet substitution ciphers, most notably the Vigenere' cipher.
Vigenere
This cipher was actually invented in 1553 by Giovan Battista Bellaso, though it is named after Blasé de Vigenère. It is a method of encrypting alphabetic text by using a series of different mono-alphabet ciphers selected based on the letters of a keyword. Basically you match the keyword letters (one at a time) with the letters at the top of the chart shown above, with the plain text letters on the left (one at a time), the intersection is the cipher text. So if your keyword letter is K and your plaintext letter is D, the cipher text produced will be N. When you reach the end of the keyword you start over.
ADFGX
The cipher works by first creating a modified Polybius square. Rather than number coordinates, the letters A, D, F, G, and X are used (the letter V is not used to create the modified Polybius square).
|
A |
D |
F |
G |
X |
|
|
A |
B |
T |
A |
L |
P |
|
D |
D |
H |
O |
Z |
K |
|
F |
Q |
F |
V |
S |
N |
|
G |
G |
I/J |
C |
U |
X |
|
X |
M |
R |
E |
W |
Y |
Notice that the letters are not in order in the Polybius square. This is a common variation to help make the cipher more secure. The next step is to encrypt the message using this modified Polybius square. Let us assume the message is “attack at dawn”. As with the traditional Polybius square, each letter is represented by its coordinates, in this case by two letters, giving us:
AF AD AD AF GF DX AF AD DA AF XG FX
Next the message is written out under in columns under some key word. Let us continue using “falcon” as our keyword
F A L C O N
A F A D A D
A F G F D X
A F A D D A
A F X G F X
Now the columns are sorted by alphabetical order of the keyword. So we have
A C F L N O
F D A A D A
F F A G X D
F D A A A D
C G A X X F
Then each column is written down in sequence as the cipher text. That gives us
FFFC DFDG AAAA AGAX DXAX ADDF
Obviously one can use any size transposition key word one wishes. In practice, longer keywords were frequently used.
Book Ciphers
Book ciphers have been around for probably as long as there have been books. Essentially both parties agree to use a particular book as the basis. The simplest implementation is to send coordinates for words. So for example 3,3,10 means to go to page 3, line 3, and the 10th word. In this way you can specify words with coordinates, and write out entire sentences.
ENIGMA
There were several Enigma Models including:
Enigma A, the first public Enigma
Enigma B
Enigma C
Enigma B, used by United Kingdom, Japan, Sweden, and others
Navy Cipher D, used by the Italian Navy.
Funkschlüssel C, used by the German navy beginning in 1926
Enigma G, used by the German Army.
Wehrmacht Enigma I, a modification to the Enigma G. Used extensively by the German Military
M3, an improved Enigma introduced in 1930 for the German military.
There have been systems either derived from Enigma, or similar in concept. These include the Japanese system codenamed GREEN by American cryptographers, the SIGABA system, NEMA, and others.
