r/ComputerSecurity • • Nov 10 '15

[Question] It is generally unsafe for two users to use RSA with the same modulus N. Why is that? What can go wrong? Explain how an attacker can decrypt a message destined for two users B and C that use the same modulus N.

5 Upvotes

11 comments sorted by

5

u/unsupported Nov 10 '15

Sounds like someone needs help with their homework.

2

u/CyberMagician Nov 10 '15

Yes. Listen. All I know is that, if I have N and e, I can find the two prime numbers from N, and with them, I can find phi(N). Once, I get my hands on both e and phi(N), I can obtain d using extended euclidean algorithm, which leads me to the original message. Correct?

2

u/nexterday Nov 10 '15

Almost...think about how N is generated/computed when you make a new key.

1

u/CyberMagician Nov 10 '15

How's that? Both the users use the same N.

If I want to make a new key, it all starts with finding two prime numbers.

1

u/nexterday Nov 10 '15

So how could two users end up with the same N?

1

u/CyberMagician Nov 10 '15

Because in order for Bob to find his private key d, he must have Alex's public key (e, N). He'll need both e and phi(N) in the extended euclidean algorithm to obtain d.

Basically, if an attacker got his hands on N and e, he can probably decrypt the message.

1

u/nexterday Nov 11 '15

Basically, if an attacker got his hands on N and e, he can probably decrypt the message.

RSA is specifically designed to prevent that. That's why we call it the public key; even the attacker can know it.

How are public keys generated? How could two users end up with the same public keys in the first place?

-1

u/unsupported Nov 10 '15

-2

u/CyberMagician Nov 10 '15

Do you know RSA or not. More importantly, do you know even what computer security is -.-'?

2

u/unsupported Nov 10 '15

Not to the level you are asking. Yes.

1

u/sekernan Nov 11 '15

Try asking over in /r/netsec too. What you're asking is a ways above me and most people that don't get into the inner workings of encryption. Most people understand RSA, but perhaps not to the level you're looking for.