Assignment One: Implementation of Monoalphabetic and Autokey Ciphers
CE235 Assignment One
2023-2024
1. Task of Assignment One
The aim of Assignment One is to write a Python program, which will implement the Monoalphabetic cipher and the Autokey cipher. The introduction of the Monoalphabetic cipher and Autokey cipher can be found from the lecture notes.
Specifically, this assignment task is expected to do the following:
§ Design and develop a Python program with encryption and decryption functions for Monoalphabetic cipher and
Autokey cipher.
A sample Python program caesar.py for Caesar cipher is provided for reference. The sample Python program can be run with default demo message and key from the command line in Terminal like this:
python caesar_ciphyer.py
This reference program caesar_ciphyer.py encrypts a given message and then performs decryption. After the caesar_ciphyer.py program is run, it will display the plaintext, ciphertext, and the decrypted plaintext. If the cipher works correctly, the plain text and decrypted text should be the same.
Your program for Monoalphabetic cipher and Autokey cipher should be called something like mc_registrationnumber.py (see below). Your program must run from the command line like this:
python mc_registrationnumber.py
The outputs of mc_registrationnumber.py (including exactly the key, plaintext, ciphertext and decrypted text) are required
to be displayed, following the display format given in the reference program caesar_ciphyer.py.
2. Hint
For the Monoalphabetic cipher encryption, you should find the index of a symbol in the plain alphabet LETTERS, and the corresponding symbol with the same index in the key for the cipher. The decryption process follows similar idea. The Python function find() can be used to find the index of an element in a string.
All the parts of the code you are expected to modify are highlighted in the Appendix A of the sample program for Caesar cipher.
3. How to submit
Submit one python program file to Faser with the following filename (replace registration number by your own one):
mc_registrationnumber.py
For example, if your registration number is 123456, your filename will be: mc_123456.py
4. Marking Scheme
There are 14 marks for this assignment (out of 100 marks for the overall module marks).
-
1) The functions for the monoalphabetic cipher and autokey cipher takes 8 marks and 6 marks if they are correctly
implemented, respectively.
-
2) You will be asked by the Dr He or teaching assistants at NWU to demonstrate your work and answer questions to ensure
it is your own work. If you are asked to but you don’t demonstrate your work, no mark will be given to your assignment
work.
-
3) Apart from demonstration of your work to the teaching staff members, it is mandatory for you to submit your program
file to Faser on time. Otherwise, you may not get any mark for your work on the assignment.
-
4) Your submitted program may be checked and tested by Dr He. If there are problems found from the testing, your marks
received from your demonstration may be deducted.