Upgrade to Pro — share decks privately, control downloads, hide ads and more …

How do computers exchange secrets using Math?

Sponsored · Your Podcast. Everywhere. Effortlessly. Share. Educate. Inspire. Entertain. You do you. We'll handle the rest. →
Avatar for Dharma Dharma
April 24, 2019

How do computers exchange secrets using Math?

This was an invited talk at the Central Middle School, Maryland. Without going into a lot of math, I try to explain the fundamental key exchange problem. It was a blast. 8th graders enjoyed it as much as I enjoyed it.

Avatar for Dharma

Dharma

April 24, 2019

Other Decks in Technology

Transcript

  1. How do computers exchange secrets using math? Invited talk (04/24/19)

    @ Central Middle School, Maryland Dr. Dharma Ganesan, Ph.D.,
  2. Table of Contents • Objectives of the presentation • Cryptography

    problem - Secret Key Exchange • Cryptanalysis - How to break the crypto system • Open problems • Conclusion 2
  3. Objectives • Introduce you to the exciting field of modern

    cryptography • Demonstrate how math is used to exchange secrets over the Internet ◦ Simplified the theory to get across the core ideas 3
  4. Alice Encrypts - Eve sees gibberish - Bob Decrypts 4

    Hello Bob Encryption Algorithm (open to all) Secret key K 01534236 Secret Key K Decryption Algorithm (open to all) Hello Bob Note: The same secret key K is used by encryption and decryption algorithms Kerckhoff’s principle: The enemy (Eve) knows the encryption and decryption algorithms, but not the key
  5. SIGSALY encrypts confidential call (World War II) 5 • Encryption

    keys were transferred using a special courier • Do you know how heavy SIGSALY is and how much it costs? ◦ 50,000 kg and US $1 Million • https://www.cryptomuseum.com/crypto/usa/sigsaly/index.htm Winston Churchill Franklin Roosevelt
  6. Problem: sender and receiver need the same key 6 Key

    K Key K • Alice and Bob are too far away from each other • They never met each other • They cannot exchange the secret key publicly (Eve is listening) • How can they arrive at the same secret key K?
  7. 7 We have been (unknowingly) using the mod notation Let’s

    go to bed @ 21 hour 21 ≡ 9 (mod 12) Note: When 21 is divided by 12, 9 is the remainder What is 5*8 on this clock? 5*8 = 40 ≡ 4 (mod 12) Gauss developed the theory of modular arithmetic
  8. 8 Cryptographers love mod and primes Cryptographers view this clock

    as follows: Z* 13 = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12} They use mod 13, which is a prime number Z* p = {1, 2, 3, …, p-1} i 1 2 3 4 5 6 7 8 9 10 11 12 2i 2 4 8 3 6 12 11 9 5 10 7 1 For example, 24 ≡ 3 (mod 13) 2 is a generator of this clock because it generates all hours from 1..12
  9. Why cryptographers use mod and one-way functions? 9 • In

    a clock, patterns are not that obvious to detect for Eve • For example, 26 is greater than 27 in mod 13 • Some problems are difficult to answer (without seeing the below table) • For example, 2i ≡ 11 (mod 13), can you quickly find the i? i 1 2 3 4 5 6 7 8 9 10 11 12 2i 2 4 8 3 6 12 11 9 5 10 7 1 E a s y H a r d Cryptographers use one-way functions: Easy in one direction, but hard the other
  10. Power rule of exponents (23)4= (23)(23)(23)(23) = 212 (24)3= (24)(24)(24)

    = 212 So, (23)4 = (24)3 In general, (g) = (g) = (g) [Proof: homework for you] 10
  11. Diffie-Hellman Key Exchange Algorithm • In 1970s, they solved the

    problem of key exchange! ◦ Using an one-way function (easy to compute, hard to reverse) • Alice and Bob arrive at a shared secret key k ◦ Using the power rule of exponents (no courier service) • Eavesdropper Eve cannot easily derive the secret key k ◦ Takes billions of years to solve by computers (at this time of writing) • Diffie, W., and Hellman, M. New directions in cryptography ◦ IEEE Trans. Inform. Theory IT-22, 6 (Nov. 1976), 644-654 11 Prof. Hellman (H) Diffie (D)
  12. 12 Double the hours 5 times (i.e., 25 mod 13)

    Double the hours 4 times (i.e., 24 mod 13) Send the clock to Bob Send the clock to Alice Key Exchange - Visual Demo Triple the hours 5 times (i.e., 35 mod 13) Sixfold the hours 4 times (i.e., 64 mod 13) Both Alice and Bob arrive at the same key (9) Note: 5 and 4 are secrets
  13. 13 Pick a random number Pick a random number Compute

    A = g mod p Compute B = g mod p Secret K = B mod p Secret K = A mod p Send A to Bob Send B to Alice Both Alice and Bob have the same secret key Eve sees A and B, but not , , or K Key Exchange Algorithm - Core Idea (assume that g and p are public)
  14. 14 Pick a random number = 5 Pick a random

    number = 4 Compute A = 25 mod 13 Compute B = 24 mod 13 Secret K = 35 mod 13 = 9 Secret K = 64 mod 13 = 9 Send A = 6 to Bob Send B = 3 to Alice Both Alice and Bob have the secret key 9 DH Key Exchange - Example (g=2, p=13)
  15. 15 How can Eve recover the secret key K? Option

    1: • Eve knows that the secret key can be in {1, 2, … 12} • She can just try 12 possibilities to decrypt messages i 1 2 3 4 5 6 7 8 9 10 11 12 2i 2 4 8 3 6 12 11 9 5 10 7 1 Option 2: • Eve builds the above table and solves B = g mod p • For example, B = 6 means secret = 5 Other Options?
  16. Cryptographers use a very large clock to trick Eve 16

    • Prime p is made of at least 600 digits or so (in 2019) ◦ p shall satisfy more properties (not covered here) • Difficult for Eve to construct the table of all possibilities • Eve will have to live for several billion years to break it • Or, she must solve some cool problems (next slide) p-1
  17. Some cool problems to solve 17 • Problem 1: Given

    B, g, and p, efficiently find y such that B = g mod p • Problem 2: Given g mod p and g mod p, find g mod p ◦ The exponents and are not known to Eve, of course • Problem 3: Find the prime factors p and q of N such that N = p*q ◦ I did not talk about this problem in this presentation ◦ See https://www.slideshare.net/dganesan11 • If you efficiently solve any one of these problems, you will be a celebrity! ◦ Instead of computer games, let’s start thinking about these problems
  18. Conclusion 18 • Computers use math to exchange secret keys

    over the Internet • Study algebra and number theory to excel in cryptography • There are many interesting open problems to solve • I hope you will choose math/computer science in college German mathematician Carl Friedrich Gauss (1777–1855) said, "Mathematics is the queen of the sciences—and number theory is the queen of mathematics."
  19. 19 Thank you Central Middle School Mr. Clayton Stewart (Math

    Teacher) Mrs. Kristy Fidyk (STEM Dept. Chair)