LLI Wiki — My Digital Knowledge Base

HTTPS: how encryption works between browser and server

Simplified diagram of the asymmetric key exchange followed by symmetric session-key encryption.

This memo summarises, as a diagram, how HTTPS encrypts traffic between a browser and a web server: asymmetric encryption is used first to exchange a key, then symmetric encryption takes over.

Steps

  1. The browser initiates the connection and asks for an HTTPS connection.
  2. The web server, which holds a public key and a private key, sends back its public key.
  3. The browser generates a session key.
  4. It encrypts the session key with the server's public key and sends it.
  5. The server decrypts it with its private key and obtains the session key.
  6. Asymmetric encryption stops; both sides use the same session key (symmetric encryption) for the rest of the exchange.

Diagram of how HTTPS encryption works

Why two kinds of encryption

Notes

This is a simplified view: real TLS also negotiates algorithms and verifies the server certificate.

Mastodon LLIMastodon SocialFosstodon