RFC 2522:Photuris: Session-Key Management Protocol
RFC-Ref

1. Introduction

   Photuris [Firefly] establishes short-lived session-keys between two
   parties, without passing the session-keys across the Internet.  These
   session-keys directly replace the long-lived secret-keys (such as
   passwords and passphrases) that have been historically configured for
   security purposes.

   The basic Photuris protocol utilizes these existing previously
   configured secret-keys for identification of the parties.  This is
   intended to speed deployment and reduce administrative configuration
   changes.

   This document is primarily intended for implementing the Photuris
   protocol.  It does not detail service and application interface
   definitions, although it does mention some basic policy areas
   required for the proper implementation and operation of the protocol
   mechanisms.

   Since the basic Photuris protocol is extensible, new data types and
   protocol behaviour should be expected.  The implementor is especially
   cautioned not to depend on values that appear in examples to be
   current or complete, since their purpose is primarily pedagogical.

1.1. Terminology

   In this document, the key words "MAY", "MUST, "MUST NOT", "optional",
   "recommended", "SHOULD", and "SHOULD NOT", are to be interpreted as
   described in [RFC-2119].

   byte             An 8-bit quantity; also known as "octet" in
                    standardese.

   exchange-value   The publically distributable value used to calculate
                    a shared-secret.  As used in this document, refers
                    to a Diffie-Hellman exchange, not the public part of
                    a public/private key-pair.

   private-key      A value that is kept secret, and is part of an
                    asymmetric public/private key-pair.

   public-key       A publically distributable value that is part of an
                    asymmetric public/private key-pair.

   secret-key       A symmetric key that is not publically
                    distributable.  As used in this document, this is
                    distinguished from an asymmetric public/private

                    key-pair.  An example is a user password.

   Security Association (SA)
                    A collection of parameters describing the security
                    relationship between two nodes.  These parameters
                    include the identities of the parties, the transform
                    (including algorithm and algorithm mode), the key(s)
                    (such as a session-key, secret-key, or appropriate
                    public/private key-pair), and possibly other
                    information such as sensitivity labelling.

   Security Parameters Index (SPI)
                    A number that indicates a particular set of uni-
                    directional attributes used under a Security
                    Association, such as transform(s) and session-
                    key(s).  The number is relative to the IP
                    Destination, which is the SPI Owner, and is unique
                    per IP (Next Header) Protocol.  That is, the same
                    value MAY be used by multiple protocols to
                    concurrently indicate different Security Association
                    parameters.

   session-key      A key that is independently derived from a shared-
                    secret by the parties, and used for keying one
                    direction of traffic.  This key is changed
                    frequently.

   shared-secret    As used in this document, the calculated result of
                    the Photuris exchange.

   SPI Owner        The party that corresponds to the IP Destination;
                    the intended recipient of a protected datagram.

   SPI User         The party that corresponds to the IP Source; the
                    sender of a protected datagram.

   transform        A cryptographic manipulation of a particular set of
                    data.  As used in this document, refers to certain
                    well-specified methods (defined elsewhere).  For
                    example, AH-MD5 [RFC-1828] transforms an IP datagram
                    into a cryptographic hash, and ESP-DES-CBC [RFC-1829] 
                    transforms plaintext to ciphertext and back
                    again.

   Many of these terms are hierarchically related:

      Security Association (bi-directional)
       - one or more lists of Security Parameters (uni-directional)
        -- one or more Attributes
         --- may have a key
         --- may indicate a transform

   Implementors will find details of cryptographic hashing (such as
   MD5), encryption algorithms and modes (such as DES), digital
   signatures (such as DSS), and other algorithms in [Schneier95].

1.2. Protocol Overview

   The Photuris protocol consists of several simple phases:

   1. A "Cookie" Exchange guards against simple flooding attacks sent
      with bogus IP Sources or UDP Ports.  Each party passes a "cookie"
      to the other.

      In return, a list of supported Exchange-Schemes are offered by the
      Responder for calculating a shared-secret.

   2. A Value Exchange establishes a shared-secret between the parties.
      Each party passes an Exchange-Value to the other.  These values
      are used to calculate a shared-secret.  The Responder remains
      stateless until a shared-secret has been created.

      In addition, supported attributes are offered by each party for
      use in establishing new Security Parameters.

   3. An Identification Exchange identifies the parties to each other,
      and verifies the integrity of values sent in phases 1 and 2.

      In addition, the shared-secret provides a basis to generate
      separate session-keys in each direction, which are in turn used
      for conventional authentication or encryption.  Additional
      security attributes are also exchanged as needed.

      This exchange is masked for party privacy protection using a
      message privacy-key based on the shared-secret.  This protects the
      identities of the parties, hides the Security Parameter attribute
      values, and improves security for the exchange protocol and
      security transforms.

   4. Additional messages may be exchanged to periodically change the
      session-keys, and to establish new or revised Security Parameters.

      These exchanges are also masked for party privacy protection in
      the same fashion as above.

   The sequence of message types and their purposes are summarized in
   the diagram below.  The first three phases (cookie, exchange, and
   identification) must be carried out in their entirety before any
   Security Association can be used.

   Initiator                            Responder
   =========                            =========
   Cookie_Request                 ->
                                   <-   Cookie_Response
                                           offer schemes
   Value_Request                  ->
      pick scheme
      offer value
      offer attributes
                                   <-   Value_Response
                                           offer value
                                           offer attributes

             [generate shared-secret from exchanged values]

   Identity_Request               ->
      make SPI
      pick SPI attribute(s)
      identify self
      authenticate
      make privacy key(s)
      mask/encrypt message
                                   <-   Identity_Response
                                           make SPI
                                           pick SPI attribute(s)
                                           identify self
                                           authenticate
                                           make privacy key(s)
                                           mask/encrypt message

               [make SPI session-keys in each direction]

   SPI User                             SPI Owner
   ========                             =========
   SPI_Needed                     ->
      list SPI attribute(s)
      make validity key
      authenticate
      make privacy key(s)
      mask/encrypt message
                                   <-   SPI_Update
                                           make SPI
                                           pick SPI attribute(s)
                                           make SPI session-key(s)
                                           make validity key
                                           authenticate
                                           make privacy key(s)
                                           mask/encrypt message

   Either party may initiate an exchange at any time.  For example, the
   Initiator need not be a "caller" in a telephony link.

   The Initiator is responsible for recovering from all message losses
   by retransmission.

1.3. Security Parameters

   A Photuris exchange between two parties results in a pair of SPI
   values (one in each direction).  Each SPI is used in creating
   separate session-key(s) in each direction.

   The SPI is assigned by the entity controlling the IP Destination: the
   SPI Owner (receiver).  The parties use the combination of IP
   Destination, IP (Next Header) Protocol, and SPI to distinguish the
   correct Security Association.

   When both parties initiate Photuris exchanges concurrently, or one
   party initiates more than one Photuris exchange, the Initiator
   Cookies (and UDP Ports) keep the exchanges separate.  This results in
   more than one initial SPI for each Destination.

   To create multiple SPIs with different parameters, the parties may
   also send SPI_Updates.

   There is no requirement that all such outstanding SPIs be used.  The
   SPI User (sender) selects an appropriate SPI for each datagram
   transmission.

   Implementation Notes:

      The method used for SPI assignment is implementation dependent.
      The only requirement is that the SPI be unique for the IP
      Destination and IP (Next Header) Protocol.

      However, selection of a cryptographically random SPI value can
      help prevent attacks that depend on a predicatable sequence of
      values.  The implementor MUST NOT expect SPI values to have a
      particular order or range.

1.4. LifeTimes

   The Photuris exchange results in two kinds of state, each with
   separate LifeTimes.

   1) The Exchange LifeTime of the small amount of state associated with
      the Photuris exchange itself.  This state may be viewed as between
      Internet nodes.

   2) The SPI LifeTimes of the individual SPIs that are established.
      This state may be viewed as between users and nodes.

   The SPI LifeTimes may be shorter or longer than the Exchange
   LifeTime.  These LifeTimes are not required to be related to each
   other.

   When an Exchange-Value expires (or is replaced by a newer value), any
   unexpired derived SPIs are not affected.  This is important to allow
   traffic to continue without interruption during new Photuris
   exchanges.

1.4.1. Exchange LifeTimes

   All retained exchange state of both parties has an associated
   Exchange LifeTime (ELT), and is subject to periodic expiration.  This
   depends on the physical and logistical security of the machine, and
   is typically in the range of 10 minutes to one day (default 30
   minutes).

   In addition, during a Photuris exchange, an Exchange TimeOut (ETO)
   limits the wait for the exchange to complete.  This timeout includes
   the packet round trips, and the time for completing the
   Identification Exchange calculations.  The time is bounded by both
   the maximum amount of calculation delay expected for the processing
   power of an unknown peer, and the minimum user expectation for

   results (default 30 seconds).

   These Exchange LifeTimes and TimeOuts are implementation dependent
   and are not disclosed in any Photuris message.  The paranoid operator
   will have a fairly short Exchange LifeTime, but it MUST NOT be less
   than twice the ETO.

   To prevent synchronization between Photuris exchanges, the
   implementation SHOULD randomly vary each Exchange LifeTime within
   twice the range of seconds that are required to calculate a new
   Exchange-Value.  For example, when the Responder uses a base ELT of
   30 minutes, and takes 10 seconds to calculate the new Exchange-Value,
   the equation might be (in milliseconds):

      1790000 + urandom(20000)

   The Exchange-Scheme, Exchange-Values, and resulting shared-secret MAY
   be cached in short-term storage for the Exchange LifeTime.  When
   repetitive Photuris exchanges occur between the same parties, and the
   Exchange-Values are discovered to be unchanged, the previously
   calculated shared-secret can be used to rapidly generate new
   session-keys.

1.4.2. SPI LifeTimes

   Each SPI has an associated LifeTime, specified by the SPI owner
   (receiver).  This SPI LifeTime (SPILT) is usually related to the
   speed of the link (typically 2 to 30 minutes), but it MUST NOT be
   less than thrice the ETO.

   The SPI can also be deleted by the SPI Owner using the SPI_Update.
   Once the SPI has expired or been deleted, the parties cease using the
   SPI.

   To prevent synchronization between multiple Photuris exchanges, the
   implementation SHOULD randomly vary each SPI LifeTime.  For example,
   when the Responder uses a base SPILT of 5 minutes, and 30 seconds for
   the ETO, the equation might be (in milliseconds):

      285000 + urandom(30000)

   There is no requirement that a long LifeTime be accepted by the SPI
   User.  The SPI User might never use an established SPI, or cease
   using the SPI at any time.

   When more than one unexpired SPI is available to the SPI User for the
   same function, a common implementation technique is to select the SPI

   with the greatest remaining LifeTime.  However, selecting randomly
   among a large number of SPIs might provide some defense against
   traffic analysis.

   To prevent resurrection of deleted or expired SPIs, SPI Owners SHOULD
   remember those SPIs, but mark them as unusable until the Photuris
   exchange shared-secret used to create them also expires and purges
   the associated state.

   When the SPI Owner detects an incoming SPI that has recently expired,
   but the associated exchange state has not yet been purged, the
   implementation MAY accept the SPI.  The length of time allowed is
   highly dependent on clock drift and variable packet round trip time,
   and is therefore implementation dependent.

1.5. Random Number Generation

   The security of Photuris critically depends on the quality of the
   secret random numbers generated by each party.  A poor random number
   generator at either party will compromise the shared-secret produced
   by the algorithm.

   Generating cryptographic quality random numbers on a general purpose
   computer without hardware assistance is a very tricky problem.  In
   general, this requires using a cryptographic hashing function to
   "distill" the entropy from a large number of semi-random external
   events, such as the timing of key strokes.  An excellent discussion
   can be found in [RFC-1750].

Google
Web
RFC-Ref