CS3273 24B Midterm
CS3273 24B Midterm
Midterm
NOTE:
• Time allowed: 120 mins. Total marks: 20 marks towards the final grade.
• This is a closed-book examination. No materials or aids (such as calculators) are allowed.
• The question papers will NOT be graded. Write ALL answers on the answer papers.
• Write your name and ID on ALL answer papers.
1
A. The data is 4-anonymous.
B. The data is 2-anonymous.
C. The data is 3-diverse.
D. The data is 1-diverse.
(5) [1 mark] Which of the following statements about access control list and capability are TRUE?
A. Access control list relies on a list of permissions attached to an object to determine access rights.
B. Access control list requires authentication to mitigate the refused deputy problem.
C. Capability does not perform authentication and therefore has the refused deputy problem.
D. In discretionary access control (DAC), the owners typically have the authority to determine who can
access their resources.
E. Mandatory access control (MAC) relies on security labels assigned by system administrators and
therefore is more difficult to implement than DAC.
(3) [2 mark] The following code implements a hybrid encryption scheme that encrypt a data file and
store the result into another file.
aes_key = get_random_bytes(16)
rsa_public_key = RSA.import_key(open(‘rsa_public_key.bin’, “rb”).read())
rsa_enc = PKCS1_OAEP.new(rsa_public_key)
aes_cipher = AES.new(aes_key.AES.MODE_ECB)
file = open(“aes_key.bin”, “wb”)
file.write(aes_cipher.encrypt(rsa_public_key))
file.close()
plaintexct = b”012345678”*80000
file = open(“ciphertext.bin”, “wb”)
file.write(rsa_enc.encrypt(plaintext))
file.close()
a. Briefly explain the idea of hybrid encryption.
b. Identify the problems of the code and suggest a correction.
(4) [2 marks] Is TLS secure against the following attacks? Please explain your answers.
2
(a) A man-in-the-middle attacker who knows the public key of the server
(b) A man-in-the-middle attacker who has stolen the private key of the certificate authority.
(5) [1 mark]
(6) [1 mark]
(7) [2 marks]
(8) [2 marks] The following table shows the access control list of a UNIX filesystem. a.out is an
executable program which reads and writes files allowed by the access control policy.
Permission Owner Group File
-rwx--x--- 7 Alice CS … a.out
-rwx------ 1 Alice CS … a.txt
-r-------- 1 Bob CS … b.txt
a [1 mark] Write a chmod command for Bob to change the permission of b.txt, such that b.txt can be
read, written, and executed by all users, and the setuid bit is set.
b [1 mark] Is it possible for Bob to know the content of a.txt and why?