


The purpose of this exchange is to confirm each other's identity. Nonce is just to protect against replay attacks by adding some randomness to key generation As selected encryption algorithm for this phase was AES-CBC (128-bits) then we use AES with this key to symmetrically encrypt further data. SKEYID_e (e for encryption): you'll see that the next 2 packets are also encrypted. Yes, I know, we verify the integrity by using a hash but throwing a key into a hash adds stronger security to hash and it's called HMAC. SKEYID_a (a for authentication): this key is used to protect message integrity in every subsequent packets as soon as both peers are authenticated (peers will authenticate each other in next 2 packets). seed key for production traffic keys in Plain English.

It is used as seed key for Phase2 keys, i.e. SKEYID_d (d for derivative): not used by Phase 1. With DH public key value and the nonce both peers will generate a seed key called SKEYID.Ī further 3 session keys will be generated using this seed key for different purposes: Then, next 2 Identity Protection packets both peers exchange Diffie-Hellman public key values and nonces (random numbers) which will then allow both peers to agree on a shared secret key: 71) can pick if it matches its local policies:įair enough, in frame #2 the Responder (. 70) sends a set of Proposals containing a set of security parameters ( Transforms) that Responder (. Sample pcap: IPSEC-tunnel-capture-1.pcap (for instructions on how to decrypt it just go to website where I got this sample capture: )īoth peers add a unique SPI just to uniquely identify each side's Security Association (SA):

We call first 6 messages Phase 1 and last 3 messages as Phase 2. The Big Pictureįirst 6 Identity Protection (Main Mode) messages negotiate security parameters to protect the next 3 messages (Quick Mode) and whatever is negotiated in Phase 2 is used to protect production traffic (ESP or AH, normally ESP for site-site VPN). Understanding IPSec IKEv2 negotiation on Wireshark 1.
