Question: Write a program that can encrypt and decrypt using the affine cipher described in Problem below. (Please attach screenshots for the output of your program)
Write a program that can encrypt and decrypt using the affine cipher described in Problem below. (Please attach screenshots for the output of your program)
A generalization of the Caesar cipher, known as the affine Caesar cipher, has the following form: For each plaintext letter , substitute the ciphertext letter :
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 b = 3, then E([a, b], 0) = E([a, b], 13) = 3.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
