

Diffie-Hellman Key Exchange in Plain English - luu
http://security.stackexchange.com/questions/45963/diffie-hellman-key-exchange-in-plain-english/45971#45971

======
ghshephard
Of course, that's only 1/3 the problem. You now have a secret key that you can
use to encrypt/decrypt messages with your neighbor - you need a good
encryption algorithm (the next 1/3 of the problem, thankfully there are a lot
of high quality ones to chose from.) But the missing 1/3 of the problem - Who
are you communicating with? Is it the person you think it is, or some
nefarious MITM.

Diffie-Hellman can give you confidentiality, but it won't authenticate your
neighbor. To do that, you'll need either a shared secret (which, ironically,
could have been used as your encryption key in the first place - It's the way
statically configured IPSec without PFS works), or some form of PKI. But, if
you have PKI, then you somehow managed to securely get a certificate on your
system, and that mechanism _also_ could have been used to get a secure
encryption key.

I like the signify approach used by OpenBSD for authentication - they didn't
even attempt to use a PKI or trust relationship (The entire thing was
basically written in 10 days) - they just blasted their public key (including
[http://www.openbsd.org/57.html](http://www.openbsd.org/57.html)) for each
release in every possible place they could think of, and users are expected to
use some caution, also check email, and possibly smoke-signals into outer
space, with that process to jump start security. Of course, once you have your
first link-in-the-chain, you can use that to securely bootstrap the rest of
the keys (which are included in each release).

You get a mechanism for Key-Exchange, but not Identify verification. At the
end of the day, Diffie-Hellman needs a good PKI infrastructure to be useful.

------
loteck
But let's really get down to plain English. What is the best analogy to use
when explaining public key cryptography to an educated, non-technical
audience? I've used the door-with-2-locks analogy previously. Is there a
clearer analogy?

~~~
tptacek
I really like the paint analogy on Wikipedia for explaining this concept to
laypeople who will never need to understand how DH actually works.

If you need to explain DH to someone who demands an understanding of what it
actually does, DH is so easy that you might as well have them bang it out with
small numbers in their scripting language of choice; you can talk someone
though DH in about 4 minutes, and it even works as a sort of magic trick if
there's a third person in the room who can hear your public values (again: use
2-3 digit numbers).

~~~
thirsteh
[https://youtu.be/6NcDVERzMGw?t=165](https://youtu.be/6NcDVERzMGw?t=165)

------
ndesaulniers
Maybe not plain English, but you prefer simple code examples, here's it in
JavaScript using Node.js' bindings to OpenSSL:
[https://nickdesaulniers.github.io/blog/2015/02/22/public-
key...](https://nickdesaulniers.github.io/blog/2015/02/22/public-key-crypto-
code-example/)

------
nemo
That is a minor simplification of the wikipedia description, though the
illustration in the wikipedia article helps to make the mechanism clear:
[https://en.wikipedia.org/wiki/Diffie–Hellman_key_exchange#Cr...](https://en.wikipedia.org/wiki/Diffie–Hellman_key_exchange#Cryptographic_explanation)

~~~
scrubby
Here is the best video I have seen explaining Diffie-Hellman using the color
analogy:
[https://youtu.be/6NcDVERzMGw?list=PLB4D701646DAF0817&t=156](https://youtu.be/6NcDVERzMGw?list=PLB4D701646DAF0817&t=156)

