When you open a site over https://, the browser and server complete a TLS handshake within milliseconds — an agreement on how they will communicate securely.
Step by step
- Client hello — the browser sends the TLS versions it supports (today TLS 1.3 and 1.2) and its cipher suites.
- Server hello and certificate — the server chooses the parameters and sends its certificate with the public key and the intermediate certificate chain.
- Certificate check — the browser checks that the certificate was issued for that domain, is valid and chains up to a root certificate it trusts (the root store in the operating system or browser).
- Key agreement — by exchanging (EC)DHE values, client and server compute a shared secret session key; the server proves with its private key that it really owns the certificate.
- Encrypted communication — all further data is encrypted with a fast symmetric algorithm (AES-GCM or ChaCha20) using the session key.
Asymmetric and symmetric cryptography
- Asymmetric cryptography (a public/private key pair, RSA or ECC) is used for identity checks and key agreement. The private key never leaves the server.
- Symmetric cryptography (one shared key) is used to transfer the data itself, because it is much faster.
Thanks to forward secrecy, even if the server's private key were compromised later, previously recorded traffic cannot be decrypted.
What do "256-bit" and "2048-bit" mean?
256 bits is the strength of the symmetric session encryption, while 2048 bits (RSA) or 256 bits (ECC) is the size of the key in the certificate. Strength depends on the server and client, not on a "more expensive" certificate — DV, OV and EV certificates provide the same encryption. They differ in the level of identity verification.
What to configure on your server
- disable outdated protocols (SSL 2/3, TLS 1.0 and 1.1);
- install the complete certificate chain;
- enable HSTS and redirect HTTP to HTTPS;
- check the installation with the tool in SSL installation checker.