The second task in this assignment is to create a Python application called codebreaker.py that will crack the code on a series of cyphertext messages with different keys.

Problem Task

In this problem, your input file will contain a number of ciphertext and key pairs, separated by a space. You may assume that the ciphertext contains only uppercase letters. However, it is possible that the key may be missing, and your program should handle this case.

The ciphertext has been encryped by shifting letters in the alphabet by the amount specified by the key. The word HELLO with key = 2 becomes JGNNQ. Letters should wrap around, so PIZZA with key = 1 becomes QJAAB.

One sample input file (q2-1.in) is provided, however you should test your program on additional inputs to ensure you have covered all cases.

Sample Run

[evaluate codebreaker.py]
Enter the input filename: q2-1.in
PYTHON
Missing key!
UNIVERSITYOFALBERTA
Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.