7Internet Engineering Task Force (IETF)                    P. Saint-Andre
 
8Request for Comments: 8265                                    Jabber.org
 
9Obsoletes: 7613                                              A. Melnikov
 
10Category: Standards Track                                      Isode Ltd
 
11ISSN: 2070-1721                                             October 2017
 
14 Preparation, Enforcement, and Comparison of Internationalized Strings
 
15                  Representing Usernames and Passwords
 
19   This document describes updated methods for handling Unicode strings
 
20   representing usernames and passwords.  The previous approach was
 
21   known as SASLprep (RFC 4013) and was based on Stringprep (RFC 3454).
 
22   The methods specified in this document provide a more sustainable
 
23   approach to the handling of internationalized usernames and
 
24   passwords.  This document obsoletes RFC 7613.
 
28   This is an Internet Standards Track document.
 
30   This document is a product of the Internet Engineering Task Force
 
31   (IETF).  It represents the consensus of the IETF community.  It has
 
32   received public review and has been approved for publication by the
 
33   Internet Engineering Steering Group (IESG).  Further information on
 
34   Internet Standards is available in Section 2 of RFC 7841.
 
36   Information about the current status of this document, any errata,
 
37   and how to provide feedback on it may be obtained at
 
38   https://www.rfc-editor.org/info/rfc8265.
 
42   Copyright (c) 2017 IETF Trust and the persons identified as the
 
43   document authors.  All rights reserved.
 
45   This document is subject to BCP 78 and the IETF Trust's Legal
 
46   Provisions Relating to IETF Documents
 
47   (https://trustee.ietf.org/license-info) in effect on the date of
 
48   publication of this document.  Please review these documents
 
49   carefully, as they describe your rights and restrictions with respect
 
50   to this document.  Code Components extracted from this document must
 
51   include Simplified BSD License text as described in Section 4.e of
 
52   the Trust Legal Provisions and are provided without warranty as
 
53   described in the Simplified BSD License.
 
58Saint-Andre & Melnikov       Standards Track                    [Page 1]
 
60RFC 8265             PRECIS: Usernames and Passwords        October 2017
 
65   1.  Introduction  . . . . . . . . . . . . . . . . . . . . . . . .   3
 
66   2.  Terminology . . . . . . . . . . . . . . . . . . . . . . . . .   4
 
67   3.  Usernames . . . . . . . . . . . . . . . . . . . . . . . . . .   5
 
68     3.1.  Definition  . . . . . . . . . . . . . . . . . . . . . . .   5
 
69     3.2.  Case Mapping vs. Case Preservation  . . . . . . . . . . .   6
 
70     3.3.  UsernameCaseMapped Profile  . . . . . . . . . . . . . . .   7
 
71       3.3.1.  Rules . . . . . . . . . . . . . . . . . . . . . . . .   7
 
72       3.3.2.  Preparation . . . . . . . . . . . . . . . . . . . . .   8
 
73       3.3.3.  Enforcement . . . . . . . . . . . . . . . . . . . . .   8
 
74       3.3.4.  Comparison  . . . . . . . . . . . . . . . . . . . . .   9
 
75     3.4.  UsernameCasePreserved Profile . . . . . . . . . . . . . .   9
 
76       3.4.1.  Rules . . . . . . . . . . . . . . . . . . . . . . . .   9
 
77       3.4.2.  Preparation . . . . . . . . . . . . . . . . . . . . .   9
 
78       3.4.3.  Enforcement . . . . . . . . . . . . . . . . . . . . .  10
 
79       3.4.4.  Comparison  . . . . . . . . . . . . . . . . . . . . .  10
 
80     3.5.  Application-Layer Constructs  . . . . . . . . . . . . . .  11
 
81     3.6.  Examples  . . . . . . . . . . . . . . . . . . . . . . . .  11
 
82   4.  Passwords . . . . . . . . . . . . . . . . . . . . . . . . . .  13
 
83     4.1.  Definition  . . . . . . . . . . . . . . . . . . . . . . .  13
 
84     4.2.  OpaqueString Profile  . . . . . . . . . . . . . . . . . .  14
 
85       4.2.1.  Preparation . . . . . . . . . . . . . . . . . . . . .  14
 
86       4.2.2.  Enforcement . . . . . . . . . . . . . . . . . . . . .  14
 
87       4.2.3.  Comparison  . . . . . . . . . . . . . . . . . . . . .  15
 
88     4.3.  Examples  . . . . . . . . . . . . . . . . . . . . . . . .  15
 
89   5.  Use in Application Protocols  . . . . . . . . . . . . . . . .  16
 
90   6.  Migration . . . . . . . . . . . . . . . . . . . . . . . . . .  17
 
91     6.1.  Usernames . . . . . . . . . . . . . . . . . . . . . . . .  17
 
92     6.2.  Passwords . . . . . . . . . . . . . . . . . . . . . . . .  19
 
93   7.  IANA Considerations . . . . . . . . . . . . . . . . . . . . .  20
 
94     7.1.  UsernameCaseMapped Profile  . . . . . . . . . . . . . . .  20
 
95     7.2.  UsernameCasePreserved Profile . . . . . . . . . . . . . .  20
 
96     7.3.  OpaqueString Profile  . . . . . . . . . . . . . . . . . .  21
 
97     7.4.  Stringprep Profile  . . . . . . . . . . . . . . . . . . .  22
 
98   8.  Security Considerations . . . . . . . . . . . . . . . . . . .  22
 
99     8.1.  Password/Passphrase Strength  . . . . . . . . . . . . . .  22
 
100     8.2.  Password/Passphrase Comparison  . . . . . . . . . . . . .  22
 
101     8.3.  Identifier Comparison . . . . . . . . . . . . . . . . . .  22
 
102     8.4.  Reuse of PRECIS . . . . . . . . . . . . . . . . . . . . .  22
 
103     8.5.  Reuse of Unicode  . . . . . . . . . . . . . . . . . . . .  22
 
104   9.  References  . . . . . . . . . . . . . . . . . . . . . . . . .  23
 
105     9.1.  Normative References  . . . . . . . . . . . . . . . . . .  23
 
106     9.2.  Informative References  . . . . . . . . . . . . . . . . .  24
 
107   Appendix A.  Changes from RFC 7613  . . . . . . . . . . . . . . .  25
 
108   Acknowledgements  . . . . . . . . . . . . . . . . . . . . . . . .  26
 
109   Authors' Addresses  . . . . . . . . . . . . . . . . . . . . . . .  26
 
114Saint-Andre & Melnikov       Standards Track                    [Page 2]
 
116RFC 8265             PRECIS: Usernames and Passwords        October 2017
 
121   Usernames and passwords are widely used for authentication and
 
122   authorization on the Internet, either directly when provided in
 
123   plaintext (as in the PLAIN Simple Authentication and Security Layer
 
124   (SASL) mechanism [RFC4616] and the HTTP Basic scheme [RFC7617]) or
 
125   indirectly when provided as the input to a cryptographic algorithm
 
126   such as a hash function (as in the Salted Challenge Response
 
127   Authentication Mechanism (SCRAM) SASL mechanism [RFC5802] and the
 
128   HTTP Digest scheme [RFC7616]).
 
130   To increase the likelihood that the input and comparison of usernames
 
131   and passwords will work in ways that make sense for typical users
 
132   throughout the world, this document defines rules for handling
 
133   internationalized strings that represent usernames and passwords.
 
134   Such strings consist of code points from the Unicode coded character
 
135   set [Unicode], with special attention to code points outside the
 
136   ASCII range [RFC20].  The rules for handling such strings are
 
137   specified through profiles of the string classes defined in the
 
138   preparation, enforcement, and comparison of internationalized strings
 
139   (PRECIS) framework specification [RFC8264].
 
141   Profiles of the PRECIS framework enable software to handle Unicode
 
142   code points outside the ASCII range in an automated way, so that such
 
143   code points are treated carefully and consistently in application
 
144   protocols.  In large measure, these profiles are designed to protect
 
145   application developers from the potentially negative consequences of
 
146   supporting the full range of Unicode code points.  For instance, in
 
147   almost all application protocols it would be dangerous to treat the
 
148   Unicode code point "¹" (SUPERSCRIPT ONE, U+00B9) as equivalent to "1"
 
149   (DIGIT ONE, U+0031), because that would result in false accepts
 
150   during comparison, authentication, and authorization (e.g., an
 
151   attacker could easily spoof an account "user1@example.com").
 
153   Whereas a naive use of Unicode would make such attacks trivially
 
154   easy, the PRECIS profile defined here for usernames generally
 
155   protects applications from inadvertently causing such problems.
 
156   (Similar considerations apply to passwords, although here it is
 
157   desirable to support a wider range of characters so as to maximize
 
158   entropy for purposes of authentication.)
 
160   The methods defined here might be applicable wherever usernames or
 
161   passwords are used.  However, the methods are not intended for use in
 
162   preparing strings that are not usernames (e.g., Lightweight Directory
 
163   Access Protocol (LDAP) distinguished names), nor in cases where
 
164   identifiers or secrets are not strings (e.g., keys and certificates)
 
165   or require specialized handling.
 
170Saint-Andre & Melnikov       Standards Track                    [Page 3]
 
172RFC 8265             PRECIS: Usernames and Passwords        October 2017
 
175   Although the historical predecessor of this document was the SASLprep
 
176   profile of Stringprep [RFC3454]), the approach defined here can be
 
177   used by technologies other than SASL [RFC4422], such as HTTP
 
178   authentication as specified in [RFC7617] and [RFC7616].
 
180   This document does not modify the handling of internationalized
 
181   strings in usernames and passwords as prescribed by existing
 
182   application protocols that use SASLprep.  If the community that uses
 
183   such an application protocol wishes to modernize its handling of
 
184   internationalized strings to use PRECIS instead of Stringprep, it
 
185   needs to explicitly update the existing application protocol
 
186   definition (one example is [RFC7622]).  Non-coordinated updates to
 
187   protocol implementations are discouraged because they can have a
 
188   negative impact on interoperability and security.
 
192   A "username" or "user identifier" is a string of characters
 
193   designating an account on a computing device or system, often but not
 
194   necessarily for use by a person.  Although some devices and systems
 
195   might allow a username to be part or all of a person's name and a
 
196   person might want their account designator to be part or all of their
 
197   name, because of the complexities involved, that outcome is not
 
198   guaranteed for all human names on all computing devices or systems
 
199   that follow the rules defined in this specification.  Protocol
 
200   designers and application developers who wish to allow a wider range
 
201   of characters are encouraged to consider a separation between more
 
202   restrictive account identifiers and more expressive display names or
 
203   nicknames (see [RFC8266]).
 
205   A "password" is a string of characters that allows access to a
 
206   computing device or system, often associated with a particular
 
207   username.  A password is not literally limited to a word, because a
 
208   password could be a passphrase consisting of more than one word,
 
209   perhaps separated by spaces, punctuation, or other non-alphanumeric
 
212   Some SASL mechanisms (e.g., CRAM-MD5, DIGEST-MD5, and SCRAM) specify
 
213   that the authentication identity used in the context of such
 
214   mechanisms is a "simple username" (see Section 2 of [RFC4422] as well
 
215   as [RFC4013]).  Various application technologies also assume that the
 
216   identity of a user or account takes the form of a username (e.g.,
 
217   authentication for the Hypertext Transfer Protocol as specified in
 
218   [RFC7617] and [RFC7616]), whether or not they use SASL.  Note well
 
219   that the exact form of a username in any particular SASL mechanism or
 
220   application technology is a matter for implementation and deployment;
 
221   note also that a username does not necessarily map to any particular
 
222   application identifier.
 
226Saint-Andre & Melnikov       Standards Track                    [Page 4]
 
228RFC 8265             PRECIS: Usernames and Passwords        October 2017
 
231   Many important terms used in this document are defined in [RFC5890],
 
232   [RFC6365], [RFC8264], and [Unicode].  The term "non-ASCII space"
 
233   refers to any Unicode code point having a Unicode general category of
 
234   "Zs", naturally with the exception of SPACE (U+0020).
 
236   The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
 
237   "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and
 
238   "OPTIONAL" in this document are to be interpreted as described in
 
239   BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all
 
240   capitals, as shown here.
 
246   This document specifies that a username is a string of Unicode code
 
247   points [Unicode] that is structured as an ordered sequence of
 
248   "userparts" and expressed in a standard Unicode Encoding Form (such
 
249   as UTF-8 [RFC3629]).  A userpart is allowed to contain only code
 
250   points that are allowed by the PRECIS IdentifierClass defined in
 
251   Section 4.2 of [RFC8264] and thus consists almost exclusively of
 
252   letters and digits.  A username can consist of a single userpart or a
 
253   space-separated sequence of userparts.
 
255   The syntax for a username is defined as follows, using the Augmented
 
256   Backus-Naur Form (ABNF) [RFC5234].
 
258      username   = userpart *(1*SP userpart)
 
259      userpart   = 1*(idpoint)
 
261                   ; an "idpoint" is a Unicode code point that
 
262                   ; can be contained in a string conforming to
 
263                   ; the PRECIS IdentifierClass
 
266   All code points and blocks not explicitly allowed in the PRECIS
 
267   IdentifierClass are disallowed; this includes private-use code
 
268   points, surrogate code points, and the other code points and blocks
 
269   that were defined as "Prohibited Output" in Section 2.3 of [RFC4013]
 
270   (when corrected per [Err1812]).  In addition, common constructions
 
271   such as "user@example.com" (e.g., the Network Access Identifier from
 
272   [RFC7542]) are allowed as usernames under this specification, as they
 
273   were under [RFC4013].
 
275      Implementation Note: The username construct defined in this
 
276      document does not necessarily match what all deployed applications
 
277      might refer to as a "username" or "userid" but instead provides a
 
278      relatively safe subset of Unicode code points that can be used in
 
282Saint-Andre & Melnikov       Standards Track                    [Page 5]
 
284RFC 8265             PRECIS: Usernames and Passwords        October 2017
 
287      existing SASL mechanisms and in application protocols that use
 
288      SASL, and even in most application protocols that do not currently
 
291   A username MUST NOT be zero bytes in length.  This rule is to be
 
292   enforced after any normalization and mapping of code points.
 
294   This specification defines two profiles for usernames: the
 
295   UsernameCaseMapped profile performs case mapping, and the
 
296   UsernameCasePreserved performs case preservation (see further
 
297   discussion under Section 3.2).
 
299   In protocols that provide usernames as input to a cryptographic
 
300   algorithm such as a hash function, the client will need to perform
 
301   enforcement of the rules for the UsernameCaseMapped or
 
302   UsernameCasePreserved profile before applying the algorithm.
 
3043.2.  Case Mapping vs. Case Preservation
 
306   In order to accommodate the widest range of username constructs in
 
307   applications, this document defines two username profiles:
 
308   UsernameCaseMapped and UsernameCasePreserved.  These two profiles
 
309   differ only in their use (or not) of the Case Mapping Rule and are
 
312   Case mapping is a matter for the application protocol, protocol
 
313   implementation, or end deployment.  In general, this document
 
314   suggests that it is preferable to apply the UsernameCaseMapped
 
315   profile and therefore perform case mapping, because not doing so can
 
316   lead to false accepts during authentication and authorization (as
 
317   described in [RFC6943]) and can result in confusion among end users,
 
318   given the prevalence of case mapping in many existing protocols and
 
319   applications.  However, there can be good reasons to apply the
 
320   UsernameCasePreserved profile and thus not perform case mapping, such
 
321   as backward compatibility with deployed infrastructure.
 
325   o  SASL mechanisms that follow the recommendations in this document
 
326      MUST specify whether and when case mapping is to be applied to
 
327      authentication identifiers.  Because case mapping results in
 
328      information loss, in order to retain that information for as long
 
329      as possible during processing, implementations SHOULD delay any
 
330      case mapping to the last possible moment, such as when doing a
 
331      lookup by username, performing username comparisons, or generating
 
332      a cryptographic salt from a username (if the last possible moment
 
333      happens on a server, then decisions about case mapping can be a
 
334      matter of service deployment policy).  In keeping with [RFC4422],
 
338Saint-Andre & Melnikov       Standards Track                    [Page 6]
 
340RFC 8265             PRECIS: Usernames and Passwords        October 2017
 
343      SASL mechanisms are not to apply this or any other profile to
 
344      authorization identifiers, only to authentication identifiers.
 
346   o  Application protocols that use SASL (such as IMAP [RFC3501] and
 
347      the Extensible Messaging and Presence Protocol (XMPP) [RFC6120])
 
348      and that directly reuse this profile MUST specify whether or not
 
349      case mapping is to be applied to authorization identifiers.  Such
 
350      "SASL application protocols" SHOULD delay any case mapping of
 
351      authorization identifiers to the last possible moment, which
 
352      happens to necessarily be on the server side (this enables
 
353      decisions about case mapping to be a matter of service deployment
 
354      policy).  In keeping with [RFC4422], SASL application protocols
 
355      are not to apply this or any other profile to authentication
 
356      identifiers, only to authorization identifiers.
 
358   o  Application protocols that do not use SASL (such as HTTP
 
359      authentication with the HTTP Basic and Digest schemes as specified
 
360      in [RFC7617] and [RFC7616]) but that directly reuse this profile
 
361      MUST specify whether and when case mapping is to be applied to
 
362      authentication identifiers or authorization identifiers, or both.
 
363      Such "non-SASL application protocols" SHOULD delay any case
 
364      mapping to the last possible moment, such as when doing a lookup
 
365      by username, performing username comparisons, or generating a
 
366      cryptographic salt from a username (if the last possible moment
 
367      happens on the server, then decisions about case mapping can be a
 
368      matter of service deployment policy).
 
370   If the specification for a SASL mechanism, SASL application protocol,
 
371   or non-SASL application protocol uses the UsernameCaseMapped profile,
 
372   it MUST clearly describe whether case mapping is to be applied at the
 
373   level of the protocol itself, implementations thereof, or service
 
374   deployments (each of these approaches can be legitimate, depending on
 
375   the application in question).
 
3773.3.  UsernameCaseMapped Profile
 
381   The following rules are defined for use within the UsernameCaseMapped
 
382   profile of the PRECIS IdentifierClass.
 
384   1.  Width Mapping Rule: Map fullwidth and halfwidth code points to
 
385       their decomposition mappings (see Unicode Standard Annex #11
 
388   2.  Additional Mapping Rule: There is no additional mapping rule.
 
394Saint-Andre & Melnikov       Standards Track                    [Page 7]
 
396RFC 8265             PRECIS: Usernames and Passwords        October 2017
 
399   3.  Case Mapping Rule: Map uppercase and titlecase code points to
 
400       their lowercase equivalents, preferably using the Unicode
 
401       toLowerCase() operation as defined in the Unicode Standard
 
402       [Unicode]; see further discussion in Section 3.2.
 
404   4.  Normalization Rule: Apply Unicode Normalization Form C (NFC) to
 
407   5.  Directionality Rule: Apply the "Bidi Rule" defined in [RFC5893]
 
408       to strings that contain right-to-left code points (i.e., each of
 
409       the six conditions of the Bidi Rule must be satisfied); for
 
410       strings that do not contain right-to-left code points, there is
 
411       no special processing for directionality.
 
415   An entity that prepares an input string for subsequent enforcement
 
416   according to this profile MUST proceed as follows (applying the steps
 
419   1.  Apply the width mapping rule specified in Section 3.3.1.  It is
 
420       necessary to apply the rule at this point because otherwise the
 
421       PRECIS "HasCompat" category specified in Section 9.17 of
 
422       [RFC8264] would forbid fullwidth and halfwidth code points.
 
424   2.  Ensure that the string consists only of Unicode code points that
 
425       are explicitly allowed by the PRECIS IdentifierClass defined in
 
426       Section 4.2 of [RFC8264].
 
430   An entity that performs enforcement according to this profile MUST
 
431   prepare an input string as described in Section 3.3.2 and MUST also
 
432   apply the following rules specified in Section 3.3.1 in the order
 
437   2.  Normalization Rule
 
439   3.  Directionality Rule
 
441   After all of the foregoing rules have been enforced, the entity MUST
 
442   ensure that the username is not zero bytes in length (this is done
 
443   after enforcing the rules to prevent applications from mistakenly
 
444   omitting a username entirely, because when internationalized strings
 
445   are accepted, a non-empty sequence of characters can result in a
 
446   zero-length username after canonicalization).
 
450Saint-Andre & Melnikov       Standards Track                    [Page 8]
 
452RFC 8265             PRECIS: Usernames and Passwords        October 2017
 
455   The result of the foregoing operations is an output string that
 
456   conforms to the UsernameCaseMapped profile.  Until an implementation
 
457   produces such an output string, it MUST NOT treat the string as
 
458   conforming (in particular, it MUST NOT assume that an input string is
 
459   conforming before the enforcement operation has been completed).
 
463   An entity that performs comparison of two strings according to this
 
464   profile MUST prepare each string as specified in Section 3.3.2 and
 
465   then MUST enforce the rules specified in Section 3.3.3.  The two
 
466   strings are to be considered equivalent if and only if they are an
 
467   exact octet-for-octet match (sometimes called "bit-string identity").
 
469   Until an implementation determines whether two strings are to be
 
470   considered equivalent, it MUST NOT treat them as equivalent (in
 
471   particular, it MUST NOT assume that two input strings are equivalent
 
472   before the comparison operation has been completed).
 
4743.4.  UsernameCasePreserved Profile
 
478   The following rules are defined for use within the
 
479   UsernameCasePreserved profile of the PRECIS IdentifierClass.
 
481   1.  Width Mapping Rule: Map fullwidth and halfwidth code points to
 
482       their decomposition mappings (see Unicode Standard Annex #11
 
485   2.  Additional Mapping Rule: There is no additional mapping rule.
 
487   3.  Case Mapping Rule: There is no case mapping rule.
 
489   4.  Normalization Rule: Apply Unicode Normalization Form C (NFC) to
 
492   5.  Directionality Rule: Apply the "Bidi Rule" defined in [RFC5893]
 
493       to strings that contain right-to-left code points (i.e., each of
 
494       the six conditions of the Bidi Rule must be satisfied); for
 
495       strings that do not contain right-to-left code points, there is
 
496       no special processing for directionality.
 
500   An entity that prepares a string for subsequent enforcement according
 
501   to this profile MUST proceed as follows (applying the steps in the
 
506Saint-Andre & Melnikov       Standards Track                    [Page 9]
 
508RFC 8265             PRECIS: Usernames and Passwords        October 2017
 
511   1.  Apply the width mapping rule specified in Section 3.4.1.  It is
 
512       necessary to apply the rule at this point because otherwise the
 
513       PRECIS "HasCompat" category specified in Section 9.17 of
 
514       [RFC8264] would forbid fullwidth and halfwidth code points.
 
516   2.  Ensure that the string consists only of Unicode code points that
 
517       are explicitly allowed by the PRECIS IdentifierClass defined in
 
518       Section 4.2 of [RFC8264].
 
522   An entity that performs enforcement according to this profile MUST
 
523   prepare a string as described in Section 3.4.2 and MUST also apply
 
524   the following rules specified in Section 3.4.1 in the order shown:
 
526   1.  Normalization Rule
 
528   2.  Directionality Rule
 
530   After all of the foregoing rules have been enforced, the entity MUST
 
531   ensure that the username is not zero bytes in length (this is done
 
532   after enforcing the rules to prevent applications from mistakenly
 
533   omitting a username entirely, because when internationalized strings
 
534   are accepted, a non-empty sequence of characters can result in a
 
535   zero-length username after canonicalization).
 
537   The result of the foregoing operations is an output string that
 
538   conforms to the UsernameCasePreserved profile.  Until an
 
539   implementation produces such an output string, it MUST NOT treat the
 
540   string as conforming (in particular, it MUST NOT assume that an input
 
541   string is conforming before the enforcement operation has been
 
546   An entity that performs comparison of two strings according to this
 
547   profile MUST prepare each string as specified in Section 3.4.2 and
 
548   then MUST enforce the rules specified in Section 3.4.3.  The two
 
549   strings are to be considered equivalent if and only if they are an
 
550   exact octet-for-octet match (sometimes called "bit-string identity").
 
552   Until an implementation determines whether two strings are to be
 
553   considered equivalent, it MUST NOT treat them as equivalent (in
 
554   particular, it MUST NOT assume that two input strings are equivalent
 
555   before the comparison operation has been completed).
 
562Saint-Andre & Melnikov       Standards Track                   [Page 10]
 
564RFC 8265             PRECIS: Usernames and Passwords        October 2017
 
5673.5.  Application-Layer Constructs
 
569   Both the UsernameCaseMapped and UsernameCasePreserved profiles enable
 
570   an application protocol, implementation, or deployment to create
 
571   application-layer constructs such as a username that is a space-
 
572   separated set of userparts like "Firstname Middlename Lastname".
 
573   Such a construct is not a profile of the PRECIS IdentifierClass,
 
574   because SPACE (U+0020) is not allowed in the IdentifierClass;
 
575   however, it can be created at the application layer because SPACE
 
576   (U+0020) can be used as a separator between instances of the PRECIS
 
577   IdentifierClass (e.g., userparts as defined in this specification).
 
581   The following examples illustrate a small number of userparts (not
 
582   usernames) that are consistent with the format defined above (note
 
583   that the characters "<" and ">" are used here to delineate the actual
 
584   userparts and are not part of the userpart strings).
 
586      +--------------------------+---------------------------------+
 
587      | # | Userpart             | Notes                           |
 
588      +--------------------------+---------------------------------+
 
589      | 1 | <juliet@example.com> | The "at" sign ("@") is allowed  |
 
590      |   |                      | in the PRECIS IdentifierClass   |
 
591      +--------------------------+---------------------------------+
 
593      +--------------------------+---------------------------------+
 
594      | 3 | <fußball>            | The third character is LATIN    |
 
595      |   |                      | SMALL LETTER SHARP S (U+00DF)   |
 
596      +--------------------------+---------------------------------+
 
597      | 4 | <π>                  | A userpart of GREEK SMALL       |
 
598      |   |                      | LETTER PI (U+03C0)              |
 
599      +--------------------------+---------------------------------+
 
600      | 5 | <Σ>                  | A userpart of GREEK CAPITAL     |
 
601      |   |                      | LETTER SIGMA (U+03A3)           |
 
602      +--------------------------+---------------------------------+
 
603      | 6 | <σ>                  | A userpart of GREEK SMALL       |
 
604      |   |                      | LETTER SIGMA (U+03C3)           |
 
605      +--------------------------+---------------------------------+
 
606      | 7 | <ς>                  | A userpart of GREEK SMALL       |
 
607      |   |                      | LETTER FINAL SIGMA (U+03C2)     |
 
608      +--------------------------+---------------------------------+
 
610                   Table 1: A Sample of Legal Userparts
 
612   Regarding examples 2 and 3: although in German writing the character
 
613   eszett "ß" (LATIN SMALL LETTER SHARP S, U+00DF) can mostly be used
 
614   interchangeably with the two characters "ss", the userparts in these
 
618Saint-Andre & Melnikov       Standards Track                   [Page 11]
 
620RFC 8265             PRECIS: Usernames and Passwords        October 2017
 
623   examples are different and (if desired) a server would need to
 
624   enforce a registration policy that disallows one of them if the other
 
627   Regarding examples 5, 6, and 7: optional case mapping of "Σ" (GREEK
 
628   CAPITAL LETTER SIGMA, U+03A3) to the lowercase character "σ" (GREEK
 
629   SMALL LETTER SIGMA, U+03C3) during comparison would result in
 
630   matching the userparts in examples 5 and 6; however, because the
 
631   PRECIS mapping rules do not account for the special status of the
 
632   character "ς" (GREEK SMALL LETTER FINAL SIGMA, U+03C2), the userparts
 
633   in examples 5 and 7 or examples 6 and 7 would not be matched during
 
636   The following examples illustrate strings that are not valid
 
637   userparts (not usernames) because they violate the format defined
 
640      +--------------------------+---------------------------------+
 
641      | # | Non-Userpart String  | Notes                           |
 
642      +--------------------------+---------------------------------+
 
643      | 8 | <foo bar>            | SPACE (U+0020) is disallowed in |
 
645      +--------------------------+---------------------------------+
 
646      | 9 | <>                   | Zero-length userpart            |
 
647      +--------------------------+---------------------------------+
 
648      | 10| <henryⅣ>            | The sixth character is ROMAN    |
 
649      |   |                      | NUMERAL FOUR (U+2163)           |
 
650      +--------------------------+---------------------------------+
 
651      | 11| <∞>                  | A userpart of INFINITY (U+221E) |
 
652      +--------------------------+---------------------------------+
 
654       Table 2: A Sample of Strings That Violate the Userpart Rules
 
656   Regarding example 8: although this is not a valid userpart, it is a
 
657   valid username because it is a space-separated sequence of userparts.
 
659   Regarding example 10: the character "Ⅳ" (ROMAN NUMERAL FOUR, U+2163)
 
660   has a compatibility equivalent of the characters "I" (LATIN CAPITAL
 
661   LETTER I, U+0049) and "V" (LATIN CAPITAL LETTER V, U+0056), but code
 
662   points with compatibility equivalents are not allowed in the PRECIS
 
665   Regarding example 11: symbol characters such as "∞" (INFINITY,
 
666   U+221E) are not allowed in the PRECIS IdentifierClass.
 
674Saint-Andre & Melnikov       Standards Track                   [Page 12]
 
676RFC 8265             PRECIS: Usernames and Passwords        October 2017
 
683   This document specifies that a password is a string of Unicode code
 
684   points [Unicode] that is conformant to the OpaqueString profile
 
685   (specified below) of the PRECIS FreeformClass defined in Section 4.3
 
686   of [RFC8264] and expressed in a standard Unicode Encoding Form (such
 
689   The syntax for a password is defined as follows, using the Augmented
 
690   Backus-Naur Form (ABNF) [RFC5234].
 
692      password   = 1*(freepoint)
 
694                   ; a "freepoint" is a Unicode code point that
 
695                   ; can be contained in a string conforming to
 
696                   ; the PRECIS FreeformClass
 
699   All code points and blocks not explicitly allowed in the PRECIS
 
700   FreeformClass are disallowed; this includes private-use code points,
 
701   surrogate code points, and the other code points and blocks defined
 
702   as "Prohibited Output" in Section 2.3 of [RFC4013] (when corrected
 
705   A password MUST NOT be zero bytes in length.  This rule is to be
 
706   enforced after any normalization and mapping of code points.
 
708      Note: Some existing systems allow an empty string in places where
 
709      a password would be expected (e.g., command-line tools that might
 
710      be called from an automated script, or servers that might need to
 
711      be restarted without human intervention).  From the perspective of
 
712      this document (and RFC 4013 before it), these empty strings are
 
713      not passwords but are workarounds for the practical difficulty of
 
714      using passwords in certain scenarios.
 
716      Note: The prohibition of zero-length passwords is not a
 
717      recommendation regarding password strength (because a password of
 
718      only one byte is highly insecure) but is meant to prevent
 
719      applications from mistakenly omitting a password entirely; such an
 
720      outcome is possible when internationalized strings are accepted,
 
721      because a non-empty sequence of characters can result in a zero-
 
722      length password after canonicalization.
 
724   In protocols that provide passwords as input to a cryptographic
 
725   algorithm such as a hash function, the client will need to perform
 
726   enforcement of the rules for the OpaqueString profile before applying
 
730Saint-Andre & Melnikov       Standards Track                   [Page 13]
 
732RFC 8265             PRECIS: Usernames and Passwords        October 2017
 
735   the algorithm, because the password is not available to the server in
 
7384.2.  OpaqueString Profile
 
740   The definition of the OpaqueString profile is provided in the
 
741   following sections, including detailed information about preparation,
 
742   enforcement, and comparison (for details on the distinction between
 
743   these actions, refer to [RFC8264]).
 
747   An entity that prepares a string according to this profile MUST
 
748   ensure that the string consists only of Unicode code points that are
 
749   explicitly allowed by the FreeformClass string class defined in
 
754   An entity that performs enforcement according to this profile MUST
 
755   prepare a string as described in Section 4.2.1 and MUST also apply
 
756   the rules specified below for the OpaqueString profile (these rules
 
757   MUST be applied in the order shown):
 
759   1.  Width Mapping Rule: Fullwidth and halfwidth code points MUST NOT
 
760       be mapped to their decomposition mappings (see Unicode Standard
 
763   2.  Additional Mapping Rule: Any instances of non-ASCII space MUST be
 
764       mapped to SPACE (U+0020); a non-ASCII space is any Unicode code
 
765       point having a Unicode general category of "Zs", with the
 
766       exception of SPACE (U+0020).  As was the case in RFC 4013, the
 
767       inclusion of only SPACE (U+0020) prevents confusion with various
 
768       non-ASCII space code points, many of which are difficult to
 
769       reproduce across different input methods.
 
771   3.  Case Mapping Rule: There is no case mapping rule (because mapping
 
772       uppercase and titlecase code points to their lowercase
 
773       equivalents would lead to false accepts and thus to reduced
 
776   4.  Normalization Rule: Unicode Normalization Form C (NFC) MUST be
 
777       applied to all strings.
 
779   5.  Directionality Rule: There is no directionality rule.  The "Bidi
 
780       Rule" (defined in [RFC5893]) and similar rules are unnecessary
 
781       and inapplicable to passwords, because they can reduce the
 
782       repertoire of characters that are allowed in a string and
 
786Saint-Andre & Melnikov       Standards Track                   [Page 14]
 
788RFC 8265             PRECIS: Usernames and Passwords        October 2017
 
791       therefore reduce the amount of entropy that is possible in a
 
792       password.  Such rules are intended to minimize the possibility
 
793       that the same string will be displayed differently on a layout
 
794       system set for right-to-left display and a layout system set for
 
795       left-to-right display; however, passwords are typically not
 
796       displayed at all and are rarely meant to be interoperable across
 
797       different layout systems in the way that non-secret strings like
 
798       domain names and usernames are.  Furthermore, it is perfectly
 
799       acceptable for opaque strings other than passwords to be
 
800       presented differently in different layout systems, as long as the
 
801       presentation is consistent in any given layout system.
 
803   The result of the foregoing operations is an output string that
 
804   conforms to the OpaqueString profile.  Until an implementation
 
805   produces such an output string, it MUST NOT treat the string as
 
806   conforming (in particular, it MUST NOT assume that an input string is
 
807   conforming before the enforcement operation has been completed).
 
811   An entity that performs comparison of two strings according to this
 
812   profile MUST prepare each string as specified in Section 4.2.1 and
 
813   then MUST enforce the rules specified in Section 4.2.2.  The two
 
814   strings are to be considered equivalent if and only if they are an
 
815   exact octet-for-octet match (sometimes called "bit-string identity").
 
817   Until an implementation determines whether two strings are to be
 
818   considered equivalent, it MUST NOT treat them as equivalent (in
 
819   particular, it MUST NOT assume that two input strings are equivalent
 
820   before the comparison operation has been completed).
 
822   See Section 8.2 regarding comparison of passwords and passphrases.
 
826   The following examples illustrate a small number of passwords that
 
827   are consistent with the format defined above (note that the
 
828   characters "<" and ">" are used here to delineate the actual
 
829   passwords and are not part of the password strings).
 
842Saint-Andre & Melnikov       Standards Track                   [Page 15]
 
844RFC 8265             PRECIS: Usernames and Passwords        October 2017
 
847   +------------------------------------+------------------------------+
 
848   | # | Password                       | Notes                        |
 
849   +------------------------------------+------------------------------+
 
850   | 12| <correct horse battery staple> | SPACE (U+0020) is allowed    |
 
851   +------------------------------------+------------------------------+
 
852   | 13| <Correct Horse Battery Staple> | Differs by case from         |
 
854   +------------------------------------+------------------------------+
 
855   | 14| <πßå>                          | Non-ASCII letters are OK     |
 
856   |   |                                | (e.g., GREEK SMALL LETTER    |
 
858   +------------------------------------+------------------------------+
 
859   | 15| <Jack of ♦s>                   | Symbols are OK (e.g., BLACK  |
 
860   |   |                                | DIAMOND SUIT (U+2666))       |
 
861   +------------------------------------+------------------------------+
 
862   | 16| <foo bar>                      | OGHAM SPACE MARK (U+1680) is |
 
863   |   |                                | mapped to SPACE (U+0020);    |
 
864   |   |                                | thus, the full string is     |
 
865   |   |                                | mapped to <foo bar>          |
 
866   +------------------------------------+------------------------------+
 
868                   Table 3: A Sample of Legal Passwords
 
870   The following examples illustrate strings that are not valid
 
871   passwords because they violate the format defined above.
 
873   +------------------------------------+------------------------------+
 
874   | # | Password                       | Notes                        |
 
875   +------------------------------------+------------------------------+
 
876   | 17| <>                             | Zero-length passwords are    |
 
878   +------------------------------------+------------------------------+
 
879   | 18| <my cat is a 	by>          | Control characters like TAB  |
 
880   |   |                                | (U+0009) are disallowed      |
 
881   +------------------------------------+------------------------------+
 
883       Table 4: A Sample of Strings That Violate the Password Rules
 
885   Note: Following the "XML Notation" used in [RFC3987], the character
 
886   TAB (U+0009) in example 18 is represented as 	 because otherwise
 
887   it could not be shown in running text.
 
8895.  Use in Application Protocols
 
891   This specification defines only the PRECIS-based rules for the
 
892   handling of strings conforming to the UsernameCaseMapped and
 
893   UsernameCasePreserved profiles of the PRECIS IdentifierClass, and
 
894   strings conforming to the OpaqueString profile of the PRECIS
 
898Saint-Andre & Melnikov       Standards Track                   [Page 16]
 
900RFC 8265             PRECIS: Usernames and Passwords        October 2017
 
903   FreeformClass.  It is the responsibility of an application protocol
 
904   to specify the protocol slots in which such strings can appear, the
 
905   entities that are expected to enforce the rules governing such
 
906   strings, and at what points during protocol processing or interface
 
907   handling the rules need to be enforced.  See Section 6 of [RFC8264]
 
908   for guidelines on using PRECIS profiles in applications.
 
910   Above and beyond the PRECIS-based rules specified here, application
 
911   protocols can also define application-specific rules governing such
 
912   strings (rules regarding minimum or maximum length, further
 
913   restrictions on allowable code points or character ranges, safeguards
 
914   to mitigate the effects of visually similar characters, etc.),
 
915   application-layer constructs (see Section 3.5), and related matters.
 
917   Some PRECIS profile definitions encourage entities that enforce the
 
918   rules to be liberal in what they accept.  However, for usernames and
 
919   passwords such a policy can be problematic, because it can lead to
 
920   false accepts.  An in-depth discussion can be found in [RFC6943].
 
922   Applying the rules for any given PRECIS profile is not necessarily an
 
923   idempotent procedure for all code points.  Therefore, an
 
924   implementation SHOULD apply the rules repeatedly until the output
 
925   string is stable; if the output string does not stabilize after
 
926   reapplying the rules three (3) additional times after the first
 
927   application, the implementation SHOULD terminate application of the
 
928   rules and reject the input string as invalid.
 
932   The rules defined in this specification differ slightly from those
 
933   defined by the SASLprep specification [RFC4013] (but not from
 
934   [RFC7613]).  In order to smooth the process of migrating from
 
935   SASLprep to the approach defined herein, the following sections
 
936   describe these differences, along with their implications for
 
937   migration, in more detail.
 
941   Deployments that currently use SASLprep for handling usernames might
 
942   need to scrub existing data when they migrate to the rules defined in
 
943   this specification.  In particular:
 
945   o  SASLprep specified the use of Unicode Normalization Form KC
 
946      (NFKC), whereas the UsernameCaseMapped and UsernameCasePreserved
 
947      profiles employ Unicode Normalization Form C (NFC).  In practice,
 
948      this change is unlikely to cause significant problems, because
 
949      NFKC provides methods for mapping Unicode code points with
 
950      compatibility equivalents to those equivalents, whereas the PRECIS
 
954Saint-Andre & Melnikov       Standards Track                   [Page 17]
 
956RFC 8265             PRECIS: Usernames and Passwords        October 2017
 
959      IdentifierClass entirely disallows Unicode code points with
 
960      compatibility equivalents (i.e., during comparison, NFKC is more
 
961      "aggressive" about finding matches than NFC).  A few examples
 
962      might suffice to indicate the nature of the problem:
 
964      1.  "ſ" (LATIN SMALL LETTER LONG S, U+017F) is compatibility
 
965          equivalent to "s" (LATIN SMALL LETTER S, U+0073).
 
967      2.  "Ⅳ" (ROMAN NUMERAL FOUR, U+2163) is compatibility equivalent
 
968          to "I" (LATIN CAPITAL LETTER I, U+0049) and "V" (LATIN CAPITAL
 
971      3.  "fi" (LATIN SMALL LIGATURE FI, U+FB01) is compatibility
 
972          equivalent to "f" (LATIN SMALL LETTER F, U+0066) and "i"
 
973          (LATIN SMALL LETTER I, U+0069).
 
975      Under SASLprep, the use of NFKC also handled the mapping of
 
976      fullwidth and halfwidth code points to their decomposition
 
979      For migration purposes, operators might want to search their
 
980      database of usernames for names containing Unicode code points
 
981      with compatibility equivalents and, where there is no conflict,
 
982      map those code points to their equivalents.  Naturally, it is
 
983      possible that during this process the operator will discover
 
984      conflicting usernames; for instance, "HENRYIV" with the last two
 
985      code points being LATIN CAPITAL LETTER I (U+0049) and LATIN
 
986      CAPITAL LETTER V (U+0056) as opposed to "HENRYⅣ" with the last
 
987      character being "Ⅳ" (ROMAN NUMERAL FOUR, U+2163), which is
 
988      compatibility equivalent to U+0049 and U+0056).  In these cases,
 
989      the operator will need to determine how to proceed, for instance,
 
990      by disabling the account whose name contains a Unicode code point
 
991      with a compatibility equivalent.  Such cases are probably rare,
 
992      but it is important for operators to be aware of them.
 
994   o  SASLprep mapped the "characters commonly mapped to nothing" (from
 
995      Appendix B.1 of [RFC3454]) to nothing, whereas the PRECIS
 
996      IdentifierClass entirely disallows most of these code points,
 
997      which correspond to the code points from the PRECIS "M" category
 
998      defined under Section 9.13 of [RFC8264].  For migration purposes,
 
999      the operator might want to remove from usernames any code points
 
1000      contained in the PRECIS "M" category (e.g., SOFT HYPHEN (U+00AD)).
 
1001      Because these code points would have been "mapped to nothing" in
 
1002      Stringprep, in practice a user would not notice the difference if,
 
1003      upon migration to PRECIS, the code points are removed.
 
1005   o  SASLprep allowed uppercase and titlecase code points, whereas the
 
1006      UsernameCaseMapped profile maps uppercase and titlecase code
 
1010Saint-Andre & Melnikov       Standards Track                   [Page 18]
 
1012RFC 8265             PRECIS: Usernames and Passwords        October 2017
 
1015      points to their lowercase equivalents (by contrast, the
 
1016      UsernameCasePreserved profile matches SASLprep in this regard).
 
1017      For migration purposes, the operator can use either the
 
1018      UsernameCaseMapped profile (thus losing the case information) or
 
1019      the UsernameCasePreserved profile (thus ignoring case difference
 
1020      when comparing usernames).
 
1024   Depending on local service policy, migration from SASLprep to this
 
1025   specification might not involve any scrubbing of data (because
 
1026   passwords might not be stored in the clear anyway); however, service
 
1027   providers need to be aware of possible issues that might arise during
 
1028   migration.  In particular:
 
1030   o  SASLprep specified the use of Unicode Normalization Form KC
 
1031      (NFKC), whereas the OpaqueString profile employs Unicode
 
1032      Normalization Form C (NFC).  Because NFKC is more aggressive about
 
1033      finding matches than NFC, in practice this change is unlikely to
 
1034      cause significant problems and indeed has the security benefit of
 
1035      probably resulting in fewer false accepts when comparing
 
1036      passwords.  A few examples might suffice to indicate the nature of
 
1039      1.  "ſ" (LATIN SMALL LETTER LONG S, U+017F) is compatibility
 
1040          equivalent to "s" (LATIN SMALL LETTER S, U+0073).
 
1042      2.  "Ⅳ" (ROMAN NUMERAL FOUR, U+2163) is compatibility equivalent
 
1043          to "I" (LATIN CAPITAL LETTER I, U+0049) and "V" (LATIN CAPITAL
 
1046      3.  "fi" (LATIN SMALL LIGATURE FI, U+FB01) is compatibility
 
1047          equivalent to "f" (LATIN SMALL LETTER F, U+0066) and "i"
 
1048          (LATIN SMALL LETTER I, U+0069).
 
1050      Under SASLprep, the use of NFKC also handled the mapping of
 
1051      fullwidth and halfwidth code points to their decomposition
 
1052      mappings.  Although it is expected that code points with
 
1053      compatibility equivalents are rare in existing passwords, some
 
1054      passwords that matched when SASLprep was used might no longer work
 
1055      when the rules in this specification are applied.
 
1057   o  SASLprep mapped the "characters commonly mapped to nothing" (from
 
1058      Appendix B.1 of [RFC3454]) to nothing, whereas the PRECIS
 
1059      FreeformClass entirely disallows such code points, which
 
1060      correspond to the code points from the PRECIS "M" category defined
 
1061      under Section 9.13 of [RFC8264].  In practice, this change will
 
1062      probably have no effect on comparison, but user-oriented software
 
1066Saint-Andre & Melnikov       Standards Track                   [Page 19]
 
1068RFC 8265             PRECIS: Usernames and Passwords        October 2017
 
1071      might reject such code points instead of ignoring them during
 
1072      password preparation.
 
10747.  IANA Considerations
 
1076   IANA has made the updates described below.
 
10787.1.  UsernameCaseMapped Profile
 
1080   IANA has added the following entry to the "PRECIS Profiles" registry.
 
1082   Name:  UsernameCaseMapped.
 
1084   Base Class:  IdentifierClass.
 
1086   Applicability:  Usernames in security and application protocols.
 
1088   Replaces:  The SASLprep profile of Stringprep.
 
1090   Width Mapping Rule:  Map fullwidth and halfwidth code points to their
 
1091      decomposition mappings.
 
1093   Additional Mapping Rule:  None.
 
1095   Case Mapping Rule:  Map uppercase and titlecase code points to
 
1098   Normalization Rule:  NFC.
 
1100   Directionality Rule:  The "Bidi Rule" defined in RFC 5893 applies.
 
1102   Enforcement:  To be defined by security or application protocols that
 
1105   Specification:  Section 3.3 of RFC 8265.
 
11077.2.  UsernameCasePreserved Profile
 
1109   IANA has added the following entry to the "PRECIS Profiles" registry.
 
1111   Name:  UsernameCasePreserved.
 
1113   Base Class:  IdentifierClass.
 
1115   Applicability:  Usernames in security and application protocols.
 
1117   Replaces:  The SASLprep profile of Stringprep.
 
1122Saint-Andre & Melnikov       Standards Track                   [Page 20]
 
1124RFC 8265             PRECIS: Usernames and Passwords        October 2017
 
1127   Width Mapping Rule:  Map fullwidth and halfwidth code points to their
 
1128      decomposition mappings.
 
1130   Additional Mapping Rule:  None.
 
1132   Case Mapping Rule:  None.
 
1134   Normalization Rule:  NFC.
 
1136   Directionality Rule:  The "Bidi Rule" defined in RFC 5893 applies.
 
1138   Enforcement:  To be defined by security or application protocols that
 
1141   Specification:  Section 3.4 of RFC 8265.
 
11437.3.  OpaqueString Profile
 
1145   IANA has added the following entry to the "PRECIS Profiles" registry.
 
1149   Base Class:  FreeformClass.
 
1151   Applicability:  Passwords and other opaque strings in security and
 
1152      application protocols.
 
1154   Replaces:  The SASLprep profile of Stringprep.
 
1156   Width Mapping Rule:  None.
 
1158   Additional Mapping Rule:  Map non-ASCII space code points to SPACE
 
1161   Case Mapping Rule:  None.
 
1163   Normalization Rule:  NFC.
 
1165   Directionality Rule:  None.
 
1167   Enforcement:  To be defined by security or application protocols that
 
1170   Specification:  Section 4.2 of RFC 8265.
 
1178Saint-Andre & Melnikov       Standards Track                   [Page 21]
 
1180RFC 8265             PRECIS: Usernames and Passwords        October 2017
 
11837.4.  Stringprep Profile
 
1185   The Stringprep specification [RFC3454] did not provide for entries in
 
1186   the "Stringprep Profiles" registry to have any state except "Current"
 
1187   or "Not Current".  Because RFC 7613 obsoleted RFC 4013, which
 
1188   registered the SASLprep profile of Stringprep, IANA previously marked
 
1189   that profile as "Not Current" and cited RFC 7613 as an additional
 
1190   reference.  IANA has modified the profile so that the current
 
1191   document is now cited as the additional reference.
 
11938.  Security Considerations
 
11958.1.  Password/Passphrase Strength
 
1197   The ability to include a wide range of characters in passwords and
 
1198   passphrases can increase the potential for creating a strong password
 
1199   with high entropy.  However, in practice, the ability to include such
 
1200   characters ought to be weighed against the possible need to reproduce
 
1201   them on various devices using various input methods.
 
12038.2.  Password/Passphrase Comparison
 
1205   In systems that conform to modern best practices for security,
 
1206   verification of passwords during authentication will not use the
 
1207   comparison defined in Section 4.2.3.  Instead, because the system
 
1208   performs cryptographic calculations to verify the password, it will
 
1209   prepare the password as defined in Section 4.2.1 and enforce the
 
1210   rules as defined in Section 4.2.2 before performing the relevant
 
12138.3.  Identifier Comparison
 
1215   The process of comparing identifiers (such as SASL simple usernames,
 
1216   authentication identifiers, and authorization identifiers) can lead
 
1217   to either false rejects or false accepts, both of which have security
 
1218   implications.  A more detailed discussion can be found in [RFC6943].
 
1222   The security considerations described in [RFC8264] apply to the
 
1223   IdentifierClass and FreeformClass string classes used in this
 
1224   document for usernames and passwords, respectively.
 
12268.5.  Reuse of Unicode
 
1228   The security considerations described in [UTS39] apply to the use of
 
1229   Unicode code points in usernames and passwords.
 
1234Saint-Andre & Melnikov       Standards Track                   [Page 22]
 
1236RFC 8265             PRECIS: Usernames and Passwords        October 2017
 
12419.1.  Normative References
 
1243   [RFC2119]  Bradner, S., "Key words for use in RFCs to Indicate
 
1244              Requirement Levels", BCP 14, RFC 2119,
 
1245              DOI 10.17487/RFC2119, March 1997,
 
1246              <https://www.rfc-editor.org/info/rfc2119>.
 
1248   [RFC3629]  Yergeau, F., "UTF-8, a transformation format of ISO
 
1249              10646", STD 63, RFC 3629, DOI 10.17487/RFC3629, November
 
1250              2003, <https://www.rfc-editor.org/info/rfc3629>.
 
1252   [RFC5234]  Crocker, D., Ed. and P. Overell, "Augmented BNF for Syntax
 
1253              Specifications: ABNF", STD 68, RFC 5234,
 
1254              DOI 10.17487/RFC5234, January 2008,
 
1255              <https://www.rfc-editor.org/info/rfc5234>.
 
1257   [RFC5890]  Klensin, J., "Internationalized Domain Names for
 
1258              Applications (IDNA): Definitions and Document Framework",
 
1259              RFC 5890, DOI 10.17487/RFC5890, August 2010,
 
1260              <https://www.rfc-editor.org/info/rfc5890>.
 
1262   [RFC6365]  Hoffman, P. and J. Klensin, "Terminology Used in
 
1263              Internationalization in the IETF", BCP 166, RFC 6365,
 
1264              DOI 10.17487/RFC6365, September 2011,
 
1265              <https://www.rfc-editor.org/info/rfc6365>.
 
1267   [RFC8174]  Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC
 
1268              2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174,
 
1269              May 2017, <https://www.rfc-editor.org/info/rfc8174>.
 
1271   [RFC8264]  Saint-Andre, P. and M. Blanchet, "PRECIS Framework:
 
1272              Preparation, Enforcement, and Comparison of
 
1273              Internationalized Strings in Application Protocols",
 
1274              RFC 8264, DOI 10.17487/RFC8264, October 2017,
 
1275              <https://www.rfc-editor.org/info/rfc8264>.
 
1277   [UAX11]    Unicode Standard Annex #11, "East Asian Width", edited by
 
1278              Ken Lunde.  An integral part of The Unicode Standard,
 
1279              <http://unicode.org/reports/tr11/>.
 
1281   [Unicode]  The Unicode Consortium, "The Unicode Standard",
 
1282              <http://www.unicode.org/versions/latest/>.
 
1290Saint-Andre & Melnikov       Standards Track                   [Page 23]
 
1292RFC 8265             PRECIS: Usernames and Passwords        October 2017
 
12959.2.  Informative References
 
1297   [Err1812]  RFC Errata, Erratum ID 1812, RFC 4013,
 
1298              <https://www.rfc-editor.org/errata/eid1812>.
 
1300   [RFC20]    Cerf, V., "ASCII format for network interchange", STD 80,
 
1301              RFC 20, DOI 10.17487/RFC0020, October 1969,
 
1302              <https://www.rfc-editor.org/info/rfc20>.
 
1304   [RFC3454]  Hoffman, P. and M. Blanchet, "Preparation of
 
1305              Internationalized Strings ("stringprep")", RFC 3454,
 
1306              DOI 10.17487/RFC3454, December 2002,
 
1307              <https://www.rfc-editor.org/info/rfc3454>.
 
1309   [RFC3501]  Crispin, M., "INTERNET MESSAGE ACCESS PROTOCOL - VERSION
 
1310              4rev1", RFC 3501, DOI 10.17487/RFC3501, March 2003,
 
1311              <https://www.rfc-editor.org/info/rfc3501>.
 
1313   [RFC3987]  Duerst, M. and M. Suignard, "Internationalized Resource
 
1314              Identifiers (IRIs)", RFC 3987, DOI 10.17487/RFC3987,
 
1315              January 2005, <https://www.rfc-editor.org/info/rfc3987>.
 
1317   [RFC4013]  Zeilenga, K., "SASLprep: Stringprep Profile for User Names
 
1318              and Passwords", RFC 4013, DOI 10.17487/RFC4013, February
 
1319              2005, <https://www.rfc-editor.org/info/rfc4013>.
 
1321   [RFC4422]  Melnikov, A., Ed. and K. Zeilenga, Ed., "Simple
 
1322              Authentication and Security Layer (SASL)", RFC 4422,
 
1323              DOI 10.17487/RFC4422, June 2006,
 
1324              <https://www.rfc-editor.org/info/rfc4422>.
 
1326   [RFC4616]  Zeilenga, K., Ed., "The PLAIN Simple Authentication and
 
1327              Security Layer (SASL) Mechanism", RFC 4616,
 
1328              DOI 10.17487/RFC4616, August 2006,
 
1329              <https://www.rfc-editor.org/info/rfc4616>.
 
1331   [RFC5802]  Newman, C., Menon-Sen, A., Melnikov, A., and N. Williams,
 
1332              "Salted Challenge Response Authentication Mechanism
 
1333              (SCRAM) SASL and GSS-API Mechanisms", RFC 5802,
 
1334              DOI 10.17487/RFC5802, July 2010,
 
1335              <https://www.rfc-editor.org/info/rfc5802>.
 
1337   [RFC5893]  Alvestrand, H., Ed. and C. Karp, "Right-to-Left Scripts
 
1338              for Internationalized Domain Names for Applications
 
1339              (IDNA)", RFC 5893, DOI 10.17487/RFC5893, August 2010,
 
1340              <https://www.rfc-editor.org/info/rfc5893>.
 
1346Saint-Andre & Melnikov       Standards Track                   [Page 24]
 
1348RFC 8265             PRECIS: Usernames and Passwords        October 2017
 
1351   [RFC6120]  Saint-Andre, P., "Extensible Messaging and Presence
 
1352              Protocol (XMPP): Core", RFC 6120, DOI 10.17487/RFC6120,
 
1353              March 2011, <https://www.rfc-editor.org/info/rfc6120>.
 
1355   [RFC6943]  Thaler, D., Ed., "Issues in Identifier Comparison for
 
1356              Security Purposes", RFC 6943, DOI 10.17487/RFC6943, May
 
1357              2013, <https://www.rfc-editor.org/info/rfc6943>.
 
1359   [RFC7542]  DeKok, A., "The Network Access Identifier", RFC 7542,
 
1360              DOI 10.17487/RFC7542, May 2015,
 
1361              <https://www.rfc-editor.org/info/rfc7542>.
 
1363   [RFC7613]  Saint-Andre, P. and A. Melnikov, "Preparation,
 
1364              Enforcement, and Comparison of Internationalized Strings
 
1365              Representing Usernames and Passwords", RFC 7613,
 
1366              DOI 10.17487/RFC7613, August 2015,
 
1367              <https://www.rfc-editor.org/info/rfc7613>.
 
1369   [RFC7616]  Shekh-Yusef, R., Ed., Ahrens, D., and S. Bremer, "HTTP
 
1370              Digest Access Authentication", RFC 7616,
 
1371              DOI 10.17487/RFC7616, September 2015,
 
1372              <https://www.rfc-editor.org/info/rfc7616>.
 
1374   [RFC7617]  Reschke, J., "The 'Basic' HTTP Authentication Scheme",
 
1375              RFC 7617, DOI 10.17487/RFC7617, September 2015,
 
1376              <https://www.rfc-editor.org/info/rfc7617>.
 
1378   [RFC7622]  Saint-Andre, P., "Extensible Messaging and Presence
 
1379              Protocol (XMPP): Address Format", RFC 7622,
 
1380              DOI 10.17487/RFC7622, September 2015,
 
1381              <https://www.rfc-editor.org/info/rfc7622>.
 
1383   [RFC8266]  Saint-Andre, P., "Preparation, Enforcement, and Comparison
 
1384              of Internationalized Strings Representing Nicknames",
 
1385              RFC 8266, DOI 10.17487/RFC8266, October 2017,
 
1386              <https://www.rfc-editor.org/info/rfc8266>.
 
1388   [UTS39]    Unicode Technical Standard #39, "Unicode Security
 
1389              Mechanisms", edited by Mark Davis and Michel Suignard,
 
1390              <http://unicode.org/reports/tr39/>.
 
1392Appendix A.  Changes from RFC 7613
 
1394   The following changes were made from [RFC7613].
 
1396   o  Corrected the order of operations for the UsernameCaseMapped
 
1397      profile to ensure consistency with [RFC8264].
 
1402Saint-Andre & Melnikov       Standards Track                   [Page 25]
 
1404RFC 8265             PRECIS: Usernames and Passwords        October 2017
 
1407   o  In accordance with working group discussions and updates to
 
1408      [RFC8264], removed the use of the Unicode toCaseFold() operation
 
1409      in favor of the Unicode toLowerCase() operation.
 
1411   o  Modified the presentation (but not the content) of the rules.
 
1413   o  Removed UTF-8 as a mandatory encoding, because that is a matter
 
1414      for the application.
 
1416   o  Clarified several editorial matters.
 
1418   o  Updated references.
 
1420   See [RFC7613] for a description of the differences from [RFC4013].
 
1424   Thanks to Christian Schudt and Sam Whited for their bug reports and
 
1427   See [RFC7613] for acknowledgements related to the specification that
 
1428   this document supersedes.
 
1436   United States of America
 
1438   Phone: +1 720 256 6756
 
1439   Email: stpeter@jabber.org
 
1440   URI:   https://www.jabber.org/
 
1445   5 Castle Business Village
 
1447   Hampton, Middlesex  TW12 2BX
 
1450   Email: Alexey.Melnikov@isode.com
 
1458Saint-Andre & Melnikov       Standards Track                   [Page 26]