<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd">
<?rfc toc='yes' ?>
<?rfc editing='no' ?>
<?rfc symrefs='yes' ?>
<?rfc sortrefs='no'?>
<?rfc linkmailto='no'?>
<?rfc compact='yes'?>
<?rfc comments='yes'?>
<?rfc inline='yes'?>
<?rfc-ext parse-xml-in-artwork='yes' ?>
<?xml-stylesheet type='text/xsl' href='rfc2629.xslt' ?>
<rfc ipr='trust200902' docName='draft-hansen-scram-sha256-04' category='std' updates='5802'>
  <front>
    <title abbrev='SASL SCRAM-SHA-256/SCRAM-SHA-256-PLUS'>SCRAM-SHA-256 and SCRAM-SHA-256-PLUS SASL Mechanisms</title>
    <author initials='T.' surname='Hansen' fullname='Tony Hansen'>
      <organization>AT&amp;T Laboratories</organization>
      <address>
        <postal>
          <street>200 Laurel Ave. South</street>
          <city>Middletown</city>
          <region>NJ</region>
          <code>07748</code>
          <country>USA</country>
        </postal>
        <email>tony+scramsha256@maillennium.att.com</email>
      </address>
    </author>
    <date />
    <area>Security</area>
    <workgroup>Kitten</workgroup>
    <keyword>Requests for Comment</keyword>
    <abstract>
      <t>
	This document registers: the SASL mechanisms SCRAM-SHA-256 and SCRAM-SHA-256-PLUS,
	provdes guidance for secure implentation of the original SCRAM-SHA-1-PLUS mechanism,
	and updates the SCRAM registration procedures of RFC 5802.
      </t>
    </abstract>
  </front>
  <middle>
    <section title='Introduction' anchor='intro'>
      <t>
	This document registers the SASL mechanisms SCRAM-SHA-256 and SCRAM-SHA-256-PLUS.
	SHA-256 has stronger security properties than SHA-1, and it is expected that SCRAM mechanisms
	based on it will have greater predicted longevity than the SCRAM mechanisms based on SHA-1. 
      </t>
      <t>
	The registration form for the SCRAM family of algorithms is also updated from <xref target="RFC5802"/>.
      </t>
      <t>
	After publication of <xref target='RFC5802'/>, it was discovered that 
	Transport Layer Security (TLS) <xref target='RFC5246'/>
	does not have the expected properties for the tls-unique channel binding to be
	secure <xref target='I-D.ietf-tls-session-hash'/>.
	Therefore, this document contains normative
	text that applies to both the original SCRAM-SHA-1-PLUS and the newly
	introduced SCRAM-SHA-256-PLUS mechanism.
      </t>
      <t>
	Note: this paragraph may be removed before publication.
	<vspace/>
	This document was written because <xref target='RFC5802'/> requires that new SASL mechanisms in the SCRAM family
	be subject to IETF review.
	This document is being discussed in the KITTEN working group
	(see the <eref target='mailto:kitten@ietf.org'>kitten@ietf.org</eref> mailing list).
	It was pursued further because of a desire for its use within a document being discussed in the HTTP-AUTH working group
	(see the <eref target='mailto:httpauth@ietf.org'>httpauth@ietf.org</eref> mailing list).
      </t>
    </section>

    <section title="Key Word Definitions">
      <t>
	The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
	"SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
	document are to be interpreted as described in <xref target="RFC2119"/>.
      </t>
    </section>

    <section title='SCRAM-SHA-256 and SCRAM-SHA-256-PLUS'>
      <t>
	The SCRAM-SHA-256 and SCRAM-SHA-256-PLUS SASL mechanisms are defined in the same way
	that SCRAM-SHA-1 and SCRAM-SHA-1-PLUS are defined
	in <xref target='RFC5802'/>, except that the hash function for HMAC() and H() uses SHA-256 instead of SHA-1
	<xref target='RFC6234'/>.
      </t>
      <t>
	For the SCRAM-SHA-256 and SCRAM-SHA-256-PLUS SASL mechanisms, the
	hash iteration-count announced by a server SHOULD be at least 4096.
      </t>
      <t>
	The GSS-API mechanism OID for SCRAM-SHA-256 is TBD1 (see <xref target='iana'/>).
      </t>
      <t>
	This is a simple example of a SCRAM-SHA-256 authentication exchange
	when the client doesn't support channel bindings.
	The username 'user' and password 'pencil' are being used.
	<list style='hanging' hangIndent='3'>
	  <t hangText='C:'>n,,n=user,r=rOprNGfwEbeRWgbNEkqO</t>
	  <t hangText='S:'>r=rOprNGfwEbeRWgbNEkqO%hvYDpWUa2RaTCAfuxFIlj)hNlF$k0,<vspace/>
	    s=W22ZaJ0SNY7soEsUEjb6gQ==,i=4096</t>
	  <t hangText='C:'>c=biws,r=rOprNGfwEbeRWgbNEkqO%hvYDpWUa2RaTCAfuxFIlj)hNlF$k0,<vspace/>
	    p=dHzbZapWIk4jUhN+Ute9ytag9zjfMHgsqmmiz7AndVQ=</t>
	  <t hangText='S:'>v=6rriTRBi23WpRR/wtup+mMhUZUn/dB5nLTJRsjl95G4=</t>
	</list>
      </t>
    </section>

    <section title='Security Considerations' anchor='security'>
      <t>
	The security considerations from <xref target='RFC5802'/> still apply.
      </t>
      <t>
	To be secure, SCRAM-SHA-256-PLUS and SCRAM-SHA-1-PLUS MUST either be used over a TLS channel that
	has had <xref target='I-D.ietf-tls-session-hash'/> negotiated, or session resumption MUST NOT
	have been used.
      </t>
      <t>
	See <xref target='RFC4270'/> and <xref target='RFC6194'/> for reasons to move from SHA-1 to
	a strong security mechanism like SHA-256.
      </t>
      <t>
	The strength of this mechanism is dependent in part on the hash-iteration count, as denoted by "i" in
	<xref target="RFC5802"/>.
	As a rule of thumb, the hash-iteration count should be such that a modern machine will take 0.1 seconds
	to perform the complete algorithm; however this is unlikely to be practical on mobile devices and
	other relatively low-performance systems.
	At the time this was written, the rule of thumb gives around 15,000 iterations required;
	however an iteration count of 4096 takes around 0.5 seconds on current mobile handsets.
	This computational cost can be avoided by caching the ClientKey (assuming the Salt and iteration count is stable).
	Therefore the recommendation of this specification is that the iteration count SHOULD be at least 4096, but careful
	consideration ought to be given to using a significantly higher value, particularly where mobile use is less important.
      </t>
    </section>

    <section title='IANA Considerations' anchor='iana'>
      <section title='Updates to SCRAM-* Registration'>
	<t>
	  The IANA registry for SCRAM-* (the SCRAM family of SASL mechanisms)
	  in the SASL Mechanism registry (<xref target='RFC4422'/>) is updated as follows.
	  The email address for reviews has been updated, and the note at the end changed.
	  <list style='empty'>
	    <t>To: iana@iana.org<vspace/>
	      Subject: Registration of a new SASL family SCRAM
	    </t>
	    <t>
	      SASL mechanism name (or prefix for the family): SCRAM-*<vspace/>
	      Security considerations: Section 7 of <xref target='RFC5802'/><vspace/>
	      Published specification (optional, recommended): RFCXXXX<vspace/>
	      Person &amp; email address to contact for further information:
	      IETF KITTEN WG kitten@ietf.org<vspace/>
	      Intended usage: COMMON<vspace/>
	      Owner/Change controller: IESG iesg@ietf.org<vspace/>
	      Note: Members of this family MUST be explicitly registered
	      using the "IETF Review" <xref target='RFC5226'/> registration procedure.
	      Reviews MUST be requested on the KITTEN mailing list kitten@ietf.org
	      (or a successor designated by the responsible Security AD).
	    </t>
	    <t>
	      Note to future SCRAM-mechanism designers: each new SASL SCRAM
	      mechanism MUST be explicitly registered with IANA within the
	      SASL SCRAM Family Mechanisms registry.
	    </t>
	  </list>
	</t>
      </section>

      <section title='SASL-SCRAM Family Mechanisms Registration Procedure'>
	<t>
	  A new IANA registry is to be added for members of the SCRAM family of SASL mechanisms, named
	  SASL SCRAM Family Mechanisms.
	  It adds two new fields to the existing SCRAM mechanism registry:
	  Minimum iteration-count and Associated OID.
	</t>
	<t>
	  <list style='empty'>
	    <t>To: iana@iana.org<vspace/>
	      Subject: Registration of a new SASL SCRAM family mechanism
	    </t>
	    <t>
	      SASL mechanism name (or prefix for the family): SCRAM-&lt;NAME&gt;<vspace/>
	      Security considerations: Section 7 of <xref target='RFC5802'/><vspace/>
	      Published specification (optional, recommended): RFCXXXX<vspace/>
	      Minimum iteration-count: The minimum iteration-count that servers SHOULD announce
	      <vspace/>
	      Associated OID: TBD-BY-IANA<vspace/>
	      Person &amp; email address to contact for further information:
	      IETF KITTEN WG kitten@ietf.org<vspace/>
	      Intended usage: COMMON<vspace/>
	      Owner/Change controller: IESG iesg@ietf.org<vspace/>
	    </t>
	    <t>
	      Note: Members of this family MUST be explicitly registered
	      using the "IETF Review" <xref target='RFC5226'/> registration procedure.
	      Reviews MUST be requested on the KITTEN mailing list kitten@ietf.org
	      (or a successor designated by the responsible Security Area Director).
	    </t>
	    <t>
	      Note: At publication of a new SASL SCRAM Family Mechanism,
	      IANA SHOULD assign a GSS-API mechanism OID for
	      this mechanism from the iso.org.dod.internet.security.mechanisms prefix
	      (see the "SMI Security for Mechanism Codes" registry) and fill in
	      the value for "TBD-BY-IANA" above.
	      Only one OID needs to be assigned for a SCRAM-&lt;NAME&gt; and SCRAM-&lt;NAME&gt;-PLUS pair.
	      The same OID should be assigned to both entries in the registry.
	    </t>
	    <t>
	      [RFC Editor: This note should be removed before publication.]
	      Note to IANA and the RFC Editor:
	      The above string "TBD-BY-IANA" is NOT to be filled in with an OID within THIS document, but is to be placed
	      as is within the registry.
	    </t>
	    <t>
	      Note to future SASL SCRAM mechanism designers: each new SASL SCRAM
	      mechanism MUST be explicitly registered with IANA and MUST comply
	      with the SCRAM-mechanism naming convention defined in Section 4 of
	      <xref target='RFC5802'/>.
	    </t>
	  </list>
	</t>

	<t>
	  The existing entries for SASL SCRAM-SHA-1 and SCRAM-SHA-1-PLUS are to be moved
	  from the existing SASL Mechanism registry to the SASL SCRAM Family Mechanism registry.
	  When doing so,
	  the following values are to be added:
	  <list style='empty'>
	    <t>
	      Minimum iteration-count: 4096<vspace/>
	      OID: 1.3.6.1.5.5.14 (from <xref target='RFC5802'/>)
	    </t>
	  </list>
	</t>

	<t>
	  The following new SASL SCRAM mechanisms are added to the SASL SCRAM Family Mechanism registry:
	  <list style='empty'>
	    <t>
	      IANA has added the following entries to the SASL SCRAM Family Mechanism registry
	      established by RFCXXXX:
	    </t>
	    <t>To: iana@iana.org<vspace/>
	      Subject: Registration of a new SASL SCRAM Family mechanism SCRAM-SHA-256
	    </t>
	    <t>
	      SASL mechanism name (or prefix for the family): SCRAM-SHA-256<vspace/>
	      Security considerations: Section <xref target='security'/> of RFCXXXX<vspace/>
	      Published specification (optional, recommended): RFCXXXX<vspace/>
	      Minimum iteration-count: 4096<vspace/>
	      OID: TBD1<vspace/>
	      Person &amp; email address to contact for further information:
	      IETF KITTEN WG kitten@ietf.org<vspace/>
	      Intended usage: COMMON<vspace/>
	      Owner/Change controller: IESG iesg@ietf.org<vspace/>
	      Note:
	    </t>
	    <t>
	      To: iana@iana.org<vspace/>
	      Subject: Registration of a new SASL SCRAM Family mechanism SCRAM-SHA-256-PLUS
	    </t>
	    <t>
	      SASL mechanism name (or prefix for the family): SCRAM-SHA-256-PLUS<vspace/>
	      Security considerations: Section <xref target='security'/> of RFCXXXX<vspace/>
	      Published specification (optional, recommended): RFCXXXX<vspace/>
	      Minimum iteration-count: 4096<vspace/>
	      OID: "TBD1"<vspace/>
	      Person &amp; email address to contact for further information:
	      IETF KITTEN WG kitten@ietf.org<vspace/>
	      Intended usage: COMMON<vspace/>
	      Owner/Change controller: IESG iesg@ietf.org<vspace/>
	      Note:
	    </t>
	  </list>
	</t>
	<t>
	  [This note may be removed on publication.]
	  IANA needs to assign the GSS-API mechanism OID TBD1 listed above
	  from the iso.org.dod.internet.security.mechanisms prefix
	  (see the "SMI Security for Mechanism Codes" registry).
	</t>
      </section>
    </section>

    <section title='Acknowledgements'>
      <t>
	This document benefited from discussions on the KITTEN WG mailing list.
	The author would like to specially thank
	Russ Albery,
	Dave Cridland,
	Shawn Emery,
	Stephen Farrell,
	Simon Josefsson,
	Pearl Liang,
	Alexey Melnikov,
	Peter Saint-Andre,
	Robert Sparks,
	Martin Thompson
	and
	Nico Williams
	for their comments on this topic.
      </t>
    </section>
  </middle>
  <back>
    <references title='Normative References'>
      <?rfc include='reference.RFC.4422' ?>
      <?rfc include='reference.RFC.5802' ?>
      <?rfc include='reference.RFC.6234' ?>
      <?rfc include='reference.I-D.ietf-tls-session-hash' ?>
    </references>
    <references title='Informative References'>
      <?rfc include='reference.RFC.2119' ?>
      <?rfc include='reference.RFC.4270' ?>
      <?rfc include='reference.RFC.5226' ?>
      <?rfc include='reference.RFC.6194' ?>
      <?rfc include='reference.RFC.5246' ?>
    </references>

    <section title='Change Log'>
      <t>
	This section should be removed before publication as an RFC.
      </t>
      <section title='Changes for -03 to -04'>
	<t>
	  Added text to the Abstract,
	  <xref target='intro'>Introduction</xref>, and
	  <xref target='security'>Security Considerations</xref> sections
	  regarding tls-session-hash negotiation.
	</t>
      </section>
      <section title='Changes for -02 to -03'>
	<t>
	  Changed from Informational document to Standards Track.
	</t>
	<t>
	  Beefed up the <xref target='security'>Security Considerations</xref> section.
	</t>
	<t>
	  At the request of IANA, reworked the <xref target='iana'>IANA Considerations</xref> section.
	</t>
      </section>
      <section title='Changes for -01 to -02'>
	<t>
	  Removed !!!!!!!!!!!!!!!! comments requesting discussion after discussion on kitten mailing list.
	</t>
      </section>      
      <section title='Changes for -00 to -01'>
	<t>
	  Added <xref target='security'>Security Considerations</xref> section.
	</t>
	<t>
	  Added Minimum iteration-count and associated OID fields to registration forms and reworked
	  the <xref target='iana'>IANA Considerations</xref> section.
	</t>
      </section>      
    </section>
  </back>
</rfc>
