Distance Learners:,
Below is the lesson plan that you usually see me write on the dry erase board in class. I have set up the exact same class on a Google Doc in your CSP class folder. This will allow you to enter "Journal" questions I pose to you and other Activities. Thus, I recommend you go straight to the Google Doc:
Access Google Doc I set up for you in your CSP folder titled: “U4Ch1L9_Public Key Crypto.”When you complete today's class assignments, Email me at: "john.harrington@student.sthelenaunified.org" so that I can give you credit.
U4Ch1L9_ Public Key Cryptography.
Purpose: Students will, 1. Learn the mechanics of communication with Public Key Cryptography(Assymetric Encryption), & 2. The basic mathematical principles (Modelo) that make it possible.
Vocabulary:
- Symmetric Encryption – (Caesar Cipher, Random). Allows for two parties to send secret messages to each other over public channels In Which They Must Agree to a secret encryption key ahead of time.
- Asymmetric Encryption – allows for two parties to send secret messages to each other over public channels Without Having To Agree On A Secret Encryption Key ahead of time.
- Public Key - Used prevalently on the web, it allows for secure messages to be sent between parties without having to agree on, or share, a secret key.
- Private Key - The decryption key is kept private and never shared, so only the intended recipient has the ability to decrypt a message that has been encrypted with a public key.
2 types of Private Encryption Keys:
- A Private Encryption Key – A Private Key that allows me to encrypt a message.
- A Private Decryption Key – A Private Key that allows me to decrypt a message.
- Modulo - Creates the Private Key buy using a mathematical operation that returns the remainder after dividing two numbers. For example, in classic division 13/5 is 2 Remainder 3. The mod operation gives the remainder portion. So we would say 13 MOD 5 = 3
- A One Way Fuction - you can't tell based on the remainder what went into the clock.
Journal: “How can two people send encrypted messages to each other if they can’t communicate, or agree on an encryption key ahead of time, and the only way they have to communicate is over the Internet?” -- Solution is Public Key Encryption! (Asymmetric Encryption is a type of Public Key Encryption).
Video: The Internet: Encryption & Public Keys (Start At 4:12! We saw this video last class - Need to remember how Public and Private keys function.)
Activity #1: An Explanation of How Asymmetric Encryption Works. (Cups and Beans)
Video: Example of Asymmetric Encryption: Mobile or YouTube
Students Now Act As 'Eve', 'Alice' and 'Bob'.: Have Eve stand between Alice and Bob in front of the class – Alice has a clear cup, counts out a specific number of beans and places them in the cup.
- Alice chose a “Private Keys” (some number of beans)
- Alice make a “Public Key” cup by placing beans in a clear cup and sealing it – she is the only one that can open it –
- Pass the cup to Bob over the “Internet.” When Eve observes it going by, she is making a random guess as to what the key is.
- Bob grabs the “Public Key” cup and adds a secret number (of beans) to it, - this is the return “Private Keys.”
- Pass the cup back to Alice over the public “Internet.” Eve is still watching it go by and is making another random guess as to what the return key is.
- Alice opens the cup and subtracts the number of beans she added originally.
- What’s left is Bob’s secret number.
* Now Alice & Bob both know each others “Private Keys” which will allow them to encrypt and decrypt all messages being passed back and forth.
The real math above is actually not that complicated-it is addition and subtraction. The next lesson shows how multiplication and division are used instead of addition and subtraction.
Students...Practice creating Private Keys!
Activity #2: Modulo Clock Thought Experiment – An explanation of the mathematics that supports Asymmetric Encryption. (clocks)
- Close your eyes and open them and look at the number on the clock the instructor is holding. (4:00)
- Then close your eyes again, and open them and look at the number on the clock the instructor is holding.(3:00)
How much time passed? (Think about it…Guess!)
|
This Clock is a “One Way Function.” Since we have no way of knowing the original input, there is an Infinite Number of Possibilities!
Note: using the clock is arbitrary – not limited to 12 – can be any size, but a clock is a useful visual.
Understanding Modulo:
- The mathematical operation Modulo is the remainder after dividing two whole numbers.
- We can visualize this idea as trying to count up to some number using a clock and seeing where the hand ends up.
- For example: if you're trying to count to 43 on a normal clock with 12 numbers.
- You are doing: 43 MOD 12.
- The result of 43 MOD 12 is: 7. Reason: 43 / 12 = 3 remainder 7 – 7 is the Private Key.
- Practice On Front Board:
- 100 MOD 12
- 100 MOD 13
- 100 MOD 11
- 99 MOD 12
Log On to: Code.org
U4Ch1L9: Click on #5 “Clock Arithmetic Modulo.”
Note: You may want to use your calculator.
- Play with the clock and test your understanding of “Modulo.”
Activity Guide (Handout): Multiplication + Modulo
- Using a clock size of 50, write a list of 5 numbers that produce a result of 0.
- With clock size of 50 how many total numbers are there that produce a result of 0? (If the list is short, write it out. If the list is long, describe a pattern of what the numbers are).
- Using a clock size of 13, can you find a number to input that produces a result of 13? (If so, what is it? If not, why not?)
Step 2: Toward encryption - Use multiplication to produce inputs
Experiment - Small changes to inputs, big changes to outputs.
Using a clock size of 37, let’s multiply two numbers (we’ll call them A (Alice!!) and B (Bob!!)) to use as input, then make small changes to each while holding the other constant. We’ll always use the formula A * B MOD M. We’ll start with A=20 and B=50 and M=37. So here is the first result...
20 * 50 MOD 37 = 1
Now find in the rest of these values making small adjustments to A and B individually.
Use a calculator, if necessary, to compute A * B. Use the Mod Clock to compute the modulus of the result.
Increment A |
|
|
Increment B |
|
21*50 MOD 37 |
|
|
20*51 MOD 37 |
|
22*50 MOD 37 |
|
|
20*52 MOD 37 |
|
23*50 MOD 37 |
|
|
20 * 53 MOD 37 |
|
Log Onto Code.org: U4Ch1L9: Click on #6 – “Public Key Widget Instructions.”
- Follow the Explanation of how to combine the Assymmetric “Bean&Cup” Encryption(Alice, Bob and Eve), with the mathematical operation, “Modulo.”.
- Start by breaking into a group of two – Alice and Bob
- Continue onto #7 and begin! (5 min – Pick a small clock size!)
- Everyone should now view Eve’s role.
- Now, break into a group of Three – Alice, Bob and Eve.
- Continue onto #7 and begin! (Pick a small clock size!)