140 likes | 261 Views
How to Destroy the World with Number Theory. Daniel Dreibelbis University of North Florida. Basic Cryptography. Alice wants to send a message to Bob. “Dr. Hamid eats kittens for breakfast.” Eve is listening to any communication between Alice and Bob.
E N D
How to Destroy the World with Number Theory Daniel Dreibelbis University of North Florida
Basic Cryptography • Alice wants to send a message to Bob. • “Dr. Hamid eats kittens for breakfast.” • Eve is listening to any communication between Alice and Bob. • Goal: Encrypt the message in a way that Alice and Bob know, but Eve does not.
Secret Decoder Ring • Simple substitution cipher. • Each letter is replaced by a letter k letters down the alphabet.
Secret Decoder Ring. • Let’s do k= 3. • “Dr. Hamid eats kittens for breakfast.” becomes “Gu. Kdplghdwvnlwwhqvirueuhdnidvw.” • Bob decodes by removing k from each letter. • The number k is called the key. Our SDR has 26 different keys.
Real Life SDR • Our SDR has 26 different keys. • In Real Life, we use an encryption method called AES (Advanced Encryption System). • AES has 2128 different keys • 2128 = 340,282,366,920,938,463,463,374,607,431,768,211,456 • That’s 340 undecillion. That’s a whole bunch of keys. • A brute force key search is infeasible. • A typical key looks like sixteen characters, something like: A4gf5*nTb[Q@21’7
Key Exchange Problem • Eve hears everything that Alice says to Bob and Bob says to Alice. • If Alice and Bob try to agree on a key k, Eve will hear this also, and she will know the key. • KEP: How can Alice and Bob agree on a key without Eve knowing its value?
Modular Arithmetic • We define a mod n to be the remainder when a is divided by n. • 100 mod 17 = 15 • Computers are really good at mods. • Example: a = 10100+5, b=1099+7, n=10101+3 • Mathematica worked out ab mod n in about 0.00034 seconds. • Answer is: 29748478515601709481956621265827578332435037952560102437932180281116087872397108919020459135080599359
Diffie-Hellman • Alice and Bob agree on two numbers: n and c. • Alice comes up with a number a, and she doesn’t tell anyone what it is. • Bob comes up with a number b, and he doesn’t tell anyone what it is. • Alice computes the number f = ca mod n. She sends f to Bob. • Bob computes the number g = cb mod n. He sends g to Alice. • Alice computes the number k = ga mod n. This is her key. • Bob computes the number k = fb mod n. This is his key. • They now have the same key.
Example • Alice and Bob choose n = 26 and c = 11. • Alice picks a = 10, Bob picks b = 14. They both keep their number private. • Alice computes f = 1110 mod 26 = 23. She sends this number to Bob. • Bob computes g = 1114 mod 26 = 17. He sends this number to Alice. • Alice computes k = 1710 mod 26 = 9. She will use this as her key to encode her message in SDR. • Bob computes k = 2314 mod 26 = 9. He will use this as his key to decode the message in SDR.
Why does it work? • Alice computes k = ga mod n = (cb)amod n. • Bob computes k = fb mod n = (ca)b mod n. • They are the same!
What does Eve know? • Eve knows n, c, f, g. She needs to find out aor b, and then she can break the code. • To find out a, she needs to solve: ca mod n = f • This is called the discrete log problem. No one knows how to solve it other than guessing values of a. • For our problem, it looks like: 11a mod 26 = 23 • If we use large numbers (which we do in Real Life), then guessing a will take thousands of years, even with the help of computers.
Real Life • c= 316912650057057350374175801351 • a = 1267650600228229401496703205653 • b = 5070602400912917605986812821771 • n = 170141184728119831959916705212587311361 • f = 161287865144798146040576922608605193658 • g = 61813267884160838151925223195196755176 • k = 116582602641953240322793154442983171347 • Computers can work out the mods very, very quickly, even with these big numbers. • Discrete log problem: • 316912650057057350374175801351a mod 170141184728119831959916705212587311361 = 161287865144798146040576922608605193658
Crypto’s Dirty Secret • Every form of public key cryptography or key exchange relies on our inability to solve a certain math problem quickly (factoring, DLP, ECDLP, SVP, etc). • It is still possible that these “hard math problems” have quick solutions. All we know is that no one has found a quick solution yet (or at least has admitted to this publicly). • Research Problem: Find a quick solution to the DLP (thus making Diffie-Hellman useless) OR prove that no quick solution exists (thus making every other form of crypto useless).
WkhHqg! • Thanks! • www.unf.edu/~ddreibel