<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [
    <!ENTITY rfc1321 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.1321.xml'>
    <!ENTITY rfc2119 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml'>
    <!ENTITY rfc4251 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.4251.xml'>
    <!ENTITY rfc4250 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.4250.xml'>
    <!ENTITY rfc4253 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.4253.xml'>
    <!ENTITY rfc4634 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.4634.xml'>
    <!ENTITY rfc4648 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.4648.xml'>
]>

<rfc category="std" ipr="full3978" docName="draft-green-secsh-ecc-04">

<?rfc toc="yes" ?>
<?rfc symrefs="yes" ?>
<?rfc sortrefs="yes"?>
<?rfc iprnotified="no" ?>
<?rfc strict="no" ?>

    <front>

        <title abbrev="SSH ECC Algorithm Integration">Elliptic-Curve Algorithm Integration in the Secure Shell Transport Layer</title>

        <author initials="D." surname="Stebila" fullname="Douglas Stebila">
            <organization>University of Waterloo</organization>
			<address>
				<postal>
					<street>Department of Combinatorics and Optimization</street>
					<city>Waterloo</city> <region>Ontario</region>
					<code>N2L 3G1</code>
					<country>Canada</country>
				</postal>
				<email>douglas@stebila.ca</email>
			</address>
        </author>
        <author initials="J." surname="Green" fullname="Jon Green">
            <organization></organization>
			<address>
			</address>
        </author>

        <date month="November" day="15" year="2008" />

		<area>Security</area>
		<workgroup>Secure Shell Working Group</workgroup>
		<keyword>I-D</keyword>
		<keyword>Internet-Draft</keyword>
		<keyword>Elliptic Curve Cryptography (ECC)</keyword>
		<keyword>SSH</keyword>

        <abstract><t>This document describes algorithms based on Elliptic Curve Cryptography (ECC) for use within the Secure Shell (SSH) transport protocol.  In particular, it specifies: Elliptic Curve Diffie-Hellman (ECDH) key agreement, Elliptic Curve Menezes-Qu-Vanstone (ECMQV) key agreement and Elliptic Curve Digital Signature Algorithm (ECDSA) for use in the SSH Transport Layer protocol.</t></abstract>

    </front>

    <middle>

		<section anchor="intro" title="Introduction">

			<t>Due to its inclusion in NSA's Suite B and its small key sizes elliptic curve cryptography (ECC) is becoming a widely utilized and attractive public-key cryptosystem.</t>

			<t>In the interest of adding Suite B algorithms to SSH this document adds three ECC Suite B algorithms to the Secure Shell arsenal: Elliptic Curve Menezes-Qu-Vanstone (ECMQV), Elliptic Curve Diffie-Hellman (ECDH), and Elliptic Curve Digital Signature Algorithm (ECDSA), as well as utilizing the SHA2 family of secure hash algorithms.</t>
			
			<t>Compared to cryptosystems such as RSA, DSA, and DH, ECC variations on these schemes offer equivalent security with smaller key sizes.  This is illustrated in the following table, based on Section 5.6.1 of NIST 800-57 <xref target="NIST-800-57" />, which gives approximate comparable key sizes for symmetric- and asymmetric-key cryptosystems based on the best known algorithms for attacking them.  L is field size and N is sub-field size.</t>
			
			<texttable>
				<ttcol align="center">Symmetric</ttcol>
				<ttcol align="center">Discrete Log (eg.  DSA, DH)</ttcol>
				<ttcol align="center">RSA</ttcol>
				<ttcol align="center">ECC</ttcol>
				<c>80</c> <c>L = 1024 N = 160</c> <c>1024</c> <c>160-223</c>
				<c>112</c> <c>L = 2048 N = 256</c> <c>2048</c> <c>224-255</c>
				<c>128</c> <c>L = 3072 N = 256</c> <c>3072</c> <c>256-383</c>
				<c>192</c> <c>L = 7680 N = 384</c> <c>7680</c> <c>384-511</c>
				<c>256</c> <c>L = 15360 N = 512</c> <c>15360</c> <c>512+</c>
			</texttable>

			<t>Implementation of this specification requires familiarity with both SSH <xref target="RFC4251" /> <xref target="RFC4253" /> <xref target="RFC4250" /> and ECC <xref target="SEC1" /> <xref target="IEEE1363" /> <xref target="ANSI-X9.63" />.</t>
			
			<t>This document is concerned with SSH implementation details; specification of the underlying cryptographic algorithms is left to other standards documents.</t>
			
			<t>Comments on this draft are solicited and should be addressed to Douglas Stebila &lt;douglas@stebila.ca&gt;.</t>

		</section>

		<section anchor="notation" title="Notation">

			<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"/>.</t>

			<t>The data types boolean, uint32, uint64, string, and mpint are to be interpreted in this document as described in <xref target="RFC4251" />.</t>
			
			<t>The size of a set of elliptic curve domain parameters on a prime curve is defined as the number of bits in the binary representation of the field order, commonly denoted p.  Size on a characteristic-2 curve is defined as the number of bits in the binary representation of the field, commonly denoted m.  A set of elliptic curve domain parameters defines a group of order n generated by a base point P.</t>

		</section>

		<section anchor="ecc" title="ECC Public Key Algorithm">

			<t>The ECC public key algorithm is defined by its key format, corresponding signature algorithm ECDSA, signature encoding and algorithm identifiers.</t>

			<t>This section defines the "ecdsa-sha2" public key format and corresponding signature format.  Every compliant SSH ECC implementation MUST implement this public key format.</t>

			<section anchor="ecc-key-format" title="Key Format">

				<t>The "ecdsa-sha2" key format has the following encoding:</t>

				<figure>
				<artwork>
   string    "ecdsa-sha2"
   byte[n]   ecc_key_blob</artwork>
				</figure>

				<t>The ecc_key_blob value has the following specific encoding:</t>
				<figure>
				<artwork>
   string     [identifier]
   string     Q</artwork>
				</figure>
	
				<t>The string [identifier] is the identifier of the elliptic curve domain parameters. The format of this string is specified in <xref target="iana-curveid" />. Information on the required and recommended sets of elliptic curve domain parameters for use with this algorithm can be found in <xref target="params" />.</t>

				<t>Q is the public key encoded from an elliptic curve point into an octet string as defined in Section 2.3.3 of <xref target="SEC1" />.</t>

				<t>The algorithm for ECC key generation can be found in Section 3.2 of <xref target="SEC1" />.  Given some elliptic curve domain parameters, an ECC key pair can be generated containing a private key, an integer d, and a public key, an elliptic curve point Q.</t>

				<section anchor="ecc-sig-alg" title="Signature Algorithm">

					<t>Signing and verifying is done using the Elliptic Curve Digital Signature Algorithm (ECDSA).  ECDSA is specified in <xref target="SEC1" /> and in <xref target="ANSI-X9.62" />.  The message hashing algorithm must be from the SHA2 family of hash functions <xref target="RFC4634" /> and is chosen according to the curve size as specified in <xref target="iana-ecdsa" />.</t>

				</section>

				<section anchor="ecc-sig-enc" title="Signature Encoding">

					<t>Signatures are encoded as follows:</t>
					<figure>
					<artwork>
   string     "ecdsa-sha2"
   string     ecdsa_signature_blob</artwork>
					</figure>

					<t>The ecdsa_signature_blob value has the following specific encoding:</t>
					<figure>
					<artwork>
   mpint      r
   mpint      s</artwork>
					</figure>

					<t>The integers r and s are the output of the ECDSA algorithm.</t>

					<t>The width of the integer fields is determined by the curve being used.  Note that the integers r and s are integers modulo the order of the curve, which may be larger than the size of the finite field.  Thus, the integers r and s are encoded as octet strings each of length ciel(log[2](n)/8) using Section 2.3.7 of <xref target="SEC1" />, where n is the order of the elliptic curve group.</t>

				</section>

			</section>

	</section>

	<section anchor="ecdh" title="ECDH Key Exchange">

		<t>The Elliptic Curve Diffie-Hellman (ECDH) key exchange method generates a shared secret from an ephemeral local elliptic curve private key and ephemeral remote elliptic curve public key.  This key exchange method provides explicit server authentication as defined in <xref target="RFC4253" /> using a signature on the exchange hash.  Every compliant SSH ECC implementation MUST implement ECDH Key Exchange.</t>

		<t>The primitive used for shared key generation is ECDH with cofactor multiplication, the full specification of which can be found in Section 3.3.2 of <xref target="SEC1" />.  The algorithm for key pair generation can be found in Section 3.2 of <xref target="SEC1" />.</t>
		
		<t>The family of key exchange method names defined for use with this key exchange can be found in <xref target="iana-ecdh" />.  Algorithm negotiation chooses the public key algorithm to be used for signing and the method name of the key exchange.  The method name of the key exchange chosen determines the elliptic curve domain parameters and hash function to be used in the remainder of this section.</t>
		
		<t>Information on the required and recommended elliptic curve domain parameters for use with this method can be found in <xref target="params" />.</t>
		
		<t>All elliptic curve public keys MUST be validated after they are received.  An example of a validation algorithm can be found in A.16.10 of <xref target="IEEE1363" />.  If a key fails validation the key exchange MUST fail.</t>
		
		<t>The elliptic curve public keys (points) that must be transmitted are encoded into octet strings before they are transmitted.  The transformation between elliptic curve points and octet strings is specified in Section 2.3 of <xref target="SEC1" />.  The output of shared key generation is a field element xp.  The ssh framework requires that the shared key be an integer.  The conversion between a field element and an integer is specified in Section 2.3.9 of <xref target="SEC1" />.</t>
		
		<t>Specification of the message numbers SSH_MSG_KEX_ECDH_INIT and SSH_MSG_KEX_ECDH_REPLY are found in <xref target="msgs" />.</t>
		
		<figure>		
		<preamble>The following is an overview of the key exchange process:</preamble>
		<artwork>
   Client                                                Server
   ------                                                ------
   Generate ephemeral key pair.
   SSH_MSG_KEX_ECDH_INIT  --------------&gt;
   
                                   Verify received key is valid.
                                    Generate ephemeral key pair.
                                          Compute shared secret.
                                Generate and sign exchange hash.
                          &lt;------------- SSH_MSG_KEX_ECDH_REPLY
   
   Verify received key is valid.
   *Verify host key belongs to server.
   Compute shared secret.
   Generate exchange hash.
   Verify server's signature.</artwork>
		</figure>

		<t>*It is recommended that the client verify that the host key sent is the server's host key (using certificates or a local database).  The client is allowed to accept the host key without verification, but doing so will render the protocol insecure against active attacks; see the discussion in Section 4.1 of <xref target="RFC4251" />.</t>

		<t>This is implemented using the following messages.</t>
		
		<figure>
		<preamble>The client sends:</preamble>
		<artwork>
   byte       SSH_MSG_KEX_ECDH_INIT
   string     client's ephemeral public key octet string</artwork>
		</figure>

		<figure>
		<preamble>The server responds with:</preamble>
		<artwork>
   byte       SSH_MSG_KEX_ECDH_REPLY
   string     server's public host key and/or certificates
   string     server's ephemeral public key octet string
   string     the signature on the exchange hash</artwork>
		</figure>

		<figure>
		<preamble>The exchange hash H is computed as the hash of the concatenation of the following.</preamble>
		<artwork>
   string     client's identification string (CR and LF excluded)
   string     server's identification string (CR and LF excluded)
   string     payload of the client's SSH_MSG_KEXINIT
   string     payload of the server's SSH_MSG_KEXINIT
   string     server's public host key
   string     client's ephemeral public key octet string
   string     server's ephemeral public key octet string
   mpint      shared secret</artwork>
		</figure>

	</section>

	<section anchor="ecmqv" title="ECMQV Key Exchange">

		<t>The Elliptic Curve Menezes-Qu-Vanstone (ECMQV) key exchange algorithm generates a shared secret from two local elliptic curve key pairs and two remote public keys.  This key exchange method provides implicit server authentication as defined in <xref target="RFC4253" />.  The ECMQV key exchange method is OPTIONAL.</t>
		
		<t>The key exchange method name defined for use with this key exchange is "ecmqv-sha2".  This method name gives a hashing algorithm that is to be used for the HMAC below.  Future RFCs may define new method names specifying new hash algorithms for use with ECMQV.  More information about the method name and HMAC can be found in <xref target="iana-ecmqv" />.</t>
		
		<t>In general the ECMQV key exchange is performed using the ephemeral and long term key pair of both the client and server, a total of 4 keys.  Within the framework of SSH the client does not have a long term key pair that needs to be authenticated.  Therefore we generate an ephemeral key and use that as both the clients keys.  This is more efficient than using two different ephemeral keys and does not adversely affect security (it is analogous to the one-pass protocol in Section 6.1 of <xref target="LMQSV98" />).</t>
		
		<t>A full description of the ECMQV primitive can be found in Section 3.4 of <xref target="SEC1" />.  The algorithm for key pair generation can be found in Section 3.2 of <xref target="SEC1" />.</t>
		
		<t>During algorithm negotiation with the SSH_MSG_KEXINIT messages the ECMQV key exchange method can only be chosen if a Public Key Algorithm supporting ECC host keys can also be chosen.  This is due to the use of implicit server authentication in this key exchange method.  This case is handled the same way that key exchange methods requiring encryption/signature capable public key algorithms are handled in Section 7.1 of <xref target="RFC4253" />.  If ECMQV key exchange is chosen then the Public Key Algorithm supporting ECC host keys MUST also be chosen.</t>
		
		<t>ECMQV requires that all the keys used to generate a shared secret are generated over the same elliptic curve domain parameters.  Since the host key is used in the generation of the shared secret, allowing for implicit server authentication, the domain parameters associated with the host key are used throughout this section.</t>
		
		<t>All elliptic curve public keys MUST be validated after they are received.  An example of a validation algorithm can be found in A.16.10 of <xref target="IEEE1363" />.  If a key fails validation the key exchange MUST fail.</t>
		
		<t>The elliptic curve public keys (points) that must be transmitted are encoded into octet strings before they are transmitted.  The transformation between elliptic curve points and octet strings is specified in Section 2.3 of <xref target="SEC1" />.  The output of shared key generation is a field element xp.  The ssh framework requires that the shared key be an integer.  The conversion between a field element and an integer is specified in Section 2.3.9 of <xref target="SEC1" />.</t>
		
		<figure>
		<preamble>The following is an overview of the key exchange process:</preamble>
		<artwork>
   Client                                                Server
   ------                                                ------
   Generate ephemeral key pair.
   SSH_MSG_KEX_ECMQV_INIT -------------&gt;
   
                                   Verify received key is valid.
                                    Generate ephemeral key pair.
                                          Compute shared secret.
                             Generate exchange hash and compute
                           HMAC over it using the shared secret.
                          &lt;------------- SSH_MSG_KEX_ECDH_REPLY
   
   Verify received keys are valid.
   *Verify host key belongs to server.
   Compute shared secret.
   Verify HMAC.</artwork>
		</figure>

		<t>*It is recommended that the client verify that the host key sent is the server's host key (Using certificates or a local database).  The client is allowed to accept the host key without verification, but doing so will render the protocol insecure against active attacks.</t>
		
		<t>The specification of the message numbers SSH_MSG_ECMQV_INIT and SSH_MSG_ECMQV_REPLY can be found in <xref target="msgs" />.</t>
		
		<t>This key exchange algorithm is implemented with the following messages.</t>
		
		<figure>
		<preamble>The client sends:</preamble>
		<artwork>
   byte       SSH_MSG_ECMQV_INIT
   string     client's ephemeral public key octet string</artwork>
		</figure>

		<figure>
		<preamble>The server sends:</preamble>
		<artwork>
   byte       SSH_MSG_ECMQV_REPLY
   string     server's public host key octet string
   string     server's ephemeral public key octet string
   string     HMAC tag computed on H using the shared secret</artwork>
		</figure>

		<figure>
		<preamble>The hash H is formed by applying the algorithm HASH on a concatenation of the following:</preamble>
		<artwork>
   string     client's identification string (CR and LF excluded)
   string     server's identification string (CR and LF excluded)
   string     payload of the client's SSH_MSG_KEXINIT
   string     payload of the server's SSH_MSG_KEXINIT
   string     client's ephemeral public key octet
   string     server's public host key octet
   string     server's ephemeral public key octet
   mpint      shared secret</artwork>
		</figure>

	</section>

	<section anchor="iana" title="IANA Considerations">

		<t>This document defines a new family of key exchange method names, a new key exchange method name, and a new public key algorithm name in the SSH name registry.  These additions to the SSH name space will have to be approved the IANA.</t>

		<section anchor="iana-curveid" title="Elliptic Curve Domain Parameter Identifiers">

			<t>This section specifies identifiers encoding named elliptic curve domain parameters.  These identifiers are used in this document to identify the curve used in the ECC public key format, the ECDSA signature blob, and the ECDH method name.</t>

			<t>An elliptic curve domain parameter identifier is the Base64 encoding of the MD5 hash <xref target="RFC1321" /> of the ASN.1 Distinguished Encoding Rules (DER) encoding <xref target="ASN1" /> of the ASN.1 Object Identifier (OID) of the named curve domain parameters that are associated with the server's ECC host keys.  Every identifier is precisely 24 characters in length.  Base64 encoding is described in Section 6.8 of <xref target="RFC4648" />.  A list of the required and recommended curves, their OIDs, and the encoding of their identifiers can be found in <xref target="params" />.</t>
			
			<t>For example: the identifier for the sect163k1 elliptic curve domain parameters would be "4MHB+NBt3AlaSRQ7MnB4cg==".</t>

		</section>

		<section anchor="iana-pubkey" title="ECC Public Key Algorithm (ecdsa-sha2)">

			<t>The ECC Public Key Algorithm is specified by the public key format identifier "ecdsa-sha2".</t>
			
			<section anchor="iana-ecdsa" title="Elliptic Curve Digital Signature Algorithm">
				<t>The Elliptic Curve Digital Signature Algorithm (ECDSA) is specified for use with the ECC Public Key Algorithm.</t>
				
				<t>The hashing algorithm defined by this family of method names is the SHA2 family of hashing algorithms <xref target="RFC4634" />.  (Note that while RFC 4634 is an Informational RFC, the SHA2 family of hashing algorithms is standardized and stable.)  The algorithm from the SHA2 family that will be used is chosen based on the size of the named curve specified in the public key:</t>

				<texttable>
					<ttcol align="center">Curve Size</ttcol>
					<ttcol align="center">Hash Algorithm</ttcol>
					<c>b &lt;= 256</c> <c>SHA-256</c>
					<c>256 &lt; b &lt;= 384</c> <c>SHA-384</c>
					<c>384 &lt; b</c> <c>SHA-512</c>
				</texttable>

			</section>

		</section>

		<section anchor="iana-ecdh" title="ECDH Key Exchange Method Names (ecdh-sha2-*)">

			<t>The Elliptic Curve Diffie-Hellman key exchange is defined by a family of method names.  Each method name is the concatenation of the string "ecdh-sha2-" with the elliptic curve domain parameter identifier as defined in <xref target="iana-curveid" />. A list of the required and recommended curves and their OIDs can be found in <xref target="params" />.</t>
			
			<t>For example: The method name for ECDH key exchange with ephemeral keys generated on the sect409k1 curve would be "ecdh-sha2-m/FtSAmrV4j/Wy6RVUaK7A==".</t>
			
			<t>The hashing algorithm defined by this family of method names is the SHA2 family of hashing algorithms <xref target="RFC4634" />.  The hashing algorithm is defined in the method name to allow room for other algorithms to be defined in future documents.  The algorithm from the SHA2 family that will be used is chosen based on the size of the named curve specified in the method name according to the table in <xref target="iana-ecdsa" />.</t>

			<t>The concatenation of any so encoded ASN.1 OID specifying a set of elliptic curve domain parameters with "ecdh-sha2-" is implicitly registered under this specification.</t>

		</section>

		<section anchor="iana-ecmqv" title="ECMQV Key Exchange and Verification Method Name (ecmqv-sha2)">

			<t>The Elliptic Curve Menezes-Qu-Vanstone key exchange is defined by the method name "ecmqv-sha2".  Unlike the ECDH key exchange method, ECMQV relies on a public key algorithm that uses ECC keys: it does not need a family of method names because the curve information can be gained from the public key algorithm.</t>
			
			<t>The hashing and message authentication code algorithms are defined by the method name to allow room for other algorithms to be defined for use with ECMQV in future documents.</t>
			
			<t>The hashing algorithm defined by this method name is the SHA2 family of hashing algorithms <xref target="RFC4634" />.  The algorithm from the SHA2 family that will be used is chosen based on the size of the named curve specified for use with ECMQV by the chosen public key algorithm according to the table in <xref target="iana-ecdsa" />.</t>

			<t>The keyed-hash message authentication code that is used to identify the server and verify communications is based on the hash chosen above.  The information on implementing the HMAC based on the chosen hash algorithm can be found in <xref target="RFC4634" />.</t>

		</section>

	</section>

	<section anchor="msgs" title="Key Exchange Messages">

		<t>The message numbers 30-49 are key exchange-specific and in a private namespace defined in <xref target="RFC4250" /> that may be redefined by any key exchange method <xref target="RFC4253" /> without being granted IANA permission.</t>
		
		<t>The following message numbers have been defined in this document:</t>
		
		<section anchor="msgs-ecdh" title="ECDH Message Numbers">

			<figure>
			<artwork>
   #define SSH_MSG_KEX_ECDH_INIT                30
   #define SSH_MSG_KEX_ECDH_REPLY               31</artwork>
			</figure>

		</section>

		<section anchor="msgs-ecmqv" title="ECMQV Message Numbers">

			<figure>
			<artwork>
   #define SSH_MSG_ECMQV_INIT                   30
   #define SSH_MSG_ECMQV_REPLY                  31</artwork>
			</figure>

		</section>

	</section>

	<section anchor="security" title="Security Considerations">

		<t>The Elliptic Curve Diffie-Hellman key agreement algorithm is defined in <xref target="SEC1" />, <xref target="IEEE1363" /> and <xref target="ANSI-X9.63" />.  The appropriate security considerations of those documents apply.</t>
		
		<t>The Elliptic Curve Menezes-Qu-Vanstone key agreement algorithm is defined in <xref target="SEC1" />.  The security considerations raised in that document also apply.  A more detailed discussion of security considerations can be found in Section 4.7 of the Guide to Elliptic Curve Cryptography <xref target="HMV04" />.</t>
		
		<t>The server's host key is used in the ECMQV key exchange algorithm.  This means that the strength of the server's ECC host key determines the strength of the ECMQV key exchange algorithm.  This should be taken into consideration when generating ECC keys for a server.</t>
		
		<t>The methods defined in <xref target="iana" /> rely on the SHA2 family of hashing functions as defined in <xref target="FIPS-180-2" />.  The appropriate security considerations of that document apply.</t>

		<t>The hashing algorithms defined for use with ECDH and ECMQV are defined by their method names so that if security problems are found with the SHA2 family of hashing algorithms or more secure hashing algorithms become the standard then future documents can extend this document to include new hashing algorithms by defining new method names.</t>
		
		<t>Additionally a good general discussion of the security considerations that must be taken into account when creating an ECC implementation can be found in Section 5 of the Guide to Elliptic Curve Cryptography <xref target="HMV04" />.</t>
		
		<t>Since ECDH and ECMQV allow for elliptic curves of arbitrary sizes and thus arbitrary security strength, it is important that the size of elliptic curve be chosen to match the security strength of other elements of the SSH handshake.  In particular, host key sizes, hashing algorithms and bulk encryption algorithms must be chosen appropriately.  Information regarding estimated equivalence of key sizes is available in <xref target="NIST-800-57" />. We note in particular that when ECDSA is used as the signature algorithm and ECDH is used as the key exchange method, if curves of different sizes are used, then it is possible that different hash functions from the SHA2 family could be used.</t>

	</section>

	<section anchor="params" title="Named Elliptic Curve Domain Parameters">
		
		<t>Implementations may support any ASN.1 object identifier (OID) in the ASN.1 object tree that defines a set of elliptic curve domain parameters <xref target="ASN1" />.</t>

		<section anchor="params-curves" title="Required and Recommended Curves">
		
			<t>Every SSH ECC implementation MUST support the named curves below, these curves are defined in <xref target="SEC2" />.  These curves should always be enabled unless specifically disabled by local security policy.</t>
			
			<t>
			<list style="symbols">
			<t>secp256r1</t>
			<t>secp384r1</t>
			<t>secp521r1</t>
			</list>
			</t>

			<t>It is RECOMMENDED that SSH ECC implementations also support the following curves.</t>

			<t>
			<list style="symbols">
			<t>sect163k1</t>
			<t>sect233k1</t>
			<t>sect233r1</t>
			<t>sect283k1</t>
			<t>sect409k1</t>
			<t>sect409r1</t>
			<t>sect571k1</t>
			<t>secp192r1</t>
			<t>secp224r1</t>
			</list>
			</t>

		</section>

		<section anchor="params-equivs" title="SEC Equivalent NIST Curves and Encoded OIDs">

			<t>The following table lists common curves by their equivalent SEC and NIST names.  The named NIST curves are specified in <xref target="NIST-CURVES" />.</t>

			<texttable>
				<ttcol align="center">SEC</ttcol>
				<ttcol align="center">NIST</ttcol>
				<c>sect163k1</c> <c>nistk163</c>
				<c>secp192r1</c> <c>nistp192</c>
				<c>secp224r1</c> <c>nistp224</c>
				<c>sect233k1</c> <c>nistk233</c>
				<c>sect233r1</c> <c>nistb233</c>
				<c>secp256r1</c> <c>nistp256</c>
				<c>sect283k1</c> <c>nistk283</c>
				<c>secp384r1</c> <c>nistp384</c>
				<c>sect409k1</c> <c>nistk409</c>
				<c>sect409r1</c> <c>nistb409</c>
				<c>secp521r1</c> <c>nistp521</c>
				<c>sect571k1</c> <c>nistk571</c>
			</texttable>

			<t>The following table lists the above SEC curves, their OID, and the encoding of their OID as appropriate for the identifiers and method names defined in <xref target="iana" />.  The encoding is the Base64 encoding of the MD5 hash <xref target="RFC1321" /> of the ASN.1 Distinguished Encoding Rules (DER) encoding <xref target="ASN1" /> of the ASN.1 Object Identifier (OID) of the named curve domain parameters that are associated with the ephemeral keys.  Base64 encoding is described in Section 6.8 of <xref target="RFC4648" />.</t>

			<texttable>
				<ttcol align="center">SEC</ttcol>
				<ttcol align="center">OID</ttcol>
				<ttcol align="center">Base64(MD5(DER(OID)))</ttcol>
				<c>sect163k1</c> <c>1.3.132.0.1</c> <c>4MHB+NBt3AlaSRQ7MnB4cg==</c>
				<c>secp192r1</c> <c>1.2.840.10045.3.1.1</c> <c>5pPrSUQtIaTjUSt5VZNBjg==</c>
				<c>secp224r1</c> <c>1.3.132.0.33</c> <c>VqBg4QRPjxx1EXZdV0GdWQ==</c>
				<c>sect233k1</c> <c>1.3.132.0.26</c> <c>zD/b3hu/71952ArpUG4OjQ==</c>
				<c>sect233r1</c> <c>1.3.132.0.27</c> <c>qCbG5Cn/jjsZ7nBeR7EnOA==</c>
				<c>secp256r1</c> <c>1.2.840.10045.3.1.7</c> <c>9UzNcgwTlEnSCECZa7V1mw==</c>
				<c>sect283k1</c> <c>1.3.132.0.16</c> <c>wiRIU8TKjMZ418sMqlqtvQ==</c>
				<c>secp384r1</c> <c>1.3.132.0.34</c> <c>qcFQaMAMGhTziMT0z+Tuzw==</c>
				<c>sect409k1</c> <c>1.3.132.0.36</c> <c>m/FtSAmrV4j/Wy6RVUaK7A==</c>
				<c>sect409r1</c> <c>1.3.132.0.37</c> <c>D3FefCjYoJ/kfXgAyLddYA==</c>
				<c>secp521r1</c> <c>1.3.132.0.35</c> <c>h/SsxnLCtRBh7I9ATyeB3A==</c>
				<c>sect571k1</c> <c>1.3.132.0.38</c> <c>mNVwCXAoS1HGmHpLvBC94w==</c>
			</texttable>

			<t>The following sequence of commands can be used on a Unix-type system to generate the encoding of the OID as above provided the appropriate software is installed.  The program "oid" can be downloaded from <xref target="OID.C" />.  The program "xxd" is part of the editor Vim and can be downloaded from <xref target="VIM" />.  The program "openssl" can be downloaded from <xref target="OPENSSL" />.</t>

			<figure>
			<artwork><![CDATA[
   echo -n ${i} > tmp.oid
   echo -n 0000: > tmp.hex
   oid -i tmp.oid >> tmp.hex
   xxd -r tmp.hex tmp.der
   openssl md5 -binary < tmp.der > tmp.md5
   openssl base64 < tmp.md5 > tmp.b64
   cat tmp.b64]]></artwork>
			</figure>

		</section>

	</section>

    </middle>

    <back>

        <references title="Normative References">

			<reference anchor="ASN1">
				<front>
					<title>Abstract Syntax Notation One (ASN.1): Specification of basic notation</title>
					<author>
						<organization>International Telecommunications Union</organization>
					</author>
					<date month="July" year="2002" />
				</front>
				<seriesInfo name="" value="X.680" />
			</reference>

			&rfc1321;
			&rfc2119;
			&rfc4251;
			&rfc4250;
			&rfc4253;
			&rfc4634;
			&rfc4648;

			<reference anchor="SEC1" target="http://www.secg.org/">
				<front>
					<title>Elliptic Curve Cryptography</title>
					<author>
						<organization>Standards for Efficient Cryptography Group</organization>
					</author>
					<date month="September" day="20" year="2000" />
				</front>
				<seriesInfo name="SEC" value="1" />
				<format type="PDF" target="http://www.secg.org/download/aid-385/sec1_final.pdf" />
			</reference>

			<reference anchor="SEC2" target="http://www.secg.org/">
				<front>
					<title>Recommended Elliptic Curve Domain Parameters</title>
					<author>
						<organization>Standards for Efficient Cryptography Group</organization>
					</author>
					<date month="September" day="20" year="2000" />
				</front>
				<seriesInfo name="SEC" value="2" />
				<format type="PDF" target="http://www.secg.org/download/aid-386/sec2_final.pdf" />
			</reference>

		</references>

        <references title="Informative References">

			<reference anchor="ANSI-X9.62">
				<front>
					<title>Public Key Cryptography For The Financial Services Industry: The Elliptic Curve Digital Signature Algorithm (ECDSA)</title>
					<author><organization>American National Standards Institute</organization></author>
					<date month="" year="1998" />
				</front>
				<seriesInfo name="ANSI" value="X9.62" />
			</reference>
		
			<reference anchor="ANSI-X9.63">
				<front>
					<title>Public Key Cryptography For The Financial Services Industry: Key Agreement and Key Transport Using Elliptic Curve Cryptography</title>
					<author><organization>American National Standards Institute</organization></author>
					<date month="January" year="1999" />
				</front>
				<seriesInfo name="ANSI" value="X9.63" />
			</reference>
		
			<reference anchor="FIPS-180-2">
				<front>
					<title>Secure Hash Standard</title>
					<author>
						<organization>National Institute of Standards and Technology</organization>
					</author>
					<date month="August" year="2002" />
				</front>
				<seriesInfo name="FIPS" value="180-2" />
				<format type="PDF" target="http://csrc.nist.gov/publications/fips/fips180-2/fips180-2.pdf" />
			</reference>

			<reference anchor="HMV04">
				<front>
					<title>Guide to Elliptic Curve Cryptography</title>
					<author initials="D." surname="Hankerson" fullname="Darrel Hankerson"><organization /></author>
					<author initials="A. J." surname="Menezes" fullname="Alfred J. Menezes"><organization /></author>
					<author initials="S." surname="Vanstone" fullname="Scott Vanstone"><organization /></author>
					<date month="" year="2004" />
				</front>
				<annotation>Springer, ISBN 038795273X</annotation>
			</reference>
			
			<reference anchor="IEEE1363">
				<front>
					<title>Standard Specifications for Public Key Cryptography</title>
					<author><organization>Institute of Electrical and Electronics Engineers</organization></author>
					<date month="" year="2000" />
				</front>
				<seriesInfo name="IEEE" value="1363" />
			</reference>

			<reference anchor="LMQSV98" target="http://www.cacr.math.uwaterloo.ca/techreports/1998/corr98-05.pdf">
				<front>
					<title>An Efficient Protocol for Authenticated Key Agreement</title>
					<author initials="L." surname="Law" fullname="Laurie Law"><organization /></author>
					<author initials="A. J." surname="Menezes" fullname="Alfred J. Menezes"><organization /></author>
					<author initials="M." surname="Qu" fullname="Minghua Qu"><organization /></author>
					<author initials="J." surname="Solinas" fullname="Jerry Solinas"><organization /></author>
					<author initials="S." surname="Vanstone" fullname="Scott Vanstone"><organization /></author>
					<date month="August" year="1998" />
				</front>
				<seriesInfo name="University of Waterloo Technical Report CORR" value="98-05" />
				<format type="PDF" target="http://www.cacr.math.uwaterloo.ca/techreports/1998/corr98-05.pdf" />
			</reference>
			
			<reference anchor="NIST-800-57">
				<front>
					<title>Recommendation for Key Management - Part 1: General (Revised)</title>
					<author>
						<organization>National Institute of Standards and Technology</organization>
					</author>
					<date month="March" year="2007" />
				</front>
				<seriesInfo name="NIST Special Publication" value="800-57" />
				<format type="PDF" target="http://csrc.nist.gov/publications/nistpubs/800-57/sp800-57-Part1-revised2_Mar08-2007.pdf" />
			</reference>

			<reference anchor="NIST-CURVES">
				<front>
					<title>Recommended Elliptic Curves for Federal Government Use</title>
					<author>
						<organization>National Institute of Standards and Technology</organization>
					</author>
					<date month="August" year="1999" />
				</front>
   				<format type="PDF" target="http://csrc.nist.gov/encryption/dss/ecdsa/NISTReCur.pdf" />
			</reference>

			<reference anchor="OID.C" target="http://rtner.de/software/oid.html">
				<front>
					<title>OID Converter</title>
					<author initials="M." surname="Gartner" fullname="Matthias Gartner"><organization /></author>
					<date month="" day="" year="2006" />
				</front>
			</reference>

			<reference anchor="OPENSSL" target="http://openssl.org">
				<front>
					<title>OpenSSL</title>
					<author>
						<organization>The OpenSSL Project</organization>
					</author>
					<date month="" day="" year="2006" />
				</front>
			</reference>

			<reference anchor="VIM" target="http://www.vim.org">
				<front>
					<title>Vim</title>
					<author initials="B." surname="Moolenaar" fullname="Bram Moolenaar"><organization /></author>
					<date month="" day="" year="2008" />
				</front>
			</reference>

		</references>

		<section anchor="ack" title="Acknowledgements">

			<t>The authors acknowledge helpful comments from Alfred Hoenes, Russ Housley, Jeffrey Hutzelman, Rob Lambert, and Jan Pechanek, and the help of Tim Polk.</t>

		</section>

    </back>

</rfc>
