home *** CD-ROM | disk | FTP | other *** search
/ Internet Info 1997 December / Internet_Info_CD-ROM_Walnut_Creek_December_1997.iso / drafts / draft_s_z / draft-wu-srp-auth-00.txt < prev    next >
Text File  |  1997-09-11  |  16KB  |  360 lines

  1.  
  2.  
  3.  
  4. Internet Draft                                                     T. Wu
  5. draft-wu-srp-auth-00.txt                             Stanford University
  6. Expires 31 March 1998                                     September 1997
  7.  
  8.  
  9.             The SRP Authentication and Key Exchange System
  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 view the entire list of current Internet-Drafts, please check
  25.      the "1id-abstracts.txt" listing contained in the Internet-Drafts
  26.      Shadow Directories on ftp.is.co.za (Africa), ftp.nordu.net
  27.      (Europe), munnari.oz.au (Pacific Rim), ds.internic.net (US East
  28.      Coast), or ftp.isi.edu (US West Coast).
  29.  
  30. Abstract
  31.  
  32.    This document describes a cryptographically strong network
  33.    authentication mechanism known as the Secure Remote Password (SRP)
  34.    protocol.  This mechanism is suitable for negotiating secure
  35.    connections using a user-supplied password, while eliminating the
  36.    security problems traditionally associated with reusable passwords.
  37.    This system also performs a secure key exchange in the process of
  38.    authentication, allowing security layers (privacy and/or integrity
  39.    protection) to be enabled during the session.  Trusted key servers
  40.    and certificate infrastructures are not required, and clients are
  41.    not required to store or manage any long-term keys.  SRP offers
  42.    both security and deployment advantages over existing challenge-
  43.    response techniques, making it an ideal drop-in replacement where
  44.    secure password authentication is needed.
  45.  
  46. 1. Introduction
  47.  
  48.    The lack of a secure authentication mechanism that is also easy
  49.    to use has been a long-standing problem with the vast majority of
  50.    Internet protocols currently in use.  The problem is two-fold:
  51.    Users like to use passwords that they can remember, but most
  52.    password-based authentication systems offer little protection
  53.    against even passive attackers, especially if weak and easily-
  54.    guessed passwords are used.
  55.  
  56.  
  57. draft-ietf-wu-srp-auth-00.txt                                   [Page 2]
  58.  
  59.    Eavesdropping on a TCP/IP network can be carried out very easily
  60.    and very effectively against protocols that transmit passwords in
  61.    the clear.  Even so-called "challenge-response" techniques like
  62.    the one described in [RFC 2095] and [RFC 1760], which are designed
  63.    to defeat simple sniffing attacks, can be compromised by what is
  64.    known as a "dictionary attack".  This occurs when an attacker
  65.    captures the messages exchanged during a legitimate run of the
  66.    protocol and uses that information to verify a series of guessed
  67.    passwords taken from a precompiled "dictionary" of common passwords.
  68.    This works because users often choose simple, easy-to-remember
  69.    passwords, which invariably are also easy to guess.
  70.  
  71.    Many existing mechanisms also require the password database on the
  72.    host to be kept secret because the password P or some private hash
  73.    h(P) is stored there and would compromise security if revealed.
  74.    That approach often degenerates into "security through obscurity"
  75.    and goes against the UNIX convention of keeping a "public" password
  76.    file whose contents can be revealed without destroying system security.
  77.  
  78.    SRP meets the strictest requirements laid down in [RFC 1704] for a
  79.    non-disclosing authentication protocol.  It offers complete protection
  80.    against both passive and active attacks, and accomplishes this
  81.    efficiently using a single Diffie-Hellman-style round of computation,
  82.    making it feasible to use in both interactive and non-interactive
  83.    authentication for a wide range of Internet protocols.  Since it
  84.    retains its security when used with low-entropy passwords, it can
  85.    be seamlessly integrated into existing user applications.
  86.  
  87. 2. Conventions and Terminology
  88.  
  89.    The protocol described by this document is officially known as
  90.    "SRP-3" for the sake of clarity.  This particular protocol is
  91.    described in [SRP] and is believed to have very good logical
  92.    and cryptographic resistance to both eavesdropping and active
  93.    attacks.
  94.  
  95.    This document does not attempt to describe SRP-3 in the context
  96.    of any particular Internet protocol; instead it describes an
  97.    abstract protocol that can be easily fitted to a particular
  98.    application.  For example, the specific format of messages
  99.    (including padding) is not specified.  Those issues have been
  100.    left to the protocol implementor to decide.
  101.  
  102.    The one implementation issue worth specifying here is the
  103.    mapping between strings and integers.  Internet protocols are
  104.    byte-oriented, while SRP-3 performs algebraic operations on its
  105.    messages, so it is logical to define at least one method
  106.    by which integers can be converted into a string of bytes and
  107.    vice versa.
  108.  
  109.  
  110. draft-ietf-wu-srp-auth-00.txt                                   [Page 3]
  111.  
  112.    An n-byte string S can be converted to an integer as follows:
  113.  
  114.    i = S[n-1] + 256 * S[n-2] + 256^2 * S[n-3] + ... + 256^(n-1) * S[0]
  115.  
  116.    where i is the integer and S[x] is the value of the x'th byte
  117.    of S.  In human terms, the string of bytes is the integer
  118.    expressed in base 256, with the most significant digit first.
  119.    When converting back to a string, S[0] must be non-zero (padding
  120.    is considered to be a separate, independent process).  This
  121.    conversion method is suitable for file storage, in-memory
  122.    representation, and network transmission of large integer
  123.    values.  Unless otherwise specified, this mapping will be
  124.    assumed.
  125.  
  126.    If implementations require padding a string that represents an
  127.    integer value, it is recommended that they use zero bytes and
  128.    add them to the beginning of the string.  The conversion back to
  129.    integer automatically discards leading zero bytes, making this
  130.    padding scheme less prone to error.
  131.  
  132.    The SHA hash function, when used in this document, refers to the
  133.    SHA-1 message digest algorithm described in [SHA1].
  134.  
  135. 3. The SRP3-SHA1 mechanism
  136.  
  137.    This section describes an implementation of the SRP-3 authentication
  138.    and key-exchange protocol that employs the SHA hash function to
  139.    generate session keys and authentication proofs.
  140.  
  141.    The host stores user passwords as triplets of the form
  142.  
  143.      { <username>, <password verifier>, <salt> }
  144.  
  145.    Password entries are generated as follows:
  146.  
  147.      <salt> = random()
  148.      x = SHA(<salt> | SHA(<username> | ":" | <raw password>))
  149.      <password verifier> = v = g^x % N
  150.  
  151.    The | symbol indicates string concatenation, the ^ operator is the
  152.    exponentiation operation, and the % operator is the integer remainder
  153.    operation.  Most implementations perform the exponentiation and
  154.    remainder in a single stage to avoid generating unwieldy intermediate
  155.    results.  Note that the 160-bit output of SHA is implicitly converted
  156.    to an integer before it is operated upon.
  157.  
  158.  
  159. draft-ietf-wu-srp-auth-00.txt                                   [Page 4]
  160.  
  161.    Authentication is generally initiated by the client.
  162.  
  163.         Client                             Host
  164.        --------                           ------
  165.         U = <username>              -->
  166.                                     <--    s = <salt from passwd file>
  167.  
  168.    Upon identifying himself to the host, the client will receive
  169.    the salt stored on the host under his username.
  170.  
  171.         a = random()
  172.         A = g^a % N                 -->
  173.                                            v = <stored password verifier>
  174.                                            b = random()
  175.                                     <--    B = (v + g^b) % N
  176.  
  177.         p = <raw password>
  178.         x = SHA(s | SHA(u | ":" | p))
  179.  
  180.         S = (B - g^x) ^ (a + u * x) % N    S = (A * v^u) ^ b % N
  181.     K = SHA_Interleave(S)              K = SHA_Interleave(S)
  182.         (this function is described
  183.          in the next section)
  184.  
  185.    The client generates a random number, raises g to that power modulo
  186.    the field prime, and sends the result to the host.  The host
  187.    does the same thing and also adds the public verifier before
  188.    sending it to the client.  Both sides then construct the shared
  189.    session key based on the respective formulae.
  190.  
  191.    The parameter u is a 32-bit unsigned integer which takes its
  192.    value from the first 32 bits of the SHA1 hash of B, MSB first.
  193.  
  194.    The client MUST abort authentication if B % N is zero.
  195.  
  196.    The host MUST abort the authentication attempt if A % N is
  197.    zero.  The host MUST send B after receiving A from the client,
  198.    never before.
  199.  
  200.    At this point, the client and server should have a common
  201.    session key that is secure (i.e. not known to an outside party).
  202.    To finish authentication, they must prove to each other that
  203.    their keys are identical.
  204.  
  205.         M = H(H(N) XOR H(g) | H(U) | s | A | B | K)
  206.                                     -->
  207.                                     <--    H(A | M | K)
  208.  
  209.    The server will calculate M using its own K and compare
  210.    it against the client's response.  If they do not match, the
  211.    server MUST abort and signal an error before it attempts to
  212.    answer the client's challenge.  Not doing so could compromise the
  213.    security of the user's password.
  214.  
  215.  
  216. draft-ietf-wu-srp-auth-00.txt                                   [Page 5]
  217.  
  218.    If the server receives a correct response, it issues its own proof
  219.    to the client.  The client will compute the expected response using
  220.    its own K to verify the authenticity of the server.  If the client
  221.    responded correctly, the server MUST respond with its hash value.
  222.  
  223.    The transactions in this protocol description do not necessarily
  224.    have a one-to-one correspondence with actual protocol messages.
  225.    This description is only intended to illustrate the relationships
  226.    between the different parameters and how they are computed.
  227.    It is possible, for example, for an implementation of the SRP3-SHA1
  228.    mechanism to consolidate some of the flows as follows:
  229.  
  230.         Client                             Host
  231.        --------                           ------
  232.         U, A                        -->
  233.                                     <--    s, B
  234.         H(H(N) XOR H(g) | H(U) | s | A | B | K)
  235.                                     -->
  236.                                     <--    H(A | M | K)
  237.  
  238.    The values of N and g used in this protocol must be agreed upon
  239.    by the two parties in question.  They can be set in advance, or
  240.    the host can supply them to the client.  In the latter case, the
  241.    host should send the parameters in the first message along with
  242.    the salt.  For maximum security, N should be a safe prime
  243.    (i.e. a number of the form N = 2q + 1, where q is also prime).
  244.    Also, g should be a generator modulo N (see [SRP] for details),
  245.    which means that for any X where 0 < X < N, there exists a value
  246.    x for which g^x % N == X.
  247.  
  248. 3.1.  Interleaved SHA
  249.  
  250.    The SHA_Interleave function used in SRP3-SHA1 is used to generate
  251.    a session key that is twice as long as the 160-bit output of SHA1.
  252.    To compute this function, remove all leading zero bytes from the
  253.    input.  If the length of the resulting string is odd, also remove
  254.    the first byte.  Call the resulting string T.  Extract the
  255.    even-numbered bytes into a string E and the odd-numbered bytes
  256.    into a string F, i.e.
  257.  
  258.      E = T[0] | T[2] | T[4] | ...
  259.      F = T[1] | T[3] | T[5] | ...
  260.  
  261.    Both E and F should be exactly half the length of T.  Hash each
  262.    one with regular SHA1, i.e.
  263.  
  264.      G = SHA(E)
  265.      H = SHA(F)
  266.  
  267.    Interleave the two hashes back together to form the output, i.e.
  268.  
  269.      result = G[0] | H[0] | G[1] | H[1] | ... | G[19] | H[19]
  270.  
  271.    The result will be 40 bytes (320 bits) long.
  272.  
  273.  
  274. draft-ietf-wu-srp-auth-00.txt                                   [Page 6]
  275.  
  276. 3.2.  Other Hash Algorithms
  277.  
  278.    SRP-3 can be used with hash functions other than SHA.
  279.    If the hash function produces an output of a different length
  280.    than SHA (20 bytes), it may change the length of some of the
  281.    messages in the protocol, but the fundamental operation will
  282.    be unaffected.
  283.  
  284.    Earlier versions of the SRP mechanism used the MD5 hash function,
  285.    described in [RFC 1321].
  286.  
  287.    Any hash function used with SRP should produce an output of at
  288.    least 16 bytes and have the property that small changes in the
  289.    input cause significant nonlinear changes in the output.  [SRP]
  290.    covers these issues in more depth.
  291.  
  292. 4. Intellectual Property Considerations
  293.  
  294.    The SRP-3 authentication protocol will be made available worldwide
  295.    on a royalty-free basis for non-commercial uses.  Stanford
  296.    University has filed a patent application for SRP, and it
  297.    is expected that commercial licensing terms will be nominal,
  298.    open, and fair.
  299.  
  300. 5. Security Considerations
  301.  
  302.    This entire draft discusses an authentication and key-exchange
  303.    system that protects passwords and exchanges keys across an
  304.    untrusted network.  This system improves security by eliminating
  305.    the need to send cleartext passwords over the network and by
  306.    enabling encryption through its secure key-exchange mechanism.
  307.  
  308.    SRP-3 has been designed not only to counter the threat of casual
  309.    password-sniffing, but also to prevent a determined attacker
  310.    equipped with a dictionary of passwords from guessing at
  311.    passwords using captured network traffic.  The SRP-3 protocol
  312.    itself also resists active network attacks, and implementations
  313.    can use the securely exchanged keys to protect the session against
  314.    hijacking and provide confidentiality.
  315.  
  316.    SRP-3 also has the added advantage of permitting the host to store
  317.    passwords in a form that is not directly useful to an attacker.
  318.    Even if the host's password database were publicly revealed,
  319.    the attacker would still need an expensive dictionary search to
  320.    obtain any passwords.  The exponential computation required to
  321.    validate a guess in this case is much more time-consuming than
  322.    the hash currently used by most UNIX systems.  Hosts are still
  323.    advised, though, to try their best to keep their password files
  324.    secure.
  325.  
  326.  
  327. draft-ietf-wu-srp-auth-00.txt                                   [Page 7]
  328.  
  329. 6. References
  330.  
  331.    [RFC 1321]  R. L. Rivest, The MD5 Message-Digest Algorithm, "Request
  332.                For Comments (RFC) 1321", MIT and RSA Data Security, Inc.,
  333.                April 1992
  334.  
  335.    [RFC 1704]  N. Haller and R. Atkinson, On Internet Authentication,
  336.                "Request for Comments (RFC) 1704", NRL, October 1994
  337.  
  338.    [RFC 1760]  N. Haller, The S/Key One-Time Password System, "Request
  339.                For Comments (RFC) 1760", Bellcore, Feburary 1995
  340.  
  341.    [RFC 2095]  J. Klensin, R. Catoe, P. Krumviede, IMAP/POP AUTHorize
  342.                Extension for Simple Challenge/Response, "Request For
  343.                Comments (RFC) 2095", MCI, January 1997
  344.  
  345.    [SHA1]  National Institute of Standards and Technology (NIST),
  346.            "Announcing the Secure Hash Standard", FIPS 180-1, U.S.
  347.            Department of Commerce, April 1995.
  348.  
  349.    [SRP]  T. Wu, The Secure Remote Password Protocol, work in progress
  350.  
  351. 7. Author's Address
  352.  
  353.    Thomas Wu
  354.    Stanford University
  355.    Stanford, CA 94305
  356.  
  357.    Phone: (650) 725-6969
  358.    EMail: tjw@cs.Stanford.EDU
  359.  
  360.