draft-ietf-ipsecme-safecurves-04.txt   draft-ietf-ipsecme-safecurves-05.txt 
Network Working Group Y. Nir Network Working Group Y. Nir
Internet-Draft Check Point Internet-Draft Check Point
Intended status: Standards Track S. Josefsson Intended status: Standards Track S. Josefsson
Expires: March 3, 2017 SJD Expires: April 14, 2017 SJD
August 30, 2016 October 11, 2016
Curve25519 and Curve448 for IKEv2 Key Agreement Curve25519 and Curve448 for IKEv2 Key Agreement
draft-ietf-ipsecme-safecurves-04 draft-ietf-ipsecme-safecurves-05
Abstract Abstract
This document describes the use of Curve25519 and Curve448 for This document describes the use of Curve25519 and Curve448 for
ephemeral key exchange in the Internet Key Exchange (IKEv2) protocol. ephemeral key exchange in the Internet Key Exchange (IKEv2) protocol.
Status of This Memo Status of This Memo
This Internet-Draft is submitted in full conformance with the This Internet-Draft is submitted in full conformance with the
provisions of BCP 78 and BCP 79. provisions of BCP 78 and BCP 79.
skipping to change at page 1, line 32 skipping to change at page 1, line 32
Internet-Drafts are working documents of the Internet Engineering Internet-Drafts are working documents of the Internet Engineering
Task Force (IETF). Note that other groups may also distribute Task Force (IETF). Note that other groups may also distribute
working documents as Internet-Drafts. The list of current Internet- working documents as Internet-Drafts. The list of current Internet-
Drafts is at http://datatracker.ietf.org/drafts/current/. Drafts is at http://datatracker.ietf.org/drafts/current/.
Internet-Drafts are draft documents valid for a maximum of six months Internet-Drafts are draft documents valid for a maximum of six months
and may be updated, replaced, or obsoleted by other documents at any and may be updated, replaced, or obsoleted by other documents at any
time. It is inappropriate to use Internet-Drafts as reference time. It is inappropriate to use Internet-Drafts as reference
material or to cite them other than as "work in progress." material or to cite them other than as "work in progress."
This Internet-Draft will expire on March 3, 2017. This Internet-Draft will expire on April 14, 2017.
Copyright Notice Copyright Notice
Copyright (c) 2016 IETF Trust and the persons identified as the Copyright (c) 2016 IETF Trust and the persons identified as the
document authors. All rights reserved. document authors. All rights reserved.
This document is subject to BCP 78 and the IETF Trust's Legal This document is subject to BCP 78 and the IETF Trust's Legal
Provisions Relating to IETF Documents Provisions Relating to IETF Documents
(http://trustee.ietf.org/license-info) in effect on the date of (http://trustee.ietf.org/license-info) in effect on the date of
publication of this document. Please review these documents publication of this document. Please review these documents
skipping to change at page 2, line 26 skipping to change at page 2, line 26
7. References . . . . . . . . . . . . . . . . . . . . . . . . . 5 7. References . . . . . . . . . . . . . . . . . . . . . . . . . 5
7.1. Normative References . . . . . . . . . . . . . . . . . . 5 7.1. Normative References . . . . . . . . . . . . . . . . . . 5
7.2. Informative References . . . . . . . . . . . . . . . . . 5 7.2. Informative References . . . . . . . . . . . . . . . . . 5
Appendix A. Numerical Example for Curve25519 . . . . . . . . . . 6 Appendix A. Numerical Example for Curve25519 . . . . . . . . . . 6
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 7 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 7
1. Introduction 1. Introduction
The "Elliptic Curves for Security" document [RFC7748] describes two The "Elliptic Curves for Security" document [RFC7748] describes two
elliptic curves: Curve25519 and Curve448, as well as the X25519 and elliptic curves: Curve25519 and Curve448, as well as the X25519 and
X448 functions for performing key agreement (Diffie-Hellman) X448 functions for performing key agreement using Diffie-Hellman
operations with these curves. The curves and functions are designed operations with these curves. The curves and functions are designed
for both performance and security. for both performance and security.
Elliptic curve Diffie-Hellman [RFC5903] has been specified for the Elliptic curve Diffie-Hellman [RFC5903] has been specified for the
Internet Key Exchange (IKEv2 - [RFC7296]) for almost ten years. That Internet Key Exchange (IKEv2 - [RFC7296]) for almost ten years. RFC
document specified the so-called NIST curves. The state of the art 5903 and its predecessor specified the so-called NIST curves. The
has advanced since then. More modern curves allow faster state of the art has advanced since then. More modern curves allow
implementations while making it much easier to write constant-time faster implementations while making it much easier to write constant-
implementations free from time-based side-channel attacks. This time implementations resilient to time-based side-channel attacks.
document defines two such curves for use in IKE. See [Curve25519] This document defines two such curves for use in IKE. See
for details about the speed and security of the Curve25519 function. [Curve25519] for details about the speed and security of the
Curve25519 function.
1.1. Conventions Used in This Document 1.1. Conventions Used in This Document
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
document are to be interpreted as described in [RFC2119]. document are to be interpreted as described in [RFC2119].
2. Curve25519 & Curve448 2. Curve25519 & Curve448
All cryptographic computations are done using the X25519 and X448 Implementations of Curve25519 and Curve448 in IKEv2 SHALL follow the
functions defined in [RFC7748]. All related parameters (for example, steps described in this section. All cryptographic computations are
the base point) and the encoding (in particular, pruning the least/ done using the X25519 and X448 functions defined in [RFC7748]. All
most significant bits and use of little-endian encoding) are related parameters (for example, the base point) and the encoding (in
inherited from [RFC7748]. particular, pruning the least/most significant bits and use of
little-endian encoding) are compliant with [RFC7748].
An ephemeral Diffie-Hellman key exchange using Curve25519 or Curve448 An ephemeral Diffie-Hellman key exchange using Curve25519 or Curve448
goes as follows: Each party picks a secret key d uniformly at random is performed as follows: Each party picks a secret key d uniformly at
and computes the corresponding public key. "X" is used below to random and computes the corresponding public key. "X" is used below
denote either X25519 or X448, and "G" is used to denote the to denote either X25519 or X448, and "G" is used to denote the
corresponding base point: corresponding base point:
pub_mine = X(d, G) pub_mine = X(d, G)
Parties exchange their public keys (see Section 3.1) and compute a Parties exchange their public keys (see Section 3.1) and compute a
shared secret: shared secret:
SHARED_SECRET = X(d, pub_peer). SHARED_SECRET = X(d, pub_peer).
This shared secret is used directly as the value denoted g^ir in This shared secret is used directly as the value denoted g^ir in
skipping to change at page 3, line 50 skipping to change at page 4, line 4
| Diffie-Hellman Group Num | RESERVED | | Diffie-Hellman Group Num | RESERVED |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| | | |
~ Key Exchange Data ~ ~ Key Exchange Data ~
| | | |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
o Payload Length - For Curve25519 the public key is 32 octets, so o Payload Length - For Curve25519 the public key is 32 octets, so
the Payload Length field will be 40, and for Curve448 the public the Payload Length field will be 40, and for Curve448 the public
key is 56 octets, so the Payload Length field will be 64. key is 56 octets, so the Payload Length field will be 64.
o The Diffie-Hellman Group Num is TBA1 for Curve25519, or TBA2 for o The Diffie-Hellman Group Num is TBA1 for Curve25519, or TBA2 for
Curve448. Curve448.
o The Key Exchange Data is the 32 or 56 octets as described in o The Key Exchange Data is the 32 or 56 octets as described in
section 6 of [RFC7748] section 6 of [RFC7748]
3.2. Recipient Tests 3.2. Recipient Tests
This document matches the discussion in [RFC7748] related to Receiving and handling of incompatible point formats MUST follow the
receiving and accepting incompatible point formats. In particular, considerations described in section 5 of [RFC7748]. In particular,
receiving entities MUST mask the most-significant bit in the final receiving entities MUST mask the most-significant bit in the final
byte for X25519 (but not X448), and implementations MUST accept non- byte for X25519 (but not X448), and implementations MUST accept non-
canonical values. See section 5 of [RFC7748] for further discussion. canonical values.
4. Security Considerations 4. Security Considerations
Curve25519 and Curve448 are designed to facilitate the production of Curve25519 and Curve448 are designed to facilitate the production of
high-performance constant-time implementations. Implementors are high-performance constant-time implementations. Implementors are
encouraged to use a constant-time implementation of the functions. encouraged to use a constant-time implementation of the functions.
This point is of crucial importance if the implementation chooses to This point is of crucial importance especially if the implementation
reuse its supposedly ephemeral key pair for many key exchanges, which chooses to reuse its ephemeral key pair in many key exchanges for
some implementations do in order to improve performance. performance reasons.
Curve25519 is intended for the ~128-bit security level, comparable to Curve25519 is intended for the ~128-bit security level, comparable to
the 256-bit random ECP group (group 19) defined in RFC 5903, also the 256-bit random ECP group (group 19) defined in RFC 5903, also
known as NIST P-256 or secp256r1. Curve448 is intended for the known as NIST P-256 or secp256r1. Curve448 is intended for the
~224-bit security level. ~224-bit security level.
While the NIST curves are advertised as being chosen verifiably at While the NIST curves are advertised as being chosen verifiably at
random, there is no explanation for the seeds used to generate them. random, there is no explanation for the seeds used to generate them.
In contrast, the process used to pick these curves is fully In contrast, the process used to pick Curve25519 and Curve448 is
documented and rigid enough so that independent verification has been fully documented and rigid enough so that independent verification
done. This is widely seen as a security advantage, since it prevents can and has been done. This is widely seen as a security advantage,
the generating party from maliciously manipulating the parameters. since it prevents the generating party from maliciously manipulating
the parameters.
Another family of curves available in IKE, generated in a fully Another family of curves available in IKE that were generated in a
verifiable way, is the Brainpool curves [RFC6954]. For example, fully verifiable way, is the Brainpool curves [RFC6954]. For
brainpoolP256 (group 28) is expected to provide a level of security example, brainpoolP256 (group 28) is expected to provide a level of
comparable to Curve25519 and NIST P-256. However, due to the use of security comparable to Curve25519 and NIST P-256. However, due to
pseudo-random prime, it is significantly slower than NIST P-256, the use of pseudo-random prime, it is significantly slower than NIST
which is itself slower than Curve25519. P-256, which is itself slower than Curve25519.
5. IANA Considerations 5. IANA Considerations
IANA is requested to assign two values from the IKEv2 "Transform Type IANA is requested to assign two values from the IKEv2 "Transform Type
4 - Diffie-Hellman Group Transform IDs" registry, with names 4 - Diffie-Hellman Group Transform IDs" registry, with names
"Curve25519" and "Curve448" and this document as reference. The "Curve25519" and "Curve448" and this document as reference. The
Recipient Tests field should also point to this document: Recipient Tests field should also point to this document:
+--------+------------+---------------------+-----------+ +--------+------------+---------------------+-----------+
| Number | Name | Recipient Tests | Reference | | Number | Name | Recipient Tests | Reference |
+--------+------------+---------------------+-----------+ +--------+------------+---------------------+-----------+
| TBA1 | Curve25519 | RFCxxxx Section 3.2 | RFCxxxx | | TBA1 | Curve25519 | RFCxxxx Section 3.2 | RFCxxxx |
| TBA2 | Curve448 | RFCxxxx Section 3.2 | RFCxxxx | | TBA2 | Curve448 | RFCxxxx Section 3.2 | RFCxxxx |
+--------+------------+---------------------+-----------+ +--------+------------+---------------------+-----------+
Table 1: New Transform Type 4 Values Table 1: New Transform Type 4 Values
6. Acknowledgements 6. Acknowledgements
Curve25519 was designed by D. J. Bernstein and the parameters for Curve25519 was designed by D. J. Bernstein and the parameters for
Curve448 ("Goldilocks") is by Mike Hamburg. The specification of Curve448 ("Goldilocks") were defined by Mike Hamburg. The
algorithms, wire format and other considerations are in RFC 7748 by specification of algorithms, wire format and other considerations are
Adam Langley, Mike Hamburg, and Sean Turner. documented in RFC 7748 by Adam Langley, Mike Hamburg, and Sean
Turner.
The example in Appendix A was calculated using the master version of The example in Appendix A was calculated using the master version of
OpenSSL, retrieved on August 4th, 2016. OpenSSL, retrieved on August 4th, 2016.
7. References 7. References
7.1. Normative References 7.1. Normative References
[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate
Requirement Levels", BCP 14, RFC 2119, March 1997. Requirement Levels", BCP 14, RFC 2119, March 1997.
 End of changes. 15 change blocks. 
40 lines changed or deleted 44 lines changed or added

This html diff was produced by rfcdiff 1.45. The latest version is available from http://tools.ietf.org/tools/rfcdiff/