When ESP and AH are used together (ESP transport, AH transport) on the same packet does ESP encrypt the AH's hash, or is the hash left in the clear?

If the hash isn't encrypted, there are obviously security implications (like the AH not ensuring integrity of the authenticated information)

I ask because the AH precedes the ESP header, and ESP encryption in transport mode only applies to the TCP/UDP datagram following the ESP header (SPI and sequence).

I know that these are not commonly used together. That is not relevant. Also, I'm aware that ESP tunnel mode supports optional authentication (in a trailing segment after the message body) that's also not relevant here.

1 Answer 1


You already mentioned that the AH header precedes the ESP header when applying both. Consequently the ESP header doesn't have any effect on the AH header. But the AH header can be used to protect the IP header when using transport mode and to protect the ESP header for both modes. But this is not very common and requires an additional Security Association for each direction. Thus you will end up with 4 SAs instead of 2 if you have a bi-directional connection.

Furthermore the hash used by AH is a cryptographic hash. You can't change/recalculate it without knowing the key.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .