JSON Key ExchangeComodo Group Inc.philliph@comodo.com
The JSON Key Exchange
This document is also available online at
http://mathmesh.com/Documents/draft-hallambaker-json-key-exchange.html
.
This document describes a lightweight key agreement mechanism using between 2 and four Diffe-Hellman or Elliptic Curve Diffie-Hallman keys. The mechanism may be used establish a shared session key with authentication of any or none of the initiator and the responder.
The approach described is similar to that adopted in the X3DH Key agreement
used in Signal.
The objective of the key exchange is limited to establishing a shared secret between two mutually authenticated parties that cannot be derived by any other parties and cannot be reconstructed by either of the parties after the ephemeral contributions have been deleted.
The key exchange is intended for use as one component in a multi-layer security approach in which comprehensive security is provided through use of encryption and authentication at multiple layers in the protocol stack.
[[This figure is not viewable in this format. The figure is available at http://mathmesh.com/Documents/draft-hallambaker-json-key-exchange.html.]]
Multi-layer security
Specifically, this key exchange is intended for use at the presentation layer (e.g. authenticate and encrypt HTTP message bodies) to establish keys for authentication and optional encryption of messages in Web Service transactions.
Encryption of cryptographic keys, protocol configuration profiles.
Authentication of parties to a Web Service transaction.
Protect metadata against interception at single point on the message path (link or node)
Protect messages against traffic analysis by means of interception at multiple points on the message path
This section presents the related specifications and standard, the terms that are used as terms of art within the documents and the terms used as requirements language.
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].
No terms of art are defined.
JSON Key Exchange is used extensively in the Mathematical Mesh and related protocols
.
The implementation status of the reference code base is described in the companion document
.
The following parameters are defined
The key exchange protocol. Diffie Hellman in discrete log, EdECDH25519 or EdECDH448.
The key derivation function. This is always HKDF
The Key Wrap function. This is always RFC3394
It should be noted that the algorithm described makes use of the Edwards form of the curve and not the Montgomery form described in
. While these curves are isomorphic, implementations of the Montgomery ladder do not lend themselves easily to the approach shown.
The notation adopted in
is applied with minor modifications.
The concatenation of the byte sequence X followed by the byte sequence Y.
The result of performing the key exchange (Diffie-Hellman or Elliptic Curve Diffie Hellman) with the public parameters of PK1 and the private parameters of PK2.
The public, private key pair formed by combining the public, private parameters of PK1 and PK2.
The KDF expansion function that derives a key of length L bits from the Pre Random Key PRK using the string info as the salt.
The KDF extraction function that derives a Pre-Random Key from the Initial Keying Material IKM and the salt value salt. If the salt value is specified as 0, the default salt of a string of zero bits the same length as the Pre-Random Key to be extracted is used.
The party that initiates the key exchange
The party that responds to the key exchange
The identification key of the client. The encoding of this key MAY include one or more credentials such as a Mesh personal profile or an X.509 certificate binding the key to an identity.
The identification key of the service. The encoding of this key MAY include one or more credentials such as a Mesh personal profile or an X.509 certificate binding the key to an identity.
The ephemeral key of the client.
The ephemeral key of the service.
The key derivation function is used to derive separate keys for different purposes as shown below. The value L is the number of bits requires to key the algorithm specified. The salt value used to derive the PRK from the IKM is either the default salt value (all zeros) or the previous Rekey value as described below.
Authentication Key = Expand (PRK, "authentication", L)
Encryption Key = Expand (PRK, "encryption", L)
Rekey Key = Expand (PRK, "rekey", L)
Witness value= Expand (PRK, "witness", L)
A key exchange request is either an initial key exchange request or a rekeying request. An initial key exchange request MAY be issued at any time but a rekeying request cannot be sent until at least one initial keying request has been completed.
Rekey messages are authenticated under a Rekey shared secret established in a previous session. This may be the immediately preceding session or any prior session whose rekey token has not expired.
The client sends their identity and ephemeral key to the service. { IKC, EKC }
If the request message is an initial keying request, a credential associated with the identity key MAY be provided. The request MAY be authenticated by means of a digital signature.
The service calculates the IKM value as follows:
IKM = KE (IKC + EKC, IKS + EKS)
PRK = Extract (IKM, 0)
The service returns the values { IKS, EKS, W(IKM) } in a message authenticated under AK(IKM)
Unless the key agreement is performed to a device of restricted capability, rekeying imposes minimal load on client or server and can be performed often, particularly if the Ed25519 curve is used for rekeying.
The state required for rekeying is separate from the keys used to encrypt and/or authenticate messages. This allows an application to store the rekeying key between communication sessions without risk of compromising the confidentiality or integrity of messages.
The use of the chaining salt ensures that rekeying cannot compromise the security of an already established key, even if a weaker key exchange algorithm is used. Thus a client MAY use an Ed488 key to perform an initial key exchange and then preform rekey operations using a
The client sends a new ephemeral key to the service. { CEK }
The request message MUST be authenticated under the rekeying key of the shared secret of any unexpired session previously agreed. This allows the credentials of the parties to be omitted while providing the advantage of establishing a fresh forward secrecy session.
The service calculates the IKM value as follows:
IKM = KE (EKC, EKS)
The service returns the values { EKS, W(IKM) } in a message authenticated under AK(IKM)
PRK = Extract (IKM, RA')
Where RA' is the previous rekeying key output.
Alice requests access to a service using her account identifier alice@example.com. She has already registered her Mesh personal profile with the service where it is bound to her account identifier as the corresponding credential.
The Key exchange request is:
The Keyu Exchange response is
Note that the example has the witness value but does not authenticate the signed result at present. Perhaps it would be better to create the witness value from the ticket data which eliminates the need for authenticating the response??
(TBS)
Supports key exchange to establish a shared secret and bound ticket between a client and a service
Every Recrypt Service transaction consists of exactly one request followed by exactly one response.
Describes an algorithm suite. Each suite consists of sets of authentication and encryption algorithms which are mutually compatible. i.e. the counterparty MAY select any one of the encryption algorithms and use it with any one of the authentication algorithms.
Algorithm identifiers of encryption and authenticated encryption algorithms offered
Authentication algorithm offer
Perform Key Exchange to establish shared key bound to a ticket.
Initiate the key exchange request.
Set of message authentication and encryption algorithms offered by the client
Returns the server parameters.
Opaque session identifier.
Opaque witness value used to prove binding to the ticket.
Algorithm identifiers of encryption or authenticated encryption algorithm chosen
Algorithm identifiers of authentication algorithm chosen
The following registrations are required:
jose-jwb
/.well-known/srv/
[Or change registry to FCFS]Edwards-Curve Digital Signature Algorithm (EdDSA)HMAC-based Extract-and-Expand Key Derivation Function (HKDF)Advanced Encryption Standard (AES) Key Wrap AlgorithmMathematical Mesh: ArchitectureThe X3DH Key Agreement ProtocolElliptic Curves for SecurityMathematical Mesh: Reference Implementation