Question: THE PROGRAM SHOULD BE WRITTEN IN PYTHON OR LINUX COMPATIBLE C You will actually write 2 programs that will run separately, an encryption program and

 THE PROGRAM SHOULD BE WRITTEN IN PYTHON OR LINUX COMPATIBLE C
THE PROGRAM SHOULD BE WRITTEN IN PYTHON OR LINUX COMPATIBLE C

You will actually write 2 programs that will run separately, an encryption program and a decryption program. Your plaintext will be in a file named plaintext.txt. This will be the input to your encryption program. Your alphabet will be the uppercase characters (A-Z). Count them starting with A=00, B=01, etc., with Z=25. Your encryption program will encrypt this plaintext using a Block Affine cipher with 3 letter blocks. If your plaintext has any leftover missing character(s) in a 3 letter block, you will pad that block with a capital letter B. NOTE: you will pad this in the ORIGINAL plaintext, that is, the plaintext that is stored in the plaintext.txt file. The ciphertext output from your encryption program will be written to a file called ciphertext.txt. This file, ciphertext.txt, will be the input to your decryption program. For both the encryption program and the decryption program, the user will input the multiplier from the console, as follows: Input multiplier for Block Affine cipher The user will input the offset from the console, as follows: Input offset for Block Affine cipher Your program will then check whether or the multiplier is relatively prime to the modulo. If it is NOT relatively prime to the modulo, then your program will print an error message to the console and will terminate As part of its operation, the decryption program MUST actually calculate the modular inverse (that is, you are NOT allowed to precalculate it all and save it in a big table). And similarly for the modular arithmetic in all parts of this program. Your data that is decrypted using your Block Affine cipher decrypter will be written to a file called finalplaintextoutput.txt

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!