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-oakley-01.txt < prev    next >
Text File  |  1997-05-29  |  118KB  |  2,975 lines

  1.  
  2. IPSEC Working Group                                          H. K. Orman
  3. INTERNET-DRAFT               Dept. of Computer Science, Univ. of Arizona
  4. draft-ietf-ipsec-oakley-01.txt                                May 1996
  5.  
  6.  
  7.                  The OAKLEY Key Determination Protocol
  8.                     <draft-ietf-ipsec-oakley-01.txt>
  9.  
  10.  
  11.  
  12.               This document describes a protocol, named OAKLEY,
  13.       by which two authenticated parties can agree on secure and secret
  14.       keying material.  The basic mechanism is the Diffie-Hellman key
  15.       exchange algorithm.
  16.  
  17.       The OAKLEY protocol supports Perfect Forward Secrecy,
  18.       compatibility with the ISAKMP protocol for managing security
  19.       associations, user-defined abstract group structures for use with
  20.       the Diffie-Hellman algorithm, key updates, and incorporation of
  21.       keys distributed via out-of-band mechanisms.
  22.  
  23.  
  24.  
  25.  
  26. Status of this Memo
  27.  
  28.    This document is being distributed to members of the Internet community in
  29.    order to solicit their comments on the protocol described in it.
  30.  
  31.    This draft expires six months from the day of issue.  The expiration
  32.    date will be August 24, 1996.
  33.  
  34.    Required text:
  35.  
  36.       This document is an Internet-Draft.  Internet-Drafts are working
  37.       documents of the Internet Engineering Task Force (IETF), its
  38.       areas, and its working groups.  Note that other groups may also
  39.       distribute working documents as Internet-Drafts.
  40.  
  41.       Internet-Drafts are draft documents valid for a maximum of six
  42.       months and may be updated, replaced, or obsoleted by other
  43.       documents at any time.  It is inappropriate to use Internet-
  44.       Drafts as reference material or to cite them other than as ``work
  45.       in progress.''
  46.  
  47.       To learn the current status of any Internet-Draft, please check
  48.       the ``1id-abstracts.txt'' listing contained in the Internet-
  49.       Drafts Shadow Directories on ftp.is.co.za (Africa), nic.nordu.net
  50.       (Europe), munnari.oz.au (Pacific Rim), ds.internic.net (US East
  51.       Coast), or ftp.isi.edu (US West Coast).
  52.  
  53.  
  54.    Distribution of this memo is unlimited.
  55.  
  56.  
  57.  
  58.  
  59. H. K. Orman                                                     [Page 1]
  60.  
  61. INTERNET DRAFT                                                  May 1996
  62.  
  63.  
  64. 1. INTRODUCTION
  65.  
  66.    Key establishment is the heart of data protection that relies on
  67.    cryptography, and it is an essential component of the packet
  68.    protection mechanisms described in [RFC1825, RFC1826, RFC1827], for
  69.    example.  A scalable and secure key distribution mechanism for the
  70.    Internet is a necessity.  The goal of this protocol is to provide
  71.    that mechanism, coupled with a great deal of cryptographic strength.
  72.  
  73.    The Diffie-Hellman key exchange algorithm provides such a mechanism.
  74.    It allows two parties to agree on a shared value without requiring
  75.    encryption.  The shared value is immediately available for use in
  76.    encrypting subsequent conversation, e.g. data transmission and/or
  77.    authentication.  The STS protocol [STS] provides a demonstration of
  78.    how to embed the algorithm in a secure protocol, one that ensures
  79.    that in addition to securely sharing a secret, the two parties can be
  80.    sure of each other's identities, even when an active attacker exists.
  81.  
  82.    Because OAKLEY is a generic key exchange protocol, and because the
  83.    keys that it generates might be used for encrypting data with a long
  84.    privacy lifetime, 20 years or more, it is important that the
  85.    algorithms underlying the protocol be able to ensure the security of
  86.    the keys for that period of time, based on the best prediction
  87.    capabilities available for seeing into the mathematical future.  The
  88.    protocol therefore has two options for adding to the difficulties
  89.    faced by an attacker who has a large amount of recorded key exchange
  90.    traffic at his disposal (a passive attacker).  These options are
  91.    useful for deriving keys which will be used for encryption.
  92.  
  93.    The OAKLEY protocol is related to STS, sharing the similarity of
  94.    authenticating the Diffie-Hellman exponentials and using them for
  95.    determining a shared key, and also of achieving Perfect Forward
  96.    Secrecy for the shared key, but it differs from the STS protocol in
  97.    several ways.
  98.  
  99.       The first is the addition of a weak address identification
  100.       mechanism ("cookies", described by Phil Karn [Photuris]) to help
  101.       avoid denial of service attacks.
  102.  
  103.       The second extension is to allow the two parties to select
  104.       mutually agreeable supporting algorithms for the protocol: the
  105.       encryption method, the key derivation method, and the
  106.       authentication method.
  107.  
  108.       Thirdly, the authentication does not depend on encryption using
  109.       the Diffie-Hellman exponentials; instead, the authentication
  110.       validates the binding of the exponentials to the identities of the
  111.       parties.
  112.  
  113.       The protocol does not require the two parties compute the shared
  114.       exponentials prior to authentication.
  115.  
  116.       This protocol adds additional security to the derivation of keys
  117.       meant for use with encryption (as opposed to authentication) by
  118.  
  119.  
  120.  
  121. H. K. Orman                                                     [Page 2]
  122.  
  123. INTERNET DRAFT                                                  May 1996
  124.  
  125.  
  126.       including a dependence on an additional algorithm.  The derivation
  127.       of keys for encryption is made to depend not only on the Diffie-
  128.       Hellman algorithm, but also on the cryptographic method used to
  129.       securely authenticate the communicating parties to each other.
  130.  
  131.       Finally, this protocol explicitly defines how the two parties can
  132.       select the mathematical structures (group representation and
  133.       operation) for performing the Diffie-Hellman algorithm; they can
  134.       use standard groups or define their own.  User-defined groups
  135.       provide an additional degree of long-term security.
  136.  
  137.  
  138.    OAKLEY has several options for distributing keys.  In addition to the
  139.    classic Diffie-Hellman exchange, this protocol can be used to derive
  140.    a new key from an existing key and to distribute an externally
  141.    derived key by encrypting it.
  142.  
  143.    The protocol allows two parties to use all or some of the anti-
  144.    clogging and perfect forward secrecy features.  It also permits the
  145.    use of authentication based on symmetric encryption or non-encryption
  146.    algorithms.  This flexibility is included in order to allow the
  147.    parties to use the features that are best suited to their security
  148.    and performance requirements.
  149.  
  150.    This document draws extensively in spirit and approach from the
  151.    Photuris draft by Karn and Simpson [Photuris] (and from discussions
  152.    with the authors), specifics of the ISAKMP draft by Schertler et al.
  153.    [ISAKMP], and it was also influenced by papers by Paul van Oorschot
  154.    and Hugo Krawcyzk.
  155.  
  156. 2. The Protocol Outline
  157.  
  158. 2.1  General Remarks
  159.  
  160.    The OAKLEY protocol is used to establish a shared key with an
  161.    assigned identifier and associated authenticated identities for the
  162.    two parties.  The name of the key can be used later to derive
  163.    security associations for the RFC1826 and RFC1827 protocols (AH and
  164.    ESP) or to achieve other network security goals.
  165.  
  166.    Each key is associated with algorithms that are used for
  167.    authentication, privacy, and one-way functions.  These are ancillary
  168.    algorithms for OAKLEY; their appearance in subsequent security
  169.    association definitions derived with other protocols is neither
  170.    required nor prohibited.
  171.  
  172.    The specification of the details of how to apply an algorithm to data
  173.    is called a transform.  This document does not supply the transform
  174.    definitions; they will be in separate RFC's.
  175.  
  176.    The anti-clogging tokens, or "cookies", provide a weak form of source
  177.    address identification for both parties; the cookie exchange can be
  178.    completed before they perform the computationally expensive part of
  179.    the protocol (large integer exponentiations).
  180.  
  181.  
  182.  
  183. H. K. Orman                                                     [Page 3]
  184.  
  185. INTERNET DRAFT                                                  May 1996
  186.  
  187.  
  188.    It is important to note that OAKLEY uses the cookies for two
  189.    purposes: anti-clogging and key naming.  The two parties to the
  190.    protocol each contribute one cookie at the initiation of key
  191.    establishment; the pair of cookies becomes the key identifier
  192.    (KEYID), a reusable name for the keying material.  Because of this
  193.    dual role, we will use the notation for the concatenation of the
  194.    cookies ("COOKIE-I, COOKIE-R") interchangeably with the symbol
  195.    "KEYID".
  196.  
  197.    OAKLEY is designed to be a compatible component of the ISAKMP
  198.    protocol [ISAKMP], which runs over the UDP protocol using a well-
  199.    known port (see the RFC on port assignments, STD02-RFC-1700).  The
  200.    only technical requirement for the protocol environment is that the
  201.    underlying protocol stack must be able to supply the Internet address
  202.    of the remote party for each message.  Thus, OAKLEY could, in theory,
  203.    be used directly over the IP protocol or over UDP, if suitable
  204.    protocol or port number assignments were available.
  205.  
  206.    The machine running OAKLEY must provide a good random number
  207.    generator, as described in [RFC1750], as the source of random numbers
  208.    required in this protocol description.  Any mention of a "nonce"
  209.    implies that the nonce value is generated by such a generator.  The
  210.    same is true for "pseudorandom" values.
  211.  
  212. 2.2  Notation
  213.  
  214. The section describes the notation used in this document for message
  215. sequences and content.
  216.  
  217. 2.2.1  Message descriptions
  218.  
  219.    The protocol exchanges below are written in an abbreviated notation
  220.    that is intended to convey the essential elements of the exchange in
  221.    a clear manner.  A brief guide to the notation follows.  The detailed
  222.    formats and assigned values are given in the appendices.
  223.  
  224.    In order to represent message exchanges succinctly, this document
  225.    uses an abbreviated notation that describes each message in terms of
  226.    its source and destination and relevant fields.
  227.  
  228.    Arrows ("->") indicate whether the message sent from the initiator to
  229.    the responder, or vice versa ("<-").
  230.  
  231.    The fields in the message are named and comma separated.  The
  232.    protocol uses the convention that the first several fields constitute
  233.    a fixed header format for all messages.
  234.  
  235.    For example, consider a HYPOTHETICAL exchange of messages involving a
  236.    fixed format message, the four fixed fields being two "cookies", the
  237.    third field being a message type name, the fourth field being a
  238.    multi-precision integer representing a power of a number:
  239.  
  240.         Initiator                                       Responder
  241.             ->    Cookie-I, 0, OK_KEYX, g^x                    ->
  242.  
  243.  
  244.  
  245. H. K. Orman                                                     [Page 4]
  246.  
  247. INTERNET DRAFT                                                  May 1996
  248.  
  249.  
  250.             <-    Cookie-R, Cookie-I, OK_KEYX, g^y            <-
  251.  
  252.    The notation describes a two message sequence.  The initiator begins
  253.    by sending a message with 4 fields to the responder; the first field
  254.    has the unspecified value "Cookie-I", second field has the numeric
  255.    value 0, the third field indicates the message type is OK_KEYX, the
  256.    fourth value is an abstract group element g to the x'th power.
  257.  
  258.    The second line indicates that the responder replies with value
  259.    "Cookie-R" in the first field, a copy of the "Cookie-I" value in the
  260.    second field, message type OK_KEYX, and the number g raised to the
  261.    y'th power.
  262.  
  263.    The value OK_KEYX is in capitals to indicate that it is a unique
  264.    constant (constants are defined the appendices).
  265.  
  266.    Variable precision integers with length zero are null values for the
  267.    protocol.
  268.  
  269.    Sometimes the protocol will indicate that an entire payload (usually
  270.    the Key Exchange Payload) has null values.  The payload is still
  271.    present in the message, for the purpose of simplifying parsing.
  272.  
  273. 2.2.2 Guide to symbols
  274.  
  275.    Cookie-I and Cookie-R (or CKY-I and CKY-R) are 64-bit pseudo-random
  276.    numbers.  The generation method must ensure with high probability
  277.    that the numbers used for each IP remote address are unique over some
  278.    previous time period, such as one hour.
  279.  
  280.    KEYID is the concatenation of the initiator and responder cookies and
  281.    the domain of interpretation; it is the name of keying material.
  282.  
  283.    sKEYID is used to denote the keying material named by the KEYID.  It
  284.    is never transmitted, but it is used in various calculations
  285.    performed by the two parties.
  286.  
  287.    OK_KEYX and OK_NEWGRP are distinct message types.
  288.  
  289.    IDP is a bit indicating whether or not material after the encryption
  290.    boundary (see appendix D), is encrypted.
  291.  
  292.    g^x and g^y are encodings of group elements, where g is a special
  293.    group element indicated in the group description (see Appendix A) and
  294.    g^x indicates that element raised to the x'th power.  The type of the
  295.    encoding is either a variable precision integer or a pair of such
  296.    integers, as indicated in the group operation in the group
  297.    description.  Note that we will write g^xy as a short-hand for
  298.    g^(xy).  See Appendix J for references that describe implementing
  299.    large integer computations and the relationship between various group
  300.    definitions and basic arithmetic operations.
  301.  
  302.    EHAO is a list of encryption/hash/authentication choices.  Each item
  303.    is a pair of values: a class name and an algorithm name.
  304.  
  305.  
  306.  
  307. H. K. Orman                                                     [Page 5]
  308.  
  309. INTERNET DRAFT                                                  May 1996
  310.  
  311.  
  312.    EHAS is a set of three items selected from the EHAO list, one from
  313.    each of the classes for encryption, hash, authentication.
  314.  
  315.    GRP is a name (32-bit value) for the group and its relevant
  316.    parameters: the size of the integers, the arithmetic operation, and
  317.    the generator element.  There are a few pre-defined GRP's (for 768
  318.    bit modular exponentiation groups, 1024 bit modexp, 2048 bit modexp,
  319.    155-bit elliptic curve, see Appendix H), but participants can share
  320.    other group descriptions in a later protocol stage (see the section
  321.    NEW GROUP).  It is important to separate notion of the GRP from the
  322.    group descriptor (Appendix A); the former is a name for the latter.
  323.  
  324.    The symbol vertical bar "|" is used to denote concatenation of bit
  325.    strings.  Fields are concatenated using their encoded form as they
  326.    appear in their payload.
  327.  
  328.    Ni and Nr are nonces selected by the initiator and responder,
  329.    respectively.
  330.  
  331.    ID(I) and ID(R) are the identities to be used in authenticating the
  332.    initiator and responder respectively.
  333.  
  334.    E{x}Ki indicates the encryption of x using the public key of the
  335.    initiator.  Encryption is done using the algorithm associated with
  336.    the authentication method; usually this will be RSA.
  337.  
  338.    S{x}Ki indicates the signature over x using the private key (signing
  339.    key) of the initiator.  Signing is done using the algorithm
  340.    associated with the authentication method; usually this will be RSA
  341.    or DSS.
  342.  
  343.    prf(a, b) denotes the result of applying pseudo-random function "a"
  344.    to data "b".  One may think of "a" as a key or as a value that
  345.    characterizes the function prf; in the latter case it is the index
  346.    into a family of functions.
  347.  
  348.    prf(0, b) denotes the application of a one-way function to data "b".
  349.    The similarity with the previous notation is deliberate and indicates
  350.    that a single algorithm, e.g. MD5, might will used for both purposes.
  351.    In the first case a "keyed" MD5 transform would be used with key "a";
  352.    in the second case the transform would have the fixed key value zero,
  353.    resulting in a one-way function.
  354.  
  355.    The term "transform" is used to refer to functions defined in
  356.    auxiliary RFC's.  The the transform RFC's will be drawn from those
  357.    defined for IPSEC AH and ESP (see RFC1825 for the overall
  358.    architecture encompassing these protocols).
  359.  
  360.  
  361. 2.3 The Key Exchange Message Overview
  362.  
  363.  
  364.    The goal of key exchange processing is the secure establishment of
  365.    common keying information state in the two parties.  This state
  366.  
  367.  
  368.  
  369. H. K. Orman                                                     [Page 6]
  370.  
  371. INTERNET DRAFT                                                  May 1996
  372.  
  373.  
  374.    information is a key name, secret keying material, the identification
  375.    of the two parties, and three algorithms for use during
  376.    authentication: encryption (for privacy of the identities of the two
  377.    parties), hashing (a pseudorandom function for protecting the
  378.    integrity of the messages and for authenticating message fields), and
  379.    authentication (the algorithm on which the mutual authentication of
  380.    the two parties is based).  The encodings and meanings for these
  381.    choices are presented in Appendix B.
  382.  
  383.    The main mode exchange has five optional features: stateless cookie
  384.    exchange, perfect forward secrecy for the keying material, secrecy
  385.    for the identities, perfect forward secrecy for identity secrecy, use
  386.    of signatures (for non-repudiation).  The two parties can use all or
  387.    none of these features.
  388.  
  389.    The general outline of processing is that the Initiator of the
  390.    exchange begins by specifying as much information as he wishes in his
  391.    first message.  The Responder replies, supplying as much information
  392.    as he wishes.  The two sides exchange messages, supplying more
  393.    information each time, until their requirements are satisfied.
  394.  
  395.    The choice of how much information to include in each message depends
  396.    on which options are desirable.  For example, if stateless cookies
  397.    are not a requirement, and identity secrecy and perfect forward
  398.    secrecy for the keying material are not requirements, and if non-
  399.    repudiatable signatures are acceptable, then the exchange can be
  400.    completed in three messages.
  401.  
  402.    Additional features may increase the number of roundtrips needed for
  403.    the keying material determination.
  404.  
  405.    ISAKMP provides fields for specifying the security association
  406.    parameters for use with the AH and ESP protocols.  These security
  407.    association payload types are specified in the ISAKMP draft; the
  408.    payload types can be protected with OAKLEY keying material and
  409.    algorithms, but this document does not discuss their use.
  410.  
  411.  
  412. 2.3.1 The Essential Key Exchange Message Fields
  413.  
  414.  
  415.    There are 12 fields in an OAKLEY key exchange message.  Not all the
  416.    fields are relevant in every message; if a field is not relevant it
  417.    can have a null value or not be present (no payload).
  418.  
  419.       CK-I             originator cookie.
  420.       CK-R             responder cookie.
  421.       MSGTYPE          for key exchange, will be ISA_KE&AUTH_REQ or ISA_KE&AUTH_REP;
  422.                        for new group definitions, will be ISA_NEW_GROUP_REQ
  423.                        or ISA_NEW_GROUP_REP
  424.       GRP              the name of the Diffie-Hellman group used for the exchange
  425.       g^x (or g^y)     variable length integer representing a power of
  426.                        group generator
  427.       EHAO or EHAS     encryption, hash, authentication functions, offered
  428.  
  429.  
  430.  
  431. H. K. Orman                                                     [Page 7]
  432.  
  433. INTERNET DRAFT                                                  May 1996
  434.  
  435.  
  436.                        and selected
  437.       IDP              an indicator as to whether or not encryption with
  438.                        g^xy follows (perfect forward secrecy for ID's)
  439.       ID(I)            the identity for the Initiator
  440.       ID(R)            the identity for the Responder
  441.       Ni               nonce supplied by the Initiator
  442.       Nr               nonce supplied by the Responder
  443.  
  444.    The construction of the cookies is implementation dependent.  Phil
  445.    Karn has recommended making them the result of a one-way function
  446.    applied to a secret value (changed periodically), the local and
  447.    remote IP address, and the local and remote UDP port.  In this way,
  448.    the cookies remain stateless and expire periodically.  Note that with
  449.    OAKLEY, this would cause the KEYID's derived from the secret value to
  450.    also expire, necessitating the removal of any state information
  451.    associated with it.
  452.  
  453.    In order to support pre-distributed keys, we recommend that
  454.    implementations reserved some portion of their cookie space to
  455.    permanent keys.  The encoding of these depends only on the local
  456.    implementation.
  457.  
  458.    The encryption functions used with OAKLEY must be cryptographic
  459.    transforms which guarantee privacy and integrity for the message
  460.    data.  Merely using DES in CBC mode is not permissible.  The
  461.    MANDATORY and OPTIONAL transforms will include any that satisfy this
  462.    criteria and are defined for use with RFC1827 (ESP).
  463.  
  464.    The one-way (hash) functions used with OAKLEY must be cryptographic
  465.    transforms which can be used as either keyed hash (pseudo-random) or
  466.    non-keyed transforms.  The MANDATORY and OPTIONAL transforms will
  467.    include any that are defined for use with RFC1826 (AH).
  468.  
  469.    Where nonces are indicated, they will be variable precision integers
  470.    with an entropy value that matches the "strength" attribute of the
  471.    GRP used with the exchange.  If no GRP is indicated, the nonces must
  472.    be at least 90 bits long.  The pseudo-random generator for the nonce
  473.    material should start with initial data that has at least 90 bits of
  474.    entropy; see RFC1750.
  475.  
  476.  
  477. 2.3.2 Mapping to ISAKMP Message Structures
  478.  
  479.  
  480.    All the OAKLEY message fields correspond to ISAKMP message payloads
  481.    or payload components.  The relevant payload fields are the SA
  482.    payload, the AUTH payload, the Certificate Payload, the Key Exchange
  483.    Payload.
  484.  
  485.    Some of the ISAKMP header and payload fields will have constant
  486.    values when used with OAKLEY:
  487.       DOI, the Domain of Interpretation, will have the value INTERNET.  In this
  488.       document, the DOI will not be mentioned; it is assumed that the
  489.       software implementing OAKLEY will always be in the IPv4 or IPv6 DOI.
  490.  
  491.  
  492.  
  493. H. K. Orman                                                     [Page 8]
  494.  
  495. INTERNET DRAFT                                                  May 1996
  496.  
  497.  
  498.       Unless otherwise noted, the Key Exchange Identifier is Oakley Main Mode.
  499.  
  500.       In the SA Payload, the Situation is ISAKMPID.  This value is fixed
  501.       at a constant value because Oakley uses the ID fields in AUTH payload
  502.       to identify the two parties.
  503.  
  504.    In the following we indicate where each OAKLEY field appears in the
  505.    ISAKMP message structure.
  506.       CK-I             ISAKMP header
  507.       CK-R             ISAKMP header
  508.       MSGTYPE          Message Type in ISAKMP header
  509.       GRP              SA payload, Proposal section
  510.       g^x (or g^y)     Key Exchange Payload, encoded as a variable precision integer
  511.       EHAO and EHAS    SA payload, Proposal section
  512.       IDP              A bit in the RESERVED field in the AUTH header
  513.       ID(I)            AUTH payload, Identity field
  514.       ID(R)            AUTH payload, Identity field
  515.       Ni               AUTH payload, Nonce Field
  516.       Nr               AUTH payload, Nonce Field
  517.       S{...}Kx         AUTH payload, Data Field
  518.       prf{K,...}       AUTH payload, Data Field
  519.  
  520.  
  521. 2.4 The Key Exchange Protocol
  522.  
  523.    The exact number and content of messages exchanged during an OAKLEY
  524.    key exchange depends on which options the Initiator and Responder
  525.    want to use.  A key exchange can be completed with three or more
  526.    messages, depending on those options.
  527.  
  528.    The three components of the key determination protocol are the
  529.       1. cookie exchange (optionally stateless)
  530.       2. Diffie-Hellman half-key exchange (optional, but essential for
  531.          perfect forward secrecy)
  532.       3. authentication (options: privacy for ID's, privacy for ID's with PFS,
  533.          non-repudiatable)
  534.  
  535.    The initiator can supply as little information as a bare exchange
  536.    request, carrying no additional information.  On the other hand the
  537.    initiator can begin by supplying all of the information necessary for
  538.    the responder to authenticate the request and complete the key
  539.    determination quickly, if the responder chooses to accept this
  540.    method.  If not, the responder can reply with a minimal amount of
  541.    information (at the minimum, a cookie).
  542.  
  543.    The Initiator is responsible for retransmitting messages if the
  544.    protocol does not terminate in a timely fashion.  The Responder must
  545.    therefore avoid discarding reply information until it is acknowledged
  546.    by Initiator in the course of continuing the protocol.
  547.  
  548.    The remainder of this section contains examples demonstrating how to
  549.    use OAKLEY options.
  550.  
  551.  
  552.  
  553.  
  554.  
  555. H. K. Orman                                                     [Page 9]
  556.  
  557. INTERNET DRAFT                                                  May 1996
  558.  
  559.  
  560. 2.4.1 An Aggressive Example
  561.  
  562.  
  563.    The following example indicates how two parties can complete a key
  564.    exchange in two messages.  The identities are not secret, the derived
  565.    keying material is protected by PFS.
  566.  
  567.    By using digital signatures, the two parties will have a proof of
  568.    communication that can be recorded and presented later to a third
  569.    party.
  570.  
  571.    The keying material implied by the group exponentials is not needed
  572.    for completing the exchange.  If it is desirable to defer the
  573.    computation, the implementation can save the "x" and "g^y" values and
  574.    mark the keying material as "uncomputed".  It can be computed from
  575.    this information later.
  576.  
  577.  
  578.    Initiator                                                   Responder
  579.    ---------                                                   ---------
  580.      -> CKY-I, 0,     OK_KEYX, GRP, g^x, EHAO, NIDP,               ->
  581.         ID(I), ID(R), Ni, 0,
  582.         S{ID(I) | ID(R) | Ni | 0 | GRP | g^x | EHAO}Ki
  583.     <-  CKY-R, CKY-I, OK_KEYX, GRP, g^y, EHAS, NIDP,
  584.         ID(R), ID(I), Nr, Ni,
  585.         S{ID(R) | ID(I) | Nr | Ni | GRP | g^y | EHAS}Kr            <-
  586.      -> CKY-I, CKY-R, OK_KEYX, GRP, g^x, EHAO, NIDP,                ->
  587.         ID(I), ID(R), Ni, Nr,
  588.         S{ID(I) | ID(R) | Ni | Nr | GRP | g^y | EHAO}Ki
  589.  
  590.    NB "NIDP" means that the PFS option for hiding identities is not used.
  591.       i.e., the identities are not encrypted using g^xy
  592.  
  593.    NB Fields are concatenated using their encoded form as they appear in
  594.    their payload.
  595.  
  596.    The result of this exchange is a key with KEYID = CKY-I|CKY-R and
  597.    value
  598.  
  599.    sKEYID = prf(Ni | Nr, g^xy | CKY-I | CKY-R).
  600.  
  601.    The processing outline for this exchange is as follows:
  602.  
  603.    Initiation
  604.  
  605.       The Initiator generates a unique cookie and associates it with the
  606.       expected IP address of the responder, and its chosen state
  607.       information: GRP, a pseudo-randomly selected exponent x, g^x, EHAO
  608.       list, nonce, identities.  The first authentication choice in the
  609.       EHAO list is an algorithm that supports digital signatures, and
  610.       this is used to sign the ID's and the nonce and group id.  The
  611.       initiator further
  612.  
  613.       notes that the key is in the initial state of "unauthenticated",
  614.  
  615.  
  616.  
  617. H. K. Orman                                                    [Page 10]
  618.  
  619. INTERNET DRAFT                                                  May 1996
  620.  
  621.  
  622.       and
  623.  
  624.       sets a timer for possible retransmission and/or termination of the
  625.       request.
  626.  
  627.    When the Responder receives the message, he may choose to ignore all
  628.    the information and treat it as merely a request for a cookie,
  629.    creating no state.  If CKY-I is not already in use by the source
  630.    address in the IP header, the responder generates a unique cookie,
  631.    CKY-R.  The next steps depend on the Responder's preferences.  The
  632.    minimal required response is to reply with the first cookie field set
  633.    to zero and CKY-R in the second field.  For this example we will
  634.    assume that responder is more aggressive (for the alternatives, see
  635.    section 6) and accepts the following:
  636.       group with identifier GRP,
  637.       first authentication choice (which must be the digital signature
  638.       method
  639.       used to sign the Initiator message),
  640.       lack of perfect forward secrecy for protecting the identities,
  641.       identity ID(I) and identity ID(R)
  642.  
  643.    In this example the Responder decides to accept all the information
  644.    offered by the initiator.  It validates the signature over the signed
  645.    portion of the message, and associate the pair (CKY-I, CKY-R) with
  646.    the following state information:
  647.  
  648.    the source and destination network addresses of the message
  649.  
  650.    key state of "unauthenticated"
  651.  
  652.    the first algorithm from the authentication offer
  653.  
  654.    group GRP, a "y" exponent value in group GRP, and g^x from the
  655.    message
  656.  
  657.    the nonce Ni and a pseudorandomly selected value Nr
  658.  
  659.    a timer for possible destruction of the state.
  660.  
  661.    The Responder computes g^y, forms the reply message, and then signs
  662.    the state information with the private key of ID(R) and sends it to
  663.    the Initiator.
  664.  
  665.    In this example, to expedite the protocol, the Responder implicitly
  666.    accepts the first algorithm in the Authentication class of the EHAO
  667.    list.  This because he cannot validate the Initiator signature
  668.    without accepting the algorithm for doing the signature.  The
  669.    Responder's EHAS list will also reflect his acceptance.
  670.  
  671.    The Initiator receives the reply message and
  672.       validates that CKY-I is a valid association for the network
  673.       address of the incoming message,
  674.  
  675.       adds the CKY-R value to the state for the pair (CKY-I, network
  676.  
  677.  
  678.  
  679. H. K. Orman                                                    [Page 11]
  680.  
  681. INTERNET DRAFT                                                  May 1996
  682.  
  683.  
  684.       address), and associates all state information with the pair
  685.       (CKY-I, CKY-R),
  686.  
  687.       validates the signature of the responder over the state
  688.       information (should validation fail, the message is discarded)
  689.  
  690.       adds g^y to its state information,
  691.  
  692.       saves the EHA selections in the state,
  693.  
  694.       optionally computes (g^y)^x (= g^xy) (this can be deferred until
  695.       after sending the reply message),
  696.  
  697.       sends the reply message, signed with the public key of ID(I),
  698.  
  699.       marks the KEYID (CKY-I|CKY-R) as authenticated,
  700.  
  701.       and composes the reply message and signature.
  702.  
  703.  
  704.    When the Responder receives the Initiator message, and if the
  705.    signature is valid, it marks the key as being in the authenticated
  706.    state.  It should compute g^xy and associate it with the KEYID.
  707.  
  708.    Note that although PFS for identity protection is not used, PFS for
  709.    the derived keying material is still present because the Diffie-
  710.    Hellman half-keys g^x and g^y are exchanged.
  711.  
  712.    Even if the Responder only accepts some of the Initiator information,
  713.    the Initiator will consider the protocol to be progressing.  The
  714.    Initiator should assume that fields that were not accepted by the
  715.    Responder were not recorded by the Responder.
  716.  
  717.    If the Responder does not accept the aggressive exchange and selects
  718.    another algorithm for the A function, then the protocol will not
  719.    continue using the signature algorithm or the signature value from
  720.    the first message.
  721.  
  722. 2.4.1.1 Fields Not Present
  723.  
  724.    If the Responder does not accept all the fields offered by the
  725.    Initiator, he should include null values for those fields in his
  726.    response.  Section 6 has guidelines on how to select fields in a
  727.    "left-to-right" manner.  If a field is not accepted, then it and all
  728.    following fields must have null values.
  729.  
  730.    The Responder should not record any information that it does not
  731.    accept.  If the ID's and nonces have null values, there will not be a
  732.    signature over these null values.
  733.  
  734. 2.4.1.2 Signature via Pseudo-Random Functions
  735.  
  736.  
  737.    The aggressive example is written to suggest that public key
  738.  
  739.  
  740.  
  741. H. K. Orman                                                    [Page 12]
  742.  
  743. INTERNET DRAFT                                                  May 1996
  744.  
  745.  
  746.    technology is used for the signatures.  However, a pseudorandom
  747.    function can be used, if the parties have previously agreed to such a
  748.    scheme and have a shared key.
  749.  
  750.    If the first proposal in the EHAO list is an "existing key" method,
  751.    then the KEYID named in that proposal will supply the keying material
  752.    for the "signature" which is computed using the "H" algorithm
  753.    associated with the KEYID.
  754.  
  755.    Suppose the first proposal in EHAO is
  756.               EXISTING-KEY, 32
  757.    and the "H" algorithm for KEYID 32 is MD5-HMAC, by prior negotiation.
  758.    The keying material is some string of bits, call it sK32.  Then in
  759.    the first message in the aggressive exchange, where the signature
  760.  
  761.            S{ID(I), ID(R), Ni, 0, GRP, g^x, EHAO}Ki
  762.  
  763.    is indicated, the signature computation would be performed by
  764.        MD5-HMAC_func(KEY=sK32, DATA = ID(I) | ID(R) | Ni | 0 | GRP | g^x
  765.       | EHAO)
  766.    (The exact definition of the algorithm corresponding to "MD5-HMAC-
  767.    func" will appear in the RFC defining that transform).
  768.  
  769.    The result of this computation appears in the Authentication payload.
  770.  
  771. 2.4.2 An Aggressive Example With Hidden Identities
  772.  
  773.  
  774.    The following example indicates how two parties can complete a key
  775.    exchange without using digital signatures.  Public key cryptography
  776.    hides the identities during authentication.  The group exponentials
  777.    are exchanged and authenticated, but the implied keying material
  778.    (g^xy) is not needed during the exchange.
  779.  
  780.    This exchange has an important difference from the previous signature
  781.    scheme --- in the first message, an identity for the responder is
  782.    indicated as cleartext: ID(R').  However, the identity hidden with
  783.    the public key cryptography is different: ID(R).  This happens
  784.    because the Initiator must somehow tell the Responder which
  785.    public/private key pair to use for the decryption, but at the same
  786.    time, the identity is hidden by encryption with that public key.
  787.  
  788.    The Initiator might elect to forgo secrecy of the Responder identity,
  789.    but this is undesirable.  Instead, if there is a well-known identity
  790.    for the Responder node, the public key for that identity can be used
  791.    to encrypt the actual Responder identity.
  792.  
  793.  
  794.    Initiator                                                   Responder
  795.    ---------                                                   ---------
  796.      -> CKY-I, 0,     OK_KEYX, GRP, g^x, EHAO, NIDP,              ->
  797.         ID(R'), E{ID(I), ID(R), E{Ni}Kr}Kr'
  798.     <-  CKY-R, CKY-I, OK_KEYX, GRP, g^y, EHAS, NIDP,
  799.         E{ID(R), ID(I), Nr}Ki,
  800.  
  801.  
  802.  
  803. H. K. Orman                                                    [Page 13]
  804.  
  805. INTERNET DRAFT                                                  May 1996
  806.  
  807.  
  808.         prf(Kir, ID(R) | ID(I) | Nr | Ni | GRP | g^y | g^x)      <-
  809.      -> CKY-I, CKY-R, OK_KEYX, GRP, 0, 0, NIDP,
  810.         prf(Kir, ID(I)| ID(R) | Ni | Nr | GRP | g^x | g^y)        ->
  811.  
  812.    Kir = prf(0, Ni | Nr)
  813.  
  814.    NB "NIDP" means that the PFS option for hiding identities is not used.
  815.  
  816.    NB  The ID(R') value is included in the Authentication payload as
  817.        described in Appendix B.
  818.  
  819.  
  820.    The result of this exchange is a key with KEYID = CKY-I|CKY-R and
  821.    value sKEYID = prf(Ni | Nr, g^xy | CKY-I | CKY-R).
  822.  
  823.    The processing outline for this exchange is as follows:
  824.  
  825.    Initiation
  826.       The Initiator generates a unique cookie and associates it with the
  827.       expected IP address of the responder, and its chosen state
  828.       information: GRP, g^x, EHAO list.  The first authentication choice
  829.       in the EHAO list is an algorithm that supports public key
  830.       encryption.  The Initiator also names the two identities to be
  831.       used for the connection and enters these into the state.  A well-
  832.       known identity for the responder machine is also chosen, and the
  833.       public key for this identity is used to encrypt the nonce Ni and
  834.       the two connection identities.  The Initiator further
  835.  
  836.       notes that the key is in the initial state of "unauthenticated",
  837.       and
  838.  
  839.       sets a timer for possible retransmission and/or termination of the
  840.       request.
  841.  
  842.    When the Responder receives the message, he may choose to ignore all
  843.    the information and treat it as merely a request for a cookie,
  844.    creating no state.
  845.  
  846.    If CKY-I is not already in use by the source address in the IP
  847.    header, the Responder generates a unique cookie, CKY-R.  As before,
  848.    the next steps depend on the responders preferences.  The minimal
  849.    required response is a message with the first cookie field set to
  850.    zero and CKY-R in the second field.  For this example we will assume
  851.    that responder is more aggressive and accepts the following:
  852.       group GRP, first authentication choice (which must be the public key
  853.       encryption algorithm used to encrypt the payload), lack of perfect
  854.       forward secrecy for protecting the identities, identity ID(I),
  855.       identity ID(R)
  856.  
  857.    The Responder must decrypt the ID and nonce information, using the
  858.    private key for the R' ID.  After this, the private key for the R ID
  859.    will be used to decrypt the nonce field.
  860.  
  861.    The Responder now associates the pair (CKY-I, CKY-R) with the
  862.  
  863.  
  864.  
  865. H. K. Orman                                                    [Page 14]
  866.  
  867. INTERNET DRAFT                                                  May 1996
  868.  
  869.  
  870.    following state information:
  871.  
  872.    the source and destination network addresses of the message
  873.  
  874.    key state of "unauthenticated"
  875.  
  876.    the first algorithm from each class in the EHAO (encryption-hash-
  877.    authentication algorithm offers) list
  878.  
  879.    group GRP and a y and g^y value in group GRP
  880.  
  881.    the nonce Ni and a pseudorandomly selected value Nr
  882.  
  883.    a timer for possible destruction of the state.
  884.  
  885.    The Responder then encrypts the state information with the public key
  886.    of ID(I), forms the prf value, and sends it to the Initiator.
  887.  
  888.    The Initiator receives the reply message and
  889.       validates that CKY-I is a valid association for the network
  890.       address of the incoming message,
  891.  
  892.       adds the CKY-R value to the state for the pair (CKY-I, network
  893.       address), and associates all state information with the pair
  894.       (CKY-I, CKY-R),
  895.  
  896.       decrypts the ID and nonce information
  897.  
  898.       checks the prf calculation (should this fail, the message is
  899.       discarded)
  900.  
  901.       adds g^y to its state information,
  902.  
  903.       saves the EHA selections in the state,
  904.  
  905.       optionally computes (g^x)^y (= g^xy) (this may be deferred), and
  906.  
  907.       sends the reply message, encrypted with the public key of ID(R),
  908.  
  909.       and marks the KEYID (CKY-I|CKY-R) as authenticated.
  910.  
  911.    When the Responder receives this message, it marks the key as being
  912.    in the authenticated state.  If it has not already done so, it should
  913.    compute g^xy and associate it with the KEYID.
  914.  
  915.    The secret keying material sKEYID = prf(Ni | Nr,  g^xy | CKY-I |
  916.    CKY-R)
  917.  
  918.    Note that although PFS for identity protection is not used, PFS for
  919.    the derived keying material is still present because the Diffie-
  920.    Hellman half-keys g^x and g^y are exchanged.
  921.  
  922.  
  923.  
  924.  
  925.  
  926.  
  927. H. K. Orman                                                    [Page 15]
  928.  
  929. INTERNET DRAFT                                                  May 1996
  930.  
  931.  
  932. 2.4.3 An Aggressive Example With Private Identities and Without Diffie-
  933. Hellman
  934.  
  935.  
  936.    Considerable computational expense can be avoided if perfect forward
  937.    secrecy is not a requirement for the session key derivation.  The two
  938.    parties can exchange nonces and secret key parts to achieve the
  939.    authentication and derive keying material.  The long-term privacy of
  940.    data protected with derived keying material is dependent on the
  941.    private keys of each of the parties.
  942.  
  943.    In this exchange, the GRP has the value 0 and the field for the group
  944.    exponential is used to hold a nonce value instead.
  945.  
  946.    As in the previous section, the first proposed algorithm must be a
  947.    public key encryption system; by responding with a cookie and a non-
  948.    zero exponential field, the Responder implicitly accepts the first
  949.    proposal and the lack of perfect forward secrecy for the identities
  950.    and derived keying material.
  951.  
  952.  
  953.    Initiator                                                   Responder
  954.    ---------                                                   ---------
  955.      -> CKY-I, 0,     OK_KEYX, 0, 0, EHAO, NIDP,                  ->
  956.         ID(R'), E{ID(I), ID(R), sKi}Kr',
  957.         prf(Kir, ID(R), ID(I)                                    <-
  958.     <-  CKY-R, CKY-I, OK_KEYX, 0, 0, EHAS, NIDP,
  959.         E{ID(R), ID(I), sKr}Ki,
  960.         prf(Kir, ID(R), ID(I), Nr, Ni)                           <-
  961.      -> CKY-I, CKY-R, OK_KEYX, EHAS, NIDP,
  962.         prf(Kir, ID(I), ID(R), Ni, Nr)                            ->
  963.  
  964.    Kir = prf(0, sKi | sKr)
  965.  
  966.    NB  The sKi and sKr values go into the nonce fields.  The change in
  967.    notation is meant to emphasize that their entropy is critical to setting
  968.    the keying material.
  969.  
  970.    NB "NIDP" means that the PFS option for hiding identities is not used.
  971.  
  972.  
  973.    The result of this exchange is a key with KEYID = CKY-I|CKY-R and
  974.    value sKEYID = prf(Kir, CKY-I | CKY-R).
  975.  
  976. 2.4.4 A Conservative Example
  977.  
  978.  
  979.    In this example the two parties are minimally aggressive; they use
  980.    the cookie exchange to delay creation of state, and they use perfect
  981.    forward secrecy to protect the identities.
  982.  
  983.    The responder considers the ability of the initiator to repeat CKY-R
  984.    as weak evidence that the message originates from a "live"
  985.    correspondent on the network and the correspondent is associated with
  986.  
  987.  
  988.  
  989. H. K. Orman                                                    [Page 16]
  990.  
  991. INTERNET DRAFT                                                  May 1996
  992.  
  993.  
  994.    the initiator's network address.  The initiator makes similar
  995.    assumptions when CKY-I is repeated to the initiator.
  996.  
  997.    All messages must have either have valid cookies or at least one zero
  998.    cookie. If both cookies are zero, this indicates a request for a
  999.    cookie; if only the initiator cookie is zero, it is a response to a
  1000.    cookie request.
  1001.  
  1002.    Information in messages violating the cookie rules cannot be used for
  1003.    any OAKLEY operations.
  1004.  
  1005.    Note that the Initiator must and Responder must agree on one set of
  1006.    EHA algorithms; there is not one set for the Responder and one for
  1007.    the Initiator.  The Initiator must include at least MD5 and DES in
  1008.    the initial offer.
  1009.  
  1010.    Fields not indicated have null values.
  1011.  
  1012.    Initiator                                                   Responder
  1013.    ---------                                                   ---------
  1014.      ->     0, 0, OK_KEYX                                          ->
  1015.     <-      0, CKY-R, OK_KEYX                                     <-
  1016.      ->     CKY-I, CKY-R, OK_KEYX, GRP, g^x, EHAO                  ->
  1017.     <-      CKY-R, CKY-I, OK_KEYX, GRP, g^y, EHAS                 <-
  1018.      ->     CKY-I, CKY-R, OK_KEYX, GRP, g^x, IDP*,
  1019.             ID(I), ID(R), E{Ni}Kr,                                 ->
  1020.     <-      CKY-R, CKY-I, OK_KEYX, GRP, 0  , 0, IDP,              <-
  1021.             E{Nr, Ni}Ki, ID(R), ID(I),
  1022.             prf(Nr | Ni, GRP, g^xy, ID(R), ID(I))
  1023.      ->     CKY-I, CKY-R, OK_KEYX, GRP, 0  , 0, IDP,
  1024.             prf(Ni | Nr, GRP | g^xy | ID(I) | ID(R))               ->
  1025.  
  1026.    * when IDP is in effect, authentication payloads are encrypted with
  1027.      the selected encryption algorithm using the keying material prf(0, g^xy).
  1028.      (The transform defining the encryption algorithm will define
  1029.      how to select key bits from the keying material.)
  1030.      This encryption is in addition to and after any  public key encryption.
  1031.      See Appendix B.
  1032.  
  1033.      Note the in first messages, several fields are omitted from the
  1034.      description.  These fields are present as null values.
  1035.  
  1036.    The first exchange allows the Responder to use stateless cookies; if
  1037.    the responder generates cookies in a manner that allows him to
  1038.    validate them without saving them, as in Photuris, then this is
  1039.    possible.  Even if the Initiator includes a cookie in his initial
  1040.    request, the responder can still use stateless cookies by merely
  1041.    omitting the CKY-I from his reply and by declining to record the
  1042.    Initiator cookie until it appears in a later message.
  1043.  
  1044.    After the exchange is complete, both parties compute the shared key
  1045.    material sKEYID as
  1046.    prf(Ni | Nr, g^xy | CKY-I | CKY-R)
  1047.    where "prf" is the pseudo-random function in class "hash" selected in
  1048.  
  1049.  
  1050.  
  1051. H. K. Orman                                                    [Page 17]
  1052.  
  1053. INTERNET DRAFT                                                  May 1996
  1054.  
  1055.  
  1056.    the EHA list.
  1057.  
  1058.    As with the cookies, each party considers the ability of the remote
  1059.    side to repeat the Ni or Nr value as a proof that Ka, the public key
  1060.    of party a, speaks for the remote party and establishes its identity.
  1061.  
  1062.    In analyzing this exchange, it is important to note that although the
  1063.    IDP option ensures that the identities are protected with an
  1064.    ephemeral key g^xy, the authentication itself does not depend on
  1065.    g^xy.  It is essential that the authentication steps validate the g^x
  1066.    and g^y values, and it is thus imperative that the authentication not
  1067.    involve a circular dependency on them.  A third party could intervene
  1068.    with a "man-in-middle" scheme to convince the initiator and responder
  1069.    to use different g^xy values; although such an attack might result in
  1070.    revealing the identities to the eavesdropper, the authentication
  1071.    would fail.
  1072.  
  1073. 2.4.5 Extra Strength for Protection of Encryption Keys
  1074.  
  1075.  
  1076.    The nonces Ni and Nr are used to provide an extra dimension of
  1077.    secrecy in deriving session keys.  This makes the secrecy of the key
  1078.    depend on two different problems: the discrete logarithm problem in
  1079.    the group G, and the problem of breaking the nonce encryption scheme.
  1080.    If RSA encryption is used, then this second problem is roughly
  1081.    equivalent to factoring the RSA public keys of both the initiator and
  1082.    responder.
  1083.  
  1084.    For authentication, the key type, the validation method, and the
  1085.    certification requirement must be indicated.
  1086.  
  1087.  
  1088.    2.5 Identity and Authentication
  1089.  
  1090.    2.5.1 Identity
  1091.  
  1092.    In OAKLEY exchanges the Initiator offers Initiator and Responder ID's
  1093.    -- the former is the claimed identity for the Initiator, and the
  1094.    latter is the requested ID for the Responder.
  1095.  
  1096.    If neither ID is specified, the ID's are taken from the IP header
  1097.    source and destination addresses.
  1098.  
  1099.    If the Initiator doesn't supply a responder ID, the Responder can
  1100.    reply by naming any identity that the local policy allows.  The
  1101.    Initiator can refuse acceptance by terminating the exchange.
  1102.  
  1103.    The Responder can also reply with a different ID than the Initiator
  1104.    suggested; the Initiator can accept this implicitly by continuing the
  1105.    exchange or refuse it by terminating (not replying).
  1106.  
  1107.    2.5.2 Authentication
  1108.  
  1109.    The authentication of principals to one another is at the heart of
  1110.  
  1111.  
  1112.  
  1113. H. K. Orman                                                    [Page 18]
  1114.  
  1115. INTERNET DRAFT                                                  May 1996
  1116.  
  1117.  
  1118.    any key exchange scheme.  The Internet community must decide on a
  1119.    scalable standard for solving this problem, and OAKLEY must make use
  1120.    of that standard.  At the time of this writing, there is no such
  1121.    standard, though several are emerging.  This document attempts to
  1122.    describe how a handful of standards could be incorporated into
  1123.    OAKLEY, without attempting to pick and choose among them.
  1124.  
  1125.    The following methods can appear in OAKLEY offers:
  1126.  
  1127.    a. Pre-shared Keys
  1128.       When two parties have arranged for a trusted method of
  1129.       distributing secret keys for their mutual authentication, they can
  1130.       be used for authentication.  This has obvious scaling problems for
  1131.       large systems, but it is an acceptable interim solution for some
  1132.       situations.  Support for pre-shared keys is REQUIRED.
  1133.  
  1134.       The encryption, hash, and authentication algorithm for use with a
  1135.       pre-shared key must be part of the state information distributed
  1136.       with the key itself.
  1137.  
  1138.       The pre-shared keys have a KEYID and keying material sKEYID; the
  1139.       KEYID is used in a pre-shared key authentication option offer.
  1140.       There can be more than one pre-shared key offer in a list.
  1141.  
  1142.       Because the KEYID persists over different invocations of OAKLEY
  1143.       (after a crash, etc.), it must occupy a reserved part of the KEYID
  1144.       space for the two parties.  A few bits can be set aside in each
  1145.       party's "cookie space" to accommodate this.
  1146.  
  1147.       There is no certification authority for pre-shared keys.  When a
  1148.       pre-shared key is used to generate an authentication payload, the
  1149.       certification authority is "None", the Authentication Type is
  1150.       "Preshared", and the payload contains
  1151.          the KEYID, encoded as two 64-bit quantities, and
  1152.  
  1153.          the result of applying the pseudorandom hash function to the
  1154.          message body with the sKEYID forming the key for the function
  1155.  
  1156.       See Appendix B for details of formats for the Authentication
  1157.       Payload.
  1158.  
  1159.  
  1160.    b. DNS public keys
  1161.       Security extensions to the DNS protocol [DNSSEC] provide a
  1162.       convenient way to access public key information, especially for
  1163.       public keys associated with hosts.  RSA keys are a requirement for
  1164.       secure DNS implementations; extensions to allow optional DSS keys
  1165.       are a near-term possibility.
  1166.  
  1167.       DNS KEY records have associated SIG records that are signed by a
  1168.       zone authority, and a hierarchy of signatures back to the root
  1169.       server establishes a foundation for trust.  The SIG records
  1170.       indicate the algorithm used for forming the signature.
  1171.  
  1172.  
  1173.  
  1174.  
  1175. H. K. Orman                                                    [Page 19]
  1176.  
  1177. INTERNET DRAFT                                                  May 1996
  1178.  
  1179.  
  1180.       OAKLEY implementations MUST support the use of DNS KEY and SIG
  1181.       records for authenticating with respect to IPv4 and IPv6 addresses
  1182.       and fully qualified domain names.  However, implementations are
  1183.       not required to support any particular algorithm (RSA, DSS, etc.).
  1184.  
  1185.  
  1186.    c. RSA public keys w/o certification authority signature
  1187.       PGP [Zimmerman] uses public keys with an informal method for
  1188.       establishing trust.  The format of PGP public keys and naming
  1189.       methods will be described in a separate RFC.  The RSA algorithm
  1190.       can be used with PGP keys for either signing or encryption; the
  1191.       authentication option should indicate either RSA-SIG or RSA-ENC,
  1192.       respectively.  Support for this is OPTIONAL.
  1193.  
  1194.    d.1 RSA public keys w/ certificates
  1195.       There are various formats and naming conventions for public keys
  1196.       that are signed by one or more certification authorities.  The
  1197.       Public Key Interchange Protocol discusses X.509 encodings and
  1198.       validation.  Support for this is OPTIONAL.
  1199.  
  1200.    d.2 DSS keys w/ certificates
  1201.       Encoding for the Digital Signature Standard with X.509 is
  1202.       described in draft-ietf-ipsec-dss-cert-00.txt.  Support for this
  1203.       is OPTIONAL; an ISAKMP Authentication Type will be assigned.
  1204.  
  1205.  
  1206. 2.5.3 Validating Authentication Keys
  1207.  
  1208.  
  1209.    The combination of the Authentication algorithm, the Authentication
  1210.    Authority, the Authentication Type, and a key (usually public) define
  1211.    how to validate the messages with respect to the claimed identity.
  1212.    The key information will be available either from a pre-shared key,
  1213.    or from some kind of certification authority.
  1214.  
  1215.    Generally the certification authority produces a certificate binding
  1216.    the entity name to a public key.  OAKLEY implementations must be
  1217.    prepared to fetch and validate certificates before using the public
  1218.    key for OAKLEY authentication purposes.
  1219.  
  1220.    The ISAKMP Authentication Payload defines the Authentication
  1221.    Authority field for specifying the authority that must be apparent in
  1222.    the trust hierarchy for authentication.
  1223.  
  1224.    Once an appropriate certificate is obtained (see 2.4.3), the
  1225.    validation method will depend on the Authentication Type; if it is
  1226.    PGP then the PGP signature validation routines can be called to
  1227.    satisfy the local web-of-trust predicates; if it is RSA with X.509
  1228.    certificates, the certificate must be examined to see if the
  1229.    certification authority signature can be validated, and if the
  1230.    hierarchy is recognized by the local policy.
  1231.  
  1232.  
  1233.  
  1234.  
  1235.  
  1236.  
  1237. H. K. Orman                                                    [Page 20]
  1238.  
  1239. INTERNET DRAFT                                                  May 1996
  1240.  
  1241.  
  1242. 2.5.4 Fetching Identity Objects
  1243.  
  1244.    In addition to interpreting the certificate or other data structure
  1245.    that contains an identity, users of OAKLEY must face the task of
  1246.    retrieving certificates that bind a public key to an identifier and
  1247.    also retrieving auxiliary certificates for certifying authorities or
  1248.    co-signers (as in the PGP web of trust).
  1249.  
  1250.    The ISAKMP Credentials Payload can be used to attach useful
  1251.    certificates to OAKLEY messages.  The Credentials Payload is defined
  1252.    in Appendix B.
  1253.  
  1254.    Support for accessing and revoking public key certificates via the
  1255.    Secure DNS protocol [SECDNS] is MANDATORY for OAKLEY implementations.
  1256.    Other retrieval methods can be used when the AUTH class indicates a
  1257.    preference.
  1258.  
  1259.    The Public Key Interchange Protocol discusses a full protocol that
  1260.    might be used with X.509 encoded certificates.
  1261.  
  1262.  
  1263. 2.6 Interface to Cryptographic Transforms
  1264.  
  1265.  
  1266.    The keying material computed by the key exchange should have at least
  1267.    90 bits of entropy, which means that it must be at least 90 bits in
  1268.    length.  This may be more or less than is required for keying the
  1269.    encryption and/or pseudorandom function transforms.
  1270.  
  1271.    The transforms used with OAKLEY should have auxiliary algorithms
  1272.    which take a variable precision integer and turn it into keying
  1273.    material of the appropriate length.  For example, a DES algorithm
  1274.    could take the low order 56 bits, a triple DES algorithm might use
  1275.    the following:
  1276.               K1 = low 56 bits of md5(0|sKEYID)
  1277.               K2 = low 56 bits of md5(1|sKEYID)
  1278.               K3 = low 56 bits of md5(2|sKEYID)
  1279.  
  1280.    The transforms will be called with the keying material encoded as a
  1281.    variable precision integer, the length of the data, and the block of
  1282.    memory with the data.  Conversion of the keying material to a
  1283.    transform key is the responsibility of the transform.
  1284.  
  1285.  
  1286. 2.7 Retransmission, Timeouts, and Error Messages
  1287.  
  1288.  
  1289.    If a response from the Responder is not elicited in an appropriate
  1290.    amount of time, the message should be retransmitted by the Initiator.
  1291.    These retransmissions must be handled gracefully by both parties; the
  1292.    Responder must retain information for retransmitting until the
  1293.    Initiator moves to the next message in the protocol or completes the
  1294.    exchange.
  1295.  
  1296.  
  1297.  
  1298.  
  1299. H. K. Orman                                                    [Page 21]
  1300.  
  1301. INTERNET DRAFT                                                  May 1996
  1302.  
  1303.  
  1304.    Informational error messages present a problem because they cannot be
  1305.    authenticated using only the information present in an incomplete
  1306.    exchange; for this reason, the parties may wish to establish a
  1307.    default key for OAKLEY error messages.  A possible method for
  1308.    establishing such a key is described in Appendix B, under the use of
  1309.    ISA_INIT message types.
  1310.  
  1311.    In the following the message type is OAKLEY Error, the KEYID supplies
  1312.    the H algorithm and key for authenticating the message contents; this
  1313.    value is carried in the Sig/Prf payload.
  1314.  
  1315.    The Error payload contains the error code and the contents of the
  1316.    rejected message.
  1317.  
  1318.  
  1319.                              1                   2                   3
  1320.          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
  1321.         +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1322.         !                                                               !
  1323.         ~                       Initiator-Cookie                        ~
  1324.      /  !                                                               !
  1325. KEYID   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1326.     \  !                                                               !
  1327.         ~                       Responder-Cookie                        ~
  1328.         !                                                               !
  1329.         +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1330.         !                  Domain of Interpretation                     !
  1331.         +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1332.         ! Message Type  ! Exch  ! Vers  !          Length               !
  1333.         +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1334.         !                 SPI (unused)                                  !
  1335.         +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1336.         !                 SPI (unused)                                  !
  1337.         +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1338.         !                 Error Payload                                 !
  1339.         ~                                                               ~
  1340.         +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1341.         !                 Sig/prf Payload
  1342.         ~                                                               ~
  1343.         +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1344.  
  1345.  
  1346.  
  1347.  
  1348. The error message will contain the cookies as presented in the offending
  1349. message, the message type OAKLEY_ERROR, and the reason for the error,
  1350. followed by the rejected message.
  1351.  
  1352. Error messages are informational only, and the correctness of the
  1353. protocol does not depend on them.
  1354.  
  1355. Error reasons:
  1356.  
  1357. TIMEOUT                         exchange has taken too long, state destroyed
  1358.  
  1359.  
  1360.  
  1361. H. K. Orman                                                    [Page 22]
  1362.  
  1363. INTERNET DRAFT                                                  May 1996
  1364.  
  1365.  
  1366. AEH_ERROR                       an unknown algorithm appears in an offer
  1367. GROUP_NOT_SUPPORTED             GRP named is not supported
  1368. EXPONENTIAL_UNACCEPTABLE        exponential too large/small
  1369. SELECTION_NOT_OFFERED           selection does not occur in offer
  1370. NO_ACCEPTABLE_OFFERS            no offer meets host requirements
  1371. AUTHENTICATION_FAILURE          signature or hash function fails
  1372. RESOURCE_EXCEEDED               too many exchanges or too much state info
  1373. NO_EXCHANGE_IN_PROGRESS         a reply received with no request in progress
  1374.  
  1375.  
  1376.  
  1377.  
  1378. 2.8 Additional Security for Privacy Keys: Private Groups
  1379.  
  1380.  
  1381.    If the two parties have need to use a Diffie-Hellman key
  1382.    determination scheme that does not depend on the standard group
  1383.    definitions, they have the option of establishing a private group.
  1384.    The authentication need not be repeated, because this stage of the
  1385.    protocol will be protected by a pre-existing authentication key.  As
  1386.    an extra security measure, the two parties will establish a private
  1387.    name for the shared keying material, so even if they use exactly the
  1388.    same group to communicate with other parties, the re-use will not be
  1389.    apparent to passive attackers.
  1390.  
  1391.    Private groups have the advantage of making a widespread passive
  1392.    attack much harder by increasing the number of groups that would have
  1393.    to be exhaustively analyzed in order to recover a large number of
  1394.    session keys.  This contrasts with the case when only one or two
  1395.    groups are ever used; in that case, one would expect that years and
  1396.    years of session keys would be compromised.
  1397.  
  1398.    There are two technical challenges to face: how can a particular user
  1399.    create a unique and appropriate group, and how can a second party
  1400.    assure himself that the proposed group is reasonably secure?
  1401.  
  1402.    The security of a modular exponentiation group depends on the largest
  1403.    prime factor of the group size.  In order to maximize this, one can
  1404.    choose "strong" or Sophie-Germaine primes, P = 2Q + 1, where P and Q
  1405.    are prime.  However, if P = kQ + 1, where k is small, then the
  1406.    strength of the group is still considerable.  These groups are known
  1407.    as Schnorr subgroups, and they can be found with much less
  1408.    computational effort than Sophie-Germaine primes.
  1409.  
  1410.  
  1411.    Schnorr subgroups can also be validated efficiently by using probable
  1412.    prime tests.
  1413.  
  1414.    It is also fairly easy to find P, k, and Q such that the largest
  1415.    prime factor can be easily proven to be Q.
  1416.  
  1417.    We estimate that it would take about 10 minutes to find a new group
  1418.    of about 2^1024 elements, and this could be done once a day by a
  1419.    scheduled process; validating a group proposed by a remote party
  1420.  
  1421.  
  1422.  
  1423. H. K. Orman                                                    [Page 23]
  1424.  
  1425. INTERNET DRAFT                                                  May 1996
  1426.  
  1427.  
  1428.    would take perhaps a minute on a 25 MHz RISC machine or a 66 MHz CISC
  1429.    machine.
  1430.  
  1431.    We note that validation is done only between previously mutually
  1432.    authenticated parties, and that a new group definition always follows
  1433.    and is protected by a key established using a well-known group.
  1434.    There are four points to keep in mind:
  1435.  
  1436.       a. The description and public identifier for the new group are
  1437.       protected by the well-known group.
  1438.  
  1439.       b. The responder can reject the attempt to establish the new
  1440.       group, either because he is too busy or because he cannot validate
  1441.       the largest prime factor as being sufficiently large.
  1442.  
  1443.       c. The new modulus and generator can be cached for long periods of
  1444.       time; they are not security critical and need not be associated
  1445.       with ongoing activity.
  1446.  
  1447.       d. Generating a new g^x value periodically will be more expensive
  1448.       if there are many groups cached; however, the importance of
  1449.       frequently generating new g^x values is reduced, so the time
  1450.       period can be lengthened correspondingly.
  1451.  
  1452. 2.8.1 Defining a New Group
  1453.    This section describes how to define a new group.  The description of
  1454.    the group is hidden from eavesdroppers, and the identifier assigned
  1455.    to the group is unique to the two parties.  Use of the new group for
  1456.    Diffie-Hellman key exchanges is described in the next section.
  1457.  
  1458.    The secrecy of the description and the identifier increases the
  1459.    difficulty of a passive attack, because if the group descriptor is
  1460.    not known to the attacker, there is no straightforward and efficient
  1461.    way to gain information about keys calculated using the group.
  1462.  
  1463.    Only the description of the new group need be encrypted in this
  1464.    exchange.  The hash algorithm is implied by the OAKLEY session named
  1465.    by the group.  The encryption is the authentication encryption
  1466.    function of the OAKLEY session.
  1467.  
  1468.    The descriptor of the new group is encoded in the new group payload.
  1469.    The nonces are encoded in the Auth Payload.
  1470.  
  1471.    Data beyond the encryption boundary is encrypted using the transform
  1472.    named by the KEYID.
  1473.  
  1474.    The following message use the ISAKMP Key Exchange Identifier OAKLEY
  1475.    New Group.
  1476.  
  1477.    To define a new modular exponentiation group:
  1478.     Initiator                                        Responder
  1479.     ---------                                       ----------
  1480.      ->   KEYID,                                        ->
  1481.           INEWGRP,
  1482.  
  1483.  
  1484.  
  1485. H. K. Orman                                                    [Page 24]
  1486.  
  1487. INTERNET DRAFT                                                  May 1996
  1488.  
  1489.  
  1490.           Desc(New Group), Na
  1491.           prf(sKEYID, Desc(New Group) | Na)
  1492.  
  1493.      <-   KEYID,
  1494.           INEWGRPRS,
  1495.           Na, Nb
  1496.           prf(sKEYID, Na | Nb | Desc(New Group))       <-
  1497.  
  1498.       ->  KEYID,
  1499.           INEWGRPACK
  1500.           prf(sKEYID, Nb | Na | Desc(New Group))        ->
  1501.  
  1502.    These messages are encrypted at the encryption boundary using the key
  1503.    indicated.  The hash value is placed in the "digital signature" field
  1504.    (see Appendix C).
  1505.  
  1506.  
  1507.       New GRP identifier = Na | Nb (the initiator and responder must use
  1508.       nonces that are distinct from any used for current GRPID's.
  1509.  
  1510.       Desc(G) is the encoding of the descriptor for the group descriptor
  1511.       (see Appendix A for the format of a group descriptor)
  1512.  
  1513.    The two parties must store the mapping between the new group
  1514.    identifier GRP and the group descriptor Desc(New Group).  They must
  1515.    also note the identities used for the KEYID and copy these to the
  1516.    state for the new group.
  1517.  
  1518.    Note that one could have the same group descriptor associated with
  1519.    several KEYID's.   Pre-calculation of g^x values may be done based
  1520.    only on the group descriptor, not the private group name.
  1521.  
  1522. 2.8.2 Deriving a Key Using a Private Group
  1523.  
  1524.    Once a private group has been established, its group id can be used
  1525.    in the key exchange messages in the GRP position.  No changes to the
  1526.    protocol are required.
  1527.  
  1528.  
  1529. 2.9 Quick Mode: New Keys From Old,
  1530.  
  1531.    When an authenticated KEYID and associated keying material sKEYID
  1532.    already exist, it is easy to derive additional KEYID's and keys
  1533.    sharing similar attributes (GRP, EHA, etc.)  using only hashing
  1534.    functions.  The KEYID might be one that was derived in Main Mode, for
  1535.    example.
  1536.  
  1537.    On the other hand, the authenticated key may be a manually
  1538.    distributed key, one that is shared by the initiator and responder
  1539.    via some means external to OAKLEY.  If the distribution method has
  1540.    formed the KEYID using appropriately unique values for the two halves
  1541.    (CKY-I and CKY-R), then this method is applicable.
  1542.  
  1543.    In the following, the Key Exchange Identifier is OAKLEY Quick Mode.
  1544.  
  1545.  
  1546.  
  1547. H. K. Orman                                                    [Page 25]
  1548.  
  1549. INTERNET DRAFT                                                  May 1996
  1550.  
  1551.  
  1552.    The nonces are carried in the Authentication Payload, and the prf
  1553.    value is carried in the Authentication Payload; the Authentication
  1554.    Authority is "None" and the type is "Pre-Shared".
  1555.  
  1556.    The protocol is:
  1557.  
  1558.      Initiator                                           Responder
  1559.      ---------                                           ---------
  1560.      -> KEYID, INEWKRQ, Ni, prf(sKEYID, Ni)                ->
  1561.     <-  KEYID, INEWKRS, Nr, prf(sKEYID, 1 | Nr | Ni)      <-
  1562.      -> KEYID, INEWKRP, 0, prf(sKEYID,  0 | Ni | Nr)       ->
  1563.  
  1564.    The New KEYID, NKEYID, is Ni | Nr
  1565.  
  1566.    sNKEYID = prf(sKEYID, Ni | Nr )
  1567.  
  1568.  
  1569.    The identities and EHA values associated with NKEYID are the same as
  1570.    those associated with KEYID.
  1571.  
  1572.    Each party must validate the hash values before using the new key for
  1573.    any purpose.
  1574.  
  1575.  
  1576. 2.10 Defining and Using Pre-Distributed Keys
  1577.  
  1578.  
  1579.    If a key and an associated key identifier and state information have
  1580.    been distributed manually, then the key can be used for any OAKLEY
  1581.    purpose.  The key must be associated with the usual state
  1582.    information: ID's and EHA algorithms.
  1583.  
  1584.    Local policy dictates when a manual key can be included in the OAKLEY
  1585.    database.  For example, only privileged users would be permitted to
  1586.    introduce keys associated with privileged ID's, an unprivileged user
  1587.    could only introduce keys associated with her own ID.
  1588.  
  1589. 2.11 Distribution of an External Key
  1590.    Once an OAKLEY session key and ancillary algorithms are established,
  1591.    the keying material and the "H" algorithm can be used to distribute
  1592.    an externally generated key and to assign a KEYID to it.
  1593.  
  1594.    In the following, KEYID represents an existing, authenticated OAKLEY
  1595.    session key, and sNEWKEYID represents the externally generated keying
  1596.    material.
  1597.  
  1598.    In the following, the Key Exchange Identifier is OAKLEY External
  1599.    Mode.  The Key Exchange Payload contains the new key, which is
  1600.    protected
  1601.  
  1602.  
  1603.      Initiator                                                     Responder
  1604.      ---------                                                     ---------
  1605.      -> KEYID, IEXTKEY, Ni, prf(sKEYID, Ni)                               ->
  1606.  
  1607.  
  1608.  
  1609. H. K. Orman                                                    [Page 26]
  1610.  
  1611. INTERNET DRAFT                                                  May 1996
  1612.  
  1613.  
  1614.     <-  KEYID, IEXTKEY, Nr, prf(sKEYID, 1 | Nr | Ni)                     <-
  1615.      -> KEYID, IEXTKEY, Kir xor sNEWKEYID*, prf(Kir, sNEWKEYID | Ni | Nr) ->
  1616.  
  1617.    Kir = prf(sKEYID, Ni | Nr)
  1618.  
  1619.    * this field is carried in the Key Exchange Payload.
  1620.  
  1621.  
  1622.    Each party must validate the hash values using the "H" function in
  1623.    the KEYID state before changing any key state information.
  1624.  
  1625.    The new key is recovered by the Responder by calculating the xor of
  1626.    the field in the Authentication Payload with the Kir value.
  1627.  
  1628.    The new key identifier, naming the keying material sNEWKEYID, is
  1629.    prf(sKEYID, 1 | Ni | Nr).
  1630.  
  1631.    Note that this exchange does not require encryption.  Hugo Krawcyzk
  1632.    suggested the method and its advantage.
  1633.  
  1634.  
  1635. 2.11.1 Cryptographic Strength Considerations
  1636.  
  1637.    The strength of the key used to distribute the external key must be
  1638.    at least equal to the strength of the external key.  Generally, this
  1639.    means that the length of the sKEYID material must be greater than or
  1640.    equal to the length of the sNEWKEYID material.
  1641.  
  1642.    The derivation of the external key, its strength or intended use are
  1643.    not addressed by this protocol; the parties using the key must have
  1644.    some other method for determining these properties.
  1645.  
  1646.    As of early 1996, it appears that for 90 bits of cryptographic
  1647.    strength, one should use a modular exponentiation group modulus of
  1648.    2000 bits.  For 128 bits of strength, a 3000 bit modulus is required.
  1649.  
  1650.  
  1651.  
  1652.  
  1653.  
  1654.  
  1655.  
  1656.  
  1657.  
  1658.  
  1659.  
  1660.  
  1661.  
  1662.  
  1663.  
  1664.  
  1665.  
  1666.  
  1667.  
  1668.  
  1669.  
  1670.  
  1671. H. K. Orman                                                    [Page 27]
  1672.  
  1673. INTERNET DRAFT                                                  May 1996
  1674.  
  1675.  
  1676. 3. Specifying and Deriving Security Associations
  1677.  
  1678.    When a security association is defined, only the KEYID need be given.
  1679.    The responder should be able to look up the state associated with the
  1680.    KEYID value and find the appropriate keying material, sKEYID.
  1681.  
  1682.    The OAKLEY protocol does not define security association encodings or
  1683.    message formats.  These can be defined through a protocol such as
  1684.    ISAKMP.  Compatibility with ISAKMP is a goal of the OAKLEY design,
  1685.    and coordination of the message formats and use of identifiers is an
  1686.    ongoing activity at this time.
  1687.  
  1688.  
  1689.  
  1690.  
  1691.  
  1692.  
  1693.  
  1694.  
  1695.  
  1696.  
  1697.  
  1698.  
  1699.  
  1700.  
  1701.  
  1702.  
  1703.  
  1704.  
  1705.  
  1706.  
  1707.  
  1708.  
  1709.  
  1710.  
  1711.  
  1712.  
  1713.  
  1714.  
  1715.  
  1716.  
  1717.  
  1718.  
  1719.  
  1720.  
  1721.  
  1722.  
  1723.  
  1724.  
  1725.  
  1726.  
  1727.  
  1728.  
  1729.  
  1730.  
  1731.  
  1732.  
  1733. H. K. Orman                                                    [Page 28]
  1734.  
  1735. INTERNET DRAFT                                                  May 1996
  1736.  
  1737.  
  1738. 4. ISAKMP Compatibility
  1739.  
  1740.    OAKLEY uses ISAKMP header and payload formats, as described in the
  1741.    text and in Appendix B.  There are particular noteworthy extensions
  1742.    beyond the version 4 draft.
  1743.  
  1744. 4.1 Authentication with Existing Keys
  1745.  
  1746.    In the case that two parties do not have suitable public key
  1747.    mechanisms in place for authenticating each other, they can use keys
  1748.    that were distributed manually.  After establishment of these keys
  1749.    and their associated state in OAKLEY, they can be used for
  1750.    authentication modes that depend on signatures, e.g. Aggressive Mode.
  1751.  
  1752.    When an existing key is to appear in an offer list, it should be
  1753.    indicated with an Authentication Algorithm of ISAKMP_EXISTING.  This
  1754.    value will be assigned in the ISAKMP RFC.
  1755.  
  1756.    When the authentication method is ISAKMP_EXISTING, the authentication
  1757.    authority will have the value ISAKMP_AUTH_EXISTING; the value for
  1758.    this field must not conflict with any authentication authority
  1759.    registered with IANA and will be defined in the ISAKMP RFC.
  1760.  
  1761.    The authentication payload will have two parts:
  1762.  
  1763.        the KEYID for the pre-existing key
  1764.  
  1765.        the identifier for the party to be authenticated by the pre-
  1766.       existing key.
  1767.  
  1768.    The pseudo-random function "H" in the state information for that
  1769.    KEYID will be the signature algorithm, and it will use the keying
  1770.    material for that key (sKEYID) when generating or checking the
  1771.    validity of message data.
  1772.  
  1773.    E.g. if the existing key has an KEYID denoted by KID and 128 bits of
  1774.    keying material denoted by sKID and "H" algorithm a transform named
  1775.    HMAC, then to generate a "signature" for a data block, the output of
  1776.    HMAC(sKID, data)
  1777.    will be the corresponding signature payload.
  1778.  
  1779.    The KEYID state will have the identities of the local and remote
  1780.    parties for which the KEYID was assigned; it is up to the local
  1781.    policy implementation to decide when it is appropriate to use such a
  1782.    key for authenticating other parties.  For example, a key distributed
  1783.    for use between two Internet hosts A and B may be suitable for
  1784.    authenticating all identities of the form "alice@A" and "bob@B".
  1785.  
  1786.    4.2 Third Party Authentication
  1787.  
  1788.    A local security policy might restrict key negotiation to trusted
  1789.    parties.  For example, two OAKLEY daemons running with equal
  1790.    sensitivity labels on two machines might wish to be the sole arbiters
  1791.    of key exchanges between users with that same sensitivity label.  In
  1792.  
  1793.  
  1794.  
  1795. H. K. Orman                                                    [Page 29]
  1796.  
  1797. INTERNET DRAFT                                                  May 1996
  1798.  
  1799.  
  1800.    this case, some way of authenticating the provenance of key exchange
  1801.    requests is needed.  I.e., the identities of the two daemons should
  1802.    be bound to a key, and that key will be used to form a "signature"
  1803.    for the key exchange messages.
  1804.  
  1805.    The Signature Payload, in Appendix B, is for this purpose.  This
  1806.    payload names a KEYID that is in existence before the start of the
  1807.    current exchange.  The "H" transform for that KEYID is used to
  1808.    calculate an integrity/authentication value for all payloads
  1809.    preceding the signature.
  1810.  
  1811.    Local policy can dictate which KEYID's are appropriate for signing
  1812.    further exchanges.
  1813.  
  1814.    4.3 New Group Mode
  1815.  
  1816.    OAKLEY uses a new KEI for the exchange that defines a new group.
  1817.  
  1818.  
  1819. 5. Security Implementation Notes
  1820.  
  1821.    Timing attacks that are capable of recovering the exponent value used
  1822.    in Diffie-Hellman calculations have been described by Paul Kocher
  1823.    [Kocher].  In order to nullify the attack, implementors must take
  1824.    pains to obscure the sequence of operations involved in carrying out
  1825.    modular exponentiations.
  1826.  
  1827.    A "blinding factor" can accomplish this goal.  A group element, r, is
  1828.    chosen at random.  When an exponent x is chosen, the value r^(-x) is
  1829.    also calculated.  Then, when calculating (g^y)^x, the implementation
  1830.    will calculate this sequence:
  1831.            A = (rg^y)
  1832.            B = A^x = (rg^y)^x = (r^x)(g^(xy))
  1833.            C = B*r^(-x) = (r^x)(r^-(x))(g^(xy)) = g^(xy)
  1834.  
  1835.    The blinding factor is only necessary if the exponent x is used more
  1836.    than 100 times (estimate by Richard Schroeppel).
  1837.  
  1838.  
  1839. 6. OAKLEY Parsing and State Machine
  1840.  
  1841.  
  1842.    There are many pathways through OAKLEY, but they follow a left-to-
  1843.    right parsing patterns of the message fields as defined in section
  1844.    2.1.
  1845.  
  1846.    The initiator decides on an initial message in the following order:
  1847.       1. Offer a cookie.  This is not necessary but it helps with
  1848.       aggressive exchanges.
  1849.  
  1850.       2. Pick a group.  The choices are the well-known groups or any
  1851.       private groups that may have been negotiated.  The very first
  1852.       exchange between two Oakley daemons with no common state must
  1853.       involve a well-known group (0, meaning no group, is a well-known
  1854.  
  1855.  
  1856.  
  1857. H. K. Orman                                                    [Page 30]
  1858.  
  1859. INTERNET DRAFT                                                  May 1996
  1860.  
  1861.  
  1862.       group).  Note that the group identifier, not the group descriptor,
  1863.       is used in the message.
  1864.  
  1865.       If a non-null group will be used, it must be included with the
  1866.       first message specifying EHAO.  It need not be specified until
  1867.       then.
  1868.  
  1869.       3. If PFS will be used, pick an exponent x and present g^x.
  1870.  
  1871.       4. Offer Encryption, Hash, and Authentication lists.
  1872.  
  1873.       5. Use PFS for hiding the identities
  1874.  
  1875.       If identity hiding is not used, then the initiator has this
  1876.       option:
  1877.  
  1878.       6. Name the identities and include authentication information
  1879.  
  1880.    The information in the authentication section depends on the first
  1881.    authentication offer.  In this aggressive exchange, the Initiator
  1882.    hopes that the Responder will accept all the offered information and
  1883.    the first authentication method.  The authentication method
  1884.    determines the authentication payload as follows:
  1885.  
  1886.    1. Signing method.  The signature will be applied to all the offered
  1887.    information.
  1888.  
  1889.    2. A public key encryption method.  The algorithm will be used to
  1890.    encrypt a nonce in the public key of the requested Responder identity.
  1891.    There are two cases possible, depending on whether or not identity
  1892.    hiding is used:
  1893.  
  1894.       a. No identity hiding.  The ID's will appear as plaintext.
  1895.       b. Identity hiding.  A well-known ID, call it R', will appear as
  1896.          plaintext in the authentication payload.  It will be followed
  1897.          by two ID's and a nonce; these will be encrypted using the
  1898.          public key for R'.
  1899.  
  1900.    3. A pre-existing key method.  The pre-existing key will be used to
  1901.    encrypt a nonce.  If identity hiding is used, the ID's will be
  1902.    encrypted in place in the payload, using the "E" algorithm associated
  1903.    with the pre-existing key.
  1904.  
  1905.    The Responder can accept all, part or none of the initial message.
  1906.  
  1907.    The Responder accepts as many of the fields as he wishes, using the
  1908.    same decision order as the initiator.  At any step he can stop,
  1909.    implicitly rejecting further fields (which will have null values in
  1910.    his response message).  The minimum response is a cookie and the GRP.
  1911.  
  1912.    1. Accept cookie.  The Responder may elect to record no state
  1913.    information until the Initiator successfully replies with a cookie
  1914.    chosen by the responder.  If so, the Responder replies with a cookie,
  1915.    the GRP, and no other information.
  1916.  
  1917.  
  1918.  
  1919. H. K. Orman                                                    [Page 31]
  1920.  
  1921. INTERNET DRAFT                                                  May 1996
  1922.  
  1923.  
  1924.    2. Accept GRP.  If the group is not acceptable, the Responder will
  1925.    not reply.  The Responder may send an error message indicating the
  1926.    the group is not acceptable (modulus too small, unknown identifier,
  1927.    etc.) Note that "no group" has two meanings during the protocol: it
  1928.    may mean the group is not yet specified, or it may mean that no group
  1929.    will be used (and thus PFS is not possible).
  1930.  
  1931.    3. Accept the g^x value.  The Responder indicates his acceptance of
  1932.    the g^x value by including his own g^y value in his reply.  He can
  1933.    postpone this by ignoring g^x and putting a zero length g^y value in
  1934.    his reply.
  1935.  
  1936.    4. Accept one element from each of the EHA lists.  The acceptance is
  1937.    indicated by a non-zero proposal.
  1938.  
  1939.    5. If PFS for identity hiding is requested, then no further data will
  1940.    follow.
  1941.  
  1942.    6. If the authentication payload is present, and if the first item in
  1943.    the offered authentication class is acceptable, then the Responder
  1944.    must validate/decrypt the information in the authentication payload
  1945.    and signature payload, if present. The Responder should choose a
  1946.    nonce and reply using the same authentication/hash algorithm as the
  1947.    Initiator used.
  1948.  
  1949.    The Initiator notes which information the Responder has accepted,
  1950.    validates/decrypts any signed, hashed, or encrypted fields, and if
  1951.    the data is acceptable, replies in accordance to the EHA methods
  1952.    selected by the Responder.  The Initiator replies are distinguished
  1953.    from his initial message by the presence of the non-zero value for
  1954.    the Responder cookie.
  1955.  
  1956.  
  1957.  
  1958.  
  1959.  
  1960.  
  1961.  
  1962.  
  1963.  
  1964.  
  1965.  
  1966.  
  1967.  
  1968.  
  1969.  
  1970.  
  1971.  
  1972.  
  1973.  
  1974.  
  1975.  
  1976.  
  1977.  
  1978.  
  1979.  
  1980.  
  1981. H. K. Orman                                                    [Page 32]
  1982.  
  1983. INTERNET DRAFT                                                  May 1996
  1984.  
  1985.  
  1986. APPENDIX A Group Descriptors
  1987.  
  1988.  
  1989.  
  1990.    Three distinct group representations can be used with OAKLEY.  Each
  1991.    group is defined by its group operation and the kind of underlying
  1992.    field used to represent group elements.  The three types are modular
  1993.    exponentiation groups (named MODP herein), elliptic curve groups
  1994.    over the field GF[2^N] (named EC2N herein), and elliptic curve groups
  1995.    over GF[P] (named ECP herein) For each representation, many distinct
  1996.    realizations are possible, depending on parameter selection.
  1997.  
  1998.    With a few exceptions, all the parameters are transmitted as if they
  1999.    were non-negative multi-precision integers, using the format defined
  2000.    in this appendix (note, this is distinct from the encoding in Appendix
  2001.    D).  Every multi-precision integer has a prefixed length field, even
  2002.    where this information is redundant.
  2003.  
  2004.    For the group type EC2N, the parameters are more properly thought of
  2005.    as very long bit fields, but they are represented as multi-precision
  2006.    integers, (with length fields, and right-justified).  This is the
  2007.    natural encoding.
  2008.  
  2009.    MODP means the classical modular exponentiation group, where the
  2010.    operation is to calculate G^X (mod P).  The group is defined by
  2011.    the numeric parameters P and G.  P must be a prime.  G is often 2,
  2012.    but may be a larger number.  2 <= G <= P-2.
  2013.  
  2014.    ECP is an elliptic curve group, modulo a prime number P.
  2015.    The defining equation for this kind of group is
  2016.     Y^2 = X^3 + AX + B
  2017.    The group operation is taking a multiple of an elliptic-curve point.
  2018.    The group is defined by 5 numeric parameters:  The prime P, two curve
  2019.    parameters A and B, and a generator (X,Y).  A,B,X,Y are all
  2020.    interpreted mod P, and must be (non-negative) integers less than P.
  2021.    They must satisfy the defining equation, modulo P.
  2022.  
  2023.    EC2N is an elliptic curve group, over the finite field F[2^N].  The
  2024.    defining equation for this kind of group is
  2025.     Y^2 + XY = X^3 + AX^2 + B
  2026.    (This equation differs slightly from the mod P case:  it has an XY
  2027.    term, and an AX^2 term instead of an AX term.)
  2028.  
  2029.    We must specify the field representation, and then the elliptic
  2030.    curve.  The field is specified by giving an irreducible polynomial
  2031.    (mod 2) of degree N.  This polynomial is represented as an integer of
  2032.    size between 2^N and 2^(N+1), as if the defining polynomial were
  2033.    evaluated at the value U=2.
  2034.  
  2035.    For example, the field defined by the polynomial
  2036.    U^155 + U^62 + 1
  2037.    is represented by the integer 2^155 + 2^62 + 1.  The group is defined
  2038.    by 4 more parameters, A,B,X,Y.  These parameters are elements of the
  2039.    field F[2^N], and can be though of as polynomials of degree < N, with
  2040.  
  2041.  
  2042.  
  2043. H. K. Orman                                                    [Page 33]
  2044.  
  2045. INTERNET DRAFT                                                  May 1996
  2046.  
  2047.  
  2048.    (mod 2) coefficients.  They fit in N-bit fields, and are represented
  2049.    as integers < 2^N, as if the polynomial were evaluated at U=2.  For
  2050.    example, the field element U^2 + 1 would be represented by the
  2051.    integer 2^2+1, which is 5.  The two parameters A and B define the
  2052.    curve.  A is frequently 0.  B must not be 0.  The parameters X and Y
  2053.    select a point on the curve.  The parameters A,B,X,Y must satisfy the
  2054.    defining equation, modulo the defining polynomial, and mod 2.
  2055.  
  2056.    Group descriptor formats:
  2057.  
  2058.     Type of group: A two-byte field,
  2059.            assigned values for the types "MODP", "ECP", "EC2N"
  2060.            will be defined (see ISAKMP-04).
  2061.    Size of a field element, in bits.  This is either Ceiling(log2 P)
  2062.       or the degree of the irreducible polynomial: a 32-bit integer.
  2063.    The prime P or the irreducible field polynomial: a multi-precision integer.
  2064.    The generator: 1 or 2 values, multi-precision integers.
  2065.    EC only:  The parameters of the curve:  2 values, multi-precision integers.
  2066.  
  2067.    The following parameters are Optional (each of these may appear
  2068.    independently):
  2069.      a value of 0 may be used as a place-holder to represent an unspecified
  2070.      parameter; any number of the parameters may be sent, from 0 to 3.
  2071.  
  2072.    The largest prime factor: the encoded value that is the LPF of the group size,
  2073.      a multi-precision integer.
  2074.  
  2075.    EC only:  The order of the group: multi-precision integer.
  2076.      (The group size for MODP is always P-1.)
  2077.  
  2078.    Strength of group: 32-bit integer.
  2079.      The strength of the group is approximately the number of key-bits protected.
  2080.      It is determined by the log2 of the effort to attack the group.
  2081.      It may change as we learn more about cryptography.
  2082.  
  2083. This is a generic example for a "classic" modular exponentiation group:
  2084.       Group type: "MODP"
  2085.       Size of a field element in bits:  Log2 (P) rounded *up*.  A 32bit integer.
  2086.       Defining prime P: a multi-precision integer.
  2087.       Generator G: a multi-precision integer.  2 <= G <= P-2.
  2088.       <optional>
  2089.       Largest prime factor of P-1: the multi-precision integer Q
  2090.       Strength of group: a 32-bit integer.  We will specify a formula
  2091.         for calculating this number (TBD).
  2092.  
  2093.    This is a generic example for elliptic curve group, mod P:
  2094.       Group type: "ECP"
  2095.       Size of a field element in bits:  Log2 (P) rounded *up*,
  2096.           a 32 bit integer.
  2097.       Defining prime P: a multi-precision integer.
  2098.       Generator (X,Y): 2 multi-precision integers, each < P.
  2099.       Parameters of the curve A,B: 2 multi-precision integers, each < P.
  2100.       <optional>
  2101.       Largest prime factor of the group order: a multi-precision integer.
  2102.  
  2103.  
  2104.  
  2105. H. K. Orman                                                    [Page 34]
  2106.  
  2107. INTERNET DRAFT                                                  May 1996
  2108.  
  2109.  
  2110.       Order of the group: a multi-precision integer.
  2111.       Strength of group:  a 32-bit integer.  Formula TBD.
  2112.  
  2113.    This is a specific example for elliptic curve group:
  2114.       Group type: "EC2N"
  2115.       Degree of the irreducible polynomial: 155
  2116.       Irreducible polynomial:  U^155 + U^62 + 1, represented as the
  2117.         multi-precision integer 2^155 + 2^62 + 1.
  2118.       Generator (X,Y) : represented as 2 multi-precision integers, each < 2^155.
  2119.         For our present curve, these are (decimal) 123 and 456.  Each is represented
  2120.         as a multi-precision integer.
  2121.       Parameters of the curve A,B: represented as 2 multi-precision
  2122.         integers,  each < 2^155.
  2123.         For our present curve these are 0 and (decimal) 471951, represented as two
  2124.         multi-precision integers.
  2125.  
  2126.       <optional>
  2127.       Largest prime factor of the group order:
  2128.  
  2129.        3805993847215893016155463826195386266397436443,
  2130.  
  2131.       represented as a multi-precision integer.
  2132.       The order of the group:
  2133.  
  2134.         45671926166590716193865565914344635196769237316
  2135.  
  2136.       represented as a multi-precision integer.
  2137.  
  2138.       Strength of group: 76, represented as a 32-bit integer.
  2139.  
  2140.    The variable precision integer encoding for group descriptor fields
  2141.    is the following.  This is a slight variation on the format defined
  2142.    in Appendix D in that a fixed 16-bit value is used first, and the
  2143.    length is limited to 16 bits.  However, the interpretation is
  2144.    otherwise identical.
  2145.  
  2146.                              1                   2                   3
  2147.          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
  2148.         +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2149.         !   Fixed value (TBD)           !             Length            !
  2150.         +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2151.         .                                                               .
  2152.         .                  Integer                                      .
  2153.         .                                                               .
  2154.         +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2155.  
  2156.  
  2157.    The format of a group descriptor is:
  2158.                              1                   2                   3
  2159.          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
  2160.         +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2161.         !1!1!     Group Description     !             MODP              !
  2162.         +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2163.         !1!0!        Field Size         !            Length             !
  2164.  
  2165.  
  2166.  
  2167. H. K. Orman                                                    [Page 35]
  2168.  
  2169. INTERNET DRAFT                                                  May 1996
  2170.  
  2171.  
  2172.         +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2173.         !                              MPI                              !
  2174.         +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2175.         !1!0!          Prime            !            Length             !
  2176.         +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2177.         !                              MPI                              !
  2178.         +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2179.         !1!0!       Generator1          !            Length             !
  2180.         +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2181.         !                              MPI                              !
  2182.         +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2183.         !1!0!       Generator2          !            Length             !
  2184.         +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2185.         !                              MPI                              !
  2186.         +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2187.         !1!0!         Curve-p1          !            Length             !
  2188.         +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2189.         !                              MPI                              !
  2190.         +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2191.         !1!0!         Curve-p2          !            Length             !
  2192.         +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2193.         !                              MPI                              !
  2194.         +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2195.         !1!0!   Largest Prime Factor    !            Length             !
  2196.         +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2197.         !                              MPI                              !
  2198.         +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2199.         !1!0!      Order of Group       !            Length             !
  2200.         +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2201.         !                              MPI                              !
  2202.         +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2203.         !0!0!    Strength of Group      !            Length             !
  2204.         +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2205.         !                              MPI                              !
  2206.         +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2207.  
  2208.  
  2209. APPENDIX B  Message formats
  2210.  
  2211.  
  2212.    1. The ISAKMP Message Types and Header
  2213.  
  2214.    OAKLEY uses the ISAKMP Message Types ISA_KE&AUTH_REQ and
  2215.    ISA_KE&AUTH_REP for all key exchanges.
  2216.  
  2217.  
  2218.                                 1                   2                   3
  2219.             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
  2220.            +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2221.            !                                                               !
  2222.            ~                       Initiator-Cookie                        ~
  2223.         /  !                                                               !
  2224.    KEYID   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2225.        \  !                                                               !
  2226.  
  2227.  
  2228.  
  2229. H. K. Orman                                                    [Page 36]
  2230.  
  2231. INTERNET DRAFT                                                  May 1996
  2232.  
  2233.  
  2234.            ~                       Responder-Cookie                        ~
  2235.            !                                                               !
  2236.            +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2237.            ! Message Type  ! Exch  ! Vers  !          Length               !
  2238.            +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2239.            !                 (unused)                                      !
  2240.            +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2241.            !                 (unused)                                      !
  2242.       eeee +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ eeee
  2243.            !                 ...                                           !
  2244.  
  2245.  
  2246.    "eeee" represents the encryption boundary for messages requiring privacy.
  2247.    The message after this point is subject to the encryption transform implied
  2248.    by the KEYID.
  2249.  
  2250.  
  2251.    The Group ID field is used for the group identifier for the key
  2252.    exchange methods described in this document; in other ISAKMP messages
  2253.    the field is used for a SPI.  OAKLEY does not use the two SPI fields
  2254.    in an ISAKMP header.
  2255.  
  2256.    The second SPI field is not used in OAKLEY.  It must contain the
  2257.    value zero.
  2258.  
  2259.    The OAKLEY proposal format contains the SA attributes that are
  2260.    exchanged in the ISA_INIT messages in order to establish the required
  2261.    security attributes for the key and authentication exchange.
  2262.  
  2263.    2. OAKLEY Use of ISA_AUTH&KE packets.
  2264.  
  2265.  
  2266.  
  2267.                                 1                   2                   3
  2268.             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
  2269.            +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2270.            ~                        ISAKMP Header                          ~
  2271.            +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2272.            !                    Domain of Interpretation                   !
  2273.            +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2274.            ! Next Payload  !  Payload Len  !            RESERVED           !
  2275.            +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2276.            ~                                                               ~
  2277.            !                   Authentication Payload                      !
  2278.            ~                                                               ~
  2279.            +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2280.            ! Next Payload  !  Payload Len  !            RESERVED           !
  2281.            +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2282.            ~                                                               ~
  2283.            !                    Key Exchange Payload                       !
  2284.            ~                                                               ~
  2285.            +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2286.  
  2287.  
  2288.  
  2289.  
  2290.  
  2291. H. K. Orman                                                    [Page 37]
  2292.  
  2293. INTERNET DRAFT                                                  May 1996
  2294.  
  2295.  
  2296.                ISA_AUTH&KE_REQ and ISA_AUTH&KE_RESP Packet Format
  2297.  
  2298.  
  2299.    The encodings of the OAKLEY parameters into these fields are
  2300.    described in the next sections.
  2301.  
  2302.  
  2303.    3. The Key Exchange Payload
  2304.  
  2305.    The Key Exchange Payload carries values that are used to derive
  2306.    secret keying material.  Because OAKLEY uses both nonces and Diffie-
  2307.    Hellman exponentials for deriving keys, its use of the Key Exchange
  2308.    Payload is slightly different from the use described in ISAKMP; that
  2309.    document expects only one Key Exchange Payload per packet, but OAKLEY
  2310.    can have two, one for nonces, one for an exponential.
  2311.  
  2312.                                 1                   2                   3
  2313.             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
  2314.            +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2315.            ! Next Payload  !  Payload Len  !            RESERVED           !
  2316.            +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2317.            !                  KEI          !            Length             !
  2318.            +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2319.            ~                                                               ~
  2320.            !                       Key Exchange Data                       !
  2321.            ~                                                               ~
  2322.            +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2323.  
  2324.  
  2325.                               Key Exchange Payload Format
  2326.  
  2327.     o  KEI (2 octets) - Key Exchange Identifier
  2328.  
  2329.     o  Length (2 octets) - Length of payload in octets
  2330.  
  2331.     o  Key Exchange Data (variable) - Data required to
  2332.        create session key.
  2333.  
  2334.  
  2335.    OAKLEY uses four KEI values: OAKLEY Main Mode, OAKLEY Quick Mode,
  2336.    OAKLEY External Mode, OAKLEY New Group Mode.
  2337.  
  2338.    The value encoded in the Key Exchange Data field will be the Diffie-
  2339.    Hellman exponential (if it is used), encoded as variable precision
  2340.    integers as shown in Appendix D.  For Oakley External Mode, the field
  2341.    will contain the external key.
  2342.  
  2343.    3. The OAKLEY Authentication Payload
  2344.  
  2345.  
  2346.                                 1                   2                   3
  2347.             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
  2348.            +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2349.            ! Next Payload  !  Payload Len  !            RESERVED           !
  2350.  
  2351.  
  2352.  
  2353. H. K. Orman                                                    [Page 38]
  2354.  
  2355. INTERNET DRAFT                                                  May 1996
  2356.  
  2357.  
  2358.            +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2359.            !  Authentication Authority     !           Reserved            !
  2360.            +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2361.            !  Authentication Type          !            Length             !
  2362.            +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2363.            ~                                                               ~
  2364.            !                      Authentication Data                      !
  2365.            ~                                                               ~
  2366.            +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2367.  
  2368.  
  2369.                             Authentication Payload Format
  2370.  
  2371.    The Authentication Payload will be used to carry three pieces of
  2372.    essential information: the entity identifiers (ID's), the nonces, and
  2373.    the output of a function proving proving knowledge of a secret.
  2374.  
  2375.    The format of the ID's is described in the next section.  A payload
  2376.    will have two ID's, for the Initiator and Responder, in that order.
  2377.    If the length of an ID is zero, the ID is unspecified.
  2378.  
  2379.    If the low order bit of the RESERVED field is set, the payload will
  2380.    have three ID's; see section 2.4.2, An Aggressive Example With Hidden
  2381.    Identities.  Note that in this case, only the first ID will be in
  2382.    plaintext.  The two following ID's and the encrypted nonce (see next
  2383.    paragraph) will be encrypted in the public key of the first ID.
  2384.  
  2385.    The nonce will follow the ID's; if a nonce is encoded with zero
  2386.    length, it is considered to be not present.  If the low order bit of
  2387.    the RESERVED field is set, as in 2.4.2, then the nonce will be
  2388.    encrypted in the public key of the requested responder.
  2389.  
  2390.    The fourth part of the authentication payload will contain the result
  2391.    of applying the pseudorandom function or signature algorithm to the
  2392.    key exchange parameters, as described in the main text.  For example,
  2393.    the output might be the result of applying a keyed MD5 transform to
  2394.    the ID's, the cookies, the nonces, and the exponentials.
  2395.  
  2396.    The pseudorandom function output will encoded as a variable precision
  2397.    integer as described in Appendix D.
  2398.  
  2399.    The Authentication Authority and Authentication Type will be taken
  2400.    from the ISAKMP requirements:
  2401.  
  2402.    If the second-most low order bit is set, it means that the remainder
  2403.    of the message is encrypted a key derived from the Diffie-Hellman
  2404.    g^xy value (this is the IDP bit).
  2405.  
  2406.  
  2407.        o  Authentication Authority (2 octets) - This field identifies
  2408.       the party
  2409.           that generated the certificates used for authentication.
  2410.       Authorities
  2411.           must be assigned an identifier by the Internet Assigned
  2412.  
  2413.  
  2414.  
  2415. H. K. Orman                                                    [Page 39]
  2416.  
  2417. INTERNET DRAFT                                                  May 1996
  2418.  
  2419.  
  2420.       Numbers
  2421.           Authority (IANA). Before being assigned an identifier, an
  2422.       authority
  2423.           must publish an RFC defining the authority's domain.  [RFC-
  2424.       1422]
  2425.           describes the Internet Policy Registration Authority (IPRA)
  2426.       and the
  2427.           procedures for achieving this registration.
  2428.  
  2429.           If PGP certificates, based on the ``web of trust'', are
  2430.       carried in
  2431.           the authentication payload the Authentication Authority value
  2432.       is one
  2433.           (1).
  2434.  
  2435.           Example certificate authorities that would have to register
  2436.       for an
  2437.           identifier are:
  2438.  
  2439.  
  2440.           --  RSA Commercial Certificate Authority
  2441.               (http://www_csc.rsa.com/netsite)
  2442.  
  2443.           --  Stable Large E-mail Database (SLED)
  2444.       (http://www.four11.com)
  2445.  
  2446.           --  U.S. Postal Service.
  2447.  
  2448.  
  2449.        o  Authentication Type (2 octets) - This field indicates the
  2450.           authentication payload format.  This field is used by
  2451.       authentication
  2452.           authorities that support more than one certificate type.  The
  2453.           authentication types supported by an authentication authority
  2454.       must be
  2455.           defined in the RFC required for authentication authority
  2456.           registration.  Examples are:
  2457.  
  2458.  
  2459.           --  PKCS #7 certificates
  2460.  
  2461.           --  PGP certificates
  2462.  
  2463.           --  DNS Signed Keys
  2464.  
  2465.           --  Kerberos Tokens
  2466.  
  2467.           --  X.509 certificates
  2468.  
  2469.  
  2470.        o  Length (2 octets) - Length of the Authentication Data field in
  2471.           octets.
  2472.  
  2473.        o  Authentication Data (variable) - Actual authentication data.
  2474.  
  2475.  
  2476.  
  2477. H. K. Orman                                                    [Page 40]
  2478.  
  2479. INTERNET DRAFT                                                  May 1996
  2480.  
  2481.  
  2482.       The
  2483.           type of certificate is indicated by the Authentication Type
  2484.       field.
  2485.  
  2486.  
  2487.    4. The OAKLEY Proposal
  2488.  
  2489.                                 1                   2                   3
  2490.             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
  2491.            +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2492.            !    OAKLEY     !  Proposal #   !  Proposal Len !    RESERVED   !
  2493.            +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2494.            !                           EHA  Format                         !
  2495.            +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2496.            !                          Group Format                         !
  2497.            +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2498.  
  2499.  
  2500.                                OAKLEY Proposal Format
  2501.  
  2502.  
  2503.                                 1                   2                   3
  2504.             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
  2505.            +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2506.            !0!1!     RESERVED              !            GRP                !
  2507.            +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2508.            !                            GRPID                              !
  2509.            +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2510.            !0!1!     GRP                   !            PRIV               !
  2511.            +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2512.            !0!1!   Encryption Algorithm    !             DES               !
  2513.            +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2514.            !0!1!       Hash Algorithm      !             MD5               !
  2515.            +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2516.            !1!1!    Authentication Alg     !             RSA               !
  2517.            +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2518.            !0!1!    Authentication Mode    !            KEYED              !
  2519.            +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2520.  
  2521.  
  2522.                            OAKLEY Proposal - EHA Format
  2523.  
  2524.  
  2525.    5. Identity (ID) formats
  2526.                                 1                   2                   3
  2527.             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
  2528.            +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2529.            !  Identification Type          !            Length             !
  2530.            +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2531.            ~                                                               ~
  2532.            !                      Identification Data                      !
  2533.            ~                                                               ~
  2534.            +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2535.  
  2536.  
  2537.  
  2538.  
  2539. H. K. Orman                                                    [Page 41]
  2540.  
  2541. INTERNET DRAFT                                                  May 1996
  2542.  
  2543.  
  2544.    There are three identification types: IP_ADDR (value 1), FQDN (value
  2545.    2), USER_FQDN (value 3).
  2546.  
  2547.    The length of the IP address will be 4 bytes for the IPv4 Domain of
  2548.    Interpretation, 8 bytes for the IPv6 DOI.
  2549.  
  2550.    FQDN is a fully qualified domain name, as used by the DNS protocol.
  2551.    Its form is an ASCII character string.  The domain components are
  2552.    separated by "." characters, as in DNS.
  2553.  
  2554.    USER_FQDN is a user id followed by a "." character, followed by a
  2555.    fully qualified domain name, as used by the DNS protocol.  Its form
  2556.    is an ASCII character string.
  2557.  
  2558.    6. OAKLEY's use ISA_INIT_REQ and ISA_INIT_RESP Packets
  2559.  
  2560.    OAKLEY does not require the use the ISAKMP ISA_INIT_REQ and
  2561.    ISA_INIT_RESP packets.  Their optional use may include the
  2562.    establishment of ISAKMP-to-ISAKMP daemon KEYID's for later use as
  2563.    signatures over ISA_KE&AUTH packets, providing an extra level of
  2564.    authenticity checking.  In this case, the Situation field will have
  2565.    the IP addresses of the two principals; the length of the IP address
  2566.    will depend on the Domain of Interpretation.
  2567.  
  2568.  
  2569.                                   1                   2                   3
  2570.             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
  2571.            +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2572.            ~                         ISAKMP Header                         ~
  2573.            +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2574.            ! Next Payload  !  Payload Len  !            RESERVED           !
  2575.            +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2576.            !                    Domain of Interpretation                   !
  2577.            +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2578.            !                                                               !
  2579.            ~                          Situation                            ~
  2580.            !                                                               !
  2581.            +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2582.            !                                                               !
  2583.            ~                          Proposal                             ~
  2584.            !                                                               !
  2585.            +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2586.  
  2587.  
  2588.                           ISA_INIT_REQ and ISA_INIT_RESP Packet Format
  2589.  
  2590.    7. Digital Signature/PRF Payload
  2591.  
  2592.    The Digital Signature/PRF payload will carry a value for
  2593.    authenticating the entire message.  When it occurs, it will be the
  2594.    last payload.
  2595.  
  2596.                                 1                   2                   3
  2597.             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
  2598.  
  2599.  
  2600.  
  2601. H. K. Orman                                                    [Page 42]
  2602.  
  2603. INTERNET DRAFT                                                  May 1996
  2604.  
  2605.  
  2606.            +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2607.            !                         KEYID                                 !
  2608.            +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2609.            ~                                                               ~
  2610.            !                   Signature/hash data                         !
  2611.            ~                                                               ~
  2612.            +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2613.  
  2614.    The output of the signature or prf function will be encoded as a
  2615.    variable precision integer as described in Appendix D.  The KEYID
  2616.    will indicate KEYID that names keying material and the Hash or
  2617.    Signature function.
  2618.  
  2619.    8. The Credential Payload
  2620.  
  2621.    Useful certificates with public key information can be attached to
  2622.    OAKLEY messages using Credential Payloads.  The format of the payload
  2623.    depends on the Authentication Type, and separate RFC's define the
  2624.    formats.  The encoding of the Authority and Type are the same as for
  2625.    the Authentication Payload.
  2626.  
  2627.  
  2628.                                 1                   2                   3
  2629.             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
  2630.            +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2631.            ! Next Payload  !  Payload Len  !            RESERVED           !
  2632.            +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2633.            !  Authentication Authority     !           Reserved            !
  2634.            +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2635.            !  Authentication Type          !            Length             !
  2636.            +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2637.            ~                                                               ~
  2638.            !                      Credential Data                          !
  2639.            ~                                                               ~
  2640.            +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2641.  
  2642.                             Credential Payload Format
  2643.  
  2644.  
  2645.  
  2646.  
  2647.  
  2648.  
  2649.  
  2650.  
  2651.  
  2652.  
  2653.  
  2654.  
  2655.  
  2656.  
  2657.  
  2658.  
  2659.  
  2660.  
  2661.  
  2662.  
  2663. H. K. Orman                                                    [Page 43]
  2664.  
  2665. INTERNET DRAFT                                                  May 1996
  2666.  
  2667.  
  2668. APPENDIX D Encoding a variable precision integer.
  2669.  
  2670.  
  2671.    Variable precision integers will be encoded as a 32-bit length field
  2672.    followed by one or more 32-bit quantities containing the
  2673.    representation of the integer, aligned with the most significant bit
  2674.    in the first 32-bit item.
  2675.  
  2676.                                 1                   2                   3
  2677.             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
  2678.            +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2679.            !    length                                                     !
  2680.            +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2681.            !    first value word (most significant bits)                   !
  2682.            +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2683.            !                                                               !
  2684.            ~     additional value words                                    ~
  2685.            !                                                               !
  2686.            +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2687.  
  2688.  
  2689.    An example of such an encoding is given below, for a number with 51
  2690.    bits of significance.  The length field indicates that 2 32-bit
  2691.    quantities follow.  The most significant non-zero bit of the number
  2692.    is in bit 13 of the first 32-bit quantity, the low order bits are in
  2693.    the second 32-bit quantity.
  2694.  
  2695.                                 1                   2                   3
  2696.             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
  2697.            +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2698.            !                                                            1 0!
  2699.            +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2700.            !0 0 0 0 0 0 0 0 0 0 0 0 0 1 x x x x x x x x x x x x x x x x x x!
  2701.            +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2702.            !x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x!
  2703.            +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2704.  
  2705. APPENDIX E Cryptographic strengths
  2706.  
  2707.    The Diffie-Hellman algorithm is used to compute keys that will be
  2708.    used with symmetric algorithms.  It should be no easier to break the
  2709.    Diffie-Hellman computation than it is to do an exhaustive search over
  2710.    the symmetric key space.  A recent recommendation by an group of
  2711.    cryptographers [Blaze-Diffie-et-al] has recommended a symmetric key
  2712.    size of 75 bits for a practical level of security.  For 20 year
  2713.    security, they recommend 90 bits.
  2714.  
  2715.    Based on that report, a conservative strategy for OAKLEY users would
  2716.    be to ensure that their Diffie-Hellman computations were as secure as
  2717.    at least a 90-bit key space.  In order to accomplish this for modular
  2718.    exponentiation groups, the size of the largest prime factor of the
  2719.    modulus should be at least 180 bits, and the size of the modulus
  2720.    should be at least 1400 bits.  For elliptic curve groups, the LPF
  2721.    should be at least 180 bits.
  2722.  
  2723.  
  2724.  
  2725. H. K. Orman                                                    [Page 44]
  2726.  
  2727. INTERNET DRAFT                                                  May 1996
  2728.  
  2729.  
  2730.    If long-term secrecy of the encryption key is not an issue, then the
  2731.    following parameters may be used for the modular exponentiation
  2732.    group: 150 bits for the LPF, 980 bits for the modulus size.
  2733.  
  2734.    The modulus size alone does not determine the strength of the
  2735.    Diffie-Hellman calculation; the size of the exponent used in
  2736.    computing powers within the group is also important.  The size of the
  2737.    exponent in bits should be at least twice the size of any symmetric
  2738.    key that will be derived from it.  We recommend that ISAKMP
  2739.    implementors use at least 180 bits of exponent (twice the size of a
  2740.    20-year symmetric key).
  2741.  
  2742.    The mathematical justification for these estimates can be found in
  2743.    texts that estimate the effort for solving the discrete log problem,
  2744.    a task that is strongly related to the efficiency of using the Number
  2745.    Field Sieve for factoring large integers.  Readers are referred to
  2746.    [Stinson] and [Schneier].
  2747.  
  2748.  
  2749.  
  2750.  
  2751.  
  2752.  
  2753.  
  2754.  
  2755.  
  2756.  
  2757.  
  2758.  
  2759.  
  2760.  
  2761.  
  2762.  
  2763.  
  2764.  
  2765.  
  2766.  
  2767.  
  2768.  
  2769.  
  2770.  
  2771.  
  2772.  
  2773.  
  2774.  
  2775.  
  2776.  
  2777.  
  2778.  
  2779.  
  2780.  
  2781.  
  2782.  
  2783.  
  2784.  
  2785.  
  2786.  
  2787. H. K. Orman                                                    [Page 45]
  2788.  
  2789. INTERNET DRAFT                                                  May 1996
  2790.  
  2791.  
  2792. APPENDIX F The Well-Known Groups
  2793.  
  2794.  
  2795.    This section will have explicit descriptors for three modular
  2796.    exponentiation groups and two elliptic curve over GF[2^n] groups.
  2797.  
  2798.    The identifiers for the groups (the well-known GRP's) will also be
  2799.    given here.
  2800.  
  2801.       0   No group (used as a placeholder and for non-DH exchanges)
  2802.       1   A modular exponentiation group with a 768 bit modulus (TBD)
  2803.       2   A modular exponentiation group with a 1024 bit modulus (TBD)
  2804.       3   A modular exponentiation group with a 2048 bit modulus (TBD)
  2805.       4   An elliptic curve group over GF[2^155]
  2806.       5   An elliptic curve group over GF[2^210]
  2807.  
  2808.       values 2^32 and higher are used for private group identifiers
  2809.  
  2810.  
  2811.  
  2812.  
  2813.  
  2814.  
  2815.  
  2816.  
  2817.  
  2818.  
  2819.  
  2820.  
  2821.  
  2822.  
  2823.  
  2824.  
  2825.  
  2826.  
  2827.  
  2828.  
  2829.  
  2830.  
  2831.  
  2832.  
  2833.  
  2834.  
  2835.  
  2836.  
  2837.  
  2838.  
  2839.  
  2840.  
  2841.  
  2842.  
  2843.  
  2844.  
  2845.  
  2846.  
  2847.  
  2848.  
  2849. H. K. Orman                                                    [Page 46]
  2850.  
  2851. INTERNET DRAFT                                                  May 1996
  2852.  
  2853.  
  2854. Appendix K  Implementing Group Operations
  2855.  
  2856.  
  2857.    The group operation must be implemented as a sequence of arithmetic
  2858.    operations; the exact operations depend on the type of group.  For
  2859.    modular exponentiation groups, the operation is multi-precision
  2860.    integer multiplication and remainders by the group modulus.  See
  2861.    Knuth Vol. 2 [Knuth] for a discussion of how to implement these for
  2862.    large integers.  Implementation recommendations for elliptic curve
  2863.    group operations over GF[2^N] are described in [Schroeppel].
  2864.  
  2865.  
  2866.  
  2867.  
  2868.  
  2869.  
  2870.  
  2871.  
  2872.  
  2873.  
  2874.  
  2875.  
  2876.  
  2877.  
  2878.  
  2879.  
  2880.  
  2881.  
  2882.  
  2883.  
  2884.  
  2885.  
  2886.  
  2887.  
  2888.  
  2889.  
  2890.  
  2891.  
  2892.  
  2893.  
  2894.  
  2895.  
  2896.  
  2897.  
  2898.  
  2899.  
  2900.  
  2901.  
  2902.  
  2903.  
  2904.  
  2905.  
  2906.  
  2907.  
  2908.  
  2909.  
  2910.  
  2911. H. K. Orman                                                    [Page 47]
  2912.  
  2913. INTERNET DRAFT                                                  May 1996
  2914.  
  2915.  
  2916. BIBLIOGRAPHY
  2917.  
  2918.  
  2919.    [RFC1825] Atkinson, Randall, RFC's 1825-1827
  2920.  
  2921.    [Blaze] Blaze, Matt et al., Recent symmetric key report
  2922.  
  2923.    [STS] Diffie, van Oorschot, and Wiener, Authentication and
  2924.    Authenticated Key Exchanges
  2925.  
  2926.    [DSS] DSS draft-ietf-ipsec-dss-cert-00.txt
  2927.  
  2928.    [SECDNS]        DNS Signed Keys,         Eastlake & Kaufman,
  2929.            draft-ietf-dnssec-secext-09.txt
  2930.  
  2931.    [Photuris] Karn, Phil and Simpson, William, Photuris, draft-ietf-
  2932.    ipsec-photuris-09.txt
  2933.  
  2934.    [Kocher] Kocher, Paul, Timing Attack
  2935.  
  2936.    [Krawcyzk] Krawcyzk, Hugo, SKEME, ISOC, SNDS Symposium, San Diego,
  2937.    1996
  2938.  
  2939.    [PKIX] PKIX internet drafts, draft-ietf-pkix-ipki-00.txt
  2940.  
  2941.    [Random] Random number RFC 1750
  2942.  
  2943.    [ISAKMP] Schertler, Mark, ISAKMP, draft-ietf-ipsec-isakmp-03.txt and
  2944.    draft-ietf-ipsec-isakmp-04.txt.  The transition from version 3 to
  2945.    version 4 was in progress at the time of this writing.
  2946.  
  2947.    [Schneier] Schneier, Bruce, Applied cryptography: protocols,
  2948.    algorithms, and source code in C, Second edition, John Wiley & Sons,
  2949.    Inc. 1995, ISBN 0-471-12845-7, hardcover.  ISBN 0-471-11709-9,
  2950.    softcover.
  2951.  
  2952.    [Schroeppel] Schroeppel, Richard, et al.; Fast Key Exchange with
  2953.    Elliptic Curve Systems, Crypto '95, Santa Barbara, 1995.  Available
  2954.    on-line as ftp://ftp.cs.arizona.edu/reports/1995/TR95-03.ps (and .Z).
  2955.  
  2956.    [Stinson] Stinson, Douglas, Cryptography Theory and Practice. CRC
  2957.    Press, Inc., 2000, Corporate Blvd., Boca Raton, FL, 33431-9868, ISBN
  2958.    0-8493-8521-0, 1995
  2959.  
  2960.    [Zimmerman] Philip Zimmermann, The Official Pgp User's Guide,
  2961.    Published by MIT Press Trade, Publication date: June 1995, ISBN:
  2962.    0262740176
  2963.  
  2964.  
  2965.       This draft expires six months from the day of issue.  The
  2966.       expiration date will be August 24, 1996.
  2967.  
  2968.  
  2969.  
  2970.  
  2971.  
  2972.  
  2973. H. K. Orman                                                    [Page 48]
  2974.  
  2975.