Skip to content
The Lumenary

Each worksheet prints cleanly on A4 or Letter. Answer keys are on a separate page.

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 kk is undone by a shift forward by 26−k26 - k
  • 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. 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. 2.

    Encode ZEBRA with a Caesar shift of 3.

    • A.CHEUD
    • B.ZHEUD
    • C.WBYOX
  3. 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. 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. 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. 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. 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. 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. 9.

    In Lean, caesar k message encodes a message with a Caesar shift by k. Which statement says that shifting by 26 − k decodes every message encoded with key k (for any key k from 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"
  10. 10.

    Write a function shift_letter(letter, k) that shifts one capital letter k places forward, wrapping round after Z. For example shift_letter("A", 3) is "D" and shift_letter("Y", 3) is "B". Use the string ALPHABET: ALPHABET.index(letter) gives the letter's number (A = 0), and ALPHABET[n] gives the letter with number n. In Python, n % 26 is the remainder when n is divided by 26.

    Computational — Practice

Code: Apache-2.0 · Content: CC BY-SA 4.0