4
$\begingroup$

During the TLS handshake, there are random bytes sent from the server to the client and random bytes sent from the client to the server.

Since these bytes are sent in clear text, what is the relevance of them being random? I thought randomness was mostly about lowering the likelihood that these numbers could be guessed. If they are passed around in clear text; whats the importance of the randomness?

Also, what exactly are these random bytes used for?

$\endgroup$
  • $\begingroup$ I believe they are intended to "nonceify" the exchange, and make it unique in the event of a timestamp repeat $\endgroup$ – Richie Frame Jul 29 '16 at 4:07
  • $\begingroup$ Mustn't nonces be protected from eavesdropping?--dont nonces have to be confidential? $\endgroup$ – Minaj Jul 29 '16 at 4:28
  • 2
    $\begingroup$ @Minaj, no. $\endgroup$ – otus Jul 29 '16 at 6:47
  • 1
    $\begingroup$ Their primare role is to guarantee freshness of the handshake, e.g. guarantee that neither party is just replaying some old recording of a handshake (which they may not even have performed themselves). $\endgroup$ – SEJPM Jul 29 '16 at 9:09
  • 1
    $\begingroup$ The premaster secret is as its name says secret, and separate from the nonces. The premaster secret and the two nonces are input to the PRF to produce the master secret, and the master secret and the two nonces similarly produce the working key material. See rfc5246 sections 8.1 6.3 and 5. If you want to learn about the premaster secret, it depends on the key-exchange method(s) used, which you didn't identify. $\endgroup$ – dave_thompson_085 Jul 29 '16 at 9:32
5
$\begingroup$

Since these bytes are sent in clear text, what is the relevance of them being random?

They are a guarantee that the other party with whom you wish to communicate is actually interactively there and you're not just seeing a recorded session that is being replayed to you, potentially impersonating somebody else.
The randomness helps in this to prevent attackers from simulating a bunch of sessions beforehand and then picking the the relevant one for you.

Also, what exactly are these random bytes used for?

Their actual usage is limited to being additional input to the key based key derivation function that transforms the pre-master secret into the master secret (section 8.1 RFC 5246).

$\endgroup$

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.