Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

- the program must be written in python and throw away all nonuppercase characters and give an error message before proceeding. Your program MUST run

- the program must be written in python and throw away all nonuppercase characters and give an error message before proceeding. image text in transcribed
Your program MUST run using the linux command line. You will use EITHER python OR C++/C. If you use C++/C then your code must work using the gnu c compiler. 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-2). 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

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions