The IP Security Protocol, Part 1
The authentication header (AH) format is specified in RFC 2402. Usage of this IPSec feature guarantees data integrity and uniquely authenticates the sending peer. AH operation depends on algorithms called hash functions. These are basically one-way functions that, given an arbitrary-length data sequence, produce a fixed-length hash ( group of bytes) guaranteed to be different for input sequences differing even by one bit.
When the AH packet is built, a hash function is applied to the whole IP packet. The resulting value is stored inside an additional header attached to the packet itself. This new packet is then sent on the network. Upon reception of the packet, the destination host applies the same hash function to the received packet and compares the obtained value to the one stored in the AH header. If the two values differ, it means the packet integrity is compromised, and the packet is rejected.
Actually, some fields of the original IP header are not considered while computing the hash, because their value is subject to change along the path. Examples of such fields are the time to live (TTL) and the IP checksum.
Some readers may wonder what would prevent an attacker from modifying both packet bytes and the hash value in order to make the latter coherent with the former. Hash functions used for AH are called keyed hashes. In the computation of the basic hash, they also consider a secret key (which has been negotiated between the IPSec peers, as we will see in a while), thus making it impossible for someone who does not know the key to recalculate the new hash.
This is also the reason why AH can authenticate the sending host. Since the secret key is needed to calculate the hash, verifying the latter's correctness simultaneously proves that the packet is untouched and that the sender knew the secret key. Thus, he is the legitimate sender.
The keyed hash algorithm mandated by RFC 2402 is HMAC, which must be used in conjunction with either MD5 or SHA. For more details on these obscure acronyms, see the sidebar. The two working modes are commonly referred to by HMAC-MD5-96 or HMAC-SHA-1-96, respectively. Other hash algorithms may be added in the future without changing the overall AH architecture; only the hash computation modules would need to be modified.
An optional feature of AH is protection against replay attacks. This is possible thanks to a monotonically increasing counter that also is included in the AH header. Generation of the counter is mandatory for the sending peer, whereas its verification by the receiving peer is optional.
The most important fields contained in the AH header are:
a 32-bit integer called SPI (security parameter index) that is used to associate the packet with a specific security relationship between the communicating peers (more on this in Part 2);
a 32-bit sequence number that is used to protect against replay attacks. The number must be monotonically increasing and can wrap only when a new connection procedure is established; and
the authentication data proper (ICV, integrity check value), computed by the sending peer as described above.
What AH does not provide is data confidentiality. An AH packet carries some information related to its integrity, but the original packet payload is still in clear text. An eavesdropper, therefore, will be able to read packet content and grab any sensitive information that may be present. Anyway, he will not be able to modify the packet and substitute it for the real one. Neither will he be allowed to forge fake data and send it to the receiver by pretending to be the legitimate sender. If data confidentiality is required, IPSec's ESP format must be used.
In Part 2 of this article, we will discuss encapsulating security payloads, IPSec modes, security associations and key exchange mechanisms.
Applied Cryptography, by Bruce Schneier, is an excellent and deep introduction to cryptography issues and algorithms.
Cryptonomicom, by Neal Stephenson, is a good novel romance deeply related to cryptography.
IETF RFCs 2401-2411, RFC 2451, and others (available from www.ietf.org), specify the IPSec architecture and its components.
"OpenSSL Programming", Linux Journal, September 2001. Eric Rescorla gives an introduction on how to use SSL in your own programs.
"Problem Areas for the IP Security Protocols", Proc. 6th Usenix Unix Security Symposium, July 1996. Steve Bellovin explains, among other things, why using confidentiality without authentication is dangerous.
"The 101 Uses of OpenSSH: Part II", Linux Journal, February 2001. Mick Bauer introduces the basic concepts of public key cryptography.
Gianluca Insolvibile has been a Linux enthusiast since kernel 0.99pl4. He currently deals with networking and digital video research and development.
|Free Today: September Issue of Linux Journal (Retail value: $5.99)||Sep 27, 2016|
|nginx||Sep 27, 2016|
|Epiq Solutions' Sidekiq M.2||Sep 26, 2016|
|Nativ Disc||Sep 23, 2016|
|Android Browser Security--What You Haven't Been Told||Sep 22, 2016|
|The Many Paths to a Solution||Sep 21, 2016|
- Free Today: September Issue of Linux Journal (Retail value: $5.99)
- Android Browser Security--What You Haven't Been Told
- Readers' Choice Awards 2013
- Epiq Solutions' Sidekiq M.2
- The Many Paths to a Solution
- Nativ Disc
- Synopsys' Coverity
- Download "Linux Management with Red Hat Satellite: Measuring Business Impact and ROI"
- Tech Tip: Really Simple HTTP Server with Python
Pick up any e-commerce web or mobile app today, and you’ll be holding a mashup of interconnected applications and services from a variety of different providers. For instance, when you connect to Amazon’s e-commerce app, cookies, tags and pixels that are monitored by solutions like Exact Target, BazaarVoice, Bing, Shopzilla, Liveramp and Google Tag Manager track every action you take. You’re presented with special offers and coupons based on your viewing and buying patterns. If you find something you want for your birthday, a third party manages your wish list, which you can share through multiple social- media outlets or email to a friend. When you select something to buy, you find yourself presented with similar items as kind suggestions. And when you finally check out, you’re offered the ability to pay with promo codes, gifts cards, PayPal or a variety of credit cards.Get the Guide