1
$\begingroup$

I just picked up cryptography and have some questions on RSA cryptosystem:

  1. Say there are two public keys (n, e1), (n, e2), e1 is coprime to e2. They share the same n. Is it possible to find the plaintext if both of them encrypt the same message if I have both 2 public keys and 2 ciphertexts?

  2. Usually, we use two primes p, q to construct modulo n = pq. I am wondering if we change n to pqr....... which is the multiplication of more than two primes, is the phi(n) equal to (p-1)(q-1)(r-1)..... and nothing else need to be changed to make RSA still work?

$\endgroup$
  • 1
    $\begingroup$ Are you talking about textbook RSA (no padding, just interpret the message as a number and raise it to an exponent) or real world RSA (with padding)? $\endgroup$ – Thomas Nov 18 '14 at 3:23
  • $\begingroup$ @Thomas Sorry, I am talking about RSA cryptosystem $\endgroup$ – ChesterL Nov 18 '14 at 3:29
  • 1
    $\begingroup$ @ChesterL: In 1, you are talking about textbook RSA (also discussed here), where the plaintext is enciphered without prior transformation. In RSA as actually used, random padding is used, see PKCS#1; among many other things, its guards against what you are tasked to find. $\;$ In 2, you are talking about multi-prime RSA. $\endgroup$ – fgrieu Nov 18 '14 at 7:39
  • 1
    $\begingroup$ @ChesterL: For 1, enumerate your knowns (I count 5 of them) and unknown, and what relations you have between these. Then notice that if you know $x^i\bmod n$, $x^j\bmod n$, and $n,i,j$, then you can efficiently compute $x^{a\cdot i+b\cdot j}\bmod n$ for any integers $a$ and $b$, including negative. $\;$ You might want to write down an answer to your own question. $\endgroup$ – fgrieu Nov 18 '14 at 7:52
1
$\begingroup$

1) Yes. This is the common modulus attack and has actually been answered many times on this forum.

2) Assuming $r$ is prime, yes. $\phi(n)$, (the totient of $n$) can be computed by subtracting 1 from each of $n$'s prime factors and multiplying them together.

$\endgroup$
  • $\begingroup$ In 2), do I need to change anything else? $\endgroup$ – ChesterL Nov 19 '14 at 12:40
  • 2
    $\begingroup$ You need distinct primes. Also if you're using CRT you'll need to change your code a bit to take advantage of the multi prime speedup. $\endgroup$ – CodesInChaos Nov 19 '14 at 12:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.