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

Secret messages

Week 22 · Unit 9 · Unit · 3 lessons
3

One rule for both

Computing 3: Unit 9, pp. 135–146
GoalExplain why the sender and the receiver must use the same rule, and what to do if a rule is found out.
New words
sender · the person who sends the messagereceiver · the person who gets the messagecrack · to work out a cipher without being told the rule
Explanation

A cipher only works if the sender and the receiver both know the same rule. The sender encodes the message with the rule. The receiver decodes it with the same rule. If the receiver uses a different rule, the message still comes out wrong. A person who does not know the rule can try to crack the cipher by looking for patterns. That is why a rule is only told to the people who should know it. If a rule is found out, the team agrees on a new one. A password is a secret too: we tell it only to a parent or a carer.

sender encodesciphertext travelsreceiver decodes
Worked examples
WhoWhat they doThe message
Nodiraencodes: flips the whole messageetik eht gnirb
Amirdecodes: flips the whole message againbring the kite
Nodira sends “bring the kite” to Amir. She uses the flip text cipher, so she writes “etik eht gnirb”. Amir flips the whole message again and reads “bring the kite”. The rule is the same on both sides.
StepResult
Nodira flips the whole messageetik eht gnirb
Amir flips each word on its ownkite the bring
What if the rule is different? Amir flips each word on its own instead. Then he reads “kite the bring”. All the letters are right, but the words are in the wrong order, so the message is spoiled.
Rule“bring the kite” becomes
old: flip the whole messageetik eht gnirb
new: flip each wordgnirb eht etik
The friends find out that someone has seen their rule. They agree on a new one: flip each word on its own, and keep the words in order. “bring the kite” now becomes “gnirb eht etik”.
Class activity

Secret club (in a group of three or four): choose one player to be the outsider, who waits outside the door. The others agree on the flip text cipher and write a short message in ciphertext on a card. The outsider comes back and tries to crack it. Then the club changes the rule to “flip each word” and writes a new message. Talk about it: why did the club change the rule? Who should know the new rule?

Practice
1
Who should know the rule of a cipher?
2
Sara encodes “go to the park” with the flip text cipher. What does she write? Omar flips each word on its own. What does he read?
Plain textSara writesOmar reads
go to the park??
3
The team finds out that the rule is no longer a secret. What should they do?
found the rulenew rule
4
Ali wants to tell a friend his password in a secret message. Is that a good idea?