Talk:Diffie–Hellman key exchange

'insecure channel' or ?
The second paragraph states:

"The Diffie–Hellman key exchange method allows two parties that have no prior knowledge of each other to jointly establish a shared secret key over an insecure channel"

The linked page defines that an "insecure channel" is "unencrypted and may be subject to eavesdropping and tampering". Since DH doesn't protect against MITM, perhaps we should change this to say 'authentic channel', as "an authentic channel is a means of data transmission that is resistant to tampering but not necessarily resistant to overhearing."? --Raboof (talk) 08:25, 17 January 2023 (UTC)

DH is not vulnerable to MITM per se
"the Diffie–Hellman exchange by itself does not provide authentication of the communicating parties and is thus vulnerable to a man-in-the-middle attack."

Given that Diffie–Hellman key exchange is anonymous, the example of a MITM attack between Alice, Bob and Mallory doesn't make sense, because Alice doesn't know who she is talking to!


 * The example makes sense to me: Alice may think she's talking to Bob (for some reason, for example because either the content or the context of the communication gives that impression), and the fact that with DH she doesn't actually know this is what makes Mallory able to masquerade as Bob. I could agree perhaps "vulnerable" is too strong: since DH isn't intended to protect against this, it seems unfair to classify this lack of protection as a "vulnerability". Perhaps it should be worded "thus does not protect against" instead of "is thus vulnerable to". I think the example is helpful, though. --Raboof (talk) 08:21, 17 January 2023 (UTC)

I propose a possible improvement to the algorithm explanation graphic, but lack the skills to deliver it
I've experimented with reworking the DH algorithm graphics to add a temporal dimension, but I lack the skills and wikipedia experience to turn my ideas into something usable; rather than pollute this page with excessive discussion, I wrote up the concepts at https://alecmuffett.com/article/14750 and would be interested to chat with anyone regarding whether this is actually a better proposal than the extant diagrams. Alecmuffett (talk) 21:14, 30 May 2021 (UTC)

Please, evaluate to choose the values in the numeric example.
There is a method to choose the values, there aren't random. You must choose a prime p, a q which divides p-1 and a generator of order q. In the example, g is not a order q genereator. You can check it with g^q mod p != 1. 5^11 mod 23 != 1. If you choose q=2, it's a example trivial, I suppose you choose q=11. 23-1=22=2*11 — Preceding unsigned comment added by 193.146.209.194 (talk) 09:36, 23 November 2021 (UTC)


 * p-1 = 22, and 5^22 = 1 mod 23. So what's wrong with using q=22? DaemonicSigil (talk) 02:10, 14 October 2022 (UTC)

Salom 84.54.73.215 (talk) 16:56, 29 April 2023 (UTC)

Incorrect image?
The main image on this article I think might be incorrect? My understanding (from this article even) is that a single public key is agreed upon? The image has Bob and Alice each using their public keys. Can someone correct/corroborate me on this? Epachamo (talk) 21:31, 9 December 2023 (UTC)
 * Ok, I changed the image and based it on the example in the text. Epachamo (talk) 14:39, 18 December 2023 (UTC)

Merge proposal
It was proposed over at Talk:Signal Protocol that Post-Quantum Extended Diffie-Hellman might usefully be merge here, for reasons of short text and context. Let's discuss the new proposal here. Klbrain (talk) 14:56, 28 January 2024 (UTC)


 * In my opinion as an editor, the Post-Quantum Extended Diffie-Hellman (PQXDH) could be extended a bit more. There is more information to put in that article. I don't think they should be merged. Rather that PQXDH should be expanded. Epachamo (talk) 19:01, 29 January 2024 (UTC)
 * There is a large gap between PQXDH and good old DH; just merging might not make enough sense. However, I believe we can make the cognitive gap a lot more navigable by getting a good description of PQXDH's predecessor, X3DH, on the DH page. Artoria2e5 🌉 02:42, 21 February 2024 (UTC)