Friday, July 12, 2013

IPSec VPN concepts

IPsec is defined in RFC 2401 and a frame work of protocols.

The IPsec protocol suite provides three overall pieces:

1.  A protocol negotiation and key exchange process, Internet key exchange (IKE), that allows to agree on authentication methods, encryption methods, the keys to use, how long to use the keys before changing them, and that allows smart, secure key exchange.

2. An encapsulating security payload (ESP) format for IP that scrambles the data (and even certain sensitive IP addresses) in each packet using hard core encryption — so a sniffer somewhere on the network doesn't get anything usable.

3. An authentication header (AH) for IP that lets communicating parties verify that data was not modified in transit and that it genuinely came from its apparent source.


IKE phase 1: (exchanging policies)
=============
Negotiate IKE policy sets and authenticate each other and create secure channel to exchange information

2 modes:

Main mode:
=========
The first step, securing an IKE SA using main mode, occurs in three two-way exchanges between the SA initiator and the recipient.
In the first exchange, the two agree on basic algorithms and hashes.
In the second, they exchange public keys for a DiffieHellman exchange, and pass each other nonces — random numbers the other party must sign and return to prove their identity.
In the third, they verify those identities.

Aggressive Mode:
================
Aggressive mode provides the same services as main mode. It establishes the original IKE SA. It looks much the same as main mode except that it is accomplished in two exchanges, rather than three, with only one round trip, and a total of three packets rather than six.
In aggressive mode, the proposing party generates a Diffie-Hellman pair at the beginning of the exchange, and does as much as is practical with that first packet — proposing an SA, passing the DiffieHellman public value, sending a nonce for the other party to sign, and sending an ID packet which the responder can use to check their identity with a third party. The responder then sends back everything needed to complete the exchange — really an amalgamation of all three response steps in main mode, and all that’s left for the initiator to do is to confirm the exchange.

IKE2: Transormsets (clear text to cypher text)
====
PFS : Perfrect forward Secrecy

main mode
aggressive mode >default >

Quick Mode:
===========
Once two communicating parties have established an IKE SA using aggressive mode or main mode, they can use quick mode.
Quick mode has two purposes —
negotiating general IPSec security services and generating fresh keying material.
Quick mode is less complex than either main or aggressive mode. Since it’s already inside a secure tunnel (every packet is encrypted), it can also afford to be a little more flexible. Quick mode packets are always encrypted, and always start with a hash payload. 
The hash payload is composed using the agreed-upon PRF and the derived authentication key for the IKE SA. The hash payload is used to authenticate the rest of the packet.
Quick mode defines which parts of the packet are included in the hash.




No comments:

Post a Comment