A generalization of the Caesar cipher, known as the affine Caesar cipher, has the following form: For each plaintext letter p, substitute the ciphertext letter C:
C = E([a, b], p) = (ap + b) mod 26
A basic requirement of any encryption algorithm is that it be one-to-one. That is, if p ≠ q, then E(k, p) ≠ E(k, q). Otherwise, decryption is impossible, because more than one plaintext character maps into the same ciphertext character. The affine Caesar cipher is not one-to-one for all values of a. For example, for a = 2 and b = 3, then E([a, b], 0) = E([a, b], 13) = 3.
a. Are there any limitations on the value of b? Explain why or why not.
b. Determine which values of a are not allowed.
c. Provide a general statement of which values of a are and are not allowed. Justify
your statement.
a.
There are no limitations on the value of b in the affine Caesar cipher.
The value of b determines the shift applied to each plaintext letter before modular arithmetic is performed. Since modular arithmetic wraps around the alphabet, any value of b will produce a unique ciphertext letter for each plaintext letter, ensuring a one-to-one mapping.
b.
c.
In general, the values of a that are allowed in the affine Caesar cipher are the ones that are coprime (have no common factors) with the modulus (26 in this case).
This ensures a one-to-one mapping between plaintext and ciphertext letters. Conversely, the values of a that are not allowed are the ones that share a common factor with the modulus, as they result in a non-one-to-one mapping.