CSCI 7000 - Cryptography - Spring 2008

Problem Set #4

Due: May 9th, 2008



1. Let's do RSA. For the following, I used python; please do the same.

2. Assume RSA. The public key is (411816231521, 5). The encoding method is to take 8 characters of plaintext and convert to an integer M1. Then encrypt under the public key as usual, to obtain C1. Then we take the next 8 characters of plaintext and convert to M2, which we encrypt to C2. And so forth.

The conversion works as follows: we treat a string of 8 alphabetical characters as a vector of 8 coordinates, each of which is between 0 and 25. (A is 0, B is 1, ..., Z is 25). For example, HEYTHERE converts to (7,4,24,19,7,4,17,4). We then convert this to an integer by taking these coordinates as the digits of a base-26 number. So HEYTHERE converts to the integer 7*267 + 4*266 + 24*265 + 19*264 + 7*263 + 4*262 + 17*26 + 4 = 57752296086.

3. We showed in class that RSA works. That is, that if you have some M relatively prime to n, then Med = M (mod n). Please show that RSA still works if M is any integer between 1 and n-1.

4. (Extra Credit) Fix some RSA modulus n=pq (where p and q are distinct primes) and some encryption exponent e which is relatively prime to phi(n). Show that the number of messages M, 0 <= M <= n-1, such that Me = M (mod n) is equal to (1 + gcd(e-1, p-1))(1 + gcd(e-1, q-1)).