01 Monoalphabetic substitution

Monoalphabetic substitution means an encryption in which each letter or group of letters is replaced by exactly one letter, group of letters or character. Thus, there is exactly one key alphabet.

The advantage here is the simplicity of encryption and decryption. The disadvantage in the possibility of frequency analysis and “logical” decryption. The longer the encrypted text, the easier it is to guess which frequently occurring letter of the ciphertext probably corresponds to the most frequently used E in German, for example. Tables on letter frequency and tools on the Internet (Crypt-Online or kas-bc.de or for downloading the code-breaker ) make this very easy. And the simpler a text is structured, the more likely certain words (north, east, cache, written out numbers, full stop, degree), phrases or parts of words occur, the easier it is to decode monoalphabetic ciphers even by laymen with a piece of paper, a pen and a little time.

Caesar Cipher

The first user of a monoalphabetic “cipher” known to this day was Julius Caesar, who simply shifted the alphabet by three digits. The 3 corresponds to the letter value of the C from Caesar. So the A became a C, the B became a D, the C became an E. The word cryptology thus becomes the gibberish: Nubswrorjlh.

Red13, Red5, RedX

Of course, you can take any other of the 25 possible alphabet shifts. These are usually abbreviated RED for rotation. Furthermore, numbers and special characters can also be added, although it would then be better to define somehow which order the plain text alphabet is based on. However, I have often encountered ROT5 only with numbers when caching. Thus, 1 becomes 6 or, mirrored on the 10-axis, 1 becomes 9, 2 becomes 8, 3 becomes 7,…

There are immensely many websites that do the manual decoding of these rotation ciphers for you. Even ones where all 25 alphabet possibilities are presented with one click. Very helpful if you don’t know by how many letters the alphabet has been shifted.

Such a shift cipher as a monoalphabetic substitution cipher is doubly nice for the one who wants to decode it, because once you have decoded two letters for sure, you get the other 24 right away. Nevertheless, it was still considered sufficiently secure centuries after Ceasar and is still used today. However, it is largely used only to make written text unreadable at first glance. In the case of geocaching hints with the popular ROT13, a commendable “un-spoiler”.

If you want to make the decoding of monoalphabetic substitutions at least a little more difficult, you would do well to remove the telltale spaces and punctuation marks from which typical word or sentence beginnings or endings can be guessed, if possible, and perhaps, in order to feign a more difficult encryption approach, to divide the encrypted letter salad into pretty groups of 5 letters. This doesn’t help against frequency analyses either, but at least it confuses the decryptor for a short time  😉

Atbash

Almost as simple as a shifting cipher is Atbasch, where here the alphabet is symmetrically “mirrored”. A becomes Z, B becomes Y, C becomes X, etc. Atbash comes from Hebrew, hence its name, which consists of the first two (Aleph and Beth) and last two letters (Taw and Shin) of the Hebrew alphabet.

Cubed alphabets with keywords

Of course, you can also use any other alphabet scrambling, which then at least has the advantage of not being decrypted by pure shifting, but involves a bit more mental and manual or arithmetical work. Since a decryption of such scrambled alphabets always means that the recipient of such a message must have knowledge of the encryption alphabet, but of course this must not be supplied (at most by another means), it is obvious to use keywords to generate the secret alphabet. This also works for simple, monoalphabetic substitutions. For example, if you decide to use the keyword SCHMIERBLOG, remove all duplicate letters (practically, there are none in SCHMIERBLOG) and add them to the front of the secret alphabet to be created. Letters that are left in the normal alphabet minus those already used with SCHMIERBLOG are added at the end.

And so the normal alphabet ABCDEFGHIJKLMNOPQRSTUVWXYZ becomes the walking alphabet “Schmierblog” SCHMIERBLOGADFJKNPQTUVWXYZ

With this walking alphabet, the NINA now becomes an encrypted FLFS.

The longer the keyword, the better, as fewer letters need to be “encoded” with themselves. in the Schmierblog example, all letters from the T onwards remain themselves. It is therefore not at all uncommon to turn the back of the key alphabet over again, i.e. to fill up the alphabet with the Z after the keyword (SCHMIERBLOG).

Instead of SCHMIERBLOGADFJKNPQTUVWXYZ
you get SCHMIERBLOGZYXWVUTQPNKJFDA

The multiplicative substitution

Also a variant of monoalphabetic substitution, where the alphabet is rolled through instead of just shifted, is multiplicative substitution. Here, each letter of the plaintext alphabet is assigned the corresponding natural number according to its position in the alphabet (A=0, B=1,…). Multiplying the value of each plaintext letter by a freely selectable number and now replacing this number again with the letter of the alphabet (A=0, B=1,…), a new ciphertext alphabet is created.

If I take 7 as a multiplier, I get the following secret alphabet:

ABCDEFGHIJKLMNOPQRSTUVWXYZ
AHOVCJQXELSZGNUBIPWDKRYFMT

Whereas the A from A=0, 0 multiplied by 7 = still 0, so the A remains an A (when counting A=0, this will always be the case).
The B with the value 1 multiplied by 7 gives the 7, which corresponds to the letter value of H.
The F with the value 5 multiplied by 7 gives 35. Bit too much for the 26-character alphabet, so you calculate 35 modulo 26. This gives a remainder of 9, which again corresponds to J.

Playfair

Also using a keyword, the Playfair encryption works. Not a pure monoalphabetic substitution, but a “bigraphic, monoalphabetic” one. This means that each pair of letters in the text to be encrypted is replaced by another pair of letters. To do this, the alphabet is placed in a 5*5 grid (I=J, otherwise it won’t fit), the keyword (cleansed of duplicate letters) is placed in front and filled with the rest of the alphabet. To encrypt, the letters are now swapped in this square according to two rules:

  1. if the pairs of letters to be encoded are in one row or one column, the next (lower or right) letter is used
  2. if the pairs of letters to be encoded are in different rows or columns, take the letter in the same row but the column of the other plaintext letter.

Begegnet euch auch mal einen Code wie diesen:
UE QP XY XK KE EN BC RV HL, probiert mal euer Glück mit diesem Quadrat oder auf einer Seite wie Crypt-Tool.

Das verwendete Schlüsselwort lautet Kryptographie.

But even the Playfair cipher, already a more difficult one than a simple, monoalphabetic method, is still relatively easy to crack; after all, the same letter pairs are always encrypted by the same cipher letters.

Alberti’s cipher disk

That monoalphabetic ciphers can be easily deciphered was known about 400 years ago, and so Mr Alberti had the sensible idea that instead of using a single key alphabet, one could use several and switch between them after a certain number of letters or words. This does not make a frequency analysis impossible but, since you first need the key for the alphabet change, at least more difficult. And to make this alphabet change quick, there was a handy cipher disk from him. Just how right Mr Alberti was about the alphabet change can be seen from the fact that the “queen” of encryption machines, the Enigma, also works exactly according to this principle. However, it even changes the key alphabet after each letter.