AdvertisementYour brand could be hereYour brand hereOn every Darslab page · students, parents and teachersinfo@darslab.comAsk for pricesPricesinfo@darslab.com
☰ Year plan · Computing

Keeping sent data safe

Week 22 · Unit 9: Keeping data safe · 3 lessons
3

Defending data on the move

Computing 6: Unit 9, pp. 124–133
GoalExplain how encryption and one-time codes protect data on the move, and match each threat to a defence.
New words
encryption · scrambling data with a key so that only someone with the right key can read itciphertext · the data after it has been scrambledkey · the secret information used to scramble and unscramble dataone-time code · a code that works only once or for a short time, so a copy of it is useless later
Explanation

You met ciphers in earlier stages: a cipher scrambles a message with a key. Computers use the same idea, called encryption, to protect data on the move. Before the data is sent, it is scrambled with a key into ciphertext, which looks like nonsense. Only the receiver, who has the key, can turn it back. So a sniffer that copies encrypted packets gets only nonsense. To stop replay attacks, many systems add a one-time code, so a copied message is refused when it is sent again. An encrypted connection also checks the website’s digital ID, which makes a man-in-the-middle attack very hard. Real encryption uses huge keys and clever maths, so nobody can break it by trying keys by hand.

Worked examples
ThreatDefenceWhy it helps
packet sniffingencryptioncopied packets look like nonsense
replay attackone-time codesa copied code has already been used
man in the middlean encrypted link that checks the website’s IDthe attacker cannot pretend to be the website
The picture above uses a shift code with the key 5: every letter moves five places along the alphabet, so M becomes R. A sniffer on the way sees only RJJY FY KNAJ. Each threat has its own defence.
TimeMessageCodeDoor
8:10open the door4417opens
8:12open the door (a copy)4417refuses: code already used
8:30open the door9052opens
A garage door opens with a message from a phone. Each message carries a new code, and the door keeps a list of codes that have been used. A copy sent later is refused.
A shift code is weak, because there are only 25 keys to try. Real encryption has so many keys that even the fastest computers could not try them all.
Class activity

Used-ticket game (no computer): three players are the Sender, the Copier and the Receiver. The Sender writes harmless notes, such as ‘Bring the red ball’, and gives each note a new ticket number from 30 upwards. The Receiver keeps a list of the numbers that have arrived and refuses any number that is already on the list. The Copier secretly copies one note and sends it again later. Does the Receiver catch the copy? Next, the Sender and the Receiver agree a shift key in secret before the game. The Sender scrambles one short note with it. Can the Copier read that note? Talk about which defence stopped which threat, then swap roles.

Practice
1
Encrypt BAG with a shift key of 4. Write the ciphertext.
plainsecretABCDEFGHIJKLMplainsecretNOPQRSTUVWXYZ
2
A bike-share lock accepts each code only once. The codes 5120 and 7731 have already been used. Which of the three new messages unlock a bike?
MessageCode
18846
27731
33302
3
Why must the key not travel with the message?
4
Kenji’s friend says ‘My messages are encrypted, so I can tell my password to anyone.’ What is wrong with this idea?