{
  "aliases": null,
  "backlinks": null,
  "body": "\n## Example\n\nThe Diffie–Hellman key exchange is an example of [[public-key cryptography|01E9MNJYEX]]. Two parties, Alice and Bob, use it to agree on a secret key over a public channel.\nThey agree in public on a prime $p$ and an integer $g$, often a [[primitive root|0KM2CJ80G7]] modulo $p$.\nAlice chooses a secret integer $a$ and sends $A = g^a \\bmod p$. Bob chooses a secret integer $b$ and sends $B = g^b \\bmod p$.\nAlice computes $B^a \\bmod p$, and Bob computes $A^b \\bmod p$. Both are equal to $g^{ab} \\bmod p$, the shared secret.\nA small case: $p = 11$, $g = 2$, $a = 3$ and $b = 4$. Then $A = 8$, $B = 16 \\bmod 11 = 5$, and $5^3 \\equiv 8^4 \\equiv 4 \\pmod{11}$.\n\n## Remarks\n\nAn eavesdropper sees $p$, $g$, $A$ and $B$. To find $g^{ab}$, a natural method is to compute a [[discrete logarithm|09B4X51J09]], which is believed to be hard for large $p$.\nThe same method works in any finite cyclic group, for example the group of points of an elliptic curve.\nWhitfield Diffie and Martin Hellman published the method in 1976.\n\n## Explanations\n\n### L1 human\n\nEach party mixes a public number with a private number, and they swap the results.\nEach then mixes in their own private number again, and both get the same final number.\nAn eavesdropper sees only the swapped numbers, and cannot easily undo the mixing.\n",
  "commit": "6ac761d40018146541484a9e8b9eafd6ecc303dc",
  "front": {
    "instance_of": [
      "01E9MNJYEX"
    ],
    "kind": "example",
    "msc": [
      "94A60"
    ],
    "name": "Diffie–Hellman key exchange",
    "same_as": {
      "wikidata": "Q623447",
      "wikipedia": "Diffie–Hellman key exchange"
    },
    "sources": [
      {
        "locator": "lead section",
        "url": "https://en.wikipedia.org/wiki/Diffie%E2%80%93Hellman_key_exchange"
      },
      {
        "locator": "Cryptographic explanation",
        "url": "https://en.wikipedia.org/wiki/Diffie%E2%80%93Hellman_key_exchange"
      }
    ],
    "tag": "01TKKESHSB",
    "uses": [
      "0KM2CJ80G7",
      "09B4X51J09",
      "04DR5PM25N"
    ]
  },
  "kind": "example",
  "link": "https://math2.tamnd.com/node/01TKKESHSB/",
  "links": [
    {
      "field": "instance_of",
      "target": "01E9MNJYEX"
    },
    {
      "field": "uses",
      "target": "0KM2CJ80G7"
    },
    {
      "field": "uses",
      "target": "09B4X51J09"
    },
    {
      "field": "uses",
      "target": "04DR5PM25N"
    }
  ],
  "markdown": "https://math2.tamnd.com/node/01TKKESHSB.md",
  "msc": [
    "94A60"
  ],
  "name": "Diffie–Hellman key exchange",
  "prov": null,
  "role": "",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/01T/01TKKESHSB.md",
  "status": null,
  "tag": "01TKKESHSB",
  "uri": "m2://01TKKESHSB",
  "url": "https://math2.tamnd.com/wiki/diffie-hellman-key-exchange/",
  "writing": {
    "tag": "01TKKESHSB",
    "kind": "example",
    "level": "W2",
    "next": [
      {
        "what": "a person confirmed each agent-written section",
        "note": "rule P04",
        "have": 0,
        "want": 1
      }
    ]
  }
}
