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.
Predict: Read the problem and decide what you think before you try anything. A wrong guess is fine: it shows you what to look for.
Try: Try it on the board and compare the result with your prediction.
Investigate: Work out why it happens, one step at a time.
Modify: Change the problem on purpose and see what happens.
Practise: A few on your own, to check you have it.
Make: Make your own problem using what you have learned. Expect a few tries; that is normal.
Make your prediction first. Help opens once you've locked it in.
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?
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.
SLQ 7154This is what travels, and all Eve can copy.
SLQ 7154→PIN 4821The bank moves everything 3 back: decrypt with the same key.
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.
Sam decides whether it is safe to type a password. Click the line where the reasoning first goes wrong.
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.
PractiseA few on your own, to check you have it.
Keep it safe
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.
I can explain why data needs encrypting when it is sent.
I can encrypt and decrypt a short message with a key.
I can say what makes a key weak.
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
Predict: students who chose "only the bank" hold Sam's misconception; trace the path after the Try.
Try: ask whose Wi-Fi it is, and who else could be on it.
Worked example: have students encrypt their initials with key 3.
Vary: the key 10 task surprises: ask why the digits came through unchanged.
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
A student says only the receiver sees the message (Sam's mistake). Ask: Which pieces of equipment does the packet pass through? Fix: Every one of them could copy it.
A student shifts the wrong way to decrypt. Ask: Which way did encryption move the letters? Fix: Decrypt by moving back by the same key.
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
who can read it?: Committing to who can read an unencrypted message tests the new move: packets cross shared equipment, so anyone on the path can read plain text.
Try: send it plain: Sending the PIN with encryption off settles the prediction: Eve's panel shows it in full.
Worked example: encrypt, then send: Following the PIN through encryption with key 3 and back models the new move: the scrambled packets are useless to Eve, and reversing with the key restores them. Sam assumes only the receiver sees a message, the misconception planted after the method.
Vary: one setting at a time: Each task changes one setting: encryption on, then key 0, then key 10 (which leaves the digits unchanged), then how many keys there are to try.
keep it safe: Choosing what needs encryption, decrypting with a key, the padlock on websites, and a review of packets.
a safe key: Choosing a key that scrambles both the letters and the digits reverses the process: students start from what Eve must not see and pick the setting.
Now you can
Explain why data needs encrypting when it is sent.