Automatic Graders for CS 465

RSA Grader

You may use the language of your choice for this assignment. You may use a bignum library as in the Diffie-Hellman assignment. You may not use any built-in modular exponentiation, multiplicative inverse, Euclid's algorithm, etc., but you may use a library to help you generate your prime numbers p and q.

To implement RSA, you will first need to,

  1. Generate 2 512-bit primes p and q. Ensure that their high order bit is set. Verify that (p-1)(q-1) is relatively prime to 65537 (which we will be using for e). If it isn't, choose new p and q values.
  2. Using n=pq and e=65537, calculate the secret exponent d, such that ed=1 (mod phi(n)).
  3. Verify that for numbers m less than n, ((m^e%n)^d)%n == m.
  4. Enter these values into the provided form.

Submission