0
$\begingroup$

I am trying to understand how RSA public key cryptography works. I have the following questions:

  1. Are any attacks / compromises possible if a server sends its public key $(n,e)$ in the clear to a client?

  2. Suppose a server is using the same public key $(n,e)$ for all the clients in a LAN. Does this pose a threat?

$\endgroup$

migrated from stackoverflow.com Mar 10 '16 at 12:55

This question came from our site for professional and enthusiast programmers.

  • $\begingroup$ As @SergioAndrésFigueroaSantos points out below, if you could give us more context, we could give you a much better answer (what is RSA being used for? What kind of network environment is it being run in? What kind of attacks are you worried about?). $\endgroup$ – Mike Ounsworth Mar 10 '16 at 13:43
3
$\begingroup$
  1. Are any attacks / compromises possible if a server sends its public key $(n,e)$ in the clear to a client?

Nope, it's a public key; it's designed to be public. Shout it out loud, tell the world, there's no risk.

That said, you want to be sure that a Man In The Middle attacker can't intercept the message and replace your public key with their own and then pretend to be you. The only real way to prevent this in to get your public key embedded into a Public Key Certificate tying that public key to your server in some unique way (IP, or domain name, or email address, etc) by a Certificate Authority that both you and the other person have in their trust store. (I'll leave out further details from this post.)

  1. Suppose a server is using the same public key $(n,e)$ for all the clients in a LAN. Does this pose a threat?

Yup, that's fine.

$\endgroup$
  • $\begingroup$ The answer is fine, but I would add one remark: the question suggests a lack of a threat model. "Does this pose a threat?" is a question that depends on a lot of factors. Will the other nodes need strong authentication? Who has access to the private key? In the simplest scenario, defining whether the adversary will be passive (just intercept data) or active (with tampering capabilities). In that case, @Mike Ounsworth's remark about Man in the middle is even more important than the original question. $\endgroup$ – Sergio Andrés Figueroa Santos Mar 10 '16 at 13:16
  • $\begingroup$ @SergioAndrésFigueroaSantos I agree. There was a thread on meta.security.se called “Is (x) Secure” Question Anti-Pattern that was about ill-defined threat models in questions. I argued that when a new user stumbles here looking for introductory information, pressing them for a threat model (or giving an answer that heavily depends on a threat model) is more likely to scare them off than anything. $\endgroup$ – Mike Ounsworth Mar 10 '16 at 13:37

Your Answer

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