Teachers' Portal  /  A-Level Computer Science 9618  /  Security  /  SSL and TLS
Lesson pack · A-Level Computer Science 9618 · 17.1 · A Level (A2)

SSL and TLS

The padlock, explained. Every time a browser shows a padlock, SSL/TLS is at work between the client and the server.

Student lesson Lab, full screen
At a glance

The shape of the lesson

Topic
Security
Syllabus reference
Cambridge International AS and A Level Computer Science 9618, 17.1
Level
A Level (A2)
Duration
45 minutes, lab-led; stretches to a 60 minute block (see the contingency notes)
Position in topic
Lesson 2 of 3 in Security; follows Symmetric and asymmetric encryption, quantum cryptography; leads into Digital signatures and digital certificates
Central model
Fig. 1: the handshake uses the server's key pair and certificate; the conversation then uses a shared symmetric session key
Cooperative structure
Assessment
Stage 1 check and the exam-style plenary from the student lesson, plus the worksheet as the exit task
Learning objectives

By the end of the lesson, learners can

Section by section
  • What SSL/TLS is for: In the lab, follow a URL to a web server.
  • 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.
  • 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.
Key points to leave on the board
  • Purpose: encryption, authentication of the server, integrity of data in transit.
  • Handshake: client hello, server sends certificate (public key), client checks it.
  • Session key: exchanged using the server’s public key; only its private key can recover it.
  • Data: then encrypted symmetrically with the session key, because symmetric is faster.
The core visual model

One picture every idea returns to

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
Lesson sequence

Forty-five minutes, phase by phase

TimePhaseWhat happens in the roomGrouping
0 to 5 minHook: predictOpen with the question in the title, The padlock, explained.. Every time a browser shows a padlock, SSL/TLS is at work between the client and the server. Put the figure on the board: it is the one picture every idea in the lesson returns to.Whole class, then pairs
5 to 13 minTeach and check: What SSL/TLS is forIn the lab, follow a URL to a web server. Project tab 1 of the lab (HTTP or HTTPS: from URL to web page) and let a student drive it while the class predicts.Whole class, then pairs
13 to 21 minTeach and check: The handshakeTLS 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. Model the worked example Why two kinds of encryption? on the board, one line at a time. 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?Pairs
21 to 30 minTeach and check: When to use itSSL/TLS is appropriate wherever data travelling over a network is confidential, or where the user must be sure who they are talking to.Anticipation / Reaction Guide
30 to 36 minCheckThe four Stage 1 questions from the student lesson, answered on mini whiteboards or by show of fingers. Re-teach the one most get wrong.Individual, then whole class
36 to 43 minPlenaryThe exam-style questions from Stage 2, one at a time: thirty seconds alone, then a random call. The feedback lines in the key give the examiner's wording.Individual, random call
43 to 45 minExit and homeworkSet the worksheet below (6 questions, 19 marks). Learners self-assess against the objectives before they leave.Individual
Timing and contingency

Protect the parts that carry the learning

The sequence carries about fifty minutes of material, so the lab is driven by one student while the class predicts rather than explored freely. Times are a guide.

Protected: the check at 30 minutes. It is the only individual read on whether the key idea landed, and it is not cut.

Cut first if the build overruns: the last check in When to use it, never the check or the plenary.

In a 60 minute block: run worksheet questions 1 to 3 in class as a Rally Coach set and model both the hardest worked example and its check live.

Running the cooperative task

Anticipation / Reaction Guide

Before the lesson, students mark five statements true or false. After the teaching they mark them again and justify any change of mind in one sentence each. The statements come from the examiner traps below.

The full structure, with its variations and the other twelve, is on the cooperative-learning page.

Examiner traps to pre-empt

What to head off, and how

Trap learners fall intoTeaching move that pre-empts it
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.
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.
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.Return to When to use it: ask a pair to state the correct version and show it on the lab before moving on.
Worksheet

SSL and TLS: worksheet

6 questions, 19 marks. Written in the style of the papers; no past paper question is reproduced.

NameClassDate
Q1 · recall[3 marks]

State three purposes of Transport Layer Security (TLS).

Q2 · explain[5 marks]

A user types the address of their bank’s website, which uses HTTPS. Describe how SSL/TLS sets up a secure connection between the browser and the web server.

Q3 · explain[2 marks]

Explain why SSL/TLS uses a symmetric session key to encrypt the data rather than continuing to use asymmetric encryption.

Q4 · apply[4 marks]

Identify two situations where the use of SSL/TLS is appropriate. For each, explain why.

Q5 · analysis[3 marks]

A student says: "If a website uses HTTPS, it must be safe to enter my card details." Discuss this claim.

Q6 · recall[2 marks]

State the difference between SSL and TLS, and explain where SSL/TLS operates in the TCP/IP protocol stack.

Answer key and marking notes
Q1 · 3 marks
  • To encrypt data sent between client and server so it cannot be understood if intercepted.
  • To authenticate the server (and optionally the client) using a digital certificate.
  • To ensure data integrity: data altered in transit is detected.
Q2 · 5 marks
  • The browser requests a secure connection and sends the TLS versions / cipher suites it supports.
  • The server replies with its chosen cipher suite and its digital certificate (containing its public key).
  • The browser checks the certificate is valid / issued by a trusted CA / in date / for this domain.
  • The browser generates session key material, encrypts it with the server’s public key and sends it.
  • The server decrypts it with its private key; both now use the shared symmetric session key to encrypt all data.
Q3 · 2 marks
  • Symmetric encryption is much faster / needs less processing than asymmetric encryption.
  • A session involves a large amount of data; asymmetric encryption is used only to exchange the key securely.
Q4 · 4 marks
  • Online banking / payments: account and card details must not be readable if intercepted.
  • Logging in to a website: the password (and session cookie) must be protected from packet sniffing.
  • Accept also: email between client and server, online forms with personal data, VoIP / instant messaging, VPNs, cloud file transfer.
  • One mark for each situation, one for each matching reason.
Q5 · 3 marks
  • HTTPS means the data is encrypted between the browser and that server, so it cannot be read in transit.
  • The certificate only proves the site controls that domain name; criminals can obtain certificates for their own look-alike domains.
  • The user should still check the domain name is correct and the business is genuine; HTTPS does not make the site itself trustworthy.
Q6 · 2 marks
  • TLS is the successor to SSL; SSL is older and its versions are now insecure / deprecated.
  • It operates between the application layer (e.g. HTTP) and the transport layer (TCP).
Quiz

6 multiple-choice questions on this lesson

From the topic question bank. Assign them in the app for a marked score in your gradebook, or run the topic as a class game.

Q11 mark

Which list gives the purposes of SSL/TLS?

  • AEncryption of data in transit, authentication of the server, and integrity of the data
  • BRouting of packets, error correction and allocation of IP addresses
  • CCompression of web pages, caching of images and faster page loading
  • DBlocking malware downloads, filtering spam and scanning attachments for viruses
Q21 mark

Put these simplified TLS handshake steps in order.
1 Client checks the certificate
2 Server sends its chosen cipher suite and its digital certificate
3 Both sides encrypt data with the shared session key
4 Client requests a secure connection and lists the cipher suites it supports
5 Client sends session key material encrypted with the server’s public key

  • A4, 2, 1, 5, 3
  • B4, 1, 2, 5, 3
  • C2, 4, 1, 3, 5
  • D4, 2, 5, 1, 3
Q31 mark

Why does TLS switch to a symmetric session key once the handshake is complete?

  • ASymmetric encryption is much faster, which suits the large amount of data in a session
  • BSymmetric keys do not need to be kept secret once the connection is open
  • CAsymmetric keys can only be used once and are destroyed after the handshake
  • DThe server’s private key is sent to the client so both can use it
Q41 mark

A user logs in to a website over HTTPS on public Wi-Fi. An attacker on the same network captures every packet. What can the attacker read?

  • AOnly ciphertext for the page data and password, because TLS encrypts it between the browser and the server
  • BThe password, because HTTPS encrypts only the web page, not form data
  • CEverything, because TLS protects data only between the router and the server
  • DNothing at all, because TLS stops the packets from being captured
Q51 mark

During a TLS handshake, a browser finds that the server’s certificate is in date and signed by a trusted CA, but was issued for a different domain name. What is the correct response?

  • AWarn the user, because the server has not proved it is the site requested and could be an impostor
  • BContinue silently, because the connection will still be encrypted with a session key
  • CContinue silently, because a certificate signed by a trusted CA is always valid
  • DAsk the server to send its private key so the browser can check its identity directly
Q61 mark

An attacker records an entire TLS handshake, including the encrypted session key material sent by the client. Why can the attacker still not decrypt the session?

  • AThe key material was encrypted with the server’s public key, and only the server’s private key can decrypt it
  • BThe session key is hashed, and a hash can only be reversed by the client
  • CThe certificate contains the session key, which is protected by the CA’s signature
  • DThe session key was sent in plaintext, but over a separate secure cable
Quiz key
Q1: A

SSL/TLS encrypts the data between client and server, uses a digital certificate to authenticate the server, and adds message authentication codes so changes in transit are detected. Routing and addressing are done by the internet layer (IP). Compression and caching are performance features, not security. Malware and spam filtering are done by anti-malware software and firewalls, not by TLS.

Q2: A

The client opens with its request (4); the server replies with its cipher suite and certificate (2); the client checks the certificate (1); only then does it send the session key material encrypted with the server’s public key, taken from the certificate (5); finally both use the symmetric session key (3). 4, 1, 2 checks a certificate before receiving it. Starting with 2 has the server speak first. 4, 2, 5, 1 uses the public key before the certificate has been checked.

Q3: A

Asymmetric encryption is used only to share the session key safely, because it is slow; the bulk data is then encrypted with the fast symmetric session key. The session key must stay secret, or anyone could read the session. Key pairs are reused for many sessions. The server’s private key never leaves the server.

Q4: A

TLS sits between the application layer (HTTP) and TCP, so everything HTTP sends, including form data such as the password, is encrypted end to end between the browser and the server. Form data is part of the HTTP request and is encrypted with it. Protection covers the whole path from browser to server, not just part of it. The attacker can still capture the packets; they are simply unreadable.

Q5: A

The certificate proves only that its key belongs to the named domain; if that is not the domain requested, the server has not authenticated itself, so the browser warns the user (it could be a pharming or impostor site). Encryption alone is worthless if the other end is an attacker. A trusted signature does not help when the certificate is for a different site. A private key is never sent to anyone.

Q6: A

The client encrypted the key material with the server’s public key, so only the matching private key, which never leaves the server, can recover the session key. A hash is one-way and is not how the session key is protected. The certificate carries the server’s public key, not a session key, which is new for every session. Nothing is sent in plaintext over a separate cable.

Lab and demo

What to project

The student lesson embeds these tabs. Open them full screen on the projector; every slider has a drag handle on the stage.

Slides

Slides for this lesson

A projectable deck for every pack is on the way. Until then, present the student lesson full screen: its sections, figure and lab tabs follow the same order as the plan above.

Also for this topic

Everything else you can use

Original work by the TheLucidSTEM team. The worksheet items are written in the style of the papers; no past paper question is reproduced.
Previous lessonSymmetric and asymmetric encryption, quantum cryptography