Lesson Summary


Students are introduced to the topic of cryptography and learn to perform two encryption techniques. The students will identify the role of the algorithm and key in the encryption process. Students will use abstraction to see the general process used in symmetric encryption. The students will consider the strength of ciphers and the importance of keeping the key a secret. 


  • Students will understand how encryption is used to keep data secure.
  • Students will learn how encrypting and decrypting data is accomplished using an algorithm and a key.
  • Students will understand why the key must be kept a secret.


  1. Getting Started (5 min) - Journal
  2. Introduction to Content (15 min)
    1. Lesson Motivation [5 min]
    2. Presenting the Key Concepts [10 min]
  3. Guided Activities (25 min)
    1. Practice [15 min]
    2. Follow Up: Analyzing the Strength of Ciphers [5 min]
    3. Follow Up: Defining Symmetric Encryption and Seeing the Abstraction in Symmetric Encryption Systems [5 min]
  4. Wrap Up (5 min) - Journal

Learning Objectives

CSP Objectives

Big Idea - Algorithms
  • EU 4.1 - Algorithms are precise sequences of instructions for processes that can be executed by a computer and are implemented using programming languages.
    • LO 4.1.1 - Develop an algorithm for implementation in a program. [P2]
      • EK 4.1.1A - Sequencing, selection, and iteration are building blocks of algorithms.
      • EK 4.1.1B - Sequencing is the application of each step of an algorithm in the order in which the statements are given.
      • EK 4.1.1C - Selection uses a Boolean condition to determine which of two parts of an algorithm is used.
      • EK 4.1.1D - Iteration is the repetition of part of an algorithm until a condition is met or for a specified number of times.
      • EK 4.1.1G - Knowledge of standard algorithms can help in constructing new algorithms.
      • EK 4.1.1H - Different algorithms can be developed to solve the same problem.
      • EK 4.1.1I - Developing a new algorithm to solve a problem can yield insight into the problem.
    • LO 4.1.2 - Express an algorithm in a language. [P5]
      • EK 4.1.2A - Languages for algorithms include natural language, pseudocode, and visual and textual programming languages.
      • EK 4.1.2B - Natural language and pseudocode describe algorithms so that humans can understand them.
      • EK 4.1.2C - Algorithms described in programming languages can be executed on a computer.
      • EK 4.1.2G - Every algorithm can be constructed using only sequencing, selection, and iteration.
Big Idea - Programming
  • EU 5.1 - Programs can be developed for creative expression, to satisfy personal curiosity, to create new knowledge, or to solve problems (to help people, organizations, or society).
    • LO 5.1.1 - Develop a program for creative expression, to satisfy personal curiosity, or to create new knowledge. [P2]
      • EK 5.1.1A - Programs are developed and used in a variety of ways by a wide range of people depending on the goals of the programmer.
      • EK 5.1.1B - Programs developed for creative expression, to satisfy personal curiosity, or to create new knowledge may have visual, audible, or tactile inputs and outputs.
    • LO 5.1.2 - Develop a correct program to solve problems. [P2]
      • EK 5.1.2A - An iterative process of program development helps in developing a correct program to solve problems.
      • EK 5.1.2I - A programmer's knowledge and skill affects how a program is developed and how it is used to solve a problem.
      • EK 5.1.2J - A programmer designs, implements, tests, debugs, and maintains programs when solving problems.
  • EU 5.2 - People write programs to execute algorithms.
    • LO 5.2.1 - Explain how programs implement algorithms. [P3]
      • EK 5.2.1A - Algorithms are implemented using program instructions that are processed during program execution.
      • EK 5.2.1B - Program instructions are executed sequentially.
      • EK 5.2.1C - Program instructions may involve variables that are initialized and updated, read, and written.
      • EK 5.2.1E - Program execution automates processes.
      • EK 5.2.1J - Simple algorithms can solve a large set of problems when automated.
  • EU 5.3 - Programming is facilitated by appropriate abstractions.
    • LO 5.3.1 - Use abstraction to manage complexity in programs. [P3]
      • EK 5.3.1A - Procedures are reusable programming abstractions.
      • EK 5.3.1B - A procedure is a named grouping of programming instructions.
      • EK 5.3.1C - Procedures reduce the complexity of writing and maintaining programs.
      • EK 5.3.1D - Procedures have names and may have parameters and return values.
      • EK 5.3.1E - Parameterization can generalize a specific solution.
      • EK 5.3.1F - Parameters generalize a solution by allowing a procedure to be used instead of duplicated code.
      • EK 5.3.1G - Parameters provide different values as input to procedures when they are called in a program.
      • EK 5.3.1H - Data abstraction provides a means of separating behavior from implementation.
      • EK 5.3.1I - Strings and string operations, including concatenation and some form of substring, are common in many programs.
      • EK 5.3.1J - Integers and floating-point numbers are used in programs without requiring understanding of how they are implemented.
  • EU 5.4 - Programs are developed, maintained, and used by people for different purposes.
    • LO 5.4.1 - Evaluate the correctness of a program. [P4]
      • EK 5.4.1E - Locating and correcting errors in a program is called debugging the program.
      • EK 5.4.1F - Knowledge of what a program is supposed to do is required in order to find most program errors.
      • EK 5.4.1G - Examples of intended behavior on specific inputs help people understand what a program is supposed to do.
      • EK 5.4.1H - Visual displays (or different modalities) of program state can help in finding errors.
  • EU 5.5 - Programming uses mathematical and logical concepts.
    • LO 5.5.1 - Employ appropriate mathematical and logical concepts in programming. [P1]
      • EK 5.5.1A - Numbers and numerical concepts are fundamental to programming.
      • EK 5.5.1D - Mathematical expressions using arithmetic operators are part of most programming languages.
      • EK 5.5.1E - Logical concepts and Boolean algebra are fundamental to programming.
      • EK 5.5.1G - Intuitive and formal reasoning about program components using Boolean concepts helps in developing correct programs.
Big Idea - Internet
  • EU 6.3 - Cybersecurity is an important concern for the Internet and the systems built on it.
    • LO 6.3.1 - Identify existing cybersecurity concerns and potential options to address these issues with the Internet and the systems built on it. [P1]
      • EK 6.3.1A - The trust model of the Internet involves trade-offs.
      • EK 6.3.1H - Cryptography is essential to many models of cybersecurity.
      • EK 6.3.1I - Cryptography has a mathematical foundation.
      • EK 6.3.1K - Symmetric encryption is a method of encryption involving one key for encryption and decryption.

Math Common Core Practice:

  • MP1: Make sense of problems and persevere in solving them.
  • MP2: Reason abstractly and quantitatively.
  • MP8: Look for and express regularity in repeated reasoning.

Common Core ELA:

  • RST 12.4 - Determine the meaning of symbols, key terms, and other domain-specific words and phrases

NGSS Practices:

  • 5. Using mathematics and computational thinking

Key Concepts

  • Encryption is used to keep data secure as it is transmitted through the Internet.
  • Symmetric encryption involves encrypting and decrypting data using an algorithm and a key.
  • Encryption algorithms themselves are standardized (well known), so the key must be kept secret.

Essential Questions

  • How is cybersecurity impacting the ever increasing number of Internet users?

Teacher Resources

Student computer usage for this lesson is: optional

In the Lesson Resources folder:

  • "Cryptography Partner Practice": A worksheet for the students
  • "Cipher Python Project": A worksheet with instructions for a simple Python project
  • "Cipher Python Project Rubric": The rubric for the Cipher project

Optional: Lesson slides with the key questions, encryption demos, and diagrams (the teacher could simply read the questions and present demos and diagrams by writing on a board).

For examples, consider reviewing The Code Book by Simon Singh.

Lesson Plan

Getting Started (5 min)


  • Name one website you use that requires you to log in with a username and password.
  • Why does the website require you to provide a username and password?

Introduction to Content (15 min)

Lesson Motivation  [5 min]

  • Present the scenario: “Alice would like to send a message to her friend Li in China, but she wants to keep it secret from everybody else.”
  • Ask the students: “If Alice sends the message to Li by email over the Internet, will her message remain secret?”
  • Student responses should bring up the architecture and trust model of the Internet to show that Alice’s message could be intercepted along the way, since it will pass through many devices before it ends up at Li’s computer.

Present the Key Concepts [10 min]

Tell the students, “This problem is not a new one. Throughout history, people, including government and military officials and personnel, business owners, and others, have wanted to send secret messages to someone but worried that the message could be intercepted along the way.”

There are two ways to try to keep the message secret: Steganography and Cryptography.

Explain the basic difference between the two. 

  • Steganography is when a message is "hiding in plain sight". Examples: Writing something in invisible ink that can be revealed with a special type of light. 
  • Cryptography is when a message is modified in a way that hides the meaning of the message. For example, the letters are replaced with symbols that someone else would not understand.

Present two different encryption techniques, showing one example of each.

An alternative to this lecture portion above is to have students independently study the same concepts using a reading, video, or online learning tool. Here are some suggested resources:

Summarize with this overview: "Each encryption scheme involves an algorithm and a key. The algorithm is the set of steps that you follow to accomplish the encryption. The key is the secret piece of information that is needed to know exactly how to apply the algorithm in this case. This allows you to securely send encoded information across the Internet and decode it when it arrives. Some codes are more secure than others."

Guided Activities (25 min)

Practice [15 min]

Have the students pair up and practice sending each other encrypted messages, then decrypting them to make sure they end up with the correct message. 

A worksheet called "Cryptography Partner Practice" is provided in the Lesson Resources folder.

  1. Each student gets to write two short messages that they will encrypt and send to their partner.
  2. First message: Transposition: Use the rail fence algorithm. You must agree on the number of rails to use (this will be the “key”).
  3. Second message: Substitution: Use the shift substitution cipher algorithm. You must agree on the amount to shift (this will be the “key”).
  4. For each message, pass it to your partner and have them decrypt it using the agreed upon algorithm and key. Have them read back the decrypted message to make sure they decrypted it correctly.

Follow Up: Analyzing the Strength of Ciphers [5 min]

Ask the students: “How difficult would it be to crack a message that was encrypted using the Caesar (shift) cipher if you didn’t know the key? How would you do it?” (Easy, try each of the 25 possible shifts.)

Present: There are two ways to increase the strength of encryption:

Option #1: Increase the number of possible keys.

A general substitution (not limiting to just a shift) dramatically increases the number of keys. The number of keys in this case is the number of permutations (different orderings) of the 26 letters in the alphabet. This can be computed by multiplying the 26 options for the first letter in the cipheralphabet, by the 25 remaining options for the 2nd letter, 24 remaining options for the 3rd letter, etc. (26! or 26 factorial).

The answer: 4.032914e x 1026 keys (Google will calculate it for you).

This analysis makes it seem as though a substitution cipher would be unbreakable, but clever people have invented tricks (e.g., frequency analysis) that can be used so you don't have to try all of the different keys.

Option #2: Use a better algorithm. 

For example, use a polyalphabetic cipher that combines multiple cipher alphabets.

(If time allows, you can have students explore other ciphers. For further study, see Khan Academy or The Code Book by Simon Singh.)

Follow Up: Defining Symmetric Encryption and Seeing the Abstraction in Symmetric Encryption Systems [5 min]

Present a diagram that shows high-level view of the encryption and decryption process (see The Code Book, p. 11).

  1. Identify this as an example of abstraction. (You can ask the students to try to explain why.) Example: This is abstraction because it shows the general process of encryption and decryption using any key or algorithm. It omits the details of the specific algorithm and the type of key.
  2. Tell the students, “The types of encryption you learned today are called “symmetric”. Why do you think they are called “symmetric”?  (The same key is used to encrypt and decrypt. You use the algorithm to encrypt, and then reverse it to decrypt.)
  3. What do you think it would mean for encryption to be asymmetric (non-symmetric)? (foreshadowing the next lesson)

Wrap Up (5 min)


  • What is the role of the algorithm in the encryption process? What is the role of the key?
  • Which one of these, the algorithm or the key, is more important to keep secret? Why?

Optional Project for additional Python Practice

Use the "Cipher Python Project" worksheet in the Lesson Resources folder. Students are tasked to create a simple Caesar cipher program that uses ASCII values to shift messages by a certain letter. The rubric for this project is also in the Lesson Resources folder.

Homework (Optional): Choose one of the following or let each student choose which one to complete.

  1. Computer Encryption: Use bitwise XOR to do substitution cipher (see The Code Book, p. 247)
  2. Students read a historical account that involves encryption (Mary, Queen of Scots) http://www.nationalarchives.gov.uk/spies/ciphers/mary/ (After reading the introduction, click on the links below the picture for “Mary’s ciphers” and “The Babington Plot”)
  3. Students read about cryptanalysis and learn about the frequency analysis technique. Try using it on an encryption puzzle..
    1. An example of breaking a substitution cipher: http://www-math.ucdenver.edu/~wcherowi/courses/m5410/exsubcip.html
    2. Try deciphering an encrypted message using the techniques you read about: http://cryptogram.org/solve_cipher.html#contents


Evidence of Learning

Formative Assessment

The teacher will evaluate student responses to the journal entries, class discussion questions, and the students performance during the encryption practice.