Assignment 2
Problem Submission Rules:
1) Detection of plagiarism will result in Failing grade. Students must do this
assignment by themselves.
2) After completion, your work must be submitted to an assignment folder in D2L
y a co
esponding deadline.
3) Late assignments will be accepted up to 24 hours after the due date for 50%
credit. Assignments submitted more than 24 hours late will not be accepted for
credit.
4) It is much better to submit a partial/failed-attempt solution than none. Include
the circumstances of the incompletion in your report.
Problems:
The aim of this assignment is to implement a Feistel cipher round function which consists of
the following steps:
1. Implementing a Feistel Cipher – 70 points
Step 1: The function takes as input 8 bits and the 4-bit key ??.
Step 2: The binary is divided into two halves (??0 and ??0).
Step 3: The function computes ??1 = ??0 and ??1 = ??0 ⊕??(??0,??), where
??(??0,??) = 2 × ??0?? ?????? 24
Step 4: The function performs a swapping of ??1 and ??1, then outputs ??1||??1.
2. Combining with Assignment 1 – 20 points
Improve your implementation for 1 by using your Text Converter, so it can handle a
string from a user and output a string.
3. Make some test codes to show the co
ectness of your implementation – 10 points
Note: It is recommended to exchange a ciphertext generated by the implementation with your
friend and check the decryption algorithm successfully recovers the original plaintext (you can
use the discussion section in D2L).
Complier requirement:
The text converter must be implemented using Python version 3.9.x or higher. Students
must use Python official li
aries that are accessible from the webpage
(https:
docs.python.org/3/li
ary/index.html). All used li
aries and their purpose should be
described in the report.
Submission instructions:
Please submit your deliverables to the D2L Assignments folder:
(a) “2. Feistel Cipher”: create a txt file, copy and paste your entire Python code, save,
and then submit with a written report explaining your implementation. The report
should have some test inputs and screenshots of execution results, which verify the
co
ectness of your implementation.
Once you submit, D2L will perform a similarity check for your submission and show you the
esult. Your similarity score must be lower than 50% unless valid reasons for a high score
described in the report. Otherwise, (the score -50%) will be deducted.
https:
docs.python.org/3/li
ary/index.html