A generalization of the Caesar cipher known as the affine Ca
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 notequalto q, then E(k, p) notequalto 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. Are there any limitations on the value of bl Explain why or why not. Determine which values of a are not allowed. Provide a general statement of which values of a are and are not allowed. Justify your statement.
Solution
for Affine cipher:
m is the total number
suppose m is 26 (alphabets)
a should be chosen to be relatively prime to m (i.e. a should have no factors in common with m). For example 15 and 26 have no factors in common, so 15 is an acceptable value for a, however 12 and 26 have factors in common (e.g. 2) so 12 cannot be used for a value of a. When encrypting, we first convert all the letters to numbers (\'a\'=0, \'b\'=1, ..., \'z\'=25).
the decryption funtion is
p = a-1(c-b)mod m
