18CSE354T Network Security Unit II
18CSE354T Network Security Unit II
UNIT - 2
UNIT - 2 TOPICS
Overview of IPSEC Internet Key Exchange
Security Association Phases of IKE
Security Association DB Phase I IKE – Modes and key
Security Policy DB types
AH & ESP
Phase I IKE Protocols
Tunnel and Transport Mode
Phase II IKE
IP Header Protection
ISAKMP / IKE Encoding
IP and IPv6
IPV4 and IPV6 header
Authentication Header
Mutable,Immutable and
Mutable but predictable
Encapsulation Security
Payload(ESP)
IP Security
Have a range of application-specific
security mechanisms
E.g. S/MIME, PGP, Kerberos, SSL/HTTPS
- however, there are security concerns that
cut across protocol layers
People would like security to be
implemented by the network for all
applications
IPSec
General IP Security mechanisms provides
authentication
confidentiality
key management
Applicable to use over LANs, across public
& private WANs, & for the Internet
Applications of IPSec
Build a secure virtual private network over the
Internet or over a public WAN.
Secure remote access over the Internet to his
company, for example.
Establishing extranet and intranet connectivity
with partners
- ensuring authentication and confidentiality and
providing a key exchange mechanism
Enhancing electronic commerce security
Benefits of IPSec
IPSec in a firewall/router provides strong
security to all traffic crossing the perimeter
IPSec in a firewall/router is resistant to bypass
traffic as long as all traffic is IP
IPSec is below transport layer, hence
transparent to applications
IPSec can be transparent to end users
IPSec can provide security for individual users
IPSec secures routing architecture
IPSec Uses
IP Security Architecture
Specification is quite complex
Defined in numerous RFC’s
incl. RFC 2401/2402/2406/2408
many others, grouped by category
Mandatory in IPv6, optional in IPv4
Have two security header extensions:
Authentication Header (AH)
Encapsulating Security Payload (ESP)
Seven Groups
Architecture
Encapsulating Security Payload (ESP)
Authentication Header (AH)
Encryption algorithms
Authentication algorithms
Key management
Domain of Interpretation (DOI)
~ From RFC 2406
Policy: For a given datagram, sending entity needs to know if it should use
IPsec.
SPD
SA-1
SA-2
SADB SPI
SPI
26
SPD and SADB Example
Transport mode
Tunnel mode
Transport vs Tunnel Mode
ESP
Transport mode is used to encrypt and
optionally authenticate IP data
data protected but header left in clear
good for ESP host to host traffic
Tunnel mode encrypts the entire IP packet
add new header for next hop
good for VPNs, gateway to gateway security
IPSec tunnel mode is the default mode.
Tunnel mode is used to encrypt traffic between secure IPSec Gateways( for
example two Cisco routers connected over the Internet via IPSec VPN.)
Traffic from the client is encrypted, encapsulated inside a new IP packet and
sent to the other end.
37
IPSec Tunnel mode with ESP
header:
38
IPSec Tunnel mode with AH header:
The AH can be applied alone or together with the ESP, when IPSec is in tunnel
mode.
The AH does not protect all of the fields in the New IP Header because some
change in transit, and the sender cannot predict how they might change.
39
Transport mode provides the protection of our data, also known as IP Payload, and
consists of TCP/UDP header + Data, through an AH or ESP header.
The original IP headers remain intact, except that the IP protocol field is changed to
ESP (50) or AH (51), and the original protocol value is saved in the IPsec trailer to
be restored when the packet is decrypted.
IPSec transport mode is usually used when another tunneling protocol (like GRE) is
used to first encapsulate the IP data packet, then IPSec is used to protect the GRE
tunnel packets. IPSec protects the GRE tunnel traffic in transport mode.
40
IPSec Transport mode with ESP header:
Placing the sender’s IP header at the front (with minor changes to the protocol
ID), proves that transport mode does not provide protection or encryption to the
original IP header .
41
IPSec Transport mode with AH header:
The AH can be applied alone or together with the ESP when IPSec is in
transport mode.
AH’s job is to protect the entire packet, however, IPSec in transport mode
does not create a new IP header in front of the packet but places a copy of
the original with some minor changes to the protocol ID therefore not
providing essential protection to the details contained in the IP header
(Source IP, destination IP etc).
42
Combining Security
Associations
SA’s can implement either AH or ESP (but
not both)
To implement both need to combine SA’s
form a SA bundle
may terminate at different or same endpoints
combined by
• transport adjacency
• iterated tunneling
issue of authentication & encryption order
Transport mode
Tunnel mode
ESP – TRANSPORT & TUNNEL MODE
Transport Mode
Tunnel Mode
AH – TRANSPORT & TUNNEL MODE
AH Transport Mode
AH Tunnel Mode
Summary – AH & ESP
UNIT - 2 TOPICS
Overview of IPSEC Internet Key Exchange
Security Association Phases of IKE
Security Association DB Phase I IKE – Modes and key
Security Policy DB types
AH & ESP
Phase I IKE Protocols
Tunnel and Transport Mode
Phase II IKE
IP Header Protection
ISAKMP / IKE Encoding
IP and IPv6
IPV4 and IPV6 header
Authentication Header
Mutable,Immutable and
Mutable but predictable
Encapsulation Security
Payload(ESP)
Internet Key
Exchange
?Where does IKE fit in
SA’s building and managing is either:
• Static (manual) – keys and other attributes
of SA are manually configured by system
administrator. Practical for small, relatively
static environments.
• Dynamic (automated) – On-demand
creation of keys. Handled by IKE protocol
IKE
• IKE is a protocol that builds and manages IPSec
SA’s between two computers that implement
IPSec.
• IKE is the only standard protocol for building
IPSec SA’s (Standard IPSec implementation must
also implement IKE)
• IKE (like IPSec) is carried out either between a
pair of hosts, a pair of security gateways or a host
and a security gateway
IKE version
• There are two version of IKE (IKEv1 and
IKEv2)
• IKE version 1 is a hybrid of three protocols
(actually a framework and two protocols)
• Version 1 grew out of ISAKMP framework
and OAKLEY and SKEME protocols that
work within that framework.
ISAKMP (IKE version 1)
• Stands for “Internet Security Association
and Key Management” Protocol
• Created by NSA (National Security
Agency)
• Framework (not really a protocol) for
authentication and key exchange.
• This framework decides on the SA’s
attributes that the parties will use.
ISAKMP (IKE version 1)
• IKE Phase 2
How It Works
IKE has two phases
Phase 1: Establish bi-directional IKE SA
• Note: IKE SA different from IPsec SA
• Also called ISAKMP security association
Phase 2: ISAKMP is used to securely negotiate the
IPsec pair of SAs
Phase 1 has two modes: aggressive mode and
main mode
Aggressive mode uses fewer messages
Main mode provides identity protection and is more
flexible
Both phases use Diffie-Hellman key exchange to
establish a shared key
IKE Phase 1
Goal: to establish a secure channel
between two end points
This channel provides basic security features:
• Source authentication
• Data integrity and data confidentiality
• Protection against replay attacks
66
IKE Phase 1
Rationale: each application has different
security requirements
But they all need to negotiate policies and
exchange keys!
So, provide the basic security features
and allow application to establish custom
sessions
67
IKE Phase 1
Themain purpose of IKE phase 1 is
to establish a secure tunnel that we can
use for IKE phase 2.
Step 1 : Negotiation
Step 2: DH Key Exchange
Step 3: Authentication
Step 1 : Negotiation
• Hashing: We use MD5 or SHA for this.
• DH (Diffie Hellman) group: the DH group determines the strength of the key that
is used in the key exchange process.
• Lifetime: how long does the IKE phase 1 tunnel stand up? the shorter the lifetime,
the more secure it is because rebuilding it means we will also use new keying
material.
• Encryption: what algorithm do we use for encryption? For example, DES, 3DES or
AES.
Step 2: DH Key Exchange
• Main mode
• Aggressive mode
Phase 1 Exchange
Can operate in two modes:
Main mode
• Six messages in three round trips
• More options
Aggressive mode
• Three messages in two exchanges
• Less options
75
Phase 1 (Main Mode)
Initiator Responder
[Header, SA1]
76
Phase 1 (Main Mode)
Initiator Responder
[Header, SA1]
[Header, SA2]
77
Phase 1 (Main Mode)
Initiator Responder
[Header, SA1]
[Header, SA2]
[Header, KE, Ni, {Cert_Reg} ]
78
Phase 1 (Main Mode)
Initiator Responder
Header, SA1
[Header, SA1]
79
Phase 1 (Main Mode)
Initiator Responder
[Header, SA1]
[Header, SA1]
80
Phase 1 (Main Mode)
Initiator Responder
[Header, SA1]
[Header, SA1]
Initiator Responder
82
Phase 1 (Aggressive Mode)
Initiator Responder
[Header, [Cert]sig]
83
IPSec (Phase 1)
Four different way to authenticate (either
mode)
Digital signature
Two forms of authentication with public key
encryption
Pre-shared key
NOTE: IKE does use public-key based
cryptography for encryption
84
IKE Version Difference
Mainand aggressive modes applies only to
IKEv1 protocol.
IKEv2 protocol does not negotiate using main
and aggressive modes.
IPSec (Phase 2)
Goal: to establish custom secure channels
between two end points
End points are identified by <IP, port>:
• e.g. <www.mybank.com, 8000>
Or by packet:
• e.g. All packets going to 128.124.100.0/24
Use the secure channel established in Phase
1 for communication
86
Regardless of the mode used in Phase 1, Phase 2
always operates in quick mode and involves the
exchange of three messages.
Expectations from IKE
Secrecy and authenticity
Protection against replay attacks
Scalability (being suitable for big networks)
Privacy and anonymity (protecting identity of
players in the protocol)
Protection against DOS
Efficiency (both computational and minimal in
the number of messages)
Independence of cryptographic algorithms
Minimize protocol complexity
Reliability
UNIT - 2 TOPICS
Overview of IPSEC Internet Key Exchange
Security Association Phases of IKE
Security Association DB Phase I IKE – Modes and key
Security Policy DB types
AH & ESP
Phase I IKE Protocols
Tunnel and Transport Mode
Phase II IKE
IP Header Protection
ISAKMP / IKE Encoding
IP and IPv6
IPV4 and IPV6 header
Authentication Header
Mutable,Immutable and
Mutable but predictable
Encapsulation Security
Payload(ESP)