Technology and Computer Science Computer Science
Secret Messages: The Caesar Cipher and Keys
Students read an original passage on the Caesar cipher, keys, wraparound arithmetic, brute-force attacks and frequency analysis. They answer 11 questions, including seven cipher problems, then write a coded message for a partner to crack.
THE GOAL
What students will learn
Students encrypt and decrypt messages with a Caesar cipher, explain the roles of plaintext, ciphertext and the key, use wraparound (modular) arithmetic, and explain why a cipher with only 25 keys is easy to break.
BEFORE THE BELL
Get ready
Copy the reading and worksheet (pages 3-5) for each student. Write the alphabet A-Z across the board with the numbers 0-25 under the letters. No computer science background is needed; every answer is in the key.
KEEP THE PLAN CLOSE
Your teacher guide
Teacher directions only. Student worksheets and the answer key are in the complete PDF.
SECRET MESSAGES: THE CAESAR CIPHER AND KEYS
Grades 7-11 | 50 minutes | SP-CS-024
THE GOAL
Students encrypt and decrypt messages with a Caesar cipher, explain the roles of plaintext, ciphertext and the key, use wraparound (modular) arithmetic, and explain why a cipher with only 25 keys is easy to break.
BEFORE THE BELL
Copy the reading and worksheet (pages 3-5) for each student. Write the alphabet A-Z across the board with the numbers 0-25 under the letters. No computer science background is needed; every answer is in the key.
- Student reading (page 3)
- Worksheet (pages 4-5)
- Pencils
- Scrap paper (optional)
STEP BY STEP
1. (5 min) Warm-up: Write on the board: IFMMP. Tell students each letter was moved one step forward in the alphabet. Ask them to figure out the word (HELLO) and explain how they did it.
2. (12 min) Read: Hand out the reading. Students read silently. Walk through the example in paragraph 3 together using the alphabet on the board.
3. (23 min) Worksheet: Students complete questions 1-11. Encourage them to write the alphabet across the top of their paper with numbers 0-25 underneath. Calculators are not needed.
4. (5 min) Code swap: Students trade their question 11 messages with a partner, who tries to decode them using the key written underneath.
5. (5 min) Exit ticket: Students answer the exit ticket. Collect all papers.
NOTES FOR YOU
- The most common mistake is forgetting to wrap around: with a key of 3, X becomes A, Y becomes B and Z becomes C.
- To decrypt, students shift backward by the key. Shifting forward by 26 minus the key gives the same result.
- Question 8 is meant to be solved by trying keys. Let students struggle a little before giving the hint to compare the first letters.
EXIT TICKET (read aloud or post)
Decrypt FRGH. The key is 3.
EARLY FINISHERS
Early finishers make a cipher wheel: draw two circles of the alphabet, one inside the other, so that turning the inner circle shows any key at a glance.
PAGES TO COPY: only pages marked STUDENT PAGE in the complete PDF. Answers are on the last teacher page.