Every time a browser shows a padlock, SSL/TLS is at work between the client and the server. It combines everything from the last lesson: asymmetric keys and a digital certificate to start the conversation safely, then a fast symmetric session key for the data itself.
SSL (Secure Socket Layer) and its successor TLS (Transport Layer Security) are protocols that provide a secure connection between two computers, normally a client and a server. Their purpose is to give encryption (data cannot be understood if intercepted), authentication (the server proves who it is with a digital certificate) and data integrity (any change in transit is detected). A handshake uses asymmetric encryption to agree a session key; the data is then encrypted with that symmetric key. HTTPS is HTTP running over SSL/TLS.
Fig. 1: the handshake uses the server's key pair and certificate; the conversation then uses a shared symmetric session key
Section 01
What SSL/TLS is for.
In the lab, follow a URL to a web server. With https the browser and server first agree an encrypted connection and check the server's certificate before any page is requested. Change https to http and that step disappears.
Encryption: data passing between client and server is encrypted, so a packet sniffer sees only ciphertext.
Authentication: the server sends a digital certificate, so the client knows it is talking to the genuine site and not an impostor (this defeats pharming and fake sites). Client certificates can authenticate the client too, but this is optional.
Integrity: each record carries a message authentication code, so data altered in transit is detected.
Where it sits: between the application layer (e.g. HTTP, SMTP, IMAP) and the transport layer (TCP) of the TCP/IP stack, so applications get security without changing how they work.
SSL or TLS? SSL is the older protocol and all its versions are now considered insecure; TLS replaced it, but the name "SSL" is still widely used for both.
Examiner trap
HTTPS is not a different protocol from HTTP that "is encrypted". It is ordinary HTTP carried inside an SSL/TLS connection; say SSL/TLS provides the encryption and authentication.
Section 02
The handshake.
TLS is made of two main layers: the handshake protocol, which sets up the secure session, and the record protocol, which then carries the application data in encrypted records. A simplified handshake runs like this.
Step
What happens
1
The client (browser) contacts the server and asks for a secure connection, listing the TLS versions and cipher suites (encryption algorithms) it supports.
2
The server replies with the version and cipher suite it has chosen and sends its digital certificate, which contains the server’s public key.
3
The client checks the certificate is valid: signed by a trusted certificate authority, in date, and issued for this domain. If not, the browser warns the user.
4
The client creates the key material for a session key, encrypts it with the server’s public key and sends it. Only the server’s private key can decrypt it. (Modern TLS often uses a Diffie-Hellman key exchange instead, but the result is the same: both sides share a secret session key.)
5
Both sides now hold the same symmetric session key. All further data is encrypted and decrypted with it until the session ends.
Worked example Why two kinds of encryption?
Explain why TLS uses asymmetric encryption in the handshake but symmetric encryption for the web page data.
Symmetric encryption is fast, which matters for the large amount of data in a session, but both sides need the same secret key.
Sending that key in the clear would let an interceptor read everything.
Asymmetric encryption solves this: the key material is encrypted with the server’s public key, so only the server’s private key can recover it.
Asymmetric encryption is too slow for bulk data, so it is used only once, to set up the session key.
Answer: Asymmetric for safe key exchange, symmetric for speed
Your turn
During a handshake, a browser finds that the server’s certificate was issued for a different domain name. What should happen, and why?
The browser should warn the user / not trust the connection: the server has not proved its identity, so it could be an impostor (e.g. a pharming site) even though data would be encrypted.
Examiner trap
The session key is not the server’s private key. The private key never leaves the server; a new session key is created for each session.
Stage 1 · Learn
Check what the sim just showed you
Four quick checks. Each correct answer earns XP and records this skill on your profile.
Quick check+10 XP
What does TLS stand for?
Quick check+10 XP
In the lab, what extra step happens when the URL starts with https?
Quick check+10 XP
During the TLS handshake, what does the server send to prove its identity?
Quick check+10 XP
Which type of encryption protects the data after the handshake?
Section 03
When to use it.
SSL/TLS is appropriate wherever data travelling over a network is confidential, or where the user must be sure who they are talking to.
Online banking and payments: card numbers, account details and transactions.
Logins: any page where a username and password are sent, and the session cookies afterwards.
Online shopping and forms with personal data: names, addresses, medical or tax information.
Email: between client and mail server (SMTP, IMAP and POP3 over TLS).
Other client-server services: instant messaging, VoIP calls, cloud storage and file transfer (FTPS), VPN connections.
Examiner trap
Name a situation and the reason: "online banking, because account details sent across the internet must not be readable if intercepted" earns more than "banking" on its own.
Stage 2 · Exam
Exam-style questions
Unlocks once the four checks above are done. Worth more XP, written to A Level Paper 3 and Paper 4 standard.
Finish the four checks above to unlock the exam questions
Exam style+20 XP
Which is a purpose of SSL/TLS?
Exam style+20 XP
How is the session key kept secret as it is set up in a TLS handshake?
Exam style+20 XP
In which situation is the use of SSL/TLS least necessary?
Exam style+20 XP
Between which layers of the TCP/IP stack does SSL/TLS operate?
Skill unlocked
SSL and TLS, mastered.
This skill is now recorded on your profile. Keep the chain going.