| Are you: | Initiating key exchange | Public value Private (secret) value |
| Responding to key exchange request | ||
| Receiving response to key exchange request |
| Sender key exponent: | A = pa mod m | |
| Responder key exponent: | B = pb mod m |
| Person A | Person B | |
| Generates Base/Modulus | ⇨ | Receives: Base/Modulus |
| Generates: Secret key a | ||
| ⇩ | ||
| Calculates: Key exponent A | ⇨ | Receives: Key exponent A |
| Generates: Secret key b | ||
| ⇩ | ||
| Calculates: Shared Key | ||
| Base/modulus | ||
| Secret key B | ||
| ⇩ | ||
| Receives: Key exponent B | ⇦ | Calculates: Key exponent B |
| Secret key a | ||
| ⇩ | ||
| Calculates: Shared Key | ||