<?xml version="1.0" encoding="US-ASCII"?>

<!DOCTYPE rfc SYSTEM "rfc2629.dtd">
<?xml-stylesheet type='text/xsl' href='rfc2629.xslt' ?>

<?rfc toc="yes"?>
<?rfc tocdepth="4"?>
<?rfc symrefs="yes"?>
<?rfc sortrefs="yes" ?>
<?rfc compact="yes" ?>
<?rfc subcompact="no" ?>

<rfc number="8110"
     category="info" 
     submissionType="IETF"
     consensus="yes"
     ipr="trust200902">
  <front>
    <title>Opportunistic Wireless Encryption</title>

    <author fullname="Dan Harkins" initials="D.H." role="editor"
            surname="Harkins">
      <organization>HP Enterprise</organization>

      <address>
        <postal>
          <street>3333 Scott Boulevard</street>

          <city>Santa Clara</city>

          <region>California</region>

          <code>95054</code>

          <country>United States of America</country>
        </postal>

        <phone>+1 415 555 1212</phone>

        <email>dharkins@arubanetworks.com</email>
      </address>
    </author>

    <author fullname="Warren Kumari" initials="W.K." role="editor"
            surname="Kumari">
      <organization>Google</organization>

      <address>
        <postal>
          <street>1600 Amphitheatre Parkway</street>

          <city>Mountain View</city>

          <region>California</region>

          <code>94043</code>

          <country>United States of America</country>
        </postal>

        <phone>+1 408 555 1212</phone>

        <email>warren@kumari.net</email>
      </address>
    </author>

    <date month="March" year="2017"/>

    <area>ART</area>

    <keyword>opportunistic encryption wireless</keyword>

    <abstract>
      <t>This memo specifies an extension to IEEE Std 802.11 to provide for
      opportunistic (unauthenticated) encryption to the wireless media.</t>

    </abstract>
  </front>

  <middle>
    <section title="Introduction">
      <t>This memo describes Opportunistic Wireless Encryption (OWE) -- a mode
      of opportunistic security <xref
      target="RFC7435"/> for IEEE Std 802.11 that provides encryption of the
      wireless medium but no authentication.</t>

      <section title="Requirements Language">
        <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">RFC 2119</xref>.</t>
      </section>

      <section title="Notation">
        <t>This memo uses the following notation: <list hangIndent="4"
            style="hanging">
            <t hangText="y = F(X)"><vspace blankLines="0"/>An element-to-scalar mapping function. For
            an elliptic curve group, it takes a point on the curve and returns
            the x-coordinate; for a finite field element, it is the identity
            function, just returning the element itself.</t>

            <t hangText="Z = DH(x,Y)"><vspace blankLines="0"/>For an elliptic
            curve, DH(x,Y) is the multiplication of point Y by the scalar value
           x, creating a point on the curve Z; for finite field cryptography,
            DH(x,Y) is an exponentiation of element Y to the power of x (implied
            modulo a field defining prime, p) resulting in an element Z.</t>

            <t hangText="a = len(b)"><vspace blankLines="0"/>Indicates the
            length in bits of the string b.</t>
          </list></t>
      </section>
    </section>

    <section anchor="background" title="Background">
      <t>Internet access has become an expected service at many locations --
      for example, coffee shops, airports, and hotels. In many cases, this is
      offered over "Open" (unencrypted) wireless networks, because
      distributing a passphrase (or using other authentication solutions) is
      not convenient or realistic. Ideally, users would always use a VPN when
      using an untrusted network, but often they don't. This leaves their
      traffic vulnerable to sniffing attacks, for example, from someone in the
      adjacent hotel room running Wireshark, pervasive monitors, etc.</t>

      <t>In addition, many businesses (for example, coffee shops and bars)
      offer free Wi-Fi as an inducement to customers to enter and remain in
      the premises. Many customers will use the availability of free Wi-Fi as
      a deciding factor in which business to patronize. Since these businesses
      are not Internet service providers, they are often unwilling and/or
      unqualified to perform complex configuration on their network. In
      addition, customers are generally unwilling to do complicated
      provisioning on their devices just to obtain free Wi-Fi. This leads to a
      popular deployment technique -- a network protected using a shared and
      public Pre-Shared Key (PSK) that is printed on a sandwich board at the entrance, on a
      chalkboard on the wall, or on a menu. The PSK is used in a cryptographic
      handshake, defined in <xref target="IEEE802.11"/>, called the "4-way
      handshake" to prove knowledge of the PSK and derive traffic encryption
      keys for bulk wireless data.</t>

      <t>The belief is that this protects the wireless medium from passive
      sniffing and simple attacks. That belief is erroneous. Since the PSK is
      known by everyone, it is possible for a passive attacker to observe the
      4-way handshake and compute the traffic encryption keys used by a client
      and access point (AP). If the attacker is too late to observe this exchange,
      he can issue a forged "deauthenticate" frame that will cause the client
      and/or AP to reset the 802.11 state machine and cause them to go through
      the 4-way handshake again, thereby allowing the passive attacker to
      determine the traffic keys.</t>

      <t>With OWE, the client and AP perform a Diffie-Hellman key exchange
      during the access procedure and use the resulting pairwise secret with
      the 4-way handshake instead of using a shared and public PSK in the
      4-way handshake.</t>

      <t>OWE requires no special configuration or user interaction but
      provides a higher level of security than a common, shared, and public
      PSK. OWE not only provides more security to the end user, it is also
      easier to use both for the provider and the end user because there are no
      public keys to maintain, share, or manage.</t>
    </section>

    <section title="802.11 Network Access">

      <t>Wi-Fi access points (APs) advertise their presence through frames
      called "beacons". 
   These frames inform clients within earshot of the
   SSID (Service Set Identifier) the AP is advertising, the AP's Media
   Access Control (MAC)
   address (known as its "BSSID" (Basic Service Set Identifier)),
   security policy governing access, the symmetric ciphers it uses for
   unicast and broadcast frames, QoS information, as well as support for
   other optional features of
      <xref target="IEEE802.11"/>. Wi-Fi clients can actively
      discover APs by issuing "probe requests", which are queries for APs that
      respond with "probe responses". A probe response carries essentially the
      same information as a beacon.</t>

      <t>After an AP is discovered by a client, actively through probing or
      passively through beacons, the client initiates a two-step method to
      gain network access. The first step is "802.11 authentication". For most
      methods of access, this is an empty exchange
      known as "Open Authentication" -- basically, the client says, "authenticate
      me", and the AP responds, "ok, you're authenticated". After 802.11
      authentication is 802.11 association, in which the client requests
      network access from an AP (the SSID, a selection of the type of
      subsequent authentication to be made, any pairwise and group ciphers,
      etc.) using an 802.11 association request. The AP acknowledges the
      request with an 802.11 association response.</t>

      <t>If the network is Open (no authentication and no encryption), the
      client has network access immediately after completion of 802.11
      association. If the network enforces PSK authentication, the 4-way
      handshake is initiated by the AP using the PSK to authenticate the
      client and derive traffic encryption keys.</t>

      <t>To add an opportunistic encryption mode of access to <xref
      target="IEEE802.11"/>, it is necessary to perform a Diffie-Hellman key
      exchange during 802.11 authentication and use the resulting pairwise
      secret with the 4-way handshake.</t>
    </section>

    <section anchor="owe" title="Opportunistic Wireless Encryption">
      <section anchor="crypto" title="Cryptography">
        <t>Performing a Diffie-Hellman key exchange requires agreement on a
        domain parameter set in which to perform the exchange. OWE uses a
        registry (see
	<xref target="IKE-IANA"/>) to map an integer into a
        complete domain parameter set. OWE supports both Elliptic Curve
        Cryptography (ECC) and Finite Field Cryptography (FFC).</t>

        <t>OWE uses a hash algorithm for generation of a secret and a secret
        identifier. The particular hash algorithm depends on the group chosen
        for the Diffie-Hellman. For ECC, the hash algorithm depends on the
        size of the prime defining the curve p: <list style="symbols">
            <t>SHA-256: when len(p) &lt;= 256</t>

            <t>SHA-384: when 256 &lt; len(p) &lt;= 384</t>

            <t>SHA-512: when 384 &lt; len(p)</t>
          </list> For FFC, the hash algorithm depends on the prime, p,
        defining the finite field: <list style="symbols">
            <t>SHA-256: when len(p) &lt;= 2048</t>

            <t>SHA-384: when 2048 &lt; len(p) &lt;= 3072</t>

            <t>SHA-512: when 3072 &lt; len(p)</t>
          </list></t>
      </section>

      <section anchor="discovery" title="OWE Discovery">
        <t>
An access point advertises support for OWE using an Authentication
and Key Management (AKM) suite selector for OWE. This AKM is illustrated in
<xref target="akm"/> and is added to the Robust Security Network
(RSN) element, defined in <xref target="IEEE802.11"/>, in all beacons and
probe response frames the AP issues.</t>

        <texttable anchor="akm" title="OWE AKM">

          <ttcol align="center">OUI</ttcol>

          <ttcol align="center">Suite Type</ttcol>

          <ttcol align="center">Authentication Type</ttcol>

          <ttcol align="center">Key Management Type</ttcol>

          <ttcol align="center">Key derivation type</ttcol>

          <c>00-0F-AC</c>

          <c>18</c>

          <c>Opportunistic Wireless Encryption</c>

          <c>This document</c>

          <c><xref target="RFC5869"/></c>
        </texttable>

        <t>Once a client discovers an OWE-compliant AP, it performs "Open
        System" 802.11 authentication as defined in <xref
        target="IEEE802.11"/>, and it then proceeds to 802.11 association.</t>
      </section>

      <section anchor="association" title="OWE Association">
        <t>Information is added to 802.11 association requests and responses
        using TLVs that <xref target="IEEE802.11"/> calls "elements". Each
        element has an "Element ID" (including any Element ID extension), a
        length, and a value field that is element specific. These elements are
        appended to each other to construct 802.11 association requests and
        responses.</t>

        <t>OWE adds the Diffie-Hellman Parameter element (see <xref
        target="dhelem"/>) to 802.11 association requests and responses. The
        client adds her public key in the 802.11 association request, and the AP
        adds his public key in the 802.11 association response.</t>

        <figure align="center" anchor="dhelem" title="The Diffie-Hellman
	  Parameter Element">

          <artwork align="center"><![CDATA[
+------------+----------+------------+------------------------+
| Element ID |  Length  | Element ID |   element-specific     |
|            |          |  Extension |         data           |
+------------+----------+------------+---------+--------------+
|    255     | variable |     32     | group   |  public key  |
+------------+----------+------------+---------+--------------+
          ]]></artwork>
        </figure>

        <t>where: <list style="symbols">
            <t>group is an unsigned two-octet integer defined in 
	    <xref
            target="IKE-IANA"/>, in little-endian format, that identifies a
            domain parameter set;</t>

            <t>public key is an octet string representing the Diffie-Hellman
            public key; and,</t>

	    <t>Element ID, Length, and Element ID Extension are all single-octet
      integers.</t>
          </list></t>

	<t>The encoding of the public key depends on its type. FFC elements
	SHALL be encoded per the integer-to-octet-string conversion
	technique of <xref target="RFC6090"/>. For ECC elements, the
	encoding depends on the definition of the curve, either that in
	<xref target="RFC6090"/> or <xref target="RFC7748"/>. If
	the public key is from a curve defined in
	<xref target="RFC6090"/>, compact representation SHALL be used.</t>
	
        <t>A client wishing to do OWE MUST indicate the OWE AKM in the RSN
        element portion of the 802.11 association request and MUST include a
        Diffie-Hellman Parameter element to its 802.11 association request. An
        AP agreeing to do OWE MUST include the OWE AKM in the RSN element
        portion of the 802.11 association response. If "PMK caching" (see
        <xref target="caching"/>) is not performed, it MUST also include a
        Diffie-Hellman Parameter element. If "PMK caching" is not being
        performed, a client MUST discard any 802.11 association response that
        indicates the OWE AKM in the RSN element but does not have not a
        Diffie-Hellman Parameter element.</t>

        <t>For interoperability purposes, a compliant implementation MUST
        support group nineteen (19), a 256-bit elliptic curve group. If the AP
        does not support the group indicated in the received 802.11
        association request, it MUST respond with an 802.11 association
        response with a status code of seventy-seven (77) indicating an
        unsupported finite cyclic group. A client that receives an 802.11
        association response with a status code of seventy-seven SHOULD retry
        OWE with a different supported group and, due to the unsecured nature
        of 802.11 association, MAY request association again using the group
        that resulted in failure. This failure SHOULD be logged, and if the
        client abandons association due to the failure to agree on any group,
        notification of this fact SHOULD be provided to the user.</t>

        <t>Received Diffie-Hellman Parameter elements are checked for validity
        upon receipt. For ECC, a validity check depends on the curve
	definition, either that in <xref target="RFC6090"/> or
	<xref target="RFC7748"/>. For FFC, elements are checked that
        they are between one (1) and one (1) less than the prime, p, exclusive
        (i.e., 1 &lt; element &lt; p-1). Invalid received Diffie-Hellman keys
        MUST result in unsuccessful association, a failure of OWE, and
        a reset of the 802.11 state machine. 
   Due to the unsecured nature of 802.11 association, a client SHOULD retry OWE
   a number of times (this memo does not specify the number of times). 
   This failure should be logged, and if the
        client abandons association due to the (repeated) receipt of invalid
        elements, notification of this fact should be provided to the
        user.</t>
      </section>

      <section anchor="fwhs" title="OWE Post-Association">
        <t>Once the client and AP have finished 802.11 association, they then
        complete the Diffie-Hellman key exchange and create a Pairwise Master
        Key (PMK) and its associated identifier, PMKID <xref target="IEEE802.11"/>. Given a private key
        x and the peer's (AP's if client, client's if AP) public key Y, the
        following are generated: <list style="empty">
            <t>z = F(DH(x, Y))</t>

            <t>prk = HKDF-extract(C | A | group, z)</t>

            <t>PMK = HKDF-expand(prk, "OWE Key Generation", n)</t>
          </list>
	where HKDF-expand() and HKDF-extract() are defined in
	<xref target="RFC5869"/>; "C | A | group" is a concatenation of
	the client's Diffie-Hellman public key, the AP's Diffie-Hellman
	public key (from the 802.11 association request and response,
	respectively), and the two-octet group from the Diffie-Hellman
	Parameter element (in little-endian format) and is passed as the
	salt to the HMAC-based Extract-and-Expand Key Derivation Function 
	(HKDF) using the hash algorithm defined in 
	<xref target="crypto"/>; and n is the bit length of the digest
	produced by that hash algorithm. z and prk SHOULD be irretrievably
	deleted once the PMK has been generated.</t>

        <t>The PMKID is generated by hashing the two Diffie-Hellman public
        keys (the data, as sent and received, from the "public key" portion of
        the Diffie-Hellman Parameter element in the 802.11 association request
        and response) and returning the leftmost 128 bits: <list
            hangIndent="4" style="empty">
            <t>PMKID = Truncate-128(Hash(C | A))</t>
          </list>where C is the client's Diffie-Hellman public key from the
        802.11 association request, A is the AP's Diffie-Hellman public key
        from the 802.11 association response, and Hash is the hash algorithm
        defined in <xref target="crypto"/>.</t>

	<texttable anchor="fourway" title="Integrity and Key Wrap Algorithms">
	  <ttcol align="center">Hash</ttcol>
	  <ttcol align="center">Integrity Algorithm</ttcol>
	  <ttcol align="center">KCK_bits</ttcol>
	  <ttcol align="center">Size of MIC</ttcol>
	  <ttcol align="center">Key-wrap Algorithm</ttcol>
	  <ttcol align="center">KEK_bits</ttcol>

	  <c>SHA-256</c>
	  <c>HMAC-SHA-256</c>
	  <c>128</c>
	  <c>16</c>
	  <c>NIST AES Key-wrap</c>
	  <c>128</c>

	  <c>SHA-384</c>
	  <c>HMAC-SHA-384</c>
	  <c>192</c>
	  <c>24</c>
	  <c>NIST AES Key-wrap</c>
	  <c>256</c>

	  <c>SHA-512</c>
	  <c>HMAC-SHA-521</c>
	  <c>256</c>
	  <c>32</c>
	  <c>NIST AES Key-wrap</c>
	  <c>256</c>

	</texttable>

        <t>Upon completion of 802.11 association, the AP initiates the 4-way
        handshake to the client using the PMK generated above. The 4-way
	handshake generates a Key-Encrypting Key (KEK), a Key-Confirmation
	Key (KCK), and a Message Integrity Code (MIC) to use for protection
	of the frames that define the 4-way handshake. The algorithms and
	key lengths used in the 4-way handshake depend on the hash algorithm
	selected in <xref target="crypto"/> and are listed in
	<xref target="fourway"/>.</t>

	<t>The result of
        the 4-way handshake is encryption keys to protect bulk unicast data
        and broadcast data. If the 4-way handshake fails, this information
	SHOULD be presented to the user.</t>
      </section>

      <section anchor="caching" title="OWE PMK Caching">
        <t><xref target="IEEE802.11"/> defines "PMK caching" where a client
        and access point can cache a PMK for a certain period of time and
        reuse it with the 4-way handshake after subsequent associations to
        bypass potentially expensive authentication. A client indicates its
        desire to do "PMK caching" by including the identifying PMKID in its
        802.11 association request. If an AP has cached the PMK identified by
        that PMKID, it includes the PMKID in its 802.11 association response;
        otherwise, it ignores the PMKID and proceeds with normal 802.11
        association. OWE supports the notion of "PMK caching".</t>

        <t>Since "PMK caching" is indicated in the same frame as the
        Diffie-Hellman Parameter element is passed, a client wishing to do
        "PMK caching" MUST include both in her 802.11 association request. If
        the AP has the PMK identified by the PMKID and wishes to perform "PMK
        caching", he will include the PMKID in his 802.11 association response
        but does not include a Diffie-Hellman Parameter element. If the AP
        does not have the PMK identified by the PMKID, it ignores the PMKID
        and proceeds with normal OWE 802.11 association by including a
        Diffie-Hellman Parameter element.</t>

        <t>When attempting "PMK caching", a client SHALL ignore any
        Diffie-Hellman Parameter element in an 802.11 association response
        whose PMKID matches that of the client-issued 802.11 association
        request. If the 802.11 association response does not include a PMKID,
        or if the PMKID does not match that of the client-issued 802.11
        association request, the client SHALL proceed with normal OWE
        association.</t>

        <t>The client SHALL ignore a PMKID in any 802.11 association response
        frame for which it did not include a PMKID in the corresponding 802.11
        association request frame.</t>
      </section>
    </section>

    <section anchor="IANA" title="IANA Considerations">
      <t>This document does not require any IANA actions.
</t>
    </section>

    <section anchor="implement" title="Implementation Considerations">
      <t>OWE is a replacement for 802.11 "Open" authentication. Therefore,
      when OWE-compliant access points are discovered, the presentation of the
      available SSID to users should not include special security symbols such
      as a "lock icon". To a user, an OWE SSID is the same as "Open"; it
      simply provides more security behind the scenes.</t>
      <t>When OWE is initially deployed as a replacement for an existing
      network that uses "Open" authentication or a shared and public PSK,
      it will be necessary to create an additional Basic Service Set
      Identifier (BSSID) or a new Extended Service Set (ESS) with a
      separate Service Set Identifier (SSID) for OWE so two distinct 802.11
      networks can exist on the same access point (see
      <xref target="IEEE802.11"/>). This arrangement should remain until
      the majority of users have switched over to OWE.</t>
    </section>

    <section anchor="Security" title="Security Considerations">
      <t>Opportunistic encryption does not provide authentication. The client
      will have no authenticated identity for the access point, and vice
      versa. They will share pairwise traffic encryption keys and have a
      cryptographic assurance that a frame claimed to be from the peer is
      actually from the peer and was not modified in flight.</t>

      <t>OWE only secures data sent over the wireless medium and does not
      provide security for end-to-end traffic. Users should still use
      application-level security to achieve security end-to-end.</t>

      <t>OWE is susceptible to an active attack in which an adversary
      impersonates an access point and induces a client to connect to it via OWE
      while it makes a connection to the legitimate access point. In this
      particular attack, the adversary is able to inspect, modify, and forge
      any data between the client and legitimate access point.</t>

      <t>OWE is not a replacement for any authentication protocol specified in
      <xref target="IEEE802.11"/> and is not intended to be used when an
      alternative that provides real authentication is available.</t>
    </section>
  </middle>

  <!--  *****BACK MATTER ***** -->

  <back>

    <references title="Normative References">

      <?rfc include='reference.RFC.2119'?>

      <?rfc include='reference.RFC.5869'?>

      <?rfc include='reference.RFC.6090'?>

      <?rfc include='reference.RFC.7748'?>


      <reference anchor="IEEE802.11">
        <front>
          <title>IEEE Standard for Information technology--Telecommunications
	  and information exchange between systems
          Local and metropolitan area networks--Specific requirements - Part 11:
	  Wireless LAN Medium Access Control (MAC) and Physical Layer (PHY) Specifications</title>

          <author>
            <organization>IEEE</organization>
          </author>
        <date month="" year=""/>
        </front>

        <seriesInfo name="IEEE Std 802.11," value="DOI 10.1109/IEEESTD.2016.7786995" />
      </reference>

      <reference anchor="IKE-IANA"
                 target="http://www.iana.org/assignments/ikev2-parameters/">
        <front>
          <title>Transform Type 4 - Diffie-Hellman Group Transform IDs
          </title>

          <author>
            <organization>IANA</organization>
          </author>
	  
          <date />
        </front>

      </reference>
    </references>

    <references title="Informative References">

      <?rfc include='reference.RFC.7435'?>
    </references>

  </back>
</rfc>
