6

The number $43733$ was chosen as base for an implementation of the RSA system. $M=19985$ is the message, that was encrypted with help of a public key $K=53$.

What is the plaintext text? What is the private key?

So far, my calculations are:

  1. $n=pq$
  2. $n=101*433$
  3. $\phi(43733) = (101 − 1)*(433 − 1) = 43200$.
  4. The public key is $(n = 43733, e = 53)$.
  5. The private key is $(n = 43733, d = 12343)$.

However, I'm not sure if this is right? Where am I going wrong?

1 Answers1

4

The public key is $K = e = 53$, already given. $n$ (the modulus) must also be given, so you could say that $(e, n)$ is the actual key.

The private key is $d$ which must satisfy $d * e = 1 \mod \phi(n)$. So you're looking for $d$ for which $(53 * d) \mod 43200 == 1$. A quick brute-force search (with such small numbers it's not a problem) reveals that $17117$ satisfies this equation.

Now $N=43733$, and you're guaranteed that $(M^e)^d = (M^d)^e = M \mod n$.

Your message is $M=19985$:

  • $19985^{53} \equiv 17195 \mod 43733$

  • $17195^{17117} \equiv 19985 \mod 43733 $

This shows that you can encrypt using the public key and decrypt using the private key. The opposite also works (for signing the message):

  • $19985 ^{17117} \equiv 125 \mod 43733$

  • $125 ^{53} \equiv 19985 \mod 43733$

There are better ways to find $d$ from $e$ if you know $\phi(n)$. But if you don't, you're in trouble, because you need to factorise $n$ to do that.