IPsec IKE CS 470 Introduction to Applied Cryptography

  • Slides: 18
Download presentation
IPsec – IKE CS 470 Introduction to Applied Cryptography Instructor: Ali Aydin Selcuk CS

IPsec – IKE CS 470 Introduction to Applied Cryptography Instructor: Ali Aydin Selcuk CS 470, A. Selcuk IPsec – IKE 1

History of IKE • Early contenders: – Photuris: Authenticated DH with cookies & identity

History of IKE • Early contenders: – Photuris: Authenticated DH with cookies & identity hiding – SKIP: Auth. DH with long-term exponents • ISAKMP: – A protocol specifying only payload formats & exchanges (i. e. , an empty protocol) – Adopted by the IPsec working group • Oakley: Modified Photuris; can work with ISAKMP • IKE: A particular Oakley-ISAKMP combination CS 470, A. Selcuk IPsec – IKE 2

Photuris CA CA, CB, crypto offered CA, CB, gb mod p Bob Alice CA,

Photuris CA CA, CB, crypto offered CA, CB, gb mod p Bob Alice CA, CB, ga mod p, crypto selected (K = gab mod p) CA, CB, K{“Alice”, signature on previous messages} CA, CB, K{“Bob”, signature on previous messages} CA: Alice’s cookie; for connection ID CB: Bob’s cookie; against Do. S CS 470, A. Selcuk IPsec – IKE 3

Photuris – Features • Do. S protection by cookies (note: CB can be stateless)

Photuris – Features • Do. S protection by cookies (note: CB can be stateless) • Authentication & integrity protection of the messages by a combined signature at the last rounds • Identity hiding from passive attackers (How? ) CS 470, A. Selcuk IPsec – IKE 4

IKE/ISAKMP Phases Phase 1: – does authenticated DH, establishes session key & “ISAKMP SA”

IKE/ISAKMP Phases Phase 1: – does authenticated DH, establishes session key & “ISAKMP SA” – two possible modes: Main & Aggressive – two keys are derived from the session key: SKEYID_e: to encrypt Phase 2 messages SKEYID_a: to authenticate Phase 2 messages Phase 2: – IPsec SA & session key established; messages encrypted & authenticated with Phase 1 keys – Additional DH exchange is optional (for PFS) CS 470, A. Selcuk IPsec – IKE 5

Phase 1 Exchange Two possible modes: – Main mode: 6 rounds; provides identity hiding

Phase 1 Exchange Two possible modes: – Main mode: 6 rounds; provides identity hiding – Aggressive mode: 3 rounds Types of authentication: – MAC with pre-shared secret key – digital signatures – public key encryption • original: all public key encryption • revised: public + secret key encryption (Each type has its benefits; but is it worth the complexity? ) CS 470, A. Selcuk IPsec – IKE 6

Phase 1 – Main Mode (generic) crypto offered crypto selected gb mod p Bob

Phase 1 – Main Mode (generic) crypto offered crypto selected gb mod p Bob Alice ga mod p (K = gab mod p) K{“Alice”, proof I’m Alice} K{“Bob”, proof I’m Bob} CS 470, A. Selcuk IPsec – IKE 7

Phase 1 – Aggressive Mode (generic) gb mod p, crypto selected, proof I’m Bob

Phase 1 – Aggressive Mode (generic) gb mod p, crypto selected, proof I’m Bob Alice ga mod p, “Alice”, crypto offered proof I’m Alice CS 470, A. Selcuk IPsec – IKE 8

Phase 1 Issues & Problems Crypto parameters: Alice presents all algorithm combinations she can

Phase 1 Issues & Problems Crypto parameters: Alice presents all algorithm combinations she can support (may be too many combinations) Authentication: – certain fields (why not all? !) of the protocol messages are hashed & signed/encrypted in the final rounds – not included: Bob’s accepted parameters (problematic) Cookies & Statelessness: – Cookie protection: similar to Photuris cookies – Bob is no longer stateless (problematic) since “crypto offered” must be remembered from message 1. CS 470, A. Selcuk IPsec – IKE 9

Phase 1 Issues (cont’d) Session Keys: – 2 session keys (1 for enc. &

Phase 1 Issues (cont’d) Session Keys: – 2 session keys (1 for enc. & 1 for auth. ) are generated. – Better to generate 4 keys; 2 for each direction. (may be subject to reflection attack) Complexity: – 8 different protocols are defined (2 modes, each with 4 types of authentication) – Unnecessarily flexible and complex CS 470, A. Selcuk IPsec – IKE 10

Phase 2 Exchange • Establishes IPsec SA & session key • Runs over the

Phase 2 Exchange • Establishes IPsec SA & session key • Runs over the IKE SA established in Phase 1. (message are encrypted/authenticated with Phase 1 keys) • Key generation: based on Phase 1 key, SPI, nonces. • DH exchange: Optional (for PFS). • IPsec Traffic Selector: Established optionally. Specifies what traffic is acceptable. (e. g. , What port numbers are allowed to use this SA. ) CS 470, A. Selcuk IPsec – IKE 11

Phase 2 Phase 1 SA X, Y, CPA, SPIB, nonce. B, [traffic], [gb mod

Phase 2 Phase 1 SA X, Y, CPA, SPIB, nonce. B, [traffic], [gb mod p] Bob Alice X, Y, CP, SPIA, nonce. A, [traffic], [ga mod p] X, Y, ack • X: pair of cookies generated in Phase 1 • Y: session identifier • traffic: IPsec traffic selector (optional) CS 470, A. Selcuk IPsec – IKE 12

IKEv 2 Protocol Initiated by Perlman & Kaufman, with the aims of • simplifying

IKEv 2 Protocol Initiated by Perlman & Kaufman, with the aims of • simplifying IKEv 1 • fixing the bugs • fixing the ambiguities • while remaining as close to IKEv 1 as possible. (“no gratuitous changes”) CS 470, A. Selcuk IPsec – IKE 13

IKEv 2 – Main Features • Only one mode of authentication: Public key signatures.

IKEv 2 – Main Features • Only one mode of authentication: Public key signatures. • IKE SA + IPsec SA are established in the same protocol, in 4 messages. (~ Phase 1) • Additional child SAs, if needed, are established in 2 messages. (~ Phase 2) • Do. S protection optional, via cookies (stateless). • Crypto negotiation is simplified – support for “suites” – ability to say “any of these enc. , with any of these hash. . . ” CS 470, A. Selcuk IPsec – IKE 14

IKEv 2 – The Exchange Protocol ga mod p, crypto offered, n. A, [certreq]

IKEv 2 – The Exchange Protocol ga mod p, crypto offered, n. A, [certreq] K = f(nonces, SPIs, gab mod p) K{“Alice”, sign on 1/2 msgs, [cert], child} Bob Alice gb mod p, crypto selected, n. B, [certreq] K{“Bob”, sign on 1/2 msgs, [cert], child} • Bob can optionally refuse the first message and require return of a cookie. • Adds extra 2 messages. CS 470, A. Selcuk IPsec – IKE 15

IKEv 2 – The Exchange Protocol (cont’d) • Do. S protection: Optional; by Bob

IKEv 2 – The Exchange Protocol (cont’d) • Do. S protection: Optional; by Bob responding the first message with a (stateless) cookie. • Originally, designed with 3 rounds. Later 4 rounds is agreed on: – Initiator needs a 4 th message anyway to know when to start the transmission. – Extra msgs for cookie exchange can be incorporated into 4 msgs, if Alice repeats msg. 1 info in msg. 3 • Preserves identity hiding from passive attackers. CS 470, A. Selcuk IPsec – IKE 16

IKEv 2 – Child SA Creation proposal, nonce, [gb mod p], TS Bob Alice

IKEv 2 – Child SA Creation proposal, nonce, [gb mod p], TS Bob Alice proposal, nonce, [ga mod p], TS • proposal: crypto suites, SPI, protocol (ESP, AH, IP compression) • TS: Traffic selector • Derived keys: Function of IKE keying material, nonces of this exchange, plus optional DH output. CS 470, A. Selcuk IPsec – IKE 17

Other IKEv 2 Features Reliability: – All messages are request/response. – Initiator is responsible

Other IKEv 2 Features Reliability: – All messages are request/response. – Initiator is responsible for retransmission if it doesn’t receive a response. Traffic selector negotiation: – IKEv 1: Responder can just say yes/no. – IKEv 2: Negotiation ability added. Rekeying: – Either side can rekey at any time. – Rekeyed IKE-SA inherits all the child-SAs. CS 470, A. Selcuk IPsec – IKE 18