Method
By encoding letters as , the Caesar Cipher of a shift can be seen as applying the transformation
We can try other linear operators:
If we want this to be decryptable, must be injective (and thus forces surjectivity). We are merely just applying an affine transformation to the letters.
Example 1
Show that
loses information but
does not.
We see that , so , but , and . However, for each , we have a unique .
Theorem (Valid Affine Cipher)
More generally,
gives a valid Affine Cipher if and only if is invertible , which by the modular inversion theorem happens if and only if .
Definition (Decipher Function)
Write
with . Let be an inverse of . We write which yields
Thus,
So for each number , the following are the only invertible numbers (along with their inverse):
Example 2
What is the decryption function for
So,
Theorem (Affine Ciphers are Finite)
How many different Affine Ciphers are there? Since we have possible keys for . Then for , we have possible choices . We get affine ciphers.
For alphabet size , note that the following invertible numbers are coprime with . We apply the same rule for alphabet size .