Cryptography and Computer Security - Exercise 5
Subject: Modern Public-Key Encryption: RSA
Submission deadline: 29/12/2010


  1. Programming Generate your own 31- or 32-bit RSA public and private keys: Once you have a working RSA system (nz, ez, dz), sign your Teudat Zehut number (seen as a 9-digit integer): that is, compute

    SIG = (TZ)dz(mod nz).

    Send the results by email according to the instructions below.

  2. Consider an RSA system with a public key (n, e), with n = pq.
    1. Show an algorithm to find the factors of n if the secret $ \phi$(n) is leaked. Hint: write and solve a quadratic equation. Justify why your solution works on integers.
    2. What is the time complexity of your algorithm (order of magnitude as a function of n)? take into account the complexity of computing integer square roots.
    1. What is the probability that a randomly chosen number a would not be relatively prime to a given RSA modulus n?
    2. Estimate this probability in terms of n for p $ \approx$ q and for p $ \approx$ q3.
    3. What threat would such a number a pose ?
  3. In a given RSA system with public (n, e), prove that there exist more than one posible secret exponent d that works. In other words, show that there exists d' < $ \phi$(n), d'$ \ne$e-1 mod$ \phi$(n), which correctly decrypts every message C = me mod n.

Submission Instructions

  1. Hand in questions 2-4 on paper.
  2. Send question 1 via email to
    crypto-netsec@eng.tau.ac.il
  3. The subject should be: ex5. Do NOT put a dash ("-") between the "x" and the "5" as it confuses the mailer.
  4. The body of the email should contain 4 lines, including the leading keywords and the ":=" symbols:
    TZ  := your "Teudat Zehut" number (9 digits)
    NZ  := the public modulus nz from q.1
    EZ  := the public exponent ez from q.1
    SIG := the signature from q.2, (TZ)dz(mod nz) from q.1.
    Note that these are all PUBLIC values. Do NOT send your secret keys!
  5. Send plain ASCII email.



Avishai Wool 2010-12-19