# special public keys and modulo n

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?

• 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)? – Thomas Nov 18 '14 at 3:23
• @Thomas Sorry, I am talking about RSA cryptosystem – ChesterL Nov 18 '14 at 3:29
• @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. – fgrieu Nov 18 '14 at 7:39
• @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. – fgrieu Nov 18 '14 at 7:52

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.