view Side-By-Side changes
IPSEC Working Group D. Harkins, D. Carrel, Editors INTERNET-DRAFT cisco Systemsdraft-ietf-ipsec-isakmp-oakley-00.txt Junedraft-ietf-ipsec-isakmp-oakley-01.txt November 1996 Expire in six months The resolution of ISAKMP with Oakley<draft-ietf-ipsec-isakmp-oakley-00.txt><draft-ietf-ipsec-isakmp-oakley-01.txt> Status of this Memo This document is an Internet Draft. Internet Drafts are working documents of the Internet Engineering Task Force (IETF), its areas, and working groups. Note that other groups may also distribute working documents as Internet Drafts. Internet Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inapproporiate to use Internet Drafts as reference material or to cite them other than as "work in progress." To learn the current status of any Internet Draft, please check the "1id-abstracts.txt" listing contained in the Internet Drafts Shadow Directories on ftp.is.co.za (Africa), nic.nordu.net (Europe), munnari.oz.au (Australia), ds.internic.net (US East Coast), or ftp.isi.edu (US West Coast). 1. Abstract [MSST96] (ISAKMP) provides a framework for authentication and key exchange but does not define them. ISAKMP is designed to be key exchange independant; that is, it is designed to support many different key exchanges. [Orm96] (Oakley) describes a series of key exchanges-- called "modes"-- and details the services provided by each (e.g. perfect forward secrecy for keys, identityprotetion,protection, and authentication). This document describes a proposal for using the Oakley Key Exchange Protocol in conjunction with ISAKMP to obtain authenticated keying material for use with ISAKMP, and for other security associations such as AH and ESP for theISAKMP InternetIETF IPsec DOI. 2. Discussion This draft combines ISAKMP and Oakley. The purpose is to negotiate, and provide authenticated keying material for, security associations Harkins, Carrel [Page 1] INTERNET DRAFT June 1996 in a protected manner. Processes which implement this draft can be used for negotiating virtual private networks (VPNs) and also for providing a remote user from a remote site (whose IP address need not be known beforehand) access to a secure host or network. Proxynegotiation-- in whichnegotiation is supported. Proxy mode is where the negotiating parties are not the endpoints for which security association negotiation is takingplace-- is supported.place. When used in proxy mode, the identities of the endparties,parties remain hidden. This proposal does not implement the entire Oakley protocol, but onlythe smallesta subset necessary to satisfy its goals. It does not claim conformance or compliance with the entire Oakley protocol. For greater understanding of the Oakley protocol and the mathematics behind it, please refer to [Orm96]. 3. Terms and Definitions 3.1 Requirements Terminology In this document, the words that are used to define the significance of each particular requirement are usually capitalised. These words are: - MUST This word or the adjective "REQUIRED" means that the item is an absolute requirement of the specification. - SHOULD This word or the adjective "RECOMMENDED" means that there might exist valid reasons in particular circumstances to ignore this item, but the full implications should be understood and the case carefully weighed before taking a different course. - MAY This word or the adjective "OPTIONAL" means that this item is truly optional. One vendor might choose to include the item because a particular marketplace requires it or because it enhances the product, for example; another vendor may omit the same item. Harkins, Carrel [Page 2] INTERNET DRAFT June 1996 3.2 Notation The following notation is used throughout this draft. HDR is an ISAKMP header whose exchange type is themodemode. When writen as HDR* it indicates payload encryption. SA is an SA negotiation payload with one or more proposals. An initiator MAY provide multiple proposals for negotiation; a responder MUST reply with only one. SAp is the entire body of the SA payload (minus the SA header)-- i.e. all proposals and transforms offered by the Initiator. KE is the key exchange payload.NONCENx is the noncepayloadpayload; x can be: i or r for the ISAKMP initiator and responder respectively. IDx is the identity payload for "x". x can be: "ii" or "ir" for the ISAKMP initiator and responder respectively during phase one negotiation; or "ui" or "ur" for the user initiator and responder respectively during phase two. The ID payload format for the Internet DOI is defined inAppendix A of [MSST96].[Pip96]. SIG is the signature payload. The data to sign is exchange- specific. CERT is the certificate payload. HASH is the hash payload.ENV{} is the envelope payload.Thebraces are not partcontents of theprotocol but are included to illustrate the payloads whichhash areenveloped. These follow the envelope payload.exchange specific. prf() is the keyed hash function negotiated as part of the ISAKMP SA.SKEYID = prf(Ni | Nr, g^xy | cookie-I | Cookie-R).SKEYID_e is the keying material used by the ISAKMP SA to protect it's messages. SKEYID_a is the keying material used by the ISAKMP SA to authenticate it's messages. <x>y indicates that "x" is encrypted with the key "y". --> signifies "initiator to responder" communication (requests). <-- signifies "responder to initiator" communication (replies). Harkins, Carrel [Page 3] INTERNET DRAFT June 1996 | signifies concatenation of information-- e.g. X | Y is the concatentation of X with Y. [x] indicates that x is optional. Payload encryption (when noted by a '*' after the ISAKMP header) MUST begin immediately after the ISAKMP header. When communication is protected, all payloads following the ISAKMP header MUST be encrypted. Encryption keys are generated from SKEYID_e in a manner that is defined for each algorithm. 3.3 Perfect Forward Secrecy When used in the draft Perfect Forward Secrecy (PFS) refers to the notion that compromise of a single key will permit access to only data protected by a single key. For PFS to exist the key used to protect transmission of data MUST NOT be used to derive any additional keys, and if the key used to protect transmission of data was derived from some other keying material, that material MUST NOT be used to derive any more keys. Perfect Forward Secrecy for both keys and identities is provided in this protocol. (Sections 5.7 and 7). 3.4 Security Association A security association (SA) is a set of policy and key used to protect information. The ISAKMP SA is the shared policy and key used by the negotiating peers in this protocol to protect their communication. Harkins, Carrel [Page3]4] INTERNET DRAFT June 1996 4.Introductuction SinceIntroducttion Oakley defines a method to establish an authenticated keyexchange--exchange. This includes how payloads are constructed, the information they carry, the order in which they are processed and how they areused-- its modesused. While Oakley defines "modes", ISAKMP defines "phases". The relationship between the two is very straightforward. ISAKMP's phase 1 is where the two ISAKMP peers establish a secure, authenticated channel with which to communicate. This is called the ISAKMP Security Association (SA). Oakley's "Main Mode" and "Aggressive Mode" each accomplish a phase 1 exchange. "Main Mode" and "Aggressive Mode" MUST ONLY bevalidused in phase 1. Phase 2 is where Security Associations are negotiated on behalf of services such as AH, ESP or any other service which needs key material and/or parameter negotiation. Oakley's "Quick Mode" accomplishes a phase 2 exchange. "Quick Mode" MUST ONLY be used in phase 2. Oakley's "New Group Mode" is not really a phase 1 or phase 2. It follows phase 1, but serves to establish a new group which can be used in future negotiations. "New Group Mode" MUST ONLY be used in phase 2. With the use of ISAKMPexchange types.phases, an implementation can accomplish very fast keying when necessary. A single phase 1 negotiation may be used for more than one phase 2 negotiation. Additionally a single phase 2 negotiation can request multiple Security Associations. With these optimizations, an implementation can see less than one round trip per SA as well as less than one DH exponentiation per SA. "Main Mode" for phase 1 provides identity protection. When identity protection is not needed, "Aggressive Mode" can be used to reduce round trips even further. Developer hints for doing these optimizations are included below. The following attributes are required by Oakley and MUST be negotiated as part of the ISAKMP SecurityAssociation:Association. (These attributes pertain only to the ISAKMP Security Association and not to any Security Associations that ISAKMP may be negotiating on behalf of other services.) - encryption algorithm (e.g. DES, IDEA, Blowfish). - hash algorithm (e.g. MD5, SHA) - authenticationalgorithmmethod (e.g.DSS, RSA)DSS sig, RSA sig, RSA encryption, pre-shared key) Harkins, Carrel [Page 5] INTERNET DRAFT June 1996 - information about a group over which to do Diffie-Hellman. The selected hash algorithm MUST support both keyed and unkeyed modes. Oakley implementations MUST support the following default attributes: - DES-CBC with a weak, and semi-weak, key check (weak and semi- weak keys aredefinedreferenced in [Sch94] and listed in[Sch94]).Appendix A). Thefirst 8 non-weak bytes of keying material are used for the DES key.key is derived according to Appendix B. - MD5 and SHA in native and HMACmode.mode [KBC96]. - Authentication via pre-shared keys. The Digital SignatureStandard.Standard SHOULD be supported; RSA SHOULD also be supported. - MODP over the default Oakley group (see below). ECP and EC2N groups MAY be supported.In the Internet DOI,The Oakley modes described here MUST besupported as a key exchange protocol. All otherimplemented whenever the IETF IPsec DOI [Pip96] is implemented. Other DOIs MAY use the Oakleyprovided they implement the mandatorymodes describedbelow.here. 5. Exchanges There are two basic methods used to establish an authenticated key exchange: Oakley Main Mode and OakleyAgressiveAggressive Mode. Each generates authenticated keying material from an ephemeral Diffie-Hellman exchange. Oakley in Main Mode MUST be implemented; Oakley Aggressive Mode SHOULD be implemented. In addition, Oakley Quick Mode MUST be implemented as a mechanism to generate fresh keyingmaterial. Oakley Quick Mode will provide keyingmaterialfor alland negotiate non-ISAKMP securityassociations negotiated with ISAKMP except the ISAKMP SA itself.services. In additon, Oakley New Group Mode SHOULD be implemented as a mechanism to define private groups forHarkins, Carrel [Page 4] INTERNET DRAFT June 1996Diffie-Hellman exchanges. Implementations MUST NOT switch exchange types in the middle of an exchange. Exchangesareconform to standardISAKMP-- e.g. timeout and retransmit;ISAKMP [MSST96] payload syntax. attribute encoding, timeouts and retransmits of messages, and informational messages-- e.g a notify response isgiven whensent when, for example, a proposal is unacceptable, or a signature verification or decryption was unsuccessful, etc.5.1 Oakley Main ModeOakley Main Modein conjunction with ISAKMP is described as follows: Initiator Responder ---------- ----------- HDR, SA --> <-- HDR, SA HDR, KE, NONCE(Ni) --> <-- HDR, KE, NONCE(Nr) HDR*, IDii, SIG [, CERT] --> <-- HDR*, IDir, SIG [, CERT] where the signature in SIGisa hashan instantiation of theconcatenation ofISAKMP Identity Protect Exchange: The first two messages negotiate policy; thecookies, g^xy, nonces,next two exchange Diffie-Hellman public values and ancillary data (e.g. nonces) necessary for the exchange; andIDs usingthe last two messages authenticate the Diffie-Hellman Exchange. The authentication method negotiatedhash function. One or more certificate payloads MAY be optionally passed. 5.2 Oakley Aggressive Mode Oakley Aggressive mode in conjunction with ISAKMP is describedasfollows: Initiator Responder ----------- ----------- HDR, SA, KE, NONCE, IDii --> <-- HDR, SA, KE, NONCE, IDir, SIG [, CERT] HDR, SIG [, CERT] --> where the signature in SIG is a hashpart of theconcatenation ofinitial ISAKMP exchange influences thecookies, g^xy, nonces, and IDs usingHarkins, Carrel [Page 6] INTERNET DRAFT June 1996 composition of thenegotiated hash function. One or more certificatepayloadsMAY be optionally passed. 5.3but not their purpose. The XCHG for OakleyQuickMain Mode is ISAKMP Identity Protect. Similarly, OakleyQuickAggressive Mode isnot a complete exchange itself, but is used as partan instantiation of the ISAKMPSA negotiation process (phase 2) to derive keying material for the SA being negotiated. When used with SA negotiation,Base Exchange. The first two messages negotiate policy, exchange Diffie-Hellman public values and ancillary data necessary for theinformation exchanged along with Oakley Quick Mode MUST be protected byexchange, and identities. In addition theISAKMP SA-- i.e. all payloads exceptsecond message authenticates theISAKMP header are encrypted. Harkins, Carrel [Page 5] INTERNET DRAFT June 1996 Quick Mode is essentially an exchange of nonces that provides replay protection. The nonces are used to generate fresh key material.responder. Theenvelope payload is used to group related payloads--third message authenticates thenegotiation proposal(s), nonce,initiator andhash result-- into entities which MUST be treated asprovides awhole. In ISAKMP forproof of participation in theInternet DOI, Quickexchange. The XCHG for Oakley Aggressive Modeappears as follows Initiator Responder ----------- ----------- HDR*, ENV{SA, Ni, HASH(1)} [, IDui, IDur ] --> <-- HDR*, ENV{SA, Nr, HASH(2)} [, IDui, IDur ] HDR*, ENV{HASH(3)} --> Where: HASH(1)is ISAKMP Base Exchange. The final message is not sent under protection of the ISAKMP SA allowing each party to postpone exponentiation, if desired, until negotiation of this exchange is complete. The result of either exchange is two groups of authenticated keying material: SKEYID_e =prf( SKEYID,prf(g^xy, Ni) HASH(2) = prf( SKEYID, 1| Nr |Ni ) HASH(3) = prf( SKEYID, 0CKY-I |NiCKY-R |Nr ) The new keying material is defined as KEYMATIDii | IDir | 0) SKEYID_a =prf(SKEYID,prf(g^xy, Ni |Nr)Nr | CKY-I | CKY-R | IDii | IDir | 1) andMAY beagreed upon policy to protect further communications. The values of 0 and 1 above are represented by a single octet. The key used for encryption is derived from SKEYID_e in an algorithm-specific manner (see appendix B). Quick Mode and New Group Mode have no analog in ISAKMP. The XCHG values for Quick Mode and New Group Mode are defined in Appendix A. As mentioned above, the negotiatedSA. If ISAKMP is acting as a proxy negotiator on behalf of another partyauthentication method influences theidentitiescontent and use ofthe parties MUST be passed as IDui and IDur. Local policy will dictate whether the proposals are acceptiblemessages forthe identities specified. If IDs arePhase 1 Oakley Modes, but notexchanged,their intent. When using public keys for authentication, thenegotiation is assumed toPhase 1 Oakley can bedone on behalf of each ISAKMP peer. If an ID range (see Appendix A of [MSST96]) is not acceptable (for example,accomplished either by using signatures or by using public key encryption (if thespecified subnetalgorithm supports it). Following are Main Mode Exchanges with different authentication options. Harkins, Carrel [Page 7] INTERNET DRAFT June 1996 5.1 ISAKMP/Oakley Phase 1 Authenticated With Signatures Using signatures, the ancillary information exchanged during the second roundtrip are nonces; the exchange istoo large) an BAD_ID_RANGE notify message followedauthenticated byan acceptible ID range, in an ID payload, MUST be sent. Multiple SA's and keys can be negotiatedsigning a mutually obtainable hash. Oakley Main Mode withone exchangesignature authentication is described as follows: Initiator Responder ---------- ----------------------HDR, SA --> <-- HDR, SA HDR, KE, Ni --> <-- HDR, KE, Nr HDR*,ENV1{SA1, Ni1, HASH1(1)}, ENV2{SA2, Ni2, HASH2(1)} [, IDui, IDurIDii, [ CERT, ] SIG --> <-- HDR*,ENV1{SA1, Nr1, HASH1(2)}, ENV2{SA2, Nr2, HASH2(2)} [, IDui, IDurIDir, [ CERT, ]HDR*, ENV1{HASH1(3)},SIG Oakley Aggressive mode with signatures in conjunction with ISAKMP is described as follows: Initiator Responder ----------- ----------- HDR, SA, KE, Ni, IDii -->ENV2{HASH2(3)} Harkins, Carrel [Page 6] INTERNET DRAFT June 1996 Each enveloped entity<-- HDR, SA, KE, Nr, IDir, [ CERT, ] SIG HDR, [ CERT, ] SIG --> In both modes, the signed data in SIG isevaluated alone, componentsa signature ofentities MUST NOT be swapped. The initiatora keyed hash of theprotocol can impose a selection criterion onconcatenation of theresponder by usingnonces, cookies, theCollate bit inentire SA offer-- everything following theISAKMP header. When this bit is setSA header-- that was sent from Initiator to Responder, and theresponder MUST selectsender's ID, with g^xy as thesame ordinal proposal for all entities-- e.g. proposal three for ENV1 and proposal three for ENV2. 5.4 Oakley New Group Mode Oakley New Group Mode MUST NOT be used priorkey toestablishment of an ISAKMP SA.the hash function. Thedescriptionorder ofa new group MUST only follow phase 1 negotiation. (It is not a phase 2 exchange, though). Initiator Responder ----------- ----------- HDR*, SA --> <-- HDR*, SA The proposalthe nonces, and cookies are specific to the direction. In other words, the sender signs, HASH_I, and the responder signs HASH_R where: HASH_I = prf(g^xy, Ni | Nr | CKY-I | CKY-R | SAp | IDii)) HASH_R = prf(g^xy, Nr | Ni | CKY-R | CKY-I | SAp | IDir)) In general the keyed hash will bean Oakley proposal which specifiesthecharacteristicsHMAC version of thegroup (see A.6 in [MSST96], "Oakley Attribute Classes"). Group descriptions for private Oakley Groups MUSTnegotiated hash function. This can begreater than or equal to 2^31. Ifoverridden for construction of thegroup is not acceptable,signature if theresponder MUST reply withsignature algorithm is tied to aNotify payload withparticular hash algorithm. In this case, themessage type setnegotiated hash function would continue toGROUP_NOT_ACCEPTABLE (13). ISAKMP implementationsbe used for all other proscribed hashing functions. One or more certificate payloads MAYrequire private groups to expire with the SA under which they were established. Groups maybedirectly negotiated in the SA proposal withoptionally passed. Harkins, Carrel [Page 8] INTERNET DRAFT June 1996 5.2 OakleyMain Mode. To do thisPhase 1 Authenticated With Public Key Encryption Using public key encryption to authenticate thePrime, Generator, and Group Type are passed as SA attributes (see Appendix A in [MSST96]). Alternately,exchange, thenature ofancillary information exchanged is encrypted nonces. Each party's ability to reconstruct a hash (proving that thegroup can be hidden using Oakley New Group Mode and onlyother party decrypted thegroup identifiernonce) authenticates the exchange. In order to perform the public key encryption, the initiator must already have the responder's public key. In the case where a party has multiple public keys, a hash of the certificate the initiator is using to encrypt the ancillary information is passedinas part of theclear during Main Mode. 5.5 Oakley Groups [Orm96] defines several groups. The value 0 indicates no group. The value 1 indicatesthird message. In this way thedefault group described below. Other valuesresponder can determine which corresponding private key to use to decrypt the nonce and identity protection is retained. In addition, the identities of the parties (IDii and IDir) are alsodefined in [Orm96]. All values 2^31encrypted with the other parties public key. If the authentication method is public key encryption, the nonce andhigher are used for private group identifiers. 5.5.1 Oakley Default Group Oakley implementationsidentity payloads MUSTsupport a MODP groupbe encrypted with thefollowing prime and generator. This grouppublic key of the other party. When using encrytion for authentication with Oakley, Main Mode isassigned id 1 (one). The prime is: 2^768 - 2 ^704 - 1 + 2^64 * { [2^638 pi] + 149686 } Its hexadecimal valuedefined as follows. Initiator Responder ----------- ----------- HDR, SA --> <-- HDR, SA HDR, KE, [ HASH(1), ] <IDii>PubKey_r, <Ni>PubKey_r --> HDR, KE, <IDir>PubKey_r, <-- <Nr>PubKey_i HDR*, HASH_I --> <-- HDR*, HASH_R Oakley Aggressive Mode authenticated with encryption is described as follows: Initiator Responder ----------- ----------- HDR, SA, [ HASH(1),] KE, <IDii>Pubkey_r, <Ni>PubKey_r --> HDR, SA, KE, <Nr>PubKey_i, <-- IDir, HASH_R HDR, HASH_I --> Where HASH(1) is a hash (using the negotiated hash function) of the Harkins, Carrel [Page7]9] INTERNET DRAFT June 1996FFFFFFFF FFFFFFFF C90FDAA2 2168C234 C4C6628B 80DC1CD1 29024E08 8A67CC74 020BBEA6 3B139B22 514A0879 8E3404DD EF9519B3 CD3A431B 302B0A6D F25F1437 4FE1356D 6D51C245 E485B576 625E7EC6 F44C42E9 A63A3620 FFFFFFFF FFFFFFFFcertificate which the initiator is using to encrypt the nonce and identity. Thegenerator is: 2.contents of the othergroups can be defined using Oakley New Group Mode. This default group was generated by Richard Schroeppel athashes (HASH_I and HASH_R) are theUniversityresults ofArizona. Propertiesthe HMAC version ofthis prime are described bythefollowing exerpt from [Orm96]: The prime for this group was selected to have certain properties. The high order 64 bits are forced to 1. This helpshash algorithm negotiated in theclassical remainder algorithm, becausefirst roundtrip, with a concatenation of thetrial quotient digit can always be takennonces as thehigh order wordkey and a concatenation of thedividend, possibly +1. The low order 64 bits are forced to 1. This helpsshared secret, theMontgomery-style remainder algorithms, becausecookies, themultiplier digit can always be takenentire SA offer-- everything following the SA header-- that was sent from Initiator tobeResponder, and thelowsender's ID as the hashed data. The orderwordof thedividend. The middle bitsnonces and cookies aretaken fromspecific to thebinary expansion of pi. This guarantees that they are effectively random, while avoiding any suspiciondirection. In other words: HASH_I = prf(Ni | Nr, g^xy | CKY-I | CKY-R | SAp | IDii)) HASH_R = prf(Nr | Ni, g^xy | CKY-R | CKY-I | SAp | IDir)) Using encryption for authentication provides for a plausably deniable exchange. There is no proof (as with a digital signature) that theprimes have secretly been selected toconversation ever took place since each party can completely reconstruct both sides of the exchange. Note that, unlike other authentication methods, authentication with public key encryption allows for identity protection with Aggressive Mode. 5.3 Oakley Phase 1 Authenticated With a Pre-Shared Key A key derived by some out-of-band mechanism may also beweak.used to authenticate the exchange. Theprimeactual establishment of this key ischosen to beout of the scope of this document. When doing aSophie-Germain prime (i.e., (P-1)/2pre-shared key authentication with Oakley, Main Mode isalso prime), to have the maximum strength against the square-root attack.defined as follows Initiator Responder ---------- ----------- HDR, SA --> <-- HDR, SA HDR, KE, Ni --> <-- HDR, KE, Nr HDR*, IDii, HASH_I --> <-- HDR*, IDir, HASH_R Oakley Aggressive mode with a pre-shared key is described as follows: Initiator Responder ----------- ----------- HDR, SA, KE, Ni, IDii --> <-- HDR, SA, KE, Nr, IDir, HASH_R HDR, HASH_I --> Harkins, Carrel [Page 10] INTERNET DRAFT June 1996 Thestarting trial numbers were repeatedly incremented by 2^64 until suitable primes were located. Because this primehash iscongruentthe result of the HMAC version of the hash algorithm negotiated in the first roundtrip with the pre-shared key as the key to7 (mod 8), 2 isthe HMAC, and aquadratic residue. All powersconcatenation of2 will also be quadratic residues. This prevents an opponentthe shared secret, the nonces, the cookies, the complete SA offer-- everything following the SA header-- sent fromlearningInitiator to Responder, and thelowsender's ID. The orderbitof theDiffie-Hellman exponent. Using 2 as a generator is efficient for some modular exponentiation algorithms. [Note thatcookies and nonces are specific to the direction. In other words, HASH_I = prf(pre-shared-key, g^xy | Ni | Nr | CKY-I | CKY-R | SAp | IDii) HASH_R = prf(pre-shared-key, g^xy | Nr | Ni | CKY-R | CKY-I | SAp | IDir) 5.4 Oakley Phase 2 - Quick Mode Oakley Quick Mode istechnicallynot agenerator in the number theory sense, because it omits half of the possible residues mod P. From a cryptographic viewpoint, thiscomplete exchange itself, but isa virtue.] A further discussionused as part of theproperties of this group, the motivation behind its creation, as well as the definition of several more groups can be found in [Orm96]. Harkins, Carrel [Page 8] INTERNET DRAFT June 1996 5.6 Payload ExplosionISAKMP SA negotiation process (phase 2) to derive keying material and negotiate shared policy forComplete ISAKMP-Oakley Exchange This section illustrates hownon-ISAKMP SAs. The information exchanged along with Oakley Quick Mode MUST be protected by the ISAKMP SA-- i.e. all payloads except the ISAKMP header are encrypted. Quick Mode is essentially an exchange of nonces that provides replay protection. The nonces are usedwith Oakley to: - establish a secure and authenticated channel between ISAKMP processes (phase 1); and -to generate fresh key materialfor,andnegotiate,prevent replay attacks from generating bogus security associations. An optional Key Exchange payload can be exchanged to allow for anIPsec SA (phase 2). 5.6.1 Phase 1 using Oakley Mainadditional Diffie-Hellman exchange and exponentiation per Quick Mode. While use of the key exchange payload with Quick ModeThe following diagram illustratesis optional it MUST be supported. Base Quick Mode (without thepayloads exchanged betweenKE payload) refreshens thetwo partieskeying material derived from the exponentiation in phase 1. This does not provide PFS. Using thefirst round trip exchange. The initiator MAY propose several proposals;optional KE payload, an additional exponentiation is performed and PFS is provided for theresponderkeying material. If a KE payload is sent, a Diffie-Hellman group (see section 5.5.1 and Appendix A) MUSTreply with one. 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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ~ ISAKMP Header with XCHG of Oakley Main Mode, ~ ~ and Next Payload of ISA_INIT ~ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ! 0 ! RESERVED ! Payload Length ! +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ! Domain of Interpretation (Internet DOI) ! +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ! ! ~ Situation ~ ! ! +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ! ! ~ ISAKMP SA Proposal(s) ~ ! ! +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ The second exchange consistsbe sent as attributes of thefollowing payloads: 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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ~ ISAKMP Header with XCHG of Oakley Main Mode, ~ ~ and Next Payload of ISA_KE ~ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ! ISA_NONCE ! RESERVED ! Payload Length ! +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ~ D-H Public Value (g^x from initiator g^y from responder) ~ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ! 0 ! RESERVED ! Payload Length ! +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ~SA being negotiated. Quick Mode is defined as follows: Initiator Responder ----------- ----------- HDR*, HASH(1), SA, Ni(from initiator) or[, KE ] [, IDui, IDur ] --> <-- HDR*, HASH(2), SA, Nr(from responder) ~ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+[, KE ] [, IDui, IDur ] HDR*, HASH(3) --> Harkins, Carrel [Page9]11] INTERNET DRAFT June 1996A shared key, SKEYID = prf(Ni | Nr, g^xy | Cookie-I | Cookie-R) where "prf" isWhere: HASH(1) and HASH(2) are keyed hashes of the entire message that follows the hash including payload headers, and HASH(3)-- for liveliness-- is a keyed hashfunction negotiatedof the value zero represented asparta single octet, followed by a concatenation of theISAKMP SA, is now used to protect all further communication. Note that SKEYID is unauthenticated. 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 9two nonces. For example, the hashes for the above exchange would be: HASH(1) = prf( SKEYID_a, SA | Ni [ | KE ] [ | IDui | IDur ] ) HASH(2) = prf( SKEYID_a, SA | Nr [ | KE ] [ | IDui | IDur ] ) HASH(3) = prf( SKEYID_a, 01 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ~ ISAKMP Header with XCHG of Oakley Main Mode, ~ ~ and Next Payload of ISA_ID| Ni | Nr ) If PFS is not needed, and KE payloads are not exchanged, theencryption bit set ~ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ! ISA_SIG ! RESERVED ! Payload Length ! +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ~ Identification Data ofnew keying material is defined as KEYMAT = prf(SKEYID_e, Ni | Nr | 0). If PFS is desired and KE payloads were exchanged, theISAKMP negotiator ~ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ! 0 ! RESERVED ! Payload Length ! +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ~ signature verified bynew keying material is defined as KEYMAT = prf(g(qm)^xy, Ni | Nr | 0), where g(qm)^xy is thepublic key ofshared secret from theID above ~ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ The keyephemeral Diffie-Hellman exchange of this Quick Mode. In either case, 0 isauthenticated overrepresented by asigned hash of the cookies,single octet. For situations where thenonces,amount of keying material desired is greater than that supplied by theidentities,prf, KEYMAT is expanded by concatenation andg^xy. Oncerehashing with a monotonically increasing number represented by a single octet, i.e. KEYMAT = prf(SKEYID_e, Ni | Nr | 0) | prf(SKEYID_e, Ni | Nr | 1) ... repeated until thesignaturerequired keying material has beenverified usingreached. This keying material (whether with PFS or without, and whether derived directly or through concatenation) MUST be used with theauthentication algorithmnegotiatedas part ofSA. It is up to theISAKMP SA,service to define how keys are derived from theshared key, SKEYID can be marked as authenticated. (For brevity, certificate payloads were not exchanged). 5.6.2 Phase 2 using Oakley Quick Mode The following payloads are exchanged inkeying material (see Appendix B). In thefirst roundcase ofOakleyan ephemeral Diffie-Hellman exchange in QuickMode with ISAKMP SA negotiation. In this hypothetical exchange,Mode, the exponential (g(qm)^xy) is irretreivably removed from the current state and SKEYID_e and SKEYID_a (derived from phase 1 negotiation) continue to protect and authenticate the ISAKMPnegotiatorsSA. If ISAKMP is acting as a proxy negotiator on behalf of another party the identities of the parties MUST be passed as IDui and IDur. Local policy will dictate whether the proposals areproxiesacceptible forother parties which have requested security.the identities specified. If IDs are not exchanged, the negotiation is assumed to be done on behalf of each ISAKMP peer. If an ID range (see Appendix A of [Pip96]) is not acceptable (for example, the specified subnet is too large) a BAD_ID_RANGE notify message followed Harkins, Carrel [Page10]12] INTERNET DRAFT June 19960 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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ~ ISAKMP Header with XCHG of Oakleyby an acceptible ID range, in an ID payload, MUST be sent. Harkins, Carrel [Page 13] INTERNET DRAFT June 1996 Using Quick Mode,~ ~ Next Payload of ISA_ENVmultiple SA's and keys can be negotiated with one exchange as follows: Initiator Responder ----------- ----------- HDR*, HASH(1), SA0, SA1, Ni, [, KE ] [, IDui, IDur ] --> <-- HDR*, HASH(2), SA0, SA1, Nr, [, KE ] [, IDui, IDur ] HDR*, HASH(3) --> and theencryption bit set ~ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ! ISA_INIT ! # of payloads ! Protocol ID ! +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ~ SPIs (each party specifies his own) ~ ~ ~ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ! ISA_NONCE ! RESERVED ! Payload Length ! +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ! Domain of Interpretation (Internet DOI) ! +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ! ! ~ Situation ~ ! ! +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ! ! ~ IPSec ESP Proposal(s) ~ ! ! +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ! ISA_HASH ! RESERVED ! Payload Length ! +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ~keying material for SAx is prf(SKEYID_e, Ni(from initiator) or| Nr(from responder) ~ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ! ISA_ID ! RESERVED ! Payload Length ! +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ~ hash data ~ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ! ISA_ID ! RESERVED ! Payload Length ! +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ~ ID| x) where x is the number ofsourcethe SA negotiated (starting with zero). (In the case where one, or all, of the SAs required keys longer than that supplied by the prf, the number merely monotonically increases forwhichthis entire exchange-- e.g. SA0 uses 0 and 1; SA1 uses 2 and 3; etc). For ease of processing the HASH payloads MUST immediately follow the ISAKMP header and precede all other payloads. 5.4 Oakley New Group Mode Oakley New Group Mode MUST NOT be used prior to establishment of an ISAKMP SA. The description of a new group MUST only follow phase 1 negotiation. (It is not aproxy ~ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ! 0 ! RESERVED ! Payload Length ! +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ~ IDphase 2 exchange, though). Initiator Responder ----------- ----------- HDR*, HASH(1), SA --> <-- HDR*, HASH(2), SA where HASH(1) is a keyed hash, using SKEYID_a as the key, and the entire SA proposal, body and header, as the data; HASH(2) is a keyed hash, using SKEYID_a as the key, and the reply as the data. The proposal will be an Oakley proposal which specifies the characteristics ofdestinationthe group (see appendix A, "Oakley Attribute Assigned Numbers"). Group descriptions forwhich ISAKMPprivate Oakley Groups MUST be greater than or equal to 2^15. If the group is not acceptable, the responder MUST reply with a Notify payload with the message type set to GROUP_NOT_ACCEPTABLE (13). ISAKMP implementations MAY require private groups to expire with the SA under which they were established. Groups may be directly negotiated in the SA proposal with Oakley Main Mode. To do this the Prime, Generator, and Group Type are passed as SA attributes (see Appendix A in [MSST96]). Alternately, the nature of the group can be hidden using Oakley New Group Mode and only the Harkins, Carrel [Page 14] INTERNET DRAFT June 1996 group identifier is passed in the clear during Main Mode. 5.5 Oakley Groups [Orm96] defines several groups. The value 0 indicates no group. The value 1 indicates the default group described below. The attriute class for "Group" is defined in Appendix A. Other values are also defined in [Orm96]. All values 2^15 and higher are used for private group identifiers. 5.5.1 Oakley Default Group Oakley implementations MUST support a MODP group with the following prime and generator. This group is assigned id 1 (one). The prime is: 2^768 - 2 ^704 - 1 + 2^64 * { [2^638 pi] + 149686 } Its hexadecimal value is FFFFFFFF FFFFFFFF C90FDAA2 2168C234 C4C6628B 80DC1CD1 29024E08 8A67CC74 020BBEA6 3B139B22 514A0879 8E3404DD EF9519B3 CD3A431B 302B0A6D F25F1437 4FE1356D 6D51C245 E485B576 625E7EC6 F44C42E9 A63A3620 FFFFFFFF FFFFFFFF The generator is: 2. other groups can be defined using Oakley New Group Mode. This default group was generated by Richard Schroeppel at the University of Arizona. Properties of this prime are described by the following exerpt from [Orm96]: The prime for this group was selected to have certain properties. The high order 64 bits are forced to 1. This helps the classical remainder algorithm, because the trial quotient digit can always be taken as the high order word of the dividend, possibly +1. The low order 64 bits are forced to 1. This helps the Montgomery-style remainder algorithms, because the multiplier digit can always be taken to be the low order word of the dividend. The middle bits are taken from the binary expansion of pi. This guarantees that they are effectively random, while avoiding any suspicion that the primes have secretly been selected to be weak. The prime is chosen to be a Sophie-Germain prime (i.e., (P-1)/2 is also prime), to have the maximum strength against the square-root attack. The starting trial numbers were repeatedly incremented by 2^64 until suitable primes were located. Because this prime is congruent to 7 (mod 8), 2 is a quadratic Harkins, Carrel [Page 15] INTERNET DRAFT June 1996 residue. All powers of 2 will also be quadratic residues. This prevents an opponent from learning the low order bit of the Diffie-Hellman exponent. Using 2 as a generator is efficient for some modular exponentiation algorithms. [Note that 2 is technically not a generator in the number theory sense, because it omits half of the possible residues mod P. From a cryptographic viewpoint, this is a virtue.] A further discussion of the properties of this group, the motivation behind its creation, as well as the definition of several more groups can be found in [Orm96]. Harkins, Carrel [Page 16] INTERNET DRAFT June 1996 5.6 Payload Explosion for Complete ISAKMP-Oakley Exchange This section illustrates how ISAKMP payloads are used with Oakley to: - establish a secure and authenticated channel between ISAKMP processes (phase 1); and - generate key material for, and negotiate, an IPsec SA (phase 2). 5.6.1 Phase 1 using Oakley Main Mode The following diagram illustrates the payloads exchanged between the two parties in the first round trip exchange. The initiator MAY propose several proposals; the responder MUST reply with one. 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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ~ ISAKMP Header with XCHG of Oakley Main Mode, ~ ~ and Next Payload of ISA_SA ~ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ! ISA_PROP ! RESERVED ! Payload Length ! +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ! Domain of Interpretation (IPsec DOI) ! +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ! Situation ! +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ! ISA_TRANS ! RESERVED ! Payload Length ! +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ! Proposal #1 ! Proto=ISAKMP ! # of Transforms ! +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ~ SPI (8 octets) ~ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ! ISA_TRANS ! RESERVED ! Payload Length ! +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ! Transform #1 ! RESERVED | OAKLEY ! +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ~ preffered SA attributes ~ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ! 0 ! RESERVED ! Payload Length ! +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ! Transform #2 ! RESERVED | OAKLEY ! +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ~ alternate SA attributes ~ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ The responder replies in kind but selects, and returns, one transform proposal (the ISAKMP SA attributes). Harkins, Carrel [Page 17] INTERNET DRAFT June 1996 The second exchange consists of the following payloads: 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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ~ ISAKMP Header with XCHG of Oakley Main Mode, ~ ~ and Next Payload of ISA_KE ~ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ! ISA_NONCE ! RESERVED ! Payload Length ! +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ~ D-H Public Value (g^x from initiator g^y from responder) ~ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ! 0 ! RESERVED ! Payload Length ! +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ~ Ni (from initiator) or Nr (from responder) ~ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ The shared keys, SKEYID_e and SKEYID_a, are now used to protect and authenticate all further communication. Note that both SKEYID_e and SKEYID_a are unauthenticated. 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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ~ ISAKMP Header with XCHG of Oakley Main Mode, ~ ~ and Next Payload of ISA_ID and the encryption bit set ~ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ! ISA_SIG ! RESERVED ! Payload Length ! +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ~ Identification Data of the ISAKMP negotiator ~ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ! 0 ! RESERVED ! Payload Length ! +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ~ signature verified by the public key of the ID above ~ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ The key exchange is authenticated over a signed hash as described in section 5.1. Once the signature has been verified using the authentication algorithm negotiated as part of the ISAKMP SA, the shared keys, SKEYID_e and SKEYID_a can be marked as authenticated. (For brevity, certificate payloads were not exchanged). 5.6.2 Phase 2 using Oakley Quick Mode The following payloads are exchanged in the first round of Oakley Quick Mode with ISAKMP SA negotiation. In this hypothetical exchange, the ISAKMP negotiators are proxies for other parties which have requested authentication. Harkins, Carrel [Page 18] INTERNET DRAFT June 1996 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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ~ ISAKMP Header with XCHG of Oakley Quick Mode, ~ ~ Next Payload of ISA_HASH and the encryption bit set ~ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ! ISA_SA ! RESERVED ! Payload Length ! +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ~ keyed hash of message ~ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ! ISA_PROP ! RESERVED ! Payload Length ! +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ! Domain Of Interpretation (DOI) ! +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ! Situation ! +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ! ISA_TRANS ! RESERVED ! Payload Length ! +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ! Proposal #1 ! Protocol=AH ! # of Transforms ! +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ~ SPI (8 octets) ~ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ! ISA_TRANS ! RESERVED ! Payload Length ! +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ! Transform #1 ! RESERVED | SHA ! +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ! other SA attributes ! +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ! ISA_NONCE ! RESERVED ! Payload Length ! +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ! Transform #1 ! RESERVED | MD5 ! +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ! other SA attributes ! +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ! ISA_ID ! RESERVED ! Payload Length ! +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ~ nonce ~ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ! ISA_ID ! RESERVED ! Payload Length ! +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ~ ID of source for which ISAKMP is a proxy ~ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ! 0 ! RESERVED ! Payload Length ! +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ~ ID of destination for which ISAKMP is a proxy ~ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ where the contents of the hash are described in 5.4 above. The responder replies with a similar message which only contains one Harkins, Carrel [Page 19] INTERNET DRAFT June 1996 transform-- the selected AH transform. Upon receipt, the initiator can provide the key engine with the negotiated security association and the keying material. As a check against replay attacks, the responder waits until receipt of the next message. 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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ~ ISAKMP Header with XCHG of Oakley Quick Mode, ~ ~ Next Payload of ISA_HASH and the encryption bit set ~ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ! 0 ! RESERVED ! Payload Length ! +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ~ hash data ~ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ where the contents of the hash are described in 5.4 above. 5.7 Perfect Forward Secrecy Example This protocol can provide PFS of both keys and identities. The identies of both the ISAKMP negotiating peer and, if applicable, the proxy for whom the peers are negotiating can be protected with PFS. To provide Perfect Forward Secrecy of both keys and all identities, two parties would perform the following: o A Main Mode Exchange to protect the identities of the ISAKMP peers. This establishes an ISAKMP SA. o A Quick Mode Exchange to negotiate other security protocol protection. This establishes a SA on each end for this protocol. o Delete the ISAKMP SA and its associated state. Since the key for use in the non-ISAKMP SA was derived from the single ephemeral Diffie-Hellman exchange PFS is preserved. To provide Perfect Forward Secrecy of merely the keys of a non-ISAKMP security association, it in not necessary to do a phase 1 exchange if an ISAKMP SA exists between the two peers. A single Quick Mode in which the optional KE payload is passed, and an additional Diffie- Hellman exchange is performed, is all that is required. At this point the state derived from this Quick Mode must be deleted from the ISAKMP SA as described in section 5.4. 6. Implementation Hints Using a single ISAKMP Phase 1 negotiation makes subsequent Phase 2 negotiations extremely quick. As long as the Phase 1 state remains Harkins, Carrel [Page 20] INTERNET DRAFT June 1996 cached, and PFS is not needed, Phase 2 can proceed without any exponentiation. How many Phase 2 negotiations can be performed for a single Phase 1 is a local policy issue. The decision will depend on the strength of the algorithms being used and level of trust in the peer system. An implementation may wish to negotiate a range of SAs when performing Quick Mode. By doing this they can speed up the "re- keying". Quick Mode defines how KEYMAT is defined for a range of SAs. When one peer feels it is time to change SAs they simple use the next one within the stated range. A range of SAs can be established by negotiating multiple SAs (identical attributes, different SPIs) with one Quick Mode. An optimization that is often useful is to establish Security Associations with peers before they are needed so that when they become needed they are already in place. This ensures there would be no delays due to key management before initial data transmission. This optimization is easily implemented by setting up more than one Security Association with a peer for each requested Security Association and caching those not immediately used. Also, if ISAKMP is implementation is alerted that a SA will soon be needed (e.g. to replace an existing SA that will expire in the near future), then it can establish the new SA before that new SA is needed. 7. Security Considerations This entire draft discusses a hybrid protocol, combining Oakley with ISAKMP, to negotiate, and derive keying material for, security associations in a secure and authenticated manner. Confidentiality is assured by the use of a negotiated encryption algorithm. Authentication is assured by the use of a negotiated method: a digital signature algorithm; a public key algorithm which supports encryption; or, a pre-shared key. The confidentiality and authentication of this exchange is only as good as the attributes negotiated as part of the ISAKMP security association. Repeated re-keying using Quick Mode can consume the entropy of the Diffie- Hellman shared secret. Implementors should take note of this fact and set a limit on Quick Mode Exchanges between exponentiations. This draft does not proscribe such a limit. Perfect Forward Secrecy (PFS) of both keying material and identities is possible with this protocol. By specifying a Diffie-Hellman group, and passing public values in KE payloads, ISAKMP peers can establish Harkins, Carrel [Page 21] INTERNET DRAFT June 1996 PFS of keys-- the identities would be protected by SKEYID_e from the ISAKMP SA and would therefore not be protected by PFS. If PFS of both keying material and identities is desired, an ISAKMP peer MUST establish only one non-ISAKMP security association (e.g. IPsec Security Association) per ISAKMP SA. PFS for keys and identities is accomplished by deleting the ISAKMP SA (and optionally issuing a DELETE message) upon establishment of the single non-ISAKMP SA. In this way a phase one negotiation is uniquely tied to a single phase two negotiation, and the ISAKMP SA established during phase one negotiation is never used again. 8. Acknowledgements This document is the result of close consultation with Hilarie Orman, Douglas Maughan, Mark Schertler, Mark Schneider, and Jeff Turner. It relies completely on protocols which were written by them. Without their interest and dedication, this would not have been written. We would also like to thank Cheryl Madson, Harry Varnis, Elfed Weaver, and Hugo Krawcyzk for technical input. 9. References [KBC96] Krawczyk, H., Bellare, M., Canetti, R., "HMAC: Keyed-Hashing for Message Authentication", draft-ietf-ipsec-hmac-md5-01.txt [Kra96] Krawcyzk, H., "SKEME: A Versatile Secure Key Exchange Mechanism for Internet", from IEEE Proceedings of the 1996 Symposium on Network and Distributed Systems Security. [MSST96] Maughhan, D., Schertler, M., Schneider, M., and Turner, J., "Internet Security Association and Key Management Protocol (ISAKMP)", version 6, draft-ietf-ipsec-isakmp-06.{ps,txt}. [Orm96] Orman, H., "The Oakley Key Determination Protocol", version 1, draft-ietf-ipsec-oakley-01.txt. [Pip96] Piper, D., "The Internet IP Security Domain Of Interpretation for ISAKMP", version 1, draft-ietf-ipsec-ipsec-doi-01.txt. [Sch94] Schneier, B., "Applied Cryptography, Protocols, Algorithms, and Source Code in C", 1st edition. Harkins, Carrel [Page 22] INTERNET DRAFT June 1996 Appendix A This is aproxy ~ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ where the contentslist ofthe hashDES Weak and Semi-Weak keys. The keys come from [Sch94]. All keys aredescribedlisted in5.3 above. The # of Payloads field of the envelope payload is used to encapsulate the SA, nonce, and hash, and tie all three tohexidecimal. DES Weak Keys 0101 0101 0101 0101 1F1F 1F1F E0E0 E0E0 E0E0 E0E0 1F1F 1F1F FEFE FEFE FEFE FEFE DES Semi-Weak Keys 01FE 01FE 01FE 01FE 1FE0 1FE0 0EF1 0EF1 01E0 01E0 01F1 01F1 1FFE 1FFE 0EFE 0EFE 011F 011F 010E 010E E0FE E0FE F1FE F1FE FE01 FE01 FE01 FE01 E01F E01F F10E F10E E001 E001 F101 F101 FE1F FE1F FE0E FE0E 1F01 1F01 0E01 0E01 FEE0 FEE0 FEF1 FEF1 Attribute Assigned Numbers Attributes negotiated during phase one use thespecified SPI. Upon receipt, and validation, of this payload,following definitions. Phase two attributes are defined in theinitiator can provideapplicable DOI specification (for example, IPsec attributes are defined in thenegotiation server (or key engine)IPsec DOI), with thenegotiated security association and the keying material derived fromexception of a group description when QuickMode. To prevent replay attacks from creating bogus security associations, the responder does not provide the security association and keying material until receipt and validationMode includes an ephemeral Diffie-Hellman exchange. Attribute types can be either Basic (B) or Variable-length (V). Encoding of these attributes is defined in thenext payload.base ISAKMP specification. Attribute Classes class value type --------------------------------------------------------------------------- Encryption Algorithm 1 B Hash Algorithm 2 B Authentication Method 3 B Group Description 4 B Group Type 5 B Group Prime 6 V Group Generator One 7 V Group Generator Two 8 V Harkins, Carrel [Page11]23] INTERNET DRAFT June 19960Group Curve A 9 V Group Curve B 10 V Life Type 11 B Life Duration 12 B/V Class Values Encryption Algorithm DEC-CBC 1 IDEA-CBC 2 Blowfish-CBC 34 5 6 7 8 9 0values 4-65000 are reserved. Values 65001-65535 are for private use among mutually consenting parties. Hash Algorithm MD5 1 SHA 2 Tiger 34 5 6 7 8 9 0values 4-65000 are reserved. Values 65001-65535 are for private use among mutually consenting parties. Authentication Method pre-shared key 1 DSS signatures 2 RSA signatures 3 RSA encryption 45 6 7 8 9 0values 5-65000 are reserved. Values 65001-65535 are for private use among mutually consenting parties. Group Description default group (section 5.5.1) 1+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ~ ISAKMP Header with XCHG of Oakley Quick Mode, ~ ~ Next Payload of ISA_ENV and the encryption bit set ~ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ! ISA_HASH ! #values 2-32767 are reserved. Values 32768-65535 are for private use among mutually consenting parties. Group Type MODP (modular exponentiation group) 1 ECP (elliptic curve group) 2 Life Type seconds 1 kilobytes 2 values 3-65000 are reserved. Values 65001-65535 are for private use among mutually consenting parties. For a given "Life Type" Harkins, Carrel [Page 24] INTERNET DRAFT June 1996 the value ofpayloads ! Protocol ID ! +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ~ responder SPI ~ ~ ~ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ! 0 ! RESERVED ! Payload Length ! +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ~ hash data ~ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ wherethecontents"Life Duration" attribute defines the actual length of thehash are described in 5.3 above. The #SA life-- either a number ofPayloads fieldseconds, or a number ofthe envelope payload iskbytes protected. Additional Exchanges Defined-- XCHG values Quick Mode 32 New Group Mode 33 Harkins, Carrel [Page 25] INTERNET DRAFT June 1996 Appendix B Encryption keys used toassociate the hash payload with the responder's SPI. At this point the responder has verified thatprotect therequest wasISAKMP SA are derived from SKEYID_e in an algorithm-specific manner. When SKEYID_e is not long enough to supply all theresult of a replay attack and can provide the SA and keynecessary keying materialtoan algorithm requires, thenegotiation server (orkeyengine). To provide for secure duplex communication, the ISAKMP negotiators MUST construct two security associations for each accepted proposal. The first, identified by the SPIis derived from a concatenation of SKEYID_e and successive keyed hashes of a single character which contains a monotonically increasing counter beginning at one (1), and SKEYID_e as thesource to the destination (inkey, using theevent that there isnegotiated hash function. For example, if (ficticious) algorithm AKULA requires 320-bits of key (and has noproxy negotiation it will be from initiatorweak key check) and the prf used toresponder);generate SKEYID_e only generates 120 bits of material, thesecond identified bykey for AKULA, would be theAUX-SPIfirst 320-bits of Ka, where: Ka = SKEYID_e | prf(SKEYID_e | 1) | prf(SKEYID_e | 2) where prf isfromthedestination toHMAC version of thesource (or responder to initiator). 6. Security Considerations This entire draft discusses a hybrid protocol, combining Oakley with ISAKMP, to negotiate, and derive keying material for, security associations in a securenegotiated hash function. SKEYID_e provides 120-bits, andauthenticated manner. Confidentiality is assured by the useeach of the two additional hashes provide 120-bits, for anegotiatedtotal of 360 bits. Material for the initialization vector (IV material) for CBC mode encryptionalgorithm. Authenticationalgorithms isassured by the usederived from a hash of a concatenation of the initiator's public Diffie-Hellman value and the responder's public Diffie-Hellman value using the negotiateddigital signaturehash algorithm. Theconfidentialitykey for DES-CBC is derived from the first eight (8) non-weak andauthenticationsemi-weak (see Appendix A) bytes ofthis exchangeSKEYID_e. The IV isonly as good astheattributes negotiated as partfirst 8 bytes of theISAKMP security association. Repeated re-keying using Quick Mode can consumeIV material derived above. The key for IDEA-CBC is derived from theentropyfirst sixteen (16) bytes of SKEYID_e. The IV is theDiffie- Hellman shared secret. Implementors should take notefirst 8 bytes ofthis fact and set a limit on Quick Mode Exchanges between exponentiations. This draft does not proscribe such a limit. Harkins, Carrel [Page 12] INTERNET DRAFT June 1996 7. Acknowledgements This documentthe IV material derived above. The key for Blowfish-CBC is derived from theresultfirst fifty-six (56) bytes ofclose consultation with Hilarie Orman, Douglas Maughan, Mark Schertler, Mark Schneider, and Jeff Turner. It relies completely on protocols which were writtena key derived in the method described above, bythem. Without their interest and dedication, this would not haveconcatenating successive hashes onto SKEYID_e until the requesite number of bytes has beenwritten. We would also like to thank Cherly Madson and Harry Varnis for technical input. 8. References [MSST96] Maughhan, D., Schertler, M., Schneider, M., and Turner, J., "Internet Security Association and Key Management Protocol (ISAKMP)", version 5, draft-ietf-ipsec-isakmp-05.{ps,txt}. [Orm96] Orman, H., "The Oakley Key Determination Protocol", version 2, draft-ietf-ipsec-oakley-02.txt. [Sch94] Schneier, B., "Applied Cryptography, Protocols, Algorithms, and Source Code in C", 1st edition.achieved. The IV is the first 8 bytes of the IV material derived above. Editors' Addresses: Dan Harkins <dharkins@cisco.com> Dave Carrel <carrel@cisco.com> cisco Systems 170 W. Tasman Dr. San Jose, California, 95134-1706 United States of America +1 408 526 4000 Harkins, Carrel [Page 26] INTERNET DRAFT June 1996 Editors' Note: The editors encourage independent implementation, and interoperability testing, of this hybrid exchange. Harkins, Carrel [Page13]27] ----