Question: 2 . Block Ciphers [ 1 1 marks ] 2 You are required to implement two programs in Python aes - encrypt.py and aes -

2. Block Ciphers [11 marks]2 You are required to implement two programs in Python aes-encrypt.py and aes-decrypt.py. Each program takes five arguments: key=(input file containing 128-bit key), mode=ecb|cbc, in=(input file), out=(output file), and optional IV=(file containing IV). For this task, you should use cryptography library in python and not the openssl CLI. For padding, use PKCS7.2.a Submit your implementation of aes-encrypt.py and aes-decrypt.py. You will be marked on the correctness of your solution. If you have used any code from the Internet, specify that in the source files. [5 marks]2.b Consider the two messages from Mohit to Ian "Mohit_thedrummer:ian rockerrrrrrr: Vangelis - To The Unknown Man" and "Mohit_thedrummer:ian_rockerrrrrrr: Van- gelis - State of Independence". Use aes-encrypt with mode=ecb and any random key. Provide the hex dump of first 32 bytes of both ciphertexts. Compare the ciphertexts. Do you see some similarity between the two? Is this a vulnerability and if so, how would you fix it?[1 mark]2.c Assume that CCS at UoG chooses to use your implementation of aes-encrypt and aes-decrypt with mode=cbc and a counter IV. Does this construction provide confidentiality? Please explain your answer. [1 mark]2.d Does the construction in 2.c provide integrity? Please explain your answer [1 mark]2.e Add Galois Counter Mode (GCM) support to your aes-encrypt.py and aes-decrypt.py programs. You may need to pass a parameter for GCM. Pass this as gcm_arg=(value in ASCII). What is the purpose of this additional parameter? What additional security properties GCM provides? If you have used any code from the Internet, specify that in the source files. [3 marks]

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!