## Exam.dvi

Answer all four (4) questions. The total number of marks for the entire paper is 60. The number in [] by each question indicates the number of marks alloted to thequestion. Justify all your answers; full credit will be given only for properly supported answers,partial credit will be given where applicable. Good skill! Question 1 Transposition and Substitution Ciphers [20] a. Give an example of a simple substitution cipher for the alphabet {A, B, C, D, E} and show the ciphertext it would produce for the string BEDFACE.
b. Explain how a simple substitution cipher (operating on the English alphabet) can be attacked if it used to encode messages in English.
c. Describe what is meant by a homophonic substitution cipher, and explain how it counters the type of attack referred to in part b.
d. A transposition block cipher, which operates on blocks of 12 characters at a time, has been used to transform a short English phrase into the ciphertext T-AHINIS-S-EAE*SX*YA*-M*.
With a brief explanation of your reasoning, decipher the ciphertext to produce the originalmessage.
a. The process of setting up the RSA cipher begins by choosing two primes p, q. Explain how this pair of numbers is used to generate a public key n, e and a private key n, d . (Be sureto specify the constraints on e, d).
b. Given a cipher c, explain how to compute m, the message that was encoded to produce c. [2] c. A student uses the algorithm in Algorithm 1 to encode a given message, m. Explain why this algorithm is inadequate, and how it can be improved for use in “real life” situations.
Algorithm 1 An algorithm for encoding a message, m, using the RSA cipher d. If p = 23 and q = 31, determine whether e may be 91. (Be sure to show your working).
e. Explain what algorithm you would use to compute the d that corresponds to a valid e.
Suppose that the public information for a Diffie-Hellman key exchange protocol is p = 7 and g = 3,(g is the generator for Z ). Two parties A and B would like to share a secret key using this protocol.
Suppose that A chooses x = 4 and B chooses y = 3.
a. What values are communicated between A and B? (Mention the source and destination of b. What is the value of the shared secret key? c. If the value 2 were transmitted from A to B what would the choice of x have been? d. Why is the Diffie-Hellman key exchange protocol, in general (i.e. for large values of p), secure? A company has a safe that needs a secret code, c, to open it. The company’s policy is that anyone of the following combinations of personnel working together should be able to open the safe ifnecessary: • any two vice-presidents acting together • any one vice-president and two associates acting together a. Explain the steps involved in using a (k, t) thresholding scheme to share the secret code c.
b. Explain how a sufficient number of shares may be combined to reveal the secret.
c. The company has 1 president, 3 vice-presidents and 5 associates.
(i) Explain how to distribute shares in the secret code to effectively implement the company (ii) Based on your strategy for sharing the code, give suitable values for k and t, assuming that no two persons receive the same pieces of information.