GoalDescribe how a client and a server use HTTP, and explain how HTTPS protects the data that is sent.
New words
client · a device that asks a server for a service, such as a web pageserver · a computer that answers requests from clientsHTTP · the protocol used to request and send web pages and other filesHTTPS · the secure version of HTTP, which encrypts (scrambles) the data before it is sent
Explanation
Web pages are sent with a protocol called HTTP. When you type a web address into a browser, your device becomes a client and sends an HTTP request. A server answers with an HTTP response that holds the page, or an error message if the page cannot be found. This pattern is called client–server architecture. Plain HTTP sends text that anyone who intercepts it can read. HTTPS adds encryption: the data is scrambled before it is sent and can only be read with the right key. A secure address starts with https and the browser shows a padlock beside it. Never type a password or payment details on a page that does not use HTTPS, and ask an adult if you are unsure.
HTTP
HTTPS
Address starts with
http://
https://
Data travels as
plain text
scrambled (encrypted) data
If someone intercepts it
it can be read
it cannot be read without the key
Padlock in the browser
no
yes
Worked examples
A request and a response. Lola opens a page of a village bakery at http://example.com/bread. Her laptop is the client and sends an HTTP request. The server at example.com sends back an HTTP response that holds the page: text, prices and pictures.
Message
From
To
Content
HTTP request
Ravi’s laptop
server
‘Send me /tea-cakes.’
HTTP response
server
Ravi’s laptop
error message: page not found
A page that is missing. Ravi types http://example.com/tea-cakes, but the bakery has no such page. The server still answers. This time the response is an error message instead of a page, and the browser shows it.
Address
Starts with
Data is encrypted?
http://example.com/login
http
no, it is plain text
https://example.com/login
https
yes
http://example.net/shop
http
no, it is plain text
Which address is encrypted? Three addresses are shown. Only the second starts with https, so only its data is scrambled. The padlock and the letter s appear together. HTTPS protects the data on its way; it does not prove that the website itself is honest, so an adult should still check a site you do not know.
Class activity
Client and server (no computer). One player is the server and holds five index cards, each with a page name such as ‘home’ or ‘menu’ and a few words of content on the back. The client writes a request on a slip of paper and hands it over. The server hands back the card, or a card that says ERROR: not found. Next round, the messenger who carries the cards between the two may read plain cards, but the server writes each answer in a scramble that only the client has the key to (for example, every letter moved on by two). What did the messenger see in each round?
Practice
1
A laptop, a phone and a tablet have all asked the same computer for a page. Name the role of the computer in the middle, and the role of each of the three devices.
The computer in the middle is the server. The laptop, the phone and the tablet are clients, because they ask for the page.
2
A page asks for a password. Which of these addresses shows an encrypted connection? (a) http://example.net/join (b) https://example.net/join (c) http://example.org/join-s
Only (b). The connection is encrypted when the address starts with https. The letter s at the end of the address in (c) is part of the page name, not part of the protocol.
3
What does the server send back when the page that was requested exists, and what does it send back when it does not exist?
If the page exists, the HTTP response holds the page (text, pictures and so on). If it does not exist, the response is an error message.
4
A learner says: ‘HTTPS means the website is honest.’ Is the learner right? Explain.
No. HTTPS only encrypts the data on its way between the client and the server, so other people cannot read it. A dishonest website can also use HTTPS, so you should still ask an adult before using a website you do not know.