CS代考 COMP3334 Computer Systems Security 2021/22 Semester 2

COMP3334 Computer Systems Security 2021/22 Semester 2
Tutorial 2 Solutions Data Encryption Standard & Mode of Operation
Question 1 Parity bits
Write down the value of all parity bits of below 64-bit DES key.

Copyright By PowCoder代写 加微信 powcoder

0101 011_ 1100 111_ 0000 000_ 0111 110_ 1010 111_ 0001 000_ 1011 101_ 0010 100_
The 8th bit is 1 if the number of 1s in the first 7 bits is even, 0 otherwise. (Odd parity)
0101 0111 1100 1110 0000 0001 0111 1100 1010 1110 0001 0000 1011 1010 0010 1001
Question 2 S-Boxes of DES
Given the following 48-bit string. 101000001000011110111110001111001010101111011010
Write down the output bit string after passing through the 8 S-boxes. You may use the DES Demo program or SBox.jpg in Blackboard to help.
Row 2 and Column 4 => 13 = 11012
Row 0 and Column 4 => 6 = 01102
Row 0 and Column 15 => 8 = 10002
Row 2 and Column 15 => 4 = 01002
Row 1 and Column 7 => 1 = 00012
Row 0 and Column 5 => 2 = 00102
Row 3 and Column 7 => 7 = 01112
Row 0 and Column 13 => 0 = 00002
The output string will be: 11010110100001000001001001110000

COMP3334 Computer Systems Security 2021/22 Semester 2
Question 3 DES Encryption and Decryption
In DES, both the encryption and decryption use the same round operation. Suppose a simplified version of DES requires one round of operation only. It can be depicted as below:
Prove that, by applying the same operation on R1L1 with the sub-key K0 during decryption, it will return L0R0.
R1 = L0  F(R0, K0) ———— (1) L1 = R0 ———— (2)
R1 K0 L1 +F
In decryption, L1 will become R0.
To obtain the left half, R1  F(L1, K0)
From (1), we have R1 = L0  F(R0, K0)
Therefore, R1  F(L1, K0) = L0  F(R0, K0)  F(L1, K0)
From (2), L1 = R0
Therefore, L0  F(R0, K0)  F(L1, K0) = L0  F(L1, K0)  F(L1, K0) = L0 L0 = R1  F(L1, K0)

COMP3334 Computer Systems Security 2021/22 Semester 2
Question 4 Mode of Operation
The encryption scheme used in the following example is monoalphabetic, in which we restrict the possible letter to A – P. The key k = BCDEFGHIJKLMNOPA. In other words, for example, ‘A’ will be encrypted to ‘B’. Suppose A – P is represented as 0000 – 1111, respectively. Take all of the blocks as size of 4 bits, i.e., letters are encrypted one by one. Given plaintext “IAMBOB”, using the following mode of operations, what should be the ciphertext? Assume the initialization vector is ‘C’ and the initial counter is 1.
First, we write down the coding table: ABCDEFGHIJKLMNOP
0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 1111
a) Cipher Block Chaining (CBC)
Plaintext=IAMBOB IV=C
1000 (I)  0010 = 1010 E(1010) = 1011 (L) 0000 (A)  1011 = 1011 E(1011) = 1100 (M) 1100 (M)  1100 = 0000 E(0000) = 0001 (B) 0001 (B)  0001 = 0000 E(0000) = 0001 (B) 1110 (O)  0001 = 1111 E(1111) = 0000 (A) 0001 (B)  0000 = 0001 E(0001) = 0010 (C)
Ciphertext=LMBBAC
b) Cipher Feedback (CFB)
Plaintext=IAMBOB IV=C Ciphertext=LMBDKK

COMP3334 Computer Systems Security
2021/22 Semester 2
c) Output Feedback (OFB)
Plaintext=IAMBOB IV=C Ciphertext=LEJHJJ
d) Counter
Plaintext=IAMBOB Counter=1 Ciphertext=KDIEIG

程序代写 CS代考 加微信: powcoder QQ: 1823890830 Email: powcoder@163.com