The Lumenary · Grades 3–5
Secret codes
Name: ______________________
Date: ______________________
You will learn to
- Encode and decode messages with a Caesar shift using an alphabet wheel
- Explain why shifting past Z wraps round to A, and why a shift forward by is undone by a shift forward by
- Break a Caesar cipher by trying all 25 shifts that change the message
- Break a simple substitution cipher by counting letter frequencies
- Explain why a message is not safe just because it looks scrambled, and why the key must be secret
- 1.
This message was made with a Caesar shift of 3 (each letter moved 3 places forward): KHOOR. What does it say?
- A.HELLO
- B.NKRRU
- C.JGNNQ
- 2.
Encode ZEBRA with a Caesar shift of 3.
- A.CHEUD
- B.ZHEUD
- C.WBYOX
- 3.
A message was encoded by shifting every letter 7 places forward. Ngozi's alphabet wheel only turns forward. By how many places forward must she shift to decode it? (Give a number from 1 to 25.)
- 4.
Tobi wants to break a Caesar cipher by trying every possible shift. How many different shifts does he need to try that actually change the message?
- 5.
Chidi shifts a message 10 places forward, and then shifts the result 20 places forward. Which single shift (a number from 0 to 25) would have done the same?
- 6.
In a long message made with a Caesar shift, the most common letter is K. If K stands for E, how many places forward was each letter shifted?
- 7.
A long English message was coded with a substitution cipher (a scrambled alphabet). In the coded message the most common letter is Q. Which plain letter is Q most likely to stand for?
- A.E
- B.Q
- C.A
- D.Z
- 8.
Kai sends KHOOR ZRUOG using a Caesar shift. "Nobody can read it," he says. "It looks like complete nonsense!" Is his message safe?
- A.Yes: it looks like nonsense, so nobody can read it.
- B.No: there are only 25 shifts to try, so anyone can break it quickly.
- C.Yes, as long as nobody knows he used a Caesar shift.
- 9.
In Lean,
caesar k messageencodes a message with a Caesar shift byk. Which statement says that shifting by 26 − k decodes every message encoded with key k (for any keykfrom 0 to 26)?- A.
caesar (26 - k) (caesar k message) = message - B.
caesar k (caesar k message) = message - C.
caesar 23 "PHHW DW QRRQ" = "MEET AT NOON"
- A.
- 10.
Write a function
shift_letter(letter, k)that shifts one capital letterkplaces forward, wrapping round after Z. For exampleshift_letter("A", 3)is"D"andshift_letter("Y", 3)is"B". Use the stringALPHABET:ALPHABET.index(letter)gives the letter's number (A = 0), andALPHABET[n]gives the letter with numbern. In Python,n % 26is the remainder whennis divided by 26.Computational — Practice