home *** CD-ROM | disk | FTP | other *** search
/ Internet Info 1997 December / Internet_Info_CD-ROM_Walnut_Creek_December_1997.iso / drafts / draft_ietf_i / draft-ietf-ipsec-isakmp-oakley-03.txt < prev    next >
Text File  |  1997-02-26  |  63KB  |  1,793 lines

  1.  
  2.  
  3. IPSEC Working Group                                D. Harkins, D. Carrel
  4. INTERNET-DRAFT                                             cisco Systems
  5. draft-ietf-ipsec-isakmp-oakley-03.txt                      February 1997
  6. Expire in six months
  7.  
  8.  
  9.                   The resolution of ISAKMP with Oakley
  10.                 <draft-ietf-ipsec-isakmp-oakley-03.txt>
  11.  
  12.  
  13.                           Status of this Memo
  14.  
  15.    This document is an Internet Draft. Internet Drafts are working
  16.    documents of the Internet Engineering Task Force (IETF), its areas,
  17.    and working groups.  Note that other groups may also distribute
  18.    working documents as Internet Drafts.
  19.  
  20.    Internet Drafts are draft documents valid for a maximum of six months
  21.    and may be updated, replaced, or obsoleted by other documents at any
  22.    time. It is inapproporiate to use Internet Drafts as reference
  23.    material or to cite them other than as "work in progress."
  24.  
  25.    To learn the current status of any Internet Draft, please check the
  26.    "1id-abstracts.txt" listing contained in the Internet Drafts Shadow
  27.    Directories on ftp.is.co.za (Africa), nic.nordu.net (Europe),
  28.    munnari.oz.au (Australia), ds.internic.net (US East Coast), or
  29.    ftp.isi.edu (US West Coast).
  30.  
  31.  
  32. 1. Abstract
  33.  
  34.    [MSST96] (ISAKMP) provides a framework for authentication and key
  35.    exchange but does not define them.  ISAKMP is designed to be key
  36.    exchange independant; that is, it is designed to support many
  37.    different key exchanges.
  38.  
  39.    [Orm96] (Oakley) describes a series of key exchanges-- called
  40.    "modes"-- and details the services provided by each (e.g. perfect
  41.    forward secrecy for keys, identity protection, and authentication).
  42.  
  43.    This document describes a proposal for using the Oakley Key Exchange
  44.    Protocol in conjunction with ISAKMP to obtain authenticated keying
  45.    material for use with ISAKMP, and for other security associations
  46.    such as AH and ESP for the IETF IPsec DOI.
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55. Harkins, Carrel                                             [Page 1]
  56.  
  57. INTERNET DRAFT                                             February 1997
  58.  
  59.  
  60. 2. Discussion
  61.  
  62.    This draft combines ISAKMP and Oakley. The purpose is to negotiate,
  63.    and provide authenticated keying material for, security associations
  64.    in a protected manner.
  65.  
  66.    Processes which implement this draft can be used for negotiating
  67.    virtual private networks (VPNs) and also for providing a remote user
  68.    from a remote site (whose IP address need not be known beforehand)
  69.    access to a secure host or network.
  70.  
  71.    Proxy negotiation is supported.  Proxy mode is where the negotiating
  72.    parties are not the endpoints for which security association
  73.    negotiation is taking place.  When used in proxy mode, the identities
  74.    of the end parties remain hidden.
  75.  
  76.    This proposal does not implement the entire Oakley protocol, but only
  77.    a subset necessary to satisfy its goals. It does not claim
  78.    conformance or compliance with the entire Oakley protocol. For
  79.    greater understanding of the Oakley protocol and the mathematics
  80.    behind it, please refer to [Orm96].
  81.  
  82. 3. Terms and Definitions
  83.  
  84. 3.1 Requirements Terminology
  85.  
  86.    In this document, the words that are used to define the significance
  87.    of each particular requirement are capitalised.  These words are:
  88.  
  89.    - MUST
  90.  
  91.       This word or the adjective "REQUIRED" means that the item is an
  92.       absolute requirement of the specification.
  93.  
  94.    - SHOULD
  95.  
  96.       This word or the adjective "RECOMMENDED" means that there might
  97.       exist valid reasons in particular circumstances to ignore this
  98.       item, but the full implications should be understood and the case
  99.       carefully weighed before taking a different course.
  100.  
  101.    - MAY
  102.  
  103.       This word or the adjective "OPTIONAL" means that this item is
  104.       truly optional.  One vendor might choose to include the item
  105.       because a particular marketplace requires it or because it
  106.       enhances the product, for example; another vendor may omit the
  107.       same item.
  108.  
  109.  
  110.  
  111. Harkins, Carrel                                             [Page 2]
  112.  
  113. INTERNET DRAFT                                             February 1997
  114.  
  115.  
  116. 3.2 Notation
  117.  
  118.    The following notation is used throughout this draft.
  119.  
  120.       HDR is an ISAKMP header whose exchange type is the mode.  When
  121.       writen as HDR* it indicates payload encryption.
  122.  
  123.       SA is an SA negotiation payload with one or more proposals. An
  124.       initiator MAY provide multiple proposals for negotiation; a
  125.       responder MUST reply with only one.
  126.  
  127.       SAp is the entire body of the SA payload (minus the SA header)--
  128.       i.e.  all proposals and transforms offered by the Initiator.
  129.  
  130.       g^xi and g^xr are the Diffie-Hellman public values of the
  131.       initiator and responder respectively.
  132.  
  133.       KE is the key exchange payload.
  134.  
  135.       Nx is the nonce payload; x can be: i or r for the ISAKMP initiator
  136.       and responder respectively.
  137.  
  138.       IDx is the identity payload for "x".  x can be: "ii" or "ir" for
  139.       the ISAKMP initiator and responder respectively during phase one
  140.       negotiation; or "ui" or "ur" for the user initiator and responder
  141.       respectively during phase two.  The ID payload format for the
  142.       Internet DOI is defined in [Pip96].
  143.  
  144.       SIG is the signature payload. The data to sign is exchange-
  145.       specific.
  146.  
  147.       CERT is the certificate payload.
  148.  
  149.       HASH (and any derivitive such as HASH(2) or HASH_I) is the hash
  150.       payload. The contents of the hash are specific to the
  151.       authentication method.
  152.  
  153.       prf(key, msg) is the keyed pseudo-random function-- often a keyed
  154.       hash function-- used to generate a deterministic output that
  155.       appears pseudo-random.  prf's are used both for key derivations
  156.       and for authentication (i.e. as a keyed MAC). (See [KBC96]).
  157.  
  158.       SKEYID is a string derived from secret material known only to the
  159.       active players in the exchange.
  160.  
  161.       SKEYID_e is the keying material used by the ISAKMP SA to protect
  162.       it's messages.
  163.  
  164.  
  165.  
  166.  
  167. Harkins, Carrel                                             [Page 3]
  168.  
  169. INTERNET DRAFT                                             February 1997
  170.  
  171.  
  172.       SKEYID_a is the keying material used by the ISAKMP SA to
  173.       authenticate it's messages.
  174.  
  175.       SKEYID_d is the keying material used to derive keys for non-ISAKMP
  176.       security associations.
  177.  
  178.       <x>y indicates that "x" is encrypted with the key "y".
  179.  
  180.       --> signifies "initiator to responder" communication (requests).
  181.  
  182.       <-- signifies "responder to initiator" communication (replies).
  183.  
  184.        |  signifies concatenation of information-- e.g. X | Y is the
  185.       concatentation of X with Y.
  186.  
  187.       [x] indicates that x is optional.
  188.  
  189.    Payload encryption (when noted by a '*' after the ISAKMP header) MUST
  190.    begin immediately after the ISAKMP header. When communication is
  191.    protected, all payloads following the ISAKMP header MUST be
  192.    encrypted.  Encryption keys are generated from SKEYID_e in a manner
  193.    that is defined for each algorithm.
  194.  
  195.    When used to describe the payloads contained in complete message
  196.    exchanges, the ISAKMP generic header is implicitly included. When
  197.    used as part of a prf computation, the ISAKMP generic header is not
  198.    included. For example, the initiator may send the responder the
  199.    following message:
  200.      HDR, KE, Ni
  201.    The ISAKMP header is included in the KE and Ni payloads. But if the
  202.    initiator generates the following pseudo-random output:
  203.      HASH = prf(key, Ni | Nr)
  204.    the ISAKMP headers of the two nonce payloads are not included-- only
  205.    the body of the payload-- the nonce itself-- is used.
  206.  
  207. 3.3 Perfect Forward Secrecy
  208.  
  209.    When used in the draft Perfect Forward Secrecy (PFS) refers to the
  210.    notion that compromise of a single key will permit access to only
  211.    data protected by a single key. For PFS to exist the key used to
  212.    protect transmission of data MUST NOT be used to derive any
  213.    additional keys, and if the key used to protect transmission of data
  214.    was derived from some other keying material, that material MUST NOT
  215.    be used to derive any more keys.
  216.  
  217.    Perfect Forward Secrecy for both keys and identities is provided in
  218.    this protocol. (Sections 5.8 and 7).
  219.  
  220.  
  221.  
  222.  
  223. Harkins, Carrel                                             [Page 4]
  224.  
  225. INTERNET DRAFT                                             February 1997
  226.  
  227.  
  228. 3.4 Security Association
  229.  
  230.    A security association (SA) is a set of policy and key used to
  231.    protect information. The ISAKMP SA is the shared policy and key used
  232.    by the negotiating peers in this protocol to protect their
  233.    communication.
  234.  
  235. 4. Introduction
  236.  
  237.    Oakley defines a method to establish an authenticated key exchange.
  238.    This includes how payloads are constructed, the information they
  239.    carry, the order in which they are processed and how they are used.
  240.  
  241.    While Oakley defines "modes", ISAKMP defines "phases".  The
  242.    relationship between the two is very straightforward.  ISAKMP's phase
  243.    1 is where the two ISAKMP peers establish a secure, authenticated
  244.    channel with which to communicate.  This is called the ISAKMP
  245.    Security Association (SA). Oakley's "Main Mode" and "Aggressive Mode"
  246.    each accomplish a phase 1 exchange.  "Main Mode" and "Aggressive
  247.    Mode" MUST ONLY be used in phase 1.
  248.  
  249.    Phase 2 is where Security Associations are negotiated on behalf of
  250.    services such as IPsec or any other service which needs key material
  251.    and/or parameter negotiation. Oakley's "Quick Mode" accomplishes a
  252.    phase 2 exchange.  "Quick Mode" MUST ONLY be used in phase 2.
  253.  
  254.    Oakley's "New Group Mode" is not really a phase 1 or phase 2.  It
  255.    follows phase 1, but serves to establish a new group which can be
  256.    used in future negotiations. "New Group Mode" MUST ONLY be used in
  257.    phase 2.
  258.  
  259.    With the use of ISAKMP phases, an implementation can accomplish very
  260.    fast keying when necessary.  A single phase 1 negotiation may be used
  261.    for more than one phase 2 negotiation.  Additionally a single phase 2
  262.    negotiation can request multiple Security Associations.  With these
  263.    optimizations, an implementation can see less than one round trip per
  264.    SA as well as less than one DH exponentiation per SA.  "Main Mode"
  265.    for phase 1 provides identity protection.  When identity protection
  266.    is not needed, "Aggressive Mode" can be used to reduce round trips
  267.    even further.  Developer hints for doing these optimizations are
  268.    included below. It should also be noted that using public key
  269.    encryption to authenticate an Aggressive Mode exchange will still
  270.    provide identity protection.
  271.  
  272.    The following attributes are used by Oakley and are negotiated as
  273.    part of the ISAKMP Security Association.  (These attributes pertain
  274.    only to the ISAKMP Security Association and not to any Security
  275.    Associations that ISAKMP may be negotiating on behalf of other
  276.  
  277.  
  278.  
  279. Harkins, Carrel                                             [Page 5]
  280.  
  281. INTERNET DRAFT                                             February 1997
  282.  
  283.  
  284.    services.)
  285.  
  286.  
  287.  
  288.  
  289.  
  290.  
  291.  
  292.  
  293.  
  294.  
  295.  
  296.  
  297.  
  298.  
  299.  
  300.  
  301.  
  302.  
  303.  
  304.  
  305.  
  306.  
  307.  
  308.  
  309.  
  310.  
  311.  
  312.  
  313.  
  314.  
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.  
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334.  
  335. Harkins, Carrel                                             [Page 6]
  336.  
  337. INTERNET DRAFT                                             February 1997
  338.  
  339.  
  340.       - encryption algorithm (e.g. DES, IDEA, Blowfish).
  341.  
  342.       - hash algorithm (e.g. MD5, SHA)
  343.  
  344.       - authentication method (e.g. DSS sig, RSA sig, RSA encryption,
  345.       pre-shared key)
  346.  
  347.       - information about a group over which to do Diffie-Hellman.
  348.  
  349.       - prf (e.g. 3DES-CBC-MAC)
  350.  
  351.    All of these attributes are mandatory and MUST be negotiated except
  352.    for the "prf".  The "prf" MAY be negotiated, but if it is not, the
  353.    HMAC (see [KBC96]) version of the negotiated hash algorithm is used
  354.    as a pseudo-random function. Other non-mandatory attributes are
  355.    described in Appendix A. The selected hash algorithm MUST support
  356.    both native and HMAC modes.
  357.  
  358.    Oakley implementations MUST support the following attribute values:
  359.  
  360.       - DES-CBC with a weak, and semi-weak, key check (weak and semi-
  361.       weak keys are referenced in [Sch94] and listed in Appendix A). The
  362.       key is derived according to Appendix B.
  363.  
  364.       - MD5 and SHA.
  365.  
  366.       - Authentication via pre-shared keys. The Digital Signature
  367.       Standard SHOULD be supported; RSA SHOULD also be supported.
  368.  
  369.       - MODP over the default Oakley group (see below). ECP groups MAY
  370.       be supported.
  371.  
  372.    The Oakley modes described here MUST be implemented whenever the IETF
  373.    IPsec DOI [Pip96] is implemented. Other DOIs MAY use the Oakley modes
  374.    described here.
  375.  
  376.  
  377.  
  378.  
  379.  
  380.  
  381.  
  382.  
  383.  
  384.  
  385.  
  386.  
  387.  
  388.  
  389.  
  390.  
  391. Harkins, Carrel                                             [Page 7]
  392.  
  393. INTERNET DRAFT                                             February 1997
  394.  
  395.  
  396. 5. Exchanges
  397.  
  398.    There are two basic methods used to establish an authenticated key
  399.    exchange: Oakley Main Mode and Oakley Aggressive Mode. Each generates
  400.    authenticated keying material from an ephemeral Diffie-Hellman
  401.    exchange. Oakley in Main Mode MUST be implemented; Oakley Aggressive
  402.    Mode SHOULD be implemented. In addition, Oakley Quick Mode MUST be
  403.    implemented as a mechanism to generate fresh keying material and
  404.    negotiate non-ISAKMP security services. In additon, Oakley New Group
  405.    Mode SHOULD be implemented as a mechanism to define private groups
  406.    for Diffie-Hellman exchanges. Implementations MUST NOT switch
  407.    exchange types in the middle of an exchange.
  408.  
  409.    Exchanges conform to standard ISAKMP [MSST96] payload syntax.
  410.    attribute encoding, timeouts and retransmits of messages, and
  411.    informational messages-- e.g a notify response is sent when, for
  412.    example, a proposal is unacceptable, or a signature verification or
  413.    decryption was unsuccessful, etc.
  414.  
  415.    Oakley Main Mode is an instantiation of the ISAKMP Identity Protect
  416.    Exchange: The first two messages negotiate policy; the next two
  417.    exchange Diffie-Hellman public values and ancillary data (e.g.
  418.    nonces) necessary for the exchange; and the last two messages
  419.    authenticate the Diffie-Hellman Exchange. The authentication method
  420.    negotiated as part of the initial ISAKMP exchange influences the
  421.    composition of the payloads but not their purpose. The XCHG for
  422.    Oakley Main Mode is ISAKMP Identity Protect.
  423.  
  424.    Similarly, Oakley Aggressive Mode is an instantiation of the ISAKMP
  425.    Aggressive Exchange. The first two messages negotiate policy,
  426.    exchange Diffie-Hellman public values and ancillary data necessary
  427.    for the exchange, and identities.  In addition the second message
  428.    authenticates the responder. The third message authenticates the
  429.    initiator and provides a proof of participation in the exchange. The
  430.    XCHG for Oakley Aggressive Mode is ISAKMP Aggressive.  The final
  431.    message is not sent under protection of the ISAKMP SA allowing each
  432.    party to postpone exponentiation, if desired, until negotiation of
  433.    this exchange is complete.
  434.  
  435.    Quick Mode and New Group Mode have no analog in ISAKMP. The XCHG
  436.    values for Quick Mode and New Group Mode are defined in Appendix A.
  437.  
  438.  
  439.  
  440.  
  441.  
  442.  
  443.  
  444.  
  445.  
  446.  
  447. Harkins, Carrel                                             [Page 8]
  448.  
  449. INTERNET DRAFT                                             February 1997
  450.  
  451.  
  452.    Three different authentication methods are allowed with either Main
  453.    Mode or Aggressive Mode-- digital signature, public key encryption,
  454.    or pre-shared key. The value SKEYID is computed seperately for each
  455.    authentication method.
  456.  
  457.        For signatures:             SKEYID = prf(Ni | Nr, g^xy)
  458.        For public key encryption:  SKEYID = hash(Ni | Nr)
  459.        For pre-shared keys:        SKEYID = prf(pre-shared-key, Ni | Nr)
  460.  
  461.    The result of either Main Mode or Aggressive Mode is three groups of
  462.    authenticated keying material:
  463.  
  464.       SKEYID_d = prf(SKEYID, g^xy | CKY-I | CKY-R, 0)
  465.       SKEYID_a = prf(SKEYID, SKEYID_d | g^xy | CKY-I | CKY-R, 1)
  466.       SKEYID_e = prf(SKEYID, SKEYID_a | g^xy | CKY-I | CKY-R, 2)
  467.  
  468.    and agreed upon policy to protect further communications. The values
  469.    of 0, 1, and 2 above are represented by a single octet. The key used
  470.    for encryption is derived from SKEYID_e in an algorithm-specific
  471.    manner (see appendix B).
  472.  
  473.    To authenticate either exchange the initiator of the protocol
  474.    generates HASH_I and the responder generates HASH_R where:
  475.  
  476.       HASH_I = prf(SKEYID, g^xi | g^xr | CKY-I | CKY-R | SAp | IDii)
  477.       HASH_R = prf(SKEYID, g^xr | g^xi | CKY-R | CKY-I | SAp | IDir)
  478.  
  479.    For authentication with digital signatures, HASH_I and HASH_R are
  480.    signed and verified; for authentication with either public key
  481.    encryption or pre-shared keys, HASH_I and HASH_R directly
  482.    authenticate the exchange.
  483.  
  484.    As mentioned above, the negotiated authentication method influences
  485.    the content and use of messages for Phase 1 Oakley Modes, but not
  486.    their intent.  When using public keys for authentication, the Phase 1
  487.    Oakley can be accomplished either by using signatures or by using
  488.    public key encryption (if the algorithm supports it). Following are
  489.    Main Mode Exchanges with different authentication options.
  490.  
  491.  
  492.  
  493.  
  494.  
  495.  
  496.  
  497.  
  498.  
  499.  
  500.  
  501.  
  502.  
  503. Harkins, Carrel                                             [Page 9]
  504.  
  505. INTERNET DRAFT                                             February 1997
  506.  
  507.  
  508. 5.1 ISAKMP/Oakley Phase 1 Authenticated With Signatures
  509.  
  510.    Using signatures, the ancillary information exchanged during the
  511.    second roundtrip are nonces; the exchange is authenticated by signing
  512.    a mutually obtainable hash. Oakley Main Mode with signature
  513.    authentication is described as follows:
  514.  
  515.         Initiator                          Responder
  516.        ----------                         -----------
  517.         HDR, SA                     -->
  518.                                     <--    HDR, SA
  519.         HDR, KE, Ni                 -->
  520.                                     <--    HDR, KE, Nr
  521.         HDR*, IDii, [ CERT, ] SIG_I -->
  522.                                     <--    HDR*, IDir, [ CERT, ] SIG_R
  523.  
  524.    Oakley Aggressive mode with signatures in conjunction with ISAKMP is
  525.    described as follows:
  526.  
  527.         Initiator                          Responder
  528.        -----------                        -----------
  529.         HDR, SA, KE, Ni, IDii       -->
  530.                                     <--    HDR, SA, KE, Nr, IDir,
  531.                                                 [ CERT, ] SIG_R
  532.         HDR, [ CERT, ] SIG_I        -->
  533.  
  534.    In both modes, the signed data, SIG_I or SIG_R, is the result of the
  535.    negotiated digital signature algorithm applied to HASH_I or HASH_R
  536.    respectively.
  537.  
  538.    In general the signature will be over HASH_I and HASH_R as above
  539.    using the negotiated prf, or the HMAC version of the negotiated hash
  540.    function (if no prf is negotiated). However, this can be overridden
  541.    for construction of the signature if the signature algorithm is tied
  542.    to a particular hash algorithm (e.g. DSS is only defined with SHA's
  543.    160 bit output). In this case, the signature will be over HASH_I and
  544.    HASH_R as above, except using the HMAC version of the hash algorithm
  545.    associated with the signature method.  The negotiated prf and hash
  546.    function would continue to be used for all other proscribed pseudo-
  547.    random functions.
  548.  
  549.    RSA signatures MUST be encoded in PKCS #1 format.  DSS signatures
  550.    MUST be encoded as r followed by s.
  551.  
  552.    One or more certificate payloads MAY be optionally passed.
  553.  
  554.  
  555.  
  556.  
  557.  
  558.  
  559. Harkins, Carrel                                            [Page 10]
  560.  
  561. INTERNET DRAFT                                             February 1997
  562.  
  563.  
  564. 5.2 Oakley Phase 1 Authenticated With Public Key Encryption
  565.  
  566.    Using public key encryption to authenticate the exchange, the
  567.    ancillary information exchanged is encrypted nonces. Each party's
  568.    ability to reconstruct a hash (proving that the other party decrypted
  569.    the nonce) authenticates the exchange.
  570.  
  571.    In order to perform the public key encryption, the initiator must
  572.    already have the responder's public key. In the case where a party
  573.    has multiple public keys, a hash of the certificate the initiator is
  574.    using to encrypt the ancillary information is passed as part of the
  575.    third message. In this way the responder can determine which
  576.    corresponding private key to use to decrypt the encrypted payloads
  577.    and identity protection is retained.
  578.  
  579.    In addition to the nonce, the identities of the parties (IDii and
  580.    IDir) are also encrypted with the other parties public key. If the
  581.    authentication method is public key encryption, the nonce and
  582.    identity payloads MUST be encrypted with the public key of the other
  583.    party. Only the body of the payloads are encrypted, the payload
  584.    headers are left in the clear.
  585.  
  586.    When using encrytion for authentication with Oakley, Main Mode is
  587.    defined as follows.
  588.  
  589.         Initiator                        Responder
  590.        -----------                      -----------
  591.         HDR, SA                   -->
  592.                                   <--    HDR, SA
  593.         HDR, KE, [ HASH(1), ]
  594.           <IDii>PubKey_r,
  595.             <Ni>PubKey_r          -->
  596.                                          HDR, KE, <IDir>PubKey_i,
  597.                                   <--            <Nr>PubKey_i
  598.         HDR*, HASH_I              -->
  599.                                   <--    HDR*, HASH_R
  600.  
  601.    Oakley Aggressive Mode authenticated with encryption is described as
  602.    follows:
  603.  
  604.         Initiator                        Responder
  605.        -----------                      -----------
  606.         HDR, SA, [ HASH(1),] KE,
  607.           <IDii>Pubkey_r,
  608.            <Ni>Pubkey_r           -->
  609.                                          HDR, SA, KE, <IDir>PubKey_i,
  610.                                   <--         <Nr>PubKey_r, HASH_R
  611.         HDR, HASH_I               -->
  612.  
  613.  
  614.  
  615. Harkins, Carrel                                            [Page 11]
  616.  
  617. INTERNET DRAFT                                             February 1997
  618.  
  619.  
  620.    Where HASH(1) is a hash (using the negotiated hash function) of the
  621.    certificate which the initiator is using to encrypt the nonce and
  622.    identity.
  623.  
  624.    RSA encryption MUST be encoded in PKCS #1 format. The payload length
  625.    is the length of the entire encrypted payload plus header. The PKCS
  626.    #1 encoding allows for determination of the actual length of the
  627.    cleartext payload upon decryption.
  628.  
  629.    Using encryption for authentication provides for a plausably deniable
  630.    exchange. There is no proof (as with a digital signature) that the
  631.    conversation ever took place since each party can completely
  632.    reconstruct both sides of the exchange. In addition, security is
  633.    added to secret generation since an attacker would have to
  634.    successfully break not only the Diffie-Hellman exchange but also both
  635.    RSA encryptions. This exchange was motivated by [Kra96].
  636.  
  637.    Note that, unlike other authentication methods, authentication with
  638.    public key encryption allows for identity protection with Aggressive
  639.    Mode.
  640.  
  641.  
  642.  
  643.  
  644.  
  645.  
  646.  
  647.  
  648.  
  649.  
  650.  
  651.  
  652.  
  653.  
  654.  
  655.  
  656.  
  657.  
  658.  
  659.  
  660.  
  661.  
  662.  
  663.  
  664.  
  665.  
  666.  
  667.  
  668.  
  669.  
  670.  
  671. Harkins, Carrel                                            [Page 12]
  672.  
  673. INTERNET DRAFT                                             February 1997
  674.  
  675.  
  676. 5.3 Oakley Phase 1 Authenticated With a Pre-Shared Key
  677.  
  678.    A key derived by some out-of-band mechanism may also be used to
  679.    authenticate the exchange. The actual establishment of this key is
  680.    out of the scope of this document.
  681.  
  682.    When doing a pre-shared key authentication with Oakley, Main Mode is
  683.    defined as follows
  684.  
  685.               Initiator                        Responder
  686.              ----------                       -----------
  687.               HDR, SA             -->
  688.                                   <--    HDR, SA
  689.               HDR, KE, Ni         -->
  690.                                   <--    HDR, KE, Nr
  691.               HDR*, IDii, HASH_I  -->
  692.                                   <--    HDR*, IDir, HASH_R
  693.  
  694.    Oakley Aggressive mode with a pre-shared key is described as follows:
  695.  
  696.             Initiator                        Responder
  697.            -----------                      -----------
  698.             HDR, SA, KE, Ni, IDii -->
  699.                                   <--    HDR, SA, KE, Nr, IDir, HASH_R
  700.             HDR, HASH_I           -->
  701.  
  702.    When using pre-shared key authentication with Main Mode the key can
  703.    only be identified by the IP address of the peers since HASH_I must
  704.    be computed before the initiator has processed IDir. Aggressive Mode
  705.    allows for a wider range of identifiers of the pre-shared secret to
  706.    be used. In addition, Aggressive Mode allows two parties to maintain
  707.    multiple, different pre-shared keys and identify the correct one for
  708.    a particular exchange.
  709.  
  710.  
  711.  
  712.  
  713.  
  714.  
  715.  
  716.  
  717.  
  718.  
  719.  
  720.  
  721.  
  722.  
  723.  
  724.  
  725.  
  726.  
  727. Harkins, Carrel                                            [Page 13]
  728.  
  729. INTERNET DRAFT                                             February 1997
  730.  
  731.  
  732. 5.4 Oakley Phase 2 - Quick Mode
  733.  
  734.    Oakley Quick Mode is not a complete exchange itself, but is used as
  735.    part of the ISAKMP SA negotiation process (phase 2) to derive keying
  736.    material and negotiate shared policy for non-ISAKMP SAs. The
  737.    information exchanged along with Oakley Quick Mode MUST be protected
  738.    by the ISAKMP SA-- i.e. all payloads except the ISAKMP header are
  739.    encrypted.
  740.  
  741.    Quick Mode is essentially an exchange of nonces that provides replay
  742.    protection. The nonces are used to generate fresh key material and
  743.    prevent replay attacks from generating bogus security associations.
  744.    An optional Key Exchange payload can be exchanged to allow for an
  745.    additional Diffie-Hellman exchange and exponentiation per Quick Mode.
  746.    While use of the key exchange payload with Quick Mode is optional it
  747.    MUST be supported.
  748.  
  749.    Base Quick Mode (without the KE payload) refreshens the keying
  750.    material derived from the exponentiation in phase 1. This does not
  751.    provide PFS.  Using the optional KE payload, an additional
  752.    exponentiation is performed and PFS is provided for the keying
  753.    material. If a KE payload is sent, a Diffie-Hellman group (see
  754.    section 5.6.1 and [Pip96]) MUST be sent as attributes of the SA being
  755.    negotiated.
  756.  
  757.    Quick Mode is defined as follows:
  758.  
  759.         Initiator                        Responder
  760.        -----------                      -----------
  761.         HDR*, HASH(1), SA, Ni
  762.           [, KE ] [, IDui, IDur ] -->
  763.                                   <--    HDR*, HASH(2), SA, Nr
  764.                                                [, KE ] [, IDui, IDur ]
  765.         HDR*, HASH(3)             -->
  766.  
  767.    Where:
  768.       HASH(1) and HASH(2) are the prf over the message id (M-ID) from
  769.    the ISAKMP header concatenated with the entire message that follows
  770.    the hash including payload headers, but excluding any padding added
  771.    for encryption.  HASH(3)-- for liveliness-- is the prf over the value
  772.    zero represented as a single octet, followed by a concatenation of
  773.    the message id and the two nonces-- the initiator's followed by the
  774.    responder's. In other words, the hashes for the above exchange are:
  775.  
  776.       HASH(1) = prf(SKEYID_a, M-ID | SA | Ni [ | KE ] [ | IDui | IDur ])
  777.       HASH(2) = prf(SKEYID_a, M-ID | SA | Nr [ | KE ] [ | IDui | IDur ])
  778.       HASH(3) = prf(SKEYID_a, 0 | M-ID | Ni | Nr)
  779.  
  780.  
  781.  
  782.  
  783. Harkins, Carrel                                            [Page 14]
  784.  
  785. INTERNET DRAFT                                             February 1997
  786.  
  787.  
  788.    If PFS is not needed, and KE payloads are not exchanged, the new
  789.    keying material is defined as KEYMAT = prf(SKEYID_d, SPI | Ni | Nr).
  790.  
  791.    If PFS is desired and KE payloads were exchanged, the new keying
  792.    material is defined as KEYMAT = prf(SKEYID_d, g(qm)^xy | SPI | Ni |
  793.    Nr), where g(qm)^xy is the shared secret from the ephemeral Diffie-
  794.    Hellman exchange of this Quick Mode.
  795.  
  796.    The SPI is the value from the SPI field in the SA payload.
  797.  
  798.    A single SA negotiation results in two security assocations-- one
  799.    inbound and one outbound. Different SPIs for each SA (one chosen by
  800.    the initiator, the other by the responder) guarantee a different key
  801.    for each direction.  The SPI chosen by the destination of the SA is
  802.    used to derive KEYMAT for that SA.
  803.  
  804.    For situations where the amount of keying material desired is greater
  805.    than that supplied by the prf, KEYMAT is expanded by feeding the
  806.    results of the prf back into itself and concatenating results until
  807.    the required keying material has been reached. In other words,
  808.  
  809.       KEYMAT = K1 | K2 | K3 | ...
  810.       where
  811.         K1 = prf(SKEYID_d, [ g(qm)^xy | ] SPI | Ni | Nr)
  812.         K2 = prf(SKEYID_d, K1 | [ g(qm)^xy | ] SPI | Ni | Nr)
  813.         K3 = prf(SKEYID_d, K2 | [ g(qm)^xy | ] SPI | Ni | Nr)
  814.         etc.
  815.  
  816.    This keying material (whether with PFS or without, and whether
  817.    derived directly or through concatenation) MUST be used with the
  818.    negotiated SA. It is up to the service to define how keys are derived
  819.    from the keying material (see Appendix B).
  820.  
  821.    In the case of an ephemeral Diffie-Hellman exchange in Quick Mode,
  822.    the exponential (g(qm)^xy) is irretreivably removed from the current
  823.    state and SKEYID_e and SKEYID_a (derived from phase 1 negotiation)
  824.    continue to protect and authenticate the ISAKMP SA and SKEYID_d
  825.    continues to be used to derive keys.
  826.  
  827.    If ISAKMP is acting as a proxy negotiator on behalf of another party
  828.    the identities of the parties MUST be passed as IDui and IDur. Local
  829.    policy will dictate whether the proposals are acceptible for the
  830.    identities specified.  If IDs are not exchanged, the negotiation is
  831.    assumed to be done on behalf of each ISAKMP peer.  If an ID range
  832.    (see Appendix A of [Pip96]) is not acceptable (for example, the
  833.    specified subnet is too large) a BAD_ID_RANGE notify message followed
  834.    by an acceptible ID range, in an ID payload, MUST be sent.
  835.  
  836.  
  837.  
  838.  
  839. Harkins, Carrel                                            [Page 15]
  840.  
  841. INTERNET DRAFT                                             February 1997
  842.  
  843.  
  844.    Using Quick Mode, multiple SA's and keys can be negotiated with one
  845.    exchange as follows:
  846.  
  847.         Initiator                        Responder
  848.        -----------                      -----------
  849.         HDR*, HASH(1), SA0, SA1, Ni,
  850.           [, KE ] [, IDui, IDur ] -->
  851.                                   <--    HDR*, HASH(2), SA0, SA1, Nr,
  852.                                             [, KE ] [, IDui, IDur ]
  853.         HDR*, HASH(3)             -->
  854.  
  855.    The keying material is derived identically as in the case of a single
  856.    SA. In this case (negotiation of two SA payloads) the result would be
  857.    four security associations-- two each way for both SAs.
  858.  
  859. 5.5 Oakley New Group Mode
  860.  
  861.    Oakley New Group Mode MUST NOT be used prior to establishment of an
  862.    ISAKMP SA. The description of a new group MUST only follow phase 1
  863.    negotiation.  (It is not a phase 2 exchange, though).
  864.  
  865.         Initiator                        Responder
  866.        -----------                      -----------
  867.         HDR*, HASH(1), SA        -->
  868.                                  <--     HDR*, HASH(2), SA
  869.  
  870.    where HASH(1) is the prf output, using SKEYID_a as the key, and the
  871.    entire SA proposal, body and header, as the data; HASH(2) is the prf
  872.    output, using SKEYID_a as the key, and the reply as the data.
  873.  
  874.    The proposal will be an Oakley proposal which specifies the
  875.    characteristics of the group (see appendix A, "Oakley Attribute
  876.    Assigned Numbers"). Group descriptions for private Oakley Groups MUST
  877.    be greater than or equal to 2^15.  If the group is not acceptable,
  878.    the responder MUST reply with a Notify payload with the message type
  879.    set to GROUP_NOT_ACCEPTABLE (13).
  880.  
  881.    ISAKMP implementations MAY require private groups to expire with the
  882.    SA under which they were established.
  883.  
  884.    Groups may be directly negotiated in the SA proposal with Oakley Main
  885.    Mode.  To do this the Prime, Generator (using the Generator One
  886.    attribute class from Appendix A), and Group Type are passed as SA
  887.    attributes (see Appendix A in [MSST96]). Alternately, the nature of
  888.    the group can be hidden using Oakley New Group Mode and only the
  889.    group identifier is passed in the clear during phase 1 negotiation.
  890.  
  891.  
  892.  
  893.  
  894.  
  895. Harkins, Carrel                                            [Page 16]
  896.  
  897. INTERNET DRAFT                                             February 1997
  898.  
  899.  
  900. 5.6 Oakley Groups
  901.  
  902.    [Orm96] defines several groups.  The value 0 indicates no group.  The
  903.    value 1 indicates the default group described below. The attribute
  904.    class for "Group" is defined in Appendix A. Other values are also
  905.    defined in [Orm96]. All values 2^15 and higher are used for private
  906.    group identifiers.
  907.  
  908. 5.6.1 Oakley Default Group
  909.  
  910.    Oakley implementations MUST support a MODP group with the following
  911.    prime and generator. This group is assigned id 1 (one).
  912.  
  913.       The prime is: 2^768 - 2 ^704 - 1 + 2^64 * { [2^638 pi] + 149686 }
  914.       Its hexadecimal value is
  915.  
  916.          FFFFFFFF FFFFFFFF C90FDAA2 2168C234 C4C6628B 80DC1CD1
  917.          29024E08 8A67CC74 020BBEA6 3B139B22 514A0879 8E3404DD
  918.          EF9519B3 CD3A431B 302B0A6D F25F1437 4FE1356D 6D51C245
  919.          E485B576 625E7EC6 F44C42E9 A63A3620 FFFFFFFF FFFFFFFF
  920.  
  921.       The generator is: 2.
  922.  
  923.    other groups can be defined using Oakley New Group Mode. This default
  924.    group was generated by Richard Schroeppel at the University of
  925.    Arizona.  Properties of this prime are described by the following
  926.    exerpt from [Orm96]:
  927.  
  928.          The prime for this group was selected to have certain
  929.          properties.  The high order 64 bits are forced to 1.  This
  930.          helps the classical remainder algorithm, because the trial
  931.          quotient digit can always be taken as the high order word of
  932.          the dividend, possibly +1.  The low order 64 bits are forced to
  933.          1.  This helps the Montgomery-style remainder algorithms,
  934.          because the multiplier digit can always be taken to be the low
  935.          order word of the dividend.  The middle bits are taken from the
  936.          binary expansion of pi.  This guarantees that they are
  937.          effectively random, while avoiding any suspicion that the
  938.          primes have secretly been selected to be weak.
  939.  
  940.          The prime is chosen to be a Sophie-Germain prime (i.e., (P-1)/2
  941.          is also prime), to have the maximum strength against the
  942.          square-root attack.  The starting trial numbers were repeatedly
  943.          incremented by 2^64 until suitable primes were located.
  944.  
  945.          Because this prime is congruent to 7 (mod 8), 2 is a quadratic
  946.          residue.  All powers of 2 will also be quadratic residues.
  947.          This prevents an opponent from learning the low order bit of
  948.  
  949.  
  950.  
  951. Harkins, Carrel                                            [Page 17]
  952.  
  953. INTERNET DRAFT                                             February 1997
  954.  
  955.  
  956.          the Diffie-Hellman exponent.  Using 2 as a generator is
  957.          efficient for some modular exponentiation algorithms.  [Note
  958.          that 2 is technically not a generator in the number theory
  959.          sense, because it omits half of the possible residues mod P.
  960.          From a cryptographic viewpoint, this is a virtue.]
  961.  
  962.    A further discussion of the properties of this group, the motivation
  963.    behind its creation, as well as the definition of several more groups
  964.    can be found in [Orm96].
  965.  
  966.  
  967.  
  968.  
  969.  
  970.  
  971.  
  972.  
  973.  
  974.  
  975.  
  976.  
  977.  
  978.  
  979.  
  980.  
  981.  
  982.  
  983.  
  984.  
  985.  
  986.  
  987.  
  988.  
  989.  
  990.  
  991.  
  992.  
  993.  
  994.  
  995.  
  996.  
  997.  
  998.  
  999.  
  1000.  
  1001.  
  1002.  
  1003.  
  1004.  
  1005.  
  1006.  
  1007. Harkins, Carrel                                            [Page 18]
  1008.  
  1009. INTERNET DRAFT                                             February 1997
  1010.  
  1011.  
  1012. 5.7 Payload Explosion for Complete ISAKMP-Oakley Exchange
  1013.  
  1014.    This section illustrates how ISAKMP payloads are used with Oakley to:
  1015.  
  1016.       - establish a secure and authenticated channel between ISAKMP
  1017.       processes (phase 1); and
  1018.  
  1019.       - generate key material for, and negotiate, an IPsec SA (phase 2).
  1020.  
  1021. 5.7.1 Phase 1 using Oakley Main Mode
  1022.  
  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.
  1026.  
  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 Oakley Main Mode,           ~
  1030.       ~             and Next Payload of ISA_SA                        ~
  1031.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1032.       !       0       !    RESERVED   !        Payload Length         !
  1033.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1034.       !             Domain of Interpretation (IPsec DOI)              !
  1035.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1036.       !                          Situation                            !
  1037.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1038.       !       0       !    RESERVED   !        Payload Length         !
  1039.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1040.       !  Proposal #1  ! Proto=ISAKMP  !        # of Transforms        !
  1041.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1042.       ~                        SPI (8 octets)                         ~
  1043.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1044.       !    ISA_TRANS  !    RESERVED   !        Payload Length         !
  1045.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1046.       !  Transform #1 !          RESERVED             |     OAKLEY    !
  1047.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1048.       ~                   preffered SA attributes                     ~
  1049.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1050.       !       0       !    RESERVED   !        Payload Length         !
  1051.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1052.       !  Transform #2 !          RESERVED             |     OAKLEY    !
  1053.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1054.       ~                   alternate SA attributes                     ~
  1055.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1056.  
  1057.    The responder replies in kind but selects, and returns, one transform
  1058.    proposal (the ISAKMP SA attributes).
  1059.  
  1060.  
  1061.  
  1062.  
  1063. Harkins, Carrel                                            [Page 19]
  1064.  
  1065. INTERNET DRAFT                                             February 1997
  1066.  
  1067.  
  1068.    The second exchange consists of the following payloads:
  1069.  
  1070.        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
  1071.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1072.       ~        ISAKMP Header with XCHG of Oakley Main Mode,           ~
  1073.       ~             and Next Payload of ISA_KE                        ~
  1074.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1075.       !    ISA_NONCE  !    RESERVED   !        Payload Length         !
  1076.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1077.       ~   D-H Public Value  (g^xi from initiator g^xr from responder) ~
  1078.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1079.       !       0       !    RESERVED   !        Payload Length         !
  1080.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1081.       ~         Ni (from initiator) or  Nr (from responder)           ~
  1082.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1083.  
  1084.    The shared keys, SKEYID_e and SKEYID_a, are now used to protect and
  1085.    authenticate all further communication. Note that both SKEYID_e and
  1086.    SKEYID_a are unauthenticated.
  1087.  
  1088.        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
  1089.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1090.       ~        ISAKMP Header with XCHG of Oakley Main Mode,           ~
  1091.       ~     and Next Payload of ISA_ID and the encryption bit set     ~
  1092.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1093.       !    ISA_SIG    !    RESERVED   !        Payload Length         !
  1094.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1095.       ~        Identification Data of the ISAKMP negotiator           ~
  1096.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1097.       !       0       !    RESERVED   !        Payload Length         !
  1098.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1099.       ~       signature verified by the public key of the ID above    ~
  1100.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1101.  
  1102.    The key exchange is authenticated over a signed hash as described in
  1103.    section 5.1. Once the signature has been verified using the
  1104.    authentication algorithm negotiated as part of the ISAKMP SA, the
  1105.    shared keys, SKEYID_e and SKEYID_a can be marked as authenticated.
  1106.    (For brevity, certificate payloads were not exchanged).
  1107.  
  1108. 5.7.2 Phase 2 using Oakley Quick Mode
  1109.  
  1110.      The following payloads are exchanged in the first round of Oakley
  1111.    Quick Mode with ISAKMP SA negotiation. In this hypothetical exchange,
  1112.    the ISAKMP negotiators are proxies for other parties which have
  1113.    requested authentication.
  1114.  
  1115.  
  1116.  
  1117.  
  1118.  
  1119. Harkins, Carrel                                            [Page 20]
  1120.  
  1121. INTERNET DRAFT                                             February 1997
  1122.  
  1123.  
  1124.        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
  1125.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1126.       ~        ISAKMP Header with XCHG of Oakley Quick Mode,          ~
  1127.       ~   Next Payload of ISA_HASH and the encryption bit set         ~
  1128.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1129.       !     ISA_SA    !    RESERVED   !        Payload Length         !
  1130.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1131.       ~                 keyed hash of message                         ~
  1132.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1133.       !   ISA_NONCE   !    RESERVED   !         Payload Length        !
  1134.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1135.       !                 Domain Of Interpretation (DOI)                !
  1136.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1137.       !                          Situation                            !
  1138.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1139.       !       0       !    RESERVED   !        Payload Length         !
  1140.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1141.       !  Proposal #1  !  Protocol=AH  !        # of Transforms        !
  1142.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1143.       ~                        SPI (8 octets)                         ~
  1144.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1145.       !    ISA_TRANS  !    RESERVED   !        Payload Length         !
  1146.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1147.       !  Transform #1 !          RESERVED             |     SHA       !
  1148.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1149.       !                       other SA attributes                     !
  1150.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1151.       !       0       !    RESERVED   !        Payload Length         !
  1152.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1153.       !  Transform #1 !          RESERVED             |     MD5       !
  1154.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1155.       !                       other SA attributes                     !
  1156.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1157.       !    ISA_ID     !    RESERVED   !        Payload Length         !
  1158.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1159.       ~                            nonce                              ~
  1160.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1161.       !    ISA_ID     !    RESERVED   !        Payload Length         !
  1162.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1163.       ~              ID of source for which ISAKMP is a proxy         ~
  1164.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1165.       !      0        !    RESERVED   !        Payload Length         !
  1166.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1167.       ~           ID of destination for which ISAKMP is a proxy       ~
  1168.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1169.  
  1170.    where the contents of the hash are described in 5.4 above. The
  1171.    responder replies with a similar message which only contains one
  1172.  
  1173.  
  1174.  
  1175. Harkins, Carrel                                            [Page 21]
  1176.  
  1177. INTERNET DRAFT                                             February 1997
  1178.  
  1179.  
  1180.    transform-- the selected AH transform. Upon receipt, the initiator
  1181.    can provide the key engine with the negotiated security association
  1182.    and the keying material.  As a check against replay attacks, the
  1183.    responder waits until receipt of the next message.
  1184.  
  1185.        0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  1186.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1187.       ~        ISAKMP Header with XCHG of Oakley Quick Mode,          ~
  1188.       ~   Next Payload of ISA_HASH and the encryption bit set         ~
  1189.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1190.       !       0       !    RESERVED   !        Payload Length         !
  1191.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1192.       ~                         hash data                             ~
  1193.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1194.  
  1195.    where the contents of the hash are described in 5.4 above.
  1196.  
  1197. 5.8 Perfect Forward Secrecy Example
  1198.    This protocol can provide PFS of both keys and identities. The
  1199.    identies of both the ISAKMP negotiating peer and, if applicable, the
  1200.    proxy for whom the peers are negotiating can be protected with PFS.
  1201.  
  1202.    To provide Perfect Forward Secrecy of both keys and all identities,
  1203.    two parties would perform the following:
  1204.       o A Main Mode Exchange to protect the identities of the ISAKMP
  1205.       peers.
  1206.         This establishes an ISAKMP SA.  o A Quick Mode Exchange to
  1207.       negotiate other security protocol protection.
  1208.         This establishes a SA on each end for this protocol.  o Delete
  1209.       the ISAKMP SA and its associated state.
  1210.    Since the key for use in the non-ISAKMP SA was derived from the
  1211.    single ephemeral Diffie-Hellman exchange PFS is preserved.
  1212.  
  1213.    To provide Perfect Forward Secrecy of merely the keys of a non-ISAKMP
  1214.    security association, it in not necessary to do a phase 1 exchange if
  1215.    an ISAKMP SA exists between the two peers. A single Quick Mode in
  1216.    which the optional KE payload is passed, and an additional Diffie-
  1217.    Hellman exchange is performed, is all that is required. At this point
  1218.    the state derived from this Quick Mode must be deleted from the
  1219.    ISAKMP SA as described in section 5.4.
  1220.  
  1221.  
  1222.  
  1223.  
  1224.  
  1225.  
  1226.  
  1227.  
  1228.  
  1229.  
  1230.  
  1231. Harkins, Carrel                                            [Page 22]
  1232.  
  1233. INTERNET DRAFT                                             February 1997
  1234.  
  1235.  
  1236. 6. Implementation Hints
  1237.  
  1238.    Using a single ISAKMP Phase 1 negotiation makes subsequent Phase 2
  1239.    negotiations extremely quick.  As long as the Phase 1 state remains
  1240.    cached, and PFS is not needed, Phase 2 can proceed without any
  1241.    exponentiation. How many Phase 2 negotiations can be performed for a
  1242.    single Phase 1 is a local policy issue. The decision will depend on
  1243.    the strength of the algorithms being used and level of trust in the
  1244.    peer system.
  1245.  
  1246.    An implementation may wish to negotiate a range of SAs when
  1247.    performing Quick Mode.  By doing this they can speed up the "re-
  1248.    keying". Quick Mode defines how KEYMAT is defined for a range of SAs.
  1249.    When one peer feels it is time to change SAs they simple use the next
  1250.    one within the stated range. A range of SAs can be established by
  1251.    negotiating multiple SAs (identical attributes, different SPIs) with
  1252.    one Quick Mode.
  1253.  
  1254.    An optimization that is often useful is to establish Security
  1255.    Associations with peers before they are needed so that when they
  1256.    become needed they are already in place. This ensures there would be
  1257.    no delays due to key management before initial data transmission.
  1258.    This optimization is easily implemented by setting up more than one
  1259.    Security Association with a peer for each requested Security
  1260.    Association and caching those not immediately used.
  1261.  
  1262.    Also, if an ISAKMP implementation is alerted that a SA will soon be
  1263.    needed (e.g. to replace an existing SA that will expire in the near
  1264.    future), then it can establish the new SA before that new SA is
  1265.    needed.
  1266.  
  1267. 7. Security Considerations
  1268.  
  1269.    This entire draft discusses a hybrid protocol, combining Oakley with
  1270.    ISAKMP, to negotiate, and derive keying material for, security
  1271.    associations in a secure and authenticated manner.
  1272.  
  1273.    Confidentiality is assured by the use of a negotiated encryption
  1274.    algorithm.  Authentication is assured by the use of a negotiated
  1275.    method: a digital signature algorithm; a public key algorithm which
  1276.    supports encryption; or, a pre-shared key. The confidentiality and
  1277.    authentication of this exchange is only as good as the attributes
  1278.    negotiated as part of the ISAKMP security association.
  1279.  
  1280.    Repeated re-keying using Quick Mode can consume the entropy of the
  1281.    Diffie- Hellman shared secret. Implementors should take note of this
  1282.    fact and set a limit on Quick Mode Exchanges between exponentiations.
  1283.    This draft does not proscribe such a limit.
  1284.  
  1285.  
  1286.  
  1287. Harkins, Carrel                                            [Page 23]
  1288.  
  1289. INTERNET DRAFT                                             February 1997
  1290.  
  1291.  
  1292.    Perfect Forward Secrecy (PFS) of both keying material and identities
  1293.    is possible with this protocol. By specifying a Diffie-Hellman group,
  1294.    and passing public values in KE payloads, ISAKMP peers can establish
  1295.    PFS of keys-- the identities would be protected by SKEYID_e from the
  1296.    ISAKMP SA and would therefore not be protected by PFS. If PFS of both
  1297.    keying material and identities is desired, an ISAKMP peer MUST
  1298.    establish only one non-ISAKMP security association (e.g. IPsec
  1299.    Security Association) per ISAKMP SA. PFS for keys and identities is
  1300.    accomplished by deleting the ISAKMP SA (and optionally issuing a
  1301.    DELETE message) upon establishment of the single non-ISAKMP SA. In
  1302.    this way a phase one negotiation is uniquely tied to a single phase
  1303.    two negotiation, and the ISAKMP SA established during phase one
  1304.    negotiation is never used again.
  1305.  
  1306.    Implementations SHOULD not use Diffie-Hellman exponents of less than
  1307.    200 bits to avoid adversely effecting the security of both parties.
  1308.  
  1309.    It is assumed that the Diffie-Hellman exponents in this exchange are
  1310.    erased from memory after use. In particular, these exponents must not
  1311.    be derived from long-lived secrets like the seed to a pseudo-random
  1312.    generator.
  1313.  
  1314. 8. Acknowledgements
  1315.  
  1316.    This document is the result of close consultation with Hilarie Orman,
  1317.    Douglas Maughan, Mark Schertler, Mark Schneider, and Jeff Turner. It
  1318.    relies completely on protocols which were written by them. Without
  1319.    their interest and dedication, this would not have been written.
  1320.  
  1321.    We would also like to thank Cheryl Madson, Harry Varnis, Elfed
  1322.    Weaver, and Hugo Krawcyzk for technical input.
  1323.  
  1324. 9. References
  1325.  
  1326.    [ACM97] Adams, C.M., "Constructing Symmetric Ciphers Using the CAST
  1327.    Design Procedure", Designs, Codes and Cryptorgraphy (to appear).
  1328.  
  1329.    [KBC96] Krawczyk, H., Bellare, M., Canetti, R., "HMAC: Keyed-Hashing
  1330.    for Message Authentication", draft-ietf-ipsec-hmac-md5-01.txt
  1331.  
  1332.    [Kra96] Krawczyk, H., "SKEME: A Versatile Secure Key Exchange
  1333.    Mechanism for Internet", from IEEE Proceedings of the 1996 Symposium
  1334.    on Network and Distributed Systems Security.
  1335.  
  1336.    [MSST96] Maughhan, D., Schertler, M., Schneider, M., and Turner, J.,
  1337.    "Internet Security Association and Key Management Protocol (ISAKMP)",
  1338.    version 7, draft-ietf-ipsec-isakmp-07.{ps,txt}.
  1339.  
  1340.  
  1341.  
  1342.  
  1343. Harkins, Carrel                                            [Page 24]
  1344.  
  1345. INTERNET DRAFT                                             February 1997
  1346.  
  1347.  
  1348.    [Orm96] Orman, H., "The Oakley Key Determination Protocol", version
  1349.    1, draft-ietf-ipsec-oakley-01.txt.
  1350.  
  1351.    [Pip96] Piper, D., "The Internet IP Security Domain Of Interpretation
  1352.    for ISAKMP", version 2, draft-ietf-ipsec-ipsec-doi-02.txt.
  1353.  
  1354.    [Sch94] Schneier, B., "Applied Cryptography, Protocols, Algorithms,
  1355.    and Source Code in C", 2nd edition.
  1356.  
  1357.  
  1358.  
  1359.  
  1360.  
  1361.  
  1362.  
  1363.  
  1364.  
  1365.  
  1366.  
  1367.  
  1368.  
  1369.  
  1370.  
  1371.  
  1372.  
  1373.  
  1374.  
  1375.  
  1376.  
  1377.  
  1378.  
  1379.  
  1380.  
  1381.  
  1382.  
  1383.  
  1384.  
  1385.  
  1386.  
  1387.  
  1388.  
  1389.  
  1390.  
  1391.  
  1392.  
  1393.  
  1394.  
  1395.  
  1396.  
  1397.  
  1398.  
  1399. Harkins, Carrel                                            [Page 25]
  1400.  
  1401. INTERNET DRAFT                                             February 1997
  1402.  
  1403.  
  1404. Appendix A
  1405.  
  1406.    This is a list of DES Weak and Semi-Weak keys.  The keys come from
  1407.    [Sch94].  All keys are listed in hexidecimal.
  1408.  
  1409.        DES Weak Keys
  1410.        0101 0101 0101 0101
  1411.        1F1F 1F1F E0E0 E0E0
  1412.        E0E0 E0E0 1F1F 1F1F
  1413.        FEFE FEFE FEFE FEFE
  1414.  
  1415.        DES Semi-Weak Keys
  1416.        01FE 01FE 01FE 01FE
  1417.        1FE0 1FE0 0EF1 0EF1
  1418.        01E0 01E0 01F1 01F1
  1419.        1FFE 1FFE 0EFE 0EFE
  1420.        011F 011F 010E 010E
  1421.        E0FE E0FE F1FE F1FE
  1422.  
  1423.        FE01 FE01 FE01 FE01
  1424.        E01F E01F F10E F10E
  1425.        E001 E001 F101 F101
  1426.        FE1F FE1F FE0E FE0E
  1427.        1F01 1F01 0E01 0E01
  1428.        FEE0 FEE0 FEF1 FEF1
  1429.  
  1430.  
  1431.    Attribute Assigned Numbers
  1432.  
  1433.    Attributes negotiated during phase one use the following definitions.
  1434.    Phase two attributes are defined in the applicable DOI specification
  1435.    (for example, IPsec attributes are defined in the IPsec DOI), with
  1436.    the exception of a group description when Quick Mode includes an
  1437.    ephemeral Diffie-Hellman exchange.  Attribute types can be either
  1438.    Basic (B) or Variable-length (V). Encoding of these attributes is
  1439.    defined in the base ISAKMP specification.
  1440.  
  1441.  
  1442.  
  1443.  
  1444.  
  1445.  
  1446.  
  1447.  
  1448.  
  1449.  
  1450.  
  1451.  
  1452.  
  1453.  
  1454.  
  1455. Harkins, Carrel                                            [Page 26]
  1456.  
  1457. INTERNET DRAFT                                             February 1997
  1458.  
  1459.  
  1460.    Attribute Classes
  1461.  
  1462.           class                         value              type
  1463.      -------------------------------------------------------------------
  1464.       Encryption Algorithm                1                 B
  1465.       Hash Algorithm                      2                 B
  1466.       Authentication Method               3                 B
  1467.       Group Description                   4                 B
  1468.       Group Type                          5                 B
  1469.       Group Prime                         6                 V
  1470.       Group Generator One                 7                 V
  1471.       Group Generator Two                 8                 V
  1472.       Group Curve A                       9                 V
  1473.       Group Curve B                      10                 V
  1474.       Life Type                          11                 B
  1475.       Life Duration                      12                B/V
  1476.       PRF                                13                 B
  1477.       Key Length                         14                 B
  1478.  
  1479.  
  1480.    Class Values
  1481.  
  1482.    - Encryption Algorithm
  1483.       DEC-CBC                             1
  1484.       IDEA-CBC                            2
  1485.       Blowfish-CBC                        3
  1486.       RC5-R12-B64-CBC                     4
  1487.       3DES-CBC                            5
  1488.       CAST-CBC                            6
  1489.  
  1490.      values 7-65000 are reserved. Values 65001-65535 are for private use
  1491.      among mutually consenting parties.
  1492.  
  1493.    - Hash Algorithm
  1494.       MD5                                 1
  1495.       SHA                                 2
  1496.       Tiger                               3
  1497.  
  1498.      values 4-65000 are reserved. Values 65001-65535 are for private use
  1499.      among mutually consenting parties.
  1500.  
  1501.    - Authentication Method
  1502.       pre-shared key                      1
  1503.       DSS signatures                      2
  1504.       RSA signatures                      3
  1505.       RSA encryption                      4
  1506.  
  1507.      values 5-65000 are reserved. Values 65001-65535 are for private use
  1508.  
  1509.  
  1510.  
  1511. Harkins, Carrel                                            [Page 27]
  1512.  
  1513. INTERNET DRAFT                                             February 1997
  1514.  
  1515.  
  1516.      among mutually consenting parties.
  1517.  
  1518.  
  1519.  
  1520.  
  1521.  
  1522.  
  1523.  
  1524.  
  1525.  
  1526.  
  1527.  
  1528.  
  1529.  
  1530.  
  1531.  
  1532.  
  1533.  
  1534.  
  1535.  
  1536.  
  1537.  
  1538.  
  1539.  
  1540.  
  1541.  
  1542.  
  1543.  
  1544.  
  1545.  
  1546.  
  1547.  
  1548.  
  1549.  
  1550.  
  1551.  
  1552.  
  1553.  
  1554.  
  1555.  
  1556.  
  1557.  
  1558.  
  1559.  
  1560.  
  1561.  
  1562.  
  1563.  
  1564.  
  1565.  
  1566.  
  1567. Harkins, Carrel                                            [Page 28]
  1568.  
  1569. INTERNET DRAFT                                             February 1997
  1570.  
  1571.  
  1572.    - Group Description
  1573.       default group (section 5.6.1)       1
  1574.  
  1575.      values 2-32767 are reserved. Values 32768-65535 are for private use
  1576.      among mutually consenting parties.
  1577.  
  1578.    - Group Type
  1579.       MODP (modular exponentiation group) 1
  1580.       ECP (elliptic curve group)          2
  1581.  
  1582.      values 3-65000 are reserved. Values 65001-65535 are for private use
  1583.      among mutually consenting parties.
  1584.  
  1585.    - Life Type
  1586.       seconds                             1
  1587.       kilobytes                           2
  1588.  
  1589.      values 3-65000 are reserved. Values 65001-65535 are for private use
  1590.      among mutually consenting parties. For a given "Life Type" the
  1591.      value of the "Life Duration" attribute defines the actual length of
  1592.      the SA life-- either a number of seconds, or a number of kbytes
  1593.      protected.
  1594.  
  1595.    - PRF
  1596.       3DES-CBC-MAC                        1
  1597.  
  1598.      values 2-65000 are reserved. Values 65001-65535 are for private use
  1599.      among mutually consenting parties
  1600.  
  1601.    - Key Length
  1602.  
  1603.      When using an Encryption Algorithm that has a variable length key,
  1604.      this attribute specifies the key length in bits. (MUST use network
  1605.      byte order).
  1606.  
  1607.    Additional Exchanges Defined-- XCHG values
  1608.       Quick Mode                         32
  1609.       New Group Mode                     33
  1610.  
  1611.  
  1612.  
  1613.  
  1614.  
  1615.  
  1616.  
  1617.  
  1618.  
  1619.  
  1620.  
  1621.  
  1622.  
  1623. Harkins, Carrel                                            [Page 29]
  1624.  
  1625. INTERNET DRAFT                                             February 1997
  1626.  
  1627.  
  1628. Appendix B
  1629.  
  1630.    This appendix describes encryption details to be used ONLY when
  1631.    encrypting ISAKMP messages.  When a service (such as an IPSEC
  1632.    transform) utilizes ISAKMP to generate keying material, all
  1633.    encryption algorithm specific details (such as key and IV generation,
  1634.    padding, etc...) MUST be defined by that service.  ISAKMP does not
  1635.    purport to ever produce keys that are suitable for any encryption
  1636.    algorithm.  ISAKMP produces the requested amount of keying material
  1637.    from which the service MUST generate a suitable key.  Details, such
  1638.    as weak key checks, are the responsibility of the service.
  1639.  
  1640.    Encryption keys used to protect the ISAKMP SA are derived from
  1641.    SKEYID_e in an algorithm-specific manner. When SKEYID_e is not long
  1642.    enough to supply all the necessary keying material an algorithm
  1643.    requires, the key is derived from feeding the results of a pseudo-
  1644.    random function into itself, concatenating the results, and taking
  1645.    the highest necessary bits.
  1646.  
  1647.    For example, if (ficticious) algorithm AKULA requires 320-bits of key
  1648.    (and has no weak key check) and the prf used to generate SKEYID_e
  1649.    only generates 120 bits of material, the key for AKULA, would be the
  1650.    first 320-bits of Ka, where:
  1651.  
  1652.        Ka = K1 | K2 | K3
  1653.    and
  1654.        K1 = prf(SKEYID_e, 0)
  1655.        K2 = prf(SKEYID_e, K1)
  1656.        K3 = prf(SKEYID_e, K2)
  1657.  
  1658.    where prf is the HMAC version of the negotiated hash function or the
  1659.    negotiated prf. Each result of the prf provides 120 bits of material
  1660.    for a total of 360 bits. AKULA would use the first 320 bits of that
  1661.    360 bit string.
  1662.  
  1663.    In phase 1, material for the initialization vector (IV material) for
  1664.    CBC mode encryption algorithms is derived from a hash of a
  1665.    concatenation of the initiator's public Diffie-Hellman value and the
  1666.    responder's public Diffie-Hellman value using the negotiated hash
  1667.    algorithm. This is used for the first message only. Each message
  1668.    should be padded up to the nearest block size using bytes containing
  1669.    0x00. The message length in the header MUST include the length of the
  1670.    pad since this reflects the size of the cyphertext. Subsequent
  1671.    messages MUST use the last CBC encryption block from the previous
  1672.    message as their initialization vector.
  1673.  
  1674.  
  1675.  
  1676.  
  1677.  
  1678.  
  1679. Harkins, Carrel                                            [Page 30]
  1680.  
  1681. INTERNET DRAFT                                             February 1997
  1682.  
  1683.  
  1684.    In phase 2, material for the initialization vector for CBC mode
  1685.    encryption of the first message of a Quick Mode exchange is derived
  1686.    from a hash of a concatenation of the last phase 1 CBC output block
  1687.    and the phase 2 message id using the negotiated hash algorithm. The
  1688.    IV for subsequent messages within a Quick Mode exchange is the CBC
  1689.    output block from the previous message. Padding and IVs for
  1690.    subsequent messages are done as in phase 1.
  1691.  
  1692.    Note that the final phase 1 CBC output block, the result of
  1693.    encryption/decryption of the last phase 1 message, must be retained
  1694.    in the ISAKMP SA state to allow for generation of unique IVs for each
  1695.    Quick Mode. Each phase 2 exchange generates IVs independantly to
  1696.    prevent IVs from getting out of sync when two different Quick Modes
  1697.    are started simultaneously.
  1698.  
  1699.    The key for DES-CBC is derived from the first eight (8) non-weak and
  1700.    semi-weak (see Appendix A) bytes of SKEYID_e. The IV is the first 8
  1701.    bytes of the IV material derived above.
  1702.  
  1703.    The key for IDEA-CBC is derived from the first sixteen (16) bytes of
  1704.    SKEYID_e.  The IV is the first eight (8) bytes of the IV material
  1705.    derived above.
  1706.  
  1707.    The key for Blowfish-CBC is either the negotiated key size, or the
  1708.    first fifty-six (56) bytes of a key (if no key size is negotiated)
  1709.    derived in the aforementioned pseudo-random function feedback method.
  1710.    The IV is the first eight (8) bytes of the IV material derived above.
  1711.  
  1712.    The key for RC5-R12-B64-CBC is the negotiated key length, or the
  1713.    first sixteen (16) bytes of a key (if no key size is negotiated)
  1714.    derived from the aforementioned pseudo-random function feedback
  1715.    method if necessary. The IV is the first eight (8) bytes of the IV
  1716.    material derived above. The number of rounds MUST be 12 and the block
  1717.    size MUST be 64.
  1718.  
  1719.    The key for 3DES-CBC is the first twenty-four (24) bytes of a key
  1720.    derived in the aforementioned pseudo-random function feedback method.
  1721.    3DES-CBC is an encrypt-decrypt-encrypt operation using the first,
  1722.    middle, and last eight (8) bytes of the entier 3DES-CBC key.  The IV
  1723.    is the first eight (8) bytes of the IV material derived above.
  1724.  
  1725.    The key for CAST-CBC is either the negotiated key size, or the first
  1726.    sixteen (16) bytes of a key derived in the aforementioned pseudo-
  1727.    random function feedback method.  The IV is the first eight (8) bytes
  1728.    of the IV material derived above.
  1729.  
  1730.    Support for algorithms other than DES-CBC is purely optional. Some
  1731.    optional algorithms may be subject to intellectual property claims.
  1732.  
  1733.  
  1734.  
  1735. Harkins, Carrel                                            [Page 31]
  1736.  
  1737. INTERNET DRAFT                                             February 1997
  1738.  
  1739.  
  1740. Authors'  Addresses:
  1741.  
  1742.    Dan Harkins <dharkins@cisco.com>
  1743.    cisco Systems
  1744.    170 W. Tasman Dr.
  1745.    San Jose, California, 95134-1706
  1746.    United States of America
  1747.    +1 408 526 4000
  1748.  
  1749.    Dave Carrel <carrel@ipsec.org>
  1750.    76 Lippard Ave.
  1751.    San Francisco, CA 94131-2947
  1752.    United States of America
  1753.    +1 415 337 8469
  1754.  
  1755. Authors' Note:
  1756.  
  1757.    The authors encourage independent implementation, and
  1758.    interoperability testing, of this hybrid exchange.
  1759.  
  1760.  
  1761.  
  1762.  
  1763.  
  1764.  
  1765.  
  1766.  
  1767.  
  1768.  
  1769.  
  1770.  
  1771.  
  1772.  
  1773.  
  1774.  
  1775.  
  1776.  
  1777.  
  1778.  
  1779.  
  1780.  
  1781.  
  1782.  
  1783.  
  1784.  
  1785.  
  1786.  
  1787.  
  1788.  
  1789.  
  1790.  
  1791. Harkins, Carrel                                            [Page 32]
  1792.  
  1793.