Clock Arithmetic and Cryptography

Shodor > Interactivate > Lessons > Clock Arithmetic and Cryptography


The following discussions and activities are designed to lead the students to practice their basic arithmetic skills by learning about clock arithmetic (modular arithmetic) and cryptography. Although somewhat lengthy (approximately 2 hours), the lesson can easily be separated into two lessons.


Upon completion of this lesson, students will:

  • be able to perform basic operations in modular (clock) arithmetic
  • be able to encode and decode messages using simple shift and affine ciphers
  • have practiced their multiplication, division, addition and subtraction skills

Standards Addressed:

Student Prerequisites

  • Arithmetic: Student must be able to:
    • perform integer and rational arithmetic, including multiplicative inverses
  • Algebraic: Students must be able to:
    • work with simple algebraic expressions
  • Technological: Students must be able to:
    • perform basic mouse manipulations such as point, click and drag
    • use a browser for experimenting with the activities

Teacher Preparation

Key Terms

affine cipherAffine ciphers use linear functions to scramble the letters of secret messages
cipherCiphers are codes for writing secret messages. Two simple types are shift ciphers and affine ciphers
factorAny of the numbers or symbols in mathematics that when multiplied together form a product. For example, 3 is a factor of 12, because 3 can be multiplied by 4 to give 12. Similarly, 5 is a factor of 20, because 5 times 4 is 20
modular arithmeticA method for finding remainders where all the possible numbers (the numbers less than the divisor) are put in a circle, and then by counting around the circle the number of times of the number being divided, the remainder will be the final number landed on
multiplesThe product of multiplying a number by a whole number. For example, multiples of 5 are 10, 15, 20, or any number that can be evenly divided by 5
remaindersAfter dividing one number by another, if any amount is left that does not divide evenly, that amount is called the remainder. For example, when 8 is divided by 3, three goes in to eight twice (making 6), and the remainder is 2. When dividing 9 by 3, there is no remainder, because 3 goes in to 9 exactly 3 times, with nothing left over

Lesson Outline

  1. Focus and Review

    Remind students what has been learned in previous lessons that will be pertinent to this lesson and/or have them begin to think about the words and ideas of this lesson:

    • Ask students what multiples are. If needed, use the discussion on multiples.
    • Next, ask students what remainders are. The discussion on remainders is available to help.

  2. Objectives

    Let the students know what it is they will be doing and learning today. Say something like this:

    • Today's class is about clock arithmetic -- also called modular arithmetic -- and cryptography -- which is a method of creating secret messages. Your knowledge of multiples and remainders will be useful when coding and decoding messages.
    • We are going to use the computers to learn about modular arithmetic and cryptography, but please do not turn your computers on or go to this page until I ask you to. I want to show you a little about these ideas first.

  3. Teacher Input

    You may choose to lead the students in a short discussion on the relationship between clocks and modular arithmetic.

    Explain to the students how to do the assignment. You should model or demonstrate it for the students, especially if they are not familiar with how to use our computer applets.

    • Open your browser to the Clock activity in order to demonstrate it to the students.
    • Show students how to change the numbers on the clock.
    • Pass out the Clock Arithmetic Exploration Questions worksheet.
    • Have the students complete the worksheet with you, as you demonstrate how modular arithmetic works.
    Next, introduce students to the notion of cryptography through a discussion of simple shift and affine ciphers.
    • Open your browser to the Caesar Cipher activity in order to demonstrate it to the students.
    • Try coding a phrase with the students, such as "Once more back into the fray," and then checking it by running it through the Caesar Cipher activity.
    • Pass out the Caesar Cipher Exploration Questions worksheet.
    • Give students another phrase to code. Some examples: "Nothing ventured, nothing gained," or "Go for the gold," or "Take me out to the ball game."
    • Have students trade their codes and their values for A and B with another student in the class to practice solving.

  4. Guided Practice

    Give students additional practice, this time with the Caesar Cipher II activity. This is an excellent way to practice students' reasoning skills, since there are naive ways to play this (run phrases through) and systematic ways of playing this (run a few single letters through).

  5. Independent Practice

    As a final activity, have students compete in teams using the Caesar Cipher III activity. Students should be told that the phrases all come from children's nursery rhymes. The first team that decodes its phrase, finding the multiplier and constant correctly, wins.

  6. Closure

    • You may wish to bring the class back together for a wrap-up discussion.

Alternate Outline

The lesson can be rearranged if there is only one available computer:

  • After introducing the information in the discussions, have the students take turns working in groups or individually to practice decoding ciphers.

Suggested Follow-Up

a resource from CSERD, a pathway portal of NSDL NSDL CSERD