Course contentsShow
← Security
Lesson 478 of 3,05211. Network Security - VPNs and TunnelingFree lesson

Encapsulating Security Payload (ESP)

ESP protocol providing confidentiality, integrity, and authentication for IPsec connections.

Encapsulating Security Payload (ESP)

You'll learn how ESP protects IPsec traffic with encryption and integrity checks, making it the workhorse of modern VPN security.

What Is ESP?

Encapsulating Security Payload (ESP) is the IPsec protocol that provides confidentiality (encryption), data integrity (detecting tampering), and authentication (verifying the sender). Unlike AH, which you just learned only offers integrity and authentication, ESP actually encrypts your data so eavesdroppers can't read it.

Think of ESP like sending a letter in a locked box with a tamper-evident seal and your signature. The lock prevents anyone from reading the contents (confidentiality), the seal shows if someone tried to open it (integrity), and your signature proves you sent it (authentication).

How ESP Works

ESP wraps your packet data in a protective envelope:

  1. Encrypts the payload using algorithms like AES or 3DES
  2. Adds an ESP header before the encrypted data (contains Security Parameter Index and sequence number)
  3. Adds an ESP trailer after the encrypted data (padding and next header info)
  4. Appends an authentication field to verify nothing was tampered with

The encryption happens before the integrity check is calculated, so even the encrypted data is protected from modification.

ESP vs AH

You just learned about Authentication Header (AH). ESP is typically preferred because:

  • It provides encryption (AH does not)
  • It works better with NAT (Network Address Translation)
  • It can optionally skip authentication if only confidentiality is needed (though this is rare)

ESP can operate in both Transport Mode (encrypts just the payload) and Tunnel Mode (encrypts the entire original packet).

Key Takeaway: ESP is the primary IPsec protocol for secure VPNs, combining encryption, integrity checking, and authentication to protect data in transit—making it far more versatile than AH alone.