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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!