In tunnel mode, the entire IP packet is encrypted and authenticated. It is then encapsulated into a new IP packet with a new IP header. Tunnel mode is used to create "virtual private networks for network-to-network communications (e.g. between routers to link sites), host-to-network communications (e.g. remote user access) and host-to-host communications (e.g. private chat).
Tunnel mode supports NAT traversal.
Cryptographic algorithms defined for use with IPsec include:
- "HMAC-"SHA1/"SHA2 for integrity protection and authenticity.
- "TripleDES-"CBC for confidentiality
- "AES-CBC for confidentiality.
- AES-"GCM providing confidentiality and authentication together efficiently.
Refer to RFC 7321 for details.
IPsec support is usually implemented in the "kernel with key management and "ISAKMP/"IKE negotiation carried out from user space. The openly specified "PF_KEY Key Management API, Version 2" is often used to enable the application-space key management application to update the IPsec Security Associations stored within the kernel-space IPsec implementation.
Existing IPsec implementations usually include ESP, AH, and IKE version 2. Existing IPsec implementations on UNIX-like operating systems, for example, Solaris or Linux, usually include PF_KEY version 2.
IPsec was developed in conjunction with "IPv6 and was originally required to be supported by all standards-compliant implementations of "IPv6 before RFC 6434 made it only a recommendation. IPsec is also optional for "IPv4 implementations. IPsec is most commonly used to secure IPv4 traffic.
IPsec protocols were originally defined in RFC 1825 through RFC 1829, which were published in 1995. In 1998, these documents were superseded by RFC 2401 and RFC 2412 with a few incompatible engineering details, although they were conceptually identical. In addition, a mutual authentication and key exchange protocol "Internet Key Exchange (IKE) was defined to create and manage security associations. In December 2005, new standards were defined in RFC 4301 and RFC 4309 which are largely a superset of the previous editions with a second version of the Internet Key Exchange standard "IKEv2. These third-generation documents standardized the abbreviation of IPsec to uppercase “IP” and lowercase “sec”. “ESP” generally refers to RFC 4303, which is the most recent version of the specification.
Since mid-2008, an IPsec Maintenance and Extensions (ipsecme) working group is active at the IETF.
Alleged NSA interference
In 2013, as part of "Snowden leaks, it was revealed that the US "National Security Agency had been actively working to "Insert vulnerabilities into commercial encryption systems, IT systems, networks, and endpoint communications devices used by targets" as part of the "Bullrun program. There are allegations that IPsec was a targeted encryption system.
The OpenBSD IPsec stack was the first implementation that was available under a permissive open-source license, and was therefore copied widely. In a letter which OpenBSD lead developer "Theo de Raadt received on 11 Dec 2010 from Gregory Perry, it is alleged that Jason Wright and others, working for the FBI, inserted "a number of "backdoors and "side channel key leaking mechanisms" into the OpenBSD crypto code. In the forwarded email from 2010, Theo de Raadt did not at first express an official position on the validity of the claims, apart from the implicit endorsement from forwarding the email. Jason Wright's response to the allegations: "Every urban legend is made more real by the inclusion of real names, dates, and times. Gregory Perry's email falls into this category. … I will state clearly that I did not add backdoors to the OpenBSD operating system or the OpenBSD crypto framework (OCF)." Some days later, de Raadt commented that "I believe that NETSEC was probably contracted to write backdoors as alleged. … If those were written, I don't believe they made it into our tree." This was published before the Snowden leaks.
An alternative explanation put forward by the authors of the "Logjam attack suggests that the NSA compromised IPsec VPNs by undermining the "Diffie-Hellman algorithm used in the key exchange. In their paper they allege the NSA specially built a computing cluster to precompute multiplicative subgroups for specific primes and generators, such as for the second Oakley group defined in RFC 2409. As of May 2015, 90% of addressable IPsec VPNs supported the second Oakley group as part of IKE. If an organization were to precompute this group, they could derive the keys being exchanged and decrypt traffic without inserting any software backdoors.
A second alternative explanation that was put forward was that the "Equation Group used "zero-day exploits against several manufacturers' VPN equipment which were validated by "Kaspersky Lab as being tied to the Equation Group and validated by those manufacturers as being real exploits, some of which were zero-day exploits at the time of their exposure. The "Cisco PIX and ASA firewalls had vulnerabilities that were used for wiretapping by the NSA.
Furthermore, IPsec VPNs using "Aggressive Mode" settings send a hash of the PSK in the clear. This can be and apparently is targeted by the NSA using offline dictionary attacks.
- RFC 1829: The ESP DES-CBC Transform
- RFC 2403: The Use of HMAC-MD5-96 within ESP and AH
- RFC 2404: The Use of HMAC-SHA-1-96 within ESP and AH
- RFC 2405: The ESP DES-CBC Cipher Algorithm With Explicit IV
- RFC 2410: The NULL Encryption Algorithm and Its Use With IPsec
- RFC 2451: The ESP CBC-Mode Cipher Algorithms
- RFC 2857: The Use of HMAC-RIPEMD-160-96 within ESP and AH
- RFC 3526: More Modular Exponential (MODP) Diffie-Hellman groups for Internet Key Exchange (IKE)
- RFC 3602: The AES-CBC Cipher Algorithm and Its Use with IPsec
- RFC 3686: Using Advanced Encryption Standard (AES) Counter Mode With IPsec Encapsulating Security Payload (ESP)
- RFC 3947: Negotiation of NAT-Traversal in the IKE
- RFC 3948: UDP Encapsulation of IPsec ESP Packets
- RFC 4106: The Use of Galois/Counter Mode (GCM) in IPsec Encapsulating Security Payload (ESP)
- RFC 4301: Security Architecture for the Internet Protocol
- RFC 4302: IP Authentication Header
- RFC 4303: IP Encapsulating Security Payload
- RFC 4304: Extended Sequence Number (ESN) Addendum to IPsec Domain of Interpretation (DOI) for Internet Security Association and Key Management Protocol (ISAKMP)
- RFC 4307: Cryptographic Algorithms for Use in the Internet Key Exchange Version 2 ("IKEv2)
- RFC 4308: Cryptographic Suites for IPsec
- RFC 4309: Using Advanced Encryption Standard (AES) CCM Mode with IPsec Encapsulating Security Payload (ESP)
- RFC 4543: The Use of Galois Message Authentication Code (GMAC) in IPsec ESP and AH
- RFC 4555: IKEv2 Mobility and Multihoming Protocol (MOBIKE)
- RFC 4806: Online Certificate Status Protocol (OCSP) Extensions to IKEv2
- RFC 4868: Using HMAC-SHA-256, HMAC-SHA-384, and HMAC-SHA-512 with IPsec
- RFC 4945: The Internet IP Security PKI Profile of IKEv1/ISAKMP, IKEv2, and PKIX
- RFC 5280: Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile
- RFC 5282: Using Authenticated Encryption Algorithms with the Encrypted Payload of the Internet Key Exchange version 2 (IKEv2) Protocol
- RFC 5386: Better-Than-Nothing Security: An Unauthenticated Mode of IPsec
- RFC 5529: Modes of Operation for Camellia for Use with IPsec
- RFC 5685: Redirect Mechanism for the Internet Key Exchange Protocol Version 2 (IKEv2)
- RFC 5723: Internet Key Exchange Protocol Version 2 (IKEv2) Session Resumption
- RFC 5857: IKEv2 Extensions to Support Robust Header Compression over IPsec
- RFC 5858: IPsec Extensions to Support Robust Header Compression over IPsec
- RFC 7296: Internet Key Exchange Protocol Version 2 (IKEv2)
- RFC 7321: Cryptographic Algorithm Implementation Requirements and Usage Guidance for Encapsulating Security Payload (ESP) and Authentication Header (AH)
- RFC 7383: Internet Key Exchange Protocol Version 2 (IKEv2) Message Fragmentation
- RFC 7427: Signature Authentication in the Internet Key Exchange Version 2 (IKEv2)
- RFC 7634: ChaCha20, Poly1305, and Their Use in the Internet Key Exchange Protocol (IKE) and IPsec
- RFC 4478: Repeated Authentication in Internet Key Exchange (IKEv2) Protocol
- RFC 2367: PF_KEY Interface
- RFC 2412: The OAKLEY Key Determination Protocol
- RFC 3706: A Traffic-Based Method of Detecting Dead Internet Key Exchange (IKE) Peers
- RFC 3715: IPsec-Network Address Translation (NAT) Compatibility Requirements
- RFC 4621: Design of the IKEv2 Mobility and Multihoming (MOBIKE) Protocol
- RFC 4809: Requirements for an IPsec Certificate Management Profile
- RFC 5387: Problem and Applicability Statement for Better-Than-Nothing Security (BTNS)
- RFC 5856: Integration of Robust Header Compression over IPsec Security Associations
- RFC 5930: Using Advanced Encryption Standard Counter Mode (AES-CTR) with the Internet Key Exchange version 02 (IKEv2) Protocol
- RFC 6027: IPsec Cluster Problem Statement
- RFC 6071: IPsec and IKE Document Roadmap
- RFC 6379: Suite B Cryptographic Suites for IPsec
- RFC 6380: Suite B Profile for Internet Protocol Security (IPsec)
- RFC 6467: Secure Password Framework for Internet Key Exchange Version 2 (IKEv2)
Best Current Practice RFCs
- RFC 5406: Guidelines for Specifying the Use of IPsec Version 2
- RFC 1825: Security Architecture for the Internet Protocol (obsoleted by RFC 2401)
- RFC 1826: IP Authentication Header (obsoleted by RFC 2402)
- RFC 1827: IP Encapsulating Security Payload (ESP) (obsoleted by RFC 2406)
- RFC 1828: IP Authentication using Keyed MD5 (historic)
- RFC 2401: Security Architecture for the Internet Protocol (IPsec overview) (obsoleted by RFC 4301)
- RFC 2406: IP Encapsulating Security Payload (ESP) (obsoleted by RFC 4303 and RFC 4305)
- RFC 2407: The Internet IP Security Domain of Interpretation for ISAKMP (obsoleted by RFC 4306)
- RFC 2409: The Internet Key Exchange (obsoleted by RFC 4306)
- RFC 4305: Cryptographic Algorithm Implementation Requirements for Encapsulating Security Payload (ESP) and Authentication Header (AH) (obsoleted by RFC 4835)
- RFC 4306: Internet Key Exchange (IKEv2) Protocol (obsoleted by RFC 5996)
- RFC 4718: IKEv2 Clarifications and Implementation Guidelines (obsoleted by RFC 7296)
- RFC 4835: Cryptographic Algorithm Implementation Requirements for Encapsulating Security Payload (ESP) and Authentication Header (AH) (obsoleted by RFC 7321)
- RFC 5996: Internet Key Exchange Protocol Version 2 (IKEv2) (obsoleted by RFC 7296)
- "Dynamic Multipoint Virtual Private Network
- "Information security
- "NAT traversal
- "Opportunistic encryption
- Kent, S.; Atkinson, R. (November 1998). IP Encapsulating Security Payload (ESP). "IETF. RFC 2406. https://tools.ietf.org/html/rfc2406.
- "SIPP Encapsulating Security Payload". IETF SIPP Working Group. 1993.
- "Draft SIPP Specification". IETF. 1993. p. 21.
- "RFC4301: Security Architecture for the Internet Protocol". Network Working Group of the IETF. December 2005. p. 4.
The spelling "IPsec" is preferred and used throughout this and all related IPsec standards. All other capitalizations of IPsec [...] are deprecated.
- Thayer, R.; Doraswamy, N.; Glenn, R. (November 1998). IP Security Document Roadmap. "IETF. RFC 2411. https://tools.ietf.org/html/rfc2411.
- Hoffman, P. (December 2005). Cryptographic Suites for IPsec. "IETF. RFC 4308. https://tools.ietf.org/html/rfc4308.
- Kent, S.; Atkinson, R. (November 1998). IP Authentication Header. "IETF. RFC 2402. https://tools.ietf.org/html/rfc2402.
- Kent, S. (December 2005). IP Authentication Header. "IETF. RFC 4302. https://tools.ietf.org/html/rfc4302.
- The "Internet Key Exchange (IKE), RFC 2409, §1 Abstract
- Harkins, D.; Carrel, D. (November 1998). The Internet Key Exchange (IKE). "IETF. RFC 2409. https://tools.ietf.org/html/rfc2409.
- Kaufman, C., ed. IKE Version 2. "IETF. RFC 4306. https://tools.ietf.org/html/rfc4306.
- Sakane, S.; Kamada, K.; Thomas, M.; Vilhuber, J. (November 1998). Kerberized Internet Negotiation of Keys (KINK). "IETF. RFC 4430. https://tools.ietf.org/html/rfc4430.
- Richardson, M. (February 2005). A Method for Storing IPsec Keying Material in DNS. "IETF. RFC 4025. https://tools.ietf.org/html/rfc4025.
- "Protocol Numbers". IANA. "IANA. 2010-05-27. Archived from the original on 2010-07-27.
- "Bellovin, Steven M. (1996). "Problem Areas for the IP Security Protocols" ("PostScript). Proceedings of the Sixth Usenix Unix Security Symposium. San Jose, CA. pp. 1–16. Retrieved 2007-07-09.
- Paterson, Kenneth G.; Yau, Arnold K.L. (2006-04-24). "Cryptography in theory and practice: The case of encryption in IPsec" (PDF). Eurocrypt 2006, Lecture Notes in Computer Science Vol. 4004. Berlin. pp. 12–29. Retrieved 2007-08-13.
- Degabriele, Jean Paul; Paterson, Kenneth G. (2007-08-09). "Attacking the IPsec Standards in Encryption-only Configurations" (PDF). IEEE Symposium on Security and Privacy, IEEE Computer Society. Oakland, CA. pp. 335–349. Retrieved 2007-08-13.
- Kent, S. (December 2005). IP Encapsulating Security Payload (ESP). "IETF. RFC 4303. https://tools.ietf.org/html/rfc4303.
- RFC 2406, §1, page 2
- RFC 3129
- William, S., & Stallings, W. (2006). Cryptography and Network Security, 4/E. Pearson Education India. p. 492-493
- RFC 2367, PF_KEYv2 Key Management API, Dan McDonald, Bao Phan, & Craig Metz (July 1998)
- RFC 6434, "IPv6 Node Requirements", E. Jankiewicz, J. Loughney, T. Narten (December 2011)
- "ipsecme charter". Retrieved 2015-10-26.
- "ipsecme status". Retrieved 2015-10-26.
- "Secret Documents Reveal N.S.A. Campaign Against Encryption". New York Times.
- John Gilmore. "Re: [Cryptography] Opening Discussion: Speculation on "BULLRUN"".
- Theo de Raadt. "Allegations regarding OpenBSD IPSEC".
- Jason Wright. "Allegations regarding OpenBSD IPSEC".
- Theo de Raadt. "Update on the OpenBSD IPSEC backdoor allegation".
- David Adrian; Karthikeyan Bhargavan; Zakir Durumeric; Pierrick Gaudry; Matthew Green; "J. Alex Halderman; Nadia Heninger; Drew Springall; Emmanuel Thomé; Luke Valenta; Benjamin VanderSloot; Eric Wustrow; Santiago Zanella-Béguelink; Paul Zimmermann. "Imperfect Forward Secrecy: How Diffie-Hellman Fails in Practice" (PDF).
- Goodin, Dan (August 16, 2016). "Confirmed: hacking tool leak came from "omnipotent" NSA-tied group". Ars Technica. Retrieved August 19, 2016.
- Thomson, Iain (August 17, 2016). "Cisco confirms two of the Shadow Brokers' 'NSA' vulns are real". "The Register. Retrieved September 16, 2016.
- Pauli, Darren (August 24, 2016). "Equation Group exploit hits newer Cisco ASA, Juniper Netscreen". "The Register. Retrieved September 16, 2016.
- Chirgwin, Richard (August 18, 2016). "Fortinet follows Cisco in confirming Shadow Broker vuln". "The Register. Retrieved September 16, 2016.
- Computer Security at "DMOZ
- All IETF active security WGs
- Securing Data in Transit with IPsec WindowsSecurity.com article by Deb Shinder
- IPsec on Microsoft TechNet
- Microsoft IPsec Diagnostic Tool on Microsoft Download Center
- An Illustrated Guide to IPsec by Steve Friedl
- Security Architecture for IP (IPsec) Data Communication Lectures by Manfred Lindner Part IPsec
- Creating VPNs with IPsec and SSL/TLS Linux Journal article by Rami Rosen