The cryptography behind TLS
TLS — still loosely called "SSL" — is what puts the S in HTTPS. It proves a server is who it claims to be, agrees encryption keys over an untrusted network, and protects every byte in transit from reading and tampering. For a Senior DevOps engineer, TLS is operational territory: issuing and rotating certificates with ACM and cert-manager, deciding where TLS terminates on ALBs, NLBs, ingresses and service meshes, debugging handshake failures and broken chains, and making sure a certificate never expires at 2 AM. This topic covers the cryptography you need, the handshake step by step, certificates and PKI, and the AWS/Kubernetes operations.
What TLS guarantees
- Confidentiality — eavesdroppers can't read the traffic.
- Integrity — tampering is detected (every record carries an authentication tag).
- Authentication — the client verifies the server's identity via its certificate (and optionally the server verifies the client — mTLS).
What it doesn't hide: the IP addresses, the fact that you're talking, traffic volume/timing, and (unless Encrypted Client Hello is used) the hostname in SNI.
SSL vs TLS
SSL 2.0/3.0 (Netscape, 1990s) are broken and disabled everywhere. TLS 1.0 (1999) and 1.1 are deprecated; TLS 1.2 (2008) is the minimum acceptable today; TLS 1.3 (2018) is the modern standard. People say "SSL certificate" out of habit — the certificates are the same X.509 certificates used by TLS.
HTTPS = HTTP over TLS, default port 443. TLS also protects SMTP (STARTTLS), database connections, gRPC, LDAPS, Kafka, and DNS (DoT/DoH).
Symmetric vs asymmetric cryptography
| Symmetric | Asymmetric (public-key) | |
|---|---|---|
| Keys | One shared secret key | A key pair: public (shared) + private (secret) |
| Speed | Very fast (hardware-accelerated AES) | Much slower |
| Problem it solves | Bulk encryption | Key exchange and identity |
| Examples | AES-GCM, ChaCha20-Poly1305 | RSA, ECDSA, Ed25519; Diffie-Hellman/ECDHE for key agreement |
TLS combines them:
- Asymmetric cryptography to authenticate the server (it proves it holds the private key matching the certificate's public key by signing handshake data) and to agree on a shared secret (ephemeral Diffie-Hellman, ECDHE).
- Symmetric session keys derived from that secret encrypt all application data.
So: certificates authenticate; session keys encrypt.
Hashes, signatures and MACs
- A hash (SHA-256) is a one-way fingerprint of data — you can't reverse it. Hashing ≠ encryption: encryption is reversible with a key.
- A digital signature = hash the data, then sign the hash with a private key; anyone with the public key can verify. CAs sign certificates this way; servers sign the handshake.
- AEAD ciphers (AES-GCM, ChaCha20-Poly1305) encrypt and authenticate each record in one operation.
Forward secrecy
With ephemeral Diffie-Hellman (ECDHE), each session's keys are derived from temporary key pairs discarded after the handshake. If the server's long-term private key is stolen later, past recorded sessions can't be decrypted. Old "RSA key exchange" (the client encrypts the secret with the server's RSA public key) lacks this — a stolen key decrypts everything ever captured. TLS 1.3 only allows forward-secret key exchange.