One document matched: draft-josefsson-ssh-curves-01.xml
<?xml version="1.0"?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [
<!ENTITY rfc2119 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml">
<!ENTITY rfc4250 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.4250.xml">
<!ENTITY rfc4251 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.4251.xml">
<!ENTITY rfc4253 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.4253.xml">
<!ENTITY rfc5656 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.5656.xml">
<!ENTITY CURVES PUBLIC '' 'http://xml2rfc.ietf.org/public/rfc/bibxml3/reference.I-D.irtf-cfrg-curves.xml'>
]>
<?rfc compact="yes"?>
<?rfc toc="yes"?>
<?rfc symrefs="yes"?>
<rfc category="info" ipr="trust200902"
docName="draft-josefsson-ssh-curves-01">
<front>
<title abbrev="Curve25519/448 for SSH">
Secure Shell (SSH) Key Exchange Method using Curve25519 and
Curve448
</title>
<author initials="A." surname="Adamantiadis" fullname="Aris Adamantiadis">
<organization>libssh</organization>
<address>
<email>aris@badcode.be</email>
</address>
</author>
<author initials="S." surname="Josefsson" fullname="Simon Josefsson">
<organization>SJD AB</organization>
<address>
<email>simon@josefsson.org</email>
</address>
</author>
<date month="November" year="2015"/>
<abstract>
<t>
How to implement the Curve25519 and Curve448 key exchange
methods in the Secure Shell (SSH) protocol is described.
</t>
</abstract>
</front>
<middle>
<section title="Introduction">
<t>
In <xref target="Curve25519" />, a new elliptic curve function
for use in cryptographic applications was introduced. In
<xref target="Ed448-Goldilocks" /> the Ed448-Goldilocks curve
(also known as Curve448) is described. In <xref
target="I-D.irtf-cfrg-curves"/>, the Diffie-Hellman functions
using Curve25519 and Curve448 are specified.
</t>
<t>
Secure Shell (SSH) <xref target="RFC4251"/> is a secure remote
login protocol. The key exchange key exchange protocol
described in <xref target="RFC4253"/> supports an extensible
set of methods. In <xref target="RFC5656"/> it is described
how elliptic curves are integrated in SSH, and this document
reuses those protocol messages.
</t>
<t>
This document describe how key exchange based on Curve25519
and Curve448 is achieved in SSH. For Curve25519 what we
described is identical to an already implemented (in libssh
and OpenSSH) and widely deployed proposal registered in the
private namespace ("curve25519-sha256@libssh.org"). The
Curve448 key exchange method is novel but similar in spirit.
</t>
<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="Key Exchange Methods">
<t>
The key exchange procedure is similar to the ECDH method
described in chapter 4 of <xref target="RFC5656" />, though
with a different wire encoding used for public values and the
final shared secret. Public ephemeral keys are transmitted
over SSH encapsulated into standard SSH strings.
</t>
<t>
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 with chapter 4 of <xref
target="RFC5656" />.
</t>
<t>
The method names registered by this document are
"curve25519-sha256" and "curve448-sha256".
</t>
<t>
The whole method is based on the Curve25519 and Curve448
scalar multiplication, as described in <xref
target="I-D.irtf-cfrg-curves"/>. Private and public keys are
generated as described therein, and no special validation is
required beyond what is discussed there. Public keys are
defined as strings of 32 bytes for Curve25519 and 56 bytes for
Curve448. The derived shared secret is 32 bytes when
Curve25519 is used and 56 bytes when Curve448 is used. The
encodings of all values are defined in <xref
target="I-D.irtf-cfrg-curves"/>.
</t>
<t>
The shared secret, k, is defined in SSH specifications to be a
multiple precision integer (mpint). Curve25519/448 outputs a
binary string. The binary string is converted into a number
as follows. This step differs from <xref target="RFC5656"/>
which do not need this conversion. X is the 32 or 56 bytes
point obtained by the scalar multiplication of the other
side's public key and the local private key scalar. The whole
32 or 56 bytes of the number X is then converted into a
multiple precision integer (mpint) k. This conversion follows
the network byte order. Since the SSH mpint encoding use the
most significant bit to signal negative integers, this means
that if the most significant bit of the derived secret is set,
a zero byte is prepended to encode the correct value.
</t>
</section>
<section title="Acknowledgements">
<t>
The "curve25519-sha256" key exchange method is identical to
the "curve25519-sha256@libssh.org" key exchange method created
by Aris Adamantiadis and implemented in libssh and OpenSSH.
</t>
<t>
Thanks to the following people for review and comments: Denis
Bider, Damien Miller.
</t>
</section>
<section title="Security Considerations">
<t>
The security considerations of <xref target="RFC4251"/>, <xref
target="RFC5656"/>, and <xref target="I-D.irtf-cfrg-curves"/>
are inherited.
</t>
<t>
The way the derived binary secret string is encoded into a
mpint before it is hashed (i.e., adding a zero byte when the
most significant bit of the secret is set) raise the potential
for a side-channel attack determining the length of what is
hashed which would leak the most significant bit of the
derived secret.
</t>
</section>
<section anchor="iana-considerations" title="IANA Considerations">
<t>
IANA is requested to add "curve25519-sha256" and
"curve448-sha256" to the "Key Exchange Method Names" registry
for SSH that was created in <xref target="RFC4250">RFC 4250
section 4.10</xref>.
</t>
</section>
</middle>
<back>
<references title="Normative References">
&rfc2119;
&rfc4250;
&rfc4251;
&rfc4253;
&rfc5656;
&CURVES;
</references>
<references title="Informative References">
<reference anchor="Curve25519"
target="http://dx.doi.org/10.1007/11745853_14">
<front>
<title>
Curve25519: New Diffie-Hellman Speed Records
</title>
<author surname="Bernstein" initials="J."
fullname="Daniel J. Bernstein">
<organization></organization>
</author>
<date month="February" year="2006"/>
</front>
<seriesInfo name="LNCS" value="3958, pp. 207-228" />
</reference>
<reference anchor="Ed448-Goldilocks"
target="https://eprint.iacr.org/2015/625">
<front>
<title>
Ed448-Goldilocks, a new elliptic curve
</title>
<author surname="Hamburg" fullname="Mike Hamburg">
<organization></organization>
</author>
<date month="June" year="2015"/>
</front>
</reference>
</references>
<section title="Copying conditions">
<t>
Regarding this entire document or any portion of it, the
authors makes no guarantees and is not responsible for any
damage resulting from its use. The authors grants irrevocable
permission to anyone to use, modify, and distribute it in any
way that does not diminish the rights of anyone else to use,
modify, and distribute it, provided that redistributed
derivative works do not contain misleading author or version
information. Derivative works need not be licensed under
similar terms.
</t>
</section>
</back>
</rfc>
| PAFTECH AB 2003-2026 | 2026-04-21 17:42:09 |