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.
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.
[evaluate codebreaker.py]
Enter the input filename: q2-1.in
PYTHON
Missing key!
UNIVERSITYOFALBERTA