draft-ietf-curdle-ssh-curves-06.txt   draft-ietf-curdle-ssh-curves-07.txt 
Internet Engineering Task Force A. Adamantiadis Internet Engineering Task Force A. Adamantiadis
Internet-Draft libssh Internet-Draft libssh
Intended status: Standards Track S. Josefsson Intended status: Standards Track S. Josefsson
Expires: May 16, 2018 SJD AB Expires: July 5, 2018 SJD AB
M. Baushke M. Baushke
Juniper Networks, Inc. Juniper Networks, Inc.
November 12, 2017 January 1, 2018
Secure Shell (SSH) Key Exchange Method using Curve25519 and Curve448 Secure Shell (SSH) Key Exchange Method using Curve25519 and Curve448
draft-ietf-curdle-ssh-curves-06 draft-ietf-curdle-ssh-curves-07
Abstract Abstract
This document describes the conventions for using Curve25519 and This document describes the conventions for using Curve25519 and
Curve448 key exchange methods in the Secure Shell (SSH) protocol. Curve448 key exchange methods in the Secure Shell (SSH) 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 34 skipping to change at page 1, line 34
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 https://datatracker.ietf.org/drafts/current/. Drafts is at https://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 May 16, 2018. This Internet-Draft will expire on July 5, 2018.
Copyright Notice Copyright Notice
Copyright (c) 2017 IETF Trust and the persons identified as the Copyright (c) 2018 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
(https://trustee.ietf.org/license-info) in effect on the date of (https://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
carefully, as they describe your rights and restrictions with respect carefully, as they describe your rights and restrictions with respect
to this document. Code Components extracted from this document must to this document. Code Components extracted from this document must
include Simplified BSD License text as described in Section 4.e of include Simplified BSD License text as described in Section 4.e of
the Trust Legal Provisions and are provided without warranty as the Trust Legal Provisions and are provided without warranty as
described in the Simplified BSD License. described in the Simplified BSD License.
Table of Contents Table of Contents
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2
2. Key Exchange Methods . . . . . . . . . . . . . . . . . . . . 3 2. Requirements Language . . . . . . . . . . . . . . . . . . . . 2
2.1. Shared Secret Encoding . . . . . . . . . . . . . . . . . 3 3. Key Exchange Methods . . . . . . . . . . . . . . . . . . . . 3
3. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 4 3.1. Shared Secret Encoding . . . . . . . . . . . . . . . . . 3
4. Security Considerations . . . . . . . . . . . . . . . . . . . 4 4. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 4
5. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 4 5. Security Considerations . . . . . . . . . . . . . . . . . . . 4
6. References . . . . . . . . . . . . . . . . . . . . . . . . . 5 6. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 4
6.1. Normative References . . . . . . . . . . . . . . . . . . 5 7. References . . . . . . . . . . . . . . . . . . . . . . . . . 5
6.2. Informative References . . . . . . . . . . . . . . . . . 5 7.1. Normative References . . . . . . . . . . . . . . . . . . 5
7.2. Informative References . . . . . . . . . . . . . . . . . 5
Appendix A. Copying conditions . . . . . . . . . . . . . . . . . 6 Appendix A. Copying conditions . . . . . . . . . . . . . . . . . 6
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 6 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 6
1. Introduction 1. Introduction
Secure Shell (SSH) [RFC4251] is a secure remote login protocol. The Secure Shell (SSH) [RFC4251] is a secure remote login protocol. The
key exchange protocol described in [RFC4253] supports an extensible key exchange protocol described in [RFC4253] supports an extensible
set of methods. [RFC5656] describes how elliptic curves are set of methods. [RFC5656] describes how elliptic curves are
integrated in SSH, and this document reuses those protocol messages. integrated in SSH, and this document reuses those protocol messages.
skipping to change at page 2, line 44 skipping to change at page 2, line 45
This document provide Curve25519 as the preferred choice, but This document provide Curve25519 as the preferred choice, but
suggests that the fall back option Curve448 is implemented to provide suggests that the fall back option Curve448 is implemented to provide
an hedge against unforeseen analytical advances against Curve25519 an hedge against unforeseen analytical advances against Curve25519
and SHA-256. Due to different implementation status of these two and SHA-256. Due to different implementation status of these two
curves (high-quality free implementations of Curve25519 has been in curves (high-quality free implementations of Curve25519 has been in
deployed use for several years, while Curve448 implementations are deployed use for several years, while Curve448 implementations are
slowly appearing), it is accepted that adoption of Curve448 will be slowly appearing), it is accepted that adoption of Curve448 will be
slower. slower.
2. Requirements Language
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and
"OPTIONAL" in this document are to be interpreted as described in "OPTIONAL" in this document are to be interpreted as described in
BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all
capitals, as shown here. capitals, as shown here.
2. Key Exchange Methods 3. Key Exchange Methods
The key exchange procedure is similar to the ECDH method described in The key exchange procedure is similar to the ECDH method described in
chapter 4 of [RFC5656], though with a different wire encoding used chapter 4 of [RFC5656], though with a different wire encoding used
for public values and the final shared secret. Public ephemeral keys for public values and the final shared secret. Public ephemeral keys
are encoded for transmission as standard SSH strings. are encoded for transmission as standard SSH strings.
The protocol flow, the SSH_MSG_KEX_ECDH_INIT and The protocol flow, the SSH_MSG_KEX_ECDH_INIT and
SSH_MSG_KEX_ECDH_REPLY messages, and the structure of the exchange SSH_MSG_KEX_ECDH_REPLY messages, and the structure of the exchange
hash are identical to chapter 4 of [RFC5656]. hash are identical to chapter 4 of [RFC5656].
skipping to change at page 3, line 31 skipping to change at page 3, line 31
are generated as described therein. Public keys are defined as are generated as described therein. Public keys are defined as
strings of 32 bytes for Curve25519 and 56 bytes for Curve448. strings of 32 bytes for Curve25519 and 56 bytes for Curve448.
Clients and servers MUST fail the key exchange if the length of the Clients and servers MUST fail the key exchange if the length of the
received public keys are not the expected lengths, or if the derived received public keys are not the expected lengths, or if the derived
shared secret only consists of zero bits. No further validation is shared secret only consists of zero bits. No further validation is
required beyond what is discussed in [RFC7748]. The derived shared required beyond what is discussed in [RFC7748]. The derived shared
secret is 32 bytes when Curve25519 is used and 56 bytes when Curve448 secret is 32 bytes when Curve25519 is used and 56 bytes when Curve448
is used. The encodings of all values are defined in [RFC7748]. The is used. The encodings of all values are defined in [RFC7748]. The
hash used is SHA-256 for Curve25519 and SHA-512 for Curve448. hash used is SHA-256 for Curve25519 and SHA-512 for Curve448.
2.1. Shared Secret Encoding 3.1. Shared Secret Encoding
The following step differs from [RFC5656], which uses a different The following step differs from [RFC5656], which uses a different
conversion. This is not intended to modify that text generally, but conversion. This is not intended to modify that text generally, but
only to be applicable to the scope of the mechanism described in this only to be applicable to the scope of the mechanism described in this
document. document.
The shared secret, K, is defined in [RFC4253] and [RFC5656] as an The shared secret, K, is defined in [RFC4253] and [RFC5656] as an
integer encoded as a multiple precision integer (mpint). integer encoded as a multiple precision integer (mpint).
Curve25519/448 outputs a binary string X, which is the 32 or 56 byte Curve25519/448 outputs a binary string X, which is the 32 or 56 byte
point obtained by scalar multiplication of the other side's public point obtained by scalar multiplication of the other side's public
skipping to change at page 4, line 13 skipping to change at page 4, line 13
there will be encoded into byte strings by doing a fixed-length there will be encoded into byte strings by doing a fixed-length
unsigned little-endian conversion, per [RFC7748]. It is only later unsigned little-endian conversion, per [RFC7748]. It is only later
when these byte strings are then passed to the ECDH code in SSH that when these byte strings are then passed to the ECDH code in SSH that
the bytes are re-interpreted as a fixed-length unsigned big-endian the bytes are re-interpreted as a fixed-length unsigned big-endian
integer value K, and then later that K value is encoded as a integer value K, and then later that K value is encoded as a
variable-length signed "mpint" before being fed to the hash algorithm variable-length signed "mpint" before being fed to the hash algorithm
used for key generation. The mpint K is then fed along with other used for key generation. The mpint K is then fed along with other
data to the key exchange method's hash function to generate data to the key exchange method's hash function to generate
encryption keys. encryption keys.
3. Acknowledgements 4. Acknowledgements
The "curve25519-sha256" key exchange method is identical to the The "curve25519-sha256" key exchange method is identical to the
"curve25519-sha256@libssh.org" key exchange method created by Aris "curve25519-sha256@libssh.org" key exchange method created by Aris
Adamantiadis and implemented in libssh and OpenSSH. Adamantiadis and implemented in libssh and OpenSSH.
Thanks to the following people for review and comments: Denis Bider, Thanks to the following people for review and comments: Denis Bider,
Damien Miller, Niels Moeller, Matt Johnston, Eric Rescorla, Ron Damien Miller, Niels Moeller, Matt Johnston, Eric Rescorla, Ron
Frederick, Stefan Buehler. Frederick, Stefan Buehler.
4. Security Considerations 5. Security Considerations
The security considerations of [RFC4251], [RFC5656], and [RFC7748] The security considerations of [RFC4251], [RFC5656], and [RFC7748]
are inherited. are inherited.
Curve25519 provide strong security and is efficient on a wide range Curve25519 provide strong security and is efficient on a wide range
of architectures, and has properties that allows better of architectures, and has properties that allows better
implementation properties compared to traditional elliptic curves. implementation properties compared to traditional elliptic curves.
Curve448 with SHA-512 is similar, but has not received the same Curve448 with SHA-512 is similar, but has not received the same
cryptographic review as Curve25519, and is slower, but it is provided cryptographic review as Curve25519, and is slower, but it is provided
as an hedge to combat unforeseen analytical advances against as an hedge to combat unforeseen analytical advances against
Curve25519 and SHA-256. Curve25519 and SHA-256.
The way the derived binary secret string is encoded into a mpint The way the derived binary secret string is encoded into a mpint
before it is hashed (i.e., adding or removing zero-bytes for before it is hashed (i.e., adding or removing zero-bytes for
encoding) raises the potential for a side-channel attack which could encoding) raises the potential for a side-channel attack which could
determine the length of what is hashed. This would leak the most determine the length of what is hashed. This would leak the most
significant bit of the derived secret, and/or allow detection of when significant bit of the derived secret, and/or allow detection of when
the most significant bytes are zero. For backwards compatibility the most significant bytes are zero. For backwards compatibility
reasons it was decided not to address this potential problem. reasons it was decided not to address this potential problem.
5. IANA Considerations 6. IANA Considerations
IANA is requested to add "curve25519-sha256" and "curve448-sha512" to IANA is requested to add "curve25519-sha256" and "curve448-sha512" to
the "Key Exchange Method Names" registry for SSH [IANA-KEX] that was the "Key Exchange Method Names" registry for SSH [IANA-KEX] that was
created in RFC 4250 section 4.10 [RFC4250]. created in RFC 4250 section 4.10 [RFC4250].
6. References 7. References
6.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, Requirement Levels", BCP 14, RFC 2119,
DOI 10.17487/RFC2119, March 1997, DOI 10.17487/RFC2119, March 1997,
<https://www.rfc-editor.org/info/rfc2119>. <https://www.rfc-editor.org/info/rfc2119>.
[RFC4250] Lehtinen, S. and C. Lonvick, Ed., "The Secure Shell (SSH) [RFC4250] Lehtinen, S. and C. Lonvick, Ed., "The Secure Shell (SSH)
Protocol Assigned Numbers", RFC 4250, Protocol Assigned Numbers", RFC 4250,
DOI 10.17487/RFC4250, January 2006, DOI 10.17487/RFC4250, January 2006,
<https://www.rfc-editor.org/info/rfc4250>. <https://www.rfc-editor.org/info/rfc4250>.
skipping to change at page 5, line 36 skipping to change at page 5, line 36
[RFC5656] Stebila, D. and J. Green, "Elliptic Curve Algorithm [RFC5656] Stebila, D. and J. Green, "Elliptic Curve Algorithm
Integration in the Secure Shell Transport Layer", Integration in the Secure Shell Transport Layer",
RFC 5656, DOI 10.17487/RFC5656, December 2009, RFC 5656, DOI 10.17487/RFC5656, December 2009,
<https://www.rfc-editor.org/info/rfc5656>. <https://www.rfc-editor.org/info/rfc5656>.
[RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC
2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174,
May 2017, <https://www.rfc-editor.org/info/rfc8174>. May 2017, <https://www.rfc-editor.org/info/rfc8174>.
6.2. Informative References 7.2. Informative References
[IANA-KEX] [IANA-KEX]
Internet Assigned Numbers Authority (IANA), "Secure Shell Internet Assigned Numbers Authority (IANA), "Secure Shell
(SSH) Protocol Parameters: Key Exchange Method Names", (SSH) Protocol Parameters: Key Exchange Method Names",
March 2017, <http://www.iana.org/assignments/ssh- January 2018, <http://www.iana.org/assignments/ssh-
parameters/ssh-parameters.xhtml#ssh-parameters-16>. parameters/ssh-parameters.xhtml#ssh-parameters-16>.
[RFC6234] Eastlake 3rd, D. and T. Hansen, "US Secure Hash Algorithms [RFC6234] Eastlake 3rd, D. and T. Hansen, "US Secure Hash Algorithms
(SHA and SHA-based HMAC and HKDF)", RFC 6234, (SHA and SHA-based HMAC and HKDF)", RFC 6234,
DOI 10.17487/RFC6234, May 2011, DOI 10.17487/RFC6234, May 2011,
<https://www.rfc-editor.org/info/rfc6234>. <https://www.rfc-editor.org/info/rfc6234>.
[RFC7748] Langley, A., Hamburg, M., and S. Turner, "Elliptic Curves [RFC7748] Langley, A., Hamburg, M., and S. Turner, "Elliptic Curves
for Security", RFC 7748, DOI 10.17487/RFC7748, January for Security", RFC 7748, DOI 10.17487/RFC7748, January
2016, <https://www.rfc-editor.org/info/rfc7748>. 2016, <https://www.rfc-editor.org/info/rfc7748>.
 End of changes. 16 change blocks. 
22 lines changed or deleted 25 lines changed or added

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