Is IPsecurity Unlocked
Is IPsecurity Unlocked
Introduction
What is IPsec?
Security associations
Security associations
Basic combinations of SAs
Security association and policy databases
Prof.dr. F.L. Ţiplea, UAIC, RO Lectures on Information Security IP SecurityIPsec Fall 2023 2 / 44
TCP/IP protocol suite
Internet IP IP
header
TCP/UDP
header
data IP
Link Frame
header
IP
header
TCP/UDP
header
data Frame
footer
0111010011010
Prof.dr. F.L. Ţiplea, UAIC, RO Lectures on Information Security IP SecurityIPsec Fall 2023 3 / 44
Security issues with IP
• Data modification;
• IP address spoofing;
• Routing attacks.
Prof.dr. F.L. Ţiplea, UAIC, RO Lectures on Information Security IP SecurityIPsec Fall 2023 4 / 44
Security issues with IP
Internet IP IP
header
TCP/UDP
header
data IP
Link Frame
header
IP
header
TCP/UDP
header
data Frame
footer
ty? ity
?
ty ? ali
eg
ri0 1 1 1 0fide1nti0 0 1 1 0the1nti0c
Int n Au
Co
Prof.dr. F.L. Ţiplea, UAIC, RO Lectures on Information Security IP SecurityIPsec Fall 2023 5 / 44
What is IPsec?
IPsec: what is it?
Prof.dr. F.L. Ţiplea, UAIC, RO Lectures on Information Security IP SecurityIPsec Fall 2023 6 / 44
IPsec: networking concepts
• Node:
• device attached to a network where messages can be created,
received, or transmitted;
• examples: computers, personal digital assistants (PDAs), cell
phones, or various other networked devices;
• on a TCP/IP network, a node is any device with an IP address;
• Security gateway:
• system that implements IPsec protocols;
• examples: router or firewall implementing IPsec.
Prof.dr. F.L. Ţiplea, UAIC, RO Lectures on Information Security IP SecurityIPsec Fall 2023 7 / 44
IPsec: fundamental components
1. Security protocols:
• Authentication Header (AH): piece of information (MAC) associated
to an IP datagram in order to authenticate certain fields of the
datagram;
• Encapsulating Security Payload (ESP): obtained from an IP
datagram by encrypting, and optionally authenticating, certain fields
of the datagram;
2. Security associations;
Because of these protocols are provided at the IP layer, they can be used
by any higher layer protocol (e.g., TCP, UDP, ICMP etc.).
Prof.dr. F.L. Ţiplea, UAIC, RO Lectures on Information Security IP SecurityIPsec Fall 2023 8 / 44
Securing IP datagram
IP TCP/UDP data
Internet IP, IPsec header header
Add MAC and AE!
IP, IPsec
Link Frame
header
IP
header
TCP/UDP
header
data Frame
footer
0111010011010
Prof.dr. F.L. Ţiplea, UAIC, RO Lectures on Information Security IP SecurityIPsec Fall 2023 9 / 44
IPsec security services
Prof.dr. F.L. Ţiplea, UAIC, RO Lectures on Information Security IP SecurityIPsec Fall 2023 10 / 44
Transport and tunnel modes
IP datagrams
IP hdr IP payload
IPv6 hdr
···
routing extension header
fragmentation extension header
destination options extension header
Prof.dr. F.L. Ţiplea, UAIC, RO Lectures on Information Security IP SecurityIPsec Fall 2023 11 / 44
Transport mode
Prof.dr. F.L. Ţiplea, UAIC, RO Lectures on Information Security IP SecurityIPsec Fall 2023 12 / 44
AH in transport mode
IP hdr AH IP payload
ext hdrs
Prof.dr. F.L. Ţiplea, UAIC, RO Lectures on Information Security IP SecurityIPsec Fall 2023 13 / 44
ESP in transport mode
Encrypted
Authenticated
ext hdrs
IPv6 IP main hdr ··· rout ESP dest IP payload ESP ESP
hdr trailer auth
Encrypted
Authenticated
Prof.dr. F.L. Ţiplea, UAIC, RO Lectures on Information Security IP SecurityIPsec Fall 2023 14 / 44
Tunnel mode
• Remark that hosts must support both transport and tunnel mode;
Prof.dr. F.L. Ţiplea, UAIC, RO Lectures on Information Security IP SecurityIPsec Fall 2023 15 / 44
AH in tunnel mode
Authenticated (except for mutable fields in the new IP hdr and its extensions hdrs)
Prof.dr. F.L. Ţiplea, UAIC, RO Lectures on Information Security IP SecurityIPsec Fall 2023 16 / 44
ESP in tunnel mode
Encrypted
Authenticated
IPv6 new IPv6 new ext hdrs ESP IPv6 datagram ESP ESP
main hdr hdr trailer auth
Encrypted
Authenticated
Prof.dr. F.L. Ţiplea, UAIC, RO Lectures on Information Security IP SecurityIPsec Fall 2023 17 / 44
More on AH and ESP
Authentication Header
0 8 16 31
next header payload length researved
sequence number
Figure 3: AH format
Prof.dr. F.L. Ţiplea, UAIC, RO Lectures on Information Security IP SecurityIPsec Fall 2023 18 / 44
Authentication Header
Prof.dr. F.L. Ţiplea, UAIC, RO Lectures on Information Security IP SecurityIPsec Fall 2023 19 / 44
Encapsulating Security Payload format
0 16 24 31
security parameter index (SPI)
authenticated
sequence number
Prof.dr. F.L. Ţiplea, UAIC, RO Lectures on Information Security IP SecurityIPsec Fall 2023 20 / 44
Encryption in ESP
NULL does nothing to alter data: it is the identity function with a block
size of 1 byte (therefore, padding is not necessary).
Authentication and encryption can each be ”NULL”, but not at the same
time!
Prof.dr. F.L. Ţiplea, UAIC, RO Lectures on Information Security IP SecurityIPsec Fall 2023 21 / 44
Security associations
Security associations
where:
Prof.dr. F.L. Ţiplea, UAIC, RO Lectures on Information Security IP SecurityIPsec Fall 2023 22 / 44
Security associations
Prof.dr. F.L. Ţiplea, UAIC, RO Lectures on Information Security IP SecurityIPsec Fall 2023 23 / 44
SA bundle
Prof.dr. F.L. Ţiplea, UAIC, RO Lectures on Information Security IP SecurityIPsec Fall 2023 24 / 44
End-to-end security
Internet/
Host 1 intranet Host 2
tunnel
connection
Two hosts are connected through the Internet or an intranet without any
security gateway between them. They can use ESP, AH, or both. Either
transport or tunnel mode can be applied.
Prof.dr. F.L. Ţiplea, UAIC, RO Lectures on Information Security IP SecurityIPsec Fall 2023 25 / 44
Basic VPN support
Internet/
Host 1 intranet Gtw 1 intranet Gtw 2 intranet Host 2
tunnel
connection
The hosts in the intranets are not required to support IPsec, but the
gateways are required to run IPsec and support tunnel mode (either with
AH or ESP).
Prof.dr. F.L. Ţiplea, UAIC, RO Lectures on Information Security IP SecurityIPsec Fall 2023 26 / 44
End-to-end security with VPN support
Internet/
Host 1 intranet Gtw 1 intranet Gtw 2 intranet Host 2
connection
tunnels
Prof.dr. F.L. Ţiplea, UAIC, RO Lectures on Information Security IP SecurityIPsec Fall 2023 27 / 44
Remote access
Internet/ G2
Host 1 intranet Host 2
intranet (firewall)
connection
tunnels
Between the host H1 and the firewall G2, only the tunnel mode is
required (e.g., AH in tunnel mode), and between the host H1 and H2,
either transport or tunnel mode can be used (e.g., ESP in transport
mode).
Prof.dr. F.L. Ţiplea, UAIC, RO Lectures on Information Security IP SecurityIPsec Fall 2023 28 / 44
SAD and SPD
Prof.dr. F.L. Ţiplea, UAIC, RO Lectures on Information Security IP SecurityIPsec Fall 2023 29 / 44
Internet key exchange
Internet key exchange
IKEv2 is more flexible than IKEv1, has fewer negotiation steps, and
brings many significant new features compared to IKEv1. It is not
backward compatible with IKEv1.
Prof.dr. F.L. Ţiplea, UAIC, RO Lectures on Information Security IP SecurityIPsec Fall 2023 30 / 44
IKE exchanges
Prof.dr. F.L. Ţiplea, UAIC, RO Lectures on Information Security IP SecurityIPsec Fall 2023 31 / 44
IKE exchanges illustrated
Initiator Receptor
Prof.dr. F.L. Ţiplea, UAIC, RO Lectures on Information Security IP SecurityIPsec Fall 2023 32 / 44
IKE exchanges illustrated
IKE SA
Child SA
IKE_AUTH
KEYMAT = prf + (SKd , NI k NR )
key(s)
CREATE_CHILD_SA
new Child SA
IKE_SA_INIT
key(s)
Prof.dr. F.L. Ţiplea, UAIC, RO Lectures on Information Security IP SecurityIPsec Fall 2023 33 / 44
IKE_SA_INIT
IKE_SA_INIT
I→R : Hdr , SAI1 , KEI , NI
R →I: Hdr , SAR1 , KER , NR [, CertReq]
Prof.dr. F.L. Ţiplea, UAIC, RO Lectures on Information Security IP SecurityIPsec Fall 2023 34 / 44
IKE_SA_INIT: key generation
At this point, each party can generate all keys for IKE SA:
prf + (K , T0 ) = T1 k T2 k T3 k · · ·
T1 = prf (K , T0 k 0x01)
T2 = prf (K , T1 k 0x02)
···
SKd will be used for derivation of further keying material for Child SAs.
SKex + SKax will be used for auth. encryption, where x ∈ {i, r }.
Prof.dr. F.L. Ţiplea, UAIC, RO Lectures on Information Security IP SecurityIPsec Fall 2023 35 / 44
IKE_AUTH
IKE_AUTH
I→R : Hdr , {IDI , [Cert, ][CertReq, ][IDR , ]Auth, SAI2 , TSI , TSR }SK
R →I: Hdr , {IDR , [Cert, ]Auth, SAR2 , TSI , TSR }SK
Prof.dr. F.L. Ţiplea, UAIC, RO Lectures on Information Security IP SecurityIPsec Fall 2023 36 / 44
IKE_AUTH: key generation for Child SA
When the first Child SA is created by IKE_AUTH, the keys are generated
as follows:
• The keying material is
Prof.dr. F.L. Ţiplea, UAIC, RO Lectures on Information Security IP SecurityIPsec Fall 2023 37 / 44
CREATE_CHILD_SA
Used to:
Re-keying an SA: create a new SA and then delete the old one.
Prof.dr. F.L. Ţiplea, UAIC, RO Lectures on Information Security IP SecurityIPsec Fall 2023 38 / 44
CREATE_CHILD_SA: new Child SA
where:
• If KEI and KER are not used, the keys are generated as in the case of
a Child SA created by IKE SA but with the fresh nonces NI and NR ;
• If KEI and KER are used, the keys are generated as follows:
• KEYMAT = prf + (SKd , g ir k NI k NR ) (g ir , NI , NR are the fresh
ones);
• the same rules for taking the keys.
Prof.dr. F.L. Ţiplea, UAIC, RO Lectures on Information Security IP SecurityIPsec Fall 2023 39 / 44
CREATE_CHILD_SA: re-keying a Child SA
where:
• The keys are generated as in the case of creation of a new Child SA.
Prof.dr. F.L. Ţiplea, UAIC, RO Lectures on Information Security IP SecurityIPsec Fall 2023 40 / 44
CREATE_CHILD_SA: re-keying IKE SA
where:
• The new SKd , SKai etc., are computed as usual (a new prf may be
used).
Prof.dr. F.L. Ţiplea, UAIC, RO Lectures on Information Security IP SecurityIPsec Fall 2023 41 / 44
INFORMATIONAL
INFORMATIONAL
I→R : Hdr , {[N, ] [D, ] [CP, ] . . .}SK
R →I: Hdr , {[N, ] [D, ] [CP, ] . . .}SK
where:
• N: notify;
• D: delete;
• CP: configuration;
Prof.dr. F.L. Ţiplea, UAIC, RO Lectures on Information Security IP SecurityIPsec Fall 2023 42 / 44
References
References
Bellovin, S. M. (1989). Security problems in the tcp/ip protocol suite. SIGCOMM Comput.
Commun. Rev., 19(2):32–48.
Diffie, W., Van Oorschot, P. C., and Wiener, M. J. (1992). Authentication and authenticated key
exchanges. Des. Codes Cryptography, 2(2):107–125.
Kaufman, C., Hoffman, P. E., Nir, Y., Eronen, P., and Kivinen, T. (2014). Internet Key Exchange
Protocol Version 2 (IKEv2). RFC 7296.
Krawczyk, H. (1996). SKEME: a versatile secure key exchange mechanism for internet. In
Proceedings of Internet Society Symposium on Network and Distributed Systems Security,
pages 114–127.
Orman, H. (1998). The OAKLEY Key Determination Protocol. RFC 2412.
Seo, K. and Kent, S. (2005). Security Architecture for the Internet Protocol. RFC 4301.
Wouters, P., Migault, D., Mattsson, J. P., Nir, Y., and Kivinen, T. (2017). Cryptographic
Algorithm Implementation Requirements and Usage Guidance for Encapsulating Security
Payload (ESP) and Authentication Header (AH). RFC 8221.
Prof.dr. F.L. Ţiplea, UAIC, RO Lectures on Information Security IP SecurityIPsec Fall 2023 43 / 44