tls | R. Cragie |
Internet-Draft | ARM Ltd. |
Intended status: Informational | F. Hao |
Expires: December 24, 2016 | Newcastle University (UK) |
June 22, 2016 |
Elliptic Curve J-PAKE Cipher Suites for Transport Layer Security (TLS)
draft-cragie-tls-ecjpake-01
This document defines new cipher suites based on an Elliptic Curve Cryptography (ECC) variant of Password Authenticated Key Exchange by Juggling (J-PAKE) for the Transport Layer Security (TLS) and Datagram Transport Layer Security (DTLS) protocols.
This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79.
Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet-Drafts is at http://datatracker.ietf.org/drafts/current/.
Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress."
This Internet-Draft will expire on December 24, 2016.
Copyright (c) 2016 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 (http://trustee.ietf.org/license-info) 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.
This document defines new cipher suites based on an Elliptic Curve Cryptography (ECC) variant of Password Authenticated Key Exchange by Juggling (J-PAKE) for version 1.2 of Transport Layer Security (TLS) protocol [RFC5246] as well as version 1.2 of the Datagram Transport Layer Security (DTLS) protocol [RFC6347]. The cipher suites are AEAD cipher suites using AES-CCM [CCM] based on the cipher suites defined in [RFC7251], using ECJ-PAKE as an alternative key establishment mechanism.
The existing set of TLS cipher suites are typically aimed at more traditional client-server interactions, for example, a web browser to web server. However, TLS and DTLS are increasingly being specified for use in Internet-of-Things (IoT) standards for peer-to-peer application layer interaction. For example, DTLS is specified as a binding to provide security for the CoAP protocol [RFC7252], which is widely used in IoT applications.
J-PAKE is a balanced password-authenticated key exchange (PAKE) protocol resistant to off-line dictionary attack designed by Feng Hao and Peter Ryan in 2008 [HR08]. The use of a PAKE for IoT devices is highly appropriate as it allows a simple method of commissioning IoT devices onto a network without requiring certificates to be issued and maintained for each device. An ECC variant of J-PAKE [J-PAKE] is particularly suited to IoT devices, which are often constrained with regard to memory and processing power. The cipher suite TLS_ECJPAKE_WITH_AES_128_CCM_8 as defined in this document is currently being used in the Thread protocol [THREAD].
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 [RFC2119].
AEAD
ECJ-PAKE
ZKP
The cipher suites defined in this document are based on the AES-CCM Authenticated Encryption with Associated Data (AEAD) algorithms AEAD_AES_128_CCM and AEAD_AES_256_CCM described in [RFC5116]. The following cipher suites are defined:
TLS_ECJPAKE_WITH_AES_128_CCM = {0xTBD, 0xTBD} TLS_ECJPAKE_WITH_AES_256_CCM = {0xTBD, 0xTBD} TLS_ECJPAKE_WITH_AES_128_CCM_8 = {0xTBD, 0xTBD} TLS_ECJPAKE_WITH_AES_256_CCM_8 = {0xTBD, 0xTBD}
These cipher suites make use of the AEAD capability in TLS 1.2 [RFC5246]. Cipher suites ending with "8" use eight-octet authentication tags; the other cipher suites have 16-octet authentication tags. The HMAC truncation option described in Section 7 of [RFC6066] (which negotiates the "truncated_hmac" TLS extension) does not have an effect on the cipher suites defined in this document, because they do not use HMAC to protect TLS records.
The "nonce" input to the AEAD algorithm is as defined in [RFC6655].
These cipher suites make use of the default TLS 1.2 Pseudorandom Function (PRF), which uses HMAC with the SHA-256 hash function.
The following stipulations apply to the use of elliptic curves:
It is expected that TLS-ECJ-PAKE is used in applications where parameters applying to the particular TLS-ECJ-PAKE implementation are fixed and known to the application a priori. For this reason, certain capability negotiations usually associated with TLS are not present in TLS-ECJ-PAKE. This restricts its use to applications where such parameters can be applied a priori, for example as is the case in Thread [THREAD].
Parameters which MUST be fixed prior to implementation are:
Parameter |
---|
Choice of single elliptic curve |
Presence or absence of identity |
This section describes the notations used in this document.
The generator (base point) of an elliptic curve is represented by the letter 'G':
A modified generator is represented by the letter 'G' concatenated with a single uppercase character:
Elliptic curve points are represented using a single uppercase character or a single uppercase character concatenated with a single lowercase character or decimal digit, for example:
Conversion to and from elliptic curve points to octet strings is as specified in Sections 2.3.3 and 2.3.4 of [SEC1].
Point multiplication is shown as an elliptic curve point multiplied by a scalar integer using the '*' operator, for example:
Point addition or subtraction is shown as the addition or subtraction of elliptic curve points or scalar multiplied elliptic curve points using the '+' and '-' operators respectively, for example:
Integers are represented using a single lowercase character or a single lowercase character followed by a single lowercase character or decimal digit, for example:
Where expressed, integers are shown in hexadecimal and/or decimal form. Hexadecimal numbers have an '0x' prefix. For example:
Integer multiplication is shown as two integers multiplied together using the '*' operator:
Integer addition or subtraction is shown as the addition or subtraction of integers or multiplied integers using the '+' and '-' operators respectively:
Octet strings are expressed in a hexadecimal form, with no '0x' prefix and with a space separator, first octet leftmost, for example:
Integer to octet string conversion SHALL be performed as stated in Section 2.3.7 of [SEC1]. It is represented as follows:
where x, mlen, and M are the parameters as stated in Section 2.3.7 of [SEC1].
Octet string to integer conversion SHALL be as stated in section 2.3.8 of [SEC1]. It is represented as follows:
where x, mlen, and M are the parameters as stated in Section 2.3.8 of [SEC1].
The TLS-ECJ-PAKE handshake is as follows, augmented with parameters in braces to show the ECJ-PAKE material conveyed in each case:
Client Server ------ ------ ClientHello --------> {(X1,ZKP(X1)), (X2,ZKP(X2))} ServerHello {(X3, ZKP(X3)), (X4, ZKP(X4))} ServerKeyExchange {Xs, ZKP(Xs)} <-------- ServerHelloDone ClientKeyExchange {Xc, ZKP(Xc)} [ChangeCipherSpec] Finished --------> [ChangeCipherSpec] <-------- Finished Application Data <-------> Application Data
Figure 1: Message flow in a TLS-ECJ-PAKE handshake
If there are failures for any reason on client or server side, for example, Schnorr ZKP verification or missing extensions, the handshake SHALL abort immediately and send a TLS Error Alert message to the peer, using code 40 (handshake_failure) (see Section 7.2 of [RFC5246]).
This section describes existing and newly-defined extensions required for ECJ-PAKE-TLS. The guiding principle for extension use is to adhere as closely as possible to [RFC4492].
TLS-ECJ-PAKE requires new structure definitions for:
The TLS structure is as follows:
struct { ECPoint X; ECSchnorrZKP zkp; } ECJPAKEKeyKP;
X
zkp
The TLS structure is as follows:
struct { ECPoint V; opaque r<1..2^8-1>; } ECSchnorrZKP;
V
r
The following TLS extensions defined in Section 4 of [RFC4492] SHALL be present in ClientHello:
and the following TLS extension defined in Section 4 of [RFC4492] SHALL be present in ServerHello:
EllipticCurveList in ClientHello SHALL contain only one entry corresponding to the fixed elliptic curve chosen for the implementation (see Section 3).
The following extension SHALL additionally be present in both ClientHello and ServerHello:
enum { ecjpake_key_kp_pair(TBC) } ExtensionType; struct { opaque identity<0..2^16-1>; ECJPAKEKeyKP ecjpake_key_kp_pair_list[2]; } ECJPAKEKeyKPPairList;
identity
ecjpake_key_kp_pair_list
Note: When used in conjunction with DTLS and denial-of-service countermeasures as described in Section 4.2.1 of [RFC6347], the ECJPAKEKeyKPPairList in the subsequent ClientHello message SHALL be the same as the ECJPAKEKeyKPPairList in initial ClientHello message, i.e. the public keys X1 and X2 and associated Schnorr ZKPs SHALL be the same.
ServerKeyExchange is extended as follows:
enum { ecjpake } KeyExchangeAlgorithm;
ecjpake
ServerKeyExchange for ecjpake SHALL be formatted as follows:
struct { ECParameters curve_params; ECJPAKEKeyKP ecjpake_key_kp; } ServerECJPAKEParams; select (KeyExchangeAlgorithm) { case ecjpake: ServerECJPAKEParams params; } ServerKeyExchange;
ClientKeyExchange is extended as follows:
enum { ecjpake } KeyExchangeAlgorithm;
ecjpake
ClientKeyExchange for ecjpake SHALL be formatted as follows:
struct { ECJPAKEKeyKP ecjpake_key_kp; } ClientECJPAKEParams; select (KeyExchangeAlgorithm) { case ecjpake: ClientECJPAKEParams params; } ClientKeyExchange;
This section describes the calculations required to populate the data conveyed between Client and Server and also calculations required to verify knowledge proofs.
The following notation is used throughout this section:
The Schnorr ZKP hash calculation requires non-confidential user identities. These identities need to be unique in the context of a transaction and be different for each party. In a peer-to-peer transaction where there is no ambiguity of identity, the identities can be a simple string representing the Client and Server respectively:
Originator | Name | Identity | Length of identity |
---|---|---|---|
Client | "client" | 63 6c 69 65 6e 74 | 6 |
Server | "server" | 73 65 72 76 65 72 | 6 |
In a multi-party transaction, each party SHOULD additionally provide an identity in the ClientHello and/or ServerHello to uniquely distinguish their user identity.
The hash calculation is defined as follows:
Public Key | Calculation |
---|---|
X1, X2, X3 and X4 | h = SHA-256(G, V, X, ID) mod n |
Xs | h = SHA-256(GB, V, Xs, IDs) mod n |
Xc | h = SHA-256(GA, V, Xc, IDc) mod n |
Each item in the hash calculation is prepended with its length in octets represented an octet (length 4), formed by applying integer to octet string conversion as defined in Section 4.4. For example, the length of an uncompressed octet string representation of a public key is 65 (decimal) therefore the octet string (length 4) representation of 65 in hexadecimal is:
Each public key (elliptic curve point) is first converted to an octet string according to Section 2.3.3 of [SEC1].
The concatentation order of the hash is as follows:
The hash is therefore performed on the concatenation as follows:
An integer representation of the hash (see Section 4.5) is produced:
The shared secret for the ServerKeyExchange and ClientKeyExchange calculations is required to be an integer in the range 1 to n-1. This section shows an example of how this could be practically accomplished using an initial password. The initial password is usually represented visually as a variable length character string using a subset of internationally recognized characters from the UTF-8 character set, which prevents the possibility of the resulting shared secret having the value 0. The initial password is then be converted into an octet string <password> using UTF-8 conversion. The integer shared secret calculation is thus defined as follows, using the function defined in Section 4.5:
Password:
Equivalent octet string M using UTF-8 conversion (no null termination):
Length mlen:
Shared secret:
The structure ECJPAKEKeyKPPairList conveys the public key and associated Schnorr ZKP for ClientHello (X1 and X2) and ServerHello (X3 and X4).
For X1, X2, X3 and X4, the value for the public key part X of the ECJPAKEKeyKP structure is generated as follows:
The inputs are:
The public key of the key pair is calculated as follows:
For X1, X2, X3 and X4, the values for the ZKP part zkp.V and zkp.r of the ECJPAKEKeyKP structure are generated as follows:
The inputs are:
The ZKP is generated as follows:
For X1, X2, X3 and X4, the ECJPAKEKeyKP structure is verified as follows:
The inputs are:
The ZKP is verified as follows:
The structure ECJPAKEKeyKP conveys the public key and associated Schnorr ZKP for Xs.
For Xs, the value for the public key part X of the ECJPAKEKeyKP structure is generated as follows:
The inputs are:
The public key of the key pair is calculated as follows:
For Xs, the values for the ZKP part zkp.V and zkp.r of the ECJPAKEKeyKP structure are generated as follows:
The inputs are:
The ZKP is generated as follows:
For Xs, the ECJPAKEKeyKP structure is verified as follows:
The inputs are:
The ZKP is verified as follows:
The structure ECJPAKEKeyKP conveys the public key and associated Schnorr ZKP for Xc.
For Xc, the value for the public key part X of the ECJPAKEKeyKP structure is generated as follows:
The inputs are:
The public key of the key pair is calculated as follows:
For Xc, the values for the ZKP part zkp.V and zkp.r of the ECJPAKEKeyKP structure are generated as follows:
The inputs are:
The ZKP is generated as follows:
For Xc, the ECJPAKEKeyKP structure is verified as follows:
The inputs are:
The ZKP is verified as follows:
The TLS-ECJ-PAKE handshake relies on the generation of identical premaster secrets at the client and server to verify the key establishment. The use of the protected Finished messages is therefore used for key confirmation purposes and to verify the handshake.
The inputs are:
The premaster secret is generated as follows:
The inputs are:
The premaster secret is generated as follows:
The authors would like to thank Sorin Aliciuc, Richard Kelsey, Maurizio Nanni, Manuel Pegourie-Gonnard and Martin Turon for their helpful comments and assistance.
IANA is requested to add the following entries in the TLS Cipher Suite Registry:
TLS_ECJPAKE_WITH_AES_128_CCM = {0xTBD, 0xTBD} TLS_ECJPAKE_WITH_AES_256_CCM = {0xTBD, 0xTBD} TLS_ECJPAKE_WITH_AES_128_CCM_8 = {0xTBD, 0xTBD} TLS_ECJPAKE_WITH_AES_256_CCM_8 = {0xTBD, 0xTBD}
IANA is requested to add the following entries in the ExtensionType Values:
ecjpake_key_kp_pair = TBD
An independent study that proves security of J-PAKE in a model with algebraic adversaries and random oracles can be found in [ABM15].
The cipher suites described in this document are AES-CCM-based AEAD cipher suites, therefore the security considerations for counter reuse described in [RFC6655] also apply to these cipher suites.
The password forming the basis of the shared secret SHOULD be distributed in a secure out-of-band channel. In the specific case of [THREAD], this is achieved by the user enabling the use of the password only through a commissioning session where the user is in control of adding details of devices they wish to add to the Thread network.
An attacker could attempt to engage repeatedly with a ECJ-PAKE server in an attempt to guess the password. Servers SHOULD take steps to ensure the opportunity for repeated contact is limited.
The cipher suites described in this document have primarily been developed to enable authentication and authorization for network access for IoT devices, as described in [THREAD]. It is therefore RECOMMENDED that the use of these cipher suite is restricted to similar uses and SHOULD NOT be used in conjunction with web servers and web browsers unless consideration is given to secure entry of passwords in a browser.
The requirement to specify fixed parameters in a specific implementation limits the amount of negotiation that takes place between Client and Server. This effectively makes capability negotiation binary, i.e. if the implementation is incompatible, the handshake will simply fail. This is usually an important consideration in the applications TLS-ECJ-PAKE is recommended for, where complex negotiation is neither desirable nor recommended.
[RFC6090] | McGrew, D., Igoe, K. and M. Salter, "Fundamental Elliptic Curve Cryptography Algorithms", RFC 6090, DOI 10.17487/RFC6090, February 2011. |
[RFC6347] | Rescorla, E. and N. Modadugu, "Datagram Transport Layer Security Version 1.2", RFC 6347, DOI 10.17487/RFC6347, January 2012. |
[RFC7252] | Shelby, Z., Hartke, K. and C. Bormann, "The Constrained Application Protocol (CoAP)", RFC 7252, DOI 10.17487/RFC7252, June 2014. |