Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
Math 480: Open Source Mathematical Software
2016-05-23
William Stein
**Lectures 25: Public-key crypto (part 1 of 3) **
This week we will talk about public key crypto, as a way to learn some computational number theory.
Modular exponentation
Diffie-Hellman
RSA
Prime Numbers
Today:
Homework was collected, peer grading available (no guidelines available yet).
New homework that is due Friday at 6pm is now available.
Modular exponentation, Diffie-Hellman
TODAY: Some background so you can start working on your homework.
1. Modular Arithmetic
Let be a positive integer. Then is a ring with addition and multiplication modulo .
Application: What are the last 3 digits of ?
Solution: compute modulo 1000:
How does this work.
Write in binary.
View as multiplying together a bunch of numbers of the form , which we get by repeating squaring, using that .
2. Diffie-Hellman
This is a very widely used algorithm that allows two programs A and B that communicate over an unsecured channel to agree on a shared secret. Here's how it works.
Step 1. A and B agree on a prime number and a number modulo .
Step 2. A generates a random number and sends .
Step 3. B generates a random number and sends .
Step 4. A computes the shared secret .
Step 5. B computes the shared secret .
A and B agree on the same secret because .
Security
The only information transmitted publicly is , , , and .
An adversary (say C) can do a few things:
Since C knows , , , it can -- in theory compute ! Just try powers of until . Also, there are many much more sophisticated algorithms to solve this discrete logarithm problem .
Maybe C can trick A and B into thinking they are talking to each other, but they are really talking to C. (Major government agencies are well positioned to do this.)
Trick people into thinking is prime when it isn't, and use this to create a backdoor. See homework problem 5.
Let's try it out!