01 What is the Affine Cipher?

Affine cipher – Wikipedia

Affine is a monographic monoalphabetic substitution cipher. This means that the text is replaced character by character by another character according to a specific mathematical procedure.

The key consists of the number pair

A from the set (1, 3, 5, 7, 9, 11, 15, 17, 19, 21, 23, 25)
B from the set (0, … 25)
The key pair (1,3) is a Caesar cipher.

The affine cipher is a very weak encryption method for longer texts. There are two methods to break it. The easiest is to try all possible secret keys. A faster method can be used if the respective plaintext letters are known for two letters of the ciphertext. Then the secret key can be calculated in a few steps. The two necessary pairs of letters can be found, for example, by frequency analysis.