<?xml version="1.0" encoding="US-ASCII"?>
<!-- This template is for creating an Internet Draft using xml2rfc,
     which is available here: http://xml.resource.org. -->
<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [
<!-- One method to get references from the online citation libraries.
     There has to be one entity for each item to be referenced. 
     An alternate method (rfc include) is described in the references. -->

<!ENTITY RFC2104 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2104.xml">
<!ENTITY RFC2409 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2409.xml">
<!ENTITY RFC2119 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml">
<!ENTITY RFC2629 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2629.xml">
<!ENTITY RFC3552 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.3552.xml">
<!ENTITY RFC5226 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.5226.xml">
<!ENTITY RFC6023 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.6023.xml">
<!ENTITY RFC6030 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.6030.xml">
<!ENTITY RFC7296 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.7296.xml">
<!ENTITY RFC7619 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.7619.xml">
<!ENTITY RFC8019 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.8019.xml">
<!ENTITY I-D.draft-hoffman-c2pq-01 SYSTEM "http://xml2rfc.tools.ietf.org/public/rfc/bibxml-ids/reference.I-D.draft-hoffman-c2pq-01.xml">
]>
<?xml-stylesheet type='text/xsl' href='rfc2629.xslt' ?>
<!-- used by XSLT processors -->
<!-- For a complete list and description of processing instructions (PIs), 
     please see http://xml.resource.org/authoring/README.html. -->
<!-- Below are generally applicable Processing Instructions (PIs) that most I-Ds might want to use.
     (Here they are set differently than their defaults in xml2rfc v1.32) -->
<?rfc strict="yes" ?>
<!-- give errors regarding ID-nits and DTD validation -->
<!-- control the table of contents (ToC) -->
<?rfc toc="yes"?>
<!-- generate a ToC -->
<?rfc tocdepth="4"?>
<!-- the number of levels of subsections in ToC. default: 3 -->
<!-- control references -->
<?rfc symrefs="yes"?>
<!-- use symbolic references tags, i.e, [RFC2119] instead of [1] -->
<?rfc sortrefs="yes" ?>
<!-- sort the reference entries alphabetically -->
<!-- control vertical white space 
     (using these PIs as follows is recommended by the RFC Editor) -->
<?rfc compact="yes" ?>
<!-- do not start each main section on a new page -->
<?rfc subcompact="no" ?>
<!-- keep one blank line between list items -->
<!-- end of list of popular I-D processing instructions -->
<rfc category="std" docName="draft-ietf-ipsecme-qr-ikev2-00" ipr="trust200902">
  <!-- category values: std, bcp, info, exp, and historic
     ipr values: full3667, noModification3667, noDerivatives3667
     you can add the attributes updates="NNNN" and obsoletes="NNNN" 
     they will automatically be output with "(if approved)" -->

  <!-- ***** FRONT MATTER ***** -->

  <front>
    <!-- The abbreviated title is used in the page header - it is only necessary if the 
         full title is longer than 39 characters -->

    <title abbrev="Postquantum Security for IKEv2">Postquantum Preshared Keys for IKEv2</title>

    <!-- add 'role="editor"' below for the editors if appropriate -->

    <!-- Another author who claims to be an editor -->

    <author fullname="Scott Fluhrer" initials="S.F."
            surname="Fluhrer">
      <organization>Cisco Systems</organization>

      <address>
        <email>sfluhrer@cisco.com</email>
      </address>
    </author>
    <author fullname="David McGrew" initials="D.M."
            surname="McGrew">
      <organization>Cisco Systems</organization>
      <address>
        <email>mcgrew@cisco.com</email>
      </address>
    </author>
    <author fullname="Panos Kampanakis" initials="P.K."
            surname="Kampanakis">
      <organization>Cisco Systems</organization>
      <address>
        <email>pkampana@cisco.com</email>
      </address>
    </author>
    <author fullname="Valery Smyslov" initials="V.S."
            surname="Smyslov">
      <organization>ELVIS-PLUS</organization>
      <address>
		<phone>+7 495 276 0211</phone>
        <email>svan@elvis.ru</email>
      </address>
    </author>
    <date />

    <!-- Meta-data Declarations -->

    <area>Security</area>

    <workgroup>Internet Engineering Task Force</workgroup>

    <!-- WG name at the upperleft corner of the doc,
         IETF is fine for individual submissions.  
	 If this element is not present, the default is "Network Working Group",
         which is used by the RFC Editor as a nod to the history of the IETF. -->

    <keyword>internet key exchange</keyword>
    <keyword>quantum computer</keyword>
    <keyword>post quantum</keyword>
    <keyword>post-quantum</keyword>
    <keyword>quantum safe</keyword>

    <!-- Keywords will be incorporated into HTML output
         files in a meta tag but they have no effect on text or nroff
         output. If you submit your draft to the RFC Editor, the
         keywords will be used for the search engine. -->

    <abstract>
      <t>The possibility of Quantum Computers pose a serious challenge to cryptography algorithms deployed widely today. 
      IKEv2 is one example of a cryptosystem that could be broken; 
      someone storing VPN communications today could decrypt them at a later 
      time when a Quantum Computer is available.
      It is anticipated that IKEv2 will be extended to support quantum secure key exchange
      algorithms; however that is not likely to happen in the near term.
      To address this problem before then, this document describes an extension of IKEv2 
      to allow it to be resistant to a Quantum Computer, by using preshared keys.</t>
    </abstract>
  </front>

  <middle>
    <section title="Introduction">
      <t>It is an open question whether or not it is feasible to build a Quantum Computer
      (and if so, when one might be implemented), but if it is, many of the cryptographic algorithms
      and protocols currently in use would be insecure.  A Quantum Computer would be able to solve DH and ECDH problems 
      in polynomial time <xref target="I-D.hoffman-c2pq"/>, and this would imply that the security 
      of existing IKEv2 <xref target="RFC7296"/> systems would be compromised.  IKEv1 <xref target="RFC2409"/>, when used with strong preshared keys, is not 
      vulnerable to quantum attacks, because those keys are one of the inputs to the key derivation function.
      If the preshared key has sufficient entropy and the PRF, encryption and authentication transforms are postquantum secure, then the
      resulting system is believed to be quantum resistant, that is, invulnerable to an attacker with a Quantum Computer.</t>

      <t>This document describes a way to extend IKEv2 to have a similar
      property; assuming that the two end systems share a long secret key,
      then the resulting exchange is quantum resistant.
      By bringing postquantum security to IKEv2, this note removes the need
      to use an obsolete version of the Internet Key Exchange in order to achieve
      that security goal.</t>

      <t>The general idea is that we add an additional secret that is shared
      between the initiator and the responder; this secret is in addition
      to the authentication method that is already provided within IKEv2.
      We stir this secret into the SK_d value, which is used to generate the key material 
      (KEYMAT) keys and the SKEYSEED for the child SAs; this secret provides quantum 
      resistance to the IPsec SAs (and any child IKE SAs). We also stir the secret 
      into the SK_pi, SK_pr values; this allows both sides to detect a secret mismatch cleanly.</t>

      <t>It was considered important to minimize the changes to IKEv2.
      The existing mechanisms to do authentication and key exchange remain
      in place (that is, we continue to do (EC)DH, and potentially a PKI
      authentication if configured). This document does not replace the authentication
      checks that the protocol does; instead, it is done as a parallel check.</t>

      <section title="Changes">
        <t>Changes in this draft in each version iterations.</t>
		
        <t>draft-ietf-ipsecme-qr-ikev2-00 
		<list style="symbols">
          <t>Migrated from draft-fluhrer-qr-ikev2-05 to draft-ietf-ipsecme-qr-ikev2-00 that is a WG item.</t>
		</list></t>
		
        <t>draft-fluhrer-qr-ikev2-05
		<list style="symbols">
          <t>Nits and editorial fixes.</t>
          <t>Made PPK_ID format and PPK Distributions subsection of the PPK section. Also added an Operational Considerations section.</t>
		  <t>Added comment about Child SA rekey in the Security Considerations section.</t>
		  <t>Added NO_PPK_AUTH to solve the cases where a PPK_ID is not configured for a responder.</t>
		  <t>Various text changes and clarifications.</t>
		  <t>Expanded Security Considerations section to describe some security concerns and how they should be addressed.</t>
		</list></t>
		
        <t>draft-fluhrer-qr-ikev2-03
		<list style="symbols">
          <t>Modified how we stir the PPK into the IKEv2 secret state.</t>
          <t>Modified how the use of PPKs is negotiated.</t>
		</list></t>

        <t>draft-fluhrer-qr-ikev2-02
		<list style="symbols">
          <t>Simplified the protocol by stirring in the
          preshared key into the child SAs; this avoids the problem of
          having the responder decide which preshared key to use (as it
          knows the initiator identity at that point); it does mean that
          someone with a Quantum Computer can recover the initial IKE
          negotiation.</t>
          <t>Removed positive endorsements of various algorithms. Retained warnings 
        about algorithms known to be weak against a Quantum Computer.</t>
		</list></t>

        <t>draft-fluhrer-qr-ikev2-01
		<list style="symbols">
          <t>Added explicit guidance as to what IKE and IPsec algorithms are quantum resistant.</t>
		</list></t>

        <t>draft-fluhrer-qr-ikev2-00
		<list style="symbols">
          <t>We switched from using vendor ID's to transmit the additional data to notifications.</t>
          <t>We added a mandatory cookie exchange to allow the server to communicate to the client before the initial exchange.</t>
          <t>We added algorithm agility by having the server tell the client what algorithm to use in the cookie exchange.</t>
          <t>We have the server specify the PPK Indicator Input, which allows
             the server to make a trade-off between the efficiency for
             the search of the clients PPK, and the anonymity of the client.</t>
          <t>We now use the negotiated PRF (rather than a fixed HMAC-SHA256) to transform the nonces during the KDF.</t>
		</list></t>
      </section>

      <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>

    <section title="Assumptions">
      <t>We assume that each IKE peer has a list of Postquantum Preshared Keys (PPK) along with their identifiers (PPK_ID),
      and any potential IKE initiator has a selection of which PPK to use with any specific responder.
      In addition, implementations have a configurable flag that determines whether this
      postquantum preshared key is mandatory.
      This PPK is independent of the preshared key (if any)
      that the IKEv2 protocol uses to perform authentication.
      The PPK specific configuration that is assumed on each peer consists of the following tuple:</t>
      <figure align="center">
        <artwork align="left"><![CDATA[
Peer, PPK, PPK_ID, mandatory_or_not
            ]]></artwork>
      </figure>
    </section>

    <section anchor="Exchanges" title="Exchanges">
      <t>If the initiator is configured to use a postquantum preshared key with the responder (whether or not
      the use of the PPK is mandatory), then it will include a notification PPK_SUPPORT in the initial exchange as follows:</t>

      <figure align="center">
        <artwork align="left"><![CDATA[
Initiator                       Responder
------------------------------------------------------------------
HDR, SAi1, KEi, Ni, N(PPK_SUPPORT)  --->
            ]]></artwork>
      </figure>

      <t>N(PPK_SUPPORT) is a status notification payload with the type [TBA];
      it has a protocol ID of 0, no SPI and no notification data associated with it.</t>

      <t>If the initiator needs to resend this initial message with a cookie (because the responder response included a COOKIE
      notification), then the resend would include the PPK_SUPPORT notification if the original message did.</t>

      <t>If the responder does not support this specification or does not have any PPK configured, 
      then it ignores the received notification and continues with the IKEv2 protocol as normal.
      Otherwise the responder checks if it has a PPK configured, and if it does, then the responder
      replies with the IKEv2 initial exchange including a PPK_SUPPORT notification in the response:</t>

      <figure align="center">
        <artwork align="left"><![CDATA[
Initiator                       Responder
------------------------------------------------------------------
                <--- HDR, SAr1, KEr, Nr, [CERTREQ], N(PPK_SUPPORT)
            ]]></artwork>
      </figure>

      <t>When the initiator receives this reply, it checks whether the responder included the PPK_SUPPORT notification.
      If the responder did not and the flag mandatory_or_not indicates that using PPKs is mandatory for communication with this responder, 
      then the initiator MUST abort the exchange. This situation may happen in case of misconfiguration,
      when the initiator believes it has a mandatory to use PPK for the responder, while the responder either doesn't support 
      PPKs at all or doesn't have any PPK configured for the initiator. See <xref target="Security"/> for discussion
      of the possible impacts of this situation.</t>

      <t>If the responder did not include the PPK_SUPPORT notification and using PPKs for this responder is optional, 
      then the initiator continues with the IKEv2 protocol as normal, without using PPKs.</t>

      <t>If the responder did include the PPK_SUPPORT notification, then the initiator selects a PPK, along with its 
      identifier PPK_ID. Then, it computes this modification of the standard IKEv2 key derivation:</t>

      <figure align="center">
        <artwork align="left"><![CDATA[
 SKEYSEED = prf(Ni | Nr, g^ir)
 {SK_d' | SK_ai | SK_ar | SK_ei | SK_er | SK_pi' | SK_pr' )
                 = prf+ (SKEYSEED, Ni | Nr | SPIi | SPIr }
 SK_d = prf(PPK, SK_d')
 SK_pi = prf(PPK, SK_pi')
 SK_pr = prf(PPK, SK_pr')
            ]]></artwork>
      </figure>

      <t>That is, we use the standard IKEv2 key derivation process except that the three subkeys SK_d, SK_pi, SK_pr are
      run through the prf again, this time using the PPK as the key.</t>

      <t>The initiator then sends the initial encrypted message, including the PPK_ID value as follows:</t>
      <figure align="center">
        <artwork align="left"><![CDATA[
Initiator                       Responder
------------------------------------------------------------------
HDR, SK {IDi, [CERT,] [CERTREQ,]
    [IDr,] AUTH, SAi2,
    TSi, TSr, N(PPK_IDENTITY)(PPK_ID), [N(NO_PPK_AUTH)]}  --->
            ]]></artwork>
      </figure>

      <t>PPK_IDENTITY is a status notification with the type [TBA]; 
      it has a protocol ID of 0, no SPI and a notification data that consists of the identifier PPK_ID.</t>

      <t>A situation may happen when the responder has some PPKs, but doesn't have a PPK with the PPK_ID received 
      from the initiator. In this case the responder cannot continue with PPK (in particular, it cannot
      authenticate the initiator), but it could be able to continue with normal IKEv2 protocol if the initiator 
      provided its authentication data computed as in normal IKEv2, without using PPKs. For this purpose, 
      if using PPKs for communication with this responder is optional for the initiator, then 
      the initiator MAY include a notification NO_PPK_AUTH in the above message.</t>

      <t>NO_PPK_AUTH is a status notification with the type [TBA]; it has a protocol ID of 0 and no SPI.
      A notification data consists of the initiator's authentication data computed using SK_pi' 
      (i.e. the data that computed without using PPKs and would normally be placed in the AUTH payload).
      Authentication Method for computing the authentication data MUST be the same as indicated in the AUTH payload
      and is not included in the notification. Note that if the initiator decides to include NO_PPK_AUTH 
      notification, then it means that the initiator needs to perform authentication data computation twice that may consume 
      substantial computation power (e.g. if digital signatures are involved).</t>

      <t>When the responder receives this encrypted exchange, it first computes the values:</t>

      <figure align="center">
        <artwork align="left"><![CDATA[
 SKEYSEED = prf(Ni | Nr, g^ir)
 {SK_d' | SK_ai | SK_ar | SK_ei | SK_er | SK_pi' | SK_pr' }
                 = prf+ (SKEYSEED, Ni | Nr | SPIi | SPIr )
            ]]></artwork>
      </figure>

      <t>It then uses the SK_ei/SK_ai values to decrypt/check the message and then scans through the payloads for the PPK_ID 
      attached to the PPK_IDENTITY notification. If no PPK_IDENTITY notification is found and the peers successfully 
      exchanged PPK_SUPPORT notifications in the initial exchange, then the responder MUST send back AUTHENTICATION_FAILED 
      notification and then fail the negotiation.</t>

      <t>If the PPK_IDENTITY notification contains PPK_ID that is not known to the responder or is not configured 
      for use for the identity from IDi payload, then the responder checks whether using PPKs for this initiator is mandatory 
      and whether the initiator included NO_PPK_AUTH notification in the message. If using PPKs is mandatory or no NO_PPK_AUTH 
      notification found, then then the responder MUST send back AUTHENTICATION_FAILED notification and then fail the negotiation.
	  Otherwise (when PPK is optional and the initiator included NO_PPK_AUTH notification) the responder MAY
      continue regular IKEv2 protocol, except that it uses the data from the NO_PPK_AUTH notification as the 
      authentication data (which usually resides in the AUTH payload), for the purpose of the initiator authentication. 
      Note, that Authentication Method is still indicated in the AUTH payload.</t>

      <t>This table summarizes the above logic by the responder:</t>

      <figure align="center">
        <artwork align="left"><![CDATA[
 Received     Received    Have       PPK
PPK_SUPPORT  NO_PPK_AUTH  PPK     Mandatory    Action
------------------------------------------------------------------
     No         *          No         *        Standard IKEv2 protocol
     No         *         Yes        No        Standard IKEv2 protocol
     No         *         Yes       Yes        Abort negotiation
    Yes        No          No         *        Abort negotiation
    Yes       Yes          No       Yes        Abort negotiation
    Yes       Yes          No        No        Standard IKEv2 protocol
    Yes         *         Yes         *        Use PPK
         ]]></artwork>
      </figure>

      <t>If PPK is in use, then the responder extracts corresponding PPK and computes the following values:</t>

      <figure align="center">
        <artwork align="left"><![CDATA[
 SK_d = prf(PPK, SK_d')
 SK_pi = prf(PPK, SK_pi')
 SK_pr = prf(PPK, SK_pr')
            ]]></artwork>
      </figure>

      <t>The responder then continues with the exchange (validating the AUTH payload that the initiator included) as usual
      and sends back a response, which includes the PPK_IDENTITY notification with no data to indicate that the PPK is 
      used in the exchange:</t>

      <figure align="center">
        <artwork align="left"><![CDATA[
Initiator                       Responder
------------------------------------------------------------------
                           <--  HDR, SK {IDr, [CERT,]
                                AUTH, SAr2,
                                TSi, TSr, N(PPK_IDENTITY)}
        ]]></artwork>
      </figure>

      <t>When the initiator receives the response, then it checks for the presence of the PPK_IDENTITY
      notification.  If it receives one, it marks the SA as using the
      configured PPK to generate SK_d, SK_pi, SK_pr (as shown above);
      if it does not receive one, it MUST either fail the IKE SA negotiation sending the AUTHENTICATION_FAILED notification 
      in the Informational exchange (if the PPK was configured as mandatory), or
      continue without using the PPK (if the PPK was not configured as mandatory and the initiator
      included the NO_PPK_AUTH notification in the request).</t>
    </section>

	
    <section title="Upgrade procedure">
      <t>This algorithm was designed so that someone can introduce PPKs into an existing IKE network
         without causing network disruption.</t>
      <t>In the initial phase of the network upgrade, the network administrator would visit each IKE node, and configure:
        <list style="symbols">
		<t>The set of PPKs (and corresponding PPK_IDs) that this node would need to know.</t>
        <t>For each peer that this node would initiate to, which PPK will be used.</t>
        <t>That the use of PPK is currently not mandatory.</t>
        </list></t>
      <t>With this configuration, the node will continue to operate with nodes that have not yet been upgraded. 
         This is due to the PPK_SUPPORT notify and the NO_PPK_AUTH notify; if the initiator has not been upgraded, it will not send the PPK_SUPPORT 
         notify (and so the responder will know that we will not use a PPK). If the responder has not been upgraded, it 
         will not send the PPK_SUPPORT notify (and so the initiator will know to not use a PPK). If both peers 
         have been upgraded, but the responder isn't yet configured with the PPK for the initiator, then the responder
         could do standard IKEv2 protocol if the initiator sent NO_PPK_AUTH notification.
         If the responder has not been upgraded and properly configured, they will both realize it, and in that case, the link will be quantum secure.</t>
      <t>As an optional second step, after all nodes have been upgraded, then the administrator may then go back through
         the nodes, and mark the use of PPK as mandatory.  This will not affect the strength against a passive attacker;
         it would mean that an attacker with a Quantum Computer (which is sufficiently fast to be able to break the (EC)DH
         in real time would not be able to perform a downgrade attack).</t>
    </section>
	
	
    <section title="PPK">
      <section title="PPK_ID format">
        <t>This standard requires that both the initiator and the responder have a secret PPK value, with the responder selecting the PPK based on the PPK_ID that the
        initiator sends.  In this standard, both the initiator and the responder are configured with fixed PPK and PPK_ID values, and do the
        look up based on PPK_ID value.
        It is anticipated that later standards will extend this technique to allow dynamically changing PPK values.
        To facilitate such an extension, we specify that the PPK_ID the initiator sends will have its first
        octet be the PPK_ID Type value. This document defines two values for PPK_ID Type:
        <list style="symbols">

          <t>PPK_ID_OPAQUE (1) - for this type the format of the PPK_ID (and the PPK itself) is not specified by this document; it is
          assumed to be mutually intelligible by both by initiator and the responder.  This PPK_ID type is intended
          for those implementations that choose not to disclose the type of PPK to active attackers.</t>

          <t>PPK_ID_FIXED (2) - in this case the format of the PPK_ID and the PPK are fixed octet strings; the remaining bytes of the
          PPK_ID are a configured value.  We assume that there is a fixed mapping between PPK_ID and PPK, which is
          configured locally to both the initiator and the responder.  The responder can use to do a look up the passed
          PPK_ID value to determine the corresponding PPK value.
          Not all implementations are able to configure arbitrary octet strings; to improve the potential interoperability,
          it is recommended that, in the PPK_ID_FIXED case, both the PPK and the PPK_ID strings be limited to the base64 character set, 
          namely the 64 characters 0-9, A-Z, a-z, + and /.</t>
        </list></t>

        <t>The PPK_ID type value 0 is reserved; values 3-127 are reserved for IANA; values 128-255 are for private use among mutually consenting parties.</t>
      </section>

      <section title="Operational Considerations">
        <t>The need to maintain several independent sets of security credentials can significantly complicate security administrators job, 
        and can potentially slow down widespread adoption of this solution. It is anticipated, that administrators will try to simplify their job 
        by decreasing the number of credentials they need to maintain. This section describes some of the considerations for PPK management.</t>
		<section title="PPK Distribution">
          <t>PPK_IDs of the type PPK_ID_FIXED (and the corresponding PPKs) are assumed to be configured within the IKE device in an out-of-band fashion.
		  While the method of distribution is a local matter and out of scope of this document or IKEv2, <xref target="RFC6030"/> describes a format for 
          symmetric key exchange. That format could be reused with the Key Id field being the PPK_ID (without the PPK_ID Type octet for a PPK_ID_FIXED), 
          the PPK being the secret, and the algorithm ("Algorithm=urn:ietf:params:xml:ns:keyprov:pskc:pin") as PIN.</t>
		</section>
		<section title="Group PPK">
          <t>This document doesn't explicitly require that PPK is unique for each pair of peers. If it is the case, then this solution provides full 
          peer authentication, but it also means that each host must have that many independent PPKs, how many peers it is going to communicate with. 
          As the number of hosts grows this will scale badly.</t>
          <t>Even though it is NOT RECOMMENDED, it is possible to use a single PPK for a group of users. Since each peer uses classical public key 
          cryptography in addition to PPK for key exchange and authentication, members of the group can neither impersonate each other nor read 
          other's traffic, unless they use Quantum Computers to break public key operations. </t>
          <t>Although it's probably safe to use group PPK in short term, the fact, that the PPK is known to a (potentially large) group of users makes 
          it more susceptible to theft. If an attacker equipped with a Quantum Computer got access to a group PPK, then all the communications inside 
          the group are revealed.</t>
		</section>
		<section title="PPK-only Authentication">	
          <t>If Quantum Computers become a reality, classical public key cryptography will provide little security, so administrators may find it attractive 
          not to use it at all for authentication. This will reduce the number of credentials they need to maintain to PPKs only. Combining group PPK and 
          PPK-only authentication is NOT RECOMMENDED, since in this case any member of the group can impersonate any other member even without help 
          of Quantum Computers.</t>
          <t>PPK-only authentication can be achieved in IKEv2 if NULL Authentication method <xref target="RFC7619"/> is employed. Without PPK 
          the NULL Authentication method provides no authentication of the peers, however since a PPK is stirred into the SK_pi and the SK_pr, 
          the peers become authenticated if a PPK is in use. Using PPKs MUST be mandatory for the peers if they advertise support for PPK 
          in initial exchange and use NULL Authentication. Addtionally, since the peers are authenticated via PPK, the ID Type in the IDi/IDr
          payloads SHOULD NOT be ID_NULL, despite using NULL Authentication method.</t>
		</section>
	  </section>
    </section>
   
    <section anchor="Security" title="Security Considerations">
      <t>Quantum computers are able to perform Grover's algorithm; that
      effectively halves the size of a symmetric key.  Because of this,
      the user SHOULD ensure that the postquantum preshared key used has
      at least 256 bits of entropy, in order to provide a 128-bit security level.</t>

      <t>With this protocol, the computed SK_d is a function of the PPK, and assuming that the PPK has sufficient
      entropy (for example, at least 2^256 possible values), then even if an attacker was able to recover the
      rest of the inputs to the prf function, it would be infeasible to use Grover's algorithm with a Quantum
      Computer to recover the SK_d value.  Similarly, every child
      SA key is a function of SK_d, hence all the keys for all the child SAs are also quantum resistant
      (assuming that the PPK was high entropy and secret, and that all the subkeys are sufficiently long).</t>

      <t>Although this protocol preserves all the security properties of IKEv2 against
      adversaries with conventional computers, it allows an adversary with
      a Quantum Computer to decrypt all traffic encrypted with the initial IKE SA.
      In particular, it allows the adversary to recover the identities of both sides.
      If there is IKE traffic other than the identities that need to be protected
      against such an adversary, implementations MAY rekey the initial IKE SA  
      immediately after negotiating it to generate a new SKEYSEED with 
      from the postquantum SK_d. This would reduce the amount of data 
      available to an attacker with a Quantum Computer.</t>
   
      <t>Alternatively, an initial IKE SA (which is used to exchange identities) can take place, 
      perhaps by using the protocol documented in <xref target="RFC6023"/>.  After the childless 
      IKE SA is created, implementations would immediately create a new IKE SA (which is used to exchange 
      everything else) by using a rekey mechanism for IKE SAs. Because the rekeyed IKE SA keys are a 
      function of SK_d, which is a function of the PPK (among other things), 
      traffic protected by that IKE SA is secure against Quantum capable adversaries.</t>

      <t>If some sensitive information (like keys) is to be transferred over IKE SA, then
      implementations MUST rekey the initial IKE SA before sending this 
      information to get protection against Quantum Computers.</t>

      <t>In addition, the policy SHOULD be set to negotiate only quantum-resistant 
      symmetric algorithms; while this RFC doesn't claim to give 
      advise as to what algorithms are secure (as that may change 
      based on future cryptographical results), below is a list of defined IKEv2 and 
      IPsec algorithms that should NOT be used, as they are known not to be quantum resistant 
      <list style="symbols"> 
        <t>Any IKEv2 Encryption algorithm, PRF or Integrity algorithm with key size less than 256 bits.</t> 
        <t>Any ESP Transform with key size less than 256 bits.</t>
        <t>PRF_AES128_XCBC and PRF_AES128_CBC; even though they are defined to be able to use an arbitrary key size, 
        they convert it into a 128-bit key internally.</t>
      </list></t>

      <t><xref target="Exchanges" /> requires the initiator to abort the initial exchange if using PPKs is mandatory for it,
      but the responder didn't include the PPK_SUPPORT notification in the response. In this situation when the initiator aborts 
      negotiation it leaves half-open IKE SA on the responder (because the initial exchange completes successfully from responder's
      point of view). This half-open SA will eventually expire and be deleted, but if the initiator continues its attempts to create 
      IKE SA with a high enough rate, then the responder may consider it as a Denial-of-Service attack and take some measures 
      (see <xref target="RFC8019" /> for more detail). It is RECOMMENDED that implementations in this situation cache 
      the negative result of negotiation for some time and don't make attempts to create it again for some time, because
      this is a result of misconfiguration and probably some re-configuration of the peers is needed.</t>

      <t>If using PPKs is optional for both peers and they authenticate themselves using digital signatures, then
      an attacker in between, equipped with a Quantum Computer capable of breaking public key operations 
      in real time, is able to mount downgrade attack by removing PPK_SUPPORT notification from the initial exchange
      and forging digital signatures in the subsequent exchange. If using PPKs is mandatory for at least one of the peers
      or PSK is used for authentication, then the attack will be detected and the SA won't be created.</t>

      <t>If using PPKs is mandatory for the initiator, then an attacker capable to eavesdrop and to inject packets into
      the network can prevent creating IKE SA by mounting the following attack. The attacker intercepts the the 
      initial request containing the PPK_SUPPORT notification and injects the forget response containing no PPK_SUPPORT.
      If the attacker manages to inject this packet before the responder sends a genuine response, then the initiator would
      abort the exchange. To thwart this kind of attack it is RECOMMENDED, that if using PPKs is mandatory for the initiator and
      the received response doesn't contain the PPK_SUPPORT notification, then the initiator doesn't abort exchange 
      immediately, but instead waits some time for more responses (possibly retransmitting the request). 
      If all the received responses contain no PPK_SUPPORT, then the exchange is aborted.</t>

    </section>

    <section title="IANA Considerations">
      <t>This document defines three new Notify Message Types in the "Notify Message Types - Status Types" registry:</t>
      <figure align="center">
        <artwork align="left"><![CDATA[
<TBA>       PPK_SUPPORT
<TBA>       PPK_IDENTITY
<TBA>       NO_PPK_AUTH
                ]]></artwork>
      </figure>

      <t>This document also creates a new IANA registry for the PPK_ID types. The initial values of this registry are:</t>
      <figure align="center">
        <artwork align="left"><![CDATA[
    PPK_ID Type               Value
    -----------               -----
    Reserved                  0
    PPK_ID_OPAQUE             1
    PPK_ID_FIXED              2
    Unassigned                3-127
    Reserved for private use  128-255 ]]></artwork>
      </figure>

      <t>Changes and additions to this registry are by Expert Review <xref target="RFC5226" />.</t>
    </section>
  </middle>

  <!--  *****BACK MATTER ***** -->

  <back>
    <!-- References split into informative and normative -->

    <!-- There are 2 ways to insert reference entries from the citation libraries:
     1. define an ENTITY at the top, and use "ampersand character"RFC2629; here (as shown)
     2. simply use a PI "less than character"?rfc include="reference.RFC.2119.xml"?> here
        (for I-Ds: include="reference.I-D.narten-iana-considerations-rfc2434bis.xml")

     Both are cited textually in the same manner: by using xref elements.
     If you use the PI option, xml2rfc will, by default, try to find included files in the same
     directory as the including file. You can also define the XML_LIBRARY environment variable
     with a value containing a set of directories to search.  These can be either in the local
     filing system or remote ones accessed by http (http://domain/dir/... ).-->

    <references title="Normative References">
      <!-- &RFC2104; -->
      <!--?rfc include="http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml"?-->
      &RFC2119;
      &RFC7296;
    </references>

    <references title="Informational References">
      &RFC2409;
	  &RFC5226;
	  &RFC6023;
      &RFC6030;
	  &RFC7619; 
	  &RFC8019; 
	  <?rfc include="http://xml2rfc.tools.ietf.org/public/rfc/bibxml-ids/reference.I-D.draft-hoffman-c2pq-01.xml"?>
      <!-- <reference anchor="SPDP"
                 target="http://www.mindspring.com/~dmcgrew/spdp.txt">
          <front>
          <title>A Secure Peer Discovery Protocol (SPDP)</title>
          <author fullname="David McGrew" initials="D.M."
            surname="McGrew">
             <organization>Cisco Systems</organization>

          <address>
             <email>mcgrew@cisco.com</email>
          </address>
          </author>
          <date year="2001" />
          </front>
      </reference> -->
    </references>

    <section anchor="app-additional" title="Discussion and Rationale">
      <t>The idea behind this document is that while a Quantum Computer can easily
      reconstruct the shared secret of an (EC)DH exchange, they cannot as
      easily recover a secret from a symmetric exchange. This makes the
      SK_d, and hence the IPsec KEYMAT and any child SA's SKEYSEED, depend
      on both the symmetric PPK, and also the Diffie-Hellman exchange.
      If we assume that the attacker knows everything except the
      PPK during the key exchange, and there are 2^n plausible PPKs, then
      a Quantum Computer (using Grover's algorithm) would take O(2^(n/2))
      time to recover the PPK. So, even if the (EC)DH can be trivially
      solved, the attacker still can't recover any key material
      (except for the SK_ei, SK_er, SK_ai, SK_ar values for the initial IKE exchange) unless they
      can find the PPK, which is too difficult if the PPK has enough
      entropy (for example, 256 bits).
      Note that we do allow an attacker with a Quantum Computer to
      rederive the keying material for the initial IKE SA; this was
      a compromise to allow the responder to select the correct PPK quickly. </t>

      <t>Another goal of this protocol is to minimize the number of changes 
      within the IKEv2 protocol, and in particular, within the cryptography 
      of IKEv2.  By limiting our changes to notifications, and translating the 
      nonces, it is hoped that this would be implementable, even on systems 
      that perform much of the IKEv2 processing is in hardware.</t>

      <t>A third goal was to be friendly to incremental deployment in operational networks, for which
      we might not want to have a global shared key or quantum resistant IKEv2 is rolled out 
      incrementally. This is why we specifically try to allow the
      PPK to be dependent on the peer, and why we allow the PPK to be
      configured as optional.</t>

      <t>A fourth goal was to avoid violating any of the security goals of IKEv2.</t>
    </section>

    <section anchor="Acknowledgements" title="Acknowledgements">
      <t>We would like to thank Tero Kivinen, Paul Wouters, Graham Bartlett and the rest
      of the ipsecme Working Group for their feedback and suggestions for the scheme.</t>
    </section>

  </back>
</rfc>

