Internet-Draft | TODO - Abbreviation | July 2024 |
Perez | Expires 5 January 2025 | [Page] |
TODO Abstract¶
This note is to be removed before publishing as an RFC.¶
The latest revision of this draft can be found at https://elsalopez133.github.io/draft-lopez-lake-edhoc-psk/#go.draft-lopez-lake-edhoc-psk.html. Status information for this document may be found at https://datatracker.ietf.org/doc/draft-lopez-lake-edhoc-psk/.¶
Discussion of this document takes place on the LAKE Working Group mailing list (mailto:lake@ietf.org), which is archived at https://example.com/WG. Subscribe at https://www.ietf.org/mailman/listinfo/lake/.¶
Source for this draft and an issue tracker can be found at https://github.com/ElsaLopez133/draft-lopez-lake-psk.¶
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 https://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 5 January 2025.¶
Copyright (c) 2024 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 (https://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 Revised BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Revised BSD License.¶
Pre-shared key (PSK) authentication method provides a balance between security and computational efficiency. This authentication method was proposed in the first I-Ds of Ephemeral Diffie-Hellman Over COSE (EDHOC) [RFC9528], and was ruled out to speed out the development process. However, there is now a renewed effort to reintroduce PSK authentication, making this draft an update to the [RFC9528].¶
One prominent use case of PSK authentication in the EDHOC protocol is session resumption. This allows previously connected parties to quickly reestablish secure communication using pre-shared keys from their earlier session, reducing the overhead of full key exchange. This efficiency is beneficial in scenarios where frequent key updates are needed, such in resource-constrained environments or applications requiring high-frequency secure communications. The use of PSK authentication in EDHOC ensures that session key can be refreshed without heavy computational overhead, typically associated with public key operations, thus optimizing both performance and security.¶
The resumption capability in Extensible Authentication Protocol (EAP) leveraging EDHOC can benefit from this method. EAP-EDHOC resumption aims to provide a streamlined process for re-establishing secure sessions, reducing latency and resource consumption. By employing PSK authentication for key updates, EAP-EDHOC resumption can achieve secure session resumption, enhancing overall efficiency and user experience.¶
EDHOC with PSK authentication is also beneficial for existing systems where two nodes have been provided with a PSK from other parties out of band. This allows the nodes to perform ephemeral Diffie-Hellman to achieve Perfect Forward Secrecy (PFS), ensuring that past communications remain secure even if the PSK is compromised. The authentication provided by EDHOC prevents eavesdropping by on-path attackers, as they would need to be active participants in the communication to intercept and potentially tamper with the session. Examples could be Generic Bootstrapping Architecture (GBA) and Authenticated Key Management Architecture (AKMA) in mobile systems, or Peer and Authenticator in EAP.¶
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here.¶
There are currently two proposed versions of the authentication method, depending on where the pre-shared key identifier (ID_CRED_PSK) is sent. ID_CRED_PSK allows retrieval of CRED_PSK, a COSE object that contains the PSK.¶
In both varaints, Initiator and Responder are assumed to have a PSK with good amount of randomness and the requirements that:¶
Only the Initiator and the Responder have access to the PSK.¶
The Responder is able to retrieve the PSK using ID_CRED_PSK.¶
where:¶
ID_CRED_PSK is a COSE header map containing header parameters that can identify a pre-shared key. For example:¶
ID_CRED_PSK = {4 : h'lf' }¶
CRED_PSK is a COSE_Key compatible credential, encoded as a CCS or CWT. For example:¶
{ /CCS/ 2 : "mydotbot", /sub/ 8 : { /cnf/ 1 : { /COSE_Key/ 1 : 4, /kty/ 2 : h'32', /kid/ -1 : h'50930FF462A77A3540CF546325DEA214' /k/ } } }¶
The purpose of ID_CRED_PSK is to facilitate the retrieval of the PSK. It is RECOMMENDED that it uniquely identifies the CRED_PSK as the recipient might otherwise have to try several keys. If ID_CRED_PSK contains a single 'kid' parameter, then the compact encoding is applied; see Section 3.5.3.2 of [RFC9528]. The authentication credential CRED_PSK substitutes CRED_I and CRED_R specified in [RFC9529], and, when applicable, MUST follow the same guidelines described in Sections 3.5.2 and 3.5.3 of [RFC9528].¶
In the first variant of the method the ID_CRED_PSK is sent in the clear in the first message. Figure 1 shows the message flow of Variant 1.¶
This variant incurs minimal modifications with respect to the current methods described in [RFC9528] and the fourth message remains optional. MAC_3 is removed in message_3 and replaced by AEAD.¶
Not sure this should go here. Probably not. This approach is similar to TLS 1.3, and, consequently, has similar privacy issues. For example:¶
Identity Leakage: neither the identity of the Initiator nor the Responder are protected against active or passive attackers. By sending the ID_CRED_PSK in the clear, the initiator reveals its identity to any eavesdropper on the network. This allows passive observers to learn which entity is attempting to connect to the server.¶
Tracking and correlation: An attacker can use the plaintext ID_CRED_PSK to track the entity across multiple connections, even if those connections are made from different networks or at different times. This enables long-term tracking of entities.¶
Information leakage about relationships: ID_CRED_PSK also reveals information about the relationship between the Initiator and the Responder. An observer can infer that the two parties have a pre-existing relationship and have previously agreed on a shared secret.¶
Replay and preplay attacks: ID_CRED_PSK can facilitate replay attacks. An attacker might use the observed ID_CRED_PSK to initiate their own connection attempts, potentially leading to denial-of-service or other attacks.¶
Downgrade attacks: If multiple PSKs are available (e.g., of varying strengths or for different purposes), an attacker might attempt to force the use of a weaker or less privacy-preserving PSK by manipulating the ID_CRED_PSK field.¶
The ID_CRED_PSK is sent in message_3, encrypted using a key derived from the ephemeral shared secret, G_XY. In this case, the Responder will authenticate the Initiator first, contrary to Variant 1. Figure 2 shows the message flow of Variant 2.¶
Contrary to Variant 1, this approach provides protection against passive attackers for both Initiator and Responder. message_4 remains optional, but is needed to to authenticate the Responder and achieve mutual authentication in EDHOC if not relaying on external applications, such as OSCORE.¶
The pseudorandom keys (PRKs) used for PSK authentication method in EDHOC are derived using EDHOC_Extract, as done in [RFC9528].¶
PRK = EDHOC_Extract( salt, IKM )¶
where the salt and input keying material (IKM) are defined for each key. The definition of EDHOC_Extract depends on the EDHOC hash algorithm selected in the cipher suite.¶
Figure 3 lists the key derivations that differ from those specified in Section 4.1.2 of [RFC9528].¶
PRK_3e2m = EDHOC_Extract( salt3e_2m, CRED_PSK ) PRK_4e3m = PRK_3e2m MAC_2 = EDHOC_KDF( PRK_3e2m, 2, context_2, mac_length_2 ) K_3 = EDHOC_KDF( PRK_4e3m, TBD, TH_3, key_length ) IV_3 = EDHOC_KDF( PRK_4e3m, TBD, TH_3, iv_length )
where:¶
Figure 4 lists the key derivations that differ from those specified in Section 4.1.2 of [RFC9528].¶
PRK_3e2m = PRK_2e PRK_4e3m = EDHOC_Extract( SALT_4e3m, CRED_PSK ) KEYSTREAM_3 = EDHOC_KDF( PRK_3e2m, TBD, TH_3, key_length ) K_3 = EDHOC_KDF( PRK_4e3m, TBD, TH_3, key_length ) IV_3 = EDHOC_KDF( PRK_4e3m, TBD, TH_3, iv_length )
where:¶
This section specifies the differences on the message formatting compared to [RFC9528].¶
message_1 contains the ID_CRED_PSK. The composition of message_1 SHALL be a CBOR sequence, as defined below:¶
message_1 = ( METHOD : int, SUITES_I : suites, G_X : bstr, C_I : bstr / -24..23, ID_CRED_PSK : header map // kid_value : bstr, ? EAD_1, ) suites = [ 2* int ] / int EAD_1 = 1* ead¶
where:¶
ID_CRED_PSK is an identifier used to facilitate retrieval of the PSK.¶
The Initiator includes ID_CRED_PSK in message_1 and encodes the full message as a sequence of CBOR-encoded data items as specified in Section 5.2.1. of [RFC9528]¶
The Responder SHALL process message_1 as follows:¶
message_2 SHALL be a CBOR sequence, defined as:¶
message_2 = ( G_Y_CIPHERTEXT_2 : bstr, )¶
where:¶
G_Y_CIPHERTEXT_2 is the concatenation of G_Y (i.e., the ephemeral public key of the Responder) and CIPHERTEXT_2.¶
CIPHERTEXT_2 is calculated with a binary additive stream cipher, using KEYSTREAM_2 and the following plaintext:¶
The Responder uses MAC instead of Signature. Hence, COSE_Sign1 is not used. The Responder computes MAC_2 as described in Section 4.1.2 of [RFC9528], with context_2 <<C_R, ID_CRED_PSK, TH_2, CRED_PSK, ? EAD_2>>¶
message_3 SHALL be a CBOR sequence, defined as:¶
message_3 = ( CIPHERTEXT_3 : bstr, )¶
The Initiator computes a COSE_Encrypt0 object as defined in Section 5.2 and 5.3 of [RFC9052] with the EDHOC AEAD algorithm of the selected cipher suite and the following parameters:¶
protected = h''¶
external_aad = TH_3, as defined in Section 5.2¶
K_3 and IV_3 as defined in Section 5.2¶
PLAINTEXT_3 = ( ? EAD_3 )¶
The Initiator computes TH_4 = H( TH_3, PLAINTEXT_3, CRED_PSK )¶
message_2 SHALL be a CBOR sequence, defined as:¶
message_2 = ( G_Y_CIPHERTEXT_2 : bstr, )¶
where:¶
message_3 SHALL be a CBOR Sequence, as defined below:¶
message_3 = ( CIPHERTEXT_3 )¶
where:¶
CIPHERTEXT_3 is a concatenation of two different ciphertexts:¶
CIPHERTEXT_3A is calculated with a binary additive stream cipher, using a KESYSTREAM_3 generated with EDHOC_Expand and the following plaintext:¶
PLAINTEXT_3A = ( ID_CRED_PSK )¶
CIPHERTEXT_3B is a COSE_Encrypt0 object as defined in Sections 5.2 and 5.3 of [RFC9052], with the EDHOC AEAD algorithm of the selected cipher suite, using the encryption key K_3, the initialization vector IV_3 (if used by the AEAD algorithm), the parameters described in Section 5.2 of [RFC9528], plaintext PLAINTEXT_3B and the following parameters as input:¶
The Initiator computes TH_4 = H( TH_3, ID_CRED_PSK, PLAINTEXT_3, CRED_PSK ), defined in Section 5.2.¶
message_4 SHALL be a CBOR sequence, defined as:¶
message_4 = ( CIPHERTEXT_4 : bstr, )¶
A fourth message is mandatory for Responder's authentication. The Initiator MUST NOT persistently store PRK_out or application keys until the Initiator has verified message_4 or a message protected with a derived application key, such as an OSCORE message, from the Responder and the application has authenticated the Responder.¶
When evaluating the security considerations, it is important to differentiate between the initial handshake and session resumption phases.¶
Initial Handshake: a fresh CRED_PSK is used to establish a secure connection.¶
Session Resumption: the same PSK identifier (ID_CRED_PSK) is reused each time EDHOC is executed. While this enhances efficiency and reduces the overhead of key exchanges, it presents privacy risks if not managed properly. Over multiple resumption sessions, initiating a full EDHOC session changes the resumption PSK, resulting in a new ID_CRED_PSK. The periodic renewal of the CRED_PSK and ID_CRED_PSK helps mitigate long-term privacy risks associated with static key identifiers.¶
The current EDHOC methods protect the Initiator’s identity against active attackers and the Responder’s identity against passive attackers (See Section 9.1 of [RFC9528]). However, there are differences between the two variants described in this draft:¶
The current EDHOC protocol consists of three mandatory messages and an optional fourth message. The PSK authentication method might require a compulsory message depending on which variant is employed:¶
Variant 1: ID_CRED_PSK is sent without encryption, saving computational resources at the cost of privacy. The exposure of ID_CRED_PSK in message_1 allows for earlier key derivation on the responder's side, potentially speeding up the process.¶
Variant 2: It requires encryption of ID_CRED_PSK in message_3, which implies higher computational cost.¶
Mutual authentication is achieved at earlier stages in Variant 1, which might be important in certain applications, as well as increasing security against Denial of Service attacks or oracle attacks.¶
Variant 1: it allows for earlier authentication, potentially improving resistance to some active attacks, but at the cost of reduced privacy and increased vulnerability to passive attacks and traffic analysis.-¶
Variant 2: it offers better privacy and resistance to passive attacks but might be more vulnerable to certain active attacks due to delayed authentication.¶
Aspect | Variant 1 (Clear ID_CRED_PSK) | Variant 2 (Encrypted ID_CRED_PSK) |
---|---|---|
Privacy | Lower: ID_CRED_PSK sent in clear in message_1 | Higher: ID_CRED_PSK encrypted in message_3 |
Initiator Identity Protection | Exposed from message_1 | Protected until message_3 |
Authentication Timing | Earlier, possible from message_1 | Delayed until message_3 |
Computational Efficiency | Slightly higher (no encryption of ID_CRED_PSK) | Slightly lower (encryption of ID_CRED_PSK) |
Resistance to Passive Attacks | Lower due to exposed identity | Higher due to identity protection |
Early Access Control | Possible from message_1 | Limited, delayed until message_3 |
DoS Attack Vulnerability | Lower due to early authentication | Potentially higher due to delayed authentication |
Resource Allocation | Fewer resources allocated before authentication | More resources allocated before authentication |
Compatibility with Systems Expecting Early Identification | Higher | Lower |
Flexibility for Identity Protection | Lower | Higher |
Key Derivation Timing | Potentially earlier | Potentially delayed |
Completeness | Complete with optional message_4 | Complete with optional message_4 |
Suitability for Quick Identification Scenarios | Higher | Lower |
To improve privacy during both initial handshake and session resumption, a single unified method for handling PSKs could be beneficial. Variant 2 is particularly suitable for this purpose as it streamlines key management and usage across different phases.¶
For use cases involving the transmission of application data, application data can be sent concurrently with message_3, maintaining the protocol's efficiency. In applications such as EAP-EDHOC, where application data is not sent, message_4 is mandatory. Other implementations may continue using OSCORE in place of EDHOC message_4, with a required change in the protocol's language to: The Initiator SHALL NOT persistently store PRK_out or application keys until the Initiator has verified message_4 or a message protected with a derived application key, such as an OSCORE message.¶
This change ensures that key materials are only stored once their integrity and authenticity are confirmed, thereby enhancing privacy by preventing early storage of potentially compromised keys.¶
Lastly, whether the Initiator or Responder authenticates first is not relevant when using symmetric keys. This consideration was important for the privacy properties when using asymmetric authentication but is not significant in the context of symmetric key usage.¶
This document has no IANA actions.¶
TODO acknowledge.¶