Starting from:

$30

CE235-Assignment 1 Solved

1. Task of Assignment One  
The aim of Assignment One is to write a Python program, which will implement the monoalphabetic cipher. The introduction of the monoalphabetic cipher can be found from the Week 1 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. 

 

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 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. You should not change the other part of the reference program.

More products