ipsec

32
IPsec IPsec (IP security) • Security for transmission over IP networks – The Internet – Internal corporate IP networks – IP packets sent over public switched data networks (PSDN) Local Network Internet Local Network

Upload: aelwen

Post on 27-Jan-2016

93 views

Category:

Documents


0 download

DESCRIPTION

IPsec. IPsec (IP security) Security for transmission over IP networks The Internet Internal corporate IP networks IP packets sent over public switched data networks (PSDN). Local Network. Local Network. Internet. IPsec. Why do we need IPsec? IP has no security - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: IPsec

IPsec• IPsec (IP security)

• Security for transmission over IP networks– The Internet

– Internal corporate IP networks

– IP packets sent over public switched data networks (PSDN)

LocalNetwork

Internet LocalNetwork

Page 2: IPsec

IPsec• Why do we need IPsec?

– IP has no security– Add security to create a virtual private

network (VPN) (Chapter 9) to give secure communication over the Internet or another IP network

LocalNetwork

Internet LocalNetwork

Page 3: IPsec

IPsec

• Genesis– Being created by the Internet Engineering Task

Force– For both IP version 4 and IP version 6

Page 4: IPsec

IPsec• Two Modes of operation

• Tunnel Mode– IPsec server at each site

– Secures messages going through the Internet

LocalNetwork

Internet LocalNetwork

Secure Communication

IPsecServer

Page 5: IPsec

IPsec• Tunnel Mode

– Hosts operate in their usual way• Tunnel mode IPsec is transparent to the hosts

– No security within the site networks

LocalNetwork

Internet LocalNetwork

Secure Communication

IPsecServer

Page 6: IPsec

IPsec• Two Modes of operation

• Transport Mode– End-to-end security between the hosts– Security within site networks as well – Requires hosts to implement IPsec

LocalNetwork

Internet LocalNetwork

Secure Communication

Page 7: IPsec

IPsec

• Transport Mode– Adds a security header to IP packet– After the main IP header– Source and destination addresses of hosts can

be learned by interceptor– Only the original data field is protected

ProtectedOriginal Data Field

OriginalIP Header

TransportSecurityHeader

Page 8: IPsec

IPsec• Tunnel Mode

– Adds a security header before the original IP header

– Has IP addresses of the source and destination IPsec servers only, not those of the source and destination hosts

– Protects the main IP header

ProtectedOriginal Data Field

ProtectedOriginal

IP Header

TunnelSecurityHeader

Page 9: IPsec

IPsec• Can combine the two modes

– Transport mode for end-to-end security– Plus tunnel mode to hide the IP addresses of

the source and destination hosts during passage through the Internet

LocalNetwork

Internet LocalNetwork

Tunnel Mode Transport Mode

Page 10: IPsec

IPsec

• Two forms of protection• Encapsulating Security Protocol (ESP) security

provides confidentiality as well as authentication• Authentication Header (AH) security provides

authentication but not confidentiality– Useful where encryption is forbidden by law

– Provides slightly better authentication by providing authentication over a slightly larger part of the message, but this is rarely decisive

Page 11: IPsec

IPsec

• Modes and protection methods can be applied in any combination

Tunnel Mode

Transport Mode

ESP Supported Supported

AH Supported Supported

Page 12: IPsec

IPsec• Security Associations (SAs) are agreements

between two hosts or two IPsec servers, depending on the mode

• “Contracts” for how security will be performed

• Negotiated

• Governs subsequent transmissionsHost A Host B

NegotiateSecurity Association

Page 13: IPsec

IPsec• Security Associations (SAs) can be

asymmetrical– Different strengths in the two directions– For instance, clients and servers may have

different security needs

Host A Host B

SA for messagesFrom A to B

SA for messagesFrom B to A

Page 14: IPsec

IPsecPolicies may limit what SAs can be

negotiated– To ensure that adequately strong SAs for the

organization’s threats– Gives uniformity to negotiation decisions

Host A Host B

Security AssociationNegotiations Limited

By Policies

Page 15: IPsec

IPsec

• First, two parties negotiate IKE (Internet Key Exchange) Security Associations– IKE is not IPsec-specific– Can be used in other security protocols

Host A Host BCommunication

Governed byIKE SA

Page 16: IPsec

IPsec

• Under the protection of communication governed by this IKE SA, negotiate IPsec-specific security associations

Host A Host BCommunication

Governed byIKE SA

IPsec SA Negotiation

Page 17: IPsec

IPsec• Process of Creating IKE SAs (and other SAs)

– Negotiate security parameters within policy limitations

– Authenticate the parties using SA-agreed methods

– Exchange a symmetric session key using SA-agreed method

– Communicate securely with confidentiality, message-by-message authentication, and message integrity using SA-agreed method

Page 18: IPsec

IPsec

• IPsec has mandatory security algorithms

– Uses them as defaults if no other algorithm is negotiated

– Other algorithms may be negotiated

– But these mandatory algorithms MUST be supported

Page 19: IPsec

IPsec

• Diffie-Hellman Key Agreement– To agree upon a symmetric session key to be

used for confidentiality during this session– Also does authentication (not discussed)

Party A Party B

Page 20: IPsec

IPsec

• Diffie-Hellman Key Agreement– Each party sends the other a nonce (random

number)– The nonces will almost certainly be different – Nonces are not sent confidentially

Party A Party BNonce B

Nonce A

Page 21: IPsec

IPsec• Diffie-Hellman Key Agreement

– From the different nonces, each party will be able to compute the same symmetric session key for subsequent use

– No exchange of the key; instead, agreement on the key

Party A Party B

Symmetric Key Symmetric KeyFrom nonces,

independently computesame symmetric

session key

Page 22: IPsec

IPsec

• Mandatory algorithm for confidentiality is DES-CBC– DES with Cipher Block Chaining– An extension of DES (Data Encryption

Standard)– Straight DES always gives the same ciphertext

for the same plaintext and key– This allows certain types of attacks to guess

passwords

Page 23: IPsec

IPsec• DES-CBC (DES Cipher Block Chaining)

– DES works in blocks of 64 bits– DES-CBC begins with 64-bit plaintext to be

encrypted– Combines with the ciphertext output from the

previous block (cipher block chaining)

PlaintextBlock

PreviousCiphertext

Block

BlockTo be

Encrypted+

CipherBlock

Chaining

Page 24: IPsec

IPsec

• DES-CBC– Encrypts the plaintext block plus previous

ciphertext block to give ciphertext for the current block

– This gives different ciphertexts for the same plaintext and key on different occasions

BlockTo be

Encrypted

CiphertextFor Block

DES Encryption

Page 25: IPsec

IPsec

• Adding Plaintext and Ciphertext together in DES-CBC– The bits are XORed– The result is 1 if one bit (but not both) is 1

• 1 XOR 0 = 1• 0 XOR 1 = 1

– The result is 0 if both bits are 1 or 0• 1 XOR 1 = 0• 0 XOR 0 = 0

Page 26: IPsec

IPsec

• Adding Plaintext and Ciphertext together in DES-CBC– The bits are XORed– If the ciphertext is 111000 …– And the plaintext is 101010 …– The result is 010010 …

Page 27: IPsec

IPsec

• HMAC– key-Hashed Message Authentication Code – Mandatory IKE message-by-message

authentication and message integrity algorithm– Not a digital signature– HMAC does not use public key encryption– So it is faster than digital signature

authentication, which uses public key encryption

Page 28: IPsec

IPsec• HMAC

– Begins with original plaintext– Adds a secret HMAC key that only the

communicating partners know• It is a shared secret

• Usually different from the symmetric key used to send the entire message confidentiality

OriginalPlaintext

HMACKey

Page 29: IPsec

IPsec

• HMAC– Hashes the combination with MD5 or SHA1– This gives the HMAC– Get different HMACs with different HMAC

keys

OriginalPlaintext

HMACKey

HMACHashing

Page 30: IPsec

IPsec

• HMAC– The HMAC is added to the original plaintext– Gives authentication and message integrity– HMAC is similar to digital signature– However, hashes instead of using public key

encryption, so processing is faster

OriginalPlaintext

HMAC

Page 31: IPsec

IPsec• HMAC

– Receiver again hashes plaintext message plus shared secret HMAC key

– If the same as transmitted HMAC, sender is authenticated because the sender knows the shared secret HMAC key

Transmitted OriginalPlaintext

TransmittedHMAC

HMACKey

ComputedHMAC

HashingTransmitted OriginalPlaintext

Page 32: IPsec

IPsec

• IPsec only uses symmetric key encryption and hashing, which are very fast

• Avoids public key encryption, which is very slow– Diffie-Hellman key exchange instead of sending

session key encrypted with receiver’s public key

– HMAC instead of digital signatures

• This allows IPsec to be fairly fast, reducing host or IPsec security server costs