What if n of RSA is same for two people over the network? I was just going through RSA encryption scheme and was trying to figure out how to do all maths. I was suddenly struck by the question that (e,n) is public to the people. How easy it becomes to attack one's system if you find out that you are using same n as someone else?
How easy it becomes to attack one's system if you find out that you are using same n as someone else?


I'd be pretty easy to recover someone else's private key, even if they're using a different public exponent e; you know the factorization of n (your private key tells you that), and so it'd be simple to compute the private exponent that corresponds to their public exponent.

As a follow up, you might want to estimate the probability of two people, who are using good random number generators [1], just happen to pick the same value for n, for any secure size of n (hint: how many possible values of p and q are there?)



[1]: this 'good random number generator' cavaet is needed, because we have found duplicated RSA modulii in the field; this happened because they used a bad random number generator (more specifically, bad entropy)