Go Back

TLS 1.3 Handshake Packet Analysis

TLS Mechanism

Transport Layer Security (TLS) is a cryptographic protocol that operates above the transport layer to provide secuirty services to applications (such as HTTPS, SMTP, POP3, etc.). We have TLS over TCP and DTLS over UDP and it typically relies on a public key infrastructure (PKI).

TLS provides:

During TLS handshake, it does the following: Then bi-direction authenticated encryption follows in the record layer.

Problem in establishing a master key using RSA:

RSA key is transported as follow: Since TLS v1.3, we use ephemeral Diffie-Hellman where the server generates a temporary (EC)DH pub key and sends toclient, signs it using its signature key from certificate. Client then generates a temporary (EC)DH pub key and sends to the server and they compute (EC)DH shared secret.

TLS setup in advance:

Lab

Procedure:

  1. Dump traffics using wireshark while connecting to my website :D (https://dc-lee.com)
  2. Look into packets :P

High-level observation


Detailed Investigation

1. Packet 12 (Client Hello)
Overview:
2. Packet 14 (Server Hello)
Overview:
3. Packet 15 (Encrypted data from server)
After the server sent its public key, certificate verification, certification and finished messages are sent encrypted. I suspect packet 15 is responsible for it.