Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

11
  • 5
    I really like this answer. Is it technically accurate with regards to SSL? If it is, I'm tempted to mark it "most helpful". Gowenfawr's answer is also very helpful and has a lot more votes, but since it has "mangled details" I wonder if this answer is more accurate. Commented Aug 16, 2011 at 14:54
  • 11
    I skipped a lot of details, e.g. the "3" exponent can be another value (traditionally 65537) which is considered to be part of the public key. Also, there is padding at some point (the random value that the client chooses is smaller than x; x results from applying a relatively simple transform). Apart from that, this is how it goes in most SSL connections (the key exchange algorithm is negotiated at the start, but in most deployed SSL servers and client this ends up with RSA, as I describe, and not Diffie-Hellman). Commented Aug 16, 2011 at 15:00
  • 8
    One small tweak - in SSL/TLS - the X of this explanation is actually the "pre master secret", it's used by both the client and the server to generate the "master secret". Then another computation is done to create the "key block" which is a way of generating enough output based on the master secret and a series of random inputs to create the symmetric key needed for the selected symmetric cipher. This is really a small nit since it is pretty linear - if an attacker had the pre-master secret and the in-the-clear hello messages, he'd be able to listen in. Commented Aug 16, 2011 at 16:10
  • 31
    How do you work out x given x cubed modulo n and p and q? Commented Feb 24, 2012 at 9:46
  • 16
    @Justin: short version: you compute d, the inverse of 3 modulo phi(n) where phi(n) = (p-1)(q-1). Then, you do a modular exponentiation of x<sup>3</sup> modulo n, with d as exponent. There are reasonably clear explanations on the Wikipedia page on RSA. Commented Feb 24, 2012 at 12:22