LAKE Working Group E. Lopez-Perez Internet-Draft Inria Intended status: Informational G. Selander Expires: 21 April 2025 J. P. Mattsson Ericsson R. Marin-Lopez University of Murcia 18 October 2024 EDHOC PSK authentication draft-lopez-lake-edhoc-psk-02 Abstract This document specifies the Pre-Shared Key (PSK) authentication method for the Ephemeral Diffie-Hellman Over COSE (EDHOC) key exchange protocol. It describes the authentication processes, message flows, and security considerations of this authentication method. About This Document 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. Status of This Memo 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/. Lopez-Perez, et al. Expires 21 April 2025 [Page 1] Internet-Draft TODO - Abbreviation October 2024 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 21 April 2025. Copyright Notice 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. Table of Contents 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3 1.1. Motivation . . . . . . . . . . . . . . . . . . . . . . . 3 1.2. Assumptions . . . . . . . . . . . . . . . . . . . . . . . 3 2. Conventions and Definitions . . . . . . . . . . . . . . . . . 3 3. Protocol . . . . . . . . . . . . . . . . . . . . . . . . . . 4 3.1. Credentials . . . . . . . . . . . . . . . . . . . . . . . 4 3.2. Message flow of PSK . . . . . . . . . . . . . . . . . . . 5 4. Key derivation . . . . . . . . . . . . . . . . . . . . . . . 5 5. Message formatting and processing. Differences with respect to RFC9528 . . . . . . . . . . . . . . . . . . . . . . . . . 6 5.1. Message 1 . . . . . . . . . . . . . . . . . . . . . . . . 6 5.2. Message 2 . . . . . . . . . . . . . . . . . . . . . . . . 6 5.3. Message 3 . . . . . . . . . . . . . . . . . . . . . . . . 7 5.4. Message 4 . . . . . . . . . . . . . . . . . . . . . . . . 7 6. Security Considerations . . . . . . . . . . . . . . . . . . . 8 6.1. Identity protection . . . . . . . . . . . . . . . . . . . 8 6.2. Number of messages . . . . . . . . . . . . . . . . . . . 8 6.3. External Authorization Data . . . . . . . . . . . . . . . 9 6.4. Attacks . . . . . . . . . . . . . . . . . . . . . . . . . 9 7. Privacy Considerations . . . . . . . . . . . . . . . . . . . 9 8. Unified Approach and Recommendations . . . . . . . . . . . . 9 9. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 9 10. Normative References . . . . . . . . . . . . . . . . . . . . 9 Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . 10 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 10 Lopez-Perez, et al. Expires 21 April 2025 [Page 2] Internet-Draft TODO - Abbreviation October 2024 1. Introduction 1.1. Motivation 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]. EDHOC with PSK authentication could be 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. Another 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. 1.2. Assumptions 2. Conventions and Definitions 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. Lopez-Perez, et al. Expires 21 April 2025 [Page 3] Internet-Draft TODO - Abbreviation October 2024 3. Protocol In this method, the Pre-Shared Key identifier (ID_CRED_PSK) is sent in message_3. The ID_CRED_PSK allows retrieval of CRED_PSK, a COSE object that contains the PSK. Through this document we will refer to the Pre-Shared Key authentication method as EDHOC-PSK. 3.1. Credentials 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]. Lopez-Perez, et al. Expires 21 April 2025 [Page 4] Internet-Draft TODO - Abbreviation October 2024 3.2. Message flow of PSK The ID_CRED_PSK is sent in message_3, encrypted using a key derived from the ephemeral shared secret, G_XY. The Responder authenticates the Initiator first. Figure 1 shows the message flow of PSK authentication method. Initiator Responder | METHOD, SUITES_I, G_X, C_I, EAD_1 | +------------------------------------------------------------------>| | message_1 | | | | G_Y, Enc( C_R, EAD_2 ) | |<------------------------------------------------------------------+ | message_2 | | | | Enc( ID_CRED_PSK ), AEAD( EAD_3 ) | +------------------------------------------------------------------>| | message_3 | | | | AEAD( EAD_4 ) | |<------------------------------------------------------------------+ | message_4 | Figure 1: Overview of message flow of PSK. 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. With this fourth message, the protocol achieves both explicit key confirmation and mutual authentication. 4. Key derivation 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 2 lists the key derivations that differ from those specified in Section 4.1.2 of [RFC9528]. Lopez-Perez, et al. Expires 21 April 2025 [Page 5] Internet-Draft TODO - Abbreviation October 2024 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 ) Figure 2: Key derivation of EDHOC PSK authentication method. where: * KEYSTREAM_3 is used to encrypt the ID_CRED_PSK in message_3. * TH_3 = H( TH_2, PLAINTEXT_2, CRED_PSK ) * TH_4 = H( TH_3, ID_CRED_PSK, ? EAD_3, CRED_PSK ) 5. Message formatting and processing. Differences with respect to [RFC9528] This section specifies the differences on the message formatting compared to [RFC9528]. 5.1. Message 1 Same as message_1 of EDHOC, described in Section 5.2.1 of [RFC9528]. 5.2. Message 2 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: - PLAINTEXT_2 = ( C_R, / bstr / -24..23, ? EAD_2 ) - CIPHERTEXT_2 = PLAINTEXT_2 XOR KEYSTREAM_2 Contrary to [RFC9528], MAC_2 is not used. Lopez-Perez, et al. Expires 21 April 2025 [Page 6] Internet-Draft TODO - Abbreviation October 2024 5.3. Message 3 message_3 SHALL be a CBOR Sequence, as defined below: message_3 = ( CIPHERTEXT_3: bstr, ) where: * CIPHERTEXT_3 is a concatenation of two different ciphertexts: - CIPHERTEXT_3A is bit string calculated with a binary additive stream cipher, using a KESYSTREAM_3 generated with EDHOC_Expand and the following plaintext: o 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: o protected = h'' o external_aad = << Enc(ID_CRED_PSK), TH_3 >> o K_3 and IV_3 as defined in Section 5.2 o PLAINTEXT_3B = ( ? EAD_3 ) The Initiator computes TH_4 = H( TH_3, ID_CRED_PSK, PLAINTEXT_3, CRED_PSK ), defined in Section 5.2. 5.4. Message 4 message_4 is mandatory and is a CBOR sequence, defined as: message_4 = ( CIPHERTEXT_4 : bstr, ) Lopez-Perez, et al. Expires 21 April 2025 [Page 7] Internet-Draft TODO - Abbreviation October 2024 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. 6. Security Considerations When evaluating the security considerations, it is important to differentiate between the initial handshake and session resumption phases. 1. *Initial Handshake*: a fresh CRED_PSK is used to establish a secure connection. 2. *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. 6.1. Identity protection 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]). With EDHOC-PSK authentication method, both the Initiator's and Responder's identities are protected against passive attackers, but not against active attackers. 6.2. Number of messages The current EDHOC protocol consists of three mandatory messages and an optional fourth message. In the case of EDHOC-PSK authentication method, message_4 remains optional, but mutual authentication is not guaranteed without it, or an OSCORE message or any application data that confirms that the Responder owns the PSK. Additionally, with this fourth message the protocol achieves explicit key confirmation in addition to mutual authentication. Lopez-Perez, et al. Expires 21 April 2025 [Page 8] Internet-Draft TODO - Abbreviation October 2024 6.3. External Authorization Data The Initiator and Responder can send information in EAD_3 and EAD_4 or in OSCORE messages in parallel with message_3 and message_4. This is possible because the Initiator knows that only the Responder with access to the CRED_PSK can decrypt the information. 6.4. Attacks EDHOC-PSK authentication method offers privacy and resistance to passive attacks but might be vulnerable to certain active attacks due to delayed authentication. 7. Privacy Considerations 8. Unified Approach and Recommendations 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. Thus, EDHOC- PSK authentication method doe snot include any extra messages. 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. 9. IANA Considerations This document has no IANA actions. 10. Normative References [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, DOI 10.17487/RFC2119, March 1997, . Lopez-Perez, et al. Expires 21 April 2025 [Page 9] Internet-Draft TODO - Abbreviation October 2024 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, May 2017, . [RFC9052] Schaad, J., "CBOR Object Signing and Encryption (COSE): Structures and Process", STD 96, RFC 9052, DOI 10.17487/RFC9052, August 2022, . [RFC9528] Selander, G., Preuß Mattsson, J., and F. Palombini, "Ephemeral Diffie-Hellman Over COSE (EDHOC)", RFC 9528, DOI 10.17487/RFC9528, March 2024, . [RFC9529] Selander, G., Preuß Mattsson, J., Serafin, M., Tiloca, M., and M. Vučinić, "Traces of Ephemeral Diffie-Hellman Over COSE (EDHOC)", RFC 9529, DOI 10.17487/RFC9529, March 2024, . Acknowledgments TODO acknowledge. Authors' Addresses Elsa Lopez-Perez Inria Email: elsa.lopez-perez@inria.fr Göran Selander Ericsson Email: goran.selander@ericsson.com John Preuß Mattsson Ericsson Email: john.mattsson@ericsson.com Rafael Marin-Lopez University of Murcia Email: rafa@um.es Lopez-Perez, et al. Expires 21 April 2025 [Page 10]