


































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!



































Introduction: Students will learn how to write and read secret messages using modular arithmetic, or “clock math,” explore decryption with frequency analysis, and get a brief introduction to public key encryption. They will practice sending each other messages with each method, as well as answer questions like “how can you read a message without knowing the code?” and “how can you share a code without other people being able to read the message?”
Content Objectives:
Acknowledgements: These notes were written by Claire Merriman for use in the Summer 2016 Summer Illinois Math Camp Epsilon, along with Hannah Burson and Michelle Seat. Day 3 activities were developed in collaboration with the Champaign-Urbana Community FabLab, in particular, Colten Jackson, Tanya Josek, and Virginia McCreary.
Funding for the 2016 Summer Illinois Math Camp was provided by the Office of Public Engagement, University of Illinois for a Public Engagement Grant; Department of Mathematics, University of Illi- nois; Illinois Geometry Lab, University of Illinois; Association for Women in Mathematics, University of Illinois; Dolciani Mathematics Enrichment Grant, Mathematical Association of America; and the National Science Foundation, Grant Number DMS-1449269.
Any opinions, findings, and conclusions or recommendations expressed in this material are those of the author(s) and do not necessarily reflect the views of the National Science Foundation. This material is based upon work supported by the National Science Foundation under Grant Number DMS-1449269.
1 Intro to Cryptology/Modular Arithmetic 2 1.1 Lesson Notes........................................ 3 1.2 Reflections:......................................... 7
2 Hack your Pok´emon: locked boxes, brute force, counting and coding 8 2.1 Lesson Notes........................................ 9 2.2 Reflections.......................................... 13
3 Codes and Counting 14 3.1 Lesson Notes........................................ 15 3.2 Reflections.......................................... 18
4 Decryption practice and Skittle Key Cryptography 18 4.1 Lesson Notes........................................ 19 4.2 Reflections.......................................... 22
5 Appendix 24 5.1 Intro to Cryptology/Modular Arithmetic......................... 24 5.2 Hack your Pok´emon: locked boxes, brute force, counting and coding.......... 34 5.3 Frequency analyisis..................................... 35 5.4 Decryption practice and Skittle Key Cryptography................... 39
Central focus: The goal of this lesson is to introduce and establish the history and modular arithmetic behind cryptology.
Objectives: Students will
Materials:
Example 1
This is actually using modular arithmetic! We all did modular arithmetic just in our heads. We would call this math in “mod 12” for the hours and “mod 60” for the minutes.
For emphasis: Modular Arithmetic is as if you have taken the number line and wrapped it up, over itself. Like this tape measure. If I wrap this tape measure to be “mod 12” once you get to 13 you get back 1, once you get 14 you get 2, and so on.
—-Draw the Modular Arithmetic Clock Demo”—– (including negatives)
The modular clock demo shows that you can write numbers 1 to n around a clock, then continue another circle n + 1 to 2n outside and −n − 1 to 0 on the inside. An example can be seen below. Can also write 0 to n − 1 to be consistent with the standard representations instead of consistent with clocks.
7
1
2
4 3
5
6
8
9
11 10
12
13
14
0
-3 -
This arithmetic can be represented in multiple ways. Algebraically we use congruence modn.
Definition. Two numbers are congruent modulo n if n | (x − y). Meaning n divides (x − y).
Example 2
This leads us to establish some important properties in modular arithmetic that can be expressed using this notation.
Theorem and Proof Theorem. Pick a whole number n > 0 and let w, x, y, z be some integers. Then
Proof. 1. Let x be any integer. Then, x − x = 0 which is divisible by any non-zero integer. Thus, x − x mod n.
This is largely to show that we can actually prove mathematical facts and use them later. This is where we inserted true false questions to check for understanding.
—-BREAK—-
day) Definition. additive inverse of a number x is a number y with x+y=0.
In the integers, the additive inverse of x is -x. We can extend this idea to mod n as well.
Example 4
− 2 ≡ 3 mod 5 − 1 ≡ 7 mod 8
Pass out encryption and decryption practice worksheet
Closure: Now we hope you have enjoyed learning a little bit about what it is to study cryptology. Tomorrow we will be working with computers to introduce the combinatorics, the counting behind cryptology. But for now, time for lunch!
1.2 Reflections:
Intro went well, got better definitions than expecting, great examples, pretty enthusiastic until proofs. They were able to give pretty good definitions for cryptography and cryptanalysis that we could put together for the definition of cryptology. This also gave a good way to introduce that we are doing both encryption and decryption.
The time activity worked well. Demonstrating with a tape measure seemed really cool, since I think of mod 1 as the R/Z or R as the universal cover of S^1 , but this did not seem to be super enlightening for the students. Drawing the clock definitely helped a lot of the students, so I introduced congruency classes.
Definitely need to introduce the fact that the representative of the congruency class of x mod n is the remainder of division of x by n. None of them really seemed to use this definition, but it does justify why we use 0 instead of n. It would be beneficial to have the three methods/descriptions all in a row for the same example thus giving them multiple representations.
Did not do proofs the way they were written, since that is for an audience that is learning about proofs, and instead made sure they can follow the algebra, since not all have had algebra 1. I did explain factor/divides and that mods are the remainder from division before the proofs.. It is important to use the same wording used in the definition in the proof and decide that precise wording before the lesson. I also did not do number 5, but should probably add in x + z, y + z before the multiplication. It might also help to introduce the idea of congruence classes with the clocks and reiterate from the beginning that there are infinitely numbers in a class, but it?s normally easiest to work with the smallest.
We added in some true/false examples after proofs to get them talking, working together and to check for understanding. We also drew mod 5 addition and multiplication charts and explained how to compute them and read them.
Before passing out second worksheet, do an example of how to encrypt with a given key and how to read the cipher wheels. It’s probably good to walk through an example where you have a word,
then numbers, then add the key, then back to letters, to emphasize the math. There was a lot of confusion about how to read the directions and wheels. Also, start with an example that has real words, since that confused a lot of them.
This day was also reflected by students as being very “worksheet heavy” and potentially tedious. There may be a way to make one or two of the worksheets into a group activity instead?not so that the work gets split up but that student start the week working together and don?t feel like they are doing just busy work.
Central focus:
Objectives: Students will
Materials:
A jumper cable from A5 to GND will put the box in 3 bit/toggle switch mode, removing this cable and resetting the Arduino with put it in “challenge mode” for the physical keys.
Lesson Plan
Motivation/hook: Why would you want a lock? What about a password? Can you think of locks that use passwords, mechanical or digital?
Box activity 1: Instructions to students: We are going to give you a locked box. There is a little lever sticking out of the top that prevents it from sliding. Do not break anything. DO NOT TOUCH THE LEVER. You will need to attach the battery to the box before it will work. There are 3 switches on the side, you have to have each switch in the correct position to make the lever move and unlock the box. Once you get the right code, write it on the board and your name next to it. If your code is already on the board, just write your name next to it.
Have each student go to a computer with an Arduino, attach the battery, and try combinations. They might want to keep track of their trials on paper.
Introduction to counting: How many options were there for passwords? We can count using a tree.
Box
By counting the number of options in the bottom row, we get 8 options.
Students seemed to have seen this before, so we did not spend much time on it, but in general, you multiply together the number of options you have for each spot. So if the first spot have 5 options and the second spot has 4 options, the two together have 5 ∗ 4 options.
For each position, there were 2 options, so there were 2 ∗ 2 ∗ 2 = 8 total passwords. What if we had 4 switches? 5 switches? 4 switches is 16 options, 5 switches is 32 options If you use digits instead of numbers, each position has 10 options. An iPhone password is 4 digits, how many options are there? 10, What if we also allow letters? How many ways can you have a 3 letter or number password, no capitalization? 36 ∗ 36 ∗ 36 = 46, 656
Transition:The number of options grows really quickly if you allow longer passwords, more charac- ters. Numbers are big, computers are fast, but it is faster if you have a list of likely possibilities to check first such as common passwords and patterns.
Passwords: There are a lot of ways to reduce the number of passwords you check. https://wpengine.com/unmasked/ has a lot of information about common passwords and password patterns. This is also included in the appendix, although new analysis comes out periodically and can be found on popular websites, warning people their passwords are not safe.
Common passwords:
Physical Keys: Have students remove the jumper cable that runs from A5 to GND and press reset. This should relock the box.
There are four different physical keys and the code randomizes which one unlocks the box. Students need to find which of the physical keys unlocks their box. Divide the students into groups and give each group a copy of each key. When the student gets the box unlocked, they can remove the token and claim a prize.
—-BREAK—-
Password breaking and ethics: What are some reasons that you might want to break a lock?
Arduino Blink: Have students open Arduino on their computers and open the blink program. The presentation works through how the code works on slides 16-20 in the attached version, but most
(c) Since the Arduino has an LED on the board that is wired up to pin 13 this means we will now be setup to be able to apply a voltage to that LED ,or not apply a voltage, and thus turn that led on or off.
Students can then hack the code, changing the delay time to change the how fast it blinks. This gives them a good idea of how to ready and edit code, instead of just uploading existing code.
Brute Force password breaking: When we guessed the password with the switches, we were using brute force. That is, we just guessed each password until it worked. For longer passwords, we can use a computer to do that.
The Brute Force 1.1 code creates random 8 bit, 16 bit, and 32 bit passwords, then guesses the code and prints out how long it took to guess. Have students load this code, then write on the board how long it took their computer to guess the 8 bit and 16 bit code. It is likely no one will have the 32 bit code done. Use this to reiterate the exponential growth.
2.2 Reflections
We largely followed the FabLab’s lead on this project. The night before, we put a box at each computer, then had the campers sit at the tables for the intro section. This definitely helped with focus, and made the toggle switch activity really fast. Campers were able to very quickly come up with examples of physical and digital locks, as well as good examples of security and good reasons for breaking a codes or breaking past a security.
The tree was very useful for counting, definitely should have made them all draw it out for the examples. Most had seen it before, but it certainly helped those who hadn’t.
The actual cracking of the codes for the boxes went pretty well, it would be good to add a slide with the directions, as well as a pre-drawn grid for the codes that work with their names listed, since that got pretty chaotic. It should have a bunch of rows so as to not give away the number of solutions.
The physical key activity was not written up. Each Arduino and box was set up to run off of a battery, with a jumper cable that could be removed to change the Arduino setting. The three cables that ran from the servo motor to the Arduino were one color (which changed from box to box) and the jumper cable was blue. When campers removed the jumper cable and pressed reset, the Arduino stopped running the code for the toggle switches, and started running the code that works with physical keys. There were 3 copies of each of the 4 physical keys. Students were confused about this, since there were only 2 key patterns. We should tie ribbons or something to make them distinctive, as well as create a slide explaining the activity. Students were to find the key that unlocked their box, then they could remove the token from their box and get a prize. May also be good to get token and then the prize at the end.
We moved the discussion of ethics and hacking to before the coding. The students really got into this part of the lesson.
It would be good to have an extra activity prepared for the students who already know some coding, since they got bored easily. Also, some kids got frustrated really quickly, so it is good to have a lot of people who can answer coding questions. If the activity is to be run outside of FabLab, make sure to check that the Arduino works with each of the computers, since a few had issues not supplying enough power to the USB port, and a few others would not run without admin privileges.
Central focus: The goal of this lesson is to give students practice encrypting and decrypting messages using various cryptanalysis tools.
Objectives: Students will
Materials:
Have students write the true statements and correct the false statements on their whiteboards in groups.
The first is true. For the second, they can correct it several ways, including 8 ≡ 26 mod 9 and 8 ≡ 17 mod 9. There are many ways to fix the third, including changing n to 12, changing the second statement to 16 ≡ 4 mod n, 4 ≡ 4 mod n, 16 ≡ 16 mod n, or changing the first statement to n ≡ 4 mod 9, ect.
Review of counting: Have students answer the following problems on their whiteboards in groups. Make sure that they can explain their answer.
This first is 3 ∗ 4 = 12 and the second is 3^4 = 81. Make sure students can explain how they got the answer, some may have drawn out the chart or used another method.
—-BREAK—-
Introduction to frequency analysis: Since there are 26 ways to encrypt the letter A, 25 ways to encrypt the letter B (one has already been used), 24 ways to encrypt C,... there are 26! ways to scramble the English alphabet. This is more than 403 septillion, a number so big, I had to have Wolfram Alpha tell me what to call it! If you check 1,000,000,000 options a second, it would take 12.79 trillion years to check them all. We need a better method.
Some letters are used more often than others. In a standard block of English text, approximately 12% of the letters are E. We can count how many times each letter occurs, to help us guess the encryption. Analysis for “It does not do to dwell on dreams and forget to live.”
A D E F G I L M N O R S T V W 2 5 5 1 1 2 3 1 3 7 2 2 5 1 1
Pass out the frequency analysis practice worksheet. It is good to talk through how to divide up the work, and that the analysis does not necessarily line up with the expected value. A few students started to guess the passages, so make sure they can decrypt the entire thing and check it’s the right length.
Before break, point out that they can use spaces to guess at an encryption scheme, for example, the only one letter words are “a” and “I.” One way to get around this is to ignore where the spaces go and put them every 3 or 5 or n letters, or to use a different mod and encrypt the spaces.
—-BREAK—-
Encryption Review: Review using additive ciphers:
You can convert between letters and numbers, and use a key to get a secret message I wanna be the very best 8 22-0-13-13-0 1-4 19-7-4 21-2-17-24 1-4-8- add 5 to each number, mod 13 1-5-18-18-5 6-9 24-12-9 0-7-22-3 6-9-13- N bfssf gj ymj ajwd gjxy
Also review how to use the cipher wheels.
Encryption practice Students will be broken into 5 groups, each group comes up with a message to encrypt using an additive cipher. The plaintext message, key, and ciphertext are given to the instructors to type up for the next day. Alternatively, the encrypted message could be passed to another group, with instructions for running this activity multiple times in the same day at the end of the presentation.
Transition: Now we are going to do an encryption and decryption activity
Ask: What methods do you have to encrypt a message?
Ask: What tools do you have to decrypt a message?
Transition: Now let’s practice using these tools
Activity: Students will be broken into 5 groups, each group comes up with a message to encrypt using a multiplicative or additive cipher. This encrypted message is given to another group to decrypt.
Rules for the message:
Rules for encryption:
Materials:
4.1 Lesson Notes
Agenda
Time Activity Instructor TA Students 5 min Review Review how to use frequency chart
Maintain focus Listen, ask questions
45 min Decryption activity
Explain worksheet, guide students to answers
Guide students to an- swers
Work in groups
30 min Break Prep for after break Supervise students Relax, have fun 15 min Intro to Skittle key cryptography
Explain activity, skit Skit Pay attention
30 min Skittle key cryp- tography
Guide students through activity
Guide students through activity
Work in groups to find solution 20 min Diffie-Hellman Key Exchange
Brief review of mod- ular arithmetic, ex- plain the algorithm
Maintain focus Listen, ask questions
Lesson Plan
Decryption Activity: This lesson starts with decrypting the messages the day before. Before handing out the worksheet, review how to read the frequency analysis chart, as well as reminding students that the frequency is for really long passages. It is also possible some groups intentionally avoided common letters.
Remind students that they can divide up the work among the group. This is a good place to have a competition-we told the first table to get the entire worksheet correct could have candy at lunch.
Skittle Key Cryptography: This activity is based on Chocolate Key Cryptography by Dale J. Bachman, Ezra A. Brown, Chocolate Key and Anderson H. Norton [1], which is also available at https://www.math.vt.edu/people/brown/doc/ckc math teacher.pdf.
So we have learned a lot about cryptology, especially in the ways of encrypting and decrypting messages. But what we haven’t discussed the way two people might develop a secret key that would be used to produce encryptions and decryptions. Now we are going to run through an activity that allows you to explore sending messages securely.
The scene: Alice= Claire, Bob= Hannah, Eve= Michelle. In this scenario, Alice and Bob want to communicate a message to one another however there is someone around eavesdropping (Eve).
Alice and Bob both start out with a “magical” machine (coffee cups w/lids) which allows them to encrypt and decrypt messages (skittles). The cups represent keys for encoding and decoding messages. We have to imagine that everyone in class has an encryption-decryption machine that used cups of skittles as keys. (It’s like the cup is capable of inputting a message then encrypting it but also the other way around, getting a message and decrypting it.)
That is, if Alice wants to send a message to Bob, she picks a key (a cup of Skittles), puts the key in the slot, puts her message in the input chute, and cranks forward so that an encrypted message comes out. She then sends the message to Bob. Even when she sends the message through a public network (such as the Internet or in our case the multiple Eve’s), the message will remain secure unless someone else has the same key for encrypting-decrypting.
When Bob receives the encrypted message, he will place his identical key (a cup with the same numbers and colors of Skittles as Alice has) in the slot of his encrypting-decrypting box. He will then put the encrypted message into the input chute and crank backward to get a decrypted message out.
The tricky part is for Alice and Bob to obtain identical cans to begin with, without anyone else obtaining copies of those cans or guessing their contents (knowledge of the contents would allow someone else to create an identical can thus defeating the purpose of encrypting the message.) In short, this is the main idea. We will emphasis what not to do with the skit.
Instructors will: