Ipsec
Ipsec
IPSEC Objectives
Band-aid for IPv4
Spoofing a problem
Not designed with security or authentication in
mind
IP layer mechanism for IPv4 and IPv6
Not all applications need to be security aware
Mandatory in IPv6, optional in IPv4
Can be transparent to applications and users
Resistant to bypass
IPSec Uses
Security Associations
A one-way relationship between sender &
receiver that affords security for traffic flow
Can be between
A pair of hosts
A host and a security gateway
A pair of security gateways
Two basic protocols
Authentication headers (AH)
Encapsulating security payload (ESP)
Architecture & Concepts
Tunnel vs. Transport mode
Security association (SA)
Security parameter index (SPI)
Security policy database (SPD)
SA database (SAD)
Authentication header (AH)
Encapsulating security payload (ESP)
Key management
Transport Mode vs. Tunnel Mode
Transport mode: host -> host
Tunnel mode: host->gateway or gateway->gateway
Encrypted Tunnel
Gateway 1 Gateway 2
Encrypted Unen
y pt ed crypt
A nencr ed
B
U
Real IP ESP
destination
AH
IPSec processing
Send to B
Inbound Processing
From A
SA Database SPD
SPI & Packet
(Policy)
Use SPI to Was packet properly
index the SAD secured?
Original IP Packet
…
“un-process” …
Architecture & Concepts
Tunnel vs. Transport mode
Security association (SA)
Security parameter index (SPI)
Security policy database (SPD)
SA database (SAD)
Authentication header (AH)
Encapsulating security payload (ESP)
Key management
Authenticated Header
Data integrity
Entire packet has not been tampered with
Authentication
Can “trust” IP address source
Use keyed MAC to authenticate
Symmetric encryption, e.g, DES
One-way hash functions with a shared secret key, e.g,
HMAC-MD5-96 or HMAC-SHA-1-96
Anti-replay feature
Integrity check value
IPSec Authenticated Header
Length of the authentication header
SAD
…
SPI
Sequence Number
ICV
Integrity Check Value - ICV
Keyed Message authentication code (MAC)
calculated over
IP header field that do not change or are predictable
Source IP address, destination IP, header length, etc.
Prevent spoofing
Mutable fields: time-to-live (TTL), IP header checksum,
etc.
IPSec protocol header except the ICV value field
Upper-level data
Code may be truncated to first 96 bits
AH: Tunnel and Transport Mode
Original
Transport Mode
Cover most of the
original packet
Tunnel Mode
Cover entire
original packet
Encapsulating Security Payload (ESP)
Provide message content confidentiality
Provide limited traffic flow confidentiality
Can optionally provide the same authentication
services as AH
Supports range of ciphers, modes, padding
Incl. DES, Triple-DES, RC5, IDEA, CAST etc
A variant of DES most common
Pad to meet blocksize, for traffic flow
ESP: Tunnel and Transport Mode
Original
Transport Mode
Good for host to
host traffic
Tunnel Mode
Good for VPNs,
gateway to gateway
security
Outbound Packet Processing
Form ESP header
Security parameter index (SPI)
Sequence number
Pad as necessary
Encrypt result [payload, padding, pad length,
next header]
Apply authentication (optional)
Allow rapid detection of replayed/bogus packets
Allow potential parallel processing - decryption &
verifying authentication code
Integrity Check Value (ICV) includes whole ESP
packet minus authentication data field
Original IP Header
ESP Transport Example
Authentication coverage SPI
Sequence Number
Variable Length
A B C
IPv6
New New ESP Orig Orig ESP ESP
TCP Data
IP hdr ext hdr hdr IP hdr ext hdr trailer Auth