Math 2.0

example

Diffie–Hellman key exchange

Example

The Diffie–Hellman key exchange is an example of public-key cryptography. Two parties, Alice and Bob, use it to agree on a secret key over a public channel. They agree in public on a prime pp and an integer gg, often a primitive root modulo pp. Alice chooses a secret integer aa and sends A=ga mod pA = g^a \bmod p. Bob chooses a secret integer bb and sends B=gb mod pB = g^b \bmod p. Alice computes Ba mod pB^a \bmod p, and Bob computes Ab mod pA^b \bmod p. Both are equal to gab mod pg^{ab} \bmod p, the shared secret. A small case: p=11p = 11, g=2g = 2, a=3a = 3 and b=4b = 4. Then A=8A = 8, B=16 mod 11=5B = 16 \bmod 11 = 5, and 53≡84≡4(mod11)5^3 \equiv 8^4 \equiv 4 \pmod{11}.

Remarks

An eavesdropper sees pp, gg, AA and BB. To find gabg^{ab}, a natural method is to compute a discrete logarithm, which is believed to be hard for large pp. The same method works in any finite cyclic group, for example the group of points of an elliptic curve. Whitfield Diffie and Martin Hellman published the method in 1976.

Explanations

L1 human

Each party mixes a public number with a private number, and they swap the results. Each then mixes in their own private number again, and both get the same final number. An eavesdropper sees only the swapped numbers, and cannot easily undo the mixing.

What this node needs for W3
  • a person confirmed each agent-written section: rule P04 (0 of 1)

The writing levels say how complete the text of a node is. They do not measure its truth.

What this needs

To read this node, read these 11 nodes in this order. The foundations come first, and the list ends with this node.

Each node uses the nodes above it. The colour of the bar on a box shows the evidence level, and the box also gives it as text. The list below has the same nodes.
  • no evidence level
  1. Divisibility definition
  2. Modular exponentiation concept
  3. Congruence modulo n definition
  4. Greatest common divisor definition
  5. Coprime integers definition
  6. Euler's totient function definition
  7. Euler's theorem statement
  8. Multiplicative order definition
  9. Primitive root modulo n definition
  10. Discrete logarithm definition
  11. Diffie–Hellman key exchange example

Sources

  1. Web https://en.wikipedia.org/wiki/Diffie%E2%80%93Hellman_key_exchange, lead section
  2. Web https://en.wikipedia.org/wiki/Diffie%E2%80%93Hellman_key_exchange, Cryptographic explanation