Presentation is loading. Please wait.

Presentation is loading. Please wait.

Public Key Cryptography

Similar presentations


Presentation on theme: "Public Key Cryptography"— Presentation transcript:

1 Public Key Cryptography
How do we send secure messages over insecure channels?

2 Problem: 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 to communicate is over the internet? We should always assume someone with bad intentions is secretly eavesdropping on the conversation. Let’s come up with a strategy they could use to send encrypted messages.

3 Issues Distance – only way to communicate is through the internet
Security – The internet travels over shared wires, so others could see the messages Privacy – If messages are seen, privacy is compromised Use – We rely on the internet for almost everything we do; banking, work, school, etc. ** We need keys to encrypt our messages ** A key needs to be established before sending messages So, what do we do? Let’s brainstorm and come up with ideas. *Safes, Banks, Lockers…

4

5 Different Keys The ideas behind how public encryption is very sophisticated. We are going to dig a little deeper with short activities to help us understand how this works. The crux of how this works is by using two keys. One key to encrypt, another to decrypt

6 Cups & Pennies I will give Maggie a closed, clear, container
You will place a random # of pennies in the cup. Remember your #! You will pass the cup to Noah Lizzie will be trying to eavesdrop and read the message Noah, once you get the cup, add some pennies to the cup. Remember your #  then pass it back to Maggie while Lizzie eavesdrops.

7 Cups & Pennies continued…
Maggie, dump out the pennies and subtract your original amount. How many did Noah add? Lizzie, were you able to know exactly how many pennies were in the cup at any time?

8 … and the point is? Noah and Maggie never agreed on a key ahead of time They were able to share info publicly Noah can encrypt a secret message for Maggie by using something that Maggie puts out in public Lizzie could not tell what was going back forth without simply guessing either Maggie or Noah’s private number.

9 Asymmetric Keys The cups and pennies represent asymmetric (pronounced “A- symmetric”) encryption The procedure for encrypting a message (which Noah does) is different from the procedure for decrypting the message (which Maggie does). Up to this point, the encryption schemes we’ve studied (Caesar, random substitution, Vigenere,) have been symmetric  the key used to encrypt the message is the same key needed to decrypt the message.

10 Private & Public Keys In the case of this activity, Maggie’s secret number - the number of pennies that she put into the cup originally is known as her private key. Only she knows it, and she never shares it with anyone. The sealed container sitting on the table represents Maggie’s public key. In the real world a public key is something related to the private key, that can be safely shared in public, that another person can use to encrypt a message. In this case, the cup with the lid on top.

11 Encrypting & Decrypting
When Noah adds pennies to the sealed cup, he is using a public key to encrypt a message. Since they get mixed in with the other pennies (which are related to Maggie’s private key), no one, not even Noah, knows how many total pennies there are. When Maggie receives the cup back from Noah, she can decrypt the message by opening the lid and counting the pennies. Since she knows how many pennies she put in in the first place, she can subtract that number of pennies and arrive at the number that Noah intended to send.

12 Public Key Cryptography (summary)
This entire form of exchange is called Public Key Cryptography. In this form of secure communication, every participant has both a public and a private key. When sending a message, the sender encrypts his message using the public key of the recipient. The real math is actually not that complicated. It essentially uses multiplication and division instead of addition and subtraction. The next lesson shows how it works.

13 The operation behind Public Key encryption
Modulo The operation behind Public Key encryption

14 One Way Function Modulo is a mathematical operation
Represented in Python using % Returns only the remainder Example: 53 Mod 7 is 4 53 ÷ 7 = 7 with a remainder of 4

15 The Clock analogy Just like the face of a clock, modulo “wraps” around the number system. – we can use a clock as a way to visualize how it works However, the size of the clock does not matter – we don’t have to stick with 12. in this analogy, the number of hours on the clock would be the first number: 53 Mod 7  53 would be the size of the clock By the way, if you use a calculator and divide: 53÷7 = 7.57 you would have to go another step and multiply 0.57 x 7 to get 4 as your remainder.

16 What if the dividend < than the divisor?
What if our problem was: 12 Mod 32 In this case, the remainder would be 12, because there is not enough to divide. 12 Mod 32 is 12 Remember, the reason for this is because the Modulo is a one way function. There is no way


Download ppt "Public Key Cryptography"

Similar presentations


Ads by Google