Student Name: Student Number: Okanagan College Department Of Mathematics & Statistics Math 231 Instructor: Scott Heard Midterm 2 April 3, 2019 Duration: 80 Minutes READ INSTRUCTIONS CAREFULLY BEFORE COMMENCING EXAM INSTRUCTIONS: Answer all 6 questions in the spaces provided, showing all significant steps. Partial marks will be awarded for correct work even if the final answer is incorrect. Marks per question are given in the left margin, total 50. Check that your paper contains all 12 pages in addition to the cover page. This paper contains pages numbered 1 to 12 Math 231 Winter 2019 Midterm 2 Page 1 of 12 1. Answer each of the following: [ 3 ] (a) What is the defining characteristic of a public key cryptosystem? [ 3 ] (b) Express the binary number 10101 as an element of GF (2 5 ). Math 231 Winter 2019 Midterm 2 Page 2 of 12 [ 3 ] (c) Use Euler’s Theorem to compute 7 20103 (mod 11). [ 3 ] (d) What how would Alice digitally sign a message using RSA, and how would Bob verify her signa- ture? Math 231 Winter 2019 Midterm 2 Page 3 of 12 [ 3 ] (e) Evaluate x 8 + x 4 + x (mod x 4 + x 2 + 1) over Z 2 [ X ]. [ 3 ] (f) Evaluate ( x 3 + x 2 + 1) · ( x 3 + x 2 ) in GF (16). Math 231 Winter 2019 Midterm 2 Page 4 of 12 [ 5 ] 2. Apply the Miller-Rabin primality test to the integer n = 577 using the base a = 6. Math 231 Winter 2019 Midterm 2 Page 5 of 12 3. Let the primes p = 5 and q = 11 be chosen for the setup of RSA. [ 3 ] (a) Given the encryption exponent e = 3, verify that the corresponding decryption exponent is d = 27. [ 3 ] (b) Encrypt the plaintext message x = 9. Math 231 Winter 2019 Midterm 2 Page 6 of 12 [ 4 ] (c) Use the Chinese Remainder Theorem to decrypt the ciphertext y = 13. Math 231 Winter 2019 Midterm 2 Page 7 of 12 4. Alice and Bob wish to communicate using the ElGamal cryptosystem with prime p = 23 and primitive root g = 7. [ 3 ] (a) Bob uses the secret exponent d = 2 to create his public key. What is Bobs public key? [ 3 ] (b) Alice wants to send the plaintext p = 3 to Bob. Determine the ciphertext C = ( k E , y ) that Alice would send to Bob after encrypting using the random element i = 9. Math 231 Winter 2019 Midterm 2 Page 8 of 12 [ 3 ] (c) Suppose that Bob receives C = ( k E , y ) = (9 , 6) from Alice. Decrypt to find the plaintext. Math 231 Winter 2019 Midterm 2 Page 9 of 12 [ 4 ] 5. Suppose that in a mini-AES cryptosystem the system (and first round) key is k 0 = [ W (0) W (1)] = [ 1 B 4 9 ] Given that RC (1) = [ 8 0 ] , determine the second round key k 1 = [ W (2) W (3)] Math 231 Winter 2019 Midterm 2 Page 10 of 12 [ 4 ] 6. Apply the column mix operation to the matrix M = [ 4 0 8 0 ] Math 231 Winter 2019 Midterm 2 Page 11 of 12 Formula/Worksheet Page 12 of 12 miniAES Encryption S-box 0 1 2 3 0 9 D 6 C 1 4 1 2 E 2 A 8 0 F 3 B 5 3 7 Decryption S-box 0 1 2 3 0 A 5 6 E 1 4 D 2 F 2 9 0 8 C 3 3 1 7 B W ( j ) = { W ( j − 2) ⊕ RC( j/ 2) ⊕ SubNib[RotNib( W ( j − 1))] if j is even. W ( j − 2) ⊕ W ( j − 1) if j is odd. Table 1: Rule for calculating columns of key matrix [ 1 4 4 1 ] = [ 1 x 2 x 2 1 ] Table 2: Encryption column mix matrix [ 9 2 2 9 ] = [ x 3 + 1 x x x 3 + 1 ] Table 3: Decryption column mix matrix p ( x ) bin hex 0 0000 0 1 0001 1 x 0010 2 x + 1 0011 3 x 2 0100 4 x 2 + 1 0101 5 x 2 + x 0110 6 x 2 + x + 1 0111 7 x 3 1000 8 x 3 + 1 1001 9 x 3 + x 1010 A x 3 + x + 1 1011 B x 3 + x 2 1100 C x 3 + x 2 + 1 1101 D x 3 + x 2 + x 1110 E x 3 + x 2 + x + 1 1111 F