Caesar Cipher

What is Caesar Cipher?

This activity allows the user to see how modular arithmetic has been used for years as a means of encoding messages. The letters of the alphabet are coded as:

Original Letter to Number Equivalencies:
A B C D E F G H I J K L M
0 1 2 3 4 5 6 7 8 9 10 11 12
N O P Q R S T U V W X Y Z
13 14 15 16 17 18 19 20 21 22 23 24 25

and then the numbers are changed via an affine (linear) transformation to new, coded numbers. The coding function has the form:

Y = A * X + B

where X is the uncoded number, A is the multiplier, B is the constant (both A and B known to allies, but unknown to enemies) and Y is the calculated, coded number. The arithmetic is done mod 26 to ensure that we get numbers back that can be translated back to letters before sending the coded message.

This method of coding messages is ancient. In fact, Caesar is said to have liked to use the cipher with A = 1 and B = 3. This method of coding is fun to play with, but easy to crack, as can be seen from this activity.

Modern coding techniques still make use of modular arithmetic, but in a highly sophisticated way.

How Do I Use This Activity?

This activity allows the user to see how modular arithmetic has been used for years as a means of encoding messages.

Controls and Output

  • The text field at the top of the screen is where you type the text that you want to be encoded:
  • You specify both the multiplier and the constant below the text field by entering the appropriate numbers into the text boxes. The multiplier is the number that is multiplied by the number value of each letter in your text, and the constant is the number that is added to the product of the number value of each letter and the multiplier.
  • After you have entered the text to encode and the multiplier and constant values, you can click the Convert Text button, which will display the encoded text in the text field below the button.
  • If you would like the spacing to remain the same when you convert the text, simply check the Retain Spaces checkbox. When this is unchecked, this cipher more closely resembles a true Caesar cipher which is bunched into 5 character clumps with spaces only acting to confuse the message.

Description

This activity allows the user to experiment with encoding and decoding messages using modular arithmetic. This activity would work well in mixed ability groups of four or five for about forty-five to fifty minutes if you use the exploration questions and twenty minutes otherwise.

Place in Mathematics Curriculum

This activity can be used to:

  • practice students' long division skills
  • demonstrate the applications of modular arithmetic
  • practice the students' logical reasoning skills

Standards Addressed

Third Grade

  • Number and Operations in Base Ten

    • Use place value understanding and properties of operations to perform multi-digit arithmetic.

Algebra

  • Creating Equations

    • Create equations that describe numbers or relationships

Grades 6-8

  • Numbers and Operations

    • Compute fluently and make reasonable estimates

Technical Mathematics I

  • Number and Operations

    • Competency Goal 1: The learner will apply various strategies to solve problems.

6th Grade

  • Algebra

    • The student will demonstrate through the mathematical processes an understanding of writing, interpreting, and using mathematical expressions, equations, and inequalities.

5th Grade

  • Algebra

    • The student will demonstrate through the mathematical processes an understanding of the use of patterns, relations, functions, models, structures, and algebraic symbols to represent quantitative relationships and will analyze change in various contexts.

Algebra I

  • Foundation for Functions

    • 1. The student understands that a function represents a dependence of one quantity on another and can be described in a variety of ways.
    • 2. The student uses the properties and attributes of functions.
    • 3. The student understands how algebra can be used to express generalizations and recognizes and uses the power of symbols to represent situations.
    • 4. The student understands the importance of the skills required to manipulate symbols in order to solve problems and uses the necessary algebraic skills required to simplify algebraic expressions and solve equations and inequalities in problem situations.
  • Linear Functions

    • 7. The student formulates equations and inequalities based on linear functions, uses a variety of methods to solve them, and analyzes the solutions in terms of the situation.
    • 8. The student formulates systems of linear equations from problem situations, uses a variety of methods to solve them, and analyzes the solutions in terms of the situation.

Secondary

  • Algebra II

    • AII.16 The student will investigate and apply the properties of arithmetic and geometric sequences and series to solve practical problems, including writing the first n terms, finding the nth term, and evaluating summation formulas. Notation will include Σ and an.
    • AII.16

Textbooks Aligned

Grade Seven

  • Accentuate the Negative

    • Investigation Two: Adding Integers
    • Investigation Three: Subtracting Integers

Book 1

  • Module 8 - Our Environment

    • Section 1: Adding Integers
    • Section 1: Subtracting Integers

Book 2

  • Module 2 - Search and Rescue

    • Section 3: Adding Integers
    • Section 3: Subtracting Integers
  • Module 4 - The Art of Motion

    • Section 5: Translations

Book 3

  • Module 2 - At the Mall

    • Section 4: Operations with Integers

7th

  • Module 3 - Codes

    • Section 1: Triangles, Circles, and Constructions

Book 1

  • From Zero to One and Beyond

    • Lesson 12: Powering Up
  • Number Powerhouse

    • Lesson 3: Know How to Read the Signs
    • Lesson 4: The Problems Are All Yours
  • Patterns in Numbers and Shapes

    • Lesson 3: Crossing the River

Book 2

  • Making Mathematical Arguments

    • Lesson 1: Statements About Signs
    • Lesson 2: Counterexamples and Cube Combinations
    • Lesson 3: More Cases to Consider

Book 3

  • Exploring the Unknown

    • Lesson 5: Extending the Lab Gear Model

Grade 8

  • Reflections on Number

    • Divisibility and Prime Factorization
    • Multiplication and Division
    • Operations with Inverses

Grade 5

  • Dry and Wet Numbers

    • Positive and Negative Numbers
    • Scale Drawings
    • Number Lines

Grade 6

  • Operations

    • Operations with Integers
    • Plotting Points
    • Coordinate Plane

Be Prepared to

  • explain in detail and show examples of how Caesar Cipher works.
  • be flexible on the time spent on this activity.
  • encourage the students that they can do this if they give it a good try even though it is tricky and involved.