Octet

What is the difference between IKEv1 main mode and aggressive mode?

Show the answer

Say this first

Main mode uses six messages: two to agree the policy, two for the Diffie-Hellman values and nonces, and two, already encrypted, to exchange identities and authenticate. Aggressive mode squeezes that into three messages, so the identities go out before encryption is in place. With a pre-shared key, the aggressive-mode hash can be captured and attacked offline, so main mode is preferred. Aggressive mode exists for peers with dynamic addresses where the responder needs the identity to pick the right key.

Go deeper

Main mode

MsgDirectionContent
1initiator to responderSA proposals
2responder to initiatorchosen proposal
3initiator to responderDH public value, nonce (plus NAT-D hashes with NAT-T)
4responder to initiatorDH public value, nonce (plus NAT-D)
5initiator to responderencrypted: identity, authentication
6responder to initiatorencrypted: identity, authentication

Aggressive mode

MsgDirectionContent
1initiator to responderSA proposals, DH value, nonce, identity
2responder to initiatorchosen SA, DH value, nonce, identity, authentication hash
3initiator to responderauthentication hash

The PSK catch in main mode

With a PSK, the keys that protect messages 5 and 6 are derived from the PSK, so the responder must choose the key before it has seen the peer's identity. It can only choose by source IP address. That is why main mode with PSK and dynamic peer addresses needs a wildcard key (crypto isakmp key KEY address 0.0.0.0), and why certificates or IKEv2 are the better answer.

Traps

  • Saying aggressive mode uses weaker ciphers. Same ciphers; the weakness is identity exposure and offline cracking of the PSK.
How did you do?Book 8.4 Authentication Protocols