CSEC3616/CSEC5616-无代写
时间:2023-09-28
The University of Sydney
School of Computer Science
Dr Suranga Seneviratne
Senior Lecturer - Security
INFO3616/CSEC3616/CSEC5616 S2 2023
Assignment - 2
This is an individual assignment.
This assignment is worth 10% of the final marks of the course.
Submit your final report as a PDF file in Canvas. Submit your codes as a ZIP file in Canvas.
Final Report Due by Week 8, Sunday the 24th of September 11:59 PM
1 Finite Fields, Rings, and Polynomial Arithmetic (20 marks)
a) Polynomial Arithmetic - I (10 marks)
Let S be the set of polynomials whose coefficients form a field F . Demonstrate S is a ring.
b) Polynomial Arithmetic - II (10 marks)
Let R be the field of real numbers. Let R[x] be the ring of polynomials with coefficients in field R.
State whether each of the following statements is true or false. Explain your answers
• R[x] is a commutative ring with unity, with multiplicative identity being the constant polynomial
1. (3 marks)
• f ∈ R[x] has a multiplicative inverse if and only if f is a non-zero constant. (3 marks)
• R[x] is also a field. (4 marks)
2 Operation of AES (20 marks)
a) Steps in AES (15 marks)
Consider the AES encryption scheme. Given the plaintext {0F0E0D0C0B0A09080706050403020100}
and the key {02020202020202020202020202020202}. Explain your answers as you proceed with the
steps.
• Show the original contents of State, displayed as a 4 * 4 matrix. (3 mark)
• Show the value of State after initial AddRoundKey. (3 mark)
• Show the value of State after SubBytes. (3 mark)
• Show the value of State after ShiftRows. (3 mark)
1
• Show the value of State after MixColumns. (3 mark)
b) AES vs. DES (5 marks)
For each of the following elements of DES, indicate the differences with the comparable element in
AES.
• Key size
• Block size
• S-box
• Key expansion function
• Initial and final permutation
3 Block Modes (10 marks)
a) ECB vs. CBC (5 marks)
With the ECB mode, if there is an error in a block of the transmitted ciphertext, only the corresponding
plaintext block is affected. However, in the CBC mode, this error propagates. For example, an error
in the transmitted C1 (in the CBC diagram in the lecture) obviously corrupts P1 and P2.
• Are any blocks beyond P2 affected (2 marks)?
• Suppose that there is a bit error in the source version of P1. Through how many ciphertext
blocks is this error propagated? What is the effect at the receiver? (3 marks)
b) CTR vs. CBC (5 marks)
What are the advantages of CTR mode over the CBC mode? Explain in terms of the implementation
benefits in software, hardware, and decryption throughput.
4 RSA and MACs (10 marks)
a) Attacks on RSA (10 marks)
Explain two known attacks against the RSA encryption scheme (Use diagrams if required). You must
explain the theory behind the attacks. (5 marks for each attack)
b) Message Authentication Codes (MACs) (10 marks)
• Explain what a message authentication code is. (5 marks)
• Explain the difference between a message authentication code and a one-way hash function. (5
marks)
2
5 Hybrid cryptography in Python (20 marks)
In this task, you are going to implement hybrid crypto in Python. Let Alice and Bob be the ‘players’.
Fill in the provided skeleton code! Use pycryptodome.
The provided skeleton code will guide you through the task. You must:
• Complete the class Principal (8 marks)
• Complete the class HybridCipher (8 marks)
• Complete the main() (4 marks)
Do not change the function signatures! Your task is to fill in the gaps, not write fresh code. In the
report explain your code and how to run it.
6 Cracking the code (20 marks)
You are an undercover agent who has infiltrated a terrorist group. You got access to the group’s
leader’s laptop and found a file named top_secret.txt. However, only group leader has the key to
decrypt the file. To avoid an imminent attack you have to decrypt the file top_secret.txt. Submit
your code and explanation of your attack methods to find the plaintext.
Please note the following.
• Space character is not encrypted.
• The length of the key is less than 10.
• Hint. Use something similar to Kasiski’s analysis.