Question: We need this in C programming not C++ or Java please, this is the encrypted code as well. 101121MewContenty6627223/View The Affine cipher is a cryptographic
101121MewContenty6627223/View The Affine cipher is a cryptographic mcthod for encrypting text such that it becomes unreadable to a party without access to the cryptographic key. The encryption and deeryption opcrations are simple shifts of the alphabet letters in a cyclic fashion. Mathematically, for a key k-(, ), the encryption and decryption are defined as Encryption: c-(a-z + ) mod 26 , 1 26 and a 26 Decryption: z = -1 . (e-) mod 26. Hore, i s a multiplicative mverse of a n the group of integen modulo 26. To find the multiplicative inverse of a one needs to find z such that az 1 mod 26. A simple way of finding the inverse of a is to consider all numbers from 1 to 25 and see which one satisfies the equation (1) To illustrate the use of the Affine cipher, consider the eneryption of "defend the east wall of the castle" with key k-(a,B)(6,7. The first letter "" is mapped to mumber 3 (alphabet letters are mumbered from 0 to 25). Inserting 3 to the encryption functions yiclds c- 5 3+7 mod 26 22 mod 26 22 which corresponds to letter "w". Applying the same process for ever letter, the plaintext sentence is translated to "wbgbuw yqb bhty nhkk zg yqb rhtykb" . Now to decode, we first need to find the inverse of 5 modulo 26. Scanning every number from 1 to 25, we observe that 5-21 mod 26 1, so the inverse of 5 is 21. Using 21 for decrypting the first letter "w" (or 22) becomes 21-(22-7) mod 26 3, which reverses back to letter "d". NOTE: The modulo operation for negative numbers is different from the % arithmetic operator in C 112
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
