In a static RSA TLS 1.2 handshake, which message carried the premaster secret, and what does TLS 1.3 send instead?
answer
- Who generated the secret, and who decrypted
- Transport versus agreement, on the wire
- client_key_exchange(16) carried an encrypted blob
- In 1.3 that private key only signs
- A stored recording plus a leaked key
basics
~20 sThe client generated a 48-byte premaster secret, encrypted it under the RSA public key in the server's certificate, and sent it in client_key_exchange(16). TLS 1.3 has no such message: both ends contribute ephemeral key_share(51) values instead.
solid answer
~40 sTLS 1.2 had two shapes. In **key transport**, the client chose a 48-byte `pre_master_secret`, encrypted it under the RSA public key the server's certificate binds, and sent the ciphertext in `client_key_exchange(16)`; there was no `ServerKeyExchange (12)` at all, because the server contributed nothing but its certificate. In **key agreement**, the server sent `ServerKeyExchange (12)` carrying the named group and its own ephemeral public value, signed with the certificate's private key, and `client_key_exchange(16)` carried the client's ephemeral public value. TLS 1.3 removed the transport shape entirely: both public values ride in `key_share(51)`, and the certificate's private key never decrypts a transmitted secret — it only signs. The operational difference is what a stored recording is worth to someone who later obtains that private key.
code
pseudocode · 15 linesTLS 1.2, static RSA (key transport):
client_key_exchange(16)
-> EncryptedPreMasterSecret
= RSA_encrypt(cert_public_key, 48-byte pre_master_secret)
// no ServerKeyExchange message at all
TLS 1.2, ephemeral (key agreement):
ServerKeyExchange (12)
-> named group + server public value + signature over them
client_key_exchange(16)
-> client public value
TLS 1.3:
// neither message exists; both public values ride in
key_share(51), and the certificate key only signsgo deeper
Recall the two shapes by their messages: a secret encrypted to the server's certificate key, versus two public values that let each side compute the secret itself.
Explain what client_key_exchange(16) held in each shape and why the static case had no ServerKeyExchange (12) message to go with it.
Given a captured connection, say what the certificate's private key would and would not open, and separate the negotiated version from the negotiated exchange shape when you answer.
Treat a long-lived key that decrypts as a different class of asset from one that only signs, and let that difference drive where the key lives and what a compromise of it obliges you to do.
Consider a vote-tally transmitter uploading precinct results, and an adversary who simply records the upload and keeps it. What that recording is worth later depends entirely on **how the two ends reached their shared secret** — and TLS 1.2 offered two mechanically different answers to that, of which TLS 1.3 kept only one. ## Key transport: the secret was mailed In a static RSA handshake, the server's certificate was not only an identity claim; its public key was an encryption key. The client generated a 48-byte `pre_master_secret` (two version bytes and 46 random bytes), encrypted it under that RSA public key, and put the resulting `EncryptedPreMasterSecret` in `client_key_exchange(16)`. The server decrypted it with the matching private key, and both sides ran that secret through the TLS 1.2 pseudorandom function to produce the master secret and from there every record key. Two details matter: - There was **no** `ServerKeyExchange (12)` message in this shape. The server contributed no key-exchange value of its own; the client chose the secret unilaterally. - The one long-lived private key behind the certificate was therefore a **decryption** key, used on every connection for years. ## Key agreement: nothing secret was sent The ephemeral shape of TLS 1.2 looked different on the wire. The server sent `ServerKeyExchange (12)` carrying the named group it had selected and a freshly generated public value, plus a signature over those parameters made with the private key its certificate binds. `client_key_exchange(16)` then carried the client's own ephemeral public value. Each side combined its private value with the peer's public one; the premaster secret was computed, never transmitted. Here the long-lived key **signs** — it proves who chose the server's ephemeral value — and decrypts nothing. ## What TLS 1.3 kept TLS 1.3 removed key transport. There is no `client_key_exchange(16)` and no `ServerKeyExchange (12)`; both ephemeral public values travel in `key_share(51)` in the first two flights, and the certificate's private key is used for exactly one thing in the handshake — signing, in `CertificateVerify`. | | TLS 1.2 static RSA | TLS 1.2 ephemeral | TLS 1.3 | |---|---|---|---| | Secret reaches the server by | encryption under the certificate key | agreement from two public values | agreement from two public values | | Server key-exchange message | none | `ServerKeyExchange (12)` | none — `key_share(51)` | | Client key-exchange message | `client_key_exchange(16)` | `client_key_exchange(16)` | none — `key_share(51)` | | Certificate's private key | decrypts | signs | signs | ## What the stored recording is worth This is where the mechanism shows up operationally. With key transport, the entire premaster secret is present in the recording — as ciphertext under a key that outlives the connection by years. Anyone who later obtains that private key, by any route, decrypts the `EncryptedPreMasterSecret`, reruns the same derivation over the hello randoms (which were sent in the clear and are in the recording too), and reads every record in that session. Rotating the certificate afterwards does not help the sessions already captured: the key that opens them has already been copied. With an agreement exchange, the recording holds both **public** values and neither private one. The certificate key cannot decrypt anything in it, because nothing in it was ever encrypted to that key. The ephemeral private values existed only in the two hosts' memory for the life of the handshake. ## Reading this on a real connection The practical form of the question is usually diagnostic rather than theoretical: 1. Which TLS version did the connection actually negotiate? A 1.3 connection cannot have used key transport, because the mechanism is gone. 2. If 1.2, did it negotiate an ephemeral exchange or a static RSA one? That, not the version number, decides what a capture is worth. 3. What is the certificate's private key still able to do? In either 1.2 shape it can impersonate the server on new connections; only in the transport shape does it also open recorded ones. Keeping those three apart is what separates an answer about mechanism from an answer about vocabulary.
- What did ServerKeyExchange (12) carry in a TLS 1.2 ephemeral handshake, and why did it need a signature?The named group the server selected and the server's freshly generated public value, followed by a signature over those bytes made with the private key its certificate binds. Without the signature the ephemeral value would be unattached to any authenticated identity, and anyone in the path could substitute their own.
- If TLS 1.3 never encrypts anything to the certificate's public key, what is the matching private key still for?Signing. The server proves possession of it in `CertificateVerify`, over the handshake transcript, which is what binds the certificate to this particular exchange. Losing that key still lets an attacker impersonate the server on new connections — it simply does not open recorded ones.
- Which TLS 1.2 connections carried this exposure, and which did not?Only the ones that actually negotiated static RSA key transport. A TLS 1.2 connection that negotiated an ephemeral exchange sent no secret under the certificate key, so a recording of it is not opened by that key. The version number alone does not tell you which happened.
Key transport is mailing sealed boxes to an address whose lock never changes: whoever later obtains that lock's key opens every box ever sent, including the copies taken in transit. An agreement leaves no box for that key to open.
saying these in an interview costs you the question
- Says the server's private key can still decrypt a TLS 1.3 recording.
- Thinks the certificate's key encrypts application data in every TLS version.
- Believes a static RSA handshake included a ServerKeyExchange (12) message.
- Claims TLS 1.3 kept key transport as a fallback for old clients.
- Thinks rotating the certificate key protects sessions already recorded under the old one.
- Assumes every TLS 1.2 connection used key transport.