Skip to content

Instantly share code, notes, and snippets.

@mikedao
Created January 6, 2015 19:46
Show Gist options
  • Save mikedao/ff1ceceb253d89c65574 to your computer and use it in GitHub Desktop.
Save mikedao/ff1ceceb253d89c65574 to your computer and use it in GitHub Desktop.
Public Key Cryptography Outline
Public Key Cryptography
The Problem: How do we communicate securely on the internet?
- We have to encrypt our communications.
- How do two parties who have never met, agree on a key when all of their communications are public?
- The answer: Diffie Hellman Key Exchange. -Whitfield Diffie, Martin Hellman
- The first implementation of public key cryptography as envisioned by Ralph Merkle.
The Setup:
- Alice wants to Talk to Bob.
- Eve is listening into everything that Alice and Bob say.
- You have to agree on a numerical key that Eve can't figure out even though she hears everything.
- How is this possible?
Diffie-Hellman key exchange
- Based on the idea of a one way function
- A math equation that is easy to do in one direction but difficult in the other.
- Math is hard, so let's do colors.
- It's easy to mix two colors to get a third color.
- It's hard to take one color and figure out which two colors made it.
How?
- Agree on a starting color.
- Randomly select a color, and mix it into public yellow.
- Alice sends her mix to Bob.
- Bob sends his mix to Alice.
- They then add their secret color to the other persons mixture.
- They both end up at the same color and this is their key.
- Eve doesn't know what this key is because she needs one of the private colors to figure it out.
Math
- Same mathematical result can be computed from different inputs.
- 2 * 3 * 5 = 30
- 3 * 5 * 2 = 30
- They use modular arithmetic. It gets complicated here.
https://www.youtube.com/watch?v=Afyqwc96M1Y if you are REALLY interested.
THE END
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment