How Cellular Networks Work
The proposed method addresses the vulnerabilities in existing cellular network security protocols by using key derivation functions to encrypt and integrity-check discovery messages, ensuring secure and efficient communication in cellular networks.
Patent Information
- Application Number
- JP2024518795
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2022-08-22
- Filing Date
- 2022-09-26
- Publication Date
- 2024-10-16
AI Technical Summary
Existing solutions in cellular networks, such as those outlined in TS33.303, are susceptible to attacks and do not guarantee the integrity of discovery messages, particularly for long messages, and are complex and lack interoperability, with issues related to key usage and message protection.
A method is proposed to enhance the security of discovery messages by using key derivation functions to generate keystreams for encryption and integrity checks, ensuring that messages are protected using a unified algorithm regardless of the configured key, and optimizing the processing of long messages through multiple KDF calls.
This approach improves the security and interoperability of discovery messages by ensuring message integrity and confidentiality, reducing the risk of attacks and enhancing performance by efficiently handling messages of varying lengths.
Smart Images

Figure 2024537747000001_ABST
Abstract
Description
[Technical field]
[0001] The present invention relates to the field of wireless communications, and in particular to security aspects in the context of cellular networks such as UMTS LTE (Long Term Evolution) or LTE Advanced (both included in 4G), NR (New Radio) (5G), or other cellular or mobile communication networks. [Background technology]
[0002] In a conventional cellular network, a primary station serves multiple secondary stations located within the cell it serves. Wireless communication from the primary station to each secondary station occurs on a downlink channel. Conversely, wireless communication from each secondary station to the primary station occurs on an uplink channel. Wireless communication can include data traffic (also called user data) and control information (also called signaling). This control information typically includes information that assists the primary and / or secondary stations in exchanging data traffic (e.g., resource allocations / requests, physical transmission parameters, information about the status of each station).
[0003] In the context of cellular networks standardized by 3GPP, the primary station is called a base station, or gNodeB (or gNB) in 5G (NR) or eNodeB (or eNB) in 4G (LTE). The eNB / gNB is part of the radio access network RAN that interfaces with the functions of the core network (CN). In the same context, the secondary station corresponds to a mobile station, or a user equipment (or UE) in 4G / 5G. A UE is a wireless client device or a specific role that such a device plays. The term "node" is also used to refer to a UE or a gNB / eNB.
[0004] Furthermore, direct communication can take place between secondary stations, here UEs, for example in the case of PC5 interface or sidelink communication. It is also then possible for the UE to act as a relay, allowing for example out-of-coverage UEs to obtain an intermediate (or indirect) connection to an eNB or gNB. To be able to act as a relay, the UE may use discovery messages to establish new connections with other UEs.
[0005] Therefore, the role of a relay node was introduced in 3GPP as shown in Fig. 1. This relay node 120 is a wireless communication station 120 that includes a function of relaying communication between a primary station 100, e.g. a gNB, and a secondary station 110, e.g. a UE. This relay function allows, for example, to extend the coverage of a cell 10 to an out-of-coverage (OoC) secondary station 110. This relay node 120 may be a mobile station or a different type of device. In the specifications for 4G, Proximity Services (ProSe) functions are defined, among others, in TS 23.303 and TS 24.334. These functions enable, among others, the connection of cellular user equipment (UE) 110 that is temporarily out of coverage of a cellular network base station (eNB) 100 serving the cell 10. This particular function is called ProSe UE-to-network relay, or relay UE for short. The relay UE 120 relays application and network traffic in both directions between the OoC UE 110 and the eNB 100. The local communication between the relay UE 120 and the OoC UE 110 is called D2D (device-to-device) communication or sidelink (also called PC5) communication in TS23.303 and TS24.334. Once the relay relationship is established, the OoC-UE 110 is, for example, IP connected via the relay UE 120 and takes the role of a "remote UE" 110. This situation means that the remote UE has an indirect network connection to selected functions of the core network, unlike the usual case of a direct network connection to all core network functions.
[0006] Furthermore, the role of an inter-UE relay node is introduced, i.e. a relay node that relays communication between two UE devices. This is shown in Figure 3, where a relay node 1010 relays communication between a UE device 1020 and a UE device 1030. The UEs 1010, 1020, 1030 can be connected to a core network via a base station 1000.
[0007] As will be explained in more detail later, technical specification TS33.303 and previously proposed solutions describe the protection of discovery messages over the PC5 interface by reusing methods already introduced in previous versions of TS33.303 with modifications, namely, the parts of the message that are scrambled, how the Message Identification Code (MIC) is calculated, which MIC value is transmitted, and how confidentiality protection is achieved. However, the currently proposed solutions are vulnerable to attacks and do not guarantee the integrity of the various nodes involved in discovery. Furthermore, existing solutions in TS33.303 are not able to protect long discovery messages, e.g., messages longer than 32 bytes.
[0008] As will be explained in more detail later, technical specification TS33.303 and previously proposed solutions describe the protection of direct communication request messages over the PC5 interface, but the currently proposed solutions lack interoperability and are too complex. Summary of the Invention
[0009] One object of the present invention is to alleviate the above problems.
[0010] Another object of the invention is to propose a method of communicating in a network that allows a secure setup for establishing a Protocol Data Unit (PDU) session for a secondary station.
[0011] Yet another object of the present invention is to improve protection of discovery messages.
[0012] It is yet another object of the present invention to provide improved protection for discovery communication request (DCR) messages.
[0013] Yet another object of the invention is to propose a method for secondary stations to communicate within a network that minimizes interaction with the core network after start-up.
[0014] According to various aspects of the present invention, several modifications to the security routines are proposed to make them operable and to improve security / privacy protection and performance.
[0015] To this end, according to a first aspect of the invention, a method of operating a first station is proposed as claimed in claim 1. More specifically, a method of operating a first station in a communication system comprising a first station and a second station is proposed, the method comprising: a. preparing a message by a first station including at least a combination of a parameter indicating a type of service and a communication key or an index of a communication key to be used for communication with a second station; b. executing, by the first station, an algorithm for generating a keystream by applying a key derivation function to at least a confidentiality key and a freshness value; c. the first station encrypting the message using the key stream.
[0016] In a first variant of the invention, step b. comprises generating a keystream by applying a key derivation function to at least the confidentiality key, the freshness value and the message.
[0017] In a second variant, which can be combined with the first variant, step c. comprises applying an exclusive-or (XOR) operation to the message and the keystream.
[0018] In all of the above proposals, the freshness value may be a time value based on UTC (Coordinated Universal Time).
[0019] Moreover, in a fourth variant that can be combined with the first aspect or any of its variants, the method includes the first station computing a message integrity check for the message.
[0020] In one example of this fourth variation, a message integrity check may be included in the message prior to step c., and step b. may include generating a keystream by applying a key derivation function to at least the confidentiality key, the freshness value, the message, and a MIC of the message.
[0021] In a fifth variation of the first aspect or variations thereof, step b. includes selecting a confidentiality key from a plurality of available keys in accordance with a predetermined policy.
[0022] In such a variation, if DUCK (which is an encryption key) is set, the private key is DUCK, otherwise, if DUSK (which is a scrambling key) is set, the private key may be DUSK. Thus, the sender and receiver know which key should be used depending on which key is set and agreed upon. Additionally or optionally, if DUCK is set, the key stream may be obtained by applying an encryption algorithm, and if DUCK is not set but DUSK is set, the key stream may be obtained by applying a scrambling algorithm.
[0023] In a further option, if confidentiality is not set (neither DUCK nor DUSK is set), the message of step a. is not encrypted in step c.
[0024] In a sixth variant, which can be combined with any of the variants above, the key stream can be obtained by applying a single algorithm, regardless of the secret key that has been set. In fact, the same algorithm can be used no matter which key has been set. This algorithm uses the set or selected key indiscriminately.
[0025] In a seventh variant of the first aspect of the present invention, the method further comprises the step of the first station calculating a message integrity check for the message using an integrity key, the integrity key being the same as the selected confidentiality key.
[0026] In an eighth variant of the first aspect of the present invention, step b. comprises applying a key derivation function to obtain a second confidentiality key, and the key stream is obtained by applying the second confidentiality key to a symmetric encryption algorithm.
[0027] In one option of the eighth variant, the symmetric encryption algorithm is an NEA algorithm selected by the core network, negotiated during a previous operational phase, or signaled in the message.
[0028] In a ninth variant of the first aspect that can be combined with any of the variants described above, the parameter indicating the type of service is a relay service code.
[0029] According to a second aspect of the invention, a first station as claimed in claim 17 is proposed for operating in a communication system further comprising a second station, the first station comprising: A transmitter; A receiver; a processor coupled to a memory containing instructions, the instructions comprising: preparing a message including a combination of a parameter indicating a type of service and a communication key or an index of a communication key to be used for communication with the second station; executing an algorithm for generating a keystream by applying a key derivation function to at least a confidentiality key and a freshness value; and encrypting the message with the key stream.
[0030] According to a third aspect of the invention, a second station as claimed in claim 18 is proposed for operating in a communication system further comprising a first station, the second station comprising: A transmitter; A receiver; a processor coupled to a memory containing instructions, the instructions comprising: receiving an encrypted message; executing an algorithm for generating a keystream by applying a key derivation function to at least a confidentiality key and a freshness value; and decrypting the message using the keystream.
[0031] It should be noted that the various modifications of the first aspect apply equally to the second and third aspects of the invention.
[0032] In a fourth aspect of the invention, a system as claimed in claim 19 is proposed.
[0033] In a fifth aspect of the present invention, a method is proposed as claimed in claim 20 for a first station to transmit a message to a second station in a communication system, the method comprising: a. a first station calculating a message integrity check (MIC) based on the message; b. the first station combining the MIC with the message; c. Computing a keystream based on at least the MIC; d. the first station encrypts the message using a keyword based on the keystream to obtain a cipher.
[0034] In a first variant of the fifth aspect of the invention, the method further comprises the step e of scrambling part of the cryptogram obtained from step d.
[0035] In a second variant of the fifth aspect of the invention, the MIC is used as a message fingerprint in the calculation of the keystream.
[0036] In a third variant of the fifth aspect of the invention, which may be used independently or in combination with the other variants, the keyword is a combination of a keystream and an encryption key mask. Optionally, the combination is an AND operation.
[0037] In a sixth aspect of the present invention there is proposed a method of operating a first station in a communication system, the method comprising the steps of: a. a first station preparing a discovery message of length L bytes; b. a first station generating a pseudo-random sequence with an output size of L bytes by applying a key derivation function of size B bytes Ceiling(L / B) times or applying a NEA algorithm, where the pseudo-random sequence depends on at least a confidentiality key, a freshness value, and a counter value; c. the first station encrypting the message using the pseudo-random number sequence.
[0038] In a first variation of the sixth aspect of the invention, the input to the key derivation function comprises the result of applying a bitwise "AND" function to the mask and the concatenation of the message and the MIC.
[0039] In a second variant, which can be combined with the first variant, the input of the key derivation function or the NEA algorithm comprises at least a function of a mask, a function of a message or a function of a MIC.
[0040] In a third variant, which can be combined with the first or second variant, the message indicates a mask indicating the message length or the presence of an optional field for adjusting the encryption operation.
[0041] In a seventh aspect of the present invention, a method of operating a system including a first station operating according to the method of the sixth aspect and a second station is proposed, the second station comprising: a. receiving a discovery message; b. descrambling and / or decrypting a first portion of the discovery message by using a first portion of the generated pseudo-random number sequence; c. verifying the integrity of the first portion of the discovery message using a MIC of the first portion of the discovery message; d. if the integrity check of the first part of the discovery message is successful and / or if a field in the first part of the discovery message indicates the presence of a second part of the discovery message, descrambling and / or decrypting the second part of the discovery message using the second part of the generated pseudo-random number sequence.
[0042] In a first variation of the seventh aspect, if a hash of the scrambled / encrypted second portion of the received message matches a hash value contained within and verified within a first portion of the discovery message, the second portion of the received discovery message is descrambled and / or decrypted.
[0043] In a variant of the fifth or sixth aspect of the invention, step a comprises calculating a MIC based on the message and, if available, a DUIK (integrity key), and step a comprises setting the MIC to a random value if the DUIK is not set. Optionally, the keystream is calculated using the NEA algorithm.
[0044] Additionally, the 32-bit count in the NEA algorithm may be set to the UTC-based counter value, the BEARER field value is set to BEARER=0000, and the DIRECTION field value is set to 0.
[0045] In one option of the fifth or sixth aspect, protection of the discovery message is first applied to a first portion of the message and then to a second portion of the message, and the protection of the first portion of the message and the second portion of the message are different from each other.
[0046] In an eighth aspect of the present invention, there is proposed a first station operating in a communication system, the first station comprising: A transmitter; A receiver; a processor coupled to a memory containing instructions, the instructions comprising: a. a first station calculating a MIC (Message Integrity Check) based on the message; b. the first station combining the MIC with the message; c. Computing a keystream based on at least the MIC; d. the first station encrypting the message using a keyword based on the keystream to obtain a cipher.
[0047] In a ninth aspect of the present invention, there is proposed a first station operating in a communication system, the first station comprising: A transmitter; A receiver; a processor coupled to a memory containing instructions, the instructions comprising: preparing a discovery message of length L bytes; generating a pseudo-random sequence of L bytes in output size by applying a key derivation function of size B bytes Ceiling(L / B) times or applying the NEA algorithm, where the pseudo-random sequence depends on at least a confidentiality key, a freshness value, and a counter value; and encrypting the message using the pseudorandom number sequence.
[0048] In a tenth aspect of the present invention, there is proposed a second station operating in a communication system, the second station comprising: A transmitter; A receiver; a processor coupled to a memory containing instructions, the instructions comprising: a second station receiving the encrypted message, a MIC (Message Integrity Check); a second station obtaining a MIC-based keyword; a second station decrypting the encrypted message using the obtained keyword; and the second station checking the integrity of the message by checking whether the received MIC is valid.
[0049] In an eleventh aspect of the present invention, a system comprises a first station of the eighth aspect of the present invention and a second station of the tenth aspect of the present invention.
[0050] In a twelfth aspect of the invention, a computer program product is proposed comprising code which, when loaded onto a wireless device, causes the wireless device to carry out the steps of the method according to the first aspect.
[0051] According to a second aspect of the invention, a method for operating a relay station and a relay station are proposed.
[0052] According to a third aspect of the invention, a method of operating a secondary station and a secondary station are proposed.
[0053] According to a fourth aspect of the present invention, there is proposed a computer program product comprising code means for generating the steps of the methods of the first, fourth, fifth, sixth or seventh aspect of the present invention when executed on a computing device.
[0054] It should be noted that each of the above apparatuses may be implemented based on individual hardware circuits having separate hardware components, integrated chips, or chip module configurations, or based on signal processing devices or chips controlled by software routines or programs stored in memory, written onto a computer-readable medium, or downloaded from a network such as the Internet.
[0055] It is to be understood that the wireless devices, systems, relay stations, cell stations, and methods may have similar, corresponding, and / or identical preferred embodiments, particularly as recited in the dependent claims.
[0056] It is to be understood that a preferred embodiment of the invention can also be any combination of the dependent claims or the above embodiments with the independent claims.
[0057] These and other aspects of the invention will be elucidated and elucidated with reference to the embodiments described hereinafter.
[0058] It should be noted that each of the above apparatuses may be implemented based on individual hardware circuits having separate hardware components, integrated chips, or chip module configurations, or based on signal processing devices or chips controlled by software routines or programs stored in memory, written onto a computer-readable medium, or downloaded from a network such as the Internet.
[0059] It will be understood that the stations, methods, computer program products and systems of the various aspects of the invention may have similar and / or identical preferred embodiments, in particular as set out in the dependent claims.
[0060] These and other aspects of the invention will be elucidated and elucidated with reference to the embodiments described hereinafter. [Brief description of the drawings]
[0061] [Figure 1] FIG. 1, as already explained, represents diagrammatically a cellular system in which the invention is implemented. [Diagram 2] FIG. 2 illustrates a schematic representation of a discovery message. [Diagram 3] FIG. 3 illustrates diagrammatically another cellular system in which the present invention may be implemented. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0062] In the following embodiments, various aspects of the present invention will be described in detail. As mentioned above, embodiments of the present invention may relate to various types of wireless communication, in particular to connection setup of devices that wish to access a wireless network. A typical example is a cellular network, such as a 5G network, possibly including several relay nodes. These relay nodes may be implemented by UEs, such as sidelink-enabled UEs, that can act as relay nodes, or by other types of repeaters.
[0063] To enable a new connection via this kind of relay, a discovery phase is required in which discovery messages are sent to or by the relay UE. One general objective of this particular exemplary embodiment is to enhance the protection of such discovery messages. Section 6.1.3.4.3 of technical specification TS33.303 v17.0.0 describes the protection of discovery messages. Three types of security used to protect restricted discovery messages are listed, and are detailed as follows:
[0064] First, similar to Open Discovery (see subsection 6.1.3.3.1), integrity protection is provided by adding a MIC (Message Identification Code). The MIC is calculated in the sending UE using the received DUIK (Discovery User Integrity Key). The MIC can be checked in the receiving UE using the supplied DUIK or in the ProSe function (relay node) using the DUIK.
[0065] The second is scrambling protection, which ensures that there is no correlation between multiple discovery messages sent by a particular UE, i.e. prevents tracking of UEs over time. The scrambling key stream is calculated from the Discovery User Scrambling Key (DUSK) and a UTC-based counter associated with the discovery slot (see 6.1.3.4.3.5 for calculation details).
[0066] Finally, there is message specific confidentiality, which provides confidentiality protection for parts of discovery messages. This is used when multiple UEs use the same DUSK or when it is desired to obfuscate parts of discovery messages from a subset of UEs that are allowed for UE discovery. A keystream is calculated from the Discovery User Confidentiality Key (DUCK), the message contents and a UTC-based counter associated with the discovery slot (see 6.1.3.4.3.6 for calculation details).
[0067] The security procedures applied to the transmitting and receiving UEs are controlled by the ProSe function by sending code transmission security parameters and / or code reception security parameters to the appropriate UEs (i.e., the UE must support all of integrity protection, scrambling, and message specific confidentiality). To achieve integrity protection for ProSe restricted discovery messages, either DUSK or DUIK must be provided. When message specific confidentiality is applied using DUCK, DUIK is required for integrity protection since multiple messages are protected. Examples of discovery user key combinations depending on the type of use case are given in Appendix G.
[0068] At the receiver, the scrambling protection must be removed before a match is attempted. Because the operation to remove message-specific confidentiality is computationally intensive, the chance of a false positive occurring in the preceding match operation should be extremely minimal. To this end, the ProSe function must ensure that the number of bits in the discovery message that can be matched after descrambling is at least 16 (which reduces the chance of a false positive to less than 1 in 65,536).
[0069] In section 6.1.3.4.3.2, Message Processing in the sending UE, the UE sending the discovery message receives code transmission security parameters from the ProSe function to indicate how to protect the message (as described in the security flow). The code transmission security parameters may include DUSK and may include DUIK. The code transmission security parameters may include both DUCK and Encrypted_bits_mask.
[0070] The UE sending the discovery message performs the following steps: 1. Form a discovery message (e.g., add a suffix if only a prefix is assigned). 2. If a DUIK is provided, calculate the MIC; otherwise, set the MIC to all zeros. 3. If a DUCK is received, add message specific confidentiality to the message. 4. Attach the MIC to the output of step 3. 5. If DUSK is received, add scrambling to the output of step 4.
[0071] In subclause 6.1.3.4.3.3, Protected message processing in the receiving UE, the code reception security parameter received from the ProSe function (as described in the security flow) is used to indicate to the UE how to protect the received discovery message. The code reception security parameter may contain DUSK, and may contain either DUIK, or an indication of whether or not the matching report should be used for the MIC check. The matching report option is not allowed for the ProSe query code. The code reception security parameter may also contain both DUCK and the corresponding Encrypted_bits_mask.
[0072] A UE that receives the discovery message performs the following steps: 1. If DUSK is received, descramble (similar to step 5 in the transmitting UE). 2. Check if the bits of the unencrypted message match using message specific confidentiality. If they don't match, abort. Some bits for which a match is indicated by the discovery filter may be encrypted with message specific confidentiality at this stage. The UE may search for a match on other bits after this step to minimize the amount of processing performed before finding a match. 3. If a DUCK is received, release the message specific confidentiality (similar to step 3 in the sending UE). If 4.3 finds a match only in the unencrypted bits, perform a full match. If there is no match, abort. 5. If a MIC check is required, check the MIC directly (if a DUIK is given in the discovery filter security parameters) or via a match report if indicated in the discovery filter security parameters.
[0073] The requirement to check the MIC (in the UE or via a matching report) can be omitted only if the scrambling protection provides integrity protection for the bits of the message that the receiving UE is interested in. Such integrity protection is provided only if (1) a given DUSK protects exactly one ProSe code that the receiver matches, or (2) if message-specific confidentiality is applied to the ProSe code, but no DUSK is provided to the receiving UE to remove the message-specific confidentiality, and all non-encrypted bits take fixed values that the receiver matches. In the first case, if an attacker modifies any part of the message, matching fails. In the second case, if an attacker modifies the non-encrypted bits, matching fails, but modifying the encrypted bits does nothing, since the receiving UE ignores these bits anyway. In the latter case, the receiving UE fails to check the MIC.
[0074] In subclause 6.1.3.4.3.4, Integrity protection description, the transmitting UE shall: 1. Compute the output bit sequence from the DUIK, the message, and a UTC-based counter that are passed through the MIC computation function of Appendix A.2. 2. Take the 4 bytes of the function's output and set it as the value of the MIC for this message.
[0075] The receiving UE or ProSe function performs exactly the same procedure, but in addition performs a comparison of the calculated MIC with the received MIC.
[0076] In section 6.1.3.4.3.5, scrambling description, the transmitting UE does the following: 1. For the purposes of this scrambling calculation only, set the four LSBs of the UTC-based counter to zero. 2. Calculate a time hash bit sequence from DUSK and a UTC-based counter (modified as in step 1) that is passed through a keyed hash function. 3. XOR the time hash bit sequence with the entire discovery message being processed (including the MIC).
[0077] The receiving UE performs exactly the same procedure except that it applies to the received message it is processing.
[0078] In section 6.1.3.4.3.6, message-specific confidentiality description, the transmitting UE shall: 1. Calculate Key_calc_mask = (Encrypted_bits_mask XOR 0xFF···FF)||0xFFFFFFFF 2. Compute keystream = KDF(DUCK, UTC-based counter, (Key_calc_mask AND (Message || MIC))). 3. XOR(keystream AND Encrypted_bits_mask) into the message.
[0079] The receiving UE performs exactly the same procedure except that it applies to the received discovery message it is processing.
[0080] As will be described later, KDF in the above procedure stands for Key Derivation Function.
[0081] It is also proposed that the MIC calculation be defined as follows: [Table 1]
[0082] The calculation of the scrambling bits for discovery in this example is as per A.5. [Table 2]
[0083] In this example, the calculation of message specific confidentiality is similar to A.6 of TS 33.303. [Table 3]
[0084] The length of the message ||MIC is 0x1B = 16 + 11 = 27 bytes, which fits the fact that the MIC is 4 bytes and the length of the Key_calc_mask is 23 bytes, as defined in E.5.2.2.27.
[0085] As described in TS33.303, the contents in the Direct Communication Request (DCR) message exchanged after the Discovery message are not protected. To simplify these procedures and to enhance privacy protection, it is proposed to reuse DUCK or DUSK to protect the PRUK ID and RSC sent in the Direct Communication Request after the Discovery phase. In such a case, the Code Reception Security parameter can be used to protect the RSC and PRUK ID in the DCR message. Therefore, in this proposal, the remote UE should behave as follows: "- If the remote UE is provided with DUCK, 1. Message = RSC || form PRUK ID 2. Calculate Key_calc_mask = (Encrypted_bits_mask XOR 0xFF···FF)||0xFFFFFFFF 3. Calculate keystream = KDF(DUCK, UTC-based counter, (Key_calc_mask AND Message)) (see subsection 6.Y.2.3). 4. XOR(Keystream AND Encrypted_bits_mask) into the message.
[0086] - If the remote UE is provided with DUSK, 1. For the purposes of this scrambling calculation only, set the four LSBs of the UTC-based counter to zero. Calculate a time hash bit sequence from the Discovery User Scrambling Key (DUSK) and a UTC-based counter (modified as in step 1), which is passed through the keyed hash function described in 2.6.Y.2.4. 3. XOR the time hash bit sequence with the RSC and PRUK ID being processed.
[0087] The UE to network relay does the following to retrieve the RSC and PRUK IDs from the received DCR: - If the U2N relay UE is provided with DUCK, 1. Message = protected (RSC||PRUK ID) part in received DCR message. 2. Calculate Key_calc_mask = (Encrypted_bits_mask XOR 0xFF···FF) 3. Calculate keystream = KDF(DUCK, UTC-based counter, (Key_calc_mask AND (Message))) (see subsection 6.Y.2.3). 4. XOR(Keystream AND Encrypted_bits_mask) into the message.
[0088] - If DUSK is provided for the U2N relay, 1. For the purposes of this scrambling calculation only, set the four LSBs of the UTC-based counter to zero. Calculate a time hash bit sequence from the Discovery User Scrambling Key (DUSK) and a UTC-based counter (modified as in step 1), which is passed through the keyed hash function described in 2.6.Y.2.4. 3. XOR the time hash bit sequence with the scrambled parts of the RSC and PRUK IDs in the received DCR.
[0089] The discovery key is generated from the PDSK as described in TS33.303 v17.0.0A.8.
[0090] "When computing DUSK, DUCK, or DUIK from PSDK, the following parameters are used to form the input S to the KDF, which is described in Appendix B of TS 33.220[5]: - FC=0x4F - P0 = 0x00 if DUSK is derived, 0x01 if DUCK is derived, 0x02 if DUIK is derived - L0 = length of P0 (i.e. 0x00 0x01) - P1=algorithm ID - L1 = length of algorithm ID (i.e., 0x00 0x01)
[0091] The algorithm ID is set to 0x00. Other values may be defined in future releases.
[0092] The input key is a 256-bit PSDK.
[0093] For algorithm keys of length n bits, where n is less than or equal to 256, the least significant n bits of the 256 bits of the KDF output are used as the algorithm key."
[0094] The key derivation function (KDF) described in the above embodiment is defined in TS33.220 v17.0.0 in Appendix B.2. The KDF for an input bit string S with key K, i.e., KDF(K,S), is equivalent to HMAC-SHA-256(K,S), where SHA-256 is the hash function used in the HMAC construction. The bit string S is constructed from multiple parameters param1, param2,...,paramN, as described in TS33.220, which are concatenated with an assigned length, and includes a unique identifier FC for the specific use of the KDF. It should be understood that instead of denoting KDF(K,S), it may be denoted as KDF(K,param1,param2,...,paramN), where the bit string S is constructed from fields param1, param2,...,paramN.
[0095] The above various keys for integrity, confidentiality and scrambling (DUIK, DUCK and DUSK respectively) can be defined in combination as described in Annex G of TS33.303. More specifically, the various combinations are shown in the following table, which details the security provided and sample use cases for various possible security mechanism combinations for restricted discovery and public safety discovery. This table does not restrict the security mechanism combinations supported by the UE for restricted discovery or public safety discovery. [Table 4] TIFF2024537747000006.tif103170
[0096] The column "Sender UE" indicates the keys that the sender UE needs to know in case of restricted discovery or that need to be made known for use by the PKMF in case of public safety discovery. The column "Receiver" indicates the keys that need to be sent to the receiver UE for restricted discovery (except when ProSe function MIC check is required (DUIK is held in the ProSe function in the HPLMN of the receiver UE)) or that need to be made known for use by the PKMF. The column "Security Provided" details the security provided by this combination of security mechanisms. The last column gives example use cases where this combination of security mechanisms can be used.
[0097] DCR Protection Issues Regarding the solutions proposed to improve protection of DCR messages over the PC5 interface by reusing the methods of TS33.303, these proposed schemes create several problems, which the following embodiments of the present invention solve.
[0098] First (Problem 1.1), as described above, the encryption algorithm key_calc_mask is calculated as Key_calc_mask = (Encrypted_bits_mask XOR 0xFF···FF)||0xFFFFFFFF.
[0099] However, the concatenation of 0xFFFFFFFF is not necessary (because, unlike TS33.303, there is no MIC in protecting discovery messages). Note that the length of 0xFF...FF is not specified.
[0100] Also, (Problem 1.2) Encrypted_bits_mask is not defined, so we need to have a way to generate this mask.
[0101] Furthermore (problem 1.3), the messages are not integrity protected. In fact, the remote UE (i.e., the monitoring UE in discovery mode A or the discoverer UE in discovery mode B) may not have the proper DUIK since it may use a matching report. Therefore, there is no way to apply integrity protection using the currently proposed routines, or the current version of TS 33.303. Simply adding a MIC to these schemes would be inefficient.
[0102] A further problem is that previous proposals have shown that either DUSK or DUCK, which use different algorithms, can be used to protect the confidentiality of DCR messages, but this comes with some problems that need to be fixed.
[0103] First, the scrambling algorithm using DUSK calculates a pseudorandom number sequence that depends on DUSK and a UTC-based counter at a granularity of 16 seconds, and encrypts a message by performing an XOR operation with this pseudorandom number sequence. The encryption algorithm using DUCK calculates a pseudorandom number sequence that depends on DUCK, a UTC-based counter, and RSC at a granularity of 1 second, and encrypts a message by performing an XOR operation with this pseudorandom number sequence. The complexity of the solution increases because multiple algorithms can be used.
[0104] Secondly, if the remote UE and relay UE have both DUSK and DUCK, problems arise since it is not defined which key / algorithm is used.
[0105] A further problem is that a remote UE or relay UE may have multiple sets of discovery keys, each of which may be identified by an identifier, e.g., a PDSK ID, since DUSK, DUCK, and DUIK are derived from the PDSK as specified in TS 33.303 or Solution #37 of TR 33.847. As a result of having multiple discovery key sets, a relay UE may not know which key of which discovery key set to use to decrypt a DCR message.
[0106] An additional problem is related to the input in the generation of the pseudo-random sequence used for encryption, which is the RSC combined with DUCK: in practice, DUCK may be used in combination with multiple RSCs, so the relay UE does not directly know which RSC to use for the generation of the pseudo-random sequence used for decrypting the received message.
[0107] Issues related to security routines for TS33.303 discovery
[0108] Furthermore, a further problem occurs in the current version of TS33.303, which specifies the process for sending a message as follows: "Section 6.1.3.4.3.2 says that if a DUIK is received, then in step 2 a MIC is calculated (otherwise set to all zeros). Then in step 3, if a DUCK is received, message specific confidentiality is applied. Then in step 4 a MIC is appended. Then in step 5, if a DUSK is received the sum power is scrambled." However, this causes the following problem:
[0109] In one additional problem (Problem 2.1), the MIC is not encrypted, allowing a passive attacker to directly monitor whether the message integrity is protected, and in particular whether scrambling is used.
[0110] One additional issue (issue 2.2) is that even if the goal of TS33.303 is to avoid leaking information (e.g., whether a message is integrity protected or not) by using DUSK and the scrambling function, since the scrambling sequence only changes every 16 seconds, while the encryption sequence changes every second (because of the UTC-based counter) and the MIC also changes every second (because of the UTC-based counter), it is possible to observe whether the message is integrity protected or not by monitoring whether the last 4 bytes of the message broadcast by the UE change every second or every 16 seconds.
[0111] An additional problem (problem 2.3) is that the field Encrypted_bits_mask may be different for each device (or class of devices). If this is the case, it is possible to identify (and / or track) the device based on the encrypted_bits_mask field. This is because only the encrypted bits "change" once per second when a new encryption is applied (due to a new counter). Note that even with scrambling, tracking by an attacker is possible. This is possible because the encryption sequence changes every second, while the scrambling sequence is stable for 16 seconds. During this time, an attacker can determine the Encrypted_bits_mask field associated with the device. Each time a new scrambling sequence is applied, the attacker has 16 seconds to obtain the encrypted_bits_mask field and use it to identify / track the device.
[0112] One additional problem (problem 2.4), like problem 1.2, does not specify what the Encrypted_bits_mask is.
[0113] In one additional problem (problem 2.5), the scrambling sequence depends only on DUSK and a UTC counter that changes only every 16 seconds. DUSK may be shared by multiple devices. Thus, it is possible that 1) the same pseudo-random sequence is used by one device to scramble two different discovery messages, or 2) the same pseudo-random sequence is used by two or more devices to scramble two or more different discovery messages. If this happens, it is possible to obtain the XOR of the plaintext message by XORing the scrambled messages. This results in a loss of security.
[0114] Embodiments for improving protection of DCR messages Therefore, the objective of a first embodiment of the present invention is to design a method for generating the encrypted_bits_mask. In a first embodiment, the encrypted_bits_mask may be defined to set a bit to 1 if the bit should be encrypted and to 0 if the bit should not be encrypted. Using this definition, the processing of the message when sending can work with the following modifications:
[0115] Step 1 of TS33.303, section 6.1.3.4.3.3 requires descrambling, step 2 matches the unencrypted bits, step 3 removes confidentiality if a DUCK is received, step 4 performs a full match, and step 5 checks the MIC if it is a DUIK based on the discovery filter security parameters or via a match report if indicated in the discovery filter security parameters.
[0116] Such a confidentiality algorithm may be: 1. Calculate KCM = (EBM XOR 0xFF···FF) || 0xFFFFFFFF 2. Calculate KS=KDF(DUCK, UTC-based counter, (KCM AND (message || MIC))). 3.C=Message XOR (KS AND EBM)
[0117] For example, assume KS is 1010 1010 1010 1010 and EBM is 1111 1111 0000 0000. Then, the message XOR 1010 1010 0000 0000 if: Message=1111 1111 1111 1111=:0101 0101 1111 1111 Message=0000 0000 0000 0000=:1010 1010 0000 0000
[0118] Without this definition it is possible that the wrong parts of the message may be encrypted (which creates a security risk) and implementations may not interoperate. The proposal introduced above can be improved by defining: In the above encryption algorithm, key_calc_mask should be calculated as Key_calc_mask=(Encrypted_bits_mask XOR 0xFF···FF), where 0xFF···FF has the same length as the concatenation of PRUK_ID and RSC.
[0119] In a further embodiment, the concatenation of 0xFFFFFFFF is not necessary since the proposed solution for privacy protecting the DCR does not include a MIC. In fact, if 0xFFFFFFFF is concatenated, the following steps in the proposed algorithm: Keystream = KDF(DUCK, UTC-based counter, (Key_calc_mask AND message)) may not function interoperably because the key_calc_mask is 4 bytes longer than the message.
[0120] Alternatively, if the intent is to encrypt both the PRUK_ID and the RSC, the encryption routine may be defined as follows: 1. Message = RSC (Relay Service Code type of the service the user requires for relaying) || PRUK ID (Key identifier used for the PC5 interface) 2. Compute the keystream = KDF(DUCK, UTC-based counter, message). 3. Ciphertext = message XOR keystream.
[0121] More generally, in this embodiment, a method of operating a communication system is proposed, the method comprising: a. preparing a message by a first station including a combination of a relay service code indicating a type of service a user requires for relaying and a communication key or an index of a communication key to be used for communication with the relay station; b. a first station generating a keystream by applying a key derivation function to at least a confidentiality key and a freshness value; c. the first station encrypting the message using the keystream.
[0122] In another option, the keystream is computed as KDF(DUCK, a UTC-based counter), but the string S used in the KDF is the concatenation of the following parameters: FC=0xXX P0 = UTC-based counter L0 = length above (i.e. 0x00 0x04). P1=Message L1=PRUK_ID and length of RSC.
[0123] The keystream is the L LSBs of the output of the KDF, where L is equal to L1. This definition avoids the computation of the Key_calc_mask and simplifies the computation of the keystream values used for encryption.
[0124] Integrity protection is recommended when transmitting the DCR message in order to (1) prevent an attacker from modifying the encrypted content, (2) prevent an attacker from replaying the DCR message / PRUK_ID and RSC values at a later point in time, or (3) prevent an attacker from replaying the DCR message / PRUK_ID and RSC values to another relay UE.
[0125] If integrity protection is required, an integrity key is required to compute the MIC. However, unlike DUSK and DUCK, DUIK is not always available. There are multiple options to obtain a suitable integrity key to compute the MIC and strengthen the previously proposed schemes.
[0126] In the first option A), a key available to both the remote UE and the relay UE (e.g., DUCK or DUSK) is used as the master key in combination with the KDF to derive two keys: an integrity key and a confidentiality key.
[0127] In the second option B), the discovery key is strengthened by an additional key that is used for integrity protection of the DCR message. This additional key is denoted DUI_DCR_K.
[0128] In the third option C), the master key used to generate the existing discovery keys (DUIK, DUCK, DUSK) is also used to generate DUI_DCR_K using the KDF.
[0129] These options may use the 3GPP KDF defined in TS 33.220, if a KDF is applied.
[0130] According to this definition, the KDF takes as input a master key and a unique bit string S. For example, if DUCK is used as the master key, the bit string S used to generate the integrity key may contain a unique identifier FC associated with the purpose of the derived key (e.g. confidentiality protection of PRUK ID|RSC or integrity protection of PRUK ID|RSC), information linking the key usage to previously transmitted discovery messages (e.g. DUCK, the keystream used to protect discovery messages together with a UTC-based counter).
[0131] In option C), the DUI_DCR_K may be generated as per A.8 of TS33.303 using a new P0 value associated with the DUI_DCR_K, for example 0x03.
[0132] When a MIC for a DCR message is calculated, it makes sense to protect the PRUK_ID and RSC as well as other fields such as fields that determine the source or destination of the message. The MIC calculation may take as input a UTC-based counter to avoid replay attacks. The MIC calculation may also include a nonce previously sent by the relay UE during the discovery phase to achieve replay protection without the need for a time-based counter.
[0133] If the DCR message is confidentiality and integrity protected, the security routine is as follows. [Table 5]
[0134] In step 2, a MIC calculation routine similar to that in A.2 of TS33.303 can be used, but here DUI_DCR_K is used instead of DUIK. The values of P0 and P1 should indicate that this is a DCR message containing PRUK_ID and RSC. Note that the MIC may also be calculated including other parts of the DCR message that need to be protected, e.g. the ID of the addressed relay UE. This prevents an attacker from replaying the message to other UEs in the vicinity of the relay.
[0135] In step 3, it is assumed that both the message and the MIC are encrypted. If only the message is encrypted and not the MIC, this can be indicated by a mask or bit concatenation.
[0136] In step 4, it is assumed that both the message and the MIC are encrypted. If the MIC is not encrypted, the XOR should only be performed on the message part.
[0137] Note that even if the RSC and PRUK_ID are not integrity protected with a MIC, some integrity protection may still be possible, since if an attacker modifies the encrypted message (e.g. by flipping bits in the encrypted PRUK_ID or RSC fields), this would result in a different PRUK_ID and RSC. The relay UE may not be able to cope with such a modified RSC. Therefore, if no MIC is available / computed as in the previous proposal, it is recommended that the relay UE decrypts the encrypted fields and checks if the received fields are as expected (e.g. RSC value negotiated also in the previous discovery phase is present) or as supported (e.g. supported RSC values).
[0138] In a further embodiment that addresses the issue of additional complexity due to the use of different algorithms, called encryption or scrambling algorithms, DUSK or DUCK or a combination of these are used to protect the confidentiality of the DCR message using the same algorithm. In particular, the algorithm may be, for example, the encryption algorithm of TR33.847.
[0139] Further embodiments address the issue of uncertainty as to which key / algorithm to use when a device has multiple configurations with multiple keys.
[0140] A further embodiment addressing this problem consists in selecting the key to use according to a predefined priority order, e.g., first try DUCK if available, then try DUSK if available, etc. This can be done, for example, using respective encryption and scrambling algorithms as in TR33.847, or using the selected keys in a single algorithm as proposed in the above embodiment.
[0141] Another approach consists in applying a combination of both keys, if both keys are available, which can be done for example by (i) first deriving a key that depends on both keys and then using the resulting key in an encryption algorithm, or (ii) using both DUSK and DUCK to generate a pseudorandom sequence, with both keys being used as inputs to a KDF.
[0142] Another approach is for the remote UE to select DUCK or DUSK and signal it to the relay UE, for example by including a bit set to 0 (DUSK) or 1 (DUCK).
[0143] Another approach is for the relay UE to attempt to decrypt the DCR message using both keys.
[0144] Additional embodiments to address the problem that there may be multiple sets of discovery keys are as follows.
[0145] First, the remote UE may add a field within the DCR message that enables the relay UE to identify the correct set of discovery keys. This field may be the PDSK ID.
[0146] Second, similar to the above, since exchanging the entire PDSK ID may cause privacy issues, the remote UE may transmit a subset of the PDSK ID, for example, the least significant bits that enable the relay UE to obtain the correct set.
[0147] Third, the relay UE may track the last - delivered discovery messages and the set of keys used to protect them. In particular, the relay UE can hold a list of keys in FIFO mode, that is, it can insert and use them according to the last use of the keys. Each time a different discovery DUSK key or DUCK key is used in the discovery phase, that key is placed at the head of the list and the existing keys are pushed down within the list. When the relay UE receives a DCR message, the relay UE attempts to decrypt from the discovery key at the head of the previous list.
[0148] The problem that DUCK is used in combination with multiple RSCs can be solved by an embodiment in which the remote UE can add a field to the DCR message that enables the relay UE to identify the correct RSC. This field may be a subset of the RSCs, for example, the least significant bits, or an index indicating which RSC is used. For example, if DUCK is associated with three RSCs, namely RSC1, RSC2, and RSC3, and RSC1 < RSC2 < RSC3, then RSCi can be linked to index i, where i = 1, 2, 3.
[0149] The problem of DUCK being used in combination with multiple RSCs can be solved by an additional embodiment where the relay UE can keep track of the last delivered discovery message and the associated RSC. In particular, the relay UE can keep a list of RSCs in FIFO mode, i.e. insert and use according to the last use of the RSC. Each time a different RSC is announced in the discovery phase, it is placed at the top of the list and existing RSCs are pushed down in the list. When the relay UE receives a DCR message, it tries to decode from the RSC at the top of the previous list.
[0150] Similar to TS33.303, the decryption algorithm performs the inverse of the operations performed in encryption, i.e., calculates the same pseudo-random number sequence and then obtains the plaintext by XORing the received ciphertext with the calculated pseudo-random number sequence.
[0151] Based on the above embodiment, a specific implementation of the procedure for protecting the DCR message between the remote UE and the relay UE may be as follows.
[0152] In this example, the remote UE does the following: [Table 6]
[0153] The remote UE can then send the ciphertext as part of a DCR message to a relay from the UE to the network.
[0154] On the receiving side, the UE-to-network relay may perform the following to obtain the protected fields (eg, RSC and PRUK ID) of the received DCR message. [Table 7]
[0155] When computing the MIC, the following parameters may be used to form the input S to the KDF described in Annex B of TS 33.220: - FC=0xYY. - P0 = message type. - L0 = the length above (i.e. 0x00 0x01). - P1 = Message fields that require integrity protection. - L1 = the length above. - P2 = UTC-based counter. - L2 = the length above (i.e. 0x00 0x04).
[0156] The input key for the MIC calculation may be the 256-bit key selected in step 1 or the integrity key derived as described in the previous embodiment. The MIC is set to the least significant x bits of the output of the KDF, where x may be 32 bits, for example. The FC value used in the integrity (and confidentiality) KDF for DCR message protection must be different from the FC value used for discovery message protection. The message type identifier must identify the message being exchanged. It may be, for example, similar to the ProSe PC5 that conveys the message type in TS24.554 clause 11.3.1. The message fields (P1) and lengths (L1) that require integrity protection are at least the RSC and PRUK ID, but other fields (e.g. ProSe identifier, source user information, UE security capabilities) may also require integrity protection. Parameters exchanged in the DCR message may include PROSE DIRECT LINK ESTABLISHMENT REQUEST message ID, sequence number, ProSe identifier, source user information, UE security capability, UE PC5 unicast signaling security policy, key establishment information container, Nonce_1, MSB of KNRP session ID, target user information, KNRP ID, relay service code.
[0157] When computing message-specific confidentiality, the following parameters may be used, which form the input S to the KDF: - FC=0xXX - P0 = UTC-based counter - L0 = the length above (i.e. 0x00 0x04). - P1=RSC - L1 = the length above.
[0158] The input key may be the 256-bit key selected in step 1. The message-specific confidentiality keystream is set to the L least significant bits of the KDF output, where L is the length of the fields that require protection (RSC and PRUK ID, as above) and the MIC. Clause 10.3.1.1 of TS24.554 describes the PROSE DIRECT LINK ESTABLISHMENT REQUEST, which requests the exchange of several fields that may require protection (e.g., user information) in addition to the PRUK ID and RSC. If the fields are longer than 32 bytes in length, encryption may rely on a keystream that requires multiple calls to the KDF. This may be done by including a counter as an additional input in the definition of the S-bit string and incrementing the counter to generate additional bytes of the keystream.
[0159] Note that in some cases, RSC may not be available, for example when this technique is applied to a non-UE-to-network relay use case. In such a case, RSC cannot be used as an input parameter of S in the keystream calculation in the above procedure. In this case, this field may be omitted, i.e., keystream=KDFDCR_Confidentiality(K, UTC-based counter). Alternatively, RSC may be replaced by other input parameters, for example identifying the type of application discovered.
[0160] Note that step 1 of procedure 1 above shows how to determine which key / algorithm to use when both DUCK and DUSK are configured in the remote UE and relay UE.
[0161] The above procedure shows how the same confidentiality approach can be applied regardless of which keys were set during discovery. Having slightly different flavors increases the code complexity. Also, in contrast to the protection of discovery messages, protection of DCR message fields does not require this, whereas protection of discovery messages can use different routines for confidentiality and scrambling to meet the needs of different applications.
[0162] Note that in the above procedure, MIC is used to check the integrity of the exchanged messages. If integrity checking with MIC is not needed, a simplified version where only the integrity of the RSC is checked is as follows: The remote UE performs the following: [Table 8]
[0163] The UE to network relay performs the following to obtain the protected fields (eg, RSC and PRUK ID) of the received DCR message: [Table 9]
[0164] It should be noted that in the above algorithm, the keystream may be generated using the NEA algorithm, and the MIC may be generated using the NIA algorithm.
[0165] In particular, the NEA and NIA algorithms used to protect the DCR message may be as follows: Agreed upon during discovery, or During discovery parameter configuration, pre-configured during UE configuration, or -Indicated within the DCR message itself.
[0166] If the 128-NEA algorithm is used, the NEA algorithm may be set by using 128 bits of DUCK (or DUSK) as the input key for the NEA algorithm. The 32-bit count in the NEA algorithm may be set to a UTC-based counter, BEARER may be set to a predefined binary value (e.g., BEARER=0000), and DIRECTION may be set to a predefined value (e.g., DIRECTION=0). To ensure that the keystream is different from the keystream used for protecting discovery messages, especially discovery messages with metadata that may also rely on the NEA algorithm, some of the above parameters may need to have different settings, for example, a first BEARER value should be used if the key is used to protect discovery messages and a second, different BEARER value should be used if the key is used to protect DCR messages.
[0167] Alternatively, the key in the NEA algorithm may be generated by applying the KDF to the key K selected in step 1 of the above procedure and using different FC values for protecting the discovery and DCR messages. This ensures that two different keys are used to protect the DCR message and the discovery message. The KDF may also have as additional input a UTC-based counter or other unprotected fields in the DCR message.
[0168] The NIA algorithm may be configured similarly. If a different integrity key is derived using the KDF, then a different FC value is also required.
[0169] It should be noted that the above procedure is not only for improving security during PC5 link setup in UE to network relay, but can also be applied to other types of PC5 setup, e.g. UE to UE relay or UE to UE relay.
[0170] For example, regarding the establishment of a (secure) PC5 communication link in a UE-to-UE relay scenario, at discovery time, the UE, e.g., source UE, sends a Direct Communication Request (DCR) message containing certain parameters such as the RSC, the PRUK ID, or a first nonce used for subsequent key derivation. This information may be exchanged in the clear, unless a solution such as one of the above embodiments is applied. This procedure and necessity is further indicated by a source UE 420 wanting to establish a secure communication link with a target UE 430 via a UE-to-UE relay 410. The CN, or one or more network functions in the CN 400, performs the setup. In a first step, each remote UE (source UE and target UE) and UE-to-UE relay obtains discovery parameters and a Prose Key Management Function (PKMF) address from the 5G DDNMF and discovery security material from the PKMF. Furthermore, security material for end-to-end security setup by the PKMF may be provided to the remote UE. For example, security material for end-to-end security setup includes a Prose Service Code (PSC) and associated keys. In the next step, the remote UE 420 (i) discovers the U2U relay, (ii) sends a direct communication request including the RSC (Relay Service Code), PRUK ID, and Nonce1, and (iii) performs the discovery procedure and PC5 unicast link setup procedure with the UE-to-UE relay 410 by performing authentication and key agreement between the remote UE 420 and the UE-to-UE relay 410, which results in the derivation of the key KNRP as a result of successful authentication. The UE-to-UE relay 410 then generates Nonce2 and uses KNRP, Nonce1, and Nonce2 to derive KNRP-SESS. The UE-to-UE relay 410 sends a contact security mode command including Nonce2 to the remote UE 420. The direct security mode command is integrity protected based on KNRP-SESS.The remote UE 410 then derives KNRP-SESS using KNRP, Nonce1, and Nonce2 to check the integrity of the direct security mode command. If the verification is successful, the remote UE 420 sends a direct security mode complete to the UE-to-UE relay 410. To protect certain privacy sensitive fields or all fields in the DCR message exchange during the UE-to-UE relay, one of the keys in the discovery parameters needs to be selected by the sending and receiving devices, e.g., as detailed in the exemplary procedure above. When DUCK is available, it is used to protect privacy-sensitive fields. If DUCK is not available and DUSK is available, DUSK is used to protect them, otherwise · If neither DUCK nor DUSK is available, privacy-sensitive fields or any fields in the DCR message MUST NOT be protected.
[0171] Once a key is selected (if selected), the sending device can protect the DCR message and send the protected DCR message. Once a key is selected (if selected), the receiving device can receive the protected DCR message and process it securely (decrypt / integrity verify). Note that if the source and target UEs have a common set of discovery keys that are unknown to the relay, this set of keys may be preferred.
[0172] Improved security routines for discovery messages in TS33.303 In a set of embodiments that improve the security routines for discovery messages of TS33.303, in approach 1, the logic for obtaining the key stream (KS) used for encryption is modified according to one of the following options:
[0173] In the first option 1, we compute KCM = (EBM XOR 0xFF...FF), where 0xFF...FF has a length of 27 octets. Note that EBM XOR 0xFF...FF = BITWISENOTS (EBM) = KCM. Then we compute KS = KDF(DUCK, UTC-based counter, (KCM AND (message || MIC))), where KS is the last 27 octets of the KDF output. Here EBM is the encryption_bit_mask, KCM is the key_calc_mask, and KS is the keystream. Nevertheless, the problem with this option is that the MIC is ANDed with the KCM, and since the last 4 bytes of EBM are all 1s, the last 4 bytes of the KCM are set to 0, thus ignoring the contents of the MIC in the computation of KS.
[0174] In the second option, option 2, which builds on option 1, the KCM is given directly, i.e., EBM is not required. This option has the same problems as option 1.
[0175] In the third option 3, which addresses the issues of options 1 and 2, KS=KDF(DUCK,UTC-based counter,EBM,message||MIC) is computed. Nevertheless, the problem with this approach is that the total input size to the KDF is 32+4+27+27 bytes, i.e. more than 2*32 bytes, so the computation of the KDF requires more CPU resources.
[0176] In the fourth option 4, the KS is computed as KDF(DUCK, UTC-based counter, EBM, MIC). In this approach, the MIC is used as a fingerprint of the message being sent. The EBM is included in the calculation of the KS. This way, both the encryption mask and the message contents themselves determine the KS. The total message length is less than 2*32 bytes, so CPU needs are no worse than they are now. Note that if the EBM is known or fixed, the EBM may not be necessary.
[0177] In that case, the procedure for sending a message may be modified as follows. Step 1: Calculate the MIC from the message and the DUIK. The MIC is calculated, for example, as described in TS 33.303. Step 2: Add the MIC to the message you are sending. M=M||MIC Step 3: Calculate KS as above. Step 4: Create the ciphertext as C = M XOR (KS AND EBM). Step 5: Scramble C
[0178] The above means that the EBM also covers the MIC, so the MIC can be encrypted, which is not allowed in TS33.303.
[0179] Note that EBM is preferably 0xFF...FF (27 octets), i.e. all bits are encrypted. In this case DUSK is not needed. This also improves privacy since a device cannot track whether integrity protection is used (as it cannot infer the (MIC)) by monitoring Encrypted_bits_mask. It also improves performance since only one call to the KDF is needed to protect the confidentiality of the message. In this case this pseudorandom sequence is calculated, for example, as KS=KDF(DUCK,UTC-based counter,EBM,MIC) and step 4 to calculate the ciphertext is simply C=M XOR KS. Step 5 is not needed.
[0180] In an embodiment that improves the security routines for discovery messages in TS33.303, the scrambling sequence is calculated using a UTC-based counter that changes more frequently than once every 16 seconds, for example every 8 seconds, every 4 seconds, every 2 seconds, every second, etc. This limits the amount of information leaked by different periods of the UTC-based counters used in scrambling and confidentiality / integrity.
[0181] In an embodiment that improves the security routines of TS33.303 discovery messages, instead of appending MIC=0x00000000 when integrity is not applied (e.g., when the DUIK is not present), a random-looking value should be added. This random-looking value can be generated using a pseudorandom function from an initial random value. This ensures that an attacker cannot determine whether a UE is using integrity protection or not by observing the broadcasted discovery messages.
[0182] There are a set of embodiments that improve security routines for discovery messages.
[0183] In TS33.303, the EBM is 27 bytes long instead of just 23. In that case, the KS can be calculated as in TS33.303, but the KCM is calculated as (EBM[0:23] XOR 0xFF···FF)||0xFFFFFFFF, where EBM[0:23] indicates that only the first 23 bytes of the EBM are used when XORed with 0xFF···FF, which is also 23 bytes long. The output length of the KS is 4 bytes longer than in TS33.303, i.e. 27 bytes long, so the MIC can also be encrypted.
[0184] In that case, the procedure for sending a message is modified as follows: Step 1: Calculate the MIC from the message and the DUIK. The MIC is calculated, for example, as described in TS 33.303. Step 2: Add the MIC to the message you are sending. M=M||MIC Step 3: Calculate KS as above. Step 4: Create the ciphertext as C = M XOR (KS AND (EBM || 0xFFFFFFFF)). Step 5: Scramble C
[0185] Note that in step 4, the EBM is 23 bytes long, similar to TS33.303, and 0xFFFFFFFF is appended to encrypt the MIC as well. Note that step 3 may be performed before step 2.
[0186] In a variant of the exemplary embodiment based on the previous proposal, it may be suggested that the FC value used to generate the pseudo-random scrambling sequence when protecting the PRUK ID and RSC in the DCR message may be different from the FC value used to generate the pseudo-random scrambling sequence protecting the discovery message. This prevents that two different plaintext messages can be protected (XOR-scrambled) by the same pseudo-random scrambling sequence. The same applies to the use of the FC value used in the encryption algorithm, but in this case this is less important since other input parameters of the KDF are different, in particular the message lengths.
[0187] Improved security routines for protecting long discovery messages in TS33.303 In the above embodiment, we have described a way to protect the confidentiality of the DCR message even when the length of the fields requiring protection is greater than 32 bytes, which is the output size of the KDF used. This is done by encrypting (or scrambling) the message using a keystream obtained from multiple calls to the KDF, rather than from a single KDF call. This can be done by including at least one counter (block counter) as an additional input in the definition of the S-bit string used as input in the KDF, and incrementing the counter to generate additional bytes of the keystream. It should be noted that a nonce may be used instead of a counter. A nonce is a randomly generated number that is used only once. For example, if the message has a length of N*B bytes, where B is the output size of the KDF, then N calls to the KDF are requested, each with a different counter value (e.g., in the range 0 to N-1). Such a solution is also applicable to discovery messages that may have a length greater than 32 bytes. In particular, in Rel-17 U2N sidelink relay, the RLC UM mode may be used for sidelink discovery messages, and the maximum size of the discovery message may be, for example, 9000 bytes. It should be noted that the security routines for protecting discovery messages, as mentioned above, only work for small, fixed-size discovery messages. Discovery messages of larger size may arise due to new fields or exchange of application layer metadata information. RLC fragmentation may occur already at 2976 bits = 372 bytes. In this case, the discovery message may be longer than 32 bytes and multiple calls to the KDF may be required. In this case, the size of the discovery message may be longer than 2976 bits and multiple fragments may occur.Therefore, to use the KDF for encryption (with DUCK) and / or scrambling (with DUSK) at the PDCP layer, an additional counter, the block counter, must be included to obtain the pseudorandom sequence from the KDF and DUCK or DUSK. If the protection is at the PDCP layer and the discovery message is 128 bytes long, a total of four KDF calls are needed to obtain the keystream for encrypting the discovery message, with the following counter values: [Table 10]
[0188] If the protection is done at the RLC layer, then for example two additional input counters need to be included to obtain the pseudo-random sequence from the KDF and DUCK or DUSK. The first input counter is the fragment counter C_F and the second input counter is the block counter C_b. The fragment counter identifies the fragment within the entire discovery message. The block counter identifies the block of b (e.g. b=32 bytes) within the fragment. For example, if the fragment is 64 bytes long, the discovery message is 128 bytes long, and the output of the KDF is 32 bytes, then there are two 64-byte fragments of the discovery message. The fragments of the discovery message include a fragment counter. Each fragment contains two 32-byte blocks that can be (implicitly) linked to a block counter. In this example, the fragment counter value and the block counter value can be "0000" and "0001", and a hexadecimal representation and a 2-byte long counter are assumed. If protection is done at the RLC layer, a total of 2x2 KDF invocations are required to obtain the keystream for encrypting the discovery message, with the following counter values: [Table 11]
[0189] Note that in this last case, we can combine both counters into one value as follows: Fragment_counter*Maximum_number_blocks_in_a_fragment+block_counter
[0190] Taking into account one or more of the counters above, the input to the KDF needs to be changed compared to TS33.303.
[0191] When DUSK is used, the call to the KDF must include information from at least one counter, for example: Time hash bit sequence = KDF(DUSK, UTC-based counter, block counter) or Time hash bit sequence = KDF(DUSK, UTC-based counter, fragment counter, block counter)
[0192] Note above that the UE may obtain the fragment counter directly from the received message, i.e. each fragment must contain a fragment counter and this value must not be scrambled. The block counter should start at a predefined value and be incremented, e.g. by 1, for each additional call to the KDF.
[0193] Note that if the fragment counter and / or block counter are not used as input to generate the time hash bit sequence, multiple blocks will be scrambled with the same time hash bit sequence, and therefore the XOR of the plaintext block can be obtained by XORing two scrambled blocks together.
[0194] When DUCK is used, the call to the KDF looks like this: it includes information from at least one counter. keystream = KDF(DUCK,UTC-based-counter.block-counter,(Key_calc_mask AND (Message||MIC))).
[0195] It is noted above that information regarding the fragment counter may be included in the message itself.
[0196] Fragmentation may also suggest how integrity protection may be performed. First, a MIC may be required for each discovery message to ensure that an attacker cannot mix fragments of different discovery messages. This overall MIC must be included in at least one of the fragments of the discovery message, for example the last one. This MIC may be calculated as described in 6.1.3.4.3.4 of TS33.303, where the bit string S may also include the number of fragments in the message, and the P1 field points to the entire message content or to a value that depends on all the contents of the message (for example its hash, or a concatenation of multiple hashes / MICs of multiple parts of the message). Such a MIC may be obtained if the discovery message is protected at the PDCP layer. Second, a per-fragment MIC may still be required to ensure that the fragments are not modified and can be processed as they arrived. The calculation of this MIC should only take into account the input information from the fragment to which the MIC belongs, i.e. it should be done as described in 6.1.3.4.3.4 of TS 33.303, where the bit string S also contains the fragment counter and the P1 field points to the contents of that fragment only.
[0197] Overall, the process in TS33.303 clause 6.1.3.4.3.2 needs to be updated to take into account that 5G discovery messages are longer than LTE. In particular, steps 3 and 5 require encrypting and scrambling the discovery message using a pseudorandom sequence obtained by calling the KDF at least once, and possibly multiple times, and using a block counter with a different value for each call to the KDF (e.g., an incrementing block counter) as one of the inputs to the KDF. The number of KDF calls to protect the discovery message is CEIL(message_length / KDF_output size). This approach is applicable for 5G operation, for example as specified in TS33.503. CEIL refers to a ceiling function, but may also refer to a quantization function (which can use quantization steps > 1).
[0198] If some fields (e.g., metadata) in the discovery message do not need to be secured or if securing some fields is up to the application, only a part of the discovery message needs to be secured according to TS33.303 or the above embodiment. In one option, all contents of the discovery message may be fully secured, including metadata as well as existing fields such as source layer 2 ID, destination layer 2 ID, relay service code, announcer information, or additional parameters such as NCGI or TAI. This is possible because the entire message can be sent to the MIC generation procedure of TS33.303 clause 6.1.3.4.3.2. However, only certain fields may be confidentiality protected. In particular, the length of the field that needs to be encrypted may be less than 32 bytes, and therefore one KDF call may be required. The main difference is that in line 3 of clause 6.1.3.4.3.2, confidentiality is added only to a part of the message, and the fields that need confidentiality protection must be within 32 consecutive bytes.
[0199] An alternative embodiment to using a key derivation function to obtain a pseudo-random sequence greater than 32 bytes long is to apply one of the standard 5G confidentiality algorithms (e.g., 128-NEA1, 128-NEA2, 128-NEA3) and integrity algorithms (e.g., 128-NIA1, 128-NIA2, 128-NIA3) described in TS 33.401 in protecting the discovery message.
[0200] A key requirement for this is that the sending device (e.g., the announcing UE) includes a field in the discovery message indicating the security algorithms used to encrypt and / or integrity protect the contents of the discovery message. This allows the receiving UE (e.g., the monitoring UE) to select the appropriate algorithms to be used for decryption / integrity verification of the received message. In discovery model B, the algorithms supported by the sending UE may be included in the initial message. Upon receiving the message, the receiving UE can use the received supported algorithms to determine the encryption and / or integrity algorithms to be used to protect the response. The response may include the selected algorithms so that the receiving UE can decrypt / integrity verify them. The field containing the supported algorithms should not be encrypted, since otherwise the receiver would not know which algorithms to use.
[0201] Alternatively, if multiple encryption and / or integrity algorithms may be supported and used by the transmitting UE and no field is added to the discovery message to identify which particular encryption and / or integrity algorithm is used, the transmitting UE (e.g., the announcing UE) selects an appropriate encryption and / or integrity algorithm, encrypts and / or integrity protects the discovery message, and transmits the protected discovery message. Upon receiving the protected discovery message, the receiving UE (e.g., the monitoring UE) decrypts the message and verifies the integrity for all combinations of supported encryption and / or integrity algorithms. The receiving UE first applies the decryption algorithm and then attempts to check the integrity using all supported integrity algorithms. For example, the receiving UE first decrypts with 128-NEA1, then checks the integrity with 128-NIA1, 128-NIA2, and 128-NIA3. Once that is done, the UE decrypts using 128-NEA2 and checks the integrity with 128-NIA1, 128-NIA2, 128-NIA3, etc. If the MIC verification is successful the receiving UE stops.
[0202] The handling of long discovery messages impacts message processing in both the transmitting and receiving UEs compared to clauses 6.1.3.4.3.2 and 6.1.3.4.3.3 of TS33.303.
[0203] In such an implementation, a UE sending a discovery message may receive code transmission security parameters from the ProSe function to indicate how to protect the message (as described in the security flow). The code transmission security parameters may include DUSK and may include DUIK. The code transmission security parameters may include both DUCK and Encrypted_bits_mask. The UE sending a discovery message performs the following steps: 1. Form a discovery message (e.g., add a suffix if only a prefix is assigned). 2. If a DUIK is provided, calculate the MIC; otherwise, set the MIC to all zeros. 3. If a DUCK is received, add message specific confidentiality to the message. 4. Attach the MIC to the output of step 3. 5. If DUSK is received, add scrambling to the output of step 4.
[0204] Alternatively, to ensure that the MIC is encrypted the following is done: 1. Form a discovery message (e.g., add a suffix if only a prefix is assigned). 2. If a DUIK is provided, calculate the MIC; otherwise, set the MIC to all zeros. 3. Attach the MIC to the output of step 1. 4. If a DUCK is received, add message specific confidentiality to the message. 5. If DUSK is received, add scrambling to the output of step 4.
[0205] In step 1, the main difference from TS 33.303 is that the length of the messages is not fixed, so it may be necessary to include a field in the message indicating the message length or whether it contains application specific fields whose length depends on the application.
[0206] An option to achieve this is to always include in every discovery message a message length that corresponds to the sum of the fixed (always present) and optional fields of the discovery message. For example, if a message includes the fixed fields RSC, ProSe Relay UE ID, and Announcer Information, which are 24, 24, and 48 bits long, respectively, and the metadata, which is 256 bits long, there is a field indicating the total length of 42 bytes. Another option is to include a bit mask after the fixed (always present) fields, indicating the presence of optional fields. For example, if there are x optional fields, a mask of x bits can be included to indicate their presence. For example, if there is a mask with a value of 1000, the first bit that is 1 indicates the presence of the first optional field of the 4 possible optional fields. Thus, the receiving device knows that an additional field, e.g. with metadata, is present. This optional field may be present after the fixed fields. The first bytes of each optional field, e.g. the metadata field, must include a length in this case, e.g. 32 bytes in the above example. Another major difference in the steps related to message-specific confidentiality and scrambling is that protecting discovery messages requires multiple calls to the KDF.
[0207] For processing in the receiving UE, the code reception security parameter received from the ProSe function (as described in the security flow) is used to indicate to the UE how to protect the received discovery message. The code reception security parameter may include DUSK, and may either include DUIK, or an indication of whether or not a match report should be used for the MIC check. In general, the match report option is not allowed for ProSe query codes. The code reception security parameter may also include both DUCK and the corresponding Encrypted_bits_mask.
[0208] Therefore, a UE receiving a discovery message may perform the following steps. 1. If DUSK is received, descramble (similar to step 5 in the transmitting UE).
[0209] Note that if the total message length is included, the UE can use this input value to allocate buffers required, for example, for computing the MIC or for determining the length of the scrambling / encrypting pseudorandom sequence. The length value may be obtained after descrambling the first part of the message, if the length field is present. If the message length is not directly available, the length of the input for computing the MIC, or the length required for scrambling, is calculated step-by-step by accessing the various optional fields and extracting the length of each field from each field.
[0210] 2. Check if the bits of the unencrypted message match using message specific confidentiality. If they don't match, abort.
[0211] Note that some bits for which a match is indicated by the discovery filter may be encrypted with message specific confidentiality at this stage. The UE may search for a match on other bits after this step to minimize the amount of processing performed before finding a match.
[0212] Note that a match may only be needed on the first part of the message (e.g., the first 32 bytes of the message), so a single call to the KDF is required. If a match is found, the receiving UE can read the length of the discovery message (if a length field is available) and descramble the remainder of the message. Alternatively, the receiving UE may check the mask for the presence of optional additional fields, e.g., metadata fields. In that case, the receiving UE descrambles the first byte of the optional field to extract the field length, and then performs descrambling.
[0213] 3. If a DUCK is received, release the message specific confidentiality (similar to step 3 in the sending UE).
[0214] If 4.3 finds a match only in the unencrypted bits, perform a full match. If there is no match, abort.
[0215] 5. If a MIC check is required, check the MIC directly (if a DUIK is given in the discovery filter security parameters) or via a match report if indicated in the discovery filter security parameters.
[0216] Integrity protection is similar to section 6.1.3.4.3.4 of TS33.303.
[0217] Therefore, the transmitting UE may perform the following: 1. Calculate the output bit sequence from the DUIK, the message, and a UTC-based counter that are passed through the MIC calculation function of Appendix A.2 of TS 33.303. 2. Take n bytes (e.g., n=4) of the output of the function and set it as the value of the MIC for this message.
[0218] The receiving UE or ProSe function performs exactly the same procedure, but in addition performs a comparison of the calculated MIC with the received MIC.
[0219] The scrambling protection is similar to TS 33.303, clause 6.1.3.4.3.5, but with modifications to allow for longer messages.
[0220] In such an example, the transmitting UE performs the following: 1. For the purposes of this scrambling calculation only, set the four LSBs of the UTC-based counter to zero. 2. Calculate a time hash bit sequence from DUSK and a UTC-based counter (modified as in step 1) that is passed through a keyed hash function. a.TimeHashBitSequence="" Regarding bi=a~(a+FLOOR((L+4) / 32)), time hash bit sequence = time hash bit sequence || KDF(DUSK,UTC-based counter,i) c.TimeHashBitSequence = TimeHashBitSequence || LSB(KDF(DUSK,UTCBasedCounter,i),8*(L+4-32*FLOOR((L+4) / 32))) 3. XOR the time hash bit sequence with the entire discovery message being processed (including the MIC).
[0221] The receiving UE can perform exactly the same procedure, except that it applies to the received message being processed. In the above, the value "a" can be any initial index value, LSB means least significant bit, and FLOOR(x) returns the largest integer less than or equal to x.
[0222] In this embodiment, message specific confidentiality protection is similar to section 6.1.3.4.3.6 of TS 33.303, but modified to allow for longer messages.
[0223] The transmitting UE does the following: 1. Calculate Key_calc_mask = (Encrypted_bits_mask XOR 0xFF···FF)||0xFFFFFFFF 2. Use the KDF to get the keystream as follows: a.keystream="" b,H=(Key_calc_mask AND (message||MIC)), or Hash((Key_calc_mask AND (message||MIC))) Regarding ci=a~(a+FLOOR(L / 32)), i. keystream = keystream || KDF(DUCK, UTC-based counter, i, H). d. keystream = keystream || LSB(KDF(DUCK,UTC-based counter,i,H),8*(L-32*FLOOR(L / 32))) 3. XOR(Keystream AND Encrypted_bits_mask) into the message.
[0224] The receiving UE performs the same corresponding procedures as those applied to the received discovery message being processed.
[0225] Above, in step 2.b., H may refer to either (Key_calc_mask AND (message || MIC)), or a function of this value (e.g., its hash), or a function of a portion of the input (e.g., hash(Key_calc_mask || MIC). The main purpose is to compress the potentially long message into a short fingerprint that can be used in each KDF invocation in step 2.ci, increasing efficiency.
[0226] The above algorithm is complemented by modifications to the definition of the input to the KDF used to generate the keystream and the time hash bit sequence. These modifications are required in the definitions present in appendices A.5 and A.6 of TS 33.303.
[0227] When computing the scrambling bit sequence for discovery (related to A.5 of TS 33.303), the following parameters are used to form the input S to each KDF call described in Annex B of TS 33.220: - FC = unique identifier. - P0 = UTC-based counter for scrambling associated with the discovery slot (see subsection 6.1.3.4.3.5). - L0 = the length above (i.e. 0x00 0x04). - P1 = message fragment index. - L1 = the length above (i.e. 0x00 0x02).
[0228] The input key is 256-bit DUSK.
[0229] The length of L1 is 2, the minimum length required to protect up to 9000 bytes. P1 refers to a 32-byte fragment or block in the discovery message. A value of 32 is used because a 32-bit KDF output is assumed as in TS33.220. The length will be adjusted if a different KDF is used.
[0230] For a discovery message of length L, a total of CEIL((L+LMIC) / 32) KDF invocations are required, each with a different P1 value, where L+LMIC is used, where L refers to the length of the discovery message and LMIC refers to the length of the scrambled MIC. CEIL(x) returns the smallest integer greater than or equal to x.
[0231] The scrambling bit sequence is set to the concatenation of the entire KDF output of the first FLOOR((L+LMIC) / 32) KDF invocations and the R=8(L+LMIC-32*FLOOR((L+LMIC) / 32)) least significant bits of the output of the last KDF invocation. Instead of the LSBs, any subset of the R bits may be selected. FLOOR(x) returns the largest integer less than or equal to x.
[0232] When computing the message-specific confidentiality keystream for discovery (related to A.6 of TS 33.303), the following parameters are used to form the input S to each KDF invocation described in Appendix B of TS 33.220[5]: - FC=0x4D - P0 = UTC-based counter associated with the discovery slot (see Section 6.1.3.4.3.6). - L0 = the length above (i.e. 0x00 0x04). - P1 = message fragment index. - L1 = the length above (i.e. 0x00 0x02). - P2=(Key_calc_mask AND (Message||MIC)) (see subsection 6.1.3.4.3.6) - L2 = the length above (i.e., 0x00 0x1B).
[0233] The input key is 256-bit DUCK.
[0234] For a discovery message of length L, a total of CEIL(L / 32) KDF invocations are required, each with a different P1 value. Note that if the MIC needs to be encrypted, the LMIC must also be included. CEIL(x) returns the smallest integer greater than or equal to x.
[0235] The message-specific confidentiality keystream is set to the concatenation of the KDF output of the first FLOOR(L / 32) KDF calls and the R=8(L-32*FLOOR(L / 32)) least significant bits of the output of the last KDF call. Instead of the R LSBs, any subset of R bits may be used. FLOOR(x) returns the largest integer less than or equal to x.
[0236] An additional possible modification would be to use the NEA algorithm rather than the KDF when encrypting and / or scrambling.
[0237] This can be useful when doing cryptography, as keystream sequences need to be generated more frequently (due to the way UTC-based counters are calculated).
[0238] This is useful for scrambling in cases where encryption is only performed on a small portion of the message (eg, only the last bytes of a discovery message).
[0239] In this case, if the 128-NEA algorithm is used, the input key for the NEA algorithm may be the 128 LSBs of DUCK (or DUSK). The 32-bit count for the NEA algorithm may be set to a UTC-based counter, BEARER may be set to a predetermined binary value (e.g., BEARER=0000), and DIRECTION may be set to a predetermined value (e.g., DIRECTION=0 if this is a Model A discovery message or the first Model B discovery message, or DIRECTION=1 if this is the second Model B discovery message). The length field should contain the length of the (part of) discovery message that requires integrity protection. [Table 12]
[0240] An additional possible modification is to use the NIA algorithm instead of the KDF-based MIC approach. In this case, if the 128-NIA algorithm is used, the input key for the NIA algorithm may be the 128 LSBs of the DUIK. The 32-bit count of the NIA algorithm may be set to a UTC-based counter, BEARER may be set to a predetermined binary value (e.g., BEARER=0000), and DIRECTION may be set to a predetermined value (e.g., DIRECTION=0 if it is a Model A discovery message or the first Model B discovery message, or DIRECTION=1 if it is the second Model B discovery message). The length field should contain the length of the (part of) discovery message that requires integrity protection.
[0241] An additional modification possibility is parallel processing of encryption and scrambling, where the underlying algorithm described in section 6.1.3.4.3.2 of TS 33.303 and included above is realized as follows:
[0242] In the above algorithm, as explained above, H in line 6 is fed into the hash of (Key_calc_mask AND (message || MIC))) for performance purposes. CT in line 8 is calculated as multiple 32-byte fragments, which are encrypted and scrambled simultaneously. This is useful for computer architectures that have SIMD (Single Instruction on Multiple pieces of Data) instructions, such as AVX2. The above algorithm also encrypts the MIC. Encrypting the MIC also has the advantage that the loop length is the same for both encryption and scrambling. In the above algorithm, the encryption / scrambling of the last bytes (<32) of the message is calculated in line 12.
[0243] In another additional potential variation, most of the discovery message is not encrypted. For example, encryption of optional fields such as metadata is not performed as this is left to the application layer. However, the entire discovery message is scrambled to avoid tracking. In the following algorithm, optional fields are placed before fixed fields. [Table 13]
[0244] Another additional potential variation similar to the above is that only parts of the discovery message, e.g., fixed fields, are integrity / encryption protected and the entire discovery message is scrambled. The main reason is that while the security of some fields in the discovery message may be left to the application (e.g., metadata), the security function still needs to ensure that the UE sending the discovery message cannot be tracked.
[0245] In another additional potential variant, protection of the discovery message is applied first to the first part of the message (e.g., the first 32 bytes) and then to the remaining (or second) part of the message. The goal here is to keep the size of the fixed fields (located in the first part of the message) that are scrambled / encrypted / integrity protected by the discovery security routines as short as possible, e.g., 32 bytes or less. This allows the processing of discovery message fields such as source layer 2 ID, destination layer 2 ID, relay service code, announcer information, or additional parameters to be performed as efficiently as possible using a single KDF call. Another reason is related to the fact that if the message length is long, e.g., close to 9000 bytes, an attacker may modify the actual short discovery message to indicate a long message length.
[0246] An attacker can change the length by flipping certain bits of the length field. The reason why an attacker can do this is because the scrambling is done by XOR operation. This can cause the receiving UE to spend a lot of energy descrambling, decrypting and finally checking the MIC associated with the entire discovery message. This can facilitate, for example, denial of service attacks. Therefore, an alternative consists in processing (descrambling, decrypting and integrity checking) only the first part of the discovery message (e.g., the first 32 bytes) in an initial step. If the MIC verification associated with the first part of the message is successful and the first part of the message indicates the presence of a second part (e.g., length field > 32 bytes), the receiving UE can proceed to process (descramble, decrypt and integrity check) the remaining part of the message. Thus, a discovery message may contain two MICs, i.e., a MIC for the first 32-LMIC bytes (e.g., 28 bytes if the MIC length is LMIC=4 bytes) and a second MIC for the remaining bytes of the message. The discovery message may also include in a first part of the message, e.g., the first 32 bytes of the message, a (truncated) hash H calculated from the remainder of the message and a MIC that verifies the integrity of the first part of the message (including verifying the integrity of H). If the verification of the MIC in the first part of the message is successful, the receiving UE may proceed to process the remainder of the message. The integrity verification of the remainder of the message is performed by checking whether the hash value calculated from the remainder of the message is equal to the value H included in the first part of the message and verified with the MIC included in the first part of the message. Note that H may refer to a (truncated) hash of the second part of the message in plaintext, encrypted, or scrambled form.In this last case (scrambled form), the receiving UE may, while the second part of the message is still scrambled (i.e., immediately after reception), calculate a truncated hash of the second part and compare it with the H value that was included in the first part of the message. If this is successful, the receiving UE may proceed to descramble the second part of the message. The MIC may be calculated in accordance with TS 33.303, clause 6.1.3.4.3.4.
[0247] When sending a discovery message, the processing of the message is as follows. 1. Form a discovery message (e.g., add a suffix if only a prefix is assigned). 2. If a DUIK was provided for the first part of the message, calculate the MIC; otherwise, set the MIC to all zeros. 3. When a DUCK is received, add the message specific confidentiality to the beginning of the message. 4. Attach the MIC to the output of step 3. 5. If DUSK is received, add scrambling to the output of step 4. 6. If DUIK2 was provided and / or the second part of the message requires integrity protection, calculate and protect the MIC, otherwise set the MIC to all zeros. 7. If DUCK2 is received and / or the second part of the message requires confidentiality protection, add message-specific confidentiality to the second part of the message. 8. Attach the MIC to the output of step 7. 9. If DUSK2 is received and / or the second part of the message requires scrambling protection, add scrambling to the output of step 8.
[0248] In this algorithm, DUIK2, DUSK2, DUCK2 may correspond to DUIK, DUSK, DUCK, or may be different keys (e.g., application dependent). Whether the second part requires protection may be policy based. When creating the message, some of the above steps may be rearranged, e.g., step 6 may occur after step 2, step 7 after step 3, step 8 after step 4, and step 9 after step 5. Similarly, step 6 may be modified to compute a truncated hash H of the second part of the (plaintext) message and perform this computation before step 2. In that case, step 2 computes a MIC included in the first part of the message using H as input, and H is included as a field in the first part of the message. Similarly, step 9 may be modified to additionally compute a truncated hash H' from a scrambled version of the second part of the message and perform this computation before step 2. In that case, step 2 computes a MIC using H' as input, and H' is included as a field in the first part of the message.
[0249] Upon receiving a message, the receiving UE should first process the first part of the message, and then process the second part of the message. 1. If DUSK is received, descramble the first part of the message. 2. Optionally, a check for a match is made, and if no match exists the process is aborted. 3. If a DUCK is received, decrypt the first part of the message. 4. Optionally, do an exact match and stop processing if there is no match. 5. If a DUIK is received, verify the MIC of the first part of the message. If the MIC verification fails, abort the process. 6. If there is a length field > 32 in the first part of the message or the mask of the first part of the message indicates further fields, and DUSK2 is received and / or the second part of the message requires scrambling protection, then unscramble the second part of the message. 7. If there is a length field > 32 in the first part of the message or the mask of the first part of the message indicates more fields, if DUCK2 was received and / or the second part of the message requires cryptographic protection, decrypt the second part of the message. 8. If there is a length field > 32 in the first part of the message or the mask of the first part of the message indicates further fields, if DUIK2 was received and / or the second part of the message requires integrity protection, verify the integrity of the second part of the message.
[0250] As mentioned above, integrity protection of the second part of the message can be achieved by using a MIC included in the second part of the message or by including a fingerprint H of the second part of the message in the first part of the message. The fingerprint H is verified by using a MIC included in the first part of the message. The encryption / scrambling of the second part of the message is performed by one or more calls to the KDF. The global encryption / scrambling of the entire message is performed by multiple calls to the KDF. For example, if the first part of the message includes a fingerprint H' that corresponds to a function (e.g. a truncated hash) of the scrambled second part of the message, then after step 5 the receiving UE checks whether the hash value obtained from the received scrambled second part of the message matches the received and verified H' value. If there is a match, the receiving UE descrambles (step 6) and performs decryption (step 7). The integrity verification (step 8) is not strictly required.
[0251] Discovery messages are suitable for processing as described in the last algorithm, since they may have some fields that are always present and are length limited for performance reasons. Furthermore, additional (optional) fields may be integrity protected / encrypted by the application. However, to prevent tracking, scrambling may be applied to all fields, e.g. the entire discovery message. Also, it may be necessary to ensure that such bulk messages are not modified. For example, clause 11.2.5 of TS 24.334 contains the definition of discovery messages, e.g. the contents of the PC5 discovery message for Open ProSe Direct Discovery. [Table 14]
[0252] Furthermore, it is proposed that "depending on the UE implementation, application layer discovery messages are exchanged either as user traffic over PC5 or as part of metadata in PC5 direct discovery messages as specified in subclause 6.3.2.1. In the latter case, the PC5 direct discovery messages may contain an additional field with application layer metadata information (e.g. application layer discovery messages for group discovery). The format and content of this additional field is outside the scope of 3GPP. If the size of the resulting PC5 direct discovery messages is too large, the performance of the PC5 direct discovery messages including application layer information will be affected, e.g. longer delays and less reliability." If the information is exchanged as part of the metadata, the messages may be longer than the message size of LTE (e.g. 23 bytes). Thus, the first, e.g. 23 or 28 bytes (first part of the discovery message) may be integrity / encryption protected in a similar way as is done in LTE, as described above, and the entire discovery message including metadata may be scrambled. The first part of the message may include a truncated hash of the scrambled second part of the message. After the first part of the message is first processed (descramble, decrypt, integrity check), the integrity of the second part of the message may be verified using the H value, and finally the second part of the message may be descrambled.
[0253] Note that even if the first part of the message is processed (scrambled, encrypted, integrity verified) in a first step and the second part of the message is processed (scrambled, encrypted, integrity verified) in a second step, the scrambling (or encryption) of the discovery message by the transmitting UE and the unscrambling (or decryption) of the discovery message by the receiving UE still require multiple KDF invocations. Thus, the generation of pseudo-random number sequences for scrambling / encryption may still be performed as shown previously.
[0254] In an alternative embodiment, some (optional) fields such as metadata may be encrypted / integrity protected as determined by the application. However, the discovery message is extended to include a new field that can be used to hold a symmetric key (e.g., DUIK2, DUSK2, master key used to generate DUCK2) that the application uses to encrypt / integrity protect the metadata. A new field, the metadata key, can also be included and protected in the same way. If such a new field is present (e.g., a value other than 0x000...000), it is used for decryption / integrity verification of other fields such as metadata.
[0255] In an example instance of the above embodiment, three types of security algorithms are used to protect discovery messages over the PC5 interface: integrity protection, scrambling protection, and message specific confidentiality, as defined in TS 33.303[4], clause 6.1.3.4.3. These algorithms are applied with the following modified processing of the scrambling and confidentiality algorithms that extends TS 33.303[4] to protect variable length discovery messages.
[0256] Scrambling protection: Overall process during transmission (reception) When the UE transmits (or receives) a message, the (de)scrambling is performed according to the following steps. a) For the sole purpose of this scrambling calculation, set the four LSBs of the UTC-based counter to zero. b) Calculate a time hash bit sequence from DUSK and a UTC-based counter (modified as in step 1) that is passed through a keyed hash function. a.TimeHashBitSequence="" For bi=0~FLOOR((L+LMIC) / 32)), i. time hash bit sequence = time hash bit sequence || KDF(DUSK, UTC-based counter, i) c.Time Hash Bit Sequence = Time Hash Bit Sequence || LSB(KDF(DUSK,UTC-based counter,FLOOR((L+LMIC) / 32))+1),8*(L+LMIC-32*FLOOR((L+LMIC) / 32))) c) XOR the time hash bit sequence with the entire discovery message being processed (including the MIC).
[0257] where L is the length of the discovery message, LMIC is the length of the MIC (e.g., 4 bytes), || indicates concatenation, LSB(x,b) returns the b least significant bits of x, FLOOR(x) returns the largest integer less than or equal to x, CEIL(x) returns the smallest integer greater than or equal to x, and KDF() refers to the key derivation function:
[0258] When computing the time hash bit sequence for discovery, the following parameters are used to form the input S to the KDF described in Appendix B of TS 33.220[5]: - FC = unique identifier. - P0 = UTC-based counter for scrambling associated with the discovery slot (see subsection 6.1.3.4.3.5). - L0 = the length above (i.e. 0x00 0x04). - P1 = message fragment index. - L1 = the length above (i.e. 0x00 0x02).
[0259] The input key is 256-bit DUSK.
[0260] The length of L1 is 2, which is the minimum length required to protect up to 9000 bytes. P1 refers to a 32-byte fragment or block in the discovery message.
[0261] For a discovery message of length L, a total of CEIL((L+LMIC) / 32) KDF invocations are required, each with a different P1 value.
[0262] The scrambling bit sequence is set to the concatenation of the entire KDF output of the first FLOOR((L+LMIC) / 32) KDF invocations and the R=8(L+LMIC-32*FLOOR((L+LMIC) / 32)) least significant bits of the output of the last KDF invocation.
[0263] Confidentiality: The overall process of sending (receiving) When the UE sends (or receives) a message, encryption (decryption) is performed according to the following steps. a) Calculate Key_calc_mask = (Encrypted_bits_mask XOR 0xFF···FF)||0xFFFFFFFF b) Use the KDF to obtain the keystream as follows: a.keystream="" b.HH = (Key_calc_mask AND (Message || MIC)) or HH=Hash((Key_calc_mask AND (Message||MIC))) For ci=0~FLOOR(L / 32), i.keystream = keystream || KDF(DUCK,UTC-based counter,i,HH). d.keystream = keystream || LSB(KDF(DUCK,UTC-based counter,FLOOR(L / 32)+1,HH),8*(L-32*FLOOR(L / 32))) a) XOR (Keystream AND Encrypted_bits_mask) into the message.
[0264] where L is the length of the discovery message, LMIC is the length of the MIC (e.g., 4 bytes), || indicates concatenation, LSB(x,b) returns the b least significant bits of x, FLOOR(x) returns the largest integer less than or equal to x, CEIL(x) returns the smallest integer greater than or equal to x, and KDF() refers to the key derivation function:
[0265] When computing message-specific confidentiality for discovery, the following parameters are used to form the input S to the KDF described in Appendix B of TS 33.220[5]:
[0266] - FC = unique identifier - P0 = UTC-based counter associated with the discovery slot. - L0 = the length above (i.e. 0x00 0x04). - P1 = message fragment index. - L1 = the length above (i.e. 0x00 0x02). - P2=HH. - L2=Length of HH.
[0267] The input key is 256-bit DUCK.
[0268] For a discovery message of length L, a total of CEIL(L / 32) KDF invocations are required, each with a different P1 value. If the MIC needs to be encrypted, the LMIC must also be included.
[0269] The message-specific confidentiality keystream is set to the concatenation of the KDF output of the first FLOOR(L / 32) KDF invocations and the R=8(L-32*FLOOR(L / 32)) least significant bits of the output of the last KDF invocation.
[0270] In the above solution the MIC may also be encrypted. If the MIC is encrypted, then its length should be set to L+LMIC (instead of just L), where LMIC is the length of the MIC.
[0271] In an example instance of the above embodiment, three types of security algorithms are used to protect discovery messages over the PC5 interface: integrity protection, scrambling protection, and message specific confidentiality, as defined in TS 33.303 [4], clause 6.1.3.4.3. These algorithms are extended to protect discovery messages by doing the following:
[0272] First, it processes (integrity protects, confidentiality, scrambles) a short initial part of the discovery message that contains fixed fields, and if successful, It then processes (integrity protects, confidentiality, scrambles) the longer second part of the message, which contains optional fields of variable length such as metadata.
[0273] Figure 2 shows the structure of a discovery message. The first short part contains fixed fields such as the relay service code. These fields include: an optional field O of length 1 bit indicating the presence of optional fields in the second part of the message; a 14-bit length field L indicating the length of an optional field in the second part of the message; a 25-bit long truncated hash field H taken from the second part of the message, and A 32-bit Message Integrity Code (MIC) computed over fields contained in the first part of the message.
[0274] Possible instances include fields O, L, and H with lengths of 1, 14, and 25 bits, respectively. That's 40 bits in total, making the total length of the first part of the message 32 bytes. These fields may also be sent implicitly. For example, the first 3 bytes of the metadata contain the metadata IE and the length.
[0275] When sending a discovery message, the processing of the message is as follows. 1. If a DUIK was provided for the second part of the message, calculate MIC2; otherwise, set MIC2 to all zeros. 2. If a DUCK is received and / or the second part of the message requires confidentiality protection, add message-specific confidentiality to the second part of the message. 3. Attach MIC2 to the output of step 3. 4. If DUSK is received, add scrambling to the output of step 4. 5. Calculate the truncated hash H of the second part of the message (the output of step 4). 6. Form a discovery message (e.g., add a suffix if only a prefix is assigned) and attach fields O, L, and H. 7. Calculate MIC1 for the first part of the message (up to H) if a DUIK was provided, otherwise set MIC1 to all zeros. 8. If a DUCK is received, add the message specific confidentiality to the beginning of the message. 9. Attach MIC1 to the output of step 8. 10.If DUSK is received, add scrambling to the output of step 9. 11. Attach the output of step 4 to the output of step 10 to create a complete discovery message.
[0276] The second part of the message contains an independent message integrity code MIC2. This may not be necessary, since integrity protection of the second part of the message is always enabled by a truncated hash of the second part of the message that is verified with the message integrity code MIC1 included in the first part of the discovery message.
[0277] Steps 2, 3, 4 and steps 7, 8, 9 follow the same order as in TS 33.303. It is preferable to swap and rearrange steps 3-4 and steps 8-9 so that the MIC is always protected.
[0278] Upon receiving a discovery message, the process is as follows: the receiving UE first processes the first part of the message, and then processes the second (optional) part of the message. In particular, the subsequent steps are as follows: 1. If DUSK is received, descramble the first part of the message. 2. Optionally, a check for a match is made, and if no match exists the process is aborted. 3. If a DUCK is received, decrypt the first part of the message. 4. Optionally, do an exact match and stop processing if there is no match. 5. If a DUIK is received, verify MIC1 in the first part of the message. If MIC1 verification fails, abort processing. 6. If a length field > 32 is present in the first part of the message or a mask in the first part of the message indicates additional or optional fields, a. The truncated hash of the scrambled / encrypted / integrity protected second part of the message corresponds to a truncated hash field H contained within and verified within the first part of the message. If i.DUSK is received, descramble the second part of the message. ii. If a DUCK is received, decrypt the second part of the message. iii. If a DUIK is received, verify the integrity of the second part of the message.
[0279] Step 6.a.iii may not be necessary since an integrity check has already been performed in step 6.a.
[0280] The scrambling algorithm used to scramble the (first and second parts of) the discovery message is performed according to the following steps, which extend TS 33.303[4]:
[0281] 1. For the purposes of this scrambling calculation only, set the four LSBs of the UTC-based counter to zero.
[0282] 2. Calculate a time hash bit sequence from DUSK and a UTC-based counter (modified as in step 1) that is passed through a keyed hash function. a.TimeHashBitSequence="" For bi=0~FLOOR((L+2*LMIC) / 32), time hash bit sequence = time hash bit sequence || KDF(DUSK,UTC-based counter,i) c.Time Hash Bit Sequence = Time Hash Bit Sequence || LSB(KDF(DUSK,UTC-based counter,FLOOR((L+2*LMIC) / 32)+1),8*(L+2*LMIC-32*FLOOR((L+2*LMIC) / 32)))
[0283] 3. XOR the time hash bit sequence with the entire discovery message being processed (including the MIC).
[0284] where L is the length of the discovery message, LMIC is the length of the MIC (e.g., 4 bytes), || indicates concatenation, LSB(x,b) returns the b least significant bits of x, FLOOR(x) returns the largest integer less than or equal to x, CEIL(x) returns the smallest integer greater than or equal to x, and KDF() refers to the key derivation function:
[0285] When computing the time hash bit sequence for discovery, the following parameters are used to form the input S to the KDF described in Appendix B of TS 33.220[5]: - FC = unique identifier. - P0 = UTC-based counter for scrambling associated with the discovery slot. - L0 = the length above (i.e. 0x00 0x04). - P1 = message fragment index. - L1 = the length above (i.e. 0x00 0x02).
[0286] The input key is 256-bit DUSK.
[0287] The length of L1 is 2, which is the minimum length required to protect up to 9000 bytes. P1 refers to a 32-byte fragment or block in the discovery message.
[0288] For a discovery message of length L, a total of CEIL((L+2*LMIC) / 32) KDF invocations are required, each with a different P1 value.
[0289] The scrambling bit sequence is set to the concatenation of the entire KDF output of the first FLOOR((L+2*LMIC) / 32) KDF invocations and the R=8(L+2*LMIC-32*FLOOR((L+2*LMIC) / 32)) least significant bits of the output of the last KDF invocation.
[0290] Confidentiality protection is performed according to the following steps, which extend TS 33.303[4]:
[0291] 1. Calculate Key_calc_mask = (Encrypted_bits_mask1 XOR 0xFF···FF)||0xFFFFFFFF||(Encrypted_bits_mask2 XOR 0xFF···FF)||0xFFFFFFFF NOTE: Encrypted_bits_mask1 and Encrypted_bits_mask2 play a similar role as Encrypted_bits_mask in TS33.303, but are applied independently to the first and second parts of the discovery message.
[0292] 2. Use the KDF to get the keystream as follows: a.keystream="" b.HH = (Key_calc_mask AND (Message1||MIC||Message2||MIC2)) or HH=Hash((Key_calc_mask AND (Message1||MIC||Message2||MIC2))) For ci=0~FLOOR(L / 32), i.keystream = keystream || KDF(DUCK,UTC-based counter,i,HH). d.keystream = keystream || LSB(KDF(DUCK,UTC-based counter,FLOOR(L / 32)+1,HH),8*(L-32*FLOOR(L / 32)))
[0293] 3. XOR(Keystream AND Encrypted_bits_mask) into the message. When computing message-specific confidentiality for discovery, the following parameters are used to form the input S to the KDF described in Appendix B of TS 33.220[5]: - FC = unique identifier - P0 = UTC-based counter associated with the discovery slot. - L0 = the length above (i.e. 0x00 0x04). - P1 = message fragment index. - L1 = the length above (i.e. 0x00 0x02). - P2=HH. - L2=Length of HH.
[0294] The input key is 256-bit DUCK.
[0295] For a discovery message of length L, a total of CEIL((L) / 32) KDF invocations are required, each with a different P1 value.
[0296] The message-specific confidentiality keystream is set to the concatenation of the KDF output of the first FLOOR((L) / 32) KDF invocations and the R=8(L-32*FLOOR((L) / 32)) least significant bits of the output of the last KDF invocation.
[0297] The protection of the first and second parts of the message may also be performed using different algorithms. For example, the integrity and confidentiality protection of the first part of the message may be performed as described above using a PRF as in TS33.303. The integrity and confidentiality protection of the second part of the message may be performed using one of the standard 5G confidentiality algorithms (e.g., 128-NEA1, 128-NEA2, 128-NEA3) and integrity algorithms (e.g., 128-NIA1, 128-NIA2, 128-NIA3).
[0298] Which NIA or NEA algorithm is used may be signaled in the first part of the discovery message.
[0299] The proposed solution to address the issue in TS 33.503 v0.2.0 of protecting discovery messages of length greater than 256 bits by reusing the protection mechanisms described in TS 33.303 requires the following changes: (a) in A.5 of TS 33.303, the time hash bit sequence keystream is set to the L least significant bits of the output of the KDF, where L is the bit length of the discovery message after it has been scrambled, which is set to Min(length of discovery message - 16,256). Note: The maximum length of the scrambled discovery message is limited to 256 bits, (b) in TS 33.303 subclause 6.1.3.4.3.2, the MIC is set to a 32-bit random string if no DUIK was provided, and (c) message inherent confidentiality is achieved by the 128-NEA algorithm as specified in Appendix D of TS 33.501[3]. The input parameters to the 128-NEA algorithm, described in Appendix D of TS33.501, are: KEY, which is set to the least significant 128 bits of the output of DUCK; KDF(DUCK, UTC-based counter, MIC), COUNT, which is set to the UTC-based counter, BEARER AND DIRECTION, which is set to 0x00; LENGTH, which is set to the length of the discovery message minus the length of the message type, the UTC-based counter LSB, and the MIC. The output keystream of the encryption algorithm (output_keystream) is then masked with Encrypted_bits_mask to generate the final keystream (KEYSTREAM) for message-specific confidentiality protection, where KEYSTREAM=output_keystream AND (Encrypted_bits_mask||0xFF···FF) and the length of Encrypted_bits_mask is set to Min(Length of discovery message-48,224). The KEYSTREAM is XORed with the discovery message for message specific confidentiality protection, and (d) the encryption algorithm for message specific confidentiality is configured in the UE during the discovery request procedure.
[0300] However, there are a number of problems with this proposed solution.
[0301] First, KEY is calculated as KDF(DUCK, UTC-based counter, MIC). The reason for this is to generate a session key from DUCK. However, (i) including MIC requires MIC to be exchanged in the clear, (ii) KDF needs to be calculated before encrypting the message, which increases CPU load, and (iii) deriving the session key in this way does not extend the lifetime of DUCK, since if the same discovery message is used, the same KEY will be generated when the counter wraps around. One embodiment to overcome this problem is to use DUCK or a part of it, or a key derived directly from DUCK (by KDF). On the other hand, this approach has the advantage that it allows generating message-dependent keystreams (because MIC is used as input to KDF) without the need to send the entire message to KDF, as described in the above embodiment. Subsequent keystreams generated using the NEA algorithm inherit this property.
[0302] One embodiment to overcome this problem when a session key is generated is to generate KEY=KDF(DUCK, UTC-time-in-seconds / rotation_rate), where rotation_rate indicates how often the KEY needs to be rotated. For example, rotation_rate may be 86400 seconds (1 day), which means that a new KEY is generated once a day. This reduces the CPU load and increases the lifetime of DUCK.
[0303] Second, the encryption algorithm for message specific confidentiality is configured in the UE during the discovery request procedure. For example, in model A restricted discovery, a remote UE (or relay UE) advertises its PC5 UE security capabilities, including a list of encryption algorithms it supports. In response, the core network (e.g., 5G DDNMF in the announcing UE's HPLMN) must include the selected PC5 encryption algorithm in the discovery response message. This issue arises because there may be multiple announcing UEs and multiple monitoring UEs, and the security capabilities may not be available for all UEs that support a selected algorithm.
[0304] One embodiment to overcome this problem is that if the UE sends a list of supported cryptographic algorithms that does not include the algorithm selected by the core network, the core network provides an indication of the unsupported algorithms.
[0305] One embodiment that overcomes this problem requires that a UE that receives an indication of an unsupported algorithm, or a selection of an algorithm that it does not support, not send or process discovery messages associated with that service.
[0306] Since DUCK may not be provided, some of the messages may not be scrambled / encrypted, which leads to privacy risks. One embodiment that overcomes this problem requires the core network to set DUCK in the UE, and also requires the UE to apply DUCK if the length of the discovery message sent by the UE exceeds 256 bits. Alternatively, the UE must apply one of the above embodiments that can update the scrambling algorithm of TS33.303 to protect messages longer than 256 bits.
[0307] Clause 6.1.3.4.3.2 of TS33.303 calculates the MIC, applies confidentiality to the message, appends the MIC, and scrambles the entire message. These steps are unchanged in the related proposal, which calculates the KEYSTREAM as output_keystream AND (Encrypted_bits_mask||0xFF···FF), where the length of Encrypted_bits_mask is set to Min(length of discovery message−48,224). According to such proposal, the MIC is always encrypted, since it is at the end of the message. Therefore, the solution proposed in such proposal cannot function operationally, since it is not possible to extract the MIC and calculate the KEY to be used with the NEA algorithm. To solve this situation, in one embodiment, it is proposed to modify clause 6.1.3.4.3.2 of TS33.303 to perform the following steps: (1) compute a MIC or another integrity component, (2) apply confidentiality to the message, (3) append the (confidentiality-protected) message to the MIC and any other unprotected fields (e.g., message type, UTC-based counter LSB), and (4) scramble (at least the first part of) the message. Section 6.1.3.4.3.3 requires the reverse changes corresponding to this embodiment for decrypting the message.
[0308] An alternative embodiment changes the calculation of KEYSTREAM to output_keystream AND (0x00···00||Encrypted_bits_mask||0xFF···FF), where the length of Encrypted_bits_mask is set to Min(length of discovery message-48,224), where the length of 0x00···00 is 48 bits, and if the message is longer than 272 bits, the length of 0xFF···FF is equal to the length of the discovery message minus the length of Encrypted_bits_mask, otherwise it is 0. If this is done, then clause 6.1.3.4.3.2 of TS 33.303 states: (1) calculate a MIC or another integrity component, (2) append the MIC (and other unprotected fields) to the message, (3) apply confidentiality to the message, and (4) scramble the message. Steps (3) and (4) can be swapped. Section 6.1.3.4.3.3 requires the reverse modification to correspond to this embodiment.
[0309] In an alternative embodiment, clause 6.1.3.4.3.2 of TS33.303 is modified to perform the following steps: (1) calculate a MIC or another integrity component, (2) insert a MIC before an optional field such as metadata or group ID, (3) apply confidentiality to the message, and (4) scramble (at least the first part) of the message. Steps (3) and (4) can be swapped. In this case, the KEYSTREAM is computed as output_keystream AND (0x0000||Encrypted_bits_mask||0x00000000||0xFF···FF), where 0x00000000 corresponds to the position of the MIC and 0x0000 corresponds to the position of the message type, UTC-based counter LSB. Clause 6.1.3.4.3.3 requires the opposite modification to accommodate this embodiment.
[0310] In an alternative embodiment, clause 6.1.3.4.3.2 of TS33.303 is modified to perform the following steps: (1) calculate a MIC or another integrity component, (2) apply confidentiality to the message, (3) insert a MIC, and (4) scramble the message, specifically the first part of the message and the last 4 bytes of the message. Steps (3) and (4) can be swapped. In this case, the KEYSTREAM is computed as output_keystream AND (0x0000||Encrypted_bits_mask||0xFF···FF), where 0x0000 corresponds to the message type, UTC-based counter LSB position. Clause 6.1.3.4.3.3 requires the opposite modification to correspond to this embodiment.
[0311] As explained through the previous embodiments, the proposed variant of the invention can be implemented in a network, for example a cellular network as a 5G network, as shown in FIG. 3. A primary station 1000 serves a cell of the network. Within the coverage of the primary station 1000 (for example a gNB), multiple secondary stations can connect to the primary station. Some secondary stations may be adapted to operate as relay stations 1010. Such a relay station may include a transmitter 1011 coupled to a transmit antenna and a receiver 1012 coupled to a receive antenna. Typically, the receive antenna and the transmit antenna are the same antenna. Furthermore, depending on the technology, the antenna may be formed by an antenna array that allows different transmit / receive modes, such as MIMO, transmit diversity, and operation on different frequency sets.
[0312] The controller 1013, e.g., a CPU or microcontroller (e.g., a microprocessor dedicated to communication (baseband processor) or a main microprocessor of a device including a UE) operating with software stored in an internal memory (e.g., ROM, EEPROM, SSD), is adapted to control the transmitter and receiver, as well as the antenna. It should be noted that some or all of the transmitter, receiver, and controller may be part of a single baseband processor. With respect to the above embodiment, the controller is adapted to establish a connection between the relay station 1010 and the primary station 1000. More specifically, the controller 1013 can configure the receiver 1012 to receive a first set of configuration parameters including an attribute or service code in at least one first secure message from the primary station 1000.
[0313] The controller 1013 can control the transmitter 1011 to cause the transmitter 1011 to transmit at least one transmitted attribute or service code from the first set of configuration parameters, which may be broadcast for reception by other stations, such as the secondary stations 1020 or 1030.
[0314] Typically, a relay station may be a UE, such as a sidelink-capable UE, and thus capable of operating as a relay station when configured as such, or alternatively, a relay station may be another primary station, such as an access point, gNB, femtocell gNB, etc.
[0315] The secondary station 1020 (or similarly 1030) is typically a UE and includes a transmitter 1021 and a receiver 1022. The transmitter 1021 and the receiver 1022 are typically both coupled to one or more antennas or antenna arrays. Furthermore, the secondary station 1020 includes a controller 1023 adapted to control the receiver 1021, the transmitter 1022, and possibly other elements of the UE. As for a relay station, the controller 1023 may be a processor or CPU and may be operated by software.
[0316] The controller 1023 can cause the receiver 1021 and the transmitter 1022 to establish a connection with the primary station 1000. This includes configuring the receiver 1021 to receive from the primary station 1000 in at least one second secure message a second set of configuration parameters including, for example, attributes or a relay service code linked to an upcoming data exchange with the relay station 1010.
[0317] The receiver 1021 may be configured to receive at least one transmitted attribute or service code from the relay station 1010, and the controller may be configured to determine whether the transmitted attribute or service code is included in a second configuration parameter set or satisfies a policy included therein, and to cause the transmitter to establish direct communication with the relay station 1010 if it is determined that the transmitted service code is included in the second set.
[0318] Secondary stations 1020 and 1030 may also be able to communicate with each other via relay station 1010 .
[0319] A single unit or device may fulfill the functions of several items recited in the claims. The mere fact that several measures are recited in mutually different dependent claims does not indicate that a combination of these measures cannot be used to advantage.
[0320] The described operations, such as those shown in Figures 3 and 4, may be implemented as program code means of a computer program and / or as dedicated hardware in an associated communication or access device, respectively. The computer program may be stored and / or distributed on a suitable medium, such as an optical storage medium or a solid-state medium, supplied together with or as part of other hardware, or distributed in other forms, such as via the Internet or other wired or wireless telecommunications systems.
[0321] From the drawings, the disclosure and the appended claims, other variations of the disclosed embodiments can be understood and realized by those skilled in the art practicing the claimed invention. In the claims, the term "comprises" does not exclude other elements or steps, and singular elements do not exclude a plurality. A single processor or other unit may fulfill the functions of several items recited in the claims. The mere fact that several means are recited in mutually different dependent claims does not indicate that a combination of these means cannot be used advantageously. The above description details certain embodiments of the invention. However, no matter how detailed the above content is described, it will be understood that the invention can be implemented in many ways and is therefore not limited to the disclosed embodiments. It should be noted that the use of certain terms in describing certain features or aspects of the invention should not be interpreted as meaning that the terms are redefined to be limited to include the specific features of the feature or aspect of the invention with which they are associated.
[0322] Furthermore, when idiomatic expressions similar to "at least one of A, B, and C, etc." are used, such syntax is generally intended in the sense that one of ordinary skill in the art would understand the idiomatic expression, e.g., "a system having at least one of A, B, and C" includes, but is not limited to, systems having A only, B only, C only, A and B together, A and C together, B and C together, and / or A, B, and C together, etc. When idiomatic expressions similar to "at least one of A, B, or C, etc." are used, such syntax is generally intended in the sense that one of ordinary skill in the art would understand the idiomatic expression, e.g., "a system having at least one of A, B, or C" includes, but is not limited to, systems having A only, B only, C only, A and B together, A and C together, B and C together, and / or A, B, and C together, etc. Additionally, those of skill in the art will understand that virtually any disjunctive word and / or phrase presenting two or more alternative terms, whether in the specification, claims, or drawings, contemplates the possibility of including one of the terms, either term, or both terms. For example, the phrase "A or B" will be understood to include the possibilities of "A" or "B" or "A and B."
Claims
1. 1. A method of operating a first station in a communication system including a first station and a second station, the method comprising: a) preparing a message by the first station including at least a combination of a parameter indicating a type of service and a communication key or an index of a communication key to be used for communication with the second station; b. executing, by the first station, an algorithm for generating a keystream by applying a key derivation function to at least a confidentiality key and a freshness value; c) the first station encrypting the message using the keystream.
2. 2. The method of claim 1, wherein step b. comprises generating the keystream by applying a key derivation function to at least a confidentiality key, a freshness value, and the message.
3. 3. The method of claim 1 or 2, wherein step c. comprises applying an exclusive-or (XOR) operation to the message and the keystream.
4. The method of claim 1 , wherein the freshness value is a time value based on UTC.
5. The method of claim 1 , further comprising the step of the first station computing a message integrity check for the message.
6. 6. The method of claim 5, wherein the message integrity check is included in the message prior to step c.
7. 7. The method of claim 5 or 6, wherein step b. comprises generating the keystream by applying a key derivation function to at least a confidentiality key, a freshness value, the message, and a MIC of the message.
8. 8. The method of claim 1, wherein step b. comprises selecting a confidentiality key from a plurality of available keys according to a predetermined policy.
9. 9. The method of claim 8, wherein if DUCK is set, the private key is DUCK, otherwise, if DUSK is set, the private key is DUSK.
10. 10. The method of claim 9, wherein if the DUCK is set, the keystream is obtained by applying an encryption algorithm, and if the DUCK is not set but the DUSK is set, the keystream is obtained by applying a scrambling algorithm.
11. 11. The method of claim 9 or 10, wherein if the confidentiality key is not set, the message of step a. is not encrypted in step c.
12. The method according to claim 1 , wherein the key stream is obtained by applying a single algorithm, regardless of the secret key that is set.
13. 11. The method of claim 8, 9 or 10, further comprising the step of the first station calculating a message integrity check for the message using an integrity key, the integrity key being the same as the selected confidentiality key.
14. 14. The method of claim 1, wherein step b. comprises applying a key derivation function to obtain a second confidentiality key, the key stream being obtained by applying the second confidentiality key to a symmetric encryption algorithm.
15. The method of claim 14 , wherein the symmetric encryption algorithm is a NEA algorithm selected by the core network, negotiated during a previous operational phase, or signaled in the message.
16. The method according to claim 1 , wherein the parameter indicating the type of service is a relay service code.
17. A first station operating in a communication system further including a second station, the first station comprising: A transmitter; A receiver; a processor coupled to a memory containing instructions, the instructions comprising: preparing a message including a combination of a parameter indicative of the type of service and a communication key or an index of a communication key to be used for communication with the second station; executing an algorithm for generating a keystream by applying a key derivation function to at least a confidentiality key and a freshness value; and c) encrypting said message using said keystream.
18. A second station operating in a communication system further comprising a first station, said second station comprising: A transmitter; A receiver; a processor coupled to a memory containing instructions, the instructions comprising: receiving an encrypted message; executing an algorithm for generating a keystream by applying a key derivation function to at least a confidentiality key and a freshness value; and c) decrypting the message using the keystream.
19. A system comprising a first station according to claim 17 and a second station according to claim 18.
20. 1. A method for a first station to transmit a message to a second station in a communication system, the method comprising: a. the first station calculating a Message Integrity Check (MIC) based on the message; b. the first station combining the MIC with the message; c. calculating a keystream based on at least the MIC; and d) the first station encrypting the message using a keyword based on the keystream to obtain a cipher.
21. 21. The method of claim 20, further comprising the step of: e) scrambling a portion of the cipher resulting from step d).
22. 21. The method of claim 20, wherein the MIC is used as a fingerprint of the message in the calculation of the keystream.
23. 23. The method of claim 20, 21 or 22, wherein the keyword is a combination of the keystream and an encryption key mask.
24. The method of claim 23, wherein the combination is an AND operation.
25. 1. A method of operating a first station in a communications system, the method comprising: a. the first station preparing a discovery message of length L bytes; b. the first station generating a pseudo-random sequence of L bytes in output size by applying a key derivation function of size B bytes Ceiling (L / B) times or applying a NEA algorithm, where the pseudo-random sequence depends on at least a confidentiality key, a freshness value, and a counter value; c) the first station encrypting the message using the pseudo-random number sequence.
26. 26. The method of claim 25, wherein inputs to the key derivation function include the result of applying a bitwise "AND" function to a mask and a concatenation of the message and a MIC.
27. 27. The method of claim 25 or 26, wherein the input to the key derivation function or the NEA algorithm includes at least a function of a mask, a function of a message, or a function of a MIC.
28. 28. The method of claim 25, 26 or 27, wherein the message indicates a mask indicating a message length or the presence of an optional field for adjusting a cryptographic operation.
29. 29. A method for operating a system including a first station operating according to the method of any one of claims 26 to 28 and a second station, the second station comprising: a. receiving a discovery message; b. descrambling and / or decoding a first portion of the discovery message by using a first portion of the generated pseudo-random number sequence; c. verifying the integrity of the first portion of the discovery message using a MIC of the first portion of the discovery message; and d. if an integrity check of the first part of the discovery message is successful and / or if a field of the first part of the discovery message indicates the presence of a second part of the discovery message, descrambling and / or decrypting the second part of the discovery message using a second part of the generated pseudo-random number sequence.
30. 30. The method of claim 29, wherein the second portion of the received discovery message is descrambled and / or decrypted if a hash of the scrambled / encrypted second portion of the received message matches a hash value contained within and verified within the first portion of the discovery message.
31. 28. The method of claim 20 or 27, wherein step a comprises calculating a MIC based on the message and a DUIK (integrity key) if available, and step a comprises setting the MIC to a random value if the DUIK is not set.
32. The method of claims 20, 23, 24, 26, 27, 29 and 31, wherein the keystream is calculated using the NEA algorithm.
33. 33. The method of claim 32, wherein a 32-bit count in the NEA algorithm is set to the UTC-based counter value, a BEARER field value is set to BEARER=0000, and a DIRECTION field value is set to 0.
34. 34. The method of claim 20, 23, 24, 25, 26, 28, 31, 32, and 33, wherein protection of the discovery message is applied first to an initial portion of the message and then to the second portion of the message, and protection of the initial portion of the message and the second portion of the message are different from each other.
35. A first station operating within a communication system, the first station comprising: A transmitter; A receiver; a processor coupled to a memory containing instructions, the instructions comprising: a. the first station calculating a Message Integrity Check (MIC) based on the message; b. the first station combining the MIC with the message; c. calculating a keystream based on at least the MIC; and d. instructions for the first station to perform the steps of: encrypting the message using a keyword based on the keystream to obtain a cipher.
36. A first station operating within a communication system, the first station comprising: A transmitter; A receiver; a processor coupled to a memory containing instructions, the instructions comprising: preparing a discovery message of length L bytes; generating a pseudo-random sequence of L bytes in output size by applying a key derivation function of size B bytes Ceiling (L / B) times or applying a NEA algorithm, the pseudo-random sequence depending on at least a confidentiality key, a freshness value, and a counter value; and c) encrypting the message using the pseudorandom number sequence.
37. A second station operating within a communication system, the second station comprising: A transmitter; A receiver; a processor coupled to a memory containing instructions, the instructions comprising: a second station receiving the encrypted message, a MIC (Message Integrity Check); the second station obtaining a keyword based on the MIC; the second station decrypting the encrypted message using the obtained keyword; and b. the second station checking the integrity of the message by checking whether the received MIC is valid.
38. A system comprising a first station according to claim 35 and a second station according to claim 37.
39. A computer program comprising code which, when loaded onto a wireless device, causes said wireless device to carry out the steps of the method according to claims 1 to 16 or 20 to 34.
