Secure Shell (SSH) Key Exchange Method Using Curve25519 and Curve448
RFC 8731

Document Type RFC - Proposed Standard (February 2020; No errata)
Authors Aris Adamantiadis  , Simon Josefsson  , Mark Baushke 
Last updated 2020-02-28
Stream Internent Engineering Task Force (IETF)
Formats plain text html xml pdf htmlized (tools) htmlized bibtex
Stream WG state Submitted to IESG for Publication
Document shepherd Daniel Migault
Shepherd write-up Show (last changed 2017-04-12)
IESG IESG state RFC 8731 (Proposed Standard)
Action Holders
Consensus Boilerplate Yes
Telechat date
Responsible AD Benjamin Kaduk
Send notices to Daniel Migault <>
IANA IANA review state IANA OK - Actions Needed
IANA action state RFC-Ed-Ack

Internet Engineering Task Force (IETF)                   A. Adamantiadis
Request for Comments: 8731                                        libssh
Category: Standards Track                                   S. Josefsson
ISSN: 2070-1721                                                   SJD AB
                                                              M. Baushke
                                                  Juniper Networks, Inc.
                                                           February 2020

  Secure Shell (SSH) Key Exchange Method Using Curve25519 and Curve448


   This document describes the specification for using Curve25519 and
   Curve448 key exchange methods in the Secure Shell (SSH) protocol.

Status of This Memo

   This is an Internet Standards Track document.

   This document is a product of the Internet Engineering Task Force
   (IETF).  It represents the consensus of the IETF community.  It has
   received public review and has been approved for publication by the
   Internet Engineering Steering Group (IESG).  Further information on
   Internet Standards is available in Section 2 of RFC 7841.

   Information about the current status of this document, any errata,
   and how to provide feedback on it may be obtained at

Copyright Notice

   Copyright (c) 2020 IETF Trust and the persons identified as the
   document authors.  All rights reserved.

   This document is subject to BCP 78 and the IETF Trust's Legal
   Provisions Relating to IETF Documents
   ( in effect on the date of
   publication of this document.  Please review these documents
   carefully, as they describe your rights and restrictions with respect
   to this document.  Code Components extracted from this document must
   include Simplified BSD License text as described in Section 4.e of
   the Trust Legal Provisions and are provided without warranty as
   described in the Simplified BSD License.

Table of Contents

   1.  Introduction
   2.  Requirements Language
   3.  Key Exchange Methods
     3.1.  Shared Secret Encoding
   4.  Security Considerations
   5.  IANA Considerations
   6.  References
     6.1.  Normative References
     6.2.  Informative References
   Authors' Addresses

1.  Introduction

   Secure Shell (SSH) [RFC4251] is a secure remote login protocol.  The
   key exchange protocol described in [RFC4253] supports an extensible
   set of methods.  [RFC5656] defines how elliptic curves are integrated
   into this extensible SSH framework, and this document reuses the
   Elliptic Curve Diffie-Hellman (ECDH) key exchange protocol messages
   defined in Section 7.1 (ECDH Message Numbers) of [RFC5656].  Other
   parts of [RFC5656], such as Elliptic Curve Menezes-Qu-Vanstone
   (ECMQV) key agreement and Elliptic Curve Digital Signature Algorithm
   (ECDSA), are not considered in this document.

   This document describes how to implement key exchange based on
   Curve25519 and Curve448 [RFC7748] in SSH.  For Curve25519 with
   SHA-256 [RFC6234][SHS], the algorithm described is equivalent to the
   privately defined algorithm "", which at
   the time of publication was implemented and widely deployed in libssh
   [libssh] and OpenSSH [OpenSSH].  The Curve448 key exchange method is
   similar but uses SHA-512 [RFC6234][SHS].

2.  Requirements Language

   The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
   "OPTIONAL" in this document are to be interpreted as described in
   BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all
   capitals, as shown here.

3.  Key Exchange Methods

   The key exchange procedure is similar to the ECDH method described in
   Section 4 of [RFC5656], though with a different wire encoding used
   for public values and the final shared secret.  Public ephemeral keys
   are encoded for transmission as standard SSH strings.

   The protocol flow, the SSH_MSG_KEX_ECDH_INIT and
   SSH_MSG_KEX_ECDH_REPLY messages, and the structure of the exchange
   hash are identical to Section 4 of [RFC5656].

   The method names registered by this document are "curve25519-sha256"
   and "curve448-sha512".

   The methods are based on Curve25519 and Curve448 scalar
   multiplication, as described in [RFC7748].  Private and public keys
   are generated as described therein.  Public keys are defined as
   strings of 32 bytes for Curve25519 and 56 bytes for Curve448.

   The key-agreement schemes "curve25519-sha256" and "curve448-sha512"
   perform the Diffie-Hellman protocol using the functions X25519 and
   X448, respectively.  Implementations SHOULD compute these functions
   using the algorithms described in [RFC7748].  When they do so,
   implementations MUST check whether the computed Diffie-Hellman shared
   secret is the all-zero value and abort if so, as described in
Show full document text