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.

Grades 7-1150 minutesSP-CS-024

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.

READY WHEN YOU ARE

Take the plan with you.

Teacher copy — includes the answer key.

The complete PDF includes welcome pages, substitute directions, student worksheets, and answers. Give students only the worksheet pages. Check the page labels before you print or share.

Download complete teacher PDF

Opens the PDF in a new tab. Use its print controls to select the student pages you need.

Download teacher phone guide

A readable guide that opens offline in your browser. Student worksheets and answers are not included.

Free lesson · SP-CS-002Guide ↓PDF ↓

QUICK ANSWERS

In short:

This free 50-minute Computer Science sub plan for grades 7-11 teaches the Caesar cipher: shifting letters by a key, wrapping from Z back to A, and why only 25 keys make it easy to crack. Students encrypt and decrypt messages, find a missing key and trade codes. Answer key included.

Frequently asked questions

How does a Caesar cipher work?

Each letter is shifted the same number of places forward in the alphabet. That number is the key. With a key of 3, A becomes D, and X wraps around to A. To decrypt, shift backward by the key.

How many keys does a Caesar cipher have?

There are 25 useful keys. A key of 26 moves each letter all the way around the alphabet and leaves the message unchanged.

How do you break a Caesar cipher without the key?

Try all 25 shifts until real words appear, which is a brute-force attack, or count the most common letters and match them to E, which is frequency analysis.

What grade level is Secret Messages: The Caesar Cipher and Keys for?

It is written for grades 7-11 in Technology and Computer Science (Computer Science).

How long does Secret Messages: The Caesar Cipher and Keys take?

Plan on about 50 minutes. The teacher guide breaks the period into timed steps a substitute can follow.

What does the substitute need to prepare?

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.

Does this lesson need technology?

None. Paper and pencil only.

Is there an answer key?

Yes. The free complete PDF (6 pages) includes substitute directions, the student pages, and a teacher answer key on pages marked TEACHER PAGE.