Assignment 6 – Due Tuesday, November 21

  1. Textbook, Exercise 11.5

  2. Textbook, Exercise 11.17

  3. Extending the previous problem: Show how, if the encryption scheme from Exercise 11.17 is used and you have captured a ciphertext \(c\) that you know encrypts a message \(m\), you can replace \(c\) so that it decrypts to any message of your choice of the same length. (Note that this is stronger than breaking CCA security. Breaking CCA security just means you can tamper with the ciphertext to make a predictable change in the plaintext. Here we’re saying you can replace the message with a message of your choosing.)

  4. One way to pick a large random \(\lambda\)-bit prime is to pick a random odd \(\lambda\)-bit number \(x\), loop to test numbers \(x\), \(x+2\), \(x+4\), \(x+6\) and so on for primality using a function ISPRIME until a prime number is found. Eventually (and generally before very long) one will be prime.

    Here’s a mistake someone made in implementing RSA one time: This method was followed to find the prime \(p\), and then they just continued counting to test \(p+2\), \(p+4\), \(p+6\) and so on until a second prime was found, which is \(q\). Now the modulus is \(N=p\cdot q\). Show how you can very quickly factor any number \(N\) generated in such a manner.

  5. In this class, everyone’s first name is less than 10 letters long. You’ll be doing computations with large numbers in this problem, and I would recommend using Python (there are other ways, including writing using the “BigInteger” class in Java, but Python is much easier). Note that in Python, pow(a,b,n) efficiently computes \(a^b\ \%\ n\). For all the parts below, show your work, describing how you did the computations.

    1. Write out your name using ASCII character codes in hexadecimal, and then convert that to decimal (you can do this by hand, but you can also just type the hexadecimal digits into Python preceded by “0x”).

    2. The decimal number 2349310626352960893120133 is an “RSA modulus” that is larger than \(2^{80}\), so should be larger than the value you computed in part a. Using RSA values e=17 and d=1520142169991108573141333, compute the “Textbook RSA” signature of your name. You may give this value either in decimal or hexadecimal.

    3. My public key has RSA modulus 2551255183750716043759591 and e=3. You don’t know my secret signing key \(d\), but since this modulus is so short you can figure it out. Forge a signature on your name (the value from part a) for my key. (Hint: WolframAlpha is pretty good at factoring….)

  6. In the previous question, the public exponents (\(e\)) in both cases were small values. There’s a reason for this!

    1. Trace through the ModExp algorithm from page 235 and count how many squarings and multiplications are required for \(e=3\) (don’t worry about the cost of the mod operation – just count squarings and multiplications).

    2. If \(e\) were a random 80-bit value, approximately half of the bits would be zero and half would be one. Approximate how many squarings and multiplications are required, on average, for such a value.

    3. The most common public exponent \(e\) used in practice is 65,537. What is this number in hexadecimal, and why does this make an efficient exponent?