GSS_S_PROMPTING_NEEDED is a bit
[cyrus-sasl.git] / doc / draft-burdis-cat-srp-sasl-xx.txt
1
2
3
4 Network                                                        K. Burdis
5 Internet-Draft                                         Rhodes University
6 Expires: November 28, 2003                                     R. Naffah
7                                                           Forge Research
8                                                             May 30, 2003
9
10
11             Secure Remote Password Authentication Mechanism
12                       draft-burdis-cat-srp-sasl-08
13
14 Status of this Memo
15
16    This document is an Internet-Draft and is in full conformance with
17    all provisions of Section 10 of RFC2026.
18
19    Internet-Drafts are working documents of the Internet Engineering
20    Task Force (IETF), its areas, and its working groups. Note that other
21    groups may also distribute working documents as Internet-Drafts.
22
23    Internet-Drafts are draft documents valid for a maximum of six months
24    and may be updated, replaced, or obsoleted by other documents at any
25    time. It is inappropriate to use Internet-Drafts as reference
26    material or to cite them other than as "work in progress."
27
28    The list of current Internet-Drafts can be accessed at http://
29    www.ietf.org/ietf/1id-abstracts.txt.
30
31    The list of Internet-Draft Shadow Directories can be accessed at
32    http://www.ietf.org/shadow.html.
33
34    This Internet-Draft will expire on November 28, 2003.
35
36 Copyright Notice
37
38    Copyright (C) The Internet Society (2003). All Rights Reserved.
39
40 Abstract
41
42    This document describes an authentication mechanism based on the
43    Secure Remote Password protocol (SRP-6) and how to use it with the
44    authentication frameworks Secure Authentication and Security Layer
45    (SASL), Generic Security Services Application Programming Interface
46    (GSS-API) and Extensible Authentication Protocol (EAP).  This
47    mechanism performs mutual authentication and can provide a security
48    layer with replay detection, integrity protection and/or
49    confidentiality protection.
50
51
52
53
54
55
56 Burdis & Naffah        Expires November 28, 2003                [Page 1]
57 \f
58 Internet-Draft        SRP Authentication Mechanism              May 2003
59
60
61 Table of Contents
62
63    1.    Introduction . . . . . . . . . . . . . . . . . . . . . . . .  4
64    2.    Conventions Used in this Document  . . . . . . . . . . . . .  5
65    3.    Data Element Formats . . . . . . . . . . . . . . . . . . . .  6
66    3.1   Scalar Numbers . . . . . . . . . . . . . . . . . . . . . . .  6
67    3.2   Multi-Precision Integers . . . . . . . . . . . . . . . . . .  6
68    3.3   Octet Sequences  . . . . . . . . . . . . . . . . . . . . . .  7
69    3.4   Extended Octet Sequences . . . . . . . . . . . . . . . . . .  7
70    3.5   Text . . . . . . . . . . . . . . . . . . . . . . . . . . . .  7
71    3.6   Buffers  . . . . . . . . . . . . . . . . . . . . . . . . . .  8
72    3.7   Data Element Size Limits . . . . . . . . . . . . . . . . . .  8
73    3.8   Unsigned Integers  . . . . . . . . . . . . . . . . . . . . .  8
74    4.    Protocol Description . . . . . . . . . . . . . . . . . . . .  9
75    4.1   Client Sends its Identity  . . . . . . . . . . . . . . . . . 11
76    4.2   Server Agrees to Re-use Parameters of a Previous Session . . 11
77    4.3   Server Sends Protocol Elements . . . . . . . . . . . . . . . 12
78    4.4   Client Sends its Ephemeral Public Key and Evidence . . . . . 15
79    4.5   Server Verifies Client's Evidence and Sends its Evidence . . 17
80    5.    Security Layer . . . . . . . . . . . . . . . . . . . . . . . 19
81    5.1   Cryptographic Primitives . . . . . . . . . . . . . . . . . . 20
82    5.1.1 Pseudo Random Number Generator . . . . . . . . . . . . . . . 20
83    5.1.2 Key Derivation Function  . . . . . . . . . . . . . . . . . . 22
84    5.2   Confidentiality Protection . . . . . . . . . . . . . . . . . 23
85    5.3   Replay Detection . . . . . . . . . . . . . . . . . . . . . . 24
86    5.4   Integrity Protection . . . . . . . . . . . . . . . . . . . . 25
87    5.5   Summary of Security Layer Output . . . . . . . . . . . . . . 25
88    6.    Discussion . . . . . . . . . . . . . . . . . . . . . . . . . 27
89    6.1   Mandatory Algorithms . . . . . . . . . . . . . . . . . . . . 27
90    6.2   Modulus and Generator Values . . . . . . . . . . . . . . . . 27
91    6.3   Replay Detection Sequence Number Counters  . . . . . . . . . 27
92    6.4   Re-using the Parameters of a Previous Session  . . . . . . . 28
93    7.    SASL . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
94    7.1   Overview . . . . . . . . . . . . . . . . . . . . . . . . . . 30
95    7.2   Mechanism Name . . . . . . . . . . . . . . . . . . . . . . . 30
96    7.3   Security Layer . . . . . . . . . . . . . . . . . . . . . . . 30
97    7.4   Profile Considerations . . . . . . . . . . . . . . . . . . . 30
98    7.5   Example  . . . . . . . . . . . . . . . . . . . . . . . . . . 31
99    8.    GSS-API  . . . . . . . . . . . . . . . . . . . . . . . . . . 34
100    8.1   Overview . . . . . . . . . . . . . . . . . . . . . . . . . . 34
101    8.2   Terminology  . . . . . . . . . . . . . . . . . . . . . . . . 34
102    8.3   Initial Token  . . . . . . . . . . . . . . . . . . . . . . . 34
103    8.4   Security Layer . . . . . . . . . . . . . . . . . . . . . . . 35
104    9.    EAP  . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
105    9.1   Overview . . . . . . . . . . . . . . . . . . . . . . . . . . 36
106    9.2   Terminology  . . . . . . . . . . . . . . . . . . . . . . . . 36
107    9.3   Method Details . . . . . . . . . . . . . . . . . . . . . . . 36
108    9.4   Security Claims  . . . . . . . . . . . . . . . . . . . . . . 37
109
110
111
112 Burdis & Naffah        Expires November 28, 2003                [Page 2]
113 \f
114 Internet-Draft        SRP Authentication Mechanism              May 2003
115
116
117    10.   Security Considerations  . . . . . . . . . . . . . . . . . . 40
118    11.   Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 41
119          Normative References . . . . . . . . . . . . . . . . . . . . 42
120          Informative References . . . . . . . . . . . . . . . . . . . 44
121          Authors' Addresses . . . . . . . . . . . . . . . . . . . . . 46
122    A.    Modulus and Generator Values . . . . . . . . . . . . . . . . 47
123    B.    Changes since the previous draft . . . . . . . . . . . . . . 49
124          Intellectual Property and Copyright Statements . . . . . . . 50
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168 Burdis & Naffah        Expires November 28, 2003                [Page 3]
169 \f
170 Internet-Draft        SRP Authentication Mechanism              May 2003
171
172
173 1. Introduction
174
175    The Secure Remote Password (SRP) is a password-based, zero-knowledge,
176    authentication and key-exchange protocol developed by Thomas Wu.  It
177    has good performance, is not plaintext-equivalent and maintains
178    perfect forward secrecy.  It provides authentication (optionally
179    mutual authentication) and the negotiation of a shared context key
180    [SRP].
181
182    The mechanism described herein is based on the SRP-6 protocol,
183    described in [SRP-6] and [SRP-6i].  SRP-6 is an improved version of
184    the original SRP protocol (also called SRP-3) described in
185    [RFC-2945].  Due to the design of the mechanism, mutual
186    authentication is MANDATORY.
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224 Burdis & Naffah        Expires November 28, 2003                [Page 4]
225 \f
226 Internet-Draft        SRP Authentication Mechanism              May 2003
227
228
229 2. Conventions Used in this Document
230
231    o  A hex digit is an element of the set:
232
233          {0, 1, 2, 3, 4, 5, 6, 7, 8 , 9, A, B, C, D, E, F}
234
235       A hex digit is the representation of a 4-bit string.  Examples:
236
237          7 = 0111
238
239          A = 1010
240
241    o  An octet is an 8-bit string.  In this document an octet may be
242       written as a pair of hex digits.  Examples:
243
244          7A = 01111010
245
246          02 = 00000010
247
248    o  All data is encoded and sent in network byte order (big-endian).
249
250    o  The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL
251       NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL"
252       in this document are to be interpreted as described in [RFC-2119].
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280 Burdis & Naffah        Expires November 28, 2003                [Page 5]
281 \f
282 Internet-Draft        SRP Authentication Mechanism              May 2003
283
284
285 3. Data Element Formats
286
287    This section describes the encoding of the data elements used by the
288    mechanism described in this document.
289
290 3.1 Scalar Numbers
291
292    Scalar numbers are unsigned quantities.  Using b[k] to refer to the
293    k-th octet being processed, the value of a two-octet scalar is:
294
295       ((b[0] << 8) + b[1]),
296
297    where << is the bit left-shift operator.  The value of a four-octet
298    scalar is:
299
300       ((b[0] << 24) + (b[1] << 16) + (b[2] << 8) + b[3]).
301
302
303 3.2 Multi-Precision Integers
304
305    Multi-Precision Integers, or MPIs, are positive integers used to hold
306    large integers used in cryptographic computations.
307
308    MPIs are encoded using a scheme inspired by that used by OpenPGP -
309    [RFC-2440] (section 3.2) - for encoding such entities:
310
311       The encoded form of an MPI SHALL consist of two pieces: a
312       two-octet scalar that represents the length of the entity, in
313       octets, followed by a sequence of octets that contain the actual
314       integer.
315
316       These octets form a big-endian number; A big-endian number can be
317       encoded by prefixing it with the appropriate length.
318
319       Examples: (all numbers are in hexadecimal)
320
321          The sequence of octets [00 01 01] encodes an MPI with the value
322          1, while the sequence [00 02 01 FF] encodes an MPI with the
323          value of 511.
324
325       Additional rule:
326
327       *  The length field of an encoded MPI describes the octet count
328          starting from the MPI's first non-zero octet, containing the
329          most significant non-zero bit.  Thus, the encoding [00 02 01]
330          is not formed correctly; It should be [00 01 01].
331
332    We shall use the syntax mpi(A) to denote the encoded form of the
333
334
335
336 Burdis & Naffah        Expires November 28, 2003                [Page 6]
337 \f
338 Internet-Draft        SRP Authentication Mechanism              May 2003
339
340
341    multi-precision integer A.  Furthermore, we shall use the syntax
342    bytes(A) to denote the big-endian sequence of octets forming the
343    multi-precision integer with the most significant octet being the
344    first non-zero octet containing the most significant bit of A.
345
346 3.3 Octet Sequences
347
348    This mechanism generates, uses and exchanges sequences of octets;
349    e.g. output values of message digest algorithm functions.  When such
350    entities travel on the wire, they shall be preceded by a one-octet
351    scalar quantity representing the count of following octets.
352
353    Note that a zero-length octet sequence is encoded as a single 00
354    octet.
355
356    We shall use the syntax os(s) to denote the encoded form of the octet
357    sequence.  Furthermore, we shall use the syntax bytes(s) to denote
358    the sequence of octets s, in big-endian order.
359
360 3.4 Extended Octet Sequences
361
362    Extended sequences of octets are exchanged when using the security
363    layer.  When these sequences travel on the wire, they shall be
364    preceded by a four-octet scalar quantity representing the count of
365    following octets.
366
367    We shall use the syntax eos(s) to denote the encoded form of the
368    extended octet sequence.  Furthermore, we shall use the syntax
369    bytes(s) to denote the sequence of octets s, in big-endian order.
370
371 3.5 Text
372
373    The only character set for text is the UTF-8 encoding [RFC-2279] of
374    Unicode characters [ISO-10646]. All text MUST be in Unicode
375    Normalization Form KC [UNICODE-KC] without NUL characters.
376
377    In addition, to avoid non-interoperability due to incompatible
378    normalisation techniques, the client MUST prepare strings using the
379    [SASLprep] profile of [RFC-3454]
380
381    We shall use the syntax utf8(L) to denote the string L in UTF-8
382    encoding, preceded by a two-octet scalar quantity representing the
383    count of following octets.  Furthermore, we shall use the syntax
384    bytes(L) to denote the sequence of octets representing the UTF-8
385    encoding of L, in big-endian order.
386
387    Not that the empty string is encoded as the two octet sequence 00 00.
388
389
390
391
392 Burdis & Naffah        Expires November 28, 2003                [Page 7]
393 \f
394 Internet-Draft        SRP Authentication Mechanism              May 2003
395
396
397 3.6 Buffers
398
399    In this mechanism data is exchanged between the client and server
400    using buffers.  A buffer acts as an envelope for the sequence of data
401    elements sent by one end-point of the exchange, and expected by the
402    other.
403
404    A buffer MAY NOT contain other buffers.  It may only contain zero,
405    one or more data elements.
406
407    A buffer shall be encoded as two fields: a four-octet scalar quantity
408    representing the count of following octets, and the concatenation of
409    the octets of the data element(s) contained in the buffer.
410
411    We shall use the syntax {A|B|C} to denote a buffer containing A, B
412    and C in that order.  For example:
413
414       { mpi(N) | mpi(g) | utf8(L) }
415
416    is a buffer containing, in the designated order, the encoded forms of
417    an MPI N, an MPI g and a Text L.
418
419 3.7 Data Element Size Limits
420
421    The following table details the size limit, in number of octets, for
422    each of the data element encodings described earlier.
423
424       Data element type          Header       Size limit in octets
425                                 (octets)       (excluding header)
426       ------------------------------------------------------------
427       Octet Sequence               1                  255
428       MPI                          2                 65,535
429       Text                         2                 65,535
430       Extended Octet Sequence      4             2,147,483,383
431       Buffer                       4             2,147,483,643
432
433    An implementation MUST signal an exception if any size constraint is
434    violated.
435
436 3.8 Unsigned Integers
437
438    This mechanism uses unsigned integer values ranging from zero to
439    4,294,967,296.
440
441    When such entities travel on the wire, they shall be encoded as
442    4-octet Scalar Numbers.  We shall use the syntax uint(n) to denote
443    the encoding of an Unsigned Integer n.
444
445
446
447
448 Burdis & Naffah        Expires November 28, 2003                [Page 8]
449 \f
450 Internet-Draft        SRP Authentication Mechanism              May 2003
451
452
453 4. Protocol Description
454
455    The following sections describe the sequence of data transmitted
456    between the client and server for SRP authentication, as well as the
457    extra control information exchanged to enable a client to request
458    whether or not replay detection, integrity protection and/or
459    confidentiality protection should be provided by a security layer.
460    There are two possible mechanism data exchanges during the
461    authentication phase:
462
463    The following exchange occurs when a new session is negotiated
464    between the client and the server.  It will also occur when the
465    client requests re-use of the parameters of a previous session and
466    either the server does not support such re-use or no longer considers
467    the previous session to be valid:
468
469     Client                                                   Server
470
471     ---  { utf8(U) | utf8(I) | utf8(sid) | os(cn) }  ------------->
472
473     <------ { 00 | mpi(N) | mpi(g) | os(s) | mpi(B) | utf8(L) } ---
474
475     ---  { mpi(A) | os(M1) | utf8(o) | os(cIV) }  ---------------->
476
477     <------ { os(M2) | os(sIV) | utf8(sid) | uint(ttl) }  ---------
478
479    where:
480
481       U   is the authentication identity (username),
482
483       I   is the authorisation identity (userid),
484
485       sid is the identifier of a previous session whose parameters the
486       client wishes to re-use,
487
488       cn  is the client's nonce used in deriving a new shared context
489       key from the shared context key of the previous session,
490
491       00  is an octet indicating that the previous session parameters
492       will NOT be re-used,
493
494       N   is the safe prime modulus,
495
496       g   is the generator,
497
498       s   is the user's password salt,
499
500       B   is the server's ephemeral public key,
501
502
503
504 Burdis & Naffah        Expires November 28, 2003                [Page 9]
505 \f
506 Internet-Draft        SRP Authentication Mechanism              May 2003
507
508
509       L   is the options list indicating available security services,
510
511       A   is the client's ephemeral public key,
512
513       M1  is the client's evidence that the shared key K is known,
514
515       o   is the options list indicating chosen security services,
516
517       cIV is the client's initial vector for the chosen encryption
518       algorithm,
519
520       M2  is the server's evidence that the shared key K is known.
521
522       sIV is the server's initial vector for the chosen encryption
523       algorithm,
524
525       sid is the identifier the server gives to this session for
526       possible later re-use of the negotiated parameters,
527
528       ttl is the time period for which this session's parameters may be
529       re-usable,
530
531    The following exchange occurs when the client requests that the
532    parameters negotiated in a previous session be re-used in this
533    session, but with a newly derived shared context key, and the server
534    agrees:
535
536     Client                                                   Server
537
538     ---  { utf8(U) | utf8(I) | utf8(sid) | os(cn) }  -------------->
539
540     <----------------------------------  { FF | os(sn) }  ----------
541
542    where:
543
544       U   is the authentication identity (username),
545
546       I   is the authorisation identity (userid),
547
548       sid is the identifier of a previous session whose parameters the
549       client wishes to re-use,
550
551       cn  is the client's nonce used in deriving a new shared context
552       key from the shared context key of the previous session,
553
554       FF  is an octet indicating that the previous session parameters
555       WILL be re-used,
556
557
558
559
560 Burdis & Naffah        Expires November 28, 2003               [Page 10]
561 \f
562 Internet-Draft        SRP Authentication Mechanism              May 2003
563
564
565       sn  is the server's nonce used in deriving a new shared context
566       key from the shared context key of the previous session,
567
568
569 4.1 Client Sends its Identity
570
571    The client determines its authentication identity U and authorisation
572    identity I, encodes them and sends them to the server.
573
574    The semantics of both U and I are intended to be the same as
575    described in [SASL].  Specifically, the authentication identity U is
576    derived from the client's authentication credentials, and the
577    authorisation identity I is used by the server as the primary
578    identity for making access policy decisions.
579
580    As a client might not have the same information as the server,
581    clients SHOULD NOT themselves try to derive authorisation identities
582    from authentication identities.  When an authorisation identity is
583    not specified by the user the client SHOULD send an empty string
584    instead.
585
586    If the client does not wish to re-use parameters negotiated in a
587    previous session then it sets sid to the empty string and cn to a
588    zero-length octet sequence.
589
590    However, if the client does wish to attempt to re-use the parameters
591    negotiated in a previous session then it sets sid to the session
592    identifier for that session, and sets cn as follows:
593
594       cn = prng()
595
596    where:
597
598       prng()  is a random number generation function that outputs at
599       least 16 octets of data.
600
601    See Section 6.4 for more information on re-using negotiated
602    parameters of a previous session.
603
604    The client sends:
605
606       { utf8(U) | utf8(I) | utf8(sid) | os(cn) }
607
608
609 4.2 Server Agrees to Re-use Parameters of a Previous Session
610
611    If the server supports re-using the parameters negotiated in a
612    previous session and it considers the previous session, identified by
613
614
615
616 Burdis & Naffah        Expires November 28, 2003               [Page 11]
617 \f
618 Internet-Draft        SRP Authentication Mechanism              May 2003
619
620
621    the session identifier (sid) received from the client, to be valid,
622    it responds as follows:
623
624    The server sends the octet FF as the first element of the message to
625    indicate to the client that parameters of the previous session are
626    being re-used.  It also generates a nonce (sn), which is later used
627    in deriving a new shared context key for this session:
628
629       sn = prng()
630
631    where:
632
633       prng()  is a random number generation function that outputs at
634       least 16 octets of data.
635
636    Note that the server nonce (sn) MUST NOT be the same as the client
637    nonce (cn).
638
639    The server sends:
640
641       { FF | os(sn) }
642
643    See Section 6.4 for more information on re-using negotiated
644    parameters of a previous session and deriving the new shared context
645    key.
646
647 4.3 Server Sends Protocol Elements
648
649    Otherwise, the server receives U and looks up the safe prime modulus
650    N, the generator g, the salt s, and the verifier v, to be used for
651    that identity.  It uses the this information to generate its
652    ephemeral public key B as follows:
653
654       b = prng();
655
656       B = ((3 * v) + (g ** b)) % N;
657
658    where:
659
660       prng() is a random number generation function,
661
662       b      is the MPI that will act as the server's private key,
663
664       v      is the stored password verifier value,
665
666       g      is the generator,
667
668       N      is the safe prime modulus,
669
670
671
672 Burdis & Naffah        Expires November 28, 2003               [Page 12]
673 \f
674 Internet-Draft        SRP Authentication Mechanism              May 2003
675
676
677       *      is the multiplication operator,
678
679       +      is the addition operator,
680
681       **     is the exponentiation operator,
682
683       %      is the modulus operator,
684
685    The server also creates an options list L, which consists of a
686    comma-separated list of option strings that specify the options the
687    server supports.  This options list MUST NOT contain any whitespace
688    characters and all alphabetic characters MUST be in lowercase.  When
689    used in digest calculations by the client the options list MUST be
690    used as received.
691
692    The following option strings are defined:
693
694    o  "mda=<MDA-name>" indicates that the server supports the designated
695       hash function as the underlying Message Digest Algorithm for the
696       designated user to be used for all SRP calculations - to compute
697       both client-side and server-side digests.  The specified algorithm
698       MUST meet the requirements specified in section 3.2 of [RFC-2945]:
699
700          "Any hash function used with SRP should produce an output of at
701          least 16 bytes and have the property that small changes in the
702          input cause significant nonlinear changes in the output."
703
704       Note that in the interests of interoperability between client and
705       server implementations and with other SRP-based tools, both the
706       client and the server MUST support SHA-160 as an underlying
707       Message Digest Algorithm.  While the server is not required to
708       list SHA-160 as an available underlying Message Digest Algorithm,
709       it must be able to do so.
710
711    o  "integrity=hmac-<MDA-name>" indicates that the server supports
712       integrity protection using the HMAC algorithm [RFC-2104] with
713       <MDA-name> as the underlying Message Digest Algorithm.  Acceptable
714       MDA names are chosen from [SCAN] under the MessageDigest section.
715       A server SHOULD send such an option string for each HMAC algorithm
716       it supports.  The server MUST advertise at least one integrity
717       protection algorithm and in the interest of interoperability the
718       server SHOULD advertise support for the HMAC-SHA-160 algorithm.
719
720    o  "replay_detection" indicates that the server supports replay
721       detection using sequence numbers.  Replay detection SHALL NOT be
722       activated without also activating integrity protection.  If the
723       replay detection option is offered (by the server) and/or chosen
724       (by the client) without explicitly specifying an integrity
725
726
727
728 Burdis & Naffah        Expires November 28, 2003               [Page 13]
729 \f
730 Internet-Draft        SRP Authentication Mechanism              May 2003
731
732
733       protection option, then the default integrity protection option
734       "integrity=hmac-sha-160" is implied and SHALL be activated.
735
736    o  "confidentiality=<cipher-name>" indicates that the server supports
737       confidentiality protection using the symmetric key block cipher
738       algorithm <cipher-name>.  The server SHOULD send such an option
739       string for each confidentiality protection algorithm it supports.
740       Note that in the interest of interoperability, if the server
741       offers confidentiality protection, it MUST send the option string
742       "confidentiality=aes" since it is then MANDATORY for it to provide
743       support for the [AES] algorithm.
744
745    o  "mandatory=[integrity|replay_detection|confidentiality]" is an
746       option only available to the server that indicates that the
747       specified security layer option is MANDATORY and MUST be chosen by
748       the client for use in the resulting security layer.  If a server
749       specifies an option as mandatory in this way, it MUST abort the
750       connection if the specified option is not chosen by the client.
751       It doesn't make sense for the client to send this option since it
752       is only able to choose options that the server advertises.  The
753       client SHOULD abort the connection if the server does not offer an
754       option that it requires.  If this option is not specified then
755       this implies that no options are mandatory.  The server SHOULD
756       always send the "mandatory=integrity" option indicating that
757       integrity protection is required.
758
759    o  "maxbuffersize=<number-of-bytes>" indicates to the peer the
760       maximum number of raw bytes (excluding the buffer header) to be
761       processed by the security layer at a time, if one is negotiated.
762       The value of <number-of-bytes> MUST NOT exceed the Buffer size
763       limit defined in section 3.7.  If this option is not detected by a
764       client or server mechanism, then it shall operate its security
765       layer on the assumption that the maximum number of bytes that may
766       be sent, to the peer server or client mechanism respectively, is
767       the Buffer data size limit indicated in section 3.7.  On the other
768       hand, if a recipient detects this option, it shall break any
769       octet-sequence longer than the designated limit into two or more
770       fragments, before sending them separately, in sequence, to the
771       peer.
772
773    For example, if the server supports integrity protection using the
774    HMAC-SHA-160 and HMAC-MD5 algorithms, replay detection and no
775    confidentiality protection, the options list would be:
776
777       mda=sha-1,integrity=hmac-sha-160,integrity=hmac-md5,replay_detection
778
779    The server sends the octet 00 as the first element of the message to
780    indicate to the client that parameters from a previous session are
781
782
783
784 Burdis & Naffah        Expires November 28, 2003               [Page 14]
785 \f
786 Internet-Draft        SRP Authentication Mechanism              May 2003
787
788
789    NOT being used.
790
791    The server sends:
792
793       { 00 | mpi(N) | mpi(g) | os(s) | mpi(B) | utf8(L) }
794
795
796 4.4 Client Sends its Ephemeral Public Key and Evidence
797
798    The client receives the options list L from the server that specifies
799    the Message Digest Algorithm(s) available to be used for all SRP
800    calculations, the security service options the server supports,
801    including the maximum buffer size the server can handle, and the
802    server's ephemeral public key B.  The client selects options from
803    this list and creates a new options list o that specifies the
804    selected Message Digest Algorithm to be used for SRP calculations and
805    the security services that will be used in the security layer.  At
806    most one available Message Digest Algorithm name, one available
807    integrity protection algorithm and one available confidentiality
808    protection algorithm may be selected.  In addition the client may
809    specify the maximum buffer size it can handle.  The client MUST
810    include any option specified by the mandatory option.
811
812    The client SHOULD always select an integrity protection algorithm
813    even if the server does not make it mandatory to do so.  If the
814    client selects a confidentiality protection algorithm it SHOULD then
815    also select an integrity protection algorithm.
816
817    The options list o MUST NOT contain any whitespace characters and all
818    alphabetic characters MUST be in lowercase.  When used in digest
819    calculations by the server the options list MUST be used as received.
820
821    The client generates its ephemeral public key A as follows:
822
823       a = prng();
824
825       A = (g ** a) % N;
826
827    where:
828
829       a      is the MPI that will act as the client's private key,
830
831    The client also calculates the shared context key K, and calculates
832    the evidence M1 that proves to the server that it knows the shared
833    context key K, as well as the server's ephemeral public key B, the
834    user's authorisation identity I and the server's options list L.
835
836    K, on the client's side is computed as follows:
837
838
839
840 Burdis & Naffah        Expires November 28, 2003               [Page 15]
841 \f
842 Internet-Draft        SRP Authentication Mechanism              May 2003
843
844
845       x = H(s | H(U | ":" | p));
846
847       u = H(A | B);
848
849       S = ((B - (3 * (g ** x))) ** (a + (u * x))) % N;
850
851       K = H(S);
852
853    where:
854
855       s    is the user's password salt,
856
857       U    is the authentication identity (username),
858
859       p    is the password value.
860
861       A    is the client's ephemeral public key,
862
863       B    is the server's ephemeral public key,
864
865       g    is the generator,
866
867       N    is the safe prime modulus,
868
869       H()  is the result of digesting the designated input/data with the
870       chosen underlying Message Digest Algorithm function.
871
872       -    is the subtraction operator,
873
874       *    is the multiplication operator,
875
876       +    is the addition operator,
877
878       **   is the exponentiation operator,
879
880       %    is the modulus operator,
881
882    M1 is computed as:
883
884             H(   bytes(H( bytes(N) )) ^ bytes( H( bytes(g) ))
885                | bytes(H( bytes(U) ))
886                | bytes(s)
887                | bytes(A)
888                | bytes(B)
889                | bytes(K)
890                | bytes(H( bytes(I) ))
891                | bytes(H( bytes(L) ))
892              )
893
894
895
896 Burdis & Naffah        Expires November 28, 2003               [Page 16]
897 \f
898 Internet-Draft        SRP Authentication Mechanism              May 2003
899
900
901    where:
902
903       ^    is the bitwise XOR operator.
904
905    All parameters received from the server that are used as input to a
906    digest operation MUST be used as received.
907
908    If the client chooses to activate the Confidentiality Protection
909    service in the Security Layer, it MUST send the Initial Vector cIV
910    that the server will use to set up its encryption context.  (See
911    Section 5.2 for details on the Confidentiality Protection service and
912    how cIV is generated.)  However, this element MAY be a zero-length
913    octet stream if the server does not advertise the Confidentiality
914    Protection service or the client decides not to activate it.
915
916    The client sends:
917
918       { mpi(A) | os(M1) | utf8(o) | os(cIV) }
919
920
921 4.5 Server Verifies Client's Evidence and Sends its Evidence
922
923    The server calculates the shared context key K, and verifies the
924    client's evidence M1.
925
926    K, on the server's side is computed as follows:
927
928       u = H(A | B);
929
930       S = ((A * (v ** u)) ** b) % N;
931
932       K = H(S);
933
934    where:
935
936       A    is the client's ephemeral public key,
937
938       B    is the server's ephemeral public key,
939
940       v    is the stored password verifier value,
941
942       b    is the server's ephemeral private key,
943
944       N    is the safe prime modulus,
945
946       H()  is the result of digesting the designated input/data with the
947       chosen underlying Message Digest Algorithm function.
948
949
950
951
952 Burdis & Naffah        Expires November 28, 2003               [Page 17]
953 \f
954 Internet-Draft        SRP Authentication Mechanism              May 2003
955
956
957       *    is the multiplication operator,
958
959       **   is the exponentiation operator,
960
961       %    is the modulus operator,
962
963    If the client chose to activate the Confidentiality Protection
964    service in the Security Layer then the server MUST send the Initial
965    Vector sIV that the client will use to set up its encryption context.
966    (See Section 5.2 for details on the Confidentiality Protection
967    service and how sIV is generated.)  However, this element MAY be a
968    zero-length octet sequence if the client did not choose to activate
969    the Confidentiality Protection service.
970
971    If the server's policy allows re-using the parameters of this session
972    then it sets sid to a unique identifier for this session and sets ttl
973    to the number of seconds for which the session MAY be valid.  If the
974    server does not support re-using the parameters of this session then
975    it sets sid to the empty string and ttl to any value.  See Section
976    6.4 for more information on re-using negotiated parameters of a
977    previous session.
978
979    The server computes its evidence M2, which proves to the client that
980    it knows the shared context key K, as well as U, I and o, as follows:
981
982             H(   bytes(A)
983                | bytes(M1)
984                | bytes(K)
985                | bytes(H( bytes(I) ))
986                | bytes(H( bytes(o) ))
987                | bytes(sid)
988                | ttl
989             )
990
991    All parameters received from the client that are used as input to a
992    digest operation MUST be used as received.
993
994    The server sends:
995
996       { os(M2) | os(sIV) | sid | ttl }
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008 Burdis & Naffah        Expires November 28, 2003               [Page 18]
1009 \f
1010 Internet-Draft        SRP Authentication Mechanism              May 2003
1011
1012
1013 5. Security Layer
1014
1015    Depending on the options offered by the server and chosen by the
1016    client, the security layer may provide integrity protection, replay
1017    detection, and/or confidentiality protection.
1018
1019    The security layer can be thought of as a three-stage filter through
1020    which the data flows from the output of one stage to the input of the
1021    following one.  The first input is the original data, while the last
1022    output is the data after being subject to the transformations of this
1023    filter.
1024
1025    The data always passes through this three-stage filter, though any of
1026    the stages may be inactive.  Only when a stage is active would the
1027    output be different from the input.  In other words, if a stage is
1028    inactive, the octet sequence at the output side is an exact duplicate
1029    of the same sequence at the input side.
1030
1031    Schematically, the three-stage filter security layer appears as
1032    follows:
1033
1034                  +----------------------------+
1035                  |                            |     I/ p1
1036          p1  --->| Confidentiality protection |---+
1037                  |                            |   | A/ c
1038                  +----------------------------+   |
1039                                                   |
1040              +------------------------------------+
1041              |
1042              |   +----------------------------+
1043              |   |                            |     I/ p2
1044          p2  +-->|      Replay detection      |---+
1045                  |                            |   | A/ p2 | q
1046                  +----------------------------+   |
1047                                                   |
1048              +------------------------------------+
1049              |
1050              |   +----------------------------+
1051              |   |                            |     I/ p3
1052          p3  +-->|    Integrity protection    |--->
1053                  |                            |     A/ p3 | C
1054                  +----------------------------+
1055
1056    where:
1057
1058       p1, p2 and p3 are the input octet sequences at each stage,
1059
1060       I/ denotes the output at the end of one stage if/when the stage is
1061
1062
1063
1064 Burdis & Naffah        Expires November 28, 2003               [Page 19]
1065 \f
1066 Internet-Draft        SRP Authentication Mechanism              May 2003
1067
1068
1069       inactive or disabled,
1070
1071       A/ denotes the output at the end of one stage if/when the stage is
1072       active or enabled,
1073
1074       c is the encrypted (sender-side) or decrypted (receiver-side)
1075       octet sequence.  c1 shall denote the value computed by the sender,
1076       while c2 shall denote the value computed by the receiver.
1077
1078       q is a four-octet scalar quantity representing a sequence number,
1079
1080       C is the Message Authentication Code.  C1 shall denote the value
1081       of the MAC as computed by the sender, while C2 shall denote the
1082       value computed by the receiver.
1083
1084    It is worth noting here that both client and server have their own
1085    distinct security contexts, including distinct encryption and
1086    decryption sub-contexts.  In principal, nothing in this specification
1087    should prevent an implementation from supporting asynchronous
1088    connections.
1089
1090 5.1 Cryptographic Primitives
1091
1092 5.1.1 Pseudo Random Number Generator
1093
1094    This mechanism requires random data to be generated for use in:
1095
1096    1.  The CALG key material for both the client and server when the
1097        Confidentiality Protection service is enabled.
1098
1099    2.  The IALG key material for both the client and server when the
1100        Integrity Protection service is enabled.
1101
1102    The PRNG used in this specification is based on the pseudo-random
1103    function described in section 5 of [UMAC].  It uses the [AES]
1104    algorithm, in its 128-bit key size variant, as the underlying
1105    symmetric key block cipher for its operations.
1106
1107    A formal description of this PRNG follows:
1108
1109    o  Initialisation
1110
1111       *  SK: a 16-octet sequence (seeding key to AES)
1112
1113    o  Input
1114
1115       *  n: a positive integer
1116
1117
1118
1119
1120 Burdis & Naffah        Expires November 28, 2003               [Page 20]
1121 \f
1122 Internet-Draft        SRP Authentication Mechanism              May 2003
1123
1124
1125    o  Output
1126
1127       *  Y: an n-octet sequence
1128
1129    o  Algorithm
1130
1131       *  (initialisation)
1132
1133          1.  Initialise an AES instance for encryption with the first 16
1134              octets of SK as its user-supplied key material.  Let "aes"
1135              be that instance; i.e. aes = AES(SK, ENCRYPTION);
1136
1137          2.  Initialise T to be an all-zero 16-octet long sequence;
1138
1139       *  (for every input)
1140
1141          1.  Initialise "remaining" to n;
1142
1143          2.  Initialise Y to be a 0-length octet sequence;
1144
1145          3.  while (remaining > 0) do
1146
1147              1.  T = aes(T);
1148
1149              2.  Append m octets from T to Y, where m is the minimum of
1150                  16 and remaining;
1151
1152              3.  Subtract 16 from remaining;
1153
1154          4.  return Y;
1155
1156    In this document, "PRNG(key,n)" will refer to this algorithm, with
1157    the initialisation parameter SK set to be the octets of the specified
1158    key, returning n bits of pseudo-random data.  For example,
1159    "PRNG(K,n)" will refer to this algorithm, with the initialisation
1160    parameters SK set to the shared context key K computed by the SRP
1161    calculations (see Section 4.4 and Section 4.5), returning n bits of
1162    pseudo-random data.
1163
1164    This algorithm MAY also be used as part of the SRP calculations to
1165    generate the required "a" and "b" parameters used in creating the
1166    client and server ephemeral private keys ("A" and "B"), or to
1167    generate the cn and sn parameters used in session re-use, or to
1168    generate the initial vectors sIV and cIV used to set up the
1169    encryption contexts. In this case the initialisation parameter SK can
1170    be any 16-octet sequence (e.g. multiple representations of the
1171    time-of-day).
1172
1173
1174
1175
1176 Burdis & Naffah        Expires November 28, 2003               [Page 21]
1177 \f
1178 Internet-Draft        SRP Authentication Mechanism              May 2003
1179
1180
1181    If the same PRNG instance is used for both these calculations and the
1182    calculations in this specification, it MUST be re-initialised with
1183    the shared context key K before any of the latter calculations are
1184    performed.
1185
1186 5.1.2 Key Derivation Function
1187
1188    During the authentication phase, both parties compute the shared
1189    context key K (see Section 4.4 for the client, and Section 4.5 for
1190    the server sides respectively).  The length of K is s bits, where "s"
1191    is the output length of the chosen underlying Message Digest
1192    Algorithm used in the SRP calculations (see "mda" option in Section
1193    4.3).
1194
1195    When Confidentiality Protection is required, and the length of K is
1196    not equal to the length of the user-supplied key material needed to
1197    initialise the chosen Confidentiality Algorithm (CALG), the peers
1198    MUST apply the Key Derivation Function (KDF) in order to obtain
1199    enough data for this purpose.
1200
1201    Similarly, when Integrity Protection is required, and the length of K
1202    is not equal to the required length of the key material needed to
1203    initialise the chosen Integrity Algorithm (IALG), the peers MUST
1204    apply the Key Derivation Function (KDF) in order to obtain enough
1205    data for this purpose too.
1206
1207    If the KDF is required for both the key used with the CALG and the
1208    key used with the IALG then it is first applied for the CALG key and
1209    thereafter for the IALG key.
1210
1211    We define this KDF as:
1212
1213       Km = KDF(n)
1214
1215    where:
1216
1217       Km  is the required key material,
1218
1219       K   is the shared context key, and
1220
1221       n   is the required length of Km.
1222
1223    The following steps describe the KDF algorithm:
1224
1225       If length of K is greater than or equal to n, then
1226
1227          Let Km be the first n bytes of K;
1228
1229
1230
1231
1232 Burdis & Naffah        Expires November 28, 2003               [Page 22]
1233 \f
1234 Internet-Draft        SRP Authentication Mechanism              May 2003
1235
1236
1237       Else
1238
1239          Let Km = PRNG(K, n);
1240
1241       return Km
1242
1243
1244 5.2 Confidentiality Protection
1245
1246    The plaintext data octet sequence p1 is encrypted using the chosen
1247    confidentiality algorithm (CALG) with key size m, initialised for
1248    encryption with the key material Kc obtained as follows:
1249
1250       Kc = KDF(m)
1251
1252       c1 = CALG(Kc, ENCRYPTION)( bytes(p1) )
1253
1254    On the receiving side, the ciphertext data octet sequence p1 is
1255    decrypted using the chosen confidentiality algorithm (CALG)
1256    initialised for decryption, with the key Kc obtained by a similar
1257    process:
1258
1259       Kc = KDF(m)
1260
1261       c2 = CALG(Kc, DECRYPTION)( bytes(p1) )
1262
1263    The designated CALG symmetric-key block cipher MUST be used in OFB
1264    (Output Feedback Block) mode in the ISO variant, as described in
1265    [HAC], algorithm 7.20.
1266
1267    Let k be the block size of the chosen symmetric key block cipher
1268    algorithm; e.g. for AES this is 128 bits or 16 octets. The OFB mode
1269    used shall have a block size of k.
1270
1271    It is recommended that block ciphers operating in OFB mode be used
1272    with an Initial Vector (the mode's IV).  In such a mode of operation
1273    - OFB with key re-use - the IV need not be secret.  For the mechanism
1274    described in this document, the server MUST use cIV received from the
1275    client as the Initial Vector when initialising its encryption
1276    context, and the client MUST use sIV received from the server as the
1277    Initial Vector when initialising its encryption context.  These
1278    Initial Vectors are generated as:
1279
1280       cIV = prng(k);
1281
1282       sIV = prng(k);
1283
1284    where:
1285
1286
1287
1288 Burdis & Naffah        Expires November 28, 2003               [Page 23]
1289 \f
1290 Internet-Draft        SRP Authentication Mechanism              May 2003
1291
1292
1293       prng() is a random number generation function that outputs k
1294       octets of data,
1295
1296       k      is the block size of the chosen symmetric key block cipher
1297       algorithm
1298
1299    The input data to the confidentiality protection algorithm shall be a
1300    multiple of the symmetric key block cipher block size k.  When the
1301    input length is not a multiple of k octets, the data shall be padded
1302    according to the following scheme (described in [PKCS7] which itself
1303    is based on [RFC-1423]):
1304
1305       Assuming the length of the input is l octets, (k - (l mod k))
1306       octets, all having the value (k - (l mod k)), shall be appended to
1307       the original data.  In other words, the input is padded at the
1308       trailing end with one of the following sequences:
1309
1310
1311
1312                    01 -- if l mod k = k-1
1313                   02 02 -- if l mod k = k-2
1314                             ...
1315                             ...
1316                             ...
1317                 k k ... k k -- if l mod k = 0
1318
1319       The padding can be removed unambiguously since all input is padded
1320       and no padding sequence is a suffix of another.  This padding
1321       method is well-defined if and only if k < 256 octets, which is the
1322       case with symmetric block ciphers today, and in the forseeable
1323       future.
1324
1325    The output of this stage, when it is active, is:
1326
1327       at the sending side: CALG(Kc, ENCRYPT)( bytes(p1) )
1328
1329       at the receiving side: CALG(Kc, DECRYPT)( bytes(p1) )
1330
1331
1332 5.3 Replay Detection
1333
1334    A sequence number q is incremented every time a message is sent to
1335    the peer.
1336
1337    The output of this stage, when it is active, is:
1338
1339       p2 | q
1340
1341
1342
1343
1344 Burdis & Naffah        Expires November 28, 2003               [Page 24]
1345 \f
1346 Internet-Draft        SRP Authentication Mechanism              May 2003
1347
1348
1349    At the other end, the receiver increments its instance of the
1350    sequence number.  This new value of the sequence number is then used
1351    in the integrity protection transformation, which must also be active
1352    as described in Section 4.3.  See Section 6.3 for more details.
1353
1354 5.4 Integrity Protection
1355
1356    When the Integrity Protection stage is active, a message
1357    authentication code C is computed using the chosen integrity
1358    protection algorithm (IALG) as follows:
1359
1360    o  the IALG is initialised (once) with the key material Ki of size n
1361       (the required key size of the chosen IALG); i.e. Ki = KDF(n),
1362
1363    o  the IALG is updated with every exchange of the sequence p3,
1364       yielding the value C and a new IALG context for use in the
1365       following exchange.
1366
1367    At the other end, the receiver computes its version of C, using the
1368    same transformation, and checks that its value is equal to that
1369    received. If the two values do not agree, the receiver MUST signal an
1370    exception and abort.
1371
1372    The output of this stage, when it is active, is then:
1373
1374       IALG(Ki)( bytes(p3) )
1375
1376
1377 5.5 Summary of Security Layer Output
1378
1379    The following table shows the data exchanged by the security layer
1380    peers, depending on the possible legal combinations of the three
1381    security services in operation:
1382
1383       CP   IP   RD   Peer sends/receives
1384
1385       I    I    I    { eos(p) }
1386       I    A    I    { eos(p) | os( IALG(Ki)( bytes(p) ) ) }
1387       I    A    A    { eos(p) | os( IALG(Ki)( bytes(p) | bytes(q)) ) }
1388       A    I    I    { eos(c) }
1389       A    A    I    { eos(c) | os( IALG(Ki)( bytes(c) ) ) }
1390       A    A    A    { eos(c) | os( IALG(Ki)((bytes(c) | bytes(q)) )}
1391
1392    where
1393
1394       CP    Confidentiality protection,
1395
1396       IP    Integrity protection,
1397
1398
1399
1400 Burdis & Naffah        Expires November 28, 2003               [Page 25]
1401 \f
1402 Internet-Draft        SRP Authentication Mechanism              May 2003
1403
1404
1405       RD    Replay detection,
1406
1407       I     Security service is Inactive/disabled,
1408
1409       A     Security service is Active/enabled,
1410
1411       p     The original plaintext,
1412
1413       q     The sequence number.
1414
1415       c     The enciphered input obtained by either:
1416
1417          CALG(Kc, ENCRYPT)( bytes(p) ) at the sender's side, or
1418
1419          CALG(Kc, DECRYPT)( bytes(p) ) at the receiver's side
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456 Burdis & Naffah        Expires November 28, 2003               [Page 26]
1457 \f
1458 Internet-Draft        SRP Authentication Mechanism              May 2003
1459
1460
1461 6. Discussion
1462
1463 6.1 Mandatory Algorithms
1464
1465    The algorithms specified as mandatory were chosen for utility and
1466    availablity.  We felt that a mandatory confidentiality and integrity
1467    protection algorithm for the security layer and a mandatory Message
1468    Digest Algorithm for SRP calculations should be specified to ensure
1469    interoperability between implementations of this mechanism:
1470
1471    o  The SHA-160 Message Digest Algorithm was chosen as an underlying
1472       algorithm for SRP calculations because this allows for easy
1473       interoperability with other SRP-based tools that use the SRP-SHA1
1474       protocol described in section 3 of [RFC-2945] and create their
1475       password files using this algorithm.
1476
1477    o  The HMAC algorithm was chosen as an integrity algorithm because it
1478       is faster than MAC algorithms based on secret key encryption
1479       algorithms [RFC-2847].
1480
1481    o  AES was chosen as a symmetric-key block cipher because it has
1482       undergone thorough scrutiny by the best cryptographers in the
1483       world.
1484
1485    Since confidentiality protection is optional, this mechanism should
1486    be usable in countries that have strict controls on the use of
1487    cryptography.
1488
1489 6.2 Modulus and Generator Values
1490
1491    It is RECOMMENDED that the server use values for the modulus N and
1492    generator g chosen from those listed in Appendix A so that the client
1493    can avoid expensive constraint checks, since these predefined values
1494    already meet the constraints described in [RFC-2945]:
1495
1496       "For maximum security, N should be a safe prime (i.e. a number of
1497       the form N = 2q + 1, where q is also prime).  Also, g should be a
1498       generator modulo N (see [SRP] for details), which means that for
1499       any X where 0 < X < N, there exists a value x for which g**x == X
1500       (mod N).
1501
1502    If other values are used for N and g then these values SHOULD undergo
1503    the specified constraint checks.
1504
1505 6.3 Replay Detection Sequence Number Counters
1506
1507    The mechanism described in this document allows the use of a Replay
1508    Detection security service that works by including sequence number
1509
1510
1511
1512 Burdis & Naffah        Expires November 28, 2003               [Page 27]
1513 \f
1514 Internet-Draft        SRP Authentication Mechanism              May 2003
1515
1516
1517    counters in the message authentication code (MAC) created by the
1518    Integrity Protection service.  As noted in Section 4.3 integrity
1519    protection is always activated when the Replay Detection service is
1520    activated.
1521
1522    Both the client and the server keep two sequence number counters.
1523    Each of these counters is a 32-bit unsigned integer initialised with
1524    a Starting Value and incremented by an Increment Value with every
1525    successful transmission of a data buffer through the security layer.
1526    The Sent counter is incremented for each buffer sent through the
1527    security layer. The Received counter is incremented for each buffer
1528    received through the security layer.  If the value of a sequence
1529    number counter exceeds 2**32-1 it wraps around and starts from zero
1530    again.
1531
1532    When a sender sends a buffer it includes the value of its Sent
1533    counter in the computation of the MAC accompanying each integrity
1534    protected message.  When a recipient receives a buffer it uses the
1535    value of it's Received counter in its computation of the integrity
1536    protection MAC for the received message.  The recipient's Received
1537    counter must be the same as the sender's Sent counter in order for
1538    the received and computed MACs to match.
1539
1540    This specification assumes that for each sequence number counter the
1541    Starting Value is ZERO, and that the Increment Value is ONE.  These
1542    values do not affect the security or the intended objective of the
1543    replay detection service, since they never travel on the wire.
1544
1545 6.4 Re-using the Parameters of a Previous Session
1546
1547    Re-using the parameters of a previous session enables the client and
1548    server to avoid the overhead of the full authentication exchange
1549    where the client and server communicate more than once during a
1550    server-specified time period.
1551
1552    Servers are not required to support re-using the parameters of the
1553    current session in future sessions.  If they do not wish to support
1554    this then they send an empty string for the session identifier (sid).
1555    However, if the server's policy allows for the parameters of the
1556    current session to be re-used later, it generates a session
1557    identifier (sid) that will uniquely identify the session within the
1558    specified time period (ttl).  The time period (ttl) is specified in
1559    seconds and only gives an indication to the client how long the
1560    session  may be valid. The server is not required to ensure that the
1561    session is valid for this time period. Note that a ttl of 0 indicates
1562    an indeterminate time period.
1563
1564    To avoid session hijacking, servers SHOULD NOT indicate that a
1565
1566
1567
1568 Burdis & Naffah        Expires November 28, 2003               [Page 28]
1569 \f
1570 Internet-Draft        SRP Authentication Mechanism              May 2003
1571
1572
1573    session may be re-used unless a security layer with integrity
1574    protection and/or confidentiality protection has been negotiated.
1575
1576    Clients are not required to support re-using the parameters of
1577    previous sessions.  If they do not wish to support it or they do not
1578    wish to re-use the parameters of a previous session then they send
1579    the empty string as the value for the session identifier (sid) and
1580    send a zero-length octet sequence for the nonce (cn).  If they do
1581    support it and wish to use the parameters of a previous session then
1582    they send the session identifier for this session that they
1583    previously received from the server and calculate cn as described in
1584    Section 4.1.
1585
1586    If a client specifies a session id (sid) for a session that the
1587    server still considers valid then the server sends the octet FF, to
1588    indicate to the client that parameters of a previous session are
1589    being re-used, and the nonce (sn) calculated as described in Section
1590    4.2.  The client and server then calculate the new shared context key
1591    Kn for this session as follows:
1592
1593       Kn = H(K | cn | sn)
1594
1595    where:
1596
1597       K    is the shared context key for the previous session identified
1598       by sid.
1599
1600       H()  is the result of digesting the designated input/data with the
1601       Message Digest Algorithm function negotiated in the previous
1602       session identified by sid.
1603
1604    Then, if the confidentiality and/or integrity protection services
1605    were negotiated for the previous session, new keys for these services
1606    are derived using the KDF for use in this session.  (See Section
1607    5.1.2.)
1608
1609    If the server does not support re-using parameters of previous
1610    sessions or no longer considers the specified previous session to be
1611    valid, it ignores the session id specified by the client and
1612    continues the full authentication exchange.  However, the first
1613    element of the next buffer it sends is the octet 00, which indicates
1614    to the client that no parameters of a previous session will be
1615    re-used.
1616
1617
1618
1619
1620
1621
1622
1623
1624 Burdis & Naffah        Expires November 28, 2003               [Page 29]
1625 \f
1626 Internet-Draft        SRP Authentication Mechanism              May 2003
1627
1628
1629 7. SASL
1630
1631 7.1 Overview
1632
1633    SASL is described as follows [RFC-2222]:
1634
1635       The Simple Authentication and Security Layer (SASL) is a method
1636       for adding authentication support to connection-based protocols.
1637
1638    This document describes a mechanism that can be used within the SASL
1639    authentication framework.
1640
1641 7.2 Mechanism Name
1642
1643    The SASL mechanism name associated with this protocol is "SRP".
1644
1645 7.3 Security Layer
1646
1647    Section 3 of [RFC-2222] describes the operation of the security layer
1648    as follows:
1649
1650       "The security layer takes effect immediately following the last
1651       response of the authentication exchange for data sent by the
1652       client and the completion indication for data sent by the server.
1653       Once the security layer is in effect, the protocol stream is
1654       processed by the security layer into buffers of cipher-text.  Each
1655       buffer is transferred over the connection as a stream of octets
1656       prepended with a four octet field in network byte order that
1657       represents the length of the following buffer.  The length of the
1658       cipher-text buffer must be no larger than the maximum size that
1659       was defined or negotiated by the other side."
1660
1661
1662 7.4 Profile Considerations
1663
1664    As mentioned briefly in [RFC-2222], and detailed in [SASL] a SASL
1665    specification has three layers: (a) a protocol definition using SASL
1666    known as the "Profile", (b) a SASL mechanism definition, and (c) the
1667    SASL framework.
1668
1669    Point (3) in section 5 of [SASL] ("Protocol profile requirements")
1670    clearly states that it is the responsibility of the Profile to define
1671    "...how the challenges and responses are encoded, how the server
1672    indicates completion or failure of the exchange, how the client
1673    aborts an exchange, and how the exchange method interacts with any
1674    line length limits in the protocol."
1675
1676    The username entity, referenced as U throughout this document, and
1677
1678
1679
1680 Burdis & Naffah        Expires November 28, 2003               [Page 30]
1681 \f
1682 Internet-Draft        SRP Authentication Mechanism              May 2003
1683
1684
1685    used by the server to locate the password data, is assumed to travel
1686    "in the clear," meaning that no transformation is applied to its
1687    contents. This assumption was made to allow the same SRP password
1688    files to be used in this mechanism, as those used with other SRP
1689    applications and tools.
1690
1691    A Profile may decide, for privacy or other reason, to disallow such
1692    information to travel in the clear, and instead use a hashed version
1693    of U, or more generally a transformation function applied to U; i.e.
1694    f(U).  Such a Profile would require additional tools to add the
1695    required entries to the SRP password files for the new value(s) of
1696    f(U).  It is worth noting too that if this is the case, and the same
1697    user shall access the server through this mechanism as well as
1698    through other SRP tools, then at least two entries, one with U and
1699    the other with f(U) need to be present in the SRP password files if
1700    those same files are to be used for both types of access.
1701
1702 7.5 Example
1703
1704    The example below uses SMTP authentication [RFC-2554]. The base64
1705    encoding of challenges and responses, as well as the reply codes
1706    preceding the responses are part of the SMTP authentication
1707    specification, not part of this SASL mechanism itself.
1708
1709    "C:" and "S:" indicate lines sent by the client and server
1710    respectively.
1711
1712     S: 220 smtp.example.com ESMTP server ready
1713
1714     C: EHLO zaau.example.com
1715
1716     S: 250-smtp.example.com
1717     S: 250 AUTH SRP CRAM-MD5 DIGEST-MD5
1718
1719     C: AUTH SRP AAAADAAEdGVzdAAEdGVzdA==
1720
1721      with:
1722
1723        U = "test"
1724
1725        I = "test"
1726
1727     S: 334 AAABygEArGvbQTJKmpvxZt5eE4lYL69ytmUZh+4H/DGSlD21YFCjcynLtKCZ
1728     7YGT4HV3Z6E91SMSq0sDMQ3Nf0ip2gT9UOgIOWntt2ewz2CVF5oWOrNmGgX71fqq6Ck
1729     YqZYvC5O4Vfl5k+yXXuqoDXQK2/T/dHNZ0EHVwz6nHSgeRGsUdzvKl7Q6I/uAFna9IH
1730     pDbGSB8dK5B4cXRhpbnTLmiPh3SFRFI7UksNV9Xqd6J3XS7PoDLPvb9S+zeGFgJ5AE5
1731     Xrmr4dOcwPOUymczAQce8MI2CpWmPOo0MOCca41+Onb+7aUtcgD2J965DXeI21SX1R1
1732     m2XjcvzWjvIPpxEfnkr/cwABAgqsi3AvmIqdEbREALhtZGE9U0hBLTEsbWFuZGF0b3J
1733
1734
1735
1736 Burdis & Naffah        Expires November 28, 2003               [Page 31]
1737 \f
1738 Internet-Draft        SRP Authentication Mechanism              May 2003
1739
1740
1741     5PXJlcGxheSBkZXRlY3Rpb24scmVwbGF5IGRldGVjdGlvbixpbnRlZ3JpdHk9aG1hYy
1742     1zaGExLGludGVncml0eT1obWFjLW1kNSxjb25maWRlbnRpYWxpdHk9YWVzLGNvbmZpZ
1743     GVudGlhbGl0eT1jYXN0NSxjb25maWRlbnRpYWxpdHk9Ymxvd2Zpc2gsbWF4YnVmZmVy
1744     c2l6ZT0yMTQ3NDgzNjQz
1745
1746      with:
1747
1748        N = "21766174458617435773191008891802753781907668374255538511144
1749        6432246898862353838409572109090130860564015713997172358072665816
1750        4960647214841029141336415219736447718088739565548373811507267740
1751        2235101762521901569820740293149529620419333266262073471054548368
1752        7360395197024862265062488610602569718029849535611214426801576680
1753        0076142998822245709041387397397017192709399211475176516806361476
1754        1119615476233422096442783117971236371647333871414335895773474667
1755        3089670508070055093204247996784170368679283167612722742303140675
1756        4829113358247958306143957755934710196177140617368437852270348349
1757        5337037655006751328447510550299250924469288819"
1758
1759        g = "2"
1760
1761        s = "814819216327401865851972"
1762
1763        L = "mda=sha-1,mandatory=replay_detection,replay_detection,integ
1764        rity=hmac-sha1,integrity=hmac-md5,confidentiality=aes,confidenti
1765        ality=cast5,confidentiality=blowfish,maxbuffersize=2147483643"
1766
1767     C: AAABYwEAAp5q/4zhXoTUzXBscozN97SWgfDcAImIk3lNHNvd0b+Dr7jEm6upXblZ
1768     T5sL9mPgFsejlIh+B/eCu/HvzWCrXj6ylPZv8dy3LCH3LIORqQ45S7Lsbmrrg/dukDh
1769     4tZCJMLD4r3evzaY8KVhtJeLMVbeXuh4JljKP42Ll59Lzwf8jfPh4+4Lae1rpWUCL9D
1770     ueKcY+nN+xNHTit/ynLATxwL93P6+GoGY4TkUbUBfjiI1+rAMvyMDMw5XozGy07FOEc
1771     ++U0iPeXCQP4MT5FipOUoz8CYX7J1LbaXp2WJuFHlkyVXF7oCoyHbhld/5CfR3o6q/B
1772     /x9+yZRqaHH+JfllOgBfbWRhPVNIQS0xLHJlcGxheSBkZXRlY3Rpb24saW50ZWdyaXR
1773     5PWhtYWMtbWQ1LGNvbmZpZGVudGlhbGl0eT1ibG93ZmlzaCxtYXhidWZmZXJzaXplPT
1774     IxNDc0ODM2NDM=
1775
1776      with:
1777
1778        A = "33059541846712102497463123211304342021934496372587869281515
1779        9695658237779884462777478850394977744553746930451895815615888405
1780        0562780707370878253753979367019077142882237029766166623275718227
1781        6555389834190840322081091599089081947324537907613924707058150037
1782        7802790776231793962143786411792516760030102436603621046541729396
1783        6890613394379900527412007068242559299422872893332111365840536495
1784        1858834742328835373387573188369956379881606380890675411966073665
1785        1106922002294035533470301541999274557200666703389531481794516625
1786        4757418442215980634933876533189969562613241499465295849832999091
1787        40398081321840949606581251320320995783959866"
1788
1789
1790
1791
1792 Burdis & Naffah        Expires November 28, 2003               [Page 32]
1793 \f
1794 Internet-Draft        SRP Authentication Mechanism              May 2003
1795
1796
1797        o = mda=sha-1,replay_detection,integrity=hmac-md5,confidentialit
1798        y=blowfish,maxbuffersize=2147483643"
1799
1800     S: 334 AAABAgEAOUKbXpnzMhziivGgMwm+FS8sKGSvjh5M3D+80RF/5z9rm0oPoi4+
1801     pF83fueWn4Hz9M+muF/22PHHZkHtlutDrtapj4OtirdxC21fS9bMtEh3F0whTX+3mPv
1802     thw5sk11turandHiLvcUZOgcrAGIoDKcBPoGyBud+8bMgpkf/uGfyBM2nEX/hV+oGgg
1803     X+LiHjmkxAJ3kewfQPH0eV9ffEuuyu8BUcBXkJsS6l7eWkuERSCttVOi/jS031c+CD/
1804     nuecUXYiF8IYzW03rbcwYhZzifmTi3VK9C8zG2K1WmGU+cDKlZMkyCPMmtCsxlbgE8z
1805     SHCuCiOgQ35XhcA0Qa0C3Q==
1806
1807      with:
1808
1809        B: "722842847565031844205403087285424428589273458129750231766015
1810        4465607827529853239240118185263492617243523916106658696965596526
1811        8585300845435562962039149169549800169184521786717633959469278439
1812        8771344445002432579509292115598435685062882631760796416554562980
1813        8475896198325835507901319556929511421472132184990365213059654962
1814        7218189966140113906545856088040473723048909402258929560823932725
1815        2022154114087913895411927676707073040281136096806681758265221209
1816        8822374723416364340410020172215773934302794679034424699999611678
1817        9730443114919539575466941344964841591072763617954717789621871251
1818        71089179399349194452686682517183909017223901"
1819
1820     C: AAAAFRTkoju6xGP+zH89iaDWIFjfIKt5Kg==
1821
1822     S: 235 Authentication successful.
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848 Burdis & Naffah        Expires November 28, 2003               [Page 33]
1849 \f
1850 Internet-Draft        SRP Authentication Mechanism              May 2003
1851
1852
1853 8. GSS-API
1854
1855 8.1 Overview
1856
1857    The GSS-API is described as follows:
1858
1859       The Generic Security Service Application Program Interface
1860       (GSS-API), Version 2, as defined in [RFC-2078], provides security
1861       services to callers in a generic fashion, supportable with a range
1862       of underlying mechanisms and technologies and hence allowing
1863       source-level portability of applications to different
1864       environments.
1865
1866    According to [RFC-2078] there are certain specifications related to
1867    the GSS-API that are:
1868
1869       "documents defining token formats, protocols, and procedures to be
1870       implemented in order to realize GSS-API services atop particular
1871       security mechanisms"
1872
1873    This specification is such a document - it defines a security
1874    mechanism that can be used with the GSS-API authentication framework.
1875
1876 8.2 Terminology
1877
1878    The tokens referred to in the GSS-API specification [RFC-2078] are
1879    the same as the buffers referred to in this document.
1880
1881 8.3 Initial Token
1882
1883    [RFC-2078] states that:
1884
1885       The first context-level token obtained from GSS_Init_sec_context()
1886       is required to indicate at its very beginning a
1887       globally-interpretable mechanism identifier, i.e., an Object
1888       Identifier (OID) of the security mechanism.  The remaining part of
1889       this token as well as the whole content of all other tokens are
1890       specific to the particular underlying mechanism used to support
1891       the GSS-API.
1892
1893    To satisfy this requirement and make use of the mechanism described
1894    in this document as a GSS-API mechanism, the following octets must be
1895    prefixed to the first buffer sent as part of the protocol described
1896    in Section 4:
1897
1898       [ 60 08 06 06 2B 06 01 05 05 08 ]
1899
1900    Each octet is written as a pair of hex digits - see Section 2.
1901
1902
1903
1904 Burdis & Naffah        Expires November 28, 2003               [Page 34]
1905 \f
1906 Internet-Draft        SRP Authentication Mechanism              May 2003
1907
1908
1909    These octets represent the encoding of the GSS-API mechanism
1910    identifier as per section 3.1 of [RFC-2078].  The OID for this
1911    mechanism is iso.org.dod.internet.security.mechanisms.srp
1912    (1.3.6.1.5.5.8).
1913
1914    Note that it is not possible to make this requirement part of the
1915    security protocol itself, because other authentication frameworks
1916    have different requirements for the initial octets in a mechanism
1917    buffer.
1918
1919 8.4 Security Layer
1920
1921    This mechanism does not provide distinct replay detection and
1922    sequencing services as part of the security layer.  Both of these
1923    services are provided through the use of sequence numbers in
1924    integrity protected messages.  If a GSS-API caller sets either the
1925    replay_det_req_flag or the sequence_req_flag (section 1.2.3 of
1926    [RFC-2078]) then this selects the "replay_detection" security
1927    service.
1928
1929    This mechanism does not make use of any channel binding data (section
1930    1.1.6 of [RFC-2078]).
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960 Burdis & Naffah        Expires November 28, 2003               [Page 35]
1961 \f
1962 Internet-Draft        SRP Authentication Mechanism              May 2003
1963
1964
1965 9. EAP
1966
1967 9.1 Overview
1968
1969    The Extensible Authentication Protocol (EAP) [RFC-2284] is an
1970    authentication framework that supports multiple authentication
1971    mechanisms.  It is used with link layer protocols such as PPP and the
1972    IEEE-802 wired and wireless protocols.
1973
1974 9.2 Terminology
1975
1976    EAP uses the following terms to describe the entities involved in the
1977    authentication exchange [rfc2284bis]:
1978
1979    Authenticator: The entity that initiates EAP authentication in order
1980       to authenticate a Peer.
1981
1982    Peer: The entity that responds to requests from the Authenticator.
1983
1984    In this document, the Server corresponds to the Authenticator and the
1985    Client corresponds to the Peer.
1986
1987 9.3 Method Details
1988
1989    The EAP authentication method described in this document has the
1990    following properties:
1991
1992    Method Name: SRP
1993
1994    Method Type: 7
1995
1996    As described in section 2 of [rfc2284bis] the EAP authentication
1997    exchange is initiated by the Authenticator sending a Request packet
1998    to the peer with a Type field indicating the type of request.  The
1999    Peer responds with a corresponding Reply packet, and the
2000    Authenticator and Peer exchange additional corresponding Request and
2001    Reply packets until the Authenticator deems that the authentication
2002    exchange is successful and complete, whereafter the Authenticator
2003    sends a Success packet.  However, if at any time the Authenticator
2004    deems the authentication exchange to be unsuccessful it sends a
2005    Failure packet to indicate this.
2006
2007    When using this authentication method, the Type field in all Request
2008    and Reply packets is set to 7 and the Type Data is as described in
2009    Section 4 and the rest of this document.  The diagrams below
2010    illustrate the EAP packet exchanges for this authentication method.
2011
2012    The following exchange occurs when a new session is negotiated
2013
2014
2015
2016 Burdis & Naffah        Expires November 28, 2003               [Page 36]
2017 \f
2018 Internet-Draft        SRP Authentication Mechanism              May 2003
2019
2020
2021    between the client and the server.  It will also occur when the
2022    client requests re-use of the parameters of a previous session and
2023    either the server does not support such re-use or no longer considers
2024    the previous session to be valid:
2025
2026     Peer (client)                            Authenticator (server)
2027
2028     <------------  Request [ 7, { } ]  ----------------------------
2029
2030     ----  Reply [ 7, { U, I, sid, cn } ] ------------------------->
2031
2032     <------------  Request [ 7, { 00, N, g, s, B, L } ]  ----------
2033
2034     ----  Reply [ 7, { A, M1, o, cIV } ]  ------------------------>
2035
2036     <------------  Request [ 7, { M2, sIV, sid, ttl } ]  ----------
2037
2038     ----  Reply [ 7, { } ]  -------------------------------------->
2039
2040    The following exchange occurs when the client requests that the
2041    parameters negotiated in a previous session be re-used in this
2042    session, but with a newly derived shared context key, and the server
2043    agrees:
2044
2045     Peer (client)                            Authenticator (server)
2046
2047     <-----------------------------  Request [ 7, { } ]  -----------
2048
2049     ---------  Reply [ 7, { U, I, sid, cn } ]  ------------------->
2050
2051     <-----------------------------  Request [ 7, { FF, sn } ]  ----
2052
2053     ---------  Reply [ 7, { } ]  --------------------------------->
2054
2055    If a security layer is negotiated then the payloads of all subsequent
2056    lower layer packets sent over the link are protected using the
2057    negotiated security services.
2058
2059 9.4 Security Claims
2060
2061    As required by section 7.2 of [rfc2284bis], these are the security
2062    claims made by this authentication method indicating the level of
2063    security provided:
2064
2065    Intended Use: Wired networks, including PPP, PPPOE, and IEEE-802
2066       wired media.  Use over the Internet or with wireless media only
2067       when the recommended security layer has been negotiated.
2068
2069
2070
2071
2072 Burdis & Naffah        Expires November 28, 2003               [Page 37]
2073 \f
2074 Internet-Draft        SRP Authentication Mechanism              May 2003
2075
2076
2077    Mechanism: Passphrase
2078
2079    Mutual authentication: Yes.  This mechanism requires mutual
2080       authentication.
2081
2082    Integrity protection: Yes.  The calculations of evidence that the
2083       shared context key is known - M1 sent by the client and M2 sent by
2084       the server - include the  protocol elements received from the
2085       other party, so any modification by a third party will be
2086       detected.  SRP itself is resistent to known active and passive
2087       attacks - see [SRP].
2088
2089    Replay protection: Yes.  Both the client and the server randomly
2090       generate ephemeral private keys (a and b) that are used in the SRP
2091       calculations, but are not publicly revealed.  New ephemeral
2092       private keys are generated for each session making replay attacks
2093       infeasible.
2094
2095    Confidentiality: No.
2096
2097    Key Derivation: No.
2098
2099    Dictionary attack protection: Yes. From [SRP]: "An attacker with
2100       neither the user's password nor the host's password file cannot
2101       mount a dictionary attack on the password".
2102
2103    Fast reconnect: Yes.  An optional, optimised alternate authentication
2104       exchange is available where the parameters of a previously
2105       negotiated session are re-used, but with a newly derived shared
2106       context key - see Section 6.4.
2107
2108    Man-in-the-Middle resistance: Yes.  The calculations of evidence - M1
2109       sent by the client and M2 sent by the server - include the
2110       protocol elements received from the other party, so any
2111       modification by a third party will be detected.  SRP itself is
2112       resistent to known active attacks, including man-in-the-middle
2113       attacks - see [SRP].
2114
2115    Acknowledged result indications: Yes.  When the client receives M2
2116       from the server it knows that the server has verified that the
2117       evidence (M1) it presented to prove its knowledge of the shared
2118       context key is correct, so it knows that it is authenticated to
2119       the server. When the server receives the empty response from the
2120       client at the end of the authentication exchange, it knows that
2121       the client has verified that the evidence (M2) it presented to
2122       prove its knowledge of the shared context key is correct, so it
2123       knows that it is authenticated to the client.  Similarly for
2124       session re-use where the client receives the server nonce (sn)
2125
2126
2127
2128 Burdis & Naffah        Expires November 28, 2003               [Page 38]
2129 \f
2130 Internet-Draft        SRP Authentication Mechanism              May 2003
2131
2132
2133       from the server, and the server receives the final empty response
2134       from the client.
2135
2136    Key hierarchy: N/A
2137
2138    Key strength: The shared context key (K) negotiated between the
2139       client and server has a length of s, where "s" is the output
2140       length of the chosen underlying Message Digest Algorithm used in
2141       the SRP calculations (see "mda" option in Section 4.3).  For
2142       example, the recommended Message Digest Algorithm SHA-160 has an
2143       output length of 160 bits, so in this case the length of K would
2144       be 160 bits.  Keys for the confidentiality and integrity
2145       protection services are derived from K - see Section 5.1.2 - and
2146       have sizes appropriate for the algorithms being used.  Note that
2147       all Message Digest Algorithms used with this mechanism MUST have
2148       an output of at least 16 bytes (see "mda" option in Section 4.3),
2149       which means that the shared context key will always have a length
2150       of at least 128 bits.
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184 Burdis & Naffah        Expires November 28, 2003               [Page 39]
2185 \f
2186 Internet-Draft        SRP Authentication Mechanism              May 2003
2187
2188
2189 10. Security Considerations
2190
2191    This mechanism relies on the security of SRP, which bases its
2192    security on the difficulty of solving the Diffie-Hellman problem in
2193    the multiplicative field modulo a large safe prime.  See section 4
2194    "Security Considerations" of [RFC-2945], section 4 "Security
2195    analysis" of [SRP], and [SRP-6i].
2196
2197    This mechanism also relies on the security of the HMAC algorithm and
2198    the underlying hash function when integrity protection is used.
2199    Section 6 "Security" of [RFC-2104] discusses these security issues in
2200    detail.  Weaknesses found in MD5 do not impact HMAC-MD5 [DOBBERTIN].
2201
2202    U, I, A and o, sent from the client to the server, and N, g, s, B and
2203    L, sent from the server to the client, could be modified by an
2204    attacker before reaching the other party.  For this reason, these
2205    values are included in the respective calculations of evidence (M1
2206    and M2) to prove that each party knows the shared context key K.
2207    This allows each party to verify that these values were received
2208    unmodified.
2209
2210    The use of integrity protection is RECOMMENDED to detect message
2211    tampering and to avoid session hijacking after authentication has
2212    taken place.
2213
2214    Replay attacks may be avoided through the use of sequence numbers,
2215    because sequence numbers make each integrity protected message
2216    exchanged during a session different, and each session uses a
2217    different key.
2218
2219    Research [KRAWCZYK] shows that the order and way of combining message
2220    encryption (Confidentiality Protection) and message authentication
2221    (Integrity Protection) are important.  This mechanism follows the EtA
2222    (encrypt-then-authenticate) method and is "generically secure".
2223
2224    This mechanism uses a Pseudo-Random Number Generator (PRNG) for
2225    generating some of its parameters.  Section 5.1.1 describes a
2226    securely seeded, cryptographically strong PRNG implementation for
2227    this purpose.
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240 Burdis & Naffah        Expires November 28, 2003               [Page 40]
2241 \f
2242 Internet-Draft        SRP Authentication Mechanism              May 2003
2243
2244
2245 11. Acknowledgements
2246
2247    The following people provided valuable feedback in the preparation of
2248    this document:
2249
2250       Stephen Farrell <stephen.farrell@baltimore.ie>
2251
2252       Sam Hartman <hartmans@mit.edu>
2253
2254       Timothy Martin <tmartin@andrew.cmu.edu>
2255
2256       Alexey Melnikov <mel@messagingdirect.com>
2257
2258       Ken Murchison <ken@oceana.com>
2259
2260       Magnus Nystrom <magnus@rsasecurity.com>
2261
2262       David Taylor <DavidTaylor@forge.com.au>
2263
2264       Thomas Wu <tom@arcot.com>
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296 Burdis & Naffah        Expires November 28, 2003               [Page 41]
2297 \f
2298 Internet-Draft        SRP Authentication Mechanism              May 2003
2299
2300
2301 Normative References
2302
2303    [RFC-2078]
2304               Linn, J., "Generic Security Service Application Program
2305               Interface, Version 2", RFC 2078, January 1997, <http://
2306               www.ietf.org/rfc/rfc2078.txt>.
2307
2308    [RFC-2104]
2309               Krawczyk, H., "HMAC: Keyed-Hashing for Message
2310               Authentication", RFC 2104, February 1997, <http://
2311               www.ietf.org/rfc/rfc2104.txt>.
2312
2313    [RFC-2119]
2314               Bradner, S., "Key words for use in RFCs to Indicate
2315               Requirement Levels", BCP 0014, RFC 2119, March 1997,
2316               <http://www.ietf.org/rfc/rfc2119.txt>.
2317
2318    [RFC-2222]
2319               Myers, J., "Simple Authentication and Security Layer
2320               (SASL)", RFC 2222, October 1997, <http://www.ietf.org/rfc/
2321               rfc2222.txt>.
2322
2323    [RFC-2284]
2324               Blunk, L. and J. Vollbrecht, "PPP Extensible
2325               Authentication Protocol (EAP)", RFC 2284, March 1998,
2326               <http://www.ietf.org/rfc/rfc2284.txt>.
2327
2328    [rfc2284bis]
2329               Blunk, L., Vollbrecht, J., Aboba, B., Carlson, J. and H.
2330               Levkowetz, "Extensible Authentication Protocol (EAP), work
2331               in progress", May 2003, <http://www.ietf.org/
2332               internet-drafts/draft-ietf-eap-rfc2284bis-03.txt>.
2333
2334    [RFC-2945]
2335               Wu, T., "The SRP Authentication and Key Exchange System",
2336               RFC 2945, September 2000, <http://www.ietf.org/rfc/
2337               rfc2945.txt>.
2338
2339    [RFC-3454]
2340               Hoffman, P. and M. Blanchet, "Preparation of
2341               Internationalized Strings ("stringprep")", RFC 3454,
2342               December 2002, <http://www.ietf.org/rfc/rfc3454.txt>.
2343
2344    [SASL]     Myers, J., "Simple Authentication and Security Layer
2345               (SASL)", April 2002, <http://www.ietf.org/internet-drafts/
2346               draft-myers-saslrev-02.txt>.
2347
2348    [SASLprep]
2349
2350
2351
2352 Burdis & Naffah        Expires November 28, 2003               [Page 42]
2353 \f
2354 Internet-Draft        SRP Authentication Mechanism              May 2003
2355
2356
2357               Zeilenga, K., "SASLprep: Stringprep profile for user names
2358               and passwords, work in progress", May 2003, <http://
2359               www.ietf.org/internet-drafts/
2360               draft-ietf-sasl-saslprep-01.txt>.
2361
2362    [SRP]      Wu, T., "The Secure Remote Password Protocol, Proceedings
2363               of the 1998 Internet Society Network and Distributed
2364               System Security Symposium, San Diego, CA, Mar 1998, pp.
2365               97-111", March 1998, <http://srp.stanford.edu/ndss.html>.
2366
2367    [SRP-6i]   Wu, T., "SRP-6: Improvements and Refinements to the Secure
2368               Remote Password Protocol", October 2002, <http://
2369               srp.stanford.edu/srp6.ps>.
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408 Burdis & Naffah        Expires November 28, 2003               [Page 43]
2409 \f
2410 Internet-Draft        SRP Authentication Mechanism              May 2003
2411
2412
2413 Informative References
2414
2415    [AES]      National Institute of Standards and Technology, "Rijndael:
2416               NIST's Selection for the AES", December 2000, <http://
2417               csrc.nist.gov/encryption/aes/rijndael/Rijndael.pdf>.
2418
2419    [DOBBERTIN]
2420               Dobbertin, H., "The Status of MD5 After a Recent Attack",
2421               December 1996, <ftp://ftp.rsasecurity.com/pub/cryptobytes/
2422               crypto2n2.pdf>.
2423
2424    [HAC]      Menezes, A., van Oorschot, P. and S. Vanstone, "Handbook
2425               of Applied Cryptography", CRC Press, Inc., ISBN
2426               0-8493-8523-7, 1997, <http://www.cacr.math.uwaterloo.ca/
2427               hac/about/chap7.ps>.
2428
2429    [ISO-10646]
2430               International Standards Organization, "International
2431               Standard --Information technology-- Universal
2432               Multiple-Octet Coded Character Set (UCS) -- Part 1
2433               Architecture and Basic Multilingual Plane. UTF-8 is
2434               described in Annex R, adopted but not yet published.
2435               UTF-16 is described in Annex Q, adopted but not yet
2436               published.", ISO/IEC 10646-1, 1993.
2437
2438    [KRAWCZYK]
2439               Krawczyk, H., "The order of encryption and authentication
2440               for protecting communications (Or: how secure is SSL?)",
2441               June 2001, <http://eprint.iacr.org/2001/045/>.
2442
2443    [PKCS7]    RSA Data Security, Inc., "PKCS #7: Cryptographic Message
2444               Syntax Standard", Version 1.5, November 1993, <ftp://
2445               ftp.rsasecurity.com/pub/pkcs/ascii/pkcs-7.asc>.
2446
2447    [RFC-1423]
2448               Balenson, D., "Privacy Enhancement for Internet Electronic
2449               Mail: Part III: Algorithms, Modes, and Identifiers", RFC
2450               1423, February 1993, <http://www.ietf.org/rfc/
2451               rfc1423.txt>.
2452
2453    [RFC-2279]
2454               Yergeau, F., "UTF-8, a transformation format of Unicode
2455               and ISO 10646", RFC 2279, January 1998, <http://
2456               www.ietf.org/rfc/rfc2279.txt>.
2457
2458    [RFC-2440]
2459               Callas, J., Donnerhacke, L., Finney, H. and R. Thayer,
2460               "OpenPGP Message Format", RFC 2440, November 1998, <http:/
2461
2462
2463
2464 Burdis & Naffah        Expires November 28, 2003               [Page 44]
2465 \f
2466 Internet-Draft        SRP Authentication Mechanism              May 2003
2467
2468
2469               /www.ietf.org/rfc/rfc2440.txt>.
2470
2471    [RFC-2554]
2472               Myers, J., "SMTP Service Extension for Authentication",
2473               RFC 2554, March 1999.
2474
2475    [RFC-2629]
2476               Rose, M., "Writing I-Ds and RFCs using XML", RFC 2629,
2477               June 1999, <http://www.ietf.org/rfc/rfc2629.txt>.
2478
2479    [RFC-2847]
2480               Eisler, M., "LIPKEY - A Low Infrastructure Public Key
2481               Mechanism Using SPKM", RFC 2847, June 2000, <http://
2482               www.ietf.org/rfc/rfc2847.txt>.
2483
2484    [SCAN]     Hopwood, D., "Standard Cryptographic Algorithm Naming",
2485               June 2000, <http://www.eskimo.com/~weidai/scan-mirror/>.
2486
2487    [SRP-6]    Wu, T., "SRP Protocol Design", October 2002, <http://
2488               srp.stanford.edu/design.html>.
2489
2490    [SRPimpl]  Wu, T., "SRP: The Open Source Password Authentication
2491               Standard", March 1998, <http://srp.stanford.edu/srp/>.
2492
2493    [UMAC]     Black, J., Halevi, S., Krawczyk, H., Krovetz, T. and P.
2494               Rogaway, "UMAC: Fast and Secure Message Authentication,
2495               Advances in Cryptology - CRYPTO '99. Lecture Notes in
2496               Computer Science, vol. 1666, Springer-Verlag, 1999, pp.
2497               216-233", October 2000, <http://www.cs.ucdavis.edu/
2498               ~rogaway/umac/umac_proc.pdf>.
2499
2500    [UNICODE]  The Unicode Consortium, "The Unicode Standard, Version
2501               3.2.0, is defined by The Unicode Standard, Version 3.0, as
2502               amended by the Unicode Standard Annex #27: Unicode 3.1 and
2503               by the Unicode Standard Annex #28: Unicode 3.2.", March
2504               2002, <http://www.unicode.org/reports/tr28/tr28-3.html>.
2505
2506    [UNICODE-KC]
2507               Durst, D., "Unicode Standard Annex #15: Unicode
2508               Normalization Forms.", March 2001, <http://
2509               www.unicode.org/unicode/reports/tr15>.
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520 Burdis & Naffah        Expires November 28, 2003               [Page 45]
2521 \f
2522 Internet-Draft        SRP Authentication Mechanism              May 2003
2523
2524
2525 Authors' Addresses
2526
2527    Keith Burdis
2528    Rhodes University
2529    Computer Science Department
2530    Grahamstown  6139
2531    ZA
2532
2533    EMail: keith@rucus.ru.ac.za
2534
2535
2536    Raif S. Naffah
2537    Forge Research Pty. Limited
2538    Suite 116, Bay 9
2539    Locomotive Workshop,
2540    Australian Technology Park
2541    Cornwallis Street
2542    Eveleigh, NSW  1430
2543    AU
2544
2545    EMail: raif@forge.com.au
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576 Burdis & Naffah        Expires November 28, 2003               [Page 46]
2577 \f
2578 Internet-Draft        SRP Authentication Mechanism              May 2003
2579
2580
2581 Appendix A. Modulus and Generator Values
2582
2583    Modulus N and generator g values for various modulus lengths are
2584    given below.  In each case the modulus is a large safe prime and the
2585    generator is a primitve root of GF(n) [RFC-2945].  These values are
2586    taken from software developed by Tom Wu and Eugene Jhong for the
2587    Stanford SRP distribution [SRPimpl].
2588
2589       [264 bits]
2590         Modulus (base 16) =
2591           115B8B692E0E045692CF280B436735C77A5A9E8A9E7ED56C965F87DB5B2A2
2592           ECE3
2593         Generator = 2
2594
2595       [384 bits]
2596         Modulus (base 16) =
2597           8025363296FB943FCE54BE717E0E2958A02A9672EF561953B2BAA3BAACC3E
2598           D5754EB764C7AB7184578C57D5949CCB41B
2599         Generator = 2
2600
2601       [512 bits]
2602         Modulus (base 16) =
2603           D4C7F8A2B32C11B8FBA9581EC4BA4F1B04215642EF7355E37C0FC0443EF75
2604           6EA2C6B8EEB755A1C723027663CAA265EF785B8FF6A9B35227A52D86633DB
2605           DFCA43
2606         Generator = 2
2607
2608       [640 bits]
2609         Modulus (base 16) =
2610           C94D67EB5B1A2346E8AB422FC6A0EDAEDA8C7F894C9EEEC42F9ED250FD7F0
2611           046E5AF2CF73D6B2FA26BB08033DA4DE322E144E7A8E9B12A0E4637F6371F
2612           34A2071C4B3836CBEEAB15034460FAA7ADF483
2613         Generator = 2
2614
2615       [768 bits]
2616         Modulus (base 16) =
2617           B344C7C4F8C495031BB4E04FF8F84EE95008163940B9558276744D91F7CC9
2618           F402653BE7147F00F576B93754BCDDF71B636F2099E6FFF90E79575F3D0DE
2619           694AFF737D9BE9713CEF8D837ADA6380B1093E94B6A529A8C6C2BE33E0867
2620           C60C3262B
2621         Generator = 2
2622
2623       [1024 bits]
2624         Modulus (base 16) =
2625           EEAF0AB9ADB38DD69C33F80AFA8FC5E86072618775FF3C0B9EA2314C9C256
2626           576D674DF7496EA81D3383B4813D692C6E0E0D5D8E250B98BE48E495C1D60
2627           89DAD15DC7D7B46154D6B6CE8EF4AD69B15D4982559B297BCF1885C529F56
2628           6660E57EC68EDBC3C05726CC02FD4CBF4976EAA9AFD5138FE8376435B9FC6
2629
2630
2631
2632 Burdis & Naffah        Expires November 28, 2003               [Page 47]
2633 \f
2634 Internet-Draft        SRP Authentication Mechanism              May 2003
2635
2636
2637           1D2FC0EB06E3
2638         Generator = 2
2639
2640       [1280 bits]
2641         Modulus (base 16) =
2642           D77946826E811914B39401D56A0A7843A8E7575D738C672A090AB1187D690
2643           DC43872FC06A7B6A43F3B95BEAEC7DF04B9D242EBDC481111283216CE816E
2644           004B786C5FCE856780D41837D95AD787A50BBE90BD3A9C98AC0F5FC0DE744
2645           B1CDE1891690894BC1F65E00DE15B4B2AA6D87100C9ECC2527E45EB849DEB
2646           14BB2049B163EA04187FD27C1BD9C7958CD40CE7067A9C024F9B7C5A0B4F5
2647           003686161F0605B
2648         Generator = 2
2649
2650       [1536 bits]
2651         Modulus (base 16) =
2652           9DEF3CAFB939277AB1F12A8617A47BBBDBA51DF499AC4C80BEEEA9614B19C
2653           C4D5F4F5F556E27CBDE51C6A94BE4607A291558903BA0D0F84380B655BB9A
2654           22E8DCDF028A7CEC67F0D08134B1C8B97989149B609E0BE3BAB63D4754838
2655           1DBC5B1FC764E3F4B53DD9DA1158BFD3E2B9C8CF56EDF019539349627DB2F
2656           D53D24B7C48665772E437D6C7F8CE442734AF7CCB7AE837C264AE3A9BEB87
2657           F8A2FE9B8B5292E5A021FFF5E91479E8CE7A28C2442C6F315180F93499A23
2658           4DCF76E3FED135F9BB
2659         Generator = 2
2660
2661       [2048 bits]
2662         Modulus (base 16) =
2663           AC6BDB41324A9A9BF166DE5E1389582FAF72B6651987EE07FC3192943DB56
2664           050A37329CBB4A099ED8193E0757767A13DD52312AB4B03310DCD7F48A9DA
2665           04FD50E8083969EDB767B0CF6095179A163AB3661A05FBD5FAAAE82918A99
2666           62F0B93B855F97993EC975EEAA80D740ADBF4FF747359D041D5C33EA71D28
2667           1E446B14773BCA97B43A23FB801676BD207A436C6481F1D2B9078717461A5
2668           B9D32E688F87748544523B524B0D57D5EA77A2775D2ECFA032CFBDBF52FB3
2669           786160279004E57AE6AF874E7303CE53299CCC041C7BC308D82A5698F3A8D
2670           0C38271AE35F8E9DBFBB694B5C803D89F7AE435DE236D525F54759B65E372
2671           FCD68EF20FA7111F9E4AFF73
2672         Generator = 2
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688 Burdis & Naffah        Expires November 28, 2003               [Page 48]
2689 \f
2690 Internet-Draft        SRP Authentication Mechanism              May 2003
2691
2692
2693 Appendix B. Changes since the previous draft
2694
2695    Removed specific references to SASL in the main document, instead
2696    isolating them to their own section.
2697
2698    Added sections describing how the mechanism can be used with the
2699    GSS-API and EAP authentication frameworks.
2700
2701    Adopted SRP-6 exchange for the base protocol.
2702
2703    Mandated the use of SASLprep profile for text based information.
2704
2705    Added an optional, optimised alternate authentication exchange where
2706    the parameters of a previously negotiated session are re-used, but
2707    with a newly derived shared context key.
2708
2709    TODO: Regenerate SASL example.
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744 Burdis & Naffah        Expires November 28, 2003               [Page 49]
2745 \f
2746 Internet-Draft        SRP Authentication Mechanism              May 2003
2747
2748
2749 Intellectual Property Statement
2750
2751    The IETF takes no position regarding the validity or scope of any
2752    intellectual property or other rights that might be claimed to
2753    pertain to the implementation or use of the technology described in
2754    this document or the extent to which any license under such rights
2755    might or might not be available; neither does it represent that it
2756    has made any effort to identify any such rights. Information on the
2757    IETF's procedures with respect to rights in standards-track and
2758    standards-related documentation can be found in BCP-11. Copies of
2759    claims of rights made available for publication and any assurances of
2760    licenses to be made available, or the result of an attempt made to
2761    obtain a general license or permission for the use of such
2762    proprietary rights by implementors or users of this specification can
2763    be obtained from the IETF Secretariat.
2764
2765    The IETF invites any interested party to bring to its attention any
2766    copyrights, patents or patent applications, or other proprietary
2767    rights which may cover technology that may be required to practice
2768    this standard. Please address the information to the IETF Executive
2769    Director.
2770
2771
2772 Full Copyright Statement
2773
2774    Copyright (C) The Internet Society (2003). All Rights Reserved.
2775
2776    This document and translations of it may be copied and furnished to
2777    others, and derivative works that comment on or otherwise explain it
2778    or assist in its implementation may be prepared, copied, published
2779    and distributed, in whole or in part, without restriction of any
2780    kind, provided that the above copyright notice and this paragraph are
2781    included on all such copies and derivative works. However, this
2782    document itself may not be modified in any way, such as by removing
2783    the copyright notice or references to the Internet Society or other
2784    Internet organizations, except as needed for the purpose of
2785    developing Internet standards in which case the procedures for
2786    copyrights defined in the Internet Standards process must be
2787    followed, or as required to translate it into languages other than
2788    English.
2789
2790    The limited permissions granted above are perpetual and will not be
2791    revoked by the Internet Society or its successors or assignees.
2792
2793    This document and the information contained herein is provided on an
2794    "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING
2795    TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING
2796    BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION
2797
2798
2799
2800 Burdis & Naffah        Expires November 28, 2003               [Page 50]
2801 \f
2802 Internet-Draft        SRP Authentication Mechanism              May 2003
2803
2804
2805    HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF
2806    MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
2807
2808
2809 Acknowledgement
2810
2811    Funding for the RFC Editor function is currently provided by the
2812    Internet Society.
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
2850
2851
2852
2853
2854
2855
2856 Burdis & Naffah        Expires November 28, 2003               [Page 51]
2857 \f
2858