The exchange method relies on simple mathematical fact: (xy)z = (xz)y how Diffie-Hellman key exchange works: Here’s Alice and Bob agree on a long prime number, and a base The base, p, g. g, doesn’t need to be large; it is normally 2 or 5. Alice creates a long prime number, which is her private key. She calculates a, A = ga She sends to Bob. mod p. A Bob creates his own long prime number, which is his private key. He calculates b, B = He sends to Alice. gb mod p. B Alice gets from Bob, and calculates the shared key: B K = Ba mod p. Bob gets from Alice, and calculates the same shared key: A K = Ab mod p. Now, Alice and Bob have calculated respectively and K = (ga)b mod p K = (gb)a mod Diffie-Hellman Exchange -Weakness
The exchange method relies on simple mathematical fact: (xy)z = (xz)y Here’s how Diffie-Hellman key exchange works: Alice and Bob agree on a long prime number, p, and a base g. The base, g, doesn’t need to be large; it is normally 2 or 5. Alice creates a long prime number, a, which is her private key. She calculates A = ga mod p. She sends A to Bob. Bob creates his own long prime number, b, which is his private key. He calculates B = gb mod p. He sends B to Alice. Alice gets B from Bob, and calculates the shared key: K = Ba mod p. Bob gets A from Alice, and calculates the same shared key: K = Ab mod p. Now, Alice and Bob have calculated respectively K = (ga)b mod p and K = (gb)a mod Diffie-Hellman Exchange -Weakness