idnits 2.17.1 draft-burdis-cat-srp-sasl-04.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- ** Looks like you're using RFC 2026 boilerplate. This must be updated to follow RFC 3978/3979, as updated by RFC 4748. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- == No 'Intended status' indicated for this document; assuming Proposed Standard Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- ** The document seems to lack an Introduction section. ** The document seems to lack an IANA Considerations section. (See Section 2.2 of https://www.ietf.org/id-info/checklist for how to handle the case when there are no actions for IANA.) ** The document seems to lack separate sections for Informative/Normative References. All references will be assumed normative when checking for downward references. ** There are 40 instances of too long lines in the document, the longest one being 2 characters in excess of 72. ** There are 29 instances of lines with control characters in the document. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the RFC 3978 Section 5.4 Copyright Line does not match the current year -- The exact meaning of the all-uppercase expression 'MAY NOT' is not defined in RFC 2119. If it is intended as a requirements expression, it should be rewritten using one of the combinations defined in RFC 2119; otherwise it should not be all-uppercase. == The expression 'MAY NOT', while looking like RFC 2119 requirements text, is not defined in RFC 2119, and should not be used. Consider using 'MUST NOT' instead (if that is what you mean). Found 'MAY NOT' in this paragraph: A buffer MAY NOT contain other buffers. It may only contain zero, one or more data elements. -- The document seems to lack a disclaimer for pre-RFC5378 work, but may have content which was first submitted before 10 November 2008. If you have contacted all the original authors and they are all willing to grant the BCP78 rights to the IETF Trust, then this is fine, and you can ignore this comment. If not, you may need to add the pre-RFC5378 disclaimer. (See the Legal Provisions document at https://trustee.ietf.org/license-info for more information.) -- The document date (January 2001) is 8495 days in the past. Is this intentional? Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) == Missing Reference: '0' is mentioned on line 132, but not defined -- Looks like a reference, but probably isn't: 'SRP' on line 720 == Unused Reference: '10' is defined on line 794, but no explicit reference was found in the text == Unused Reference: '11' is defined on line 797, but no explicit reference was found in the text ** Obsolete normative reference: RFC 2440 (ref. '2') (Obsoleted by RFC 4880) ** Obsolete normative reference: RFC 2279 (ref. '3') (Obsoleted by RFC 3629) -- Possible downref: Non-RFC (?) normative reference: ref. '4' -- Possible downref: Non-RFC (?) normative reference: ref. '5' -- Possible downref: Non-RFC (?) normative reference: ref. '6' -- Possible downref: Non-RFC (?) normative reference: ref. '7' ** Downref: Normative reference to an Informational RFC: RFC 2104 (ref. '9') ** Obsolete normative reference: RFC 2222 (ref. '10') (Obsoleted by RFC 4422, RFC 4752) ** Obsolete normative reference: RFC 2629 (ref. '11') (Obsoleted by RFC 7749) -- Possible downref: Non-RFC (?) normative reference: ref. '12' -- Possible downref: Non-RFC (?) normative reference: ref. '14' -- Possible downref: Non-RFC (?) normative reference: ref. '15' -- Possible downref: Non-RFC (?) normative reference: ref. '16' -- Possible downref: Non-RFC (?) normative reference: ref. '17' ** Downref: Normative reference to an Historic RFC: RFC 1423 (ref. '18') ** Obsolete normative reference: RFC 2554 (ref. '19') (Obsoleted by RFC 4954) Summary: 13 errors (**), 0 flaws (~~), 6 warnings (==), 13 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Network Working Group K.R. Burdis 3 Internet-Draft Rhodes University 4 Expires: July 2, 2001 R. Naffah 5 Forge Research 6 January 2001 8 Secure Remote Password SASL Mechanism 9 draft-burdis-cat-srp-sasl-04 11 Status of this Memo 13 This document is an Internet-Draft and is in full conformance with 14 all provisions of Section 10 of RFC2026. 16 Internet-Drafts are working documents of the Internet Engineering 17 Task Force (IETF), its areas, and its working groups. Note that 18 other groups may also distribute working documents as 19 Internet-Drafts. 21 Internet-Drafts are draft documents valid for a maximum of six 22 months and may be updated, replaced, or obsoleted by other documents 23 at any time. It is inappropriate to use Internet-Drafts as reference 24 material or to cite them other than as "work in progress." 26 The list of current Internet-Drafts can be accessed at 27 http://www.ietf.org/ietf/1id-abstracts.txt. 29 The list of Internet-Draft Shadow Directories can be accessed at 30 http://www.ietf.org/shadow.html. 32 This Internet-Draft will expire on July 2, 2001. 34 Copyright Notice 36 Copyright (C) The Internet Society (2001). All Rights Reserved. 38 Abstract 40 This document describes a family of SASL mechanisms based on the 41 Secure Remote Password protocol. These mechanisms perform mutual 42 authentication and can provide a security layer with replay 43 detection, integrity protection and/or confidentiality protection. 45 Table of Contents 47 1. Mechanism Names . . . . . . . . . . . . . . . . . . . . . . . 3 48 2. Conventions Used in this Document . . . . . . . . . . . . . . 4 49 3. Data Element Formats . . . . . . . . . . . . . . . . . . . . . 5 50 3.1 Scalar numbers . . . . . . . . . . . . . . . . . . . . . . . . 5 51 3.2 Multi-Precision Integers . . . . . . . . . . . . . . . . . . . 5 52 3.3 Octet Sequences . . . . . . . . . . . . . . . . . . . . . . . 6 53 3.4 Extended Octet Sequences . . . . . . . . . . . . . . . . . . . 6 54 3.5 Text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 55 3.6 Buffers . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 56 3.7 Data Element Size Limits . . . . . . . . . . . . . . . . . . . 7 57 4. Protocol Description . . . . . . . . . . . . . . . . . . . . . 8 58 4.1 Client sends its authentication identity . . . . . . . . . . . 9 59 4.2 Server sends initial protocol elements . . . . . . . . . . . . 9 60 4.3 Client sends its ephemeral public key . . . . . . . . . . . . 10 61 4.4 Server sends its ephemeral public key . . . . . . . . . . . . 11 62 4.5 Client sends its evidence . . . . . . . . . . . . . . . . . . 11 63 4.6 Server sends its evidence . . . . . . . . . . . . . . . . . . 11 64 5. Security Layer . . . . . . . . . . . . . . . . . . . . . . . . 13 65 5.1 Confidentiality Protection . . . . . . . . . . . . . . . . . . 14 66 5.2 Replay Detection . . . . . . . . . . . . . . . . . . . . . . . 16 67 5.3 Integrity Protection . . . . . . . . . . . . . . . . . . . . . 16 68 5.4 Summary of Security Layer Output . . . . . . . . . . . . . . . 16 69 6. Example . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 70 7. Discussion . . . . . . . . . . . . . . . . . . . . . . . . . . 19 71 8. Security Considerations . . . . . . . . . . . . . . . . . . . 20 72 9. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . 21 73 References . . . . . . . . . . . . . . . . . . . . . . . . . . 22 74 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . 23 75 A. Modulus and Generator values . . . . . . . . . . . . . . . . . 24 76 Full Copyright Statement . . . . . . . . . . . . . . . . . . . 26 78 1. Mechanism Names 80 The family of SASL mechanisms associated with the protocol described 81 in this document are named "SRP-" where is the 82 canonical name of a Message Digest Algorithm. 84 For example, "SRP-SHA-160" shall denote the SASL mechanism using the 85 protocol described in this document with SHA-1 (20-octet output 86 length, or 160 bits) being used to compute both client-side and 87 server-side digests. Similarly, "SRP-RIPEMD-160" shall denote the 88 SASL mechanism using the protocol described in this document with 89 RIPEMD-160 as the underlying Message Digest Algorithm. 91 2. Conventions Used in this Document 93 o A hex digit is an element of the set: 95 {0, 1, 2, 3, 4, 5, 6, 7, 8 , 9, A, B, C, D, E, F} 97 A hex digit is the representation of a 4-bit string. Examples: 99 7 = 0111 101 A = 1010 103 o An octet is an 8-bit string. In this document an octet may be 104 written as a pair of hex digits. Examples: 106 7A = 01111010 108 02 = 00000010 110 o All data is encoded and sent in network byte order (big-endian). 112 o The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL 113 NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and 114 "OPTIONAL" in this document are to be interpreted as described in 115 RFC2119 [1]. 117 3. Data Element Formats 119 This section describes the encoding of the data elements used by the 120 SASL mechanisms described in this document. 122 3.1 Scalar numbers 124 Scalar numbers are unsigned quantities. Using b[k] to refer to the 125 k-th octet being processed, the value of a two-octet scalar is: 127 ((b[0] << 8) + b[1]), 129 where << is the bit left-shift operator. The value of a four-octet 130 scalar is: 132 ((b[0] << 24) + (b[1] << 16) + (b[2] << 8) + b[3]). 134 3.2 Multi-Precision Integers 136 Multi-Precision Integers, or MPIs, are positive integers used to 137 hold large integers used in cryptographic computations. 139 MPIs are encoded using a scheme inspired by that used by OpenPGP - 140 RFC2440 (section 3.2) [2] - for encoding such entities: 142 The encoded form of an MPI SHALL consist of two pieces: a 143 two-octet scalar that represents the length of the entity, in 144 octets, followed by a sequence of octets that contain the actual 145 integer. 147 These octets form a big-endian number; A big-endian number can 148 be encoded by prefixing it with the appropriate length. 150 Examples: (all numbers are in hexadecimal) 152 The sequence of octets [00 01 01] encodes an MPI with the 153 value 1, while the sequence [00 02 01 FF] encodes an MPI with 154 the value of 511 156 Additional rule: 158 * The length field of an encoded MPI describes the octet count 159 starting from the MPI's first non-zero octet, containing the 160 most significant non-zero bit. Thus, the encoding [00 02 01] 161 is not formed correctly; It should be [00 01 01]. 163 We shall use the syntax mpi(A) to denote the encoded form of the 164 multi-precision integer A. Furthermore, we shall use the syntax 165 bytes(A) to denote the big-endian sequence of octets forming the 166 multi-precision integer with the most significant octet being the 167 first non-zero octet containing the most significant bit of A. 169 3.3 Octet Sequences 171 These mechanisms generate, use and exchange sequences of octets; 172 e.g. output values of message digest algorithm functions. When such 173 entities travel on the wire, they shall be preceded by a one-octet 174 scalar quantity representing the count of following octets. 176 We shall use the syntax os(s) to denote the encoded form of the 177 octet sequence. Furthermore, we shall use the syntax bytes(s) to 178 denote the sequence of octets s, in big-endian order. 180 3.4 Extended Octet Sequences 182 Extended sequences of octets are exchanged when using the security 183 layer. When these sequences travel on the wire, they shall be 184 preceded by a four-octet scalar quantity representing the count of 185 following octets. 187 We shall use the syntax eos(s) to denote the encoded form of the 188 extended octet sequence. Furthermore, we shall use the syntax 189 bytes(s) to denote the sequence of octets s, in big-endian order. 191 3.5 Text 193 The only character set for text is the UTF-8 [3] encoding of Unicode 194 characters [4]. 196 We shall use the syntax utf8(L) to denote the string L in UTF-8 197 encoding, preceded by a two-octet scalar quantity representing the 198 count of following octets. Furthermore, we shall use the syntax 199 bytes(L) to denote the sequence of octets representing the UTF-8 200 encoding of L, in big-endian order. 202 3.6 Buffers 204 In these SASL mechanisms data is exchanged between the client and 205 server using buffers. A buffer acts as an envelope for the sequence 206 of data elements sent by one end-point of the exchange, and expected 207 by the other. 209 A buffer MAY NOT contain other buffers. It may only contain zero, 210 one or more data elements. 212 A buffer shall be encoded as two fields: a four-octet scalar 213 quantity representing the count of following octets, and the 214 concatenation of the octets of the data element(s) contained in the 215 buffer. 217 We shall use the syntax {A|B|C} to denote a buffer containing A, B 218 and C in that order. For example: 220 { mpi(N) | mpi(g) | utf8(L) } 222 is a buffer containing, in the designated order, the encoded forms 223 of an MPI N, an MPI g and a Text L. 225 3.7 Data Element Size Limits 227 The following table details the size limit, in number of octets, for 228 each of the SASL data element encodings described earlier. 230 Data element type Header Size limit in octets 231 (octets) (excluding header) 232 ------------------------------------------------------------ 233 Octet Sequence 1 255 234 MPI 2 65,535 235 Text 2 65,535 236 Extended Octet Sequence 4 2,147,483,383 237 Buffer 4 2,147,483,643 239 An implementation SHOULD signal an exception if any size constraint 240 is violated. 242 4. Protocol Description 244 SRP is a password-based, zero-knowledge, authentication and 245 key-exchange protocol developed by Thomas Wu. It has good 246 performance, is not plaintext-equivalent and maintains perfect 247 forward secrecy. It provides authentication (optionally mutual 248 authentication) and the negotiation of a session key [12]. 250 The mechanisms described herein are based on the optimised SRP 251 protocol described at the end of section 3 in [13], since this 252 reduces the total number of messages exchanged by grouping together 253 pieces of information that do not depend on earlier messages. Due 254 to the design of the mechanism, mutual authentication is MANDATORY. 256 This document describes the sequence of data transmitted between the 257 client and server, and it adds extra control information to enable 258 the client to request whether or not replay detection, integrity 259 protection and/or confidentiality protection should be provided by a 260 security layer. 262 Mechanism data exchanges, during the authentication phase, are shown 263 below: 265 Client Server 267 ----- { utf8(U) } --------------------------------> 269 <-------------- { mpi(N) | mpi(g) | utf8(L) } ----- 271 ----- { utf8(I) | mpi(A) | utf8(o) } -------------> 273 <------------------------- { os(s) | mpi(B) } ----- 275 ----- { os(M1) } ---------------------------------> 277 <--------------------------------- { os(M2) } ----- 279 where: 281 U is the authentication identity (username), 283 N is the safe prime modulus, 285 g is the generator, 287 L is the options list indicating available security services, 288 I is the authorisation identity, 290 A is the client's ephemeral public key, 292 o is the options list indicating chosen security services, 294 s is the user's password salt, 296 B is the server's ephemeral public key, 298 M1 is the client's evidence that the shared key K is known, 300 M2 is the server's evidence that the shared key K is known. 302 4.1 Client sends its authentication identity 304 The client determines its authentication identity U, encodes it and 305 sends it to the server. 307 The client sends: 309 { utf8(U) } 311 4.2 Server sends initial protocol elements 313 The server receives U, and looks up the safe prime modulus N and the 314 generator g to be used for that identity. 316 The server also creates an options list L, which consists of a 317 comma-separated list of option strings that specify the security 318 service options the server supports. The following security service 319 options strings are defined: 321 o "integrity=HMAC-" indicates that the server supports 322 integrity protection using the HMAC algorithm [9] with 323 as the underlying Message Digest Algorithm. Acceptable MDA names 324 are chosen from [15] under the MessageDigest section. A server 325 SHOULD send such an option string for each HMAC algorithm it 326 supports. Note that in the interest of interoperability, if the 327 server offers integrity protection it MUST, as a minimum, send 328 the option string "integrity=HMAC-MD5" since support for this 329 algorithm is then MANDATORY. 331 o "replay detection" indicates that the server supports replay 332 detection using sequence numbers. 334 o "confidentiality=" indicates that the server 335 supports confidentiality protection using the symmetric block 336 cipher algorithm . The server SHOULD send such an 337 option string for each confidentiality protection algorithm it 338 supports. Note that in the interest of interoperability, if the 339 server offers confidentiality protection, it MUST send the option 340 string "confidentiality=aes" since it is then MANDATORY for it to 341 provide support for this algorithm. (Rijndael [5] is synonymous 342 with AES [6].) 344 Additional rules: 346 o Replay detection SHALL NOT be activated without also activating 347 integrity protection. If the replay detection option is offered 348 (by the server) and/or chosen (by the client) without explicitely 349 specifying an integrity protection option, then the default 350 integrity protection option "integrity=HMAC-MD5" is implied and 351 shall be activated. 353 o The options list SHOULD NOT be interpreted in a case-sensitive 354 manner, and whitespace characters SHOULD be ignored. 356 For example, if the server supports integrity protection using the 357 HMAC-MD5 and HMAC-SHA-160 algorithms, replay detection and no 358 confidentiality protection, the options list would be: 360 integrity=HMAC-MD5,integrity=HMAC-SHA-160,replay detection 362 The server sends: 364 { mpi(N) | mpi(g) | utf8(L) } 366 4.3 Client sends its ephemeral public key 368 The client receives the options list L from the server that 369 specifies the security service options the server supports. The 370 client selects options from this list and creates a new options list 371 o that specifies the security services that will be used in the 372 security layer. At most one available integrity protection 373 algorithm and one available confidentiality protection algorithm may 374 be selected. 376 The client determines its authorisation identity I, and generates 377 its ephemeral public key A. 379 The client sends: 381 { utf8(I) | mpi(A) | utf8(o) } 383 4.4 Server sends its ephemeral public key 385 The server reads the client's salt s, calculates the shared context 386 key K and generates its ephemeral public key B. 388 The server sends: 390 { os(s) | mpi(B) } 392 4.5 Client sends its evidence 394 The client calculates the shared context key K, and calculates the 395 evidence M1 that proves to the server that it knows the shared 396 context key K, including L as part of the calculation. 398 M1 is computed as: 400 H( 401 bytes(H( bytes(N) )) ^ bytes( H( bytes(g) ))) 402 | bytes(H( bytes(U) )) 403 | bytes(s) 404 | bytes(H( bytes(L) )) 405 | bytes(A) 406 | bytes(B) 407 | bytes(K) 408 ) 410 where: 412 H() is the result of digesting the designated input/data with the 413 underlying Message Digest Algorithm function (see Section 1). 415 ^ is the bitwise XOR operator. 417 The client sends: 419 { os(M1) } 421 4.6 Server sends its evidence 423 The server calculates the evidence M2 that proves to the client that 424 it knows the shared context key K, as well as U, I, and o. 426 M2 is computed as: 428 H( 429 bytes(A) 430 | bytes(H( bytes(U) )) 431 | bytes(H( bytes(I) )) 432 | bytes(H( bytes(o) )) 433 | bytes(M1) 434 | bytes(K) 435 ) 437 where: 439 H() is the result of digesting the designated input/data with the 440 underlying Message Digest Algorithm function (see Section 1) 442 The server sends: 444 { os(M2) } 446 5. Security Layer 448 Depending on the options offered by the server and specified by the 449 client, the security layer may provide integrity protection, replay 450 detection, and/or confidentiality protection. 452 The security layer can be thought of as a three-stage filter through 453 which the data flows from the output of one stage to the input of 454 the following one. The first input is the original data, while the 455 last output is the data after being subject to the transformations 456 of this filter. 458 The data always passes through this three-stage filter, though any 459 of the stages may be inactive. Only when a stage is active would 460 the output be different from the input. In other words, if a stage 461 is inactive, the octet sequence at the output side is an exact 462 duplicate of the same sequence at the input side. 464 Schematically, the three-stage filter security layer appears as 465 follows: 467 +----------------------------+ 468 | | I/ p1 469 p1 --->| Confidentiality protection |---+ 470 | | | A/ c 471 +----------------------------+ | 472 | 473 +------------------------------------+ 474 | 475 | +----------------------------+ 476 | | | I/ p2 477 p2 +-->| Replay detection |---+ 478 | | | A/ p2 | q 479 +----------------------------+ | 480 | 481 +------------------------------------+ 482 | 483 | +----------------------------+ 484 | | | I/ p3 485 p3 +-->| Integrity protection |---> 486 | | A/ p3 | C 487 +----------------------------+ 489 where: 491 p1, p2 and p3 are the input octet sequences at each stage, 492 I/ denotes the output at the end of one stage if/when the stage 493 is inactive or disabled, 495 A/ denotes the output at the end of one stage if/when the stage 496 is active or enabled, 498 c is the encrypted (sender-side) or decrypted (receiver-side) 499 octet sequence. c1 shall denote the value computed by the 500 sender, while c2 shall denote the value computed by the receiver. 502 q is a four-octet scalar quantity representing a sequence number, 504 C is the Message Authentication Code. C1 shall denote the value 505 of the MAC as computed by the sender, while C2 shall denote the 506 value computed by the receiver. 508 The following paragraphs detail each of the transformations 509 mentioned above. 511 5.1 Confidentiality Protection 513 The plaintext data octet sequence p1 is encrypted using the chosen 514 confidentiality algorithm (CALG) initialised for encryption with the 515 shared context key K. 517 c1 = CALG(K, ENCRYPTION)( bytes(p1) ) 519 On the receiving side, the ciphertext data octet sequence p1 is 520 decrypted using the chosen confidentiality algorithm (CALG) 521 initialised for decryption, with the shared context key K. 523 c2 = CALG(K, DECRYPTION)( bytes(p1) ) 525 The designated CALG block cipher should be used in OFB (Output 526 Feedback Block) mode in the ISO variant, as described in [16], 527 algorithm 7.20. 529 Let k be the block size of the chosen symmetric cipher algorithm; 530 e.g. for AES this is 128 bits or 16 octets. The OFB mode used shall 531 be of length/size k. 533 It is recommended that Block ciphers operating in OFB mode be used 534 with an Initial Vector (the mode's IV). For the SASL mechanisms 535 described in this document, the IV shall be an all-zero octet 536 sequence of size k. 538 In such a mode of operation - OFB with key re-use - the IV, which 539 need not be secret, must be changed. Otherwise an identical 540 keystream results; and, by XORing corresponding ciphertexts, an 541 adversary may reduce cryptanalysis to that of a running-key cipher 542 with one plaintext as the running key. To counter the effect of 543 fixing the IV to an all-zero octet sequence, the sender should use a 544 one k-octet sequence as the value of its first block, constructed as 545 follows: 547 o the first (most significant) (k-2) octets are random, 549 o the octets at position #k-1 and #k, assuming the first octet is 550 at position #1, are exact copies of those at positions #1 and #2 551 respectively. 553 The input data to the confidentiality protection algorithm shall be 554 a multiple of the symmetric cipher block size k. When the input 555 length is not a multiple of k octets, the data shall be padded 556 according to the following scheme (described in [17] which itself is 557 based on RFC1423 [18]): 559 Assuming the length of the input is l octets, (k - (l mod k)) 560 octets, all having the value (k - (l mod k)), shall be appended 561 to the original data. In other words, the input is padded at the 562 trailing end with one of the following sequences: 564 01 -- if l mod k = k-1 565 02 02 -- if l mod k = k-2 566 ... 567 ... 568 ... 569 k k ... k k -- if l mod k = 0 571 The padding can be removed unambiguously since all input is 572 padded and no padding sequence is a suffix of another. This 573 padding method is well-defined if and only if k < 256 octets, 574 which is the case with symmetric block ciphers today, and in the 575 forseeable future. 577 The output of this stage, when it is active, is: 579 at the sending side: CALG(K, ENCRYPT)( bytes(p1) ) 581 at the receiving side: CALG(K, DECRYPT)( bytes(p1) ) 583 If the receiver, after decrypting the first block, finds that the 584 last two octets do not match the value of the first two, it MUST 585 signal an exception and abort the exchange. 587 5.2 Replay Detection 589 A sequence number q is incremented every time a message is sent to 590 the peer. 592 The output of this stage, when it is active, is: 594 p2 | q 596 At the other end, the receiver increments its copy of the sequence 597 number. This new value of the sequence number is then used in the 598 integrity protection transformation, which must also be active as 599 described in Section 4.2. 601 5.3 Integrity Protection 603 A message authentication code C is computed using the chosen 604 integrity protection algorithm (IALG) initialised with the shared 605 context key K, and applied to the sequence p3. 607 The output of this stage, when it is active, is: 609 IALG(K)( bytes(p3) ) 611 At the other end, the receiver computes its version of the MAC, 612 using the same transformation, and checks if its value is equal to 613 that received. If the two values do not agree, the receiver MUST 614 signal an exception and abort the exchange. 616 5.4 Summary of Security Layer Output 618 The following table shows the data exchanged by the security layer 619 peers, depending on the possible legal combinations of the three 620 security services in operation: 622 CP IP RD Peer sends/receives 624 I I I { eos(p) } 625 I A I { eos(p) | os( IALG(K)( bytes(p) ) ) } 626 I A A { eos(p) | os( IALG(K)( bytes(p) | bytes(q)) ) } 627 A I I { eos(c) } 628 A A I { eos(c) | os( IALG(K)( bytes(c) ) ) } 629 A A A { eos(c) | os( IALG(K)((bytes(c) | bytes(q)) ) } 631 where 633 CP Confidentiality protection, 634 IP Integrity protection, 636 RD Replay detection, 638 I Security service is Inactive/disabled, 640 A Security service is Active/enabled, 642 p The original plaintext, 644 q The sequence number. 646 c The enciphered input obtained by either: 648 CALG(K, ENCRYPT)( bytes(p) ) at the sender's side, or 650 CALG(K, DECRYPT)( bytes(p) ) at the receiver's side, or 652 6. Example 654 The example below uses SMTP authentication [19]. The base64 encoding 655 of challenges and responses, as well as the reply codes preceding 656 the responses are part of the SMTP authentication[19] specification, 657 not part of this SASL mechanism itself. 659 "C:" and "S:" indicate lines sent by the client and server 660 respectively. 662 S: 220 smtp.example.com ESMTP server ready 664 C: EHLO zaau.example.com 666 S: 250-smtp.example.com 667 S: 250 AUTH SRP-SHA-160 CRAM-MD5 DIGEST-MD5 669 C: AUTH SRP-SHA-160 AAAABQADZm9v 671 S: AAAAqgCA///////////JD9qiIWjCNMTGYouA3BzRKQJOCIpnzHQCC76mOxObIlFKCH 672 mONATd75UZs806QxswKwpt8l8UN0/hNW1tUcJF5IW1dmJefsb0TELppjftawv/XLb0Brf 673 t7jhr+1qJn6WunyQRfEsf5kkoZlHs5lOB//////////8AAQUAI2ludGVncml0eT1obWFj 674 LW1kNSxyZXBsYXkgZGV0ZWN0aW9u 676 C: AAAArAADZm9vAIBFoAAiZ7mnsz2UBmAtV4t2nW973SBNLUdL9BC3AG0CC0TCtYjjwP 677 dhobc02S9ERw7G+lPcmAFXGO6KDHc7AXe33xp+WwGGkIyB49oJB8VZ+sXqCr6OBMFvV1H 678 okkzIyjhogn2OZVdn89FryqG4LwuEsypCPGQ+cgxYWUGTIuAMrwAjaW50ZWdyaXR5PWht 679 YWMtbWQ1LHJlcGxheSBkZXRlY3Rpb24= 681 S: AAAAjgqSCwkzSOiPQ1JnAIEAmkVIho/d/xckmrzp1nMEtkWKxlOOiX0V8u+a9y9/0V 682 KgzKJlcT+QI/uQH9l23tnfOOK3CfDuaZMnQgMLNCsvRy22x6YhZW07zo39QhMWLWLSjVJ 683 lWXgxSQyds1JvVAQzZN+XaFdZs5lMDfSJMiC8L7MzZyw8XmHh5v1DtueK9mc= 685 C: AAAAFRS0T1/zTL9Idv9R5F7tuCFMtWrCGg== 687 S: AAAAFRShvobx8ubyF8fUAuupQIfWYPdu4A== 689 C: 691 S: 235 Authentication successful. 693 7. Discussion 695 The algorithms specified as mandatory were chosen for utility and 696 availablity. We felt that a mandatory confidentiality and integrity 697 protection algorithm should be specified to ensure interoperability 698 between implementations of these mechanisms. 700 o The HMAC-MD5 algorithm was chosen as an integrity algorithm 701 because it is faster than both HMAC-SHA-160 and MAC algorithms 702 based on secret key encryption algorithms [8]. 704 o Rijndael was chosen as a cipher because it has undergone thorough 705 scrutiny by the best cryptographers in the world and was chosen 706 ahead of many other algorithms as the Advanced Encryption 707 Standard. 709 Since confidentiality protection is optional this mechanism should 710 be usable in countries that have strict controls on the use of 711 cryptography. 713 It is RECOMMENDED that the server use values for the modulus (N) and 714 generator (g) chosen from those listed in Appendix A so that the 715 client can avoid expensive constraint checks, since these predefined 716 values already meet the constraints described in [13]: 718 "For maximum security, N should be a safe prime (i.e. a number 719 of the form N = 2q + 1, where q is also prime). Also, g should 720 be a generator modulo N (see [SRP] for details), which means that 721 for any X where 0 < X < N, there exists a value x for which g^x % 722 N == X." 724 8. Security Considerations 726 These mechanisms rely on the security of SRP, which bases its 727 security on the difficulty of solving the Diffie-Hellman problem in 728 the multiplicative field modulo a large safe prime. See section 4 729 "Security Considerations" of [13] and section 4 "Security analysis" 730 of [12]. 732 This mechanism also relies on the security of the HMAC algorithm and 733 the underlying hash function. Section 6 "Security" of [9] discusses 734 these security issues in detail. Weaknesses found in MD5 do not 735 impact HMAC-MD5 [7]. 737 U, I, A and o, sent from the client to the server, and N, g, L, s 738 and B, sent from the server to the client could be modified by an 739 attacker before reaching the other party. For this reason, these 740 values are included in the respective calculations of evidence (M1 741 and M2) to prove that each party knows the session key. This allows 742 each party to verify that these values were received unmodified. 744 The use of integrity protection is RECOMMENDED to detect message 745 tampering and to avoid session hijacking after authentication has 746 taken place. 748 Replay attacks may be avoided through the use of sequence numbers, 749 because sequence numbers make each integrity protected message 750 exchanged during a session different, and each session uses a 751 different key. 753 9. Acknowledgements 755 The following people provided valuable feedback in the preparation 756 of this document: 758 Timothy Martin 760 References 762 [1] Bradner, S., "Key words for use in RFCs to Indicate 763 Requirement Levels", BCP 0014, RFC 2119, March 1997. 765 [2] Callas, J., Donnerhacke, L., Finney, H. and R. Thayer, 766 "OpenPGP Message Format", RFC 2440, November 1998. 768 [3] Yergeau, F., "UTF-8, a transformation format of Unicode and 769 ISO 10646", RFC 2279, January 1998. 771 [4] "International Standard --Information technology-- Universal 772 Multiple-Octet Coded Character Set (UCS) -- Part 1 773 Architecture and Basic Multilingual Plane", ISO/IEC 10646-1, 774 1993. 776 [5] Daemen, Joan and Vincent Rijmen, "AES Proposal: Rijndael", 777 September 1999, 778 . 780 [6] National Institute of Standards and Technology, "Rijndael: 781 NIST's Selection for the AES", December 2000, 782 . 784 [7] Dobbertin, H., "The Status of MD5 After a Recent Attack", 785 December 1996, 786 . 788 [8] Eisler, M., "LIPKEY - A Low Infrastructure Public Key 789 Mechanism Using SPKM", RFC 2847, June 2000. 791 [9] Krawczyk, H. et al, "HMAC: Keyed-Hashing for Message 792 Authentication", RFC 2104, February 1997. 794 [10] Myers, J.G., "Simple Authentication and Security Layer 795 (SASL)", RFC 2222, October 1997. 797 [11] Rose, M., "Writing I-Ds and RFCs using XML", RFC 2629, June 798 1999. 800 [12] Wu, T., "The Secure Remote Password Protocol", March 1998, 801 . 803 [13] Wu, T., "The SRP Authentication and Key Exchange System", RFC 804 2945, September 2000. 806 [14] Wu, T., "SRP: The Open Source Password Authentication 807 Standard", March 1998, 808 . 810 [15] Hopwood, D., "Standard Cryptographic Algorithm Naming", June 811 2000, 812 . 814 [16] Menezes, A.J., van Oorschot, P.C. and S.A. Vanstone, "Handbook 815 of Applied Cryptography", CRC Press, Inc., ISBN 0-8493-8523-7, 816 1997, 817 . 819 [17] RSA Data Security, Inc., "PKCS #7: Cryptographic Message 820 Syntax Standard", Version 1.5, November 1993, 821 . 823 [18] Balenson, D., "Privacy Enhancement for Internet Electronic 824 Mail: Part III: Algorithms, Modes, and Identifiers", RFC 1423, 825 February 1993, 826 . 828 [19] Myers, J.G., "SMTP Service Extension for Authentication", RFC 829 2554, March 1999. 831 Authors' Addresses 833 K.R. Burdis 834 Rhodes University 835 Computer Science Department 836 Grahamstown 6139 837 ZA 839 EMail: keith@rucus.ru.ac.za 840 URI: http://www.cryptix.org/~keith/ 842 Raif S. Naffah 843 Forge Research Pty. Limited 844 Suite 116, Bay 9 845 Locomotive Workshop, 846 Australian Technology Park 847 Cornwallis Street 848 Eveleigh, NSW 1430 849 AU 851 EMail: raif@forge.com.au 852 URI: http://www.cryptix.org/~raif/ 854 Appendix A. Modulus and Generator values 856 Modulus (N) and generator (g) values for various modulus lengths are 857 given below. In each case the modulus is a large safe prime and the 858 generator is a primitve root of GF(n) [12]. These values are taken 859 from software developed by Tom Wu and Eugene Jhong for the Stanford 860 SRP distribution [14]. 862 [264 bits] 863 Modulus (base 16) = 864 115B8B692E0E045692CF280B436735C77A5A9E8A9E7ED56C965F87DB5B2A2ECE 865 3 866 Generator = 2 868 [384 bits] 869 Modulus (base 16) = 870 8025363296FB943FCE54BE717E0E2958A02A9672EF561953B2BAA3BAACC3ED57 871 54EB764C7AB7184578C57D5949CCB41B 872 Generator = 2 874 [512 bits] 875 Modulus (base 16) = 876 D4C7F8A2B32C11B8FBA9581EC4BA4F1B04215642EF7355E37C0FC0443EF756EA 877 2C6B8EEB755A1C723027663CAA265EF785B8FF6A9B35227A52D86633DBDFCA43 878 Generator = 2 880 [640 bits] 881 Modulus (base 16) = 882 C94D67EB5B1A2346E8AB422FC6A0EDAEDA8C7F894C9EEEC42F9ED250FD7F0046 883 E5AF2CF73D6B2FA26BB08033DA4DE322E144E7A8E9B12A0E4637F6371F34A207 884 1C4B3836CBEEAB15034460FAA7ADF483 885 Generator = 2 887 [768 bits] 888 Modulus (base 16) = 889 B344C7C4F8C495031BB4E04FF8F84EE95008163940B9558276744D91F7CC9F40 890 2653BE7147F00F576B93754BCDDF71B636F2099E6FFF90E79575F3D0DE694AFF 891 737D9BE9713CEF8D837ADA6380B1093E94B6A529A8C6C2BE33E0867C60C3262B 892 Generator = 2 894 [1024 bits] 895 Modulus (base 16) = 896 EEAF0AB9ADB38DD69C33F80AFA8FC5E86072618775FF3C0B9EA2314C9C256576 897 D674DF7496EA81D3383B4813D692C6E0E0D5D8E250B98BE48E495C1D6089DAD1 898 5DC7D7B46154D6B6CE8EF4AD69B15D4982559B297BCF1885C529F566660E57EC 899 68EDBC3C05726CC02FD4CBF4976EAA9AFD5138FE8376435B9FC61D2FC0EB06E3 900 Generator = 2 902 [1280 bits] 903 Modulus (base 16) = 904 D77946826E811914B39401D56A0A7843A8E7575D738C672A090AB1187D690DC4 905 3872FC06A7B6A43F3B95BEAEC7DF04B9D242EBDC481111283216CE816E004B78 906 6C5FCE856780D41837D95AD787A50BBE90BD3A9C98AC0F5FC0DE744B1CDE1891 907 690894BC1F65E00DE15B4B2AA6D87100C9ECC2527E45EB849DEB14BB2049B163 908 EA04187FD27C1BD9C7958CD40CE7067A9C024F9B7C5A0B4F5003686161F0605B 909 Generator = 2 911 [1536 bits] 912 Modulus (base 16) = 913 9DEF3CAFB939277AB1F12A8617A47BBBDBA51DF499AC4C80BEEEA9614B19CC4D 914 5F4F5F556E27CBDE51C6A94BE4607A291558903BA0D0F84380B655BB9A22E8DC 915 DF028A7CEC67F0D08134B1C8B97989149B609E0BE3BAB63D47548381DBC5B1FC 916 764E3F4B53DD9DA1158BFD3E2B9C8CF56EDF019539349627DB2FD53D24B7C486 917 65772E437D6C7F8CE442734AF7CCB7AE837C264AE3A9BEB87F8A2FE9B8B5292E 918 5A021FFF5E91479E8CE7A28C2442C6F315180F93499A234DCF76E3FED135F9BB 919 Generator = 2 921 [2048 bits] 922 Modulus (base 16) = 923 AC6BDB41324A9A9BF166DE5E1389582FAF72B6651987EE07FC3192943DB56050 924 A37329CBB4A099ED8193E0757767A13DD52312AB4B03310DCD7F48A9DA04FD50 925 E8083969EDB767B0CF6095179A163AB3661A05FBD5FAAAE82918A9962F0B93B8 926 55F97993EC975EEAA80D740ADBF4FF747359D041D5C33EA71D281E446B14773B 927 CA97B43A23FB801676BD207A436C6481F1D2B9078717461A5B9D32E688F87748 928 544523B524B0D57D5EA77A2775D2ECFA032CFBDBF52FB3786160279004E57AE6 929 AF874E7303CE53299CCC041C7BC308D82A5698F3A8D0C38271AE35F8E9DBFBB6 930 94B5C803D89F7AE435DE236D525F54759B65E372FCD68EF20FA7111F9E4AFF73 931 Generator = 2 933 Full Copyright Statement 935 Copyright (C) The Internet Society (2001). All Rights Reserved. 937 This document and translations of it may be copied and furnished to 938 others, and derivative works that comment on or otherwise explain it 939 or assist in its implementation may be prepared, copied, published 940 and distributed, in whole or in part, without restriction of any 941 kind, provided that the above copyright notice and this paragraph 942 are included on all such copies and derivative works. However, this 943 document itself may not be modified in any way, such as by removing 944 the copyright notice or references to the Internet Society or other 945 Internet organizations, except as needed for the purpose of 946 developing Internet standards in which case the procedures for 947 copyrights defined in the Internet Standards process must be 948 followed, or as required to translate it into languages other than 949 English. 951 The limited permissions granted above are perpetual and will not be 952 revoked by the Internet Society or its successors or assigns. 954 This document and the information contained herein is provided on an 955 "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING 956 TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING 957 BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION 958 HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF 959 MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. 961 Acknowledgement 963 Funding for the RFC editor function is currently provided by the 964 Internet Society.