]>
Elliptic Curve J-PAKE Cipher Suites for Transport Layer Security (TLS)ARM Ltd.110 Fulbourn RoadCambridgeCB1 9NJUKrobert.cragie@arm.comNewcastle University (UK)Claremont Tower, School of Computing Science, Newcastle UniversityNewcastle upon TyneNE1 7RUUKfeng.hao@ncl.ac.uk
Security Area
tlstlselliptic curvej-pakeThis 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 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 as well as version 1.2 of the Datagram Transport Layer Security (DTLS) protocol . The cipher suites are AEAD cipher suites using AES-CCM based on the cipher suites defined in , 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 , 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 . 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 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 .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 .AEAD
Authenticated Encryption with Associated Data.ECJ-PAKE
Elliptic Curve Cryptography (ECC) variant of Password Authenticated Key Exchange by Juggling (J-PAKE).ZKP
Zero-knowledge proof.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 . The following cipher suites are defined:These cipher suites make use of the AEAD capability in TLS 1.2 . 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 (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 .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:Curves with a cofactor equal to one SHOULD be used; this simplifies their use.The uncompressed point format MUST be supported. Other point formats MAY be used.Fundamental ECC algorithms MAY be used as an implementation method.A particular implementation MUST use only a single curve (see )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 .Parameters which MUST be fixed prior to implementation are:ParameterChoice of single elliptic curvePresence or absence of identityThis section describes the notations used in this document.The generator (base point) of an elliptic curve is represented by the letter 'G':GA modified generator is represented by the letter 'G' concatenated with a single uppercase character:GBElliptic 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:XXcX2Conversion to and from elliptic curve points to octet strings is as specified in Sections 2.3.3 and 2.3.4 of .Point multiplication is shown as an elliptic curve point multiplied by a scalar integer using the '*' operator, for example:G*xPoint 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:X1 + X3 + X4X*h + G*rXs - X4*x2*sIntegers are represented using a single lowercase character or a single lowercase character followed by a single lowercase character or decimal digit, for example:xxcx2Where expressed, integers are shown in hexadecimal and/or decimal form. Hexadecimal numbers have an '0x' prefix. For example:0x12ab34cd3132110061Integer multiplication is shown as two integers multiplied together using the '*' operator:x*sInteger addition or subtraction is shown as the addition or subtraction of integers or multiplied integers using the '+' and '-' operators respectively:v - x*hOctet strings are expressed in a hexadecimal form, with no '0x' prefix and with a space separator, first octet leftmost, for example:12 ab 34 cdInteger to octet string conversion SHALL be performed as stated in Section 2.3.7 of . It is represented as follows:M = str(mlen, x)where x, mlen, and M are the parameters as stated in Section 2.3.7 of .Octet string to integer conversion SHALL be as stated in section 2.3.8 of . It is represented as follows:x = int(mlen, M)where x, mlen, and M are the parameters as stated in Section 2.3.8 of .The TLS-ECJ-PAKE handshake is as follows, augmented with parameters in braces to show the ECJ-PAKE material conveyed in each case: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 ).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 .TLS-ECJ-PAKE requires new structure definitions for:Public key and Schnorr ZKP pairSchnorr ZKPThe TLS structure is as follows:X
Public key represented as an elliptic curve point. ECPoint is defined in .zkp
ECSchnorrZKP is defined in .The TLS structure is as follows:V
Ephemeral public key represented as an elliptic curve point. ECPoint is defined in .r
Schnorr signature.The following TLS extensions defined in Section 4 of SHALL be present in ClientHello:Supported Elliptic Curves Extension (NamedCurve, EllipticCurveList)Supported Point Formats Extension (ECPointFormat, ECPointFormatList) and the following TLS extension defined in Section 4 of SHALL be present in ServerHello:Supported Point Formats Extension (ECPointFormat, ECPointFormatList) EllipticCurveList in ClientHello SHALL contain only one entry corresponding to the fixed elliptic curve chosen for the implementation (see ).The following extension SHALL additionally be present in both ClientHello and ServerHello:identity
Included if the Client or Server needs to uniquely identify themselves to the other party. An identity is used in the Schnorr ZKP hash calculation (see ). The identity field SHALL be elided where an implementation has chosen absence of identity (see ).ecjpake_key_kp_pair_list
The list is precisely two elements long. The list in a ClientHello extension conveys public keys X1 and X2 and the list in a ServerHello extension conveys public keys X3 and X4, with associated Schnorr ZKPs.Note: When used in conjunction with DTLS and denial-of-service countermeasures as described in Section 4.2.1 of , 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:ecjpake
Indicates the ServerKeyExchange message contains ServerECJPAKEParams.ServerKeyExchange for ecjpake SHALL be formatted as follows:ClientKeyExchange is extended as follows:ecjpake
Indicates the ClientKeyExchange message contains ClientECJPAKEParams.ClientKeyExchange for ecjpake SHALL be formatted as follows: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:Order of the base point: nThe 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:OriginatorNameIdentityLength of identityClient"client"63 6c 69 65 6e 746Server"server"73 65 72 76 65 726In 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 KeyCalculationX1, X2, X3 and X4h = SHA-256(G, V, X, ID) mod nXsh = SHA-256(GB, V, Xs, IDs) mod nXch = SHA-256(GA, V, Xc, IDc) mod nEach 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 . 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:00 00 00 41Each public key (elliptic curve point) is first converted to an octet string according to Section 2.3.3 of .The concatentation order of the hash is as follows:G (or GA, GB): GeneratorV: ZKP ephemeral public keyX (or Xs, Xc): Public key to be verifiedID (or IDc, IDs): User ID (see )The hash is therefore performed on the concatenation as follows:H = SHA-256(lenG || G || lenV || V || lenX || X || lenID || ID)An integer representation of the hash (see ) is produced:h = int(H)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 :s = int(<password>) mod nPassword:"d45yj8e"Equivalent octet string M using UTF-8 conversion (no null termination):64 34 35 79 6a 38 65Length mlen:7Shared secret:0x643435796a386528204901945981028 (decimal)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:Base point: GOrder of the base point: nThe public key of the key pair is calculated as follows:A random integer in the range 1 to n-1 is assigned to private key x.A public key associated with x is generated and assigned to X:
X = G*xX is assigned to the public key part X of the ECJPAKEKeyKP structure.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:Base point: GOrder of the base point: nIdentity of originator: ID (IDc or IDs depending on context)Key pair to provide a ZKP of: (X,x) (public key: X, private key: x), where X is X1, X2, X3, or X4 and x is x1, x2, x3, or x4, depending on contextThe ZKP is generated as follows:A random integer in the range 1 to n-1 is assigned to ephemeral private key v.An ephemeral public key associated with v is generated and assigned to V:
V = G*vAn integer representation of a hash (see ) is generated and assigned to h:
h = int(SHA-256(G, V, X, ID)) mod nA signature is generated and assigned to r:
r = v - x*h mod nV and r are assigned to the ZKP part zkp.V and zkp.r of the ECJPAKEKeyKP structure respectively.For X1, X2, X3 and X4, the ECJPAKEKeyKP structure is verified as follows:The inputs are:Base point: GOrder of the base point: nIdentity of originator: ID (IDc or IDs depending on context)Public key to be verified: X (X1, X2, X3, or X4 depending on context)ZKP ephemeral public key: VZKP signature: rThe ZKP is verified as follows:An integer representation of a hash (see ) is generated and assigned to h:
h = int(SHA-256(G, V, X, ID)) mod nA check point is generated and assigned to V':
V'= X*h + G*rThe points V' and V are compared. If equal then the ZKP verifies, otherwise it does not verify.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:Public keys: X1, X2 and X3Private key: x4Shared secret: s (integer format, see )Order of the base point: nThe public key of the key pair is calculated as follows:A new generator is generated and assigned to GB:
GB = X1 + X2 + X3A private key is generated and assigned to xs:
xs = x4*s mod nA public key associated with xs is generated and assigned to Xs:
Xs = GB*xsXs is assigned to the public key part X of the ECJPAKEKeyKP structure.For Xs, the values for the ZKP part zkp.V and zkp.r of the ECJPAKEKeyKP structure are generated as follows:The inputs are:New generator: GBOrder of the base point: nIdentity of originator: IDsKey pair to provide a ZKP of: (Xs,xs) (public key: Xs, private key: xs)The ZKP is generated as follows:A random integer in the range 1 to n-1 is assigned to ephemeral private key v.An ephemeral public key associated with v is generated and assigned to V:
V = GB*vAn integer representation of a hash (see ) is generated and assigned to h:
h = int(SHA-256(GB, V, Xs, IDs)) mod nA signature is generated and assigned to r:
r = v - xs*h mod nV and r are assigned to the ZKP part zkp.V and zkp.r of the ECJPAKEKeyKP structure respectively.For Xs, the ECJPAKEKeyKP structure is verified as follows:The inputs are:New generator: GBOrder of the base point: nIdentity of originator: IDsPublic key to be verified: XsZKP ephemeral public key: VZKP signature: rThe ZKP is verified as follows:An integer representation of a hash (see ) is generated and assigned to h:
h = int(SHA-256(GB, V, Xs, IDs)) mod nA check point is generated and assigned to V':
V'= X*h + GB*rThe points V' and V are compared. If equal then the ZKP verifies, otherwise it does not verify.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:Public keys: X1, X3 and X4Private key: x2Shared secret: s (integer format, see )Order of the base point: nThe public key of the key pair is calculated as follows:A new generator is generated and assigned to GA:
GA = X1 + X3 + X4A private key is generated and assigned to xc:
xc = x2*s mod nA public key associated with xs is generated and assigned to Xc:
Xc = GA*xcXc is assigned to the public key part X of the ECJPAKEKeyKP structure.For Xc, the values for the ZKP part zkp.V and zkp.r of the ECJPAKEKeyKP structure are generated as follows:The inputs are:New generator: GAOrder of the base point: nIdentity of originator: IDcKey pair to provide a ZKP of: (Xc,xc) (public key: Xc, private key: xc)The ZKP is generated as follows:A random integer in the range 1 to n-1 is assigned to ephemeral private key v.An ephemeral public key associated with v is generated and assigned to V:
V = GA*vAn integer representation of a hash (see ) is generated and assigned to h:
h = int(SHA-256(GA, V, Xc, IDc)) mod nA signature is generated and assigned to r:
r = v - xc*h mod nV and r are assigned to the ZKP part zkp.V and zkp.r of the ECJPAKEKeyKP structure respectively.For Xc, the ECJPAKEKeyKP structure is verified as follows:The inputs are:New generator: GAOrder of the base point: nIdentity of originator: IDcPublic key to be verified: XcZKP ephemeral public key: VZKP signature: rThe ZKP is verified as follows:An integer representation of a hash (see ) is generated and assigned to h:
h = int(SHA-256(GA, V, Xc, IDc)) mod nA check point is generated and assigned to V':
V'= X*h + GA*rThe points V' and V are compared. If equal then the ZKP verifies, otherwise it does not verify.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:Public key of the client: XcPublic key: X2Private key: x4Shared secret: s (integer format, see )The premaster secret is generated as follows:Compute PMSK:
PMSK = (Xc - X2*x4*s)*x4Compute PMS:
PMS = SHA-256(str(32, X coordinate of PMSK))The master secret and key expansion is generated according to Section 8.1 and Section 6.3 of .The inputs are:Public key of the server: XsPublic key: X4Private key: x2Shared secret: s (integer format, see )The premaster secret is generated as follows:Compute PMSK:
PMSK = (Xs - X4*x2*s)*x2Compute PMS:
PMS = SHA-256(str(32, X coordinate of PMSK))The master secret and key expansion is generated according to Section 8.1 and Section 6.3 of .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:IANA is requested to add the following entries in the ExtensionType Values:An independent study that proves security of J-PAKE in a model with algebraic adversaries and random oracles can be found in .The cipher suites described in this document are AES-CCM-based AEAD cipher suites, therefore the security considerations for counter reuse described in 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 , 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 . 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.Recommendation for Block Cipher Modes of Operation: The CCM Mode for Authentication and ConfidentialityNational Institute of Standards and TechnologyStandards for Efficient Cryptography: SEC 1: Elliptic Curve CryptographyStandards for Efficient Cryptography GroupThread CommissioningThread GroupPassword Authenticated Key Exchange by JugglingSecurity of the J-PAKE Password-Authenticated Key Exchange ProtocolCNRS, ENS, INRIA, and PSLENS, CNRS, INRIA, and PSLGoogle Inc.J-PAKE: Password Authenticated Key Exchange by Juggling
&RFC2119;
&RFC4492;
&RFC5116;
&RFC5246;
&RFC6066;
&RFC6655;
&RFC7251;
&RFC6090;
&RFC6347;
&RFC7252;