=========================preview======================
(COMP2711)[2012](s)midterm2~=l66k0z^_97471.pdf
Back to COMP2711 Login to download
======================================================
HKUST C Department of Computer Science and Engineering
COMP 2711: Discrete Math Tools for CS C Spring 2012
Midterm Examination 2

Date: Friday, April 13, 2012 Time: 19:00C21:00
#

Name: Student ID:
Email: Lecture and Tutorial:

Instructions
.
This is a closed book exam. It consists of 13 pages and 8 questions.

.
Please write your name, student ID, email, lecture section and tutorial on this page.

.
For each subsequent page, please write your student ID at the top of the page in the space provided.

.
Please sign the honor code statement on page 2.

.
Answer all the questions within the space provided on the examination paper. You may use the back of the pages for your rough work. The last three pages are scrap paper and may also be used for rough work. Each question is on a separate page. This is for clarity and is not meant to imply that each question requires a full page answer. Many can be answered using only a few lines.

.
Unless otherwise speci.ed you must always explain how you de-rived your answer. A number without an explanation will be considered an incorrect answer.


Questions 1 2 3 4 5 6 7 8 Total
Points 14 14 15 10 8 13 13 13 100
Score

As part of HKUSTs introduction of an honor code, the HKUST Senate has recommended that all students be asked to sign a brief declaration printed on examination answer books that their answers are their own work, and that they are aware of the regulations relating to academic integrity. Following this, please read and sign the declaration below.
I declare that the answers submitted for this examination are my own work.
I understand that sanctions will be imposed, if I am found to have violated the University regulations governing academic integrity.
Students Name:

Students Signature:
Problem 1: [14 points] This problem is on the RSA algorithm for public key cryptorgraphy. To generate his keys, Bob starts by picking p = 37 and q = 31. So, n = pq = 1147 and T =(p . 1)(q . 1) = 1080.
(a)
Bobs public key is a pair (e, 1147). Which of the following integers can Bob use for e? Why?

(i) 17; (ii) 5; (iii) 49; (iv) 21.

(b)
Suppose Bob chooses e = 47. Compute his private key d by running the extended GCD algorithm. Show all the steps.


Solution:
(a)
(i), (iii). This is because they are the only ones that are relatively prime to T, that is, gcd(e, T ) must be 1. (ii) fails because 1080 and 5 are both divisible by 5. (iv) fails because 1080 and 21 are both divisable by 3.

(b)
The private key should satisfy (ed) mod T = 1. i.e. d is multiplicative inverse of e in ZT . Run the extended GCD algorithm to calculate it:


1080 = 47 22 + 46 47 = 46 1+1
Then,
1 = 47 . 46 = 47 . (1080 . 47 22) = 23 47 + 1080 (.1)
Thus, d = 23.
Grading:(a) 4 (1 point for each item, 0.5 for answer and 0.5 for explanation);
(b) 10: only 2 if no steps are shown. Otherwise, deduct