idnits 2.17.1 draft-ietf-ipsec-isakmp-oakley-06.txt: ** The Abstract section seems to be numbered Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- ** Cannot find the required boilerplate sections (Copyright, IPR, etc.) in this document. Expected boilerplate is as follows today (2024-04-24) according to https://trustee.ietf.org/license-info : IETF Trust Legal Provisions of 28-dec-2009, Section 6.a: This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79. IETF Trust Legal Provisions of 28-dec-2009, Section 6.b(i), paragraph 2: Copyright (c) 2024 IETF Trust and the persons identified as the document authors. All rights reserved. IETF Trust Legal Provisions of 28-dec-2009, Section 6.b(i), paragraph 3: This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (https://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- ** Missing expiration date. The document expiration date should appear on the first and last page. ** The document seems to lack a 1id_guidelines paragraph about Internet-Drafts being working documents. ** The document seems to lack a 1id_guidelines paragraph about 6 months document validity. ** The document seems to lack a 1id_guidelines paragraph about the list of current Internet-Drafts. ** The document seems to lack a 1id_guidelines paragraph about the list of Shadow Directories. ** The document is more than 15 pages and seems to lack a Table of Contents. == No 'Intended status' indicated for this document; assuming Proposed Standard Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- ** The document seems to lack an Introduction section. ** The document seems to lack separate sections for Informative/Normative References. All references will be assumed normative when checking for downward references. ** The abstract seems to contain references ([MSST98], [Kra96], [Orm96]), which it shouldn't. Please replace those with straight textual mentions of the documents in question. Miscellaneous warnings: ---------------------------------------------------------------------------- == Line 1445 has weird spacing: '... length attri...' == The document seems to lack the recommended RFC 2119 boilerplate, even if it appears to use RFC 2119 keywords. (The document does seem to have the reference to RFC 2119 which the ID-Checklist requires). == The expression 'MAY NOT', while looking like RFC 2119 requirements text, is not defined in RFC 2119, and should not be used. Consider using 'MUST NOT' instead (if that is what you mean). Found 'MAY NOT' in this paragraph: Similarly, Aggressive Mode is an instantiation of the ISAKMP Aggressive Exchange. The first two messages negotiate policy, exchange Diffie-Hellman public values and ancillary data necessary for the exchange, and identities. In addition the second message authenticates the responder. The third message authenticates the initiator and provides a proof of participation in the exchange. The XCHG for Aggressive Mode is ISAKMP Aggressive. The final message MAY NOT be sent under protection of the ISAKMP SA allowing each party to postpone exponentiation, if desired, until negotiation of this exchange is complete. The graphic depictions of Aggressive Mode show the final payload in the clear; it need not be. -- The document seems to lack a disclaimer for pre-RFC5378 work, but may have content which was first submitted before 10 November 2008. If you have contacted all the original authors and they are all willing to grant the BCP78 rights to the IETF Trust, then this is fine, and you can ignore this comment. If not, you may need to add the pre-RFC5378 disclaimer. (See the Legal Provisions document at https://trustee.ietf.org/license-info for more information.) -- The document date (February 1998) is 9565 days in the past. Is this intentional? Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) == Missing Reference: 'Pip97' is mentioned on line 771, but not defined == Missing Reference: 'P' is mentioned on line 1519, but not defined == Unused Reference: 'Acm97' is defined on line 1381, but no explicit reference was found in the text == Unused Reference: 'Pip98' is defined on line 1401, but no explicit reference was found in the text ** Downref: Normative reference to an Informational RFC: RFC 2144 (ref. 'Acm97') ** Downref: Normative reference to an Informational RFC: RFC 2104 (ref. 'KBC96') -- Possible downref: Non-RFC (?) normative reference: ref. 'Kra96' ** Downref: Normative reference to an Historic draft: draft-ietf-ipsec-isakmp (ref. 'MSST98') -- Unexpected draft version: The latest known version of draft-ietf-ipsec-oakley is -01, but you're referring to -02. ** Downref: Normative reference to an Informational draft: draft-ietf-ipsec-oakley (ref. 'Orm96') == Outdated reference: A later version (-09) exists of draft-ietf-ipsec-ipsec-doi-07 ** Downref: Normative reference to an Historic draft: draft-ietf-ipsec-ipsec-doi (ref. 'Pip98') -- Possible downref: Non-RFC (?) normative reference: ref. 'Sch96' Summary: 16 errors (**), 0 flaws (~~), 9 warnings (==), 5 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 1 IPSEC Working Group D. Harkins, D. Carrel 2 INTERNET-DRAFT cisco Systems 3 draft-ietf-ipsec-isakmp-oakley-06.txt February 1998 5 The Internet Key Exchange (IKE) 6 8 Status of this Memo 10 This document is an Internet Draft. Internet Drafts are working 11 documents of the Internet Engineering Task Force (IETF), its areas, 12 and working groups. Note that other groups may also distribute 13 working documents as Internet Drafts. 15 Internet Drafts are draft documents valid for a maximum of six months 16 and may be updated, replaced, or obsoleted by other documents at any 17 time. It is inapproporiate to use Internet Drafts as reference 18 material or to cite them other than as "work in progress." 20 To learn the current status of any Internet Draft, please check the 21 "1id-abstracts.txt" listing contained in the Internet Drafts Shadow 22 Directories on ftp.is.co.za (Africa), nic.nordu.net (Europe), 23 munnari.oz.au (Australia), ds.internic.net (US East Coast), or 24 ftp.isi.edu (US West Coast). 26 Table Of Contents 28 1 Abstract 29 2 Discussion 30 3 Terms and Definitions 31 3.1 Requirements Terminology 32 3.2 Notation 33 3.3 Perfect Forward Secrecty 34 3.4 Security Association 35 4 Introduction 36 5 Exchanges 37 5.1 Authentication with Digital Signatures 38 5.2 Authentication with Public Key Encryption 39 5.3 A Revised method of Authentication with Public Key Encryption 40 5.4 Authentication with a Pre-Shared Key 41 5.5 Quick Mode 42 5.6 New Group Mode 43 5.7 ISAKMP Informational Exchanges 44 6 Oakley Groups 45 6.1 First Oakley Group 46 6.2 Second Oakley Group 47 6.3 Third Oakley Group 48 6.4 Fourth Oakley Group 49 7 Payload Explosion of Complete Exchange 50 7.1 Phase 1 with Main Mode 51 7.2 Phase 2 with Quick Mode 52 8 Perfect Forward Secrecy Example 53 9 Implementation Hints 54 10 Security Considerations 55 11 IANA Considerations 56 12 Acknowledgments 57 13 References 58 Appendix A 59 Appendix B 61 1. Abstract 63 [MSST98] (ISAKMP) provides a framework for authentication and key 64 exchange but does not define them. ISAKMP is designed to be key 65 exchange independant; that is, it is designed to support many 66 different key exchanges. 68 [Orm96] (Oakley) describes a series of key exchanges-- called 69 "modes"-- and details the services provided by each (e.g. perfect 70 forward secrecy for keys, identity protection, and authentication). 72 [Kra96] (SKEME) describes a versatile key exchange technique which 73 provides anonymity, repudiability, and quick key refreshment. 75 This document describes a protocol using part of Oakley and part of 76 SKEME in conjunction with ISAKMP to obtain authenticated keying 77 material for use with ISAKMP, and for other security associations 78 such as AH and ESP for the IETF IPsec DOI. 80 2. Discussion 82 This draft describes a hybrid protocol. The purpose is to negotiate, 83 and provide authenticated keying material for, security associations 84 in a protected manner. 86 Processes which implement this draft can be used for negotiating 87 virtual private networks (VPNs) and also for providing a remote user 88 from a remote site (whose IP address need not be known beforehand) 89 access to a secure host or network. 91 Client negotiation is supported. Client mode is where the 92 negotiating parties are not the endpoints for which security 93 association negotiation is taking place. When used in client mode, 94 the identities of the end parties remain hidden. 96 This does not implement the entire Oakley protocol, but only a subset 97 necessary to satisfy its goals. It does not claim conformance or 98 compliance with the entire Oakley protocol nor is it dependant in any 99 way on the Oakley protocol. 101 Likewise, this does not implement the entire SKEME protocol, but only 102 the method of public key encryption for authentication and its 103 concept of fast re-keying using an exchange of nonces. This protocol 104 is not dependant in any way on the SKEME protocol. 106 3. Terms and Definitions 108 3.1 Requirements Terminology 110 Keywords "MUST", "MUST NOT", "REQUIRED", "SHOULD", "SHOULD NOT" and 111 "MAY" that appear in this document are to be interpreted as described 112 in [Bra97]. 114 3.2 Notation 116 The following notation is used throughout this draft. 118 HDR is an ISAKMP header whose exchange type is the mode. When 119 writen as HDR* it indicates payload encryption. 121 SA is an SA negotiation payload with one or more proposals. An 122 initiator MAY provide multiple proposals for negotiation; a 123 responder MUST reply with only one. 125

_b indicates the body of payload

-- the ISAKMP generic 126 payload is not included. 128 SAi_b is the entire body of the SA payload (minus the ISAKMP 129 generic header)-- i.e. the DOI, situation, all proposals and all 130 transforms offered by the Initiator. 132 CKY-I and CKY-R are the Initiator's cookie and the Responder's 133 cookie, respectively, from the ISAKMP header. 135 g^xi and g^xr are the Diffie-Hellman public values of the 136 initiator and responder respectively. 138 g^xy is the Diffie-Hellman shared secret. 140 KE is the key exchange payload which contains the public 141 information exchanged in a Diffie-Hellman exchange. There is no 142 particular encoding used for the data of a KE payload. 144 Nx is the nonce payload; x can be: i or r for the ISAKMP initiator 145 and responder respectively. 147 IDx is the identity payload for "x". x can be: "ii" or "ir" for 148 the ISAKMP initiator and responder respectively during phase one 149 negotiation; or "ui" or "ur" for the user initiator and responder 150 respectively during phase two. The ID payload format for the 151 Internet DOI is defined in [Pip97]. 153 SIG is the signature payload. The data to sign is exchange- 154 specific. 156 CERT is the certificate payload. 158 HASH (and any derivitive such as HASH(2) or HASH_I) is the hash 159 payload. The contents of the hash are specific to the 160 authentication method. 162 prf(key, msg) is the keyed pseudo-random function-- often a keyed 163 hash function-- used to generate a deterministic output that 164 appears pseudo-random. prf's are used both for key derivations 165 and for authentication (i.e. as a keyed MAC). (See [KBC96]). 167 SKEYID is a string derived from secret material known only to the 168 active players in the exchange. 170 SKEYID_e is the keying material used by the ISAKMP SA to protect 171 the confidentiality of its messages. 173 SKEYID_a is the keying material used by the ISAKMP SA to 174 authenticate its messages. 176 SKEYID_d is the keying material used to derive keys for non-ISAKMP 177 security associations. 179 y indicates that "x" is encrypted with the key "y". 181 --> signifies "initiator to responder" communication (requests). 183 <-- signifies "responder to initiator" communication (replies). 185 | signifies concatenation of information-- e.g. X | Y is the 186 concatentation of X with Y. 188 [x] indicates that x is optional. 190 Message encryption (when noted by a '*' after the ISAKMP header) MUST 191 begin immediately after the ISAKMP header. When communication is 192 protected, all payloads following the ISAKMP header MUST be 193 encrypted. Encryption keys are generated from SKEYID_e in a manner 194 that is defined for each algorithm. 196 3.3 Perfect Forward Secrecy 198 When used in the draft Perfect Forward Secrecy (PFS) refers to the 199 notion that compromise of a single key will permit access to only 200 data protected by a single key. For PFS to exist the key used to 201 protect transmission of data MUST NOT be used to derive any 202 additional keys, and if the key used to protect transmission of data 203 was derived from some other keying material, that material MUST NOT 204 be used to derive any more keys. 206 Perfect Forward Secrecy for both keys and identities is provided in 207 this protocol. (Sections 5.5 and 8). 209 3.4 Security Association 211 A security association (SA) is a set of policy and key(s) used to 212 protect information. The ISAKMP SA is the shared policy and key(s) 213 used by the negotiating peers in this protocol to protect their 214 communication. 216 4. Introduction 218 Oakley and SKEME each define a method to establish an authenticated 219 key exchange. This includes payloads construction, the information 220 payloads carry, the order in which they are processed and how they 221 are used. 223 While Oakley defines "modes", ISAKMP defines "phases". The 224 relationship between the two is very straightforward and IKE presents 225 different exchanges as modes which operate in one of two phases. 227 Phase 1 is where the two ISAKMP peers establish a secure, 228 authenticated channel with which to communicate. This is called the 229 ISAKMP Security Association (SA). "Main Mode" and "Aggressive Mode" 230 each accomplish a phase 1 exchange. "Main Mode" and "Aggressive Mode" 231 MUST ONLY be used in phase 1. 233 Phase 2 is where Security Associations are negotiated on behalf of 234 services such as IPsec or any other service which needs key material 235 and/or parameter negotiation. "Quick Mode" accomplishes a phase 2 236 exchange. "Quick Mode" MUST ONLY be used in phase 2. 238 "New Group Mode" is not really a phase 1 or phase 2. It follows 239 phase 1, but serves to establish a new group which can be used in 240 future negotiations. "New Group Mode" MUST ONLY be used after phase 241 1. 243 The ISAKMP SA is bi-directional. That is, once established, either 244 party may initiate Quick Mode, Informational, and New Group Mode 245 Exchanges. Per the base ISAKMP document, the ISAKMP SA is identified 246 by the Initiator's cookie followed by the Responder's cookie-- the 247 role of each party in the phase 1 exchange dictates which cookie is 248 the Initiator's. The cookie order established by the phase 1 exchange 249 continues to identify the ISAKMP SA regardless of the direction the 250 Quick Mode, Informational, or New Group exchange. In other words, the 251 cookies MUST NOT swap places when the direction of the ISAKMP SA 252 changes. 254 With the use of ISAKMP phases, an implementation can accomplish very 255 fast keying when necessary. A single phase 1 negotiation may be used 256 for more than one phase 2 negotiation. Additionally a single phase 2 257 negotiation can request multiple Security Associations. With these 258 optimizations, an implementation can see less than one round trip per 259 SA as well as less than one DH exponentiation per SA. "Main Mode" 260 for phase 1 provides identity protection. When identity protection 261 is not needed, "Aggressive Mode" can be used to reduce round trips 262 even further. Developer hints for doing these optimizations are 263 included below. It should also be noted that using public key 264 encryption to authenticate an Aggressive Mode exchange will still 265 provide identity protection. 267 This protocol does not define its own DOI per se. The ISAKMP SA, 268 established in phase 1, MAY use the DOI and situation from a non- 269 ISAKMP service (such as the IETF IPSec DOI [Pip97]). In this case an 270 implementation MAY choose to restrict use of the ISAKMP SA for 271 establishment of SAs for services of the same DOI. Alternately, an 272 ISAKMP SA MAY be established with the value zero in both the DOI and 273 situation (see [MSST98] for a description of these fields) and in 274 this case implementations will be free to establish security services 275 for any defined DOI using this ISAKMP SA. If a DOI of zero is used 276 for establishment of a phase 1 SA, the syntax of the identity 277 payloads used in phase 1 is that defined in [MSST98] and not from any 278 DOI-- e.g. [Pip97]-- which may further expand the syntax and 279 semantics of identities. 281 The following attributes are used by IKE and are negotiated as part 282 of the ISAKMP Security Association. (These attributes pertain only 283 to the ISAKMP Security Association and not to any Security 284 Associations that ISAKMP may be negotiating on behalf of other 285 services.) 287 - encryption algorithm (e.g. DES, IDEA, Blowfish). 289 - hash algorithm (e.g. MD5, SHA) 291 - authentication method (e.g. DSS sig, RSA sig, RSA encryption, 292 pre-shared key) 294 - information about a group over which to do Diffie-Hellman. 296 All of these attributes are mandatory and MUST be negotiated. In 297 addition, it is possible to optionally negotiate a psuedo-random 298 function ("prf"). (There are currently no negotiable pseudo-random 299 functions defined in this document. Private use attribute values can 300 be used for prf negotiation between consenting parties). If a "prf" 301 is not negotiation, the HMAC (see [KBC96]) version of the negotiated 302 hash algorithm is used as a pseudo-random function. Other non- 303 mandatory attributes are described in Appendix A. The selected hash 304 algorithm MUST support both native and HMAC modes. 306 The Diffie-Hellman group MUST be either specified using a defined 307 group description (section 6) or by defining all attributes of a 308 group (section 5.6). Group attributes (such as group type or prime-- 309 see Appendix A) MUST NOT be offered in conjunction with a previously 310 defined group (either a reserved group description or a private use 311 description that is established after conclusion of a New Group Mode 312 exchange). 314 IKE implementations MUST support the following attribute values: 316 - DES-CBC with a weak, and semi-weak, key check (weak and semi- 317 weak keys are referenced in [Sch96] and listed in Appendix A). The 318 key is derived according to Appendix B. 320 - MD5 and SHA. 322 - Authentication via pre-shared keys. The Digital Signature 323 Standard SHOULD be supported; RSA-- both signatures and 324 authentication with public key encryption-- SHOULD be supported. 326 - MODP over the default group (see below). ECP and EC2N groups MAY 327 be supported. 329 The IKE modes described here MUST be implemented whenever the IETF 330 IPsec DOI [Pip97] is implemented. Other DOIs MAY use the modes 331 described here. 333 5. Exchanges 335 There are two basic methods used to establish an authenticated key 336 exchange: Main Mode and Aggressive Mode. Each generates authenticated 337 keying material from an ephemeral Diffie-Hellman exchange. Main Mode 338 MUST be implemented; Aggressive Mode SHOULD be implemented. In 339 addition, Quick Mode MUST be implemented as a mechanism to generate 340 fresh keying material and negotiate non-ISAKMP security services. In 341 additon, New Group Mode SHOULD be implemented as a mechanism to 342 define private groups for Diffie-Hellman exchanges. Implementations 343 MUST NOT switch exchange types in the middle of an exchange. 345 Exchanges conform to standard ISAKMP [MSST98] payload syntax, 346 attribute encoding, timeouts and retransmits of messages, and 347 informational messages-- e.g a notify response is sent when, for 348 example, a proposal is unacceptable, or a signature verification or 349 decryption was unsuccessful, etc. 351 The SA payload MUST precede all other payloads in a phase 1 exchange. 352 Except where otherwise noted, there are no requirements for ISAKMP 353 payloads in any message to be in any particular order. 355 Main Mode is an instantiation of the ISAKMP Identity Protect 356 Exchange: The first two messages negotiate policy; the next two 357 exchange Diffie-Hellman public values and ancillary data (e.g. 358 nonces) necessary for the exchange; and the last two messages 359 authenticate the Diffie-Hellman Exchange. The authentication method 360 negotiated as part of the initial ISAKMP exchange influences the 361 composition of the payloads but not their purpose. The XCHG for Main 362 Mode is ISAKMP Identity Protect. 364 Similarly, Aggressive Mode is an instantiation of the ISAKMP 365 Aggressive Exchange. The first two messages negotiate policy, 366 exchange Diffie-Hellman public values and ancillary data necessary 367 for the exchange, and identities. In addition the second message 368 authenticates the responder. The third message authenticates the 369 initiator and provides a proof of participation in the exchange. The 370 XCHG for Aggressive Mode is ISAKMP Aggressive. The final message MAY 371 NOT be sent under protection of the ISAKMP SA allowing each party to 372 postpone exponentiation, if desired, until negotiation of this 373 exchange is complete. The graphic depictions of Aggressive Mode show 374 the final payload in the clear; it need not be. 376 Security Association negotiation is limited with Aggressive Mode. Due 377 to message construction requirements the group in which the Diffie- 378 Hellman exchange is performed cannot be negotiated. In addition, 379 different authentication methods may further constrain attribute 380 negotiation. For example, authentication with public key encryption 381 cannot be negotiated and when using the revised method of public key 382 encryption for authentication the cipher and hash cannot be 383 negotiated. For situations where the rich attribute negotiation 384 capabilities of IKE are required Main Mode may be required. 386 Quick Mode and New Group Mode have no analog in ISAKMP. The XCHG 387 values for Quick Mode and New Group Mode are defined in Appendix A. 389 Main Mode, Aggressive Mode, and Quick Mode do security association 390 negotiation. Security Association offers take the form of Tranform 391 Payload(s) encapsulated in Proposal Payload(s) encapsulated in 392 Security Association (SA) payload(s). If multiple offers are being 393 made for phase 1 exchanges (Main Mode and Aggressive Mode) they MUST 394 take the form of multiple Transform Payloads for a single Proposal 395 Payload in a single SA payload. To put it another way, for phase 1 396 exchanges there MUST NOT be multiple Proposal Payloads for a single 397 SA payload and there MUST NOT be multiple SA payloads. This document 398 does not proscribe such behavior on offers in phase 2 exchanges. 400 There is no limit on the number of offers the initiator may send to 401 the responder but conformant implementations MAY choose to limit the 402 number of offers it will inspect for performance reasons. 404 During security association negotiation, initiators present offers 405 for potential security associations to responders. Responders MUST 406 NOT modify attributes of any offer, attribute encoding excepted (see 407 Appendix A). If the initiator of an exchange notices that attribute 408 values have changed or attributes have been added or deleted from an 409 offer made, that response MUST be rejected. 411 Four different authentication methods are allowed with either Main 412 Mode or Aggressive Mode-- digital signature, two forms of 413 authentication with public key encryption, or pre-shared key. The 414 value SKEYID is computed seperately for each authentication method. 416 For signatures: SKEYID = prf(Ni_b | Nr_b, g^xy) 417 For public key encryption: SKEYID = prf(hash(Ni_b | Nr_b), CKY-I | 418 CKY-R) 419 For pre-shared keys: SKEYID = prf(pre-shared-key, Ni_b | 420 Nr_b) 422 The result of either Main Mode or Aggressive Mode is three groups of 423 authenticated keying material: 425 SKEYID_d = prf(SKEYID, g^xy | CKY-I | CKY-R | 0) 426 SKEYID_a = prf(SKEYID, SKEYID_d | g^xy | CKY-I | CKY-R | 1) 427 SKEYID_e = prf(SKEYID, SKEYID_a | g^xy | CKY-I | CKY-R | 2) 429 and agreed upon policy to protect further communications. The values 430 of 0, 1, and 2 above are represented by a single octet. The key used 431 for encryption is derived from SKEYID_e in an algorithm-specific 432 manner (see appendix B). 434 To authenticate either exchange the initiator of the protocol 435 generates HASH_I and the responder generates HASH_R where: 437 HASH_I = prf(SKEYID, g^xi | g^xr | CKY-I | CKY-R | SAi_b | IDii_b ) 438 HASH_R = prf(SKEYID, g^xr | g^xi | CKY-R | CKY-I | SAi_b | IDir_b ) 440 For authentication with digital signatures, HASH_I and HASH_R are 441 signed and verified; for authentication with either public key 442 encryption or pre-shared keys, HASH_I and HASH_R directly 443 authenticate the exchange. The entire ID payload (including ID type, 444 port, and protocol but excluding the generic header) is hashed into 445 both HASH_I and HASH_R. 447 As mentioned above, the negotiated authentication method influences 448 the content and use of messages for Phase 1 Modes, but not their 449 intent. When using public keys for authentication, the Phase 1 450 exchange can be accomplished either by using signatures or by using 451 public key encryption (if the algorithm supports it). Following are 452 Phase 1 exchanges with different authentication options. 454 5.1 IKE Phase 1 Authenticated With Signatures 456 Using signatures, the ancillary information exchanged during the 457 second roundtrip are nonces; the exchange is authenticated by signing 458 a mutually obtainable hash. Main Mode with signature authentication 459 is described as follows: 461 Initiator Responder 462 ---------- ----------- 463 HDR, SA --> 464 <-- HDR, SA 465 HDR, KE, Ni --> 466 <-- HDR, KE, Nr 467 HDR*, IDii, [ CERT, ] SIG_I --> 468 <-- HDR*, IDir, [ CERT, ] SIG_R 470 Aggressive mode with signatures in conjunction with ISAKMP is 471 described as follows: 473 Initiator Responder 474 ----------- ----------- 475 HDR, SA, KE, Ni, IDii --> 476 <-- HDR, SA, KE, Nr, IDir, 477 [ CERT, ] SIG_R 478 HDR, [ CERT, ] SIG_I --> 480 In both modes, the signed data, SIG_I or SIG_R, is the result of the 481 negotiated digital signature algorithm applied to HASH_I or HASH_R 482 respectively. 484 In general the signature will be over HASH_I and HASH_R as above 485 using the negotiated prf, or the HMAC version of the negotiated hash 486 function (if no prf is negotiated). However, this can be overridden 487 for construction of the signature if the signature algorithm is tied 488 to a particular hash algorithm (e.g. DSS is only defined with SHA's 489 160 bit output). In this case, the signature will be over HASH_I and 490 HASH_R as above, except using the HMAC version of the hash algorithm 491 associated with the signature method. The negotiated prf and hash 492 function would continue to be used for all other prescribed pseudo- 493 random functions. 495 Since the hash algorithm used is already known there is no need to 496 encode its OID into the signature. In addition, there is no binding 497 between the OIDs used for RSA signatures in PKCS #1 and those used in 498 this document. Therefore, RSA signatures MUST be encoded as a private 499 key encryption in PKCS #1 format. DSS signatures MUST be encoded as r 500 followed by s. 502 One or more certificate payloads MAY be optionally passed. 504 5.2 Phase 1 Authenticated With Public Key Encryption 506 Using public key encryption to authenticate the exchange, the 507 ancillary information exchanged is encrypted nonces. Each party's 508 ability to reconstruct a hash (proving that the other party decrypted 509 the nonce) authenticates the exchange. 511 In order to perform the public key encryption, the initiator must 512 already have the responder's public key. In the case where the 513 responder has multiple public keys, a hash of the certificate the 514 initiator is using to encrypt the ancillary information is passed as 515 part of the third message. In this way the responder can determine 516 which corresponding private key to use to decrypt the encrypted 517 payloads and identity protection is retained. 519 In addition to the nonce, the identities of the parties (IDii and 520 IDir) are also encrypted with the other party's public key. If the 521 authentication method is public key encryption, the nonce and 522 identity payloads MUST be encrypted with the public key of the other 523 party. Only the body of the payloads are encrypted, the payload 524 headers are left in the clear. 526 When using encrytion for authentication, Main Mode is defined as 527 follows. 529 Initiator Responder 530 ----------- ----------- 531 HDR, SA --> 532 <-- HDR, SA 533 HDR, KE, [ HASH(1), ] 534 PubKey_r, 535 PubKey_r --> 536 HDR, KE, PubKey_i, 537 <-- PubKey_i 538 HDR*, HASH_I --> 539 <-- HDR*, HASH_R 541 Aggressive Mode authenticated with encryption is described as 542 follows: 544 Initiator Responder 545 ----------- ----------- 546 HDR, SA, [ HASH(1),] KE, 547 Pubkey_r, 548 Pubkey_r --> 549 HDR, SA, KE, PubKey_i, 550 <-- PubKey_i, HASH_R 551 HDR, HASH_I --> 553 Where HASH(1) is a hash (using the negotiated hash function) of the 554 certificate which the initiator is using to encrypt the nonce and 555 identity. 557 RSA encryption MUST be encoded in PKCS #1 format. While only the body 558 of the ID and nonce payloads is encrypted, the encrypted data must be 559 preceded by a valid ISAKMP generic header. The payload length is the 560 length of the entire encrypted payload plus header. The PKCS #1 561 encoding allows for determination of the actual length of the 562 cleartext payload upon decryption. 564 Using encryption for authentication provides for a plausably deniable 565 exchange. There is no proof (as with a digital signature) that the 566 conversation ever took place since each party can completely 567 reconstruct both sides of the exchange. In addition, security is 568 added to secret generation since an attacker would have to 569 successfully break not only the Diffie-Hellman exchange but also both 570 RSA encryptions. This exchange was motivated by [Kra96]. 572 Note that, unlike other authentication methods, authentication with 573 public key encryption allows for identity protection with Aggressive 574 Mode. 576 5.3 Phase 1 Authenticated With a Revised Mode of Public Key Encryption 578 Authentication with Public Key Encryption has significant advantages 579 over authentication with signatures (see section 5.2 above). 580 Unfortunately, this is at the cost of 4 public key operations-- two 581 public key encryptions and two private key decryptions. This 582 authentication mode retains the advantages of authentication using 583 public key encryption but does so with half the public key 584 operations. 586 In this mode, the nonce is still encrypted using the public key of 587 the peer, however the peer's identity (and the certificate if it is 588 sent) is encrypted using the negotiated symmetric encryption 589 algorithm (from the SA payload) with a key derived from the nonce. 590 This solution adds minimal complexity and state yet saves two costly 591 public key operations on each side. In addition, the Key Exchange 592 payload is also encrypted using the same derived key. This provides 593 additional protection against cryptanalysis of the Diffie-Hellman 594 exchange. 596 As with the public key encryption method of authentication (section 597 5.2), a HASH payload may be sent to identify a certificate if the 598 responder has multiple certificates which contain useable public keys 599 (e.g. if the certificate is not for signatures only, either due to 600 certificate restrictions or algorithmic restrictions). If the HASH 601 payload is sent it MUST be the first payload of the second message 602 exchange and MUST be followed by the encrypted nonce. If the HASH 603 payload is not sent, the first payload of the second message exchange 604 MUST be the encrypted nonce. In addition, the initiator my optionally 605 send a certificate payload to provide the responder with a public key 606 with which to respond. 608 When using the revised encryption mode for authentication, Main Mode 609 is defined as follows. 611 Initiator Responder 612 ----------- ----------- 613 HDR, SA --> 614 <-- HDR, SA 615 HDR, [ HASH(1), ] 616 Pubkey_r, 617 Ke_i, 618 Ke_i, 619 [<Ke_i] --> 620 HDR, PubKey_i, 621 Ke_r, 622 <-- Ke_r, 623 HDR*, HASH_I --> 624 <-- HDR*, HASH_R 626 Aggressive Mode authenticated with the revised encryption method is 627 described as follows: 629 Initiator Responder 630 ----------- ----------- 631 HDR, SA, [ HASH(1),] 632 Pubkey_r, 633 Ke_i, Ke_i 634 [, Ke_i ] --> 635 HDR, SA, PubKey_i, 636 Ke_r, Ke_r, 637 <-- HASH_R 638 HDR, HASH_I --> 640 where HASH(1) is identical to section 5.2. Ke_i and Ke_r are keys to 641 the symmetric encryption algorithm negotiated in the SA payload 642 exchange. Only the body of the payloads are encrypted (in both public 643 key and symmetric operations), the generic payload headers are left 644 in the clear. The payload length includes that added to perform 645 encryption. 647 The symmetric cipher keys are derived from the decrypted nonces as 648 follows. First the values Ne_i and Ne_r are computed: 650 Ne_i = prf(Ni_b, CKY-I) 651 Ne_r = prf(Nr_b, CKY-R) 653 The keys Ke_i and Ke_r are then taken from Ne_i and Ne_r respectively 654 in the manner described in Appendix B used to derive symmetric keys 655 for use with the negotiated encryption algorithm. If the length of 656 the output of the negotiated prf is greater than or equal to the key 657 length requirements of the cipher, Ke_i and Ke_r are derived from the 658 most significant bits of Ne_i and Ne_r respectively. If the desired 659 length of Ke_i and Ke_r exceed the length of the output of the prf 660 the necessary number of bits is obtained by repeatedly feeding the 661 results of the prf back into itself and concatenating the result 662 until the necessary number has been achieved. For example, if the 663 negotiated encryption algorithm requires 320 bits of key and the 664 output of the prf is only 128 bits, Ke_i is the most significant 320 665 bits of K, where 667 K = K1 | K2 | K3 and 668 K1 = prf(Ne_i, 0) 669 K2 = prf(Ne_i, K1) 670 K3 = prf(Ne_i, K2) 672 For brevity, only derivation of Ke_i is shown; Ke_r is identical. The 673 length of the value 0 in the computation of K1 is a single octet. 674 Note that Ne_i, Ne_r, Ke_i, and Ke_r are all ephemeral and MUST be 675 discarded after use. 677 Save the requirements on the location of the optional HASH payload 678 and the mandatory nonce payload there are no further payload 679 requirements. All payloads-- in whatever order-- following the 680 encrypted nonce MUST be encrypted with Ke_i or Ke_r depending on the 681 direction. 683 If CBC mode is used for the symmetric encryption then the 684 initialization vectors (IVs) are set as follows. The IV for 685 encrypting the first payload following the nonce is set to 0 (zero). 686 The IV for subsequent payloads encrypted with the ephemeral symmetric 687 cipher key, Ke_i, is the last ciphertext block of the previous 688 payload. Encrypted payloads are padded up to the nearest block size. 689 All padding bytes, except for the last one, contain 0x00. The last 690 byte of the padding contains the number of the padding bytes used, 691 excluding the last one. Note that this means there will always be 692 padding. 694 5.4 Phase 1 Authenticated With a Pre-Shared Key 696 A key derived by some out-of-band mechanism may also be used to 697 authenticate the exchange. The actual establishment of this key is 698 out of the scope of this document. 700 When doing a pre-shared key authentication, Main Mode is defined as 701 follows: 703 Initiator Responder 705 ---------- ----------- 706 HDR, SA --> 707 <-- HDR, SA 708 HDR, KE, Ni --> 709 <-- HDR, KE, Nr 710 HDR*, IDii, HASH_I --> 711 <-- HDR*, IDir, HASH_R 713 Aggressive mode with a pre-shared key is described as follows: 715 Initiator Responder 716 ----------- ----------- 717 HDR, SA, KE, Ni, IDii --> 718 <-- HDR, SA, KE, Nr, IDir, HASH_R 719 HDR, HASH_I --> 721 When using pre-shared key authentication with Main Mode the key can 722 only be identified by the IP address of the peers since HASH_I must 723 be computed before the initiator has processed IDir. Aggressive Mode 724 allows for a wider range of identifiers of the pre-shared secret to 725 be used. In addition, Aggressive Mode allows two parties to maintain 726 multiple, different pre-shared keys and identify the correct one for 727 a particular exchange. 729 5.5 Phase 2 - Quick Mode 731 Quick Mode is not a complete exchange itself, but is used as part of 732 the ISAKMP SA negotiation process (phase 2) to derive keying material 733 and negotiate shared policy for non-ISAKMP SAs. The information 734 exchanged along with Quick Mode MUST be protected by the ISAKMP SA-- 735 i.e. all payloads except the ISAKMP header are encrypted. In Quick 736 Mode, a HASH payload MUST immediately follow the ISAKMP header and a 737 SA payload MUST immediately follow the HASH. This HASH authenticates 738 the message and also provides liveliness proofs. 740 Quick Mode is essentially a SA negotiation and an exchange of nonces 741 that provides replay protection. The nonces are used to generate 742 fresh key material and prevent replay attacks from generating bogus 743 security associations. An optional Key Exchange payload can be 744 exchanged to allow for an additional Diffie-Hellman exchange and 745 exponentiation per Quick Mode. While use of the key exchange payload 746 with Quick Mode is optional it MUST be supported. 748 Base Quick Mode (without the KE payload) refreshes the keying 749 material derived from the exponentiation in phase 1. This does not 750 provide PFS. Using the optional KE payload, an additional 751 exponentiation is performed and PFS is provided for the keying 752 material. 754 If ISAKMP is acting as a client negotiator on behalf of another party 755 the identities of the parties MUST be passed as IDci and then IDcr. 756 Local policy will dictate whether the proposals are acceptible for 757 the identities specified. If IDs are not exchanged, the negotiation 758 MAY assumed to be done on behalf of each ISAKMP peer. If an ID range 759 (see Appendix A of [Pip97]) is not acceptable (for example, the 760 specified subnet is too large) a INVALID-ID-INFORMATION notify 761 message (18) followed by an acceptible ID range, in an ID payload, 762 SHOULD be sent. 764 The client identities are used to identify and direct traffic to the 765 appropriate tunnel in cases where multiple tunnels exist between two 766 peers and also to allow for unique and shared SAs with different 767 granularities. 769 All offers made during a Quick Mode are logically related and must be 770 consistant. For example, if a KE payload is sent, the attribute 771 describing the Diffie-Hellman group (see section 6.1 and [Pip97]) 772 MUST be included in every transform of every proposal of every SA 773 being negotiated. Similarly, if client identities are used, they MUST 774 apply to every SA in the negotiation. 776 Quick Mode is defined as follows: 778 Initiator Responder 779 ----------- ----------- 780 HDR*, HASH(1), SA, Ni 781 [, KE ] [, IDci, IDcr ] --> 782 <-- HDR*, HASH(2), SA, Nr 783 [, KE ] [, IDci, IDcr ] 784 HDR*, HASH(3) --> 786 Where: 787 HASH(1) is the prf over the message id (M-ID) from the ISAKMP 788 header concatenated with the entire message that follows the hash 789 including all payload headers, but excluding any padding added for 790 encryption. HASH(2) is identical to HASH(1) except the initiator's 791 nonce-- Ni, minus the payload header-- is added after M-ID but before 792 the complete message. The addition of the nonce to HASH(2) is for a 793 liveliness proof. HASH(3)-- for liveliness-- is the prf over the 794 value zero represented as a single octet, followed by a concatenation 795 of the message id and the two nonces-- the initiator's followed by 796 the responder's-- minus the payload header. In other words, the 797 hashes for the above exchange are: 799 HASH(1) = prf(SKEYID_a, M-ID | SA | Ni [ | KE ] [ | IDci | IDcr ]) 800 HASH(2) = prf(SKEYID_a, M-ID | Ni_b | SA | Nr [ | KE ] [ | IDci | 801 IDcr ]) 802 HASH(3) = prf(SKEYID_a, 0 | M-ID | Ni_b | Nr_b) 804 With the exception of the HASH, SA, and the optional ID payloads, 805 there are no payload ordering restrictions on Quick Mode. HASH(1) and 806 HASH(2) may differ from the illustration above if the order of 807 payloads in the message differs from the illustrative example. 809 If PFS is not needed, and KE payloads are not exchanged, the new 810 keying material is defined as 812 KEYMAT = prf(SKEYID_d, protocol | SPI | Ni_b | Nr_b). 814 If PFS is desired and KE payloads were exchanged, the new keying 815 material is defined as 817 KEYMAT = prf(SKEYID_d, g(qm)^xy | protocol | SPI | Ni_b | Nr_b) 819 where g(qm)^xy is the shared secret from the ephemeral Diffie-Hellman 820 exchange of this Quick Mode. 822 In either case, "protocol" and "SPI" are from the ISAKMP Proposal 823 Payload that contained the negotiated Transform. 825 A single SA negotiation results in two security assocations-- one 826 inbound and one outbound. Different SPIs for each SA (one chosen by 827 the initiator, the other by the responder) guarantee a different key 828 for each direction. The SPI chosen by the destination of the SA is 829 used to derive KEYMAT for that SA. 831 For situations where the amount of keying material desired is greater 832 than that supplied by the prf, KEYMAT is expanded by feeding the 833 results of the prf back into itself and concatenating results until 834 the required keying material has been reached. In other words, 836 KEYMAT = K1 | K2 | K3 | ... 837 where 838 K1 = prf(SKEYID_d, [ g(qm)^xy | ] protocol | SPI | Ni_b | Nr_b) 839 K2 = prf(SKEYID_d, K1 | [ g(qm)^xy | ] protocol | SPI | Ni_b | 840 Nr_b) 841 K3 = prf(SKEYID_d, K2 | [ g(qm)^xy | ] protocol | SPI | Ni_b | 842 Nr_b) 843 etc. 845 This keying material (whether with PFS or without, and whether 846 derived directly or through concatenation) MUST be used with the 847 negotiated SA. It is up to the service to define how keys are derived 848 from the keying material. 850 In the case of an ephemeral Diffie-Hellman exchange in Quick Mode, 851 the exponential (g(qm)^xy) is irretreivably removed from the current 852 state and SKEYID_e and SKEYID_a (derived from phase 1 negotiation) 853 continue to protect and authenticate the ISAKMP SA and SKEYID_d 854 continues to be used to derive keys. 856 Using Quick Mode, multiple SA's and keys can be negotiated with one 857 exchange as follows: 859 Initiator Responder 860 ----------- ----------- 861 HDR*, HASH(1), SA0, SA1, Ni, 862 [, KE ] [, IDci, IDcr ] --> 863 <-- HDR*, HASH(2), SA0, SA1, Nr, 864 [, KE ] [, IDci, IDcr ] 865 HDR*, HASH(3) --> 867 The keying material is derived identically as in the case of a single 868 SA. In this case (negotiation of two SA payloads) the result would be 869 four security associations-- two each way for both SAs. 871 5.6 New Group Mode 873 New Group Mode MUST NOT be used prior to establishment of an ISAKMP 874 SA. The description of a new group MUST only follow phase 1 875 negotiation. (It is not a phase 2 exchange, though). 877 Initiator Responder 878 ----------- ----------- 879 HDR*, HASH(1), SA --> 880 <-- HDR*, HASH(2), SA 882 where HASH(1) is the prf output, using SKEYID_a as the key, and the 883 message-ID from the ISAKMP header concatenated with the entire SA 884 proposal, body and header, as the data; HASH(2) is the prf output, 885 using SKEYID_a as the key, and the message-ID from the ISAKMP header 886 concatenated with the reply as the data. In other words the hashes 887 for the above exchange are: 889 HASH(1) = prf(SKEYID_a, M-ID | SA) 890 HASH(2) = prf(SKEYID_a, M-ID | SA) 892 The proposal will specify the characteristics of the group (see 893 appendix A, "Attribute Assigned Numbers"). Group descriptions for 894 private Groups MUST be greater than or equal to 2^15. If the group 895 is not acceptable, the responder MUST reply with a Notify payload 896 with the message type set to ATTRIBUTES-NOT-SUPPORTED (13). 898 ISAKMP implementations MAY require private groups to expire with the 899 SA under which they were established. 901 Groups may be directly negotiated in the SA proposal with Main Mode. 902 To do this the component parts-- for a MODP group, the type, prime 903 and generator; for a EC2N group the type, the Irreducible Polynomial, 904 Group Generator One, Group Generator Two, Group Curve A, Group Curve 905 B and Group Order-- are passed as SA attributes (see Appendix A). 906 Alternately, the nature of the group can be hidden using New Group 907 Mode and only the group identifier is passed in the clear during 908 phase 1 negotiation. 910 5.7 ISAKMP Informational Exchanges 912 This protocol protects ISAKMP Informational Exchanges when possible. 913 Once the ISAKMP security association has been established (and 914 SKEYID_e and SKEYID_a have been generated) ISAKMP Information 915 Exchanges, when used with this protocol, are as follows: 917 Initiator Responder 918 ----------- ----------- 919 HDR*, HASH(1), N/D --> 921 where N/D is either an ISAKMP Notify Payload or an ISAKMP Delete 922 Payload and HASH(1) is the prf output, using SKEYID_a as the key, and 923 a M-ID unique to this exchange concatenated with the entire 924 informational payload (either a Notify or Delete) as the data. In 925 other words, the hash for the above exchange is: 927 HASH(1) = prf(SKEYID_a, M-ID | N/D) 929 As noted the message ID in the ISAKMP header-- and used in the prf 930 computation-- is unique to this exchange and MUST NOT be the same as 931 the message ID of another phase 2 exchange which generated this 932 informational exchange. The derivation of the initialization vector, 933 used with SKEYID_e to encrypt this message, is described in Appendix 934 B. 936 If the ISAKMP security association has not yet been established at 937 the time of the Informational Exchange, the exchange is done in the 938 clear without an accompanying HASH payload. 940 6 Oakley Groups 942 With IKE, the group in which to do the Diffie-Hellman exchange is 943 negotiated. Four groups-- values 1 through 4-- are defined below. 944 These groups originated with the Oakley protocol and are therefore 945 called "Oakley Groups". The attribute class for "Group" is defined in 946 Appendix A. All values 2^15 and higher are used for private group 947 identifiers. For a discussion on the strength of the default Oakley 948 groups please see the Security Considerations section below. 950 6.1 First Oakley Default Group 952 Oakley implementations MUST support a MODP group with the following 953 prime and generator. This group is assigned id 1 (one). 955 The prime is: 2^768 - 2 ^704 - 1 + 2^64 * { [2^638 pi] + 149686 } 956 Its hexadecimal value is 958 FFFFFFFF FFFFFFFF C90FDAA2 2168C234 C4C6628B 80DC1CD1 959 29024E08 8A67CC74 020BBEA6 3B139B22 514A0879 8E3404DD 960 EF9519B3 CD3A431B 302B0A6D F25F1437 4FE1356D 6D51C245 961 E485B576 625E7EC6 F44C42E9 A63A3620 FFFFFFFF FFFFFFFF 963 The generator is: 2. 965 6.2 Second Oakley Group 967 IKE implementations SHOULD support a MODP group with the following 968 prime and generator. This group is assigned id 2 (two). 970 The prime is 2^1024 - 2^960 - 1 + 2^64 * { [2^894 pi] + 129093 }. 971 Its hexadecimal value is 973 FFFFFFFF FFFFFFFF C90FDAA2 2168C234 C4C6628B 80DC1CD1 974 29024E08 8A67CC74 020BBEA6 3B139B22 514A0879 8E3404DD 975 EF9519B3 CD3A431B 302B0A6D F25F1437 4FE1356D 6D51C245 976 E485B576 625E7EC6 F44C42E9 A637ED6B 0BFF5CB6 F406B7ED 977 EE386BFB 5A899FA5 AE9F2411 7C4B1FE6 49286651 ECE65381 978 FFFFFFFF FFFFFFFF 980 The generator is 2 (decimal) 982 6.3 Third Oakley Group 984 IKE implementations SHOULD support a EC2N group with the following 985 characteristics. This group is assigned id 3 (three). The curve is 986 based on the Galois Field GF[2^155]. The field size is 155. The 987 irreducible polynomial for the field is: 988 u^155 + u^62 + 1. 989 The equation for the elliptic curve is: 990 y^2 + xy = x^3 + ax^2 + b. 992 Field Size: 155 993 Group Prime/Irreducible Polynomial: 995 0x0800000000000000000000004000000000000001 996 Group Generator One: 0x7b 997 Group Curve A: 0x0 998 Group Curve B: 0x07338f 1000 Group Order: 0X0800000000000000000057db5698537193aef944 1002 The data in the KE payload when using this group is the value x from 1003 the solution (x,y), the point on the curve chosen by taking the 1004 randomly chosen secret Ka and computing Ka*P, where * is the 1005 repetition of the group addition and double operations, P is the 1006 curve point with x coordinate equal to generator 1 and the y 1007 coordinate determined from the defining equation. The equation of 1008 curve is implicitly known by the Group Type and the A and B 1009 coefficients. There are two possible values for the y coordinate; 1010 either one can be used successfully (the two parties need not agree 1011 on the selection). 1013 6.4 Fourth Oakley Group 1015 IKE implementations SHOULD support a EC2N group with the following 1016 characteristics. This group is assigned id 4 (four). The curve is 1017 based on the Galois Field GF[2^185]. The field size is 185. The 1018 irreducible polynomial for the field is: 1019 u^185 + u^69 + 1. The 1020 equation for the elliptic curve is: 1021 y^2 + xy = x^3 + ax^2 + b. 1023 Field Size: 185 1024 Group Prime/Irreducible Polynomial: 1025 0x020000000000000000000000000000200000000000000001 1026 Group Generator One: 0x18 1027 Group Curve A: 0x0 1028 Group Curve B: 0x1ee9 1030 Group Order: 0X01ffffffffffffffffffffffdbf2f889b73e484175f94ebc 1032 The data in the KE payload when using this group will be identical to 1033 that as when using Oakley Group 3 (three). 1035 Other groups can be defined using New Group Mode. These default 1036 groups were generated by Richard Schroeppel at the University of 1037 Arizona. Properties of these primes are described in [Orm96]. 1039 7. Payload Explosion for a Complete IKE Exchange 1041 This section illustrates how the IKE protocol is used to: 1043 - establish a secure and authenticated channel between ISAKMP 1044 processes (phase 1); and 1046 - generate key material for, and negotiate, an IPsec SA (phase 2). 1048 7.1 Phase 1 using Main Mode 1050 The following diagram illustrates the payloads exchanged between the 1051 two parties in the first round trip exchange. The initiator MAY 1052 propose several proposals; the responder MUST reply with one. 1054 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 1055 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1056 ~ ISAKMP Header with XCHG of Main Mode, ~ 1057 ~ and Next Payload of ISA_SA ~ 1058 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1059 ! 0 ! RESERVED ! Payload Length ! 1060 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1061 ! Domain of Interpretation ! 1062 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1063 ! Situation ! 1064 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1065 ! 0 ! RESERVED ! Payload Length ! 1066 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1067 ! Proposal #1 ! PROTO_ISAKMP ! SPI size = 0 | # Transforms ! 1068 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1069 ! ISA_TRANS ! RESERVED ! Payload Length ! 1070 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1071 ! Transform #1 ! KEY_OAKLEY | RESERVED2 ! 1072 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1073 ~ prefered SA attributes ~ 1074 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1075 ! 0 ! RESERVED ! Payload Length ! 1076 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1077 ! Transform #2 ! KEY_OAKLEY | RESERVED2 ! 1078 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1079 ~ alternate SA attributes ~ 1080 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1082 The responder replies in kind but selects, and returns, one transform 1083 proposal (the ISAKMP SA attributes). 1085 The second exchange consists of the following payloads: 1087 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 1088 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1089 ~ ISAKMP Header with XCHG of Main Mode, ~ 1090 ~ and Next Payload of ISA_KE ~ 1091 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1092 ! ISA_NONCE ! RESERVED ! Payload Length ! 1093 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1094 ~ D-H Public Value (g^xi from initiator g^xr from responder) ~ 1095 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1096 ! 0 ! RESERVED ! Payload Length ! 1097 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1098 ~ Ni (from initiator) or Nr (from responder) ~ 1099 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1101 The shared keys, SKEYID_e and SKEYID_a, are now used to protect and 1102 authenticate all further communication. Note that both SKEYID_e and 1103 SKEYID_a are unauthenticated. 1105 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 1106 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1107 ~ ISAKMP Header with XCHG of Main Mode, ~ 1108 ~ and Next Payload of ISA_ID and the encryption bit set ~ 1109 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1110 ! ISA_SIG ! RESERVED ! Payload Length ! 1111 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1112 ~ Identification Data of the ISAKMP negotiator ~ 1113 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1114 ! 0 ! RESERVED ! Payload Length ! 1115 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1116 ~ signature verified by the public key of the ID above ~ 1117 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1119 The key exchange is authenticated over a signed hash as described in 1120 section 5.1. Once the signature has been verified using the 1121 authentication algorithm negotiated as part of the ISAKMP SA, the 1122 shared keys, SKEYID_e and SKEYID_a can be marked as authenticated. 1123 (For brevity, certificate payloads were not exchanged). 1125 7.2 Phase 2 using Quick Mode 1127 The following payloads are exchanged in the first round of Quick 1128 Mode with ISAKMP SA negotiation. In this hypothetical exchange, the 1129 ISAKMP negotiators are proxies for other parties which have requested 1130 authentication. 1132 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 1133 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1134 ~ ISAKMP Header with XCHG of Quick Mode, ~ 1135 ~ Next Payload of ISA_HASH and the encryption bit set ~ 1136 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1137 ! ISA_SA ! RESERVED ! Payload Length ! 1138 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1139 ~ keyed hash of message ~ 1140 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1141 ! ISA_NONCE ! RESERVED ! Payload Length ! 1142 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1143 ! Domain Of Interpretation ! 1144 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1145 ! Situation ! 1146 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1147 ! 0 ! RESERVED ! Payload Length ! 1148 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1149 ! Proposal #1 ! PROTO_IPSEC_AH! SPI size = 4 | # Transforms ! 1150 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1151 ~ SPI (4 octets) ~ 1152 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1153 ! ISA_TRANS ! RESERVED ! Payload Length ! 1154 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1155 ! Transform #1 ! AH_SHA | RESERVED2 ! 1156 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1157 ! other SA attributes ! 1158 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1159 ! 0 ! RESERVED ! Payload Length ! 1160 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1161 ! Transform #2 ! AH_MD5 | RESERVED2 ! 1162 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1163 ! other SA attributes ! 1164 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1165 ! ISA_ID ! RESERVED ! Payload Length ! 1166 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1167 ~ nonce ~ 1168 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1169 ! ISA_ID ! RESERVED ! Payload Length ! 1170 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1171 ~ ID of source for which ISAKMP is a client ~ 1172 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1173 ! 0 ! RESERVED ! Payload Length ! 1174 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1175 ~ ID of destination for which ISAKMP is a client ~ 1176 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1178 where the contents of the hash are described in 5.5 above. The 1179 responder replies with a similar message which only contains one 1180 transform-- the selected AH transform. Upon receipt, the initiator 1181 can provide the key engine with the negotiated security association 1182 and the keying material. As a check against replay attacks, the 1183 responder waits until receipt of the next message. 1185 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 1186 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1187 ~ ISAKMP Header with XCHG of Quick Mode, ~ 1188 ~ Next Payload of ISA_HASH and the encryption bit set ~ 1189 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1190 ! 0 ! RESERVED ! Payload Length ! 1191 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1192 ~ hash data ~ 1193 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1195 where the contents of the hash are described in 5.5 above. 1197 8 Perfect Forward Secrecy Example 1198 This protocol can provide PFS of both keys and identities. The 1199 identies of both the ISAKMP negotiating peer and, if applicable, the 1200 identities for whom the peers are negotiating can be protected with 1201 PFS. 1203 To provide Perfect Forward Secrecy of both keys and all identities, 1204 two parties would perform the following: 1205 o A Main Mode Exchange to protect the identities of the ISAKMP 1206 peers. 1207 This establishes an ISAKMP SA. 1208 o A Quick Mode Exchange to negotiate other security protocol 1209 protection. 1210 This establishes a SA on each end for this protocol. 1211 o Delete the ISAKMP SA and its associated state. 1212 Since the key for use in the non-ISAKMP SA was derived from the 1213 single ephemeral Diffie-Hellman exchange PFS is preserved. 1215 To provide Perfect Forward Secrecy of merely the keys of a non-ISAKMP 1216 security association, it in not necessary to do a phase 1 exchange if 1217 an ISAKMP SA exists between the two peers. A single Quick Mode in 1218 which the optional KE payload is passed, and an additional Diffie- 1219 Hellman exchange is performed, is all that is required. At this point 1220 the state derived from this Quick Mode must be deleted from the 1221 ISAKMP SA as described in section 5.5. 1223 9. Implementation Hints 1225 Using a single ISAKMP Phase 1 negotiation makes subsequent Phase 2 1226 negotiations extremely quick. As long as the Phase 1 state remains 1227 cached, and PFS is not needed, Phase 2 can proceed without any 1228 exponentiation. How many Phase 2 negotiations can be performed for a 1229 single Phase 1 is a local policy issue. The decision will depend on 1230 the strength of the algorithms being used and level of trust in the 1231 peer system. 1233 An implementation may wish to negotiate a range of SAs when 1234 performing Quick Mode. By doing this they can speed up the "re- 1235 keying". Quick Mode defines how KEYMAT is defined for a range of SAs. 1236 When one peer feels it is time to change SAs they simply use the next 1237 one within the stated range. A range of SAs can be established by 1238 negotiating multiple SAs (identical attributes, different SPIs) with 1239 one Quick Mode. 1241 An optimization that is often useful is to establish Security 1242 Associations with peers before they are needed so that when they 1243 become needed they are already in place. This ensures there would be 1244 no delays due to key management before initial data transmission. 1245 This optimization is easily implemented by setting up more than one 1246 Security Association with a peer for each requested Security 1247 Association and caching those not immediately used. 1249 Also, if an ISAKMP implementation is alerted that a SA will soon be 1250 needed (e.g. to replace an existing SA that will expire in the near 1251 future), then it can establish the new SA before that new SA is 1252 needed. 1254 The base ISAKMP specification describes conditions in which one party 1255 of the protocol may inform the other party of some activity-- either 1256 deletion of a security association or in response to some error in 1257 the protocol such as a signature verification failed or a payload 1258 failed to decrypt. It is strongly suggested that these Informational 1259 exchanges not be responded to under any circumstances. Such a 1260 condition may result in a "notify war" in which failure to understand 1261 a message results in a notify to the peer who cannot understand it 1262 and sends his own notify back which is also not understood. 1264 10. Security Considerations 1266 This entire draft discusses a hybrid protocol, combining parts of 1267 Oakley and parts of SKEME with ISAKMP, to negotiate, and derive 1268 keying material for, security associations in a secure and 1269 authenticated manner. 1271 Confidentiality is assured by the use of a negotiated encryption 1272 algorithm. Authentication is assured by the use of a negotiated 1273 method: a digital signature algorithm; a public key algorithm which 1274 supports encryption; or, a pre-shared key. The confidentiality and 1275 authentication of this exchange is only as good as the attributes 1276 negotiated as part of the ISAKMP security association. 1278 Repeated re-keying using Quick Mode can consume the entropy of the 1279 Diffie- Hellman shared secret. Implementors should take note of this 1280 fact and set a limit on Quick Mode Exchanges between exponentiations. 1281 This draft does not prescribe such a limit. 1283 Perfect Forward Secrecy (PFS) of both keying material and identities 1284 is possible with this protocol. By specifying a Diffie-Hellman group, 1285 and passing public values in KE payloads, ISAKMP peers can establish 1286 PFS of keys-- the identities would be protected by SKEYID_e from the 1287 ISAKMP SA and would therefore not be protected by PFS. If PFS of both 1288 keying material and identities is desired, an ISAKMP peer MUST 1289 establish only one non-ISAKMP security association (e.g. IPsec 1290 Security Association) per ISAKMP SA. PFS for keys and identities is 1291 accomplished by deleting the ISAKMP SA (and optionally issuing a 1292 DELETE message) upon establishment of the single non-ISAKMP SA. In 1293 this way a phase one negotiation is uniquely tied to a single phase 1294 two negotiation, and the ISAKMP SA established during phase one 1295 negotiation is never used again. 1297 The strength of a key derived from a Diffie-Hellman exchange using 1298 any of the groups defined here depends on the inherent strength of 1299 the group, the size of the exponent used, and the entropy provided by 1300 the random number generator used. Due to these inputs it is difficult 1301 to determine the strength of a key for any of the defined groups. The 1302 default Diffie-Hellman group (number one) when used with a strong 1303 random number generator and an exponent no less than 160 bits is 1304 sufficient to use for DES. Groups two through four provide greater 1305 security. Implementations should make note of these conservative 1306 estimates when establishing policy and negotiating security 1307 parameters. 1309 Note that these limitations are on the Diffie-Hellman groups 1310 themselves. There is nothing in IKE which prohibits using stronger 1311 groups nor is there anything which will dilute the strength obtained 1312 from stronger groups. In fact, the extensible framework of IKE 1313 encourages the definition of more groups; use of elliptical curve 1314 groups will greatly increase strength using much smaller numbers. 1316 For situations where defined groups provide insufficient strength New 1317 Group Mode can be used to exchange a Diffie-Hellman group which 1318 provides the necessary strength. In is incumbent upon implementations 1319 to check the primality in groups being offered and independently 1320 arrive at strength estimates. 1322 It is assumed that the Diffie-Hellman exponents in this exchange are 1323 erased from memory after use. In particular, these exponents must not 1324 be derived from long-lived secrets like the seed to a pseudo-random 1325 generator. 1327 11. IANA Considerations 1329 This document contains many "magic numbers" to be maintained by the 1330 IANA. This section explains the criteria to be used by the IANA to 1331 assign additional numbers in each of these lists. 1332 11.1 Attribute Classes 1333 Attributes negotiated in this protocol are identified by their class. 1334 Requests for assignment of new classes must be accompanied by a 1335 standards- track RFC which describes the use of this attribute. 1336 11.2 Encryption Algorithm Class 1337 Values of the Encryption Algorithm Class define an encryption 1338 algorithm to use when called for in this document. Requests for 1339 assignment of new encryption algorithm values must be accompanied by 1340 a reference to a standards-track or Informational RFC or a reference 1341 to published cryptographic literature which describes this algorithm. 1342 11.3 Hash Algorithm 1343 Values of the Hash Algorithm Class define a hash algorithm to use 1344 when called for in this document. Requests for assignment of new hash 1345 algorithm values must be accompanied by a reference to a standards- 1346 track or Informational RFC or a reference to published cryptographic 1347 literature which describes this algorithm. 1348 11.4 Group Description and Group Type 1349 Values of the Group Description Class identify a group to use in a 1350 Diffie-Hellman exchange. Values of the Group Type Class define the 1351 type of group. Requests for assignment of new groups must be 1352 accompanied by a reference to a standards-track or Informational RFC 1353 which describes this group. Requests for assignment of new group 1354 types must be accompanied by a reference to a standards-track or 1355 Informational RFC or by a reference to published cryptographic or 1356 mathmatical literature which describes the new type. 1357 11.5 Life Type 1358 Values of the Life Type Class define a type of lifetime to which the 1359 ISAKMP Security Association applies. Requests for assignment of new 1360 life types must be accompanied by a detailed description of the units 1361 of this type and its expiry. 1362 12. Acknowledgements 1364 This document is the result of close consultation with Hugo Krawczyk, 1365 Douglas Maughan, Hilarie Orman, Mark Schertler, Mark Schneider, and 1366 Jeff Turner. It relies on protocols which were written by them. 1368 Without their interest and dedication, this would not have been 1369 written. 1371 Special thanks Rob Adams, Cheryl Madson, Derrell Piper, Harry Varnis, 1372 and Elfed Weaver for technical input, encouragement, and various 1373 sanity checks along the way. 1375 We would also like to thank the many members of the IPSec working 1376 group that contributed to the development of this protocol over the 1377 past year. 1379 13. References 1381 [Acm97] Adams, C.M., "The CAST-128 Encryption Algorithm", RFC 2144, 1382 May 1997. 1384 [Bra97] Bradner, S., "Key Words for use in RFCs to indicate 1385 Requirement Levels", RFC2119, March 1997. 1387 [KBC96] Krawczyk, H., Bellare, M., Canetti, R., "HMAC: Keyed-Hashing 1388 for Message Authentication", RFC 2104, February 1997. 1390 [Kra96] Krawczyk, H., "SKEME: A Versatile Secure Key Exchange 1391 Mechanism for Internet", from IEEE Proceedings of the 1996 Symposium 1392 on Network and Distributed Systems Security. 1394 [MSST98] Maughhan, D., Schertler, M., Schneider, M., and Turner, J., 1395 "Internet Security Association and Key Management Protocol (ISAKMP)", 1396 version 9, draft-ietf-ipsec-isakmp-09.{ps,txt}. 1398 [Orm96] Orman, H., "The Oakley Key Determination Protocol", version 1399 2, draft-ietf-ipsec-oakley-02.txt 1401 [Pip98] Piper, D., "The Internet IP Security Domain Of Interpretation 1402 for ISAKMP", version 7, draft-ietf-ipsec-ipsec-doi-07.txt. 1404 [Sch96] Schneier, B., "Applied Cryptography, Protocols, Algorithms, 1405 and Source Code in C", 2nd edition. 1407 Appendix A 1409 This is a list of DES Weak and Semi-Weak keys. The keys come from 1410 [Sch96]. All keys are listed in hexidecimal. 1412 DES Weak Keys 1413 0101 0101 0101 0101 1414 1F1F 1F1F E0E0 E0E0 1415 E0E0 E0E0 1F1F 1F1F 1416 FEFE FEFE FEFE FEFE 1418 DES Semi-Weak Keys 1419 01FE 01FE 01FE 01FE 1420 1FE0 1FE0 0EF1 0EF1 1421 01E0 01E0 01F1 01F1 1422 1FFE 1FFE 0EFE 0EFE 1423 011F 011F 010E 010E 1424 E0FE E0FE F1FE F1FE 1426 FE01 FE01 FE01 FE01 1427 E01F E01F F10E F10E 1428 E001 E001 F101 F101 1429 FE1F FE1F FE0E FE0E 1430 1F01 1F01 0E01 0E01 1431 FEE0 FEE0 FEF1 FEF1 1433 Attribute Assigned Numbers 1435 Attributes negotiated during phase one use the following definitions. 1436 Phase two attributes are defined in the applicable DOI specification 1437 (for example, IPsec attributes are defined in the IPsec DOI), with 1438 the exception of a group description when Quick Mode includes an 1439 ephemeral Diffie-Hellman exchange. Attribute types can be either 1440 Basic (B) or Variable-length (V). Encoding of these attributes is 1441 defined in the base ISAKMP specification as Type/Value (Basic) and 1442 Type/Length/Value (Variable). 1444 Attributes described as basic MUST NOT be encoded as variable. 1445 Variable length attributes MAY be encoded as basic attributes if 1446 their value can fit into two octets. If this is the case, an 1447 attribute offered as variable (or basic) by the initiator of this 1448 protocol MAY be returned to the initiator as a basic (or variable). 1450 Attribute Classes 1452 class value type 1453 ------------------------------------------------------------------- 1454 Encryption Algorithm 1 B 1455 Hash Algorithm 2 B 1456 Authentication Method 3 B 1457 Group Description 4 B 1458 Group Type 5 B 1459 Group Prime/Irreducible Polynomial 6 V 1460 Group Generator One 7 V 1461 Group Generator Two 8 V 1462 Group Curve A 9 V 1463 Group Curve B 10 V 1464 Life Type 11 B 1465 Life Duration 12 V 1466 PRF 13 B 1467 Key Length 14 B 1468 Field Size 15 B 1469 Group Order 16 V 1471 values 17-16383 are reserved to IANA. Values 16384-32767 are for 1472 private use among mutually consenting parties. 1474 Class Values 1476 - Encryption Algorithm 1477 DEC-CBC 1 1478 IDEA-CBC 2 1479 Blowfish-CBC 3 1480 RC5-R16-B64-CBC 4 1481 3DES-CBC 5 1482 CAST-CBC 6 1484 values 7-65000 are reserved to IANA. Values 65001-65535 are for 1485 private use among mutually consenting parties. 1487 - Hash Algorithm 1488 MD5 1 1489 SHA 2 1490 Tiger 3 1492 values 4-65000 are reserved to IANA. Values 65001-65535 are for 1493 private use among mutually consenting parties. 1495 - Authentication Method 1496 pre-shared key 1 1497 DSS signatures 2 1498 RSA signatures 3 1499 Encryption with RSA 4 1500 Revised encryption with RSA 5 1502 values 6-65000 are reserved to IANA. Values 65001-65535 are for 1503 private use among mutually consenting parties. 1505 - Group Description 1506 default 768-bit MODP group (section 6.1) 1 1508 alternate 1024-bit MODP group (section 6.2) 2 1509 .sp 1510 EC2N group on GP[2^155] (section 6.3) 3 1511 .sp 1512 EC2N group on GP[2^185] (section 6.4) 4 1514 values 5-32767 are reserved to IANA. Values 32768-65535 are for 1515 private use among mutually consenting parties. 1517 - Group Type 1518 MODP (modular exponentiation group) 1 1519 ECP (elliptic curve group over GF[P]) 2 1520 EC2N (elliptic curve group over GF[2^N]) 3 1522 values 4-65000 are reserved to IANA. Values 65001-65535 are for 1523 private use among mutually consenting parties. 1525 - Life Type 1526 seconds 1 1527 kilobytes 2 1529 values 3-65000 are reserved to IANA. Values 65001-65535 are for 1530 private use among mutually consenting parties. For a given "Life 1531 Type" the value of the "Life Duration" attribute defines the actual 1532 length of the SA life-- either a number of seconds, or a number of 1533 kbytes protected. 1535 - PRF 1536 There are currently no pseudo-random functions defined. 1538 values 1-65000 are reserved to IANA. Values 65001-65535 are for 1539 private use among mutually consenting parties. 1541 - Key Length 1543 When using an Encryption Algorithm that has a variable length key, 1544 this attribute specifies the key length in bits. (MUST use network 1545 byte order). This attribute MUST NOT be used when the specified 1546 Encryption Algorithm uses a fixed length key. 1548 - Field Size 1550 The field size, in bits, of a Diffie-Hellman group. 1552 - Group Order 1554 The group order of an elliptical curve group. Note the length of 1555 this attribute depends on the field size. 1556 Additional Exchanges Defined-- XCHG values 1557 Quick Mode 32 1558 New Group Mode 33 1560 Appendix B 1562 This appendix describes encryption details to be used ONLY when 1563 encrypting ISAKMP messages. When a service (such as an IPSEC 1564 transform) utilizes ISAKMP to generate keying material, all 1565 encryption algorithm specific details (such as key and IV generation, 1566 padding, etc...) MUST be defined by that service. ISAKMP does not 1567 purport to ever produce keys that are suitable for any encryption 1568 algorithm. ISAKMP produces the requested amount of keying material 1569 from which the service MUST generate a suitable key. Details, such 1570 as weak key checks, are the responsibility of the service. 1572 Use of negotiated PRFs may require the PRF output to be expanded due 1573 to the PRF feedback mechanism employed by this document. For example, 1574 if the (ficticious) DOORAK-MAC requires 24 bytes of key but produces 1575 only 8 bytes of output, the output must be expanded three times 1576 before being used as the key for another instance of itself. The 1577 output of a PRF is expanded by feeding back the results of the PRF 1578 into itself to generate successive blocks. These blocks are 1579 concatenated until the requisite number of bytes has been acheived. 1580 For example, for pre-shared key authentication with DOORAK-MAC as the 1581 negotiated PRF: 1583 BLOCK1-8 = prf(pre-shared-key, Ni_b | Nr_b) 1584 BLOCK9-16 = prf(pre-shared-key, BLOCK1-8 | Ni_b | Nr_b) 1585 BLOCK17-24 = prf(pre-shared-key, BLOCK9-16 | Ni_b | Nr_b) 1586 and 1587 SKEYID = BLOCK1-8 | BLOCK9-16 | BLOCK17-24 1589 so therefore to derive SKEYID_d: 1591 BLOCK1-8 = prf(SKEYID, g^xy | CKY-I | CKY-R | 0) 1592 BLOCK9-16 = prf(SKEYID, BLOCK1-8 | g^xy | CKY-I | CKY-R | 0) 1593 BLOCK17-24 = prf(SKEYID, BLOCK9-16 | g^xy | CKY-I | CKY-R | 0) 1594 and 1595 SKEYID_d = BLOCK1-8 | BLOCK9-16 | BLOCK17-24 1597 Subsequent PRF derivations are done similarly. 1599 Encryption keys used to protect the ISAKMP SA are derived from 1600 SKEYID_e in an algorithm-specific manner. When SKEYID_e is not long 1601 enough to supply all the necessary keying material an algorithm 1602 requires, the key is derived from feeding the results of a pseudo- 1603 random function into itself, concatenating the results, and taking 1604 the highest necessary bits. 1606 For example, if (ficticious) algorithm AKULA requires 320-bits of key 1607 (and has no weak key check) and the prf used to generate SKEYID_e 1608 only generates 120 bits of material, the key for AKULA, would be the 1609 first 320-bits of Ka, where: 1611 Ka = K1 | K2 | K3 1612 and 1613 K1 = prf(SKEYID_e, 0) 1614 K2 = prf(SKEYID_e, K1) 1615 K3 = prf(SKEYID_e, K2) 1617 where prf is the negotiated prf or the HMAC version of the negotiated 1618 hash function (if no prf was negotiated) and 0 is represented by a 1619 single octet. Each result of the prf provides 120 bits of material 1620 for a total of 360 bits. AKULA would use the first 320 bits of that 1621 360 bit string. 1623 In phase 1, material for the initialization vector (IV material) for 1624 CBC mode encryption algorithms is derived from a hash of a 1625 concatenation of the initiator's public Diffie-Hellman value and the 1626 responder's public Diffie-Hellman value using the negotiated hash 1627 algorithm. This is used for the first message only. Each message 1628 should be padded up to the nearest block size using bytes containing 1629 0x00. The message length in the header MUST include the length of the 1630 pad since this reflects the size of the cyphertext. Subsequent 1631 messages MUST use the last CBC encryption block from the previous 1632 message as their initialization vector. 1634 In phase 2, material for the initialization vector for CBC mode 1635 encryption of the first message of a Quick Mode exchange is derived 1636 from a hash of a concatenation of the last phase 1 CBC output block 1637 and the phase 2 message id using the negotiated hash algorithm. The 1638 IV for subsequent messages within a Quick Mode exchange is the CBC 1639 output block from the previous message. Padding and IVs for 1640 subsequent messages are done as in phase 1. 1642 After the ISAKMP SA has been authenticated all Informational 1643 Exchanges are encrypted using SKEYID_e. The initiaization vector for 1644 these exchanges is derived in exactly the same fashion as that for a 1645 Quick Mode-- i.e. it is derived from a hash of a concatenation of the 1646 last phase 1 CBC output block and the message id from the ISAKMP 1647 header of the Informational Exchange (not the message id from the 1648 message that may have prompted the Informational Exchange). 1650 Note that the final phase 1 CBC output block, the result of 1651 encryption/decryption of the last phase 1 message, must be retained 1652 in the ISAKMP SA state to allow for generation of unique IVs for each 1653 Quick Mode. Each post- phase 1 exchange (Quick Modes and 1654 Informational Exchanges) generates IVs independantly to prevent IVs 1655 from getting out of sync when two different exchanges are started 1656 simultaneously. 1658 In all cases, there is a single bidirectional cipher/IV context. 1659 Having each Quick Mode and Informational Exchange maintain a unique 1660 context prevents IVs from getting out of sync. 1662 The key for DES-CBC is derived from the first eight (8) non-weak and 1663 non-semi-weak (see Appendix A) bytes of SKEYID_e. The IV is the first 1664 8 bytes of the IV material derived above. 1666 The key for IDEA-CBC is derived from the first sixteen (16) bytes of 1667 SKEYID_e. The IV is the first eight (8) bytes of the IV material 1668 derived above. 1670 The key for Blowfish-CBC is either the negotiated key size, or the 1671 first fifty-six (56) bytes of a key (if no key size is negotiated) 1672 derived in the aforementioned pseudo-random function feedback method. 1673 The IV is the first eight (8) bytes of the IV material derived above. 1675 The key for RC5-R16-B64-CBC is the negotiated key size, or the first 1676 sixteen (16) bytes of a key (if no key size is negotiated) derived 1677 from the aforementioned pseudo-random function feedback method if 1678 necessary. The IV is the first eight (8) bytes of the IV material 1679 derived above. The number of rounds MUST be 16 and the block size 1680 MUST be 64. 1682 The key for 3DES-CBC is the first twenty-four (24) bytes of a key 1683 derived in the aforementioned pseudo-random function feedback method. 1684 3DES-CBC is an encrypt-decrypt-encrypt operation using the first, 1685 middle, and last eight (8) bytes of the entire 3DES-CBC key. The IV 1686 is the first eight (8) bytes of the IV material derived above. 1688 The key for CAST-CBC is either the negotiated key size, or the first 1689 sixteen (16) bytes of a key derived in the aforementioned pseudo- 1690 random function feedback method. The IV is the first eight (8) bytes 1691 of the IV material derived above. 1693 Support for algorithms other than DES-CBC is purely optional. Some 1694 optional algorithms may be subject to intellectual property claims. 1696 Authors' Addresses: 1698 Dan Harkins 1699 cisco Systems 1700 170 W. Tasman Dr. 1701 San Jose, California, 95134-1706 1702 United States of America 1703 +1 408 526 4000 1705 Dave Carrel 1706 76 Lippard Ave. 1707 San Francisco, CA 94131-2947 1708 United States of America 1709 +1 415 337 8469 1711 Authors' Note: 1713 The authors encourage independent implementation, and 1714 interoperability testing, of this hybrid protocol.