home *** CD-ROM | disk | FTP | other *** search
/ Internet Info 1997 December / Internet_Info_CD-ROM_Walnut_Creek_December_1997.iso / drafts / draft_n_r / draft-petke-mech-00.txt < prev    next >
Text File  |  1996-11-16  |  31KB  |  801 lines

  1.  
  2. INTERNET-DRAFT                                                   G Brown
  3. draft-petke-mech-00.txt                                       CompuServe
  4. Expires: 15-May-97                                      15 November 1996
  5.  
  6.  
  7.                     Remote Passphrase Authentication
  8.                         Part Two:  The Mechanism
  9.  
  10.  
  11. Status of this Memo
  12.  
  13.    This document is an Internet-Draft.  Internet-Drafts are working
  14.    documents of the Internet Engineering Task Force (IETF), its
  15.    areas, and its working groups.  Note that other groups may also
  16.    distribute working documents as Internet-Drafts.
  17.  
  18.    Internet-Drafts are draft documents valid for a maximum of six
  19.    months and may be updated, replaced, or obsoleted by other
  20.    documents at any time.  It is inappropriate to use Internet-
  21.    Drafts as reference material or to cite them other than as
  22.    "work in progress."
  23.  
  24.    To learn the current status of any Internet-Draft, please check
  25.    the "1id-abstracts.txt" listing contained in the Internet-
  26.    Drafts Shadow Directories on ftp.is.co.za (Africa),
  27.    nic.nordu.net (Europe), munnari.oz.au (Pacific Rim),
  28.    ds.internic.net (US East Coast), or ftp.isi.edu (US West Coast).
  29.    
  30.  
  31. Abstract 
  32.    
  33.    Remote Passphrase Authentication provides a way to authenticate a 
  34.    user to a service by using a pass phrase over an insecure network, 
  35.    without revealing the pass phrase to eavesdroppers. In addition, the
  36.    service need not know and does not learn the user's pass phrase, 
  37.    making this scheme useful in distributed environments where it would 
  38.    be difficult or inappropriate to trust a service with a pass phrase 
  39.    database or to allow the server to learn enough to masquerade as the 
  40.    user in a future authentication attempt.
  41.  
  42.    This draft is part two of a four part series and explains the
  43.    mechanism behind RPA.  Part one of this series
  44.    (draft-petke-ext-intro-00.txt) provides an extended introduction to
  45.    the problems of authentication over insecure networks.  Part three
  46.    (draft-petke-http-auth-scheme-00.txt) explains how to incorporate the
  47.    mechanism into HTTP.  Part four
  48.    (draft-petke-serv-deity-protocol-00.txt) explains the protocol
  49.    between the service and deity.
  50.  
  51.    This scheme was inspired by Dave Raggett's Mediated Digest
  52.    Authentication paper.
  53.    
  54.  
  55.  
  56.  
  57. G Brown                                                         [Page 1]
  58.  
  59. INTERNET-DRAFT              RPA - Part Two              15 November 1996
  60.   
  61.  
  62. Table of Contents 
  63.    
  64.    1. INTRODUCTION
  65.    
  66.    2. TERMINOLOGY
  67.    
  68.    3. DESIGN CRITERIA
  69.    
  70.    4. THE MECHANISM
  71.    4.1 AUTHENTICATION    
  72.    4.1.1 Values and their representation    
  73.    4.1.2 The authentication process    
  74.    4.2 REAUTHENTICATION    
  75.    4.3 REAUTHENTICATION CHEATING    
  76.  
  77.    5. SECURITY CONSIDERATIONS
  78.  
  79.    6. AUTHOR'S ADDRESS
  80.    
  81.  
  82. 1. Introduction 
  83.    
  84.    In this mechanism, we'll authenticate a user to a service and vice 
  85.    versa. We'll use pass phrases--actually, they're 128-bit shared 
  86.    secrets, but we'll define a way to use textual phrases--so the goal 
  87.    is to prove to the service that you know your pass phrase, and vice 
  88.    versa. 
  89.    
  90.    Of course, it's important not to reveal the pass phrase to an 
  91.    eavesdropper. It is equally important not to reveal the pass phrase 
  92.    to a spoofer. 
  93.    
  94.    Furthermore, the mechanism should work even if the service does not 
  95.    know the user's pass phrase. In a distributed environment, with many 
  96.    services that wish to authenticate the same set of users, it may be 
  97.    difficult to make users' pass phrases available to all services. And 
  98.    we might prefer not to do that, if we don't completely trust the 
  99.    services. So, not only should the service not have to know the user's
  100.    pass phrase, but the service should not learn the user's pass phrase 
  101.    during the authentication process. 
  102.    
  103.    On the other hand, the mechanism should be simple enough to apply 
  104.    even in the traditional case where the service knows the user's pass 
  105.    phrase; there's no need to use a different mechanism in that case. 
  106.    
  107.    Part one of this specification (draft-petke-ext-intro-00.txt)
  108.    contains an extended introduction that explains the problem and
  109.    various potential solutions and their problems, leading to this
  110.    mechanism. If you find yourself asking, "Why not just...," it might
  111.  
  112.  
  113.  
  114. G Brown                                                         [Page 2]
  115.  
  116. INTERNET-DRAFT              RPA - Part Two              15 November 1996
  117.  
  118.   
  119.    be worth reading part one to see if that explains it. However, it
  120.    contains only background material, so you needn't read part one
  121.    before reading the rest of this specification. 
  122.    
  123.  
  124. 2. Terminology 
  125.    
  126.    Throughout this specification we'll speak of a "user" communicating 
  127.    with a "service" that wishes to learn and authenticate the user's 
  128.    identity. Often, the user is a "client" and the service is a 
  129.    "server," but those terms refer to an implementation. 
  130.    
  131.    The "deity" knows the users' and services' pass phrases, and the 
  132.    service talks to the deity during the authentication process. 
  133.    Although the term "authentication server" is more conventional, we 
  134.    call it a deity because it's got fewer syllables and the term 
  135.    "server" is overloaded. If the service knows the pass phrases, then 
  136.    it acts as its own deity, simplifying the implementation but 
  137.    otherwise having no effect on the mechanism. 
  138.    
  139.    Identities exist in some "realm," and we use that term in its usual 
  140.    sense. We often think of a realm as being a relatively large 
  141.    collection of users, like compuserve.com or aol.com, but it might 
  142.    well consist of a small set of users, e.g., user names and pass 
  143.    phrases associated with an individual Web server. We allow the 
  144.    service to specify a set of realms, to recognize an identity in any 
  145.    of the realms in which it participates. 
  146.    
  147.  
  148. 3. Design criteria 
  149.    
  150.    This authentication mechanism is intended to meet the following 
  151.    criteria. 
  152.    
  153.    * The service learns and authenticates the user's identity. 
  154.      
  155.    * The user learns and authenticates the service's identity. 
  156.      
  157.    * The mechanism does not use public-key technology. 
  158.      
  159.    * The mechanism does not use encryption. (By encryption, we're 
  160.      referring to reversible encryption, the ability to encrypt 
  161.      something and later decrypt it. By avoiding encryption, we avoid 
  162.      restrictions on exportability.) 
  163.      
  164.    * The mechanism is based on shared secrets: "pass phrases," although 
  165.      they can be arbitrary bit patterns rather than text. 
  166.      
  167.    * Neither the user nor the service needs to know the other's pass 
  168.      phrase. 
  169.  
  170.  
  171. G Brown                                                         [Page 3]
  172.  
  173. INTERNET-DRAFT              RPA - Part Two              15 November 1996
  174.   
  175.      
  176.    * Neither the user nor the service nor eavesdroppers will learn the 
  177.      other's pass phrase. However, if the pass phrase is based on text, 
  178.      it's important to choose a "good" pass phrase to avoid a dictionary
  179.      attack. 
  180.      
  181.    * The mechanism is reasonably easy to implement in clients and does 
  182.      not require the client to communicate with a third party nor to a 
  183.      possess a reliable clock. 
  184.      
  185.    * The mechanism derives a shared secret that may be used as a session
  186.      key for subsequent authentication. 
  187.      
  188.    * The mechanism may be incorporated into almost any protocol. In 
  189.      other words, the mechanism is not designed around a protocol; the 
  190.      protocol is designed around the mechanism. But the mechanism must 
  191.      be suitable for incorporation into protocols like HTTP. 
  192.      
  193.    * The mechanism provides the ability to accept an identity in any of
  194.      a set of realms in which the user and service are members. 
  195.    
  196.  
  197. 4. The Mechanism 
  198.    
  199.    This authentication mechanism consists of three related processes: 
  200.    authentication, reauthentication, and reauthentication cheating. 
  201.    
  202.    Authentication is the fundamental process by which a user and a 
  203.    service mutually authenticate one another within one of a set of 
  204.    realms, without revealing their pass phrases to one another. 
  205.    
  206.    Reauthentication is a process by which a user and service, having 
  207.    recently authenticated one another, may again authenticate one 
  208.    another. They could, of course, simply repeat the authentication 
  209.    process, but that requires interaction with an authentication deity.
  210.    The reauthentication process is faster, requiring no communication 
  211.    with a third party. Reauthentication is useful when multiple 
  212.    connections between the user and service are established, whether 
  213.    sequential as in HTTP or simultaneous. Each connection must be 
  214.    authenticated, but the reauthentication process provides a shortcut.
  215.    
  216.    Reauthentication cheating is a further optimization for HTTP, a 
  217.    protocol that is quite unfriendly to challenge-response mechanisms. 
  218.    Reauthentication cheating can be performed in parallel with an HTTP 
  219.    transaction. True reauthentication is just as simple, but requires 
  220.    two sequential requests because of the characteristics of HTTP. By 
  221.    using reauthentication cheating, we create a "one-way" handshake. 
  222.  
  223.  
  224.  
  225.  
  226.  
  227.  
  228. G Brown                                                         [Page 4]
  229.  
  230. INTERNET-DRAFT              RPA - Part Two              15 November 1996
  231.   
  232.    
  233. 4.1 Authentication 
  234.    
  235.    There are three parties involved in the authentication process: 
  236.    
  237.    * the user; 
  238.    
  239.    * the service; and 
  240.    
  241.    * the authentication deity. 
  242.    
  243.    Each user has a name and a pass phrase in some realm of interest. 
  244.    Similarly, each service has a name and a pass phrase in that realm. 
  245.    The pass phrase isn't really text; it's a 128-bit (16-octet) string 
  246.    of bits. 
  247.    
  248.    However, it's often useful to use pass phrases in the conventional, 
  249.    textual sense, so we define a procedure for converting a textual 
  250.    phrase to the 128-bit value used by the authentication mechanism. If 
  251.    such a pass phrase is poorly chosen, it will be subject to dictionary
  252.    attack, and that's why we never use the word password in this 
  253.    specification (well, except in this sentence)--use a phrase, not a 
  254.    word. 
  255.    
  256.    The service may specify a list of realms, and the user chooses one in
  257.    which he has an identity. Thus, a service is not restricted to 
  258.    authenticating identities in a single realm. The service must possess
  259.    a name and pass phrase in all realms it lists. 
  260.    
  261.    Each realm has an authentication deity, which knows the names and 
  262.    pass phrases of its members. It's the service's responsibility to 
  263.    know how to locate an authentication deity for each realm; the user 
  264.    never communicates directly with an authentication deity. If the 
  265.    service knows the user's pass phrase, it performs the role of the 
  266.    authentication deity itself, but this does not affect the mechanism. 
  267.  
  268.    
  269. 4.1.1 Values and their representation 
  270.    
  271.    Following is a glossary of the values involved in the authentication
  272.    process; we'll use these symbols in the following explanation. 
  273.    
  274.        As--Authentication deity's response to service; proves user's 
  275.            identity 
  276.            
  277.        Au--Authentication deity's response to user; proves service's 
  278.            identity 
  279.            
  280.        Cs--Challenge from service 
  281.            
  282.        Cu--Challenge from user 
  283.  
  284.  
  285. G Brown                                                         [Page 5]
  286.  
  287. INTERNET-DRAFT              RPA - Part Two              15 November 1996
  288.   
  289.            
  290.        Kus--Session key for user and service 
  291.            
  292.        Kuss--Session key obscured so visible only to service 
  293.            
  294.        Kusu--Session key obscured so visible only to user 
  295.            
  296.        Nr--Realm name 
  297.            
  298.        Ns--Service name 
  299.            
  300.        Nu--User name 
  301.            
  302.        Ps--Service's pass phrase, a 128-bit value 
  303.            
  304.        Pu--User's pass phrase, a 128-bit value 
  305.            
  306.        Rs--Service's response to challenge (during authentication 
  307.            process, goes to authentication deity; during 
  308.            reauthentication, goes to user) 
  309.            
  310.        Ru--User's response to challenge (during authentication process,
  311.            goes via service to authentication deity; during 
  312.            reauthentication, goes to service) 
  313.            
  314.        Ts--Service's time stamp 
  315.  
  316.        Z--Padding consisting of 48 octets (384 bits) with all bits set 
  317.            to zero 
  318.            
  319.        +--Concatenation of octet strings 
  320.            
  321.        xor--Bitwise exclusive or 
  322.    
  323.    Bit patterns for each value must be specified. Imagine, for example, 
  324.    that one implementation uses ASCII, another EBCDIC, and another 
  325.    Unicode for the user name. Or one implementation converts the name to
  326.    lowercase, another to all caps. Each would generate a different 
  327.    result for the same calculation, and authentication would fail. 
  328.    
  329.    Should we leave such details to the underlying protocol? We could, 
  330.    but that would make the service-to-deity protocol dependent on the 
  331.    user-to-service protocol, so we couldn't have a single deity for each
  332.    realm. If we specify the bit patterns, we can allow any mixture of 
  333.    user-to-service and service-to-deity protocols to operate on the same
  334.    data. Therefore, we adopt the following conventions. 
  335.    
  336.    Text strings are represented in the Unicode character set, in 
  337.    big-endian byte order, without a trailing null character. Note that 
  338.    ASCII can be converted to ISO 8859-1 by prefixing a single 0 bit, and
  339.    ISO 8859-1 can be converted to Unicode by prefixing eight 0 bits. 
  340.  
  341.  
  342. G Brown                                                         [Page 6]
  343.  
  344. INTERNET-DRAFT              RPA - Part Two              15 November 1996
  345.  
  346.   
  347.    Each 16-bit Unicode character is stored in two octets, with its 
  348.    high-order 8 bits in the first octet. Representation of characters 
  349.    with multiple encodings is for further study. For example, e-acute 
  350.    has more than one representation. The form that uses combining 
  351.    characters, in character-code order, is probably the most logical. 
  352.    
  353.    Note, by the way, that this specification refers only to values used 
  354.    in the authentication calculations, not the underlying protocol. For 
  355.    example, it's quite reasonable for a protocol to use ASCII for user 
  356.    names, if that character set is adequate. Those ASCII characters must
  357.    be converted to Unicode before using them in authentication 
  358.    calculations, but the protocol need not transmit Unicode characters. 
  359.    
  360.    * Names--Nr, Ns, Nu--are converted to lowercase Unicode. Note that 
  361.      there is no trailing null character. 
  362.      
  363.    * Challenges--Cs, Cu--are arbitrary strings of octets, not text. They
  364.      may contain any bit patterns, including nulls, and must be at least
  365.      eight octets in length. 
  366.      
  367.    * The time stamp--Ts--is the ISO 646 (ASCII) textual representation 
  368.      of the current universal time--UTC--in exactly 14 octets, using 
  369.      24-hour time, with leading zeroes: 19950805011344. 
  370.      
  371.    * Pass phrases--Ps, Pu--are 16-octet quantities that contain 
  372.      arbitrary bit patterns, including nulls. If the pass phrase is 
  373.      based on a textual phrase, the textual phrase is converted to a 
  374.      16-octet quantity by the following process. 
  375.      
  376.    * Convert the text string to a sequence of characters in either the 
  377.      Unicode or ISO 8859-1 character sets, as appropriate for the 
  378.      realm. 
  379.        
  380.    * Convert each character to its lowercase equivalent, or its 
  381.      uppercase equivalent, or leave it alone, as appropriate for the 
  382.      realm. 
  383.        
  384.    * Store the sequence of characters in an octet stream, with each 
  385.      Unicode character in two consecutive octets in big-endian order, 
  386.      or each ISO 8859-1 character in one octet. Do not append a 
  387.      trailing null character. 
  388.        
  389.    * Take the MD5 digest of the resulting string of octets. The result 
  390.      is the 128-bit value to use in the authentication calculations. 
  391.    
  392.    A realm will specify which of the preceding options--character set, 
  393.    case conversion, and hash function--it uses for the text-to-128-bit 
  394.    value transformation; the defaults are Unicode, convert to lowercase,
  395.  
  396.  
  397.  
  398.  
  399. G Brown                                                         [Page 7]
  400.  
  401. INTERNET-DRAFT              RPA - Part Two              15 November 1996
  402.  
  403.  
  404.    and MD5. More options might be added in the future. The user-service 
  405.    protocol should be designed to convey the appropriate options for 
  406.    each realm from the service to the user, if other than the defaults 
  407.    are to be supported, to avoid requiring the (human) user to manually 
  408.    configure software. 
  409.  
  410.    
  411. 4.1.2 The authentication process 
  412.    
  413.    Here we describe the individual steps. Taken literally, one might 
  414.    envision many messages between the service and deity, but an actual 
  415.    implementation within a protocol combines steps. [Perhaps we should 
  416.    add a "sample protocol" section showing a three-way handshake 
  417.    version.] For example, "The user sends a random challenge" is shown 
  418.    as a separate step for clarity, but it needn't be a separate message 
  419.    to the service, nor must it be sent at the point shown--if it makes 
  420.    sense in the underlying protocol, the user's challenge might be 
  421.    included with the user's response to the service. 
  422.    
  423.    * The service supplies a sequence of realms, with the service's name
  424.      in each realm, to the user. For example, 
  425.      
  426.          foo@compuserve.com bar@aol.com 
  427.      
  428.      means "Please identify yourself with a CIS user ID. If you don't 
  429.      have one, your AOL ID will do." The service indicates its realm 
  430.      preferences in most-preferred to least-preferred order; by 
  431.      specifying only one realm, the service requires identification in 
  432.      that realm. 
  433.      
  434.    * The user chooses a realm, Nr, and gives it and his name in that 
  435.      realm, Nu, to the service. That, in turn, determines Ns, the 
  436.      service's name in that realm. Note that a protocol might allow the
  437.      service to include a null realm name, meaning "I'll accept you as 
  438.      an anonymous user if you wish." The user might make this choice by
  439.      supplying a null name; the process stops here, and no 
  440.      authentication is performed. 
  441.      
  442.    * The service transmits a random challenge, Cs, and a time stamp, Ts.
  443.      The challenges are random values that make each authentication 
  444.      unique. The time stamp is, in effect, a third challenge, which the 
  445.      deity will ensure is recent. The user may examine it, but most 
  446.      users lack an accurate source of universal time, so most users will
  447.      treat it as an opaque value. 
  448.      
  449.    * The user sends a random challenge, Cu. 
  450.  
  451.  
  452.  
  453.  
  454.  
  455.  
  456. G Brown                                                         [Page 8]
  457.  
  458. INTERNET-DRAFT              RPA - Part Two              15 November 1996
  459.  
  460.      
  461.    * The user calculates a response, Ru: 
  462.      
  463.          Ru = MD5(Pu + Z + Nu + Ns + Nr + Cu + Cs + Ts + Pu) 
  464.      
  465.      and sends it to the service. 
  466.      
  467.      Only the real user can generate the correct response, because it 
  468.      depends on the user's pass phrase, Pu. No one can determine the 
  469.      user's pass phrase from a captured response, because it's generated
  470.      by a one-way function, although there is the risk of a dictionary 
  471.      attack if Pu is based on a poorly chosen pass phrase. 
  472.      
  473.    * The service calculates a response, Rs: 
  474.      
  475.          Rs = MD5(Ps + Z + Nu + Ns + Nr + Cu + Cs + Ts + Ru + Ps) 
  476.      
  477.      This response is not sent to the user; it would do no harm if the 
  478.      user saw it, but the user won't need it. 
  479.      
  480.    * The service sends a request to the authentication deity for the 
  481.      realm in question. The request contains 
  482.      
  483.      - The realm name, Nr (included so the same deity can serve more 
  484.        than one realm) 
  485.        
  486.      - The user's name, Nu 
  487.        
  488.      - The service's name, Ns 
  489.        
  490.      - The user's challenge, Cu 
  491.        
  492.      - The service's challenge, Cs 
  493.        
  494.      - The time stamp, Ts 
  495.  
  496.      - The user's response, Ru 
  497.        
  498.      - The service's response, Rs 
  499.      
  500.    * The deity verifies the time stamp per previously agreed upon 
  501.      criteria. In some applications, one might require it within a few 
  502.      minutes; in others, one might want to allow 25 hours to eliminate 
  503.      problems of misconfigured time zones. Beware of overzealousness, 
  504.      though; this time stamp went from the service to the user, then 
  505.      back to the service, then to the deity, perhaps with human 
  506.      interaction--typing a pass phrase--introducing further delay. The 
  507.      deity might implement a replay cache. 
  508.      
  509.    * The deity uses Nr, Ns, and Nu to look up the user's and service's 
  510.      pass phrases. 
  511.  
  512.  
  513. G Brown                                                         [Page 9]
  514.  
  515. INTERNET-DRAFT              RPA - Part Two              15 November 1996
  516.  
  517.      
  518.    * The deity uses the values in the request, plus the service's pass 
  519.      phrase, Ps, to verify Rs. If it is incorrect, the deity returns a 
  520.      negative response; this request apparently did not come from a 
  521.      legitimate service. 
  522.      
  523.    * Having verified the requesting service's identity, the deity uses 
  524.      the values in the request, plus the user's pass phrase, Pu, to 
  525.      verify Ru. If it is incorrect, the deity returns a failure response
  526.      to the service; the user does not know the correct pass phrase. 
  527.      
  528.           [Think about the effects of replaying the authentication 
  529.           request. I think the answer is that there's no problem 
  530.           because it reveals no new information.] 
  531.      
  532.    * Having verified both the user's and service's identity, the deity 
  533.      creates a random, 128-bit session key, Kus, for use by the user and
  534.      service. They might use it for session encryption; in addition, it 
  535.      will be used in the reauthentication process described later. 
  536.      
  537.    * The deity generates two obscured copies of the session key: 
  538.      
  539.      - Kuss = Kus xor MD5(Ps + Z + Ns + Nu + Nr + Cs + Cu + Ts + Ps) 
  540.        
  541.      - Kusu = Kus xor MD5(Pu + Z + Ns + Nu + Nr + Cs + Cu + Ts + Pu) 
  542.        
  543.        The obscuring masks resemble Ru and Rs, but differ, of course, so
  544.        an eavesdropper cannot recover Kus. 
  545.      
  546.    * The deity generates a pair of authentication "proofs": 
  547.      
  548.      - Au = MD5(Pu + Z + Ns + Nu + Nr + Kusu + Cs + Cu + Ts + Kus + Pu) 
  549.        
  550.      - As = MD5(Ps + Z + Ns + Nu + Nr + Kuss + Cs + Cu + Ts + Kus + M + 
  551.        Ps) 
  552.        
  553.        Here "M" is the message transmitted from the deity to the 
  554.        service; it is included in the calculation to authenticate the 
  555.        response to the service. Refer to part four of this 
  556.        specification (draft-petke-serv-deity-protocol-00.txt) for more
  557.        details. 
  558.      
  559.    * The deity sends the four values Kuss, Kusu, As, and Au to the 
  560.      service. 
  561.      
  562.    * The service extracts its copy of the session key from Kuss by 
  563.      calculating the obscuring mask value and XORing. (The service can 
  564.      determine the user's key-obscuring value by calculating Kus xor 
  565.      Kusu; and if the user sees Kuss, it can do likewise. But the 
  566.      obscuring masks reveal nothing.) 
  567.  
  568.  
  569.  
  570. G Brown                                                        [Page 10]
  571.  
  572. INTERNET-DRAFT              RPA - Part Two              15 November 1996
  573.  
  574.      
  575.    * The service verifies As by performing the same calculation and 
  576.      comparing the result. If it matches, the service knows that someone
  577.      who knows its pass phrase--the deity--replied, having verified that
  578.      the user is who he claims to be. 
  579.      
  580.    * The service forwards Kusu and Au to the user. 
  581.      
  582.    * The user extracts its copy of the session key from Kusu by 
  583.      calculating the mask value and XORing. 
  584.      
  585.    * The user verifies Au by computing it and comparing. If it matches,
  586.      the user knows that someone who knows his pass phrase--the 
  587.      deity--replied, having verified that the service is who it claims 
  588.      to be. Of course, if the service itself knows the user's pass 
  589.      phrase, it can assert any service identity; but this is the case 
  590.      where the service is trusted and acts as its own deity. 
  591.    
  592.    Now the user and service are confident of each others' identities, 
  593.    and the two parties share a session key that they may use for 
  594.    encryption, if they so choose. 
  595.    
  596.         [Perhaps we should add another value to the authentication 
  597.         calculations, opaque to the mechanism, provided by the 
  598.         protocol in which this mechanism is embedded. This value 
  599.         would, of course, have to be added to the service-to-deity 
  600.         protocol, and its generation and interpretation would be up 
  601.         to the lower-level protocol. For example, HTTP might choose 
  602.         to include the Web server's IP address and, perhaps, the 
  603.         URL in the authentication calculations, making it harder to 
  604.         do a man-in-the-middle attack. (Of course, that problem 
  605.         cannot be completely solved without using the session key 
  606.         to authenticate data, which is a protocol issue outside the 
  607.         scope of this mechanism.)] 
  608.    
  609.  
  610. 4.2 Reauthentication 
  611.    
  612.    Reauthentication is a process by which a user and service, having 
  613.    recently authenticated each other, may again mutually authenticate 
  614.    without talking to a deity. This is useful with protocols like HTTP,
  615.    which involve a sequence of connections that must be independently 
  616.    authenticated. It's also useful with parallel connections--imagine a
  617.    scheme in which a user and service are connected, and wish to 
  618.    establish a second connection. 
  619.    
  620.    To reauthenticate one another, the user and service prove to each 
  621.    other that they both possess a secret 128-bit key--the session key, 
  622.    Kus, derived during the authentication process. The reauthentication
  623.    process is essentially an ordinary challenge-response mechanism in 
  624.    which the session key is used as a pass phrase. 
  625.  
  626.  
  627. G Brown                                                        [Page 11]
  628.  
  629. INTERNET-DRAFT              RPA - Part Two              15 November 1996
  630.  
  631.    
  632.    * The service sends a challenge, Cs, to the user. 
  633.      
  634.    * The user sends a challenge, Cu, to the service. 
  635.      
  636.    * The user calculates 
  637.      
  638.          Ru = MD5(Kus + Z + Ns + Nu + Nr + Cs + Cu + Kus) 
  639.      
  640.      and sends it to the service. 
  641.      
  642.    * The service verifies the result. If correct, it calculates 
  643.      
  644.          Rs = MD5(Kus + Z + Nu + Ns + Nr + Cu + Cs + Kus) 
  645.      
  646.      and sends it to the user. Both responses involve the same set of 
  647.      values, but they're used in a different order, so the responses are
  648.      different. 
  649.      
  650.    * The user verifies the result. 
  651.  
  652.    
  653. 4.3 Reauthentication cheating 
  654.    
  655.    In HTTP, one can shortcut the reauthentication process by cheating, 
  656.    for an increase in efficiency. 
  657.    
  658.    A naive approach allows the user to repeat its authentication data, 
  659.    presumably in the form of an Authorization header. If the service 
  660.    recognizes the same Authorization header, it presumes that it's 
  661.    talking to the previously authenticated user; essentially, we pretend
  662.    that we reauthenticated with the same challenges. But this approach 
  663.    is vulnerable to replay attacks during the period of time the service
  664.    considers the data valid. The service can check the user's IP address
  665.    to reduce the risk, but IP addresses mean surprisingly little. Even 
  666.    neglecting address spoofing, multiple users share an IP address when 
  667.    they're on the same host or routed through a proxy or SOCKS server. 
  668.  
  669.    There's a better solution. We begin by noting why it's 
  670.    desirable--from an efficiency, not security, point of view--to allow 
  671.    the Authorization header to be replayed. To embed a 
  672.    challenge-response mechanism in HTTP, we require at least two HTTP 
  673.    transactions for authentication, because we cannot send a challenge 
  674.    and receive a response in one HTTP transaction. If we could challenge
  675.    the user without sending a challenge to the user, we could 
  676.    authenticate in one HTTP transaction. And we can do exactly that by 
  677.    treating the URI as a challenge. 
  678.    
  679.    * The first time, the user and service perform the authentication 
  680.      process. 
  681.  
  682.  
  683.  
  684. G Brown                                                        [Page 12]
  685.  
  686. INTERNET-DRAFT              RPA - Part Two              15 November 1996
  687.  
  688.      
  689.    * The user and service remember the session key (Kus), challenges (Cu
  690.      and Cs), and timestamp (Ts). 
  691.      
  692.    * When the user generates an HTTP request, he includes an 
  693.      Authorization header containing a response calculated as 
  694.      
  695.          MD5(Kus + Z + Ns + Nu + Nr + Cs + Cu + Ts + method + URI + Kus)
  696.    
  697.    The method and URI are canonicalized by taking the big-endian Unicode
  698.    representation and converting all characters to lowercase; the URI 
  699.    should not include the scheme://host:port. It always begins with a 
  700.    slash; for "http://www.foo.com" the one-character string "/" would be
  701.    used. 
  702.    
  703.    Now the authentication response is unique for each URI, and 
  704.    calculable only by the authenticated user, even without a unique 
  705.    challenge. This doesn't completely eliminate the risk of replay, of 
  706.    course, but an attacker can replay only a previously referenced URI 
  707.    during the window in which the service considers the session key to 
  708.    be valid. Is that acceptable? 
  709.    
  710.    Sometimes. If we're reading Web pages, and the only impact of replay 
  711.    is that the attacker could re-read the page, it might be 
  712.    acceptable--after all, the attacker saw the page, anyway, when he 
  713.    captured it along with the original request. On the other hand, if 
  714.    we're charging the user per page, or if the request "did" something, 
  715.    replay might not be so harmless. 
  716.    
  717.    One strategy is to maintain some history. In its simplest form, the 
  718.    service sets a flag for this session when it does something for which
  719.    replay would be harmful. If the user tries reauthentication cheating,
  720.    and the flag is set, the service forces reauthentication. Because the
  721.    cheating response is based on Cu and Cs, and those values change 
  722.    during reauthentication, the correct response for a given URI changes
  723.    after reauthentication. Thus, reauthentication creates a boundary 
  724.    after which previous requests cannot be replayed. 
  725.  
  726.    Or the service can maintain a history of URIs for which replay would
  727.    be harmful, and force reauthentication only if the user tries 
  728.    reauthentication cheating on one of those URIs. 
  729.    
  730.  
  731. 5. Security Considerations 
  732.    
  733.    This entire document is about security. 
  734.  
  735.  
  736.  
  737.  
  738.  
  739.    
  740.  
  741. G Brown                                                        [Page 13]
  742.  
  743. INTERNET-DRAFT              RPA - Part Two              15 November 1996
  744.  
  745.  
  746. 6. Author's Address 
  747.    
  748.    Gary S. Brown
  749.    CompuServe Incorporated
  750.    5000 Britton Rd
  751.    P.O. Box 5000
  752.    Hilliard OH 43026-5000
  753.    USA
  754.    
  755.    +1 614 723 1127
  756.    <gsb@csi.compuserve.com>
  757.  
  758.  
  759. This Internet-Draft expired on May 15, 1997.
  760.  
  761.  
  762.  
  763.  
  764.  
  765.  
  766.  
  767.  
  768.  
  769.  
  770.  
  771.  
  772.  
  773.  
  774.  
  775.  
  776.  
  777.  
  778.  
  779.  
  780.  
  781.  
  782.  
  783.  
  784.  
  785.  
  786.  
  787.  
  788.  
  789.  
  790.  
  791.  
  792.  
  793.  
  794.  
  795.  
  796.  
  797.  
  798. G Brown                                                        [Page 14]
  799.  
  800.  
  801.