idnits 2.17.1 draft-ietf-ipsec-isakmp-oakley-05.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-26) 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 an IANA Considerations section. (See Section 2.2 of https://www.ietf.org/id-info/checklist for how to handle the case when there are no actions for IANA.) ** 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 ([MSST97], [Kra96], [Orm96]), which it shouldn't. Please replace those with straight textual mentions of the documents in question. Miscellaneous warnings: ---------------------------------------------------------------------------- == 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 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 (November 1997) is 9659 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: 'P' is mentioned on line 1447, but not defined == Unused Reference: 'Acm97' is defined on line 1319, 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. 'MSST97') -- 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-04 ** Downref: Normative reference to an Historic draft: draft-ietf-ipsec-ipsec-doi (ref. 'Pip97') -- Possible downref: Non-RFC (?) normative reference: ref. 'Sch96' Summary: 17 errors (**), 0 flaws (~~), 5 warnings (==), 5 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 IPSEC Working Group D. Harkins, D. Carrel 3 INTERNET-DRAFT cisco Systems 4 draft-ietf-ipsec-isakmp-oakley-05.txt November 1997 6 The resolution of ISAKMP with Oakley 7 9 Status of this Memo 11 This document is an Internet Draft. Internet Drafts are working 12 documents of the Internet Engineering Task Force (IETF), its areas, 13 and working groups. Note that other groups may also distribute 14 working documents as Internet Drafts. 16 Internet Drafts are draft documents valid for a maximum of six months 17 and may be updated, replaced, or obsoleted by other documents at any 18 time. It is inapproporiate to use Internet Drafts as reference 19 material or to cite them other than as "work in progress." 21 To learn the current status of any Internet Draft, please check the 22 "1id-abstracts.txt" listing contained in the Internet Drafts Shadow 23 Directories on ftp.is.co.za (Africa), nic.nordu.net (Europe), 24 munnari.oz.au (Australia), ds.internic.net (US East Coast), or 25 ftp.isi.edu (US West Coast). 27 Table Of Contents 29 1 Abstract 30 2 Discussion 31 3 Terms and Definitions 32 3.1 Requirements Terminology 33 3.2 Notation 34 3.3 Perfect Forward Secrecty 35 3.4 Security Association 36 4 Introduction 37 5 Exchanges 38 5.1 Authentication with Digital Signatures 39 5.2 Authentication with Public Key Encryption 40 5.3 A Revised method of Authentication with Public Key Encryption 41 5.4 Authentication with a Pre-Shared Key 42 5.5 Quick Mode 43 5.6 New Group Mode 44 5.7 ISAKMP Informational Exchanges 45 6 Oakley Groups 46 6.1 First Oakley Group 47 6.2 Second Oakley Group 48 6.3 Third Oakley Group 49 6.4 Fourth Oakley Group 50 7 Payload Explosion of Complete Exchange 51 7.1 Phase 1 with Main Mode 52 7.2 Phase 2 with Quick Mode 53 8 Perfect Forward Secrecy Example 54 9 Implementation Hints 55 10 Security Considerations 56 11 Acknowledgments 57 12 References 58 Appendix A 59 Appendix B 61 1. Abstract 63 [MSST97] (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 defines a method to establish an authenticated key exchange. 219 This includes how payloads are constructed, the information they 220 carry, the order in which they are processed and how they are used. 222 While Oakley defines "modes", ISAKMP defines "phases". The 223 relationship between the two is very straightforward. ISAKMP's phase 224 1 is where the two ISAKMP peers establish a secure, authenticated 225 channel with which to communicate. This is called the ISAKMP 226 Security Association (SA). "Main Mode" and "Aggressive Mode" each 227 accomplish a phase 1 exchange. "Main Mode" and "Aggressive Mode" 228 MUST ONLY be used in phase 1. 230 Phase 2 is where Security Associations are negotiated on behalf of 231 services such as IPsec or any other service which needs key material 232 and/or parameter negotiation. "Quick Mode" accomplishes a phase 2 233 exchange. "Quick Mode" MUST ONLY be used in phase 2. 235 "New Group Mode" is not really a phase 1 or phase 2. It follows 236 phase 1, but serves to establish a new group which can be used in 237 future negotiations. "New Group Mode" MUST ONLY be used after phase 238 1. 240 The ISAKMP SA is bi-directional. That is, once established, either 241 party may initiate Quick Mode, Informational, and New Group Mode 242 Exchanges. Per the base ISAKMP document, the ISAKMP SA is identified 243 by the Initiator's cookie followed by the Responder's cookie-- the 244 role of each party in the phase 1 exchange dictates which cookie is 245 the Initiator's. The cookie order established by the phase 1 exchange 246 continues to identify the ISAKMP SA regardless of the direction the 247 Quick Mode, Informational, or New Group exchange. In other words, the 248 cookies MUST NOT swap places when the direction of the ISAKMP SA 249 changes. 251 With the use of ISAKMP phases, an implementation can accomplish very 252 fast keying when necessary. A single phase 1 negotiation may be used 253 for more than one phase 2 negotiation. Additionally a single phase 2 254 negotiation can request multiple Security Associations. With these 255 optimizations, an implementation can see less than one round trip per 256 SA as well as less than one DH exponentiation per SA. "Main Mode" 257 for phase 1 provides identity protection. When identity protection 258 is not needed, "Aggressive Mode" can be used to reduce round trips 259 even further. Developer hints for doing these optimizations are 260 included below. It should also be noted that using public key 261 encryption to authenticate an Aggressive Mode exchange will still 262 provide identity protection. 264 This protocol does not define its own DOI per se. The ISAKMP SA, 265 established in phase 1, MAY use the DOI and situation from a non- 266 ISAKMP service (such as the IETF IPSec DOI [Pip97]). In this case an 267 implementation MAY choose to restrict use of the ISAKMP SA for 268 establishment of SAs for services of the same DOI. Alternately, an 269 ISAKMP SA MAY be established with the value zero in both the DOI and 270 situation (see [MSST97] for a description of these fields) and in 271 this case implementations will be free to establish security services 272 for any defined DOI using this ISAKMP SA. If a DOI of zero is used 273 for establishment of a phase 1 SA, the syntax of the identity 274 payloads used in phase 1 is that defined in [MSST97] and not from any 275 DOI-- e.g. [Pip97]-- which may further expand the syntax and 276 semantics of identities. 278 The following attributes are used by ISAKMP/Oakley and are negotiated 279 as part of the ISAKMP Security Association. (These attributes 280 pertain only to the ISAKMP Security Association and not to any 281 Security Associations that ISAKMP may be negotiating on behalf of 282 other services.) 284 - encryption algorithm (e.g. DES, IDEA, Blowfish). 286 - hash algorithm (e.g. MD5, SHA) 288 - authentication method (e.g. DSS sig, RSA sig, RSA encryption, 289 pre-shared key) 291 - information about a group over which to do Diffie-Hellman. 293 - prf (e.g. 3DES-CBC-MAC) 295 All of these attributes are mandatory and MUST be negotiated except 296 for the "prf". The "prf" MAY be negotiated, but if it is not, the 297 HMAC (see [KBC96]) version of the negotiated hash algorithm is used 298 as a pseudo-random function. Other non-mandatory attributes are 299 described in Appendix A. The selected hash algorithm MUST support 300 both native and HMAC modes. 302 The Diffie-Hellman group MUST be either specified using a defined 303 group description (section 6) or by defining all attributes of a 304 group (section 5.6). Group attributes (such as group type or prime-- 305 see Appendix A) MUST NOT be offered in conjunction with a previously 306 defined group (either a reserved group description or a private use 307 description that is established after conclusion of a New Group Mode 308 exchange). 310 ISAKMP/Oakley implementations MUST support the following attribute 311 values: 313 - DES-CBC with a weak, and semi-weak, key check (weak and semi- 314 weak keys are referenced in [Sch96] and listed in Appendix A). The 315 key is derived according to Appendix B. 317 - MD5 and SHA. 319 - Authentication via pre-shared keys. The Digital Signature 320 Standard SHOULD be supported; RSA-- both signatures and 321 authentication with public key encryption-- SHOULD be supported. 323 - MODP over the default group (see below). ECP and EC2N groups MAY 324 be supported. 326 The ISAKMP/Oakley modes described here MUST be implemented whenever 327 the IETF IPsec DOI [Pip97] is implemented. Other DOIs MAY use the 328 modes described here. 330 5. Exchanges 332 There are two basic methods used to establish an authenticated key 333 exchange: Main Mode and Aggressive Mode. Each generates authenticated 334 keying material from an ephemeral Diffie-Hellman exchange. Main Mode 335 MUST be implemented; Aggressive Mode SHOULD be implemented. In 336 addition, Quick Mode MUST be implemented as a mechanism to generate 337 fresh keying material and negotiate non-ISAKMP security services. In 338 additon, New Group Mode SHOULD be implemented as a mechanism to 339 define private groups for Diffie-Hellman exchanges. Implementations 340 MUST NOT switch exchange types in the middle of an exchange. 342 Exchanges conform to standard ISAKMP [MSST97] payload syntax, 343 attribute encoding, timeouts and retransmits of messages, and 344 informational messages-- e.g a notify response is sent when, for 345 example, a proposal is unacceptable, or a signature verification or 346 decryption was unsuccessful, etc. 348 The SA payload MUST precede all other payloads in a phase 1 exchange. 349 Except where otherwise noted, there are no requirements for ISAKMP 350 payloads in any message to be in any particular order. 352 Main Mode is an instantiation of the ISAKMP Identity Protect 353 Exchange: The first two messages negotiate policy; the next two 354 exchange Diffie-Hellman public values and ancillary data (e.g. 355 nonces) necessary for the exchange; and the last two messages 356 authenticate the Diffie-Hellman Exchange. The authentication method 357 negotiated as part of the initial ISAKMP exchange influences the 358 composition of the payloads but not their purpose. The XCHG for Main 359 Mode is ISAKMP Identity Protect. 361 Similarly, Aggressive Mode is an instantiation of the ISAKMP 362 Aggressive Exchange. The first two messages negotiate policy, 363 exchange Diffie-Hellman public values and ancillary data necessary 364 for the exchange, and identities. In addition the second message 365 authenticates the responder. The third message authenticates the 366 initiator and provides a proof of participation in the exchange. The 367 XCHG for Aggressive Mode is ISAKMP Aggressive. The final message is 368 not sent under protection of the ISAKMP SA allowing each party to 369 postpone exponentiation, if desired, until negotiation of this 370 exchange is complete. 372 Security Association negotiation is limited with Aggressive Mode. Due 373 to message construction requirements the group in which the Diffie- 374 Hellman exchange is performed cannot be negotiated. In addition, 375 different authentication methods may further constrain attribute 376 negotiation. For example, authentication with public key encryption 377 cannot be negotiated and when using the revised method of public key 378 encryption for authentication the cipher and hash cannot be 379 negotiated. For situations where the rich attribute negotiation 380 capabilities of ISAKMP/Oakley are required Main Mode may be required. 382 Quick Mode and New Group Mode have no analog in ISAKMP. The XCHG 383 values for Quick Mode and New Group Mode are defined in Appendix A. 385 Main Mode, Aggressive Mode, and Quick Mode do security association 386 negotiation. There is no limit on the number of offers the initiator 387 may send to the responder but conformant implementations MAY choose 388 to limit the number of offers it will inspect for performance 389 reasons. 391 Four different authentication methods are allowed with either Main 392 Mode or Aggressive Mode-- digital signature, two forms of 393 authentication with public key encryption, or pre-shared key. The 394 value SKEYID is computed seperately for each authentication method. 396 For signatures: SKEYID = prf(Ni_b | Nr_b, g^xy) 397 For public key encryption: SKEYID = prf(hash(Ni_b | Nr_b), CKY-I | 398 CKY-R) 399 For pre-shared keys: SKEYID = prf(pre-shared-key, Ni_b | 400 Nr_b) 402 The result of either Main Mode or Aggressive Mode is three groups of 403 authenticated keying material: 405 SKEYID_d = prf(SKEYID, g^xy | CKY-I | CKY-R | 0) 406 SKEYID_a = prf(SKEYID, SKEYID_d | g^xy | CKY-I | CKY-R | 1) 407 SKEYID_e = prf(SKEYID, SKEYID_a | g^xy | CKY-I | CKY-R | 2) 409 and agreed upon policy to protect further communications. The values 410 of 0, 1, and 2 above are represented by a single octet. The key used 411 for encryption is derived from SKEYID_e in an algorithm-specific 412 manner (see appendix B). 414 To authenticate either exchange the initiator of the protocol 415 generates HASH_I and the responder generates HASH_R where: 417 HASH_I = prf(SKEYID, g^xi | g^xr | CKY-I | CKY-R | SAi_b | IDii_b ) 418 HASH_R = prf(SKEYID, g^xr | g^xi | CKY-R | CKY-I | SAi_b | IDir_b ) 420 For authentication with digital signatures, HASH_I and HASH_R are 421 signed and verified; for authentication with either public key 422 encryption or pre-shared keys, HASH_I and HASH_R directly 423 authenticate the exchange. The entire ID payload (including ID type, 424 port, and protocol but excluding the generic header) is hashed into 425 both HASH_I and HASH_R. 427 As mentioned above, the negotiated authentication method influences 428 the content and use of messages for Phase 1 Modes, but not their 429 intent. When using public keys for authentication, the Phase 1 430 exchange can be accomplished either by using signatures or by using 431 public key encryption (if the algorithm supports it). Following are 432 Phase 1 exchanges with different authentication options. 434 5.1 ISAKMP/Oakley Phase 1 Authenticated With Signatures 436 Using signatures, the ancillary information exchanged during the 437 second roundtrip are nonces; the exchange is authenticated by signing 438 a mutually obtainable hash. Main Mode with signature authentication 439 is described as follows: 441 Initiator Responder 442 ---------- ----------- 443 HDR, SA --> 444 <-- HDR, SA 445 HDR, KE, Ni --> 446 <-- HDR, KE, Nr 447 HDR*, IDii, [ CERT, ] SIG_I --> 448 <-- HDR*, IDir, [ CERT, ] SIG_R 450 Aggressive mode with signatures in conjunction with ISAKMP is 451 described as follows: 453 Initiator Responder 454 ----------- ----------- 455 HDR, SA, KE, Ni, IDii --> 456 <-- HDR, SA, KE, Nr, IDir, 457 [ CERT, ] SIG_R 458 HDR, [ CERT, ] SIG_I --> 460 In both modes, the signed data, SIG_I or SIG_R, is the result of the 461 negotiated digital signature algorithm applied to HASH_I or HASH_R 462 respectively. 464 In general the signature will be over HASH_I and HASH_R as above 465 using the negotiated prf, or the HMAC version of the negotiated hash 466 function (if no prf is negotiated). However, this can be overridden 467 for construction of the signature if the signature algorithm is tied 468 to a particular hash algorithm (e.g. DSS is only defined with SHA's 469 160 bit output). In this case, the signature will be over HASH_I and 470 HASH_R as above, except using the HMAC version of the hash algorithm 471 associated with the signature method. The negotiated prf and hash 472 function would continue to be used for all other prescribed pseudo- 473 random functions. 475 Since the hash algorithm used is already known there is no need to 476 encode its OID into the signature. In addition, there is no binding 477 between the OIDs used for RSA signatures in PKCS #1 and those used in 478 this document. Therefore, RSA signatures MUST be encoded as a private 479 key encryption in PKCS #1 format. DSS signatures MUST be encoded as r 480 followed by s. 482 One or more certificate payloads MAY be optionally passed. 484 5.2 Phase 1 Authenticated With Public Key Encryption 486 Using public key encryption to authenticate the exchange, the 487 ancillary information exchanged is encrypted nonces. Each party's 488 ability to reconstruct a hash (proving that the other party decrypted 489 the nonce) authenticates the exchange. 491 In order to perform the public key encryption, the initiator must 492 already have the responder's public key. In the case where the 493 responder has multiple public keys, a hash of the certificate the 494 initiator is using to encrypt the ancillary information is passed as 495 part of the third message. In this way the responder can determine 496 which corresponding private key to use to decrypt the encrypted 497 payloads and identity protection is retained. 499 In addition to the nonce, the identities of the parties (IDii and 500 IDir) are also encrypted with the other party's public key. If the 501 authentication method is public key encryption, the nonce and 502 identity payloads MUST be encrypted with the public key of the other 503 party. Only the body of the payloads are encrypted, the payload 504 headers are left in the clear. 506 When using encrytion for authentication, Main Mode is defined as 507 follows. 509 Initiator Responder 510 ----------- ----------- 511 HDR, SA --> 512 <-- HDR, SA 513 HDR, KE, [ HASH(1), ] 514 PubKey_r, 515 PubKey_r --> 516 HDR, KE, PubKey_i, 517 <-- PubKey_i 518 HDR*, HASH_I --> 519 <-- HDR*, HASH_R 521 Aggressive Mode authenticated with encryption is described as 522 follows: 524 Initiator Responder 525 ----------- ----------- 526 HDR, SA, [ HASH(1),] KE, 527 Pubkey_r, 528 Pubkey_r --> 529 HDR, SA, KE, PubKey_i, 530 <-- PubKey_i, HASH_R 531 HDR, HASH_I --> 533 Where HASH(1) is a hash (using the negotiated hash function) of the 534 certificate which the initiator is using to encrypt the nonce and 535 identity. 537 RSA encryption MUST be encoded in PKCS #1 format. While only the body 538 of the ID and nonce payloads is encrypted, the encrypted data must be 539 preceded by a valid ISAKMP generic header. The payload length is the 540 length of the entire encrypted payload plus header. The PKCS #1 541 encoding allows for determination of the actual length of the 542 cleartext payload upon decryption. 544 Using encryption for authentication provides for a plausably deniable 545 exchange. There is no proof (as with a digital signature) that the 546 conversation ever took place since each party can completely 547 reconstruct both sides of the exchange. In addition, security is 548 added to secret generation since an attacker would have to 549 successfully break not only the Diffie-Hellman exchange but also both 550 RSA encryptions. This exchange was motivated by [Kra96]. 552 Note that, unlike other authentication methods, authentication with 553 public key encryption allows for identity protection with Aggressive 554 Mode. 556 5.3 Phase 1 Authenticated With a Revised Mode of Public Key Encryption 558 Authentication with Public Key Encryption has significant advantages 559 over authentication with signatures (see section 5.2 above). 561 Unfortunately, this is at the cost of 4 public key operations-- two 562 public key encryptions and two private key decryptions. This 563 authentication mode retains the advantages of authentication using 564 public key encryption but does so with half the public key 565 operations. 567 In this mode, the nonce is still encrypted using the public key of 568 the peer, however the peer's identity (and the certificate if it is 569 sent) is encrypted using the negotiated symmetric encryption 570 algorithm (from the SA payload) with a key derived from the nonce. 571 This solution adds minimal complexity and state yet saves two costly 572 public key operations on each side. In addition, the Key Exchange 573 payload is also encrypted using the same derived key. This provides 574 additional protection against cryptanalysis of the Diffie-Hellman 575 exchange. 577 As with the public key encryption method of authentication (section 578 5.2), a HASH payload may be sent to identify a certificate if the 579 responder has multiple certificates which contain useable public keys 580 (e.g. if the certificate is not for signatures only, either due to 581 certificate restrictions or algorithmic restrictions). If the HASH 582 payload is sent it MUST be the first payload of the second message 583 exchange and MUST be followed by the encrypted nonce. If the HASH 584 payload is not sent, the first payload of the second message exchange 585 MUST be the encrypted nonce. In addition, the initiator my optionally 586 send a certificate payload to provide the responder with a public key 587 with which to respond. 589 When using the revised encryption mode for authentication, Main Mode 590 is defined as follows. 592 Initiator Responder 593 ----------- ----------- 594 HDR, SA --> 595 <-- HDR, SA 596 HDR, [ HASH(1), ] 597 Pubkey_r, 598 Ke_i, 599 Ke_i, 600 [<Ke_i] --> 601 HDR, PubKey_i, 602 Ke_r, 603 <-- Ke_r, 604 HDR*, HASH_I --> 605 <-- HDR*, HASH_R 607 Aggressive Mode authenticated with the revised encryption method is 608 described as follows: 610 Initiator Responder 611 ----------- ----------- 612 HDR, SA, [ HASH(1),] 613 Pubkey_r, 614 Ke_i, Ke_i 615 [, Ke_i ] --> 616 HDR, SA, PubKey_i, 617 Ke_r, Ke_r, 618 <-- HASH_R 619 HDR, HASH_I --> 621 where HASH(1) is identical to section 5.2. Ke_i and Ke_r are keys to 622 the symmetric encryption algorithm negotiated in the SA payload 623 exchange. Only the body of the payloads are encrypted (in both public 624 key and symmetric operations), the generic payload headers are left 625 in the clear. The payload length includes that added to perform 626 encryption. 628 The symmetric cipher keys are derived from the decrypted nonces as 629 follows. First the values Ne_i and Ne_r are computed: 631 Ne_i = prf(Ni_b, CKY-I) 632 Ne_r = prf(Nr_b, CKY-R) 634 The keys Ke_i and Ke_r are then taken from Ne_i and Ne_r respectively 635 in the manner described in Appendix B used to derive symmetric keys 636 for use with the negotiated encryption algorithm. If the length of 637 the output of the negotiated prf is greater than or equal to the key 638 length requirements of the cipher, Ke_i and Ke_r are derived from the 639 most significant bits of Ne_i and Ne_r respectively. If the desired 640 length of Ke_i and Ke_r exceed the length of the output of the prf 641 the necessary number of bits is obtained by repeatedly feeding the 642 results of the prf back into itself and concatenating the result 643 until the necessary number has been achieved. For example, if the 644 negotiated encryption algorithm requires 320 bits of key and the 645 output of the prf is only 128 bits, Ke_i is the most significant 320 646 bits of K, where 648 K = K1 | K2 | K3 and 649 K1 = prf(Ne_i, 0) 650 K2 = prf(Ne_i, K1) 651 K3 = prf(Ne_i, K2) 653 For brevity, only derivation of Ke_i is shown; Ke_r is identical. The 654 length of the value 0 in the computation of K1 is a single octet. 655 Note that Ne_i, Ne_r, Ke_i, and Ke_r are all ephemeral and MUST be 656 discarded after use. 658 Save the requirements on the location of the optional HASH payload 659 and the mandatory nonce payload there are no further payload 660 requirements. All payloads-- in whatever order-- following the 661 encrypted nonce MUST be encrypted with Ke_i or Ke_r depending on the 662 direction. 664 If CBC mode is used for the symmetric encryption then the 665 initialization vectors (IVs) are set as follows. The IV for 666 encrypting the first payload following the nonce is set to 0 (zero). 667 The IV for subsequent payloads encrypted with the ephemeral symmetric 668 cipher key, Ke_i, is the last ciphertext block of the previous 669 payload. Encrypted payloads are padded up to the nearest block size. 670 All padding bytes, except for the last one, contain 0x00. The last 671 byte of the padding contains the number of the padding bytes used, 672 excluding the last one. Note that this means there will always be 673 padding. 675 5.4 Phase 1 Authenticated With a Pre-Shared Key 677 A key derived by some out-of-band mechanism may also be used to 678 authenticate the exchange. The actual establishment of this key is 679 out of the scope of this document. 681 When doing a pre-shared key authentication, Main Mode is defined as 682 follows: 684 Initiator Responder 685 ---------- ----------- 686 HDR, SA --> 687 <-- HDR, SA 688 HDR, KE, Ni --> 689 <-- HDR, KE, Nr 690 HDR*, IDii, HASH_I --> 691 <-- HDR*, IDir, HASH_R 693 Aggressive mode with a pre-shared key is described as follows: 695 Initiator Responder 696 ----------- ----------- 697 HDR, SA, KE, Ni, IDii --> 698 <-- HDR, SA, KE, Nr, IDir, HASH_R 699 HDR, HASH_I --> 701 When using pre-shared key authentication with Main Mode the key can 702 only be identified by the IP address of the peers since HASH_I must 703 be computed before the initiator has processed IDir. Aggressive Mode 704 allows for a wider range of identifiers of the pre-shared secret to 705 be used. In addition, Aggressive Mode allows two parties to maintain 706 multiple, different pre-shared keys and identify the correct one for 707 a particular exchange. 709 5.5 Phase 2 - Quick Mode 711 Quick Mode is not a complete exchange itself, but is used as part of 712 the ISAKMP SA negotiation process (phase 2) to derive keying material 713 and negotiate shared policy for non-ISAKMP SAs. The information 714 exchanged along with Quick Mode MUST be protected by the ISAKMP SA-- 715 i.e. all payloads except the ISAKMP header are encrypted. In Quick 716 Mode, a HASH payload MUST immediately follow the ISAKMP header and a 717 SA payload MUST immediately follow the HASH. This HASH authenticates 718 the message and also provides liveliness proofs. 720 Quick Mode is essentially a SA negotiation and an exchange of nonces 721 that provides replay protection. The nonces are used to generate 722 fresh key material and prevent replay attacks from generating bogus 723 security associations. An optional Key Exchange payload can be 724 exchanged to allow for an additional Diffie-Hellman exchange and 725 exponentiation per Quick Mode. While use of the key exchange payload 726 with Quick Mode is optional it MUST be supported. 728 Base Quick Mode (without the KE payload) refreshes the keying 729 material derived from the exponentiation in phase 1. This does not 730 provide PFS. Using the optional KE payload, an additional 731 exponentiation is performed and PFS is provided for the keying 732 material. If a KE payload is sent, a Diffie-Hellman group (see 733 section 6.1 and [Pip97]) MUST be sent as attributes of the SA being 734 negotiated. 736 If ISAKMP is acting as a client negotiator on behalf of another party 737 the identities of the parties MUST be passed as IDci and then IDcr. 738 Local policy will dictate whether the proposals are acceptible for 739 the identities specified. If IDs are not exchanged, the negotiation 740 MAY assumed to be done on behalf of each ISAKMP peer. If an ID range 741 (see Appendix A of [Pip97]) is not acceptable (for example, the 742 specified subnet is too large) a INVALID-ID-INFORMATION notify 743 message (18) followed by an acceptible ID range, in an ID payload, 744 SHOULD be sent. 746 The client identities are used to identify and direct traffic to the 747 appropriate tunnel in cases where multiple tunnels exist between two 748 peers and also to allow for unique and shared SAs with different 749 granularities. 751 Quick Mode is defined as follows: 753 Initiator Responder 755 ----------- ----------- 756 HDR*, HASH(1), SA, Ni 757 [, KE ] [, IDci, IDcr ] --> 758 <-- HDR*, HASH(2), SA, Nr 759 [, KE ] [, IDci, IDcr ] 760 HDR*, HASH(3) --> 762 Where: 763 HASH(1) is the prf over the message id (M-ID) from the ISAKMP 764 header concatenated with the entire message that follows the hash 765 including all payload headers, but excluding any padding added for 766 encryption. HASH(2) is identical to HASH(1) except the initiator's 767 nonce-- Ni, minus the payload header-- is added after M-ID but before 768 the complete message. The addition of the nonce to HASH(2) is for a 769 liveliness proof. HASH(3)-- for liveliness-- is the prf over the 770 value zero represented as a single octet, followed by a concatenation 771 of the message id and the two nonces-- the initiator's followed by 772 the responder's-- minus the payload header. In other words, the 773 hashes for the above exchange are: 775 HASH(1) = prf(SKEYID_a, M-ID | SA | Ni [ | KE ] [ | IDci | IDcr ]) 776 HASH(2) = prf(SKEYID_a, M-ID | Ni_b | SA | Nr [ | KE ] [ | IDci | 777 IDcr ]) 778 HASH(3) = prf(SKEYID_a, 0 | M-ID | Ni_b | Nr_b) 780 With the exception of the HASH, SA, and the optional ID payloads, 781 there are no payload ordering restrictions on Quick Mode. HASH(1) and 782 HASH(2) may differ from the illustration above if the order of 783 payloads in the message differs from the illustrative example. 785 If PFS is not needed, and KE payloads are not exchanged, the new 786 keying material is defined as 788 KEYMAT = prf(SKEYID_d, protocol | SPI | Ni_b | Nr_b). 790 If PFS is desired and KE payloads were exchanged, the new keying 791 material is defined as 793 KEYMAT = prf(SKEYID_d, g(qm)^xy | protocol | SPI | Ni_b | Nr_b) 795 where g(qm)^xy is the shared secret from the ephemeral Diffie-Hellman 796 exchange of this Quick Mode. 798 In either case, "protocol" and "SPI" are from the ISAKMP Proposal 799 Payload that contained the negotiated Transform. 801 A single SA negotiation results in two security assocations-- one 802 inbound and one outbound. Different SPIs for each SA (one chosen by 803 the initiator, the other by the responder) guarantee a different key 804 for each direction. The SPI chosen by the destination of the SA is 805 used to derive KEYMAT for that SA. 807 For situations where the amount of keying material desired is greater 808 than that supplied by the prf, KEYMAT is expanded by feeding the 809 results of the prf back into itself and concatenating results until 810 the required keying material has been reached. In other words, 812 KEYMAT = K1 | K2 | K3 | ... 813 where 814 K1 = prf(SKEYID_d, [ g(qm)^xy | ] protocol | SPI | Ni_b | Nr_b) 815 K2 = prf(SKEYID_d, K1 | [ g(qm)^xy | ] protocol | SPI | Ni_b | 816 Nr_b) 817 K3 = prf(SKEYID_d, K2 | [ g(qm)^xy | ] protocol | SPI | Ni_b | 818 Nr_b) 819 etc. 821 This keying material (whether with PFS or without, and whether 822 derived directly or through concatenation) MUST be used with the 823 negotiated SA. It is up to the service to define how keys are derived 824 from the keying material. 826 In the case of an ephemeral Diffie-Hellman exchange in Quick Mode, 827 the exponential (g(qm)^xy) is irretreivably removed from the current 828 state and SKEYID_e and SKEYID_a (derived from phase 1 negotiation) 829 continue to protect and authenticate the ISAKMP SA and SKEYID_d 830 continues to be used to derive keys. 832 Using Quick Mode, multiple SA's and keys can be negotiated with one 833 exchange as follows: 835 Initiator Responder 836 ----------- ----------- 837 HDR*, HASH(1), SA0, SA1, Ni, 838 [, KE ] [, IDci, IDcr ] --> 839 <-- HDR*, HASH(2), SA0, SA1, Nr, 840 [, KE ] [, IDci, IDcr ] 841 HDR*, HASH(3) --> 843 The keying material is derived identically as in the case of a single 844 SA. In this case (negotiation of two SA payloads) the result would be 845 four security associations-- two each way for both SAs. 847 5.6 New Group Mode 849 New Group Mode MUST NOT be used prior to establishment of an ISAKMP 850 SA. The description of a new group MUST only follow phase 1 851 negotiation. (It is not a phase 2 exchange, though). 853 Initiator Responder 854 ----------- ----------- 855 HDR*, HASH(1), SA --> 856 <-- HDR*, HASH(2), SA 858 where HASH(1) is the prf output, using SKEYID_a as the key, and the 859 message-ID from the ISAKMP header concatenated with the entire SA 860 proposal, body and header, as the data; HASH(2) is the prf output, 861 using SKEYID_a as the key, and the message-ID from the ISAKMP header 862 concatenated with the reply as the data. In other words the hashes 863 for the above exchange are: 865 HASH(1) = prf(SKEYID_a, M-ID | SA) 866 HASH(2) = prf(SKEYID_a, M-ID | SA) 868 The proposal will specify the characteristics of the group (see 869 appendix A, "Attribute Assigned Numbers"). Group descriptions for 870 private Groups MUST be greater than or equal to 2^15. If the group 871 is not acceptable, the responder MUST reply with a Notify payload 872 with the message type set to ATTRIBUTES-NOT-SUPPORTED (13). 874 ISAKMP implementations MAY require private groups to expire with the 875 SA under which they were established. 877 Groups may be directly negotiated in the SA proposal with Main Mode. 878 To do this the component parts-- for a MODP group, the type, prime 879 and generator; for a EC2N group the type, the Irreducible Polynomial, 880 Group Generator One, Group Generator Two, Group Curve A, Group Curve 881 B and Group Order-- are passed as SA attributes (see Appendix A). 882 Alternately, the nature of the group can be hidden using New Group 883 Mode and only the group identifier is passed in the clear during 884 phase 1 negotiation. 886 5.7 ISAKMP Informational Exchanges 888 This protocol protects ISAKMP Informational Exchanges when possible. 889 Once the ISAKMP security association has been established (and 890 SKEYID_e and SKEYID_a have been generated) ISAKMP Information 891 Exchanges, when used with this protocol, are as follows: 893 Initiator Responder 894 ----------- ----------- 895 HDR*, HASH(1), N/D --> 897 where N/D is either an ISAKMP Notify Payload or an ISAKMP Delete 898 Payload and HASH(1) is the prf output, using SKEYID_a as the key, and 899 a M-ID unique to this exchange concatenated with the entire 900 informational payload (either a Notify or Delete) as the data. In 901 other words, the hash for the above exchange is: 903 HASH(1) = prf(SKEYID_a, M-ID | N/D) 905 As noted the message ID in the ISAKMP header-- and used in the prf 906 computation-- is unique to this exchange and MUST NOT be the same as 907 the message ID of another phase 2 exchange which generated this 908 informational exchange. The derivation of the initialization vector, 909 used with SKEYID_e to encrypt this message, is described in Appendix 910 B. 912 If the ISAKMP security association has not yet been established at 913 the time of the Informational Exchange, the exchange is done in the 914 clear without an accompanying HASH payload. 916 6 Oakley Groups 918 With ISAKMP/Oakley, the group in which to do the Diffie-Hellman 919 exchange is negotiated. Four groups-- values 1 through 4-- are 920 defined below. The attribute class for "Group" is defined in Appendix 921 A. All values 2^15 and higher are used for private group identifiers. 922 For a discussion on the strength of the default Oakley groups please 923 see the Security Considerations section below. 925 6.1 First Oakley Default Group 927 Oakley implementations MUST support a MODP group with the following 928 prime and generator. This group is assigned id 1 (one). 930 The prime is: 2^768 - 2 ^704 - 1 + 2^64 * { [2^638 pi] + 149686 } 931 Its hexadecimal value is 933 FFFFFFFF FFFFFFFF C90FDAA2 2168C234 C4C6628B 80DC1CD1 934 29024E08 8A67CC74 020BBEA6 3B139B22 514A0879 8E3404DD 935 EF9519B3 CD3A431B 302B0A6D F25F1437 4FE1356D 6D51C245 936 E485B576 625E7EC6 F44C42E9 A63A3620 FFFFFFFF FFFFFFFF 938 The generator is: 2. 940 6.2 Second Oakley Group 942 ISAKMP/Oakley implementations SHOULD support a MODP group with the 943 following prime and generator. This group is assigned id 2 (two). 945 The prime is 2^1024 - 2^960 - 1 + 2^64 * { [2^894 pi] + 129093 }. 946 Its hexadecimal value is 947 FFFFFFFF FFFFFFFF C90FDAA2 2168C234 C4C6628B 80DC1CD1 948 29024E08 8A67CC74 020BBEA6 3B139B22 514A0879 8E3404DD 949 EF9519B3 CD3A431B 302B0A6D F25F1437 4FE1356D 6D51C245 950 E485B576 625E7EC6 F44C42E9 A637ED6B 0BFF5CB6 F406B7ED 951 EE386BFB 5A899FA5 AE9F2411 7C4B1FE6 49286651 ECE65381 952 FFFFFFFF FFFFFFFF 954 The generator is 2 (decimal) 956 6.3 Third Oakley Group 958 ISAKMP/Oakley implementations SHOULD support a EC2N group with the 959 following characteristics. This group is assigned id 3 (three). The 960 curve is based on the Galois Field GF[2^155]. The field size is 155. 961 The irreducible polynomial for the field is: 962 u^155 + u^62 + 1. 963 The equation for the elliptic curve is: 964 y^2 + xy = x^3 + ax^2 + b. 966 Field Size: 155 967 Group Prime/Irreducible Polynomial: 968 0x0800000000000000000000004000000000000001 969 Group Generator One: 0x7b 970 Group Curve A: 0x0 971 Group Curve B: 0x07338f 973 Group Order: 0X0800000000000000000057db5698537193aef944 975 The data in the KE payload when using this group is the value x from 976 the solution (x,y), the point on the curve chosen by taking the 977 randomly chosen secret Ka and computing Ka*P, where * is the 978 repetition of the group addition and double operations, P is the 979 curve point with x coordinate equal to generator 1 and the y 980 coordinate determined from the defining equation. The equation of 981 curve is implicitly known by the Group Type and the A and B 982 coefficients. There are two possible values for the y coordinate; 983 either one can be used successfully (the two parties need not agree 984 on the selection). 986 6.4 Fourth Oakley Group 988 ISAKMP/Oakley implementations SHOULD support a EC2N group with the 989 following characteristics. This group is assigned id 4 (four). The 990 curve is based on the Galois Field GF[2^185]. The field size is 185. 991 The irreducible polynomial for the field is: 992 u^185 + u^69 + 1. The 993 equation for the elliptic curve is: 994 y^2 + xy = x^3 + ax^2 + b. 996 Field Size: 185 997 Group Prime/Irreducible Polynomial: 998 0x020000000000000000000000000000200000000000000001 999 Group Generator One: 0x18 1000 Group Curve A: 0x0 1001 Group Curve B: 0x1ee9 1003 Group Order: 0X01ffffffffffffffffffffffdbf2f889b73e484175f94ebc 1005 The data in the KE payload when using this group will be identical to 1006 that as when using Oakley Group 3 (three). 1008 Other groups can be defined using New Group Mode. These default 1009 groups were generated by Richard Schroeppel at the University of 1010 Arizona. Properties of these primes are described in [Orm96]. 1012 7. Payload Explosion for a Complete ISAKMP/Oakley Exchange 1014 This section illustrates how the ISAKMP/Oakley protocol is used to: 1016 - establish a secure and authenticated channel between ISAKMP 1017 processes (phase 1); and 1019 - generate key material for, and negotiate, an IPsec SA (phase 2). 1021 7.1 Phase 1 using Main Mode 1023 The following diagram illustrates the payloads exchanged between the 1024 two parties in the first round trip exchange. The initiator MAY 1025 propose several proposals; the responder MUST reply with one. 1027 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 1028 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1029 ~ ISAKMP Header with XCHG of Main Mode, ~ 1030 ~ and Next Payload of ISA_SA ~ 1031 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1032 ! 0 ! RESERVED ! Payload Length ! 1033 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1034 ! Domain of Interpretation ! 1035 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1036 ! Situation ! 1037 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1038 ! 0 ! RESERVED ! Payload Length ! 1039 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1040 ! Proposal #1 ! PROTO_ISAKMP ! SPI size = 0 | # Transforms ! 1041 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1042 ! ISA_TRANS ! RESERVED ! Payload Length ! 1043 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1044 ! Transform #1 ! KEY_OAKLEY | RESERVED2 ! 1045 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1046 ~ prefered SA attributes ~ 1047 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1048 ! 0 ! RESERVED ! Payload Length ! 1049 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1050 ! Transform #2 ! KEY_OAKLEY | RESERVED2 ! 1051 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1052 ~ alternate SA attributes ~ 1053 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1055 The responder replies in kind but selects, and returns, one transform 1056 proposal (the ISAKMP SA attributes). 1058 The second exchange consists of the following payloads: 1060 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 1061 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1062 ~ ISAKMP Header with XCHG of Main Mode, ~ 1063 ~ and Next Payload of ISA_KE ~ 1064 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1065 ! ISA_NONCE ! RESERVED ! Payload Length ! 1066 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1067 ~ D-H Public Value (g^xi from initiator g^xr from responder) ~ 1068 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1069 ! 0 ! RESERVED ! Payload Length ! 1070 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1071 ~ Ni (from initiator) or Nr (from responder) ~ 1072 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1074 The shared keys, SKEYID_e and SKEYID_a, are now used to protect and 1075 authenticate all further communication. Note that both SKEYID_e and 1076 SKEYID_a are unauthenticated. 1078 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 1079 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1080 ~ ISAKMP Header with XCHG of Main Mode, ~ 1081 ~ and Next Payload of ISA_ID and the encryption bit set ~ 1082 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1083 ! ISA_SIG ! RESERVED ! Payload Length ! 1084 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1085 ~ Identification Data of the ISAKMP negotiator ~ 1086 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1087 ! 0 ! RESERVED ! Payload Length ! 1088 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1089 ~ signature verified by the public key of the ID above ~ 1090 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1092 The key exchange is authenticated over a signed hash as described in 1093 section 5.1. Once the signature has been verified using the 1094 authentication algorithm negotiated as part of the ISAKMP SA, the 1095 shared keys, SKEYID_e and SKEYID_a can be marked as authenticated. 1096 (For brevity, certificate payloads were not exchanged). 1098 7.2 Phase 2 using Quick Mode 1100 The following payloads are exchanged in the first round of Quick 1101 Mode with ISAKMP SA negotiation. In this hypothetical exchange, the 1102 ISAKMP negotiators are proxies for other parties which have requested 1103 authentication. 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 Quick Mode, ~ 1108 ~ Next Payload of ISA_HASH and the encryption bit set ~ 1109 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1110 ! ISA_SA ! RESERVED ! Payload Length ! 1111 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1112 ~ keyed hash of message ~ 1113 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1114 ! ISA_NONCE ! RESERVED ! Payload Length ! 1115 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1116 ! Domain Of Interpretation ! 1117 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1118 ! Situation ! 1119 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1120 ! 0 ! RESERVED ! Payload Length ! 1121 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1122 ! Proposal #1 ! PROTO_IPSEC_AH! SPI size = 8 | # Transforms ! 1123 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1124 ~ SPI (8 octets) ~ 1125 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1126 ! ISA_TRANS ! RESERVED ! Payload Length ! 1127 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1128 ! Transform #1 ! AH_SHA | RESERVED2 ! 1129 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1130 ! other SA attributes ! 1131 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1132 ! 0 ! RESERVED ! Payload Length ! 1133 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1134 ! Transform #2 ! AH_MD5 | RESERVED2 ! 1135 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1136 ! other SA attributes ! 1137 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1138 ! ISA_ID ! RESERVED ! Payload Length ! 1139 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1140 ~ nonce ~ 1141 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1142 ! ISA_ID ! RESERVED ! Payload Length ! 1143 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1144 ~ ID of source for which ISAKMP is a client ~ 1145 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1146 ! 0 ! RESERVED ! Payload Length ! 1147 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1148 ~ ID of destination for which ISAKMP is a client ~ 1149 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1151 where the contents of the hash are described in 5.5 above. The 1152 responder replies with a similar message which only contains one 1153 transform-- the selected AH transform. Upon receipt, the initiator 1154 can provide the key engine with the negotiated security association 1155 and the keying material. As a check against replay attacks, the 1156 responder waits until receipt of the next message. 1158 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 1159 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1160 ~ ISAKMP Header with XCHG of Quick Mode, ~ 1161 ~ Next Payload of ISA_HASH and the encryption bit set ~ 1162 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1163 ! 0 ! RESERVED ! Payload Length ! 1164 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1165 ~ hash data ~ 1166 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1168 where the contents of the hash are described in 5.5 above. 1170 8 Perfect Forward Secrecy Example 1171 This protocol can provide PFS of both keys and identities. The 1172 identies of both the ISAKMP negotiating peer and, if applicable, the 1173 identities for whom the peers are negotiating can be protected with 1174 PFS. 1176 To provide Perfect Forward Secrecy of both keys and all identities, 1177 two parties would perform the following: 1178 o A Main Mode Exchange to protect the identities of the ISAKMP 1179 peers. 1180 This establishes an ISAKMP SA. 1181 o A Quick Mode Exchange to negotiate other security protocol 1182 protection. 1183 This establishes a SA on each end for this protocol. 1184 o Delete the ISAKMP SA and its associated state. 1185 Since the key for use in the non-ISAKMP SA was derived from the 1186 single ephemeral Diffie-Hellman exchange PFS is preserved. 1188 To provide Perfect Forward Secrecy of merely the keys of a non-ISAKMP 1189 security association, it in not necessary to do a phase 1 exchange if 1190 an ISAKMP SA exists between the two peers. A single Quick Mode in 1191 which the optional KE payload is passed, and an additional Diffie- 1192 Hellman exchange is performed, is all that is required. At this point 1193 the state derived from this Quick Mode must be deleted from the 1194 ISAKMP SA as described in section 5.5. 1196 9. Implementation Hints 1198 Using a single ISAKMP Phase 1 negotiation makes subsequent Phase 2 1199 negotiations extremely quick. As long as the Phase 1 state remains 1200 cached, and PFS is not needed, Phase 2 can proceed without any 1201 exponentiation. How many Phase 2 negotiations can be performed for a 1202 single Phase 1 is a local policy issue. The decision will depend on 1203 the strength of the algorithms being used and level of trust in the 1204 peer system. 1206 An implementation may wish to negotiate a range of SAs when 1207 performing Quick Mode. By doing this they can speed up the "re- 1208 keying". Quick Mode defines how KEYMAT is defined for a range of SAs. 1209 When one peer feels it is time to change SAs they simply use the next 1210 one within the stated range. A range of SAs can be established by 1211 negotiating multiple SAs (identical attributes, different SPIs) with 1212 one Quick Mode. 1214 An optimization that is often useful is to establish Security 1215 Associations with peers before they are needed so that when they 1216 become needed they are already in place. This ensures there would be 1217 no delays due to key management before initial data transmission. 1218 This optimization is easily implemented by setting up more than one 1219 Security Association with a peer for each requested Security 1220 Association and caching those not immediately used. 1222 Also, if an ISAKMP implementation is alerted that a SA will soon be 1223 needed (e.g. to replace an existing SA that will expire in the near 1224 future), then it can establish the new SA before that new SA is 1225 needed. 1227 The base ISAKMP specification describes conditions in which one party 1228 of the protocol may inform the other party of some activity-- either 1229 deletion of a security association or in response to some error in 1230 the protocol such as a signature verification failed or a payload 1231 failed to decrypt. It is strongly suggested that these Informational 1232 exchanges not be responded to under any circumstances. Such a 1233 condition may result in a "notify war" in which failure to understand 1234 a message results in a notify to the peer who cannot understand it 1235 and sends his own notify back which is also not understood. 1237 10. Security Considerations 1239 This entire draft discusses a hybrid protocol, combining parts of 1240 Oakley and parts of SKEME with ISAKMP, to negotiate, and derive 1241 keying material for, security associations in a secure and 1242 authenticated manner. 1244 Confidentiality is assured by the use of a negotiated encryption 1245 algorithm. Authentication is assured by the use of a negotiated 1246 method: a digital signature algorithm; a public key algorithm which 1247 supports encryption; or, a pre-shared key. The confidentiality and 1248 authentication of this exchange is only as good as the attributes 1249 negotiated as part of the ISAKMP security association. 1251 Repeated re-keying using Quick Mode can consume the entropy of the 1252 Diffie- Hellman shared secret. Implementors should take note of this 1253 fact and set a limit on Quick Mode Exchanges between exponentiations. 1254 This draft does not prescribe such a limit. 1256 Perfect Forward Secrecy (PFS) of both keying material and identities 1257 is possible with this protocol. By specifying a Diffie-Hellman group, 1258 and passing public values in KE payloads, ISAKMP peers can establish 1259 PFS of keys-- the identities would be protected by SKEYID_e from the 1260 ISAKMP SA and would therefore not be protected by PFS. If PFS of both 1261 keying material and identities is desired, an ISAKMP peer MUST 1262 establish only one non-ISAKMP security association (e.g. IPsec 1263 Security Association) per ISAKMP SA. PFS for keys and identities is 1264 accomplished by deleting the ISAKMP SA (and optionally issuing a 1265 DELETE message) upon establishment of the single non-ISAKMP SA. In 1266 this way a phase one negotiation is uniquely tied to a single phase 1267 two negotiation, and the ISAKMP SA established during phase one 1268 negotiation is never used again. 1270 The strength of a key derived from a Diffie-Hellman exchange using 1271 any of the groups defined here depends on the inherent strength of 1272 the group, the size of the exponent used, and the entropy provided by 1273 the random number generator used. Due to these inputs it is difficult 1274 to determine the strength of a key for any of the defined groups. The 1275 default Diffie-Hellman group (number one) when used with a strong 1276 random number generator and an exponent no less than 160 bits is 1277 sufficient to use for DES. Groups two through four provide greater 1278 security. Implementations should make note of these conservative 1279 estimates when establishing policy and negotiating security 1280 parameters. 1282 Note that these limitations are on the Diffie-Hellman groups 1283 themselves. There is nothing in ISAKMP/Oakley which prohibits using 1284 stronger groups nor is there anything which will dilute the strength 1285 obtained from stronger groups. In fact, the extensible framework of 1286 ISAKMP/Oakley encourages the definition of more groups; use of 1287 elliptical curve groups will greatly increase strength using much 1288 smaller numbers. 1290 For situations where defined groups provide insufficient strength New 1291 Group Mode can be used to exchange a Diffie-Hellman group which 1292 provides the necessary strength. In is incumbent upon implementations 1293 to check the primality in groups being offered and independently 1294 arrive at strength estimates. 1296 It is assumed that the Diffie-Hellman exponents in this exchange are 1297 erased from memory after use. In particular, these exponents must not 1298 be derived from long-lived secrets like the seed to a pseudo-random 1299 generator. 1301 11. Acknowledgements 1303 This document is the result of close consultation with Hugo Krawczyk, 1304 Douglas Maughan, Hilarie Orman, Mark Schertler, Mark Schneider, and 1305 Jeff Turner. It relies on protocols which were written by them. 1306 Without their interest and dedication, this would not have been 1307 written. 1309 Special thanks Rob Adams, Cheryl Madson, Derrell Piper, Harry Varnis, 1310 and Elfed Weaver for technical input, encouragement, and various 1311 sanity checks along the way. 1313 We would also like to thank the many members of the IPSec working 1314 group that contributed to the development of this protocol over the 1315 past year. 1317 12. References 1319 [Acm97] Adams, C.M., "The CAST-128 Encryption Algorithm", RFC 2144, 1320 May 1997. 1322 [Bra97] Bradner, S., "Key Words for use in RFCs to indicate 1323 Requirement Levels", RFC2119, March 1997. 1325 [KBC96] Krawczyk, H., Bellare, M., Canetti, R., "HMAC: Keyed-Hashing 1326 for Message Authentication", RFC 2104, February 1997. 1328 [Kra96] Krawczyk, H., "SKEME: A Versatile Secure Key Exchange 1329 Mechanism for Internet", from IEEE Proceedings of the 1996 Symposium 1330 on Network and Distributed Systems Security. 1332 [MSST97] Maughhan, D., Schertler, M., Schneider, M., and Turner, J., 1333 "Internet Security Association and Key Management Protocol (ISAKMP)", 1334 version 9, draft-ietf-ipsec-isakmp-09.{ps,txt}. 1336 [Orm96] Orman, H., "The Oakley Key Determination Protocol", version 1337 2, draft-ietf-ipsec-oakley-02.txt 1339 [Pip97] Piper, D., "The Internet IP Security Domain Of Interpretation 1340 for ISAKMP", version 5, draft-ietf-ipsec-ipsec-doi-04.txt. 1342 [Sch96] Schneier, B., "Applied Cryptography, Protocols, Algorithms, 1343 and Source Code in C", 2nd edition. 1345 Appendix A 1347 This is a list of DES Weak and Semi-Weak keys. The keys come from 1348 [Sch96]. All keys are listed in hexidecimal. 1350 DES Weak Keys 1351 0101 0101 0101 0101 1352 1F1F 1F1F E0E0 E0E0 1353 E0E0 E0E0 1F1F 1F1F 1354 FEFE FEFE FEFE FEFE 1356 DES Semi-Weak Keys 1357 01FE 01FE 01FE 01FE 1358 1FE0 1FE0 0EF1 0EF1 1359 01E0 01E0 01F1 01F1 1360 1FFE 1FFE 0EFE 0EFE 1361 011F 011F 010E 010E 1362 E0FE E0FE F1FE F1FE 1364 FE01 FE01 FE01 FE01 1365 E01F E01F F10E F10E 1366 E001 E001 F101 F101 1367 FE1F FE1F FE0E FE0E 1368 1F01 1F01 0E01 0E01 1369 FEE0 FEE0 FEF1 FEF1 1371 Attribute Assigned Numbers 1373 Attributes negotiated during phase one use the following definitions. 1374 Phase two attributes are defined in the applicable DOI specification 1375 (for example, IPsec attributes are defined in the IPsec DOI), with 1376 the exception of a group description when Quick Mode includes an 1377 ephemeral Diffie-Hellman exchange. Attribute types can be either 1378 Basic (B) or Variable-length (V). Encoding of these attributes is 1379 defined in the base ISAKMP specification. 1381 Attribute Classes 1383 class value type 1384 ------------------------------------------------------------------- 1385 Encryption Algorithm 1 B 1386 Hash Algorithm 2 B 1387 Authentication Method 3 B 1388 Group Description 4 B 1389 Group Type 5 B 1390 Group Prime/Irreducible Polynomial 6 V 1391 Group Generator One 7 V 1392 Group Generator Two 8 V 1393 Group Curve A 9 V 1394 Group Curve B 10 V 1395 Life Type 11 B 1396 Life Duration 12 B/V 1397 PRF 13 B 1398 Key Length 14 B 1399 Field Size 15 B 1400 Group Order 16 V 1402 Class Values 1404 - Encryption Algorithm 1405 DEC-CBC 1 1406 IDEA-CBC 2 1407 Blowfish-CBC 3 1408 RC5-R16-B64-CBC 4 1409 3DES-CBC 5 1410 CAST-CBC 6 1412 values 7-65000 are reserved. Values 65001-65535 are for private use 1413 among mutually consenting parties. 1415 - Hash Algorithm 1416 MD5 1 1417 SHA 2 1418 Tiger 3 1420 values 4-65000 are reserved. Values 65001-65535 are for private use 1421 among mutually consenting parties. 1423 - Authentication Method 1424 pre-shared key 1 1425 DSS signatures 2 1426 RSA signatures 3 1427 Encryption with RSA 4 1428 Revised encryption with RSA 5 1430 values 7-65000 are reserved. Values 65001-65535 are for private use 1431 among mutually consenting parties. 1433 - Group Description 1434 default 768-bit MODP group (section 6.1) 1 1436 alternate 1024-bit MODP group (section 6.2) 2 1437 .sp 1438 EC2N group on GP[2^155] (section 6.3) 3 1439 .sp 1440 EC2N group on GP[2^185] (section 6.4) 4 1442 values 5-32767 are reserved. Values 32768-65535 are for private use 1443 among mutually consenting parties. 1445 - Group Type 1446 MODP (modular exponentiation group) 1 1447 ECP (elliptic curve group over GF[P]) 2 1448 EC2N (elliptic curve group over GF[2^N]) 3 1450 values 4-65000 are reserved. Values 65001-65535 are for private use 1451 among mutually consenting parties. 1453 - Life Type 1454 seconds 1 1455 kilobytes 2 1457 values 3-65000 are reserved. Values 65001-65535 are for private use 1458 among mutually consenting parties. For a given "Life Type" the 1459 value of the "Life Duration" attribute defines the actual length of 1460 the SA life-- either a number of seconds, or a number of kbytes 1461 protected. 1463 - PRF 1464 3DES-CBC-MAC 1 1466 values 2-65000 are reserved. Values 65001-65535 are for private use 1467 among mutually consenting parties 1469 - Key Length 1471 When using an Encryption Algorithm that has a variable length key, 1472 this attribute specifies the key length in bits. (MUST use network 1473 byte order). 1475 - Field Size 1477 The field size, in bits, of a Diffie-Hellman group. 1479 - Group Order 1481 The group order of an elliptical curve group. Note the length of 1482 this attribute depends on the field size. 1483 Additional Exchanges Defined-- XCHG values 1484 Quick Mode 32 1485 New Group Mode 33 1487 Appendix B 1489 This appendix describes encryption details to be used ONLY when 1490 encrypting ISAKMP messages. When a service (such as an IPSEC 1491 transform) utilizes ISAKMP to generate keying material, all 1492 encryption algorithm specific details (such as key and IV generation, 1493 padding, etc...) MUST be defined by that service. ISAKMP does not 1494 purport to ever produce keys that are suitable for any encryption 1495 algorithm. ISAKMP produces the requested amount of keying material 1496 from which the service MUST generate a suitable key. Details, such 1497 as weak key checks, are the responsibility of the service. 1499 Use of negotiated PRFs may require the PRF output to be expanded. For 1500 instance, 3DES-CBC-MAC produces 8 bytes of output which must be used 1501 as a key to another 3DES-CBC-MAC function call. The output of a PRF 1502 is expanded by feeding back the results of the PRF into itself to 1503 generate successive blocks. These blocks are concatenated until the 1504 requisite number of bytes has been acheived. For example, for pre- 1505 shared key authentication with 3DES-CBC-MAC as the negotiated PRF: 1507 BLOCK1-8 = prf(pre-shared-key, Ni_b | Nr_b) 1508 BLOCK9-16 = prf(pre-shared-key, BLOCK1-8 | Ni_b | Nr_b) 1509 BLOCK17-24 = prf(pre-shared-key, BLOCK9-16 | Ni_b | Nr_b) 1510 and 1511 SKEYID = BLOCK1-8 | BLOCK9-16 | BLOCK17-24 1513 so therefore to derive SKEYID_d: 1515 BLOCK1-8 = prf(SKEYID, g^xy | CKY-I | CKY-R) 1516 BLOCK9-16 = prf(SKEYID, BLOCK1-8 | g^xy | CKY-I | CKY-R) 1517 BLOCK17-24 = prf(SKEYID, BLOCK9-16 | g^xy | CKY-I | CKY-R) 1518 and 1519 SKEYID_d = BLOCK1-8 | BLOCK9-16 | BLOCK17-24 1521 Subsequent PRF derivations are done similarly. 1523 Encryption keys used to protect the ISAKMP SA are derived from 1524 SKEYID_e in an algorithm-specific manner. When SKEYID_e is not long 1525 enough to supply all the necessary keying material an algorithm 1526 requires, the key is derived from feeding the results of a pseudo- 1527 random function into itself, concatenating the results, and taking 1528 the highest necessary bits. 1530 For example, if (ficticious) algorithm AKULA requires 320-bits of key 1531 (and has no weak key check) and the prf used to generate SKEYID_e 1532 only generates 120 bits of material, the key for AKULA, would be the 1533 first 320-bits of Ka, where: 1535 Ka = K1 | K2 | K3 1536 and 1537 K1 = prf(SKEYID_e, 0) 1538 K2 = prf(SKEYID_e, K1) 1539 K3 = prf(SKEYID_e, K2) 1541 where prf is the negotiated prf or the HMAC version of the negotiated 1542 hash function (if no prf was negotiated) and 0 is represented by a 1543 single octet. Each result of the prf provides 120 bits of material 1544 for a total of 360 bits. AKULA would use the first 320 bits of that 1545 360 bit string. 1547 In phase 1, material for the initialization vector (IV material) for 1548 CBC mode encryption algorithms is derived from a hash of a 1549 concatenation of the initiator's public Diffie-Hellman value and the 1550 responder's public Diffie-Hellman value using the negotiated hash 1551 algorithm. This is used for the first message only. Each message 1552 should be padded up to the nearest block size using bytes containing 1553 0x00. The message length in the header MUST include the length of the 1554 pad since this reflects the size of the cyphertext. Subsequent 1555 messages MUST use the last CBC encryption block from the previous 1556 message as their initialization vector. 1558 In phase 2, material for the initialization vector for CBC mode 1559 encryption of the first message of a Quick Mode exchange is derived 1560 from a hash of a concatenation of the last phase 1 CBC output block 1561 and the phase 2 message id using the negotiated hash algorithm. The 1562 IV for subsequent messages within a Quick Mode exchange is the CBC 1563 output block from the previous message. Padding and IVs for 1564 subsequent messages are done as in phase 1. 1566 After the ISAKMP SA has been authenticated all Informational 1567 Exchanges are encrypted using SKEYID_e. The initiaization vector for 1568 these exchanges is derived in exactly the same fashion as that for a 1569 Quick Mode-- i.e. it is derived from a hash of a concatenation of the 1570 last phase 1 CBC output block and the message id from the ISAKMP 1571 header of the Informational Exchange (not the message id from the 1572 message that may have prompted the Informational Exchange). 1574 Note that the final phase 1 CBC output block, the result of 1575 encryption/decryption of the last phase 1 message, must be retained 1576 in the ISAKMP SA state to allow for generation of unique IVs for each 1577 Quick Mode. Each post- phase 1 exchange (Quick Modes and 1578 Informational Exchanges) generates IVs independantly to prevent IVs 1579 from getting out of sync when two different exchanges are started 1580 simultaneously. 1582 In all cases, there is a single bidirectional cipher/IV context. 1584 Having each Quick Mode and Informational Exchange maintain a unique 1585 context prevents IVs from getting out of sync. 1587 The key for DES-CBC is derived from the first eight (8) non-weak and 1588 non-semi-weak (see Appendix A) bytes of SKEYID_e. The IV is the first 1589 8 bytes of the IV material derived above. 1591 The key for IDEA-CBC is derived from the first sixteen (16) bytes of 1592 SKEYID_e. The IV is the first eight (8) bytes of the IV material 1593 derived above. 1595 The key for Blowfish-CBC is either the negotiated key size, or the 1596 first fifty-six (56) bytes of a key (if no key size is negotiated) 1597 derived in the aforementioned pseudo-random function feedback method. 1598 The IV is the first eight (8) bytes of the IV material derived above. 1600 The key for RC5-R16-B64-CBC is the negotiated key size, or the first 1601 sixteen (16) bytes of a key (if no key size is negotiated) derived 1602 from the aforementioned pseudo-random function feedback method if 1603 necessary. The IV is the first eight (8) bytes of the IV material 1604 derived above. The number of rounds MUST be 16 and the block size 1605 MUST be 64. 1607 The key for 3DES-CBC is the first twenty-four (24) bytes of a key 1608 derived in the aforementioned pseudo-random function feedback method. 1609 3DES-CBC is an encrypt-decrypt-encrypt operation using the first, 1610 middle, and last eight (8) bytes of the entire 3DES-CBC key. The IV 1611 is the first eight (8) bytes of the IV material derived above. 1613 The key for CAST-CBC is either the negotiated key size, or the first 1614 sixteen (16) bytes of a key derived in the aforementioned pseudo- 1615 random function feedback method. The IV is the first eight (8) bytes 1616 of the IV material derived above. 1618 Support for algorithms other than DES-CBC is purely optional. Some 1619 optional algorithms may be subject to intellectual property claims. 1621 Authors' Addresses: 1623 Dan Harkins 1624 cisco Systems 1625 170 W. Tasman Dr. 1626 San Jose, California, 95134-1706 1627 United States of America 1628 +1 408 526 4000 1630 Dave Carrel 1631 76 Lippard Ave. 1632 San Francisco, CA 94131-2947 1633 United States of America 1634 +1 415 337 8469 1636 Authors' Note: 1638 The authors encourage independent implementation, and 1639 interoperability testing, of this hybrid protocol.