A Level · Topic 17.1
A-Level Computer Science 9618 / Topic 17 / A2

The padlock, explained.

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.

The key idea

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.

A simplified TLS handshake ClientServer 1. Hello: TLS versions and cipher suites it supports 2. Hello: chosen cipher suite + digital certificate 3. Client checks the certificate with the CA’s public key 4. Session key material, encrypted with server’s public key 5. Both sides now hold the same session key all data is sent with fast symmetric encryption
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.

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.

StepWhat happens
1The client (browser) contacts the server and asks for a secure connection, listing the TLS versions and cipher suites (encryption algorithms) it supports.
2The server replies with the version and cipher suite it has chosen and sends its digital certificate, which contains the server’s public key.
3The 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.
4The 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.)
5Both 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.
  1. Symmetric encryption is fast, which matters for the large amount of data in a session, but both sides need the same secret key.
  2. Sending that key in the clear would let an interceptor read everything.
  3. 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.
  4. 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?
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.

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.

-Rank -Level -Score -Topics
Go deeper · practice
Six original Cambridge-style questions
The purpose of SSL/TLS, the handshake between client and server, session keys and when SSL/TLS should be used.