← Networks

Who can see your data?

Packets pass through Wi-Fi and routers you don't control, and anyone along the way can copy them. So anything private must be encrypted on your device before it leaves: scrambled with a key, so only someone with the key can turn it back. Encryption only works because it can be reversed.

You type your PIN on the café's free Wi-Fi. Between you and the bank, who else gets a copy?

In Packets, routers passed each packet along. But who owns those routers? Your packets go through the Wi-Fi you're on, your internet provider and many other networks. Anyone with access to one of them can copy the packets as they pass.

PredictRead the problem and decide what you think before you try anything. A wrong guess is fine: it shows you what to look for.

Who can read it?

You type your PIN into a website on a café's free Wi-Fi. The website has **no encryption**. Who could read the PIN on its way to the bank?

TryTry it on the board and compare the result with your prediction.

Try: send it plain

Was your prediction right? Now look at the Encrypt button.

Try it yourselfYour edits are saved in this browser.

Send the PIN with encryption off. What does Eve see?

Use the board. This ticks when you get there.

InvestigateWork out why it happens, one step at a time.

Worked example: encrypt, then send

Worked exampleBefore each step, say what you think comes next.
  1. PIN 4821\text{PIN 4821}Your message, before it leaves.

This shift (a Caesar cipher) is easy to break, as the Secret messages course shows. Real encryption uses far stronger maths, but works the same way: a public method and a secret key.

With key 3, every letter moves 3 along (A → D) and every digit moves 3 along (7 → 0). What does **CAT 12** become?

Sam decides whether it is safe to type a password. Click the line where the reasoning first goes wrong.

Why must encryption be **reversible**?

ModifyChange the problem on purpose and see what happens.

Vary: one setting at a time

Try it yourselfYour edits are saved in this browser.

Switch encryption on and send.

Use the board. This ticks when you get there.

Set the key to 0 and send. What does Eve see?

Use the board. This ticks when you get there.

Set the key to 10 and send. Look closely at the digits.

Use the board. This ticks when you get there.

This shift has only 26 different keys. How could Eve break it without knowing the key?

PractiseA few on your own, to check you have it.

Keep it safe

Which of these most needs encrypting when you send it?

A message was encrypted with key 3. You receive **KHOOR**. What did it say?

What does the padlock in a browser's address bar mean?

Review: a packet is lost on the way. With TCP, what happens?

MakeMake your own problem using what you have learned. Expect a few tries; that is normal.

A safe key

Then: the Secret messages course (Code) builds this cipher on micro:bits, cracks it, and shares a key safely.

Try it yourselfYour edits are saved in this browser.
Need a hint?

Key 0 changes nothing.

Another hint

Digits wrap round every 10, so keys 10 and 20 leave them unchanged.

Another hint

Any key from 1 to 25 that isn't 10 or 20 works.

Encryption is on but the key is 0. Choose a key that scrambles both the letters and the digits, send the PIN, and check the bank still reads it.

Use the board. This ticks when you get there.

For teachers

Students send a PIN past an eavesdropper on café Wi-Fi, first in plain text and then encrypted with a shift key, to explain why data must be encrypted in transit and show that encryption is reversible with the key (AC9TDI8K02 nodes 3 and 4). About 40 minutes.

Open the teacher guide: answers, solutions, slides and a worksheet.

Students will be able to

Before class

Try the boards yourself.

The kit's chain for node 3: packets leave your device → travel through routers you don't control → anyone along the path can read them → so encryption is necessary. Node 4 (simple encryption) is here as a shift cipher on letters and digits, with the encrypt-decrypt cycle; the Code pathway's Secret messages course is the deeper home of ciphers (Caesar, XOR, cracking, key sharing). For students who have done it, this lesson is the why; for those who haven't, it is a first taste.

Defensive framing: the eavesdropper shows why protection matters; no attack techniques are taught.

Running the lesson

  1. Predict: students who chose "only the bank" hold Sam's misconception; trace the path after the Try.
  2. Try: ask whose Wi-Fi it is, and who else could be on it.
  3. Worked example: have students encrypt their initials with key 3.
  4. Vary: the key 10 task surprises: ask why the digits came through unchanged.
  5. Make: ask what a strong key would need (many possibilities).

The hard part (on purpose)

The shared-path idea: students picture a private tube to the bank. Trace the packets on the board: whose equipment is each one?

When students get stuck

Stretch and support

Stretch: XOR encryption (Secret messages lesson 5) works on the bits directly. Why does that suit computers better than shifting letters?

Support: An alphabet strip and a 0–9 strip to count along.

Where it leads

Next: Across the internet (the whole journey, with HTTPS).

Code links: Secret messages (Caesar, cracking, XOR, key exchange) is where students build and break ciphers.

What each step is for

Now you can
Next lesson4. Across the internetBuying something online uses everything at once: your browser encrypts the data (HTTPS), it is split into packets, the packets cross Wi-Fi and then cables, routers pass them on by different routes, TCP gets any lost packet sent again, and the shop puts them in order and decrypts them.