Method and communication device for generating key identifier
By encrypting the signaling through the encryption key (EK) negotiated between terminal devices and generating a key identifier, the privacy leakage problem caused by the plaintext transmission of the key identifier on the PC5 interface is solved, and the security and speed of the unicast connection are improved.
Patent Information
- Application Number
- CN202010360257.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-04-30
- Publication Date
- 2025-09-12
- Estimated Expiration
- 2040-04-30
AI Technical Summary
When establishing a unicast connection between terminal devices, the MSB and LSB of the PC5 interface key identifier are transmitted in plain text and can be easily obtained by attackers, resulting in the risk of privacy leakage.
The interactive signaling is encrypted by negotiating an encryption key (EK) to generate a key identifier, ensuring that parameters are transmitted in the encrypted signaling and preventing attackers from associating with unicast connections.
It avoids privacy leakage, improves the security of unicast connections, reduces node authentication and key establishment processes, and speeds up connection establishment.
Smart Images

Figure CN113676897B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communications, and more particularly, to a method for generating a key identifier and a communication device. Background Art
[0002] During the process of establishing a unicast connection between two terminal devices (e.g., terminal device #1 and terminal device #2), terminal device #1 and terminal device #2 can generate a PC5 interface key during the node authentication and key establishment process, and further generate a PC5 interface key identifier. The PC5 interface key identifier is generated using the most significant bits (MSB) and least significant bits (LSB) of the PC5 interface key identifiers provided by terminal device #1 and terminal device #2, respectively. The PC5 interface key identifier is used to uniquely index the PC5 interface key generated by terminal device #1 and terminal device #2 during the unicast connection establishment process.
[0003] In the existing unicast connection establishment process, at least one of the MSB and LSB of the PC5 interface key identifier is transmitted in plain text, and is therefore easily obtained by a third-party attacker. In the process of terminal device #1 and terminal device #2 re-establishing a unicast connection, the PC5 interface key identifier carried in the direct communication request message is also transmitted in plain text, and is also easily obtained by a third-party attacker. If a third-party attacker simultaneously obtains the MSB and / or LSB of the PC5 interface key in the previous unicast connection establishment process and the PC5 interface key identifier carried in the direct communication request message in the second unicast connection establishment process, the two unicast connections between terminal device #1 and terminal device #2 can be associated, thereby resulting in a potential risk of privacy leakage. Summary of the Invention
[0004] The present application provides a method for generating a key identifier, which can avoid the problem of privacy leakage when two terminal devices establish a unicast connection.
[0005] In a first aspect, a method for generating a key identifier is provided. This method can be executed by a terminal device, or can also be executed by a component configured in the terminal device (such as a chip or chip system). This application is not limited to this. The following describes the method provided in the embodiments of this application using a terminal device as an example.
[0006] Specifically, the method includes: a first terminal device negotiates an encryption key (EK) with a second terminal device; the first terminal device receives a first message from the second terminal device; the first terminal device decrypts the first message based on the EK to obtain a first parameter included in the first message; the first terminal device sends a second message encrypted based on the EK to the second terminal device, where the second message includes a second parameter; the first terminal device generates a key identifier based on the first parameter and the second parameter, where the key identifier is used to index the key generated by the first terminal device and the second terminal device during the process of establishing a first unicast connection.
[0007] The encryption key can be used to encrypt a plaintext message to obtain a ciphertext message, and can also be used to decrypt a ciphertext message to obtain a plaintext message.
[0008] Based on the above technical solution, after the second terminal device and the first terminal device both generate encryption keys for encrypting and decrypting signaling, the second terminal device and the first terminal device then exchange the first parameter and the second parameter that constitute the key identifier. In this case, the signaling exchanged between the second terminal device and the first terminal device is all signaling encrypted using the encryption key. Therefore, the attacker will not be able to obtain the first parameter and the second parameter carried in the signaling exchanged between the second terminal device and the first terminal device. Furthermore, even if the second terminal device carries the key identifier generated during the establishment of this unicast connection in plain text in the next direct communication request message sent, the attacker will not be able to associate the unicast connection between the second terminal device and the first terminal device with the next unicast connection between the second terminal device and the first terminal device after obtaining the key identifier, thereby avoiding the problem of privacy leakage.
[0009] Optionally, the first message may be a direct connection safety mode completion message during the safety mode activation process.
[0010] Optionally, the second message is: a direct connection communication acceptance message in a unicast connection establishment process, or a direct connection security mode confirmation message in a security mode activation process.
[0011] The first parameter may be the MSB of the key identifier, and the second parameter may be the LSB of the key identifier; or the first parameter may be the LSB of the key identifier, and the second parameter may be the MSB of the key identifier. The first parameter may uniquely index the key stored in the second terminal device, and the first parameter may uniquely index the key stored in the first terminal device.
[0012] In combination with the first aspect, in certain implementations of the first aspect, when the first terminal device maintains the first unicast connection, the method also includes: the first terminal device receives a first request message from the second terminal device, the first request message is used to request to establish a unicast connection with at least one terminal device, and the first request message includes the key identifier; when the first terminal device determines that the first unicast connection cannot be reused, the first terminal device sends a first response message to the second terminal device, and the first response message is used to initiate a security negotiation process for a second unicast connection between the first terminal device and the second terminal device; wherein the first response message includes the key identifier, and the key identifier is used to indicate that the key is reused in the second unicast connection.
[0013] Based on the above technical solution, when the second terminal device is establishing a unicast connection for a new service, if it hopes that the first terminal device intends to re-establish a unicast connection with the second terminal device, the second terminal device carries a key identifier in the broadcast direct communication request message. Accordingly, the first terminal device can index the saved key of the existing unicast connection (i.e., the first unicast connection) based on the key identifier carried in the direct communication request message, and then determine that the key of the existing unicast connection can be reused in the process of re-establishing the unicast connection. Therefore, the node authentication and key establishment processes in the unicast connection establishment process can be omitted, thereby speeding up the connection establishment speed.
[0014] In combination with the first aspect, in certain implementations of the first aspect, when the first terminal device maintains the first unicast connection, the method also includes: the first terminal device receives a first request message from the second terminal device, the first request message is used to request to establish a unicast connection with at least one terminal device, and the first request message includes the key identifier; when the first terminal device determines that the first unicast connection can be reused, the second request message is sent to the second terminal device, and the second request message is used to request to modify the first unicast connection.
[0015] In combination with the first aspect, in certain implementations of the first aspect, before the first terminal device receives the first request message from the second terminal device, the method also includes: the first terminal device receives a connection identifier update request message from the second terminal device; the first terminal device decrypts the connection identifier update request message based on the EK to obtain the third parameter included in the connection identifier update request message; the first terminal device sends a connection identifier update response message encrypted based on the EK to the second terminal device, and the connection identifier update response message includes a fourth parameter; the first terminal device updates the key identifier based on the third parameter and the fourth parameter.
[0016] In an embodiment of the present application, before the second terminal device initiates a unicast connection to the first terminal device again, it initiates a connection identifier update process so that the first terminal device and the second terminal device can generate a new key identifier. In addition, the first terminal device and the second terminal device use EK to encrypt the signaling exchanged in the connection identifier modification process, so the third parameter and the fourth parameter used to generate the new key identifier are not transmitted in plain text. Therefore, even if the second terminal device initiates a second unicast connection establishment process to the first terminal device, the direct communication request message sent by the second terminal device carries the key identifier in plain text, and a third-party attacker cannot associate the two unicast connections between the first terminal device and the second terminal device after obtaining the key identifier.
[0017] The third parameter may be the MSB of the key identifier, and the fourth parameter may be the LSB of the key identifier; or the third parameter may be the LSB of the key identifier, and the fourth parameter may be the MSB of the key identifier. The third parameter may uniquely index the key stored in the second terminal device, and the fourth parameter may uniquely index the key stored in the first terminal device.
[0018] In a second aspect, a method for generating a key identifier is provided. This method can be executed by a terminal device, or can also be executed by a component configured in the terminal device (such as a chip or chip system, etc.). This application is not limited to this. The following describes the method provided in the embodiments of this application using a terminal device as an example.
[0019] Specifically, the method includes: the second terminal device negotiates the EK with the first terminal device; the second terminal device sends a first message encrypted based on the EK to the first terminal device, and the first message includes a first parameter; the second terminal device receives a second message from the first terminal device; the second terminal device decrypts the second message based on the EK to obtain the second parameter included in the second message; the second terminal device generates a key identifier based on the first parameter and the second parameter, and the key identifier is used to index the key generated by the second terminal device and the first terminal device in the process of establishing a first unicast connection.
[0020] The encryption key can be used to encrypt a plaintext message to obtain a ciphertext message, and can also be used to decrypt a ciphertext message to obtain a plaintext message.
[0021] Based on the above technical solution, after the second terminal device and the first terminal device both generate encryption keys for encrypting and decrypting signaling, the second terminal device and the first terminal device then exchange the first parameter and the second parameter that constitute the key identifier. In this case, the signaling exchanged between the second terminal device and the first terminal device is all signaling encrypted using the encryption key. Therefore, the attacker will not be able to obtain the first parameter and the second parameter carried in the signaling exchanged between the second terminal device and the first terminal device. Furthermore, even if the second terminal device carries the key identifier generated during the establishment of this unicast connection in plain text in the next direct communication request message sent, the attacker will not be able to associate the unicast connection between the second terminal device and the first terminal device with the next unicast connection between the second terminal device and the first terminal device after obtaining the key identifier, thereby avoiding the problem of privacy leakage.
[0022] Optionally, the first message may be a direct connection security mode completion message during security mode activation; the second message may be a direct connection communication acceptance message during unicast connection establishment, or a direct connection security mode confirmation message during full mode activation.
[0023] The first parameter may be the MSB of the key identifier, and the second parameter may be the LSB of the key identifier; or the first parameter may be the LSB of the key identifier, and the second parameter may be the MSB of the key identifier. The first parameter may uniquely index the key stored in the second terminal device, and the first parameter may uniquely index the key stored in the first terminal device.
[0024] In combination with the second aspect, in certain implementations of the second aspect, when the second terminal device maintains the first unicast connection, the method also includes: the second terminal device sends a first request message, the first request message is used to request to establish a unicast connection with at least one terminal device, and the first request message includes the key identifier; the second terminal device receives a first response message from the first terminal device, and the first response message is used to initiate a security negotiation process for a second unicast connection between the first terminal device and the second terminal device; wherein the first response message includes the key identifier, and the key identifier is used to indicate that the key is reused in the second unicast connection.
[0025] Based on the above technical solution, when the second terminal device is establishing a unicast connection for a new service, if it hopes that the first terminal device intends to re-establish a unicast connection with the second terminal device, the second terminal device carries a key identifier in the broadcast direct communication request message. Accordingly, the first terminal device can index the saved key of the existing unicast connection (i.e., the first unicast connection) based on the key identifier carried in the direct communication request message, and then determine that the key of the existing unicast connection can be reused in the process of re-establishing the unicast connection. Therefore, the node authentication and key establishment processes in the unicast connection establishment process can be omitted, thereby speeding up the connection establishment speed.
[0026] In combination with the second aspect, in certain implementations of the second aspect, when the second terminal device maintains a first unicast connection, the method also includes: the second terminal device sends a first request message, the first request message is used to request to establish a unicast connection with at least one terminal device, and the first request message includes the key identifier; the second terminal device receives a second request message from the first terminal device, and the second request message is used to request to modify the first unicast connection.
[0027] In combination with the second aspect, in certain implementations of the second aspect, before the second terminal device sends the first request message, the method also includes: the second terminal device sends a connection identifier update request message encrypted based on the EK to the first terminal device, and the connection identifier update request message includes a third parameter; the second terminal device receives a connection identifier update response message from the first terminal device; the second terminal device decrypts the connection identifier update response message based on the EK to obtain a fourth parameter in the connection identifier update response message; the second terminal device updates the key identifier based on the third parameter and the fourth parameter.
[0028] In an embodiment of the present application, before the second terminal device initiates a unicast connection to the first terminal device again, it initiates a connection identifier update process so that the first terminal device and the second terminal device can generate a new key identifier. In addition, the first terminal device and the second terminal device use EK to encrypt the signaling exchanged in the connection identifier modification process, so the third parameter and the fourth parameter used to generate the new key identifier are not transmitted in plain text. Therefore, even if the second terminal device initiates a second unicast connection establishment process to the first terminal device, the direct communication request message sent by the second terminal device carries the key identifier in plain text, and a third-party attacker cannot associate the two unicast connections between the first terminal device and the second terminal device after obtaining the key identifier.
[0029] The third parameter may be the MSB of the key identifier, and the fourth parameter may be the LSB of the key identifier; or the third parameter may be the LSB of the key identifier, and the fourth parameter may be the MSB of the key identifier. The third parameter may uniquely index the key stored in the second terminal device, and the fourth parameter may uniquely index the key stored in the first terminal device.
[0030] In a third aspect, a communication device is provided, comprising modules or units for executing the method in the first aspect and any possible implementation manner of the first aspect.
[0031] In a fourth aspect, a communication device is provided, comprising a processor. The processor is coupled to a memory and configured to execute instructions in the memory to implement the method of the first aspect and any possible implementation of the first aspect. Optionally, the communication device further comprises a memory. Optionally, the communication device further comprises a communication interface, the processor being coupled to the communication interface.
[0032] In one implementation, the communication device is a first terminal device. When the communication device is the first terminal device, the communication interface may be a transceiver, or an input / output interface.
[0033] In another implementation, the communication device is a chip configured in the first terminal device. When the communication device is a chip configured in the first terminal device, the communication interface may be an input / output interface.
[0034] Optionally, the transceiver may be a transceiver circuit. Optionally, the input / output interface may be an input / output circuit.
[0035] In a fifth aspect, a communication device is provided, comprising modules or units for executing the method in the second aspect and any possible implementation manner of the second aspect.
[0036] In a sixth aspect, a communication device is provided, comprising a processor. The processor is coupled to a memory and configured to execute instructions in the memory to implement the method of the second aspect and any possible implementation thereof. Optionally, the communication device further comprises a memory. Optionally, the communication device further comprises a communication interface, the processor being coupled to the communication interface.
[0037] In one implementation, the communication device is a second terminal device. When the communication device is a second terminal device, the communication interface may be a transceiver, or an input / output interface.
[0038] In another implementation, the communication device is a chip configured in the second terminal device. When the communication device is a chip configured in the second terminal device, the communication interface may be an input / output interface.
[0039] Optionally, the transceiver may be a transceiver circuit. Optionally, the input / output interface may be an input / output circuit.
[0040] In a seventh aspect, a processor is provided, comprising: an input circuit, an output circuit, and a processing circuit. The processing circuit is configured to receive a signal via the input circuit and transmit a signal via the output circuit, so that the processor executes the method of any possible implementation of the first and second aspects above.
[0041] In a specific implementation, the processor may be a chip, the input circuit may be an input pin, the output circuit may be an output pin, and the processing circuit may be a transistor, a gate circuit, a trigger, or various logic circuits. The input signal received by the input circuit may be, for example, but not limited to, received and input by a receiver, and the signal output by the output circuit may be, for example, but not limited to, output to and transmitted by a transmitter. The input circuit and the output circuit may be the same circuit, which functions as an input circuit and an output circuit at different times. The embodiments of the present application do not limit the specific implementation of the processor and various circuits.
[0042] In an eighth aspect, a processing device is provided, comprising a processor and a memory. The processor is configured to read instructions stored in the memory and receive signals via a receiver and transmit signals via a transmitter to execute the method of any possible implementation of the first and second aspects and any possible implementation of the first and second aspects.
[0043] Optionally, there are one or more processors and one or more memories.
[0044] Optionally, the memory may be integrated with the processor, or the memory may be provided separately from the processor.
[0045] In the specific implementation process, the memory can be a non-transitory memory, such as a read-only memory (ROM), which can be integrated with the processor on the same chip or can be set on different chips. The embodiments of the present application do not limit the type of memory and the setting method of the memory and the processor.
[0046] It should be understood that related data interaction processes, such as sending indication information, can be the process of outputting indication information from the processor, and receiving capability information can be the process of receiving input capability information from the processor. Specifically, the output data of the processing can be output to the transmitter, and the input data received by the processor can come from the receiver. The transmitter and receiver can be collectively referred to as a transceiver.
[0047] The processing device in the above-mentioned eighth aspect can be a chip. The processor can be implemented by hardware or by software. When implemented by hardware, the processor can be a logic circuit, an integrated circuit, etc.; when implemented by software, the processor can be a general-purpose processor, which is implemented by reading the software code stored in the memory. The memory can be integrated in the processor or can be located outside the processor and exist independently.
[0048] In the ninth aspect, a computer program product is provided, which includes: a computer program (also referred to as code, or instructions), which, when executed, enables a computer to execute the method in the above-mentioned first aspect to the second aspect and any possible implementation of the first aspect to the second aspect.
[0049] In the tenth aspect, a computer-readable storage medium is provided, which stores a computer program (also referred to as code, or instructions). When the computer-readable storage medium is run on a computer, the computer executes the method in the above-mentioned first aspect to the second aspect and any possible implementation of the first aspect to the second aspect.
[0050] In an eleventh aspect, a communication system is provided, comprising the aforementioned first terminal device and second terminal device. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] Figure 1 It is a schematic diagram of a communication system applicable to the method provided in the embodiment of the present application.
[0052] Figure 2 The figure is a schematic flow chart of a method for establishing a unicast connection between two terminal devices.
[0053] Figure 3 This is a schematic flowchart of a method for generating a key identifier provided in an embodiment of the present application.
[0054] Figure 4 This is a schematic flowchart of a method for re-establishing a unicast connection between two terminal devices provided in an embodiment of the present application.
[0055] Figure 5 This is a schematic flowchart of a method for generating a key identifier provided in an embodiment of the present application.
[0056] Figure 6 This is a schematic flowchart of a method for generating a key identifier provided in another embodiment of the present application.
[0057] Figure 7 This is a schematic flowchart of a method for generating a key identifier provided in another embodiment of the present application.
[0058] Figure 8 A schematic block diagram of a communication device provided in an embodiment of the present application.
[0059] Figure 9 It is a structural diagram of the terminal device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0060] The technical solution in this application will be described below with reference to the accompanying drawings.
[0061] The technical solutions of the embodiments of the present application can be applied to various communication systems, such as: Long Term Evolution (LTE) system, LTE frequency division duplex (FDD) system, LTE time division duplex (TDD) system, universal mobile telecommunication system (UMTS), world-wide interoperability for microwave access (WiMAX) communication system, fifth generation (5G) mobile communication system or new radio access technology (NR) or next generation communication, such as 6G. Among them, the 5G mobile communication system can be a non-standalone (NSA) or a standalone (SA) network.
[0062] The technical solution provided in this application can also be applied to machine type communication (MTC), long term evolution technology for machine-to-machine communication (LTE-M), device-to-device (D2D) network, machine-to-machine (M2M) network, Internet of Things (IoT) network or other networks. Among them, the IoT network may include, for example, the Internet of Vehicles. Among them, the communication mode in the Internet of Vehicles system is collectively referred to as vehicle to other devices (vehicle to X, V2X, X can represent anything), for example, the V2X may include: vehicle to vehicle (V2V) communication, vehicle to infrastructure (V2I) communication, vehicle to pedestrian (V2P) communication or vehicle to network (V2N) communication, etc.
[0063] The technical solution provided in this application can also be applied to future communication systems, such as the sixth generation mobile communication system, etc. This application does not limit this.
[0064] In the embodiments of the present application, the terminal device may be referred to as user equipment (UE), terminal, mobile station (MS), and mobile terminal, etc.; the terminal device may also communicate with one or more core networks via a radio access network (RAN). The terminal device may also be referred to as an access terminal, a user unit, a user station, a mobile station, a mobile station, a remote station, a remote terminal, a mobile device, a user terminal, a terminal, a wireless communication device, a user agent, or a user apparatus. The terminal device may also be a cellular phone, a cordless phone, a session initiation protocol (SIP) phone, a wireless local loop (WLL) station, a personal digital assistant (PDA), a handheld device with wireless communication capabilities, a computing device or other processing device connected to a wireless modem, an in-vehicle device, a vehicle with communication capabilities, a wearable device, and a terminal device in a 5G network, etc. The embodiments of the present application are not limited to this.
[0065] Figure 1It is a schematic diagram of a communication system applicable to the method provided in the embodiment of the present application.
[0066] like Figure 1 As shown, the communication system 100 may include at least two terminal devices, such as Figure 1 The terminal device 110 and the terminal device 120 are shown. The terminal device 110 and the terminal device 120 can communicate with each other via the PC5 interface. The wireless direct communication link formed between the terminal device 110 and the terminal device 120 can be defined as a sidelink (SL).
[0067] It should be understood that the figure is merely illustrative, showing two terminal devices, but this does not constitute any limitation on the present application. The communication system may include a greater number of terminal devices, and at least two terminal devices in the communication system may communicate with each other via the PC5 interface. The communication system may also include one or more network devices, and the terminal devices in the communication system may communicate with the network devices via the Uu interface.
[0068] Terminal devices can perform unicast and broadcast communications on the SL. Unicast communication is a one-to-one data transmission between two terminal devices, for example Figure 1 In the broadcast communication, the terminal device 110 sends data to the terminal device 120 in a unicast manner. In this case, only the terminal device 120 can receive the data sent by the terminal device 110. The so-called broadcast communication means that the data sent by a terminal device can be received by all terminal devices within a certain range. Figure 1 In the embodiment, the terminal device 110 transmits data in a broadcasting manner. When the distance between the terminal device 120 and the terminal device 110 is within a certain range, the terminal device 120 can receive the data transmitted by the terminal device 110. Figure 1 Although only two terminal devices 110 and 120 are shown in the figure, in a broadcast scenario, a terminal device group may include more terminal devices. In other words, the data sent by terminal device 121 can be received by more terminal devices. Although this is not shown in the figure, it should not constitute any limitation to this application.
[0069] When two terminal devices are performing unicast communication, a unicast connection is first established. During the process of establishing a unicast connection, the UEs at both ends are divided into the initial UE (initiation UE) and the peer UE (peer UE) according to who initiates the connection establishment. Figure 2 As shown, UE#1 can be called the initial UE and UE#2 can be called the peer UE. When the initial UE sends a direct communication request (DCR) message, it can specify a unicast connection with a specific UE, for example, Figure 2 As shown, UE#1 specifies to establish a unicast connection with UE#2. The initial UE may also not be aware of the identity of the opposite UE, that is, it may request to establish a unicast connection with one or more UEs.
[0070] The following combination Figure 2 The process of establishing a unicast connection between two UEs is described by taking UE#1 specifying to establish a unicast connection with UE#2 as an example.
[0071] S210, UE#1 sends a DCR message to UE#2.
[0072] The DCR message may include the random number (nonce) #1 generated by UE#1, the application layer identifier of UE#1, the application layer identifier of UE#2, and the MSB of the identifier (ID) of the new radio PC5 (NRP) interface session key. For ease of understanding, the session key of the new radio PC5 interface is denoted as K NRP-sess , the session key identifier of the new air interface PC5 is recorded as K NRP-sess ID.
[0073] Among them, K NRP-sess The MSB of ID is used to generate K NRP-sess ID.
[0074] It can be understood that the application layer identifier can uniquely identify a UE.
[0075] It can be understood that if UE#1 sends the DCR message in a broadcast manner, the DCR message does not carry the application layer identifier of the opposite UE.
[0076] If UE#1 and UE#2 have already established a unicast connection before this unicast connection is established, the DCR message can also carry the identifier of the new air interface PC5 interface key generated during the previous unicast connection process. For ease of understanding, the new air interface PC5 interface key is denoted as K NRP , the identifier of the new air interface PC5 interface key is recorded as K NRP ID.
[0077] Among them, K NRP ID is used to indicate the reuse of K in the previous unicast connection process NRP , thus eliminating the authentication and key establishment process during this unicast connection.
[0078] S220 , UE#1 and UE#2 perform direct connection authentication and key establishment.
[0079] If this is the first time that UE#1 and UE#2 are performing a unicast connection establishment process, or if the security context from the previous unicast connection establishment process is not reused, UE#2 triggers the direct connection authentication and key establishment process with UE#1 after receiving the DCR message from UE#1.
[0080] After UE#1 and UE#2 complete the authentication and key establishment process, UE#1 and UE#2 generate K used in subsequent unicast communications. NRP .
[0081] Furthermore, UE#2 randomly generates K NRP MSB of ID, K NRP-sess LSB of ID and nonce#2, and use K NRP , nonce#1 and nonce#2 calculate the session key K NRP-sess . Further, UE#2 uses the session key K NRP-sess Calculate the NRP encryption key (NRPEK) and NRP integrity key (NRPIK). Among them, K generated by UE#2 NRP MSB of ID and K NRP-sess The LSB of the ID can be used to uniquely index the K stored by UE#2. NRP and K NRP-sess .
[0082] S230, UE#2 sends a direct security mode command message to UE#1.
[0083] The direct connection security mode command message can carry K NRP MSB of ID, K NRP-sess The LSB of the ID and nonce#2. In addition, UE#2 can use the NRPIK to perform integrity protection on the direct security mode request message.
[0084] Since UE#2 only performs integrity protection on the direct mode security request message, but does not perform encryption protection, K NRP The MSB of the ID can be easily obtained by a third-party node or an attacker.
[0085] S240, UE#1 sends a direct security mode complete message to UE#2.
[0086] After UE#1 receives the direct security mode command message, it uses nonce#1, nonce#2 and K NRP Calculate K NRP-sess , and then further use K NRP-sess Calculate NRPEK and NRPIK.
[0087] Furthermore, UE#1 randomly generates K NRP The LSB of ID and K NRP The LSB of the ID is sent to UE#2 via the direct connection security mode completion message. NRP The LSB of the ID can uniquely index the K stored by UE#1. NRP .
[0088] As mentioned above, if an attacker monitors the unicast establishment process between UE#1 and UE#2, the attacker can obtain K from the direct connection security mode request message. NRP MSB of the ID.
[0089] After that, the attacker continues to monitor the communication process between UE#1 and UE#2 until UE#1 or UE#2 sends a direct communication request message again that carries the K generated during this unicast connection process. NRP ID, then the attacker can obtain the K NRP The MSB of the ID and the currently obtained K NRP If the MSBs are the same, the attacker can assume that UE#1 and UE#2 have established a unicast connection again, making the two unicast connections between UE#1 and UE#2 correlated. This can further allow the attacker to obtain the communication data between UE#1 and UE#2, leading to privacy leakage.
[0090] In view of this, an embodiment of the present application provides a method for generating a key identifier, which can avoid the problem of privacy leakage during unicast communication.
[0091] The method provided in the embodiments of the present application will be described below with reference to the accompanying drawings.
[0092] Combined with the following Figures 3 to 7 In the various method embodiments described, the interaction between the first terminal device and the second terminal device is taken as an example to describe the process of each method embodiment. Figure 1 In the communication system shown in FIG, the second terminal device may correspond to the terminal device 110, for example Figure 2 The terminal device 120 in the communication system shown in FIG.
[0093] It should be noted that the embodiments shown below do not specifically limit the specific structure of the execution subject of the method provided in the embodiments of the present application. As long as it is possible to communicate according to the method provided in the embodiments of the present application by running a program that records the code of the method provided in the embodiments of the present application, for example, the execution subject of the method provided in the embodiments of the present application can be a terminal device, or a functional module in the terminal device that can call and execute the program.
[0094] Figure 3 FIG1 shows a schematic flow chart of a method for establishing a unicast connection provided by an embodiment of the present application. Figure 3 As shown, the method 300 may include S310 to S340, and each step is described in detail below.
[0095] S310: The second terminal device and the first terminal device respectively generate an encrypted key (EK).
[0096] The EK is used to encrypt the signaling exchanged between the second terminal device and the first terminal device, that is, the second terminal device can use the EK to encrypt the signaling sent to the first terminal device, and the first terminal device can use the EK to encrypt the signaling sent to the second terminal device.
[0097] The second terminal device and the first terminal device may generate an EK according to the session key.
[0098] The session key can be, for example, K NRP-sess . K NRP-sess The first terminal device and the second terminal device use the new air interface PC5 interface key K NRP , a first random number generated by the first terminal (hereinafter referred to as nonce#1 for example) and a second random number generated by the second terminal device (hereinafter referred to as nonce#2 for example). NRP It is generated by the second terminal device and the first terminal device during the direct connection authentication and key establishment process. As can be seen from the above, after the first terminal device receives the DCR message from the second terminal device, if it is interested in the unicast service initiated by the second terminal device, the first terminal device can initiate the direct connection authentication and key establishment process with the second terminal device.
[0099] The second terminal device may carry nonce#2 in a DCR message and send it to the first terminal device.
[0100] The first terminal device may carry nonce#1 in a direct connection security mode command message and send it to the second terminal device.
[0101] As can be seen from the above, after the first terminal device receives the DCR message from the second terminal device and performs the direct connection authentication and key establishment process, it can generate an EK. After the second terminal device receives the direct connection security mode command message from the first terminal device, it can generate an EK. In the case where both the second terminal device and the first terminal device generate EKs, that is, after the first terminal device sends the direct connection security mode security command message to the second terminal device, the signaling exchanged between the second terminal device and the first terminal device can be encrypted using the EK.
[0102] The second terminal device and the first terminal device may also generate integrity protection keys (integrity keys, IK) respectively.
[0103] IK is used to perform integrity protection on the signaling exchanged between the second terminal device and the first terminal device, that is, the second terminal device uses IK to perform integrity protection on the signaling sent to the first terminal device, and the first terminal device uses IK to perform integrity protection on the signaling sent to the second terminal device.
[0104] The second terminal device and the first terminal device can generate IK based on the session key. The session key can be, for example, K NRP-sess , K NRP-sess It can be based on K NRP , nonce#1 and nonce#2 are calculated.
[0105] S320: The second terminal device sends a first message encrypted based on the EK to the first terminal device.
[0106] It can be understood that after the second terminal device generates the EK, the first message sent by the second terminal device to the first terminal device is a message encrypted using the EK.
[0107] The first message includes a first parameter, which is used to generate a key identifier. The key can be, for example, K NRP , the key identifier can be, for example, K NRP ID. K NRP The ID is used to uniquely index the K generated by the first terminal device and the second terminal device during the process of establishing the first unicast connection. NRP , or in other words, K NRP ID is used to indicate the security context between the second terminal device and the first terminal device, K NRP It is generated by the second terminal device and the first terminal device during the direct connection authentication and key establishment process.
[0108] The first message may be a direct connection safety mode completion message in the safety mode activation process.
[0109] As described above, after the second terminal device receives the direct connection security mode command message, the signaling exchanged between the second terminal device and the first terminal device can be encrypted using the EK.
[0110] Therefore, the direct connection security mode completion message sent by the second terminal device is a message encrypted using the EK.
[0111] The embodiment of the present application does not limit the specific content of the first parameter.
[0112] In one implementation, the first parameter may be K NRP MSB of the ID.
[0113] In another implementation, the first parameter may be K NRP LSB of the ID.
[0114] It can be understood that whether the first parameter is K NRP Whether the MSB or LSB of the ID, the first parameter can uniquely index the K stored in the second terminal device. NRP .
[0115] Accordingly, in S320 , the first terminal device receives the first message from the second terminal device, and decrypts the first message based on the EK to obtain the first parameter included in the first message.
[0116] S330: The first terminal device sends a second message encrypted based on the EK to the second terminal device.
[0117] It can be understood that after the first terminal device generates the EK, the second message sent by the first terminal device to the second terminal device is a message encrypted using the EK.
[0118] The second message includes a second parameter, which is used to generate K NRP ID.
[0119] In one implementation, the second message may be a direct communication accept message in a unicast connection establishment process.
[0120] As described above, after the first terminal device sends the direct connection security mode command message to the second terminal device, all signalings exchanged between the second terminal device and the first terminal device can be encrypted using the EK.
[0121] Therefore, the direct communication acceptance message sent by the first terminal device may be a message encrypted using the EK.
[0122] In another implementation, the second message may also be a direct security mode confirm message during the security mode activation process.
[0123] In the embodiment of the present application, a direct connection safety mode confirmation message is added to the existing safety mode activation process. The first terminal device can carry the second parameter in the direct connection safety mode confirmation message and send it to the second terminal device.
[0124] Likewise, the direct connection security mode confirmation message sent by the first terminal device may be a message encrypted using the EK.
[0125] The embodiment of the present application does not limit the specific content of the second parameter.
[0126] In one implementation, the second parameter may be K NRP MSB of the ID.
[0127] In another implementation, the second parameter may be K NRP LSB of the ID.
[0128] It can be understood that whether the second parameter is K NRP Whether the MSB or LSB of the ID, the second parameter can uniquely index the K stored in the first terminal device. NRP .
[0129] Accordingly, in S330 , the second terminal device receives the second message from the first terminal device, and decrypts the second message based on the EK to obtain a second parameter included in the second message.
[0130] S340: The second terminal device and the first terminal device generate K using the first parameter and the second parameter. NRP ID.
[0131] It should be understood that the first parameter and the second parameter cannot be both K NRP The MSB and LSB of ID. That is, if the first parameter is K NRP ID MSB, the second parameter is K NRP LSB of ID; if the first parameter is K NRP The LSB of ID, the second parameter is K NRP MSB of the ID.
[0132] It should also be understood that if the second terminal device and the first terminal device obtain multiple first parameters or second parameters, the second terminal device and the first terminal device use the most recently obtained first parameter and second parameter to generate K NRP ID.
[0133] For example, the first parameter is KNRP LSB of ID, the second parameter is K NRP The first terminal device carries K in the direct connection security mode command message sent to the second terminal device. NRP The second terminal device carries K in the direct connection security mode completion message sent to the first terminal device. NRP LSB#1 of ID (i.e. the first parameter). Further, the first terminal device carries K in the direct communication acceptance message sent to the second terminal device. NRP MSB#2 of ID (i.e., the second second parameter). In this case, both the second terminal device and the first terminal device obtain K NRP MSB#1 and MSB#2 of ID (i.e. two second parameters), and K NRP It can be understood that the first terminal device and the second terminal device first obtain the first second parameter (K NRP ID's MSB#1), and then got the second parameter (K NRP MSB#2 of ID, i.e. K NRP The MSB#2 of the ID is the latest one obtained by the first terminal device and the second terminal device, so the second terminal device and the second terminal device generate K by using MSB#2 and LSB#1. NRP ID.
[0134] In an embodiment of the present application, after the second terminal device and the first terminal device both generate an encryption key for encrypting the signaling, the second terminal device and the first terminal device then exchange the most significant bit and the least significant bit of the key identifier. In this case, the signaling exchanged between the second terminal device and the first terminal device is all signaling encrypted using the encryption key, so an attacker will not be able to obtain the most significant bit and the least significant bit of the key identifier carried in the signaling exchanged between the second terminal device and the first terminal device. Furthermore, even if the second terminal device carries the key identifier generated during the unicast connection establishment process in plain text in the next direct communication request message sent, the attacker will not be able to associate the unicast connection between the second terminal device and the first terminal device with the next unicast connection between the second terminal device and the first terminal device after obtaining the key identifier.
[0135] Figure 4 FIG2 shows a schematic flow chart of a method for a second terminal device to establish a unicast connection with a first terminal device again. Figure 4 As shown, the method 400 may include S410 to S450, and each step is described in detail below. It should be understood that Figure 4The example of the second terminal device initiating a unicast connection is used for illustration only and should not be construed as limiting the embodiments of the present application. The first terminal device may also actively initiate another unicast connection with the second terminal device.
[0136] S410, the second terminal device sends a first request message in a broadcast manner.
[0137] The first request message is used to request to establish a unicast connection with at least one other terminal device. The first request message includes the K generated by the second terminal device and the first terminal device in the last unicast connection establishment process. NRP ID. The first request message may be a DCR message.
[0138] It should be understood that before the second terminal device sends the first request message, the second terminal device has established a unicast connection with the first terminal device, and the second terminal device still maintains a unicast connection with the first terminal device (an example of the first unicast connection), that is, data or services are still transmitted between the second terminal device and the first terminal device through the unicast link established previously.
[0139] For ease of understanding, the unicast connection established between the second terminal device and the first terminal device before the second terminal device sends the first request message is referred to as the first unicast connection, and the unicast connection established between the second terminal device and the first terminal device based on the first request message is referred to as the second unicast connection.
[0140] When the second terminal device maintains the first unicast connection with the first terminal device, the second terminal device initiates a unicast connection request for the second unicast connection. At this time, the second terminal device does not know whether the first terminal device is interested in the new service request, but hopes to reuse the key generated in the first unicast connection if the first terminal device is interested in the new service request. The second terminal device carries the K generated in the first unicast connection in the broadcast DCR message. NRP ID.
[0141] Correspondingly, after the first terminal device receives the DCR message from the second terminal device, according to the K NRP The ID can be associated with the K used by the second terminal device in the first unicast connection NRP .
[0142] Furthermore, the first terminal device can determine whether the first unicast connection can be reused based on other parameters carried in the DCR message, that is, whether new data or services can be transmitted on the unicast link established during the first unicast connection process.
[0143] If the first terminal device determines that the first unicast connection cannot be reused, S420a is executed.
[0144] If the first terminal device determines that the first unicast connection can be reused, S420b is executed.
[0145] S420a, the first terminal device sends a first response message to the second terminal device.
[0146] The first response message is used to initiate a unicast connection security negotiation process with the second terminal device. The first response message may include the K generated during the first unicast connection process. NRP ID. K NRP The ID is used to indicate that the second terminal device can reuse the K in the first unicast connection in the second unicast connection. NRP The first response message may be a direct safety mode command message during the safety mode activation process.
[0147] When the first terminal device determines that the first unicast connection cannot be reused, it initiates a security negotiation process for the second unicast connection with the second terminal device. The first terminal device may include the K in the first unicast connection in the direct connection security mode command message sent to the second terminal device. NRP ID, K NRP The ID is used to indicate that the second terminal device can reuse the K in the first unicast connection in the second unicast connection. NRP .
[0148] The second terminal device and the first terminal device reuse the K of the first unicast connection NRP In the case of , the second terminal device and the first terminal device may not perform the direct connection authentication and key establishment process in the security negotiation process of the second unicast connection. That is, the second terminal device and the first terminal device use the K generated in the first unicast connection establishment process in the second unicast connection. NRP .
[0149] S420b, the first terminal device sends a second request message to the second terminal device.
[0150] The second request message is used to request modification of the first unicast connection, that is, to request modification of the unicast link established in the first unicast connection.
[0151] When the first terminal device determines that the first unicast connection can be reused, a modification process of the unicast link established in the first unicast connection is initiated so that new services and previous services are transmitted simultaneously on the unicast link established in the first unicast connection.
[0152] In an embodiment of the present application, when the second terminal device is establishing a unicast connection for a new service, if it wishes for the first terminal device to re-establish a unicast connection with the second terminal device, the second terminal device carries a key identifier in the broadcast direct communication request message. Accordingly, the first terminal device can index the saved key of the existing unicast connection (i.e., the first unicast connection) based on the key identifier carried in the direct communication request message, and then determine that the key of the existing unicast connection can be reused in the process of re-establishing the unicast connection. Therefore, the node authentication and key establishment processes in the unicast connection establishment process can be omitted, thereby speeding up the connection establishment speed.
[0153] Optionally, before the second terminal device sends the direct communication request message, that is, before the second terminal device initiates a second unicast connection establishment to the first terminal device, the second terminal device may initiate a connection identifier update process to update the key identifier.
[0154] It should be understood that Figure 4 Herein, only the process of initiating a connection identifier update process before the second terminal device initiates the establishment of a second unicast connection to the first terminal device is used as an example for explanation.
[0155] In some possible implementations, the second terminal device may also initiate a connection identifier update process immediately after establishing the first unicast connection with the first terminal device to update the key identifier.
[0156] In some other possible implementations, the second terminal device may initiate a connection identifier update process to update the key identifier at any time after establishing the first unicast connection with the first terminal device and before establishing the second unicast connection.
[0157] The second terminal device initiates a connection identifier update process to update the key identifier, which may include steps S430 to S450.
[0158] S430: The second terminal device sends a link identifier update request message to the first terminal device.
[0159] It can be understood that the second terminal device can generate an EK during the first unicast connection process. Therefore, when the second terminal device still maintains the first unicast connection, the second terminal device can use the EK to encrypt the connection identifier update request message.
[0160] The connection identifier update request message may include a third parameter, which is used to generate K NRP ID.
[0161] The embodiment of the present application does not limit the specific content of the third parameter.
[0162] In one implementation, the third parameter may be K NRP MSB of the ID.
[0163] In another implementation, the third parameter may be K NRP LSB of the ID.
[0164] It can be understood that whether the third parameter is K NRP The MSB or LSB of the ID, the third parameter can uniquely index the K stored in the second terminal device. NRP .
[0165] Accordingly, in S430, after receiving the connection identifier update request message from the second terminal device, the first terminal device may decrypt the connection identifier update request message based on the EK to obtain the third parameter included in the connection identifier update request message.
[0166] S440: The first terminal device sends a link identifier update response (link identifier update response) encrypted based on the EK to the second terminal device.
[0167] The connection identifier update response message may include a fourth parameter, which is used to generate K NRP ID.
[0168] The embodiment of the present application does not limit the specific content of the fourth parameter.
[0169] In one implementation, the fourth parameter may be K NRP MSB of the ID.
[0170] In another implementation, the fourth parameter may be K NRP LSB of the ID.
[0171] It can be understood that whether the fourth parameter is K NRP Whether the MSB or LSB of the ID, the fourth parameter can uniquely index the K stored in the first terminal device. NRP .
[0172] Accordingly, in S440, after receiving the connection identifier update response message from the first terminal device, the second terminal device may decrypt the connection identifier update response message based on the EK to obtain the fourth parameter included in the connection identifier update response message.
[0173] S450: The first terminal device and the second terminal device generate a key identifier based on the third parameter and the fourth parameter.
[0174] It should be understood that the third parameter and the fourth parameter cannot be both K NRPThe MSB and LSB of ID. That is, if the third parameter is K NRP ID MSB, the fourth parameter is K NRP LSB of ID; if the third parameter is K NRP The LSB of ID, the fourth parameter is K NRP MSB of the ID.
[0175] It should also be understood that if the second terminal device and the first terminal device obtain multiple third parameters or fourth parameters, the second terminal device and the first terminal device use the most recently obtained third parameter and fourth parameter to generate the key identifier.
[0176] In an embodiment of the present application, before the second terminal device initiates a unicast connection to the first terminal device again, it initiates a connection identifier update process so that the first terminal device and the second terminal device can generate a new key identifier. In addition, the first terminal device and the second terminal device use EK to encrypt the signaling exchanged in the connection identifier modification process, so the MSB and LSB used to generate the new key identifier are not transmitted in plain text. Therefore, even if the second terminal device initiates a second unicast connection establishment process to the first terminal device, the direct communication request message sent by the second terminal device carries the key identifier in plain text. After obtaining the key identifier, a third-party attacker cannot associate the two unicast connections between the first terminal device and the second terminal device.
[0177] Figure 5 Schematic flow chart of the method provided in the embodiment of the present application is shown. Figure 5 As shown, the method 500 may include S501 to S515, and each step is described in detail below.
[0178] S501: The second terminal device sends a direct communication request message #1. Accordingly, in S501, the first terminal device receives the direct communication request message #1 from the second terminal device.
[0179] As an example and not a limitation, the direct communication request message #1 may include the following parameters: nonce #2, the application layer identifier of the second terminal device, and K NRP-sess ID MSB.
[0180] In the case where the second terminal device specifically requests to establish a unicast connection with the first terminal device, the direct communication request message #1 may further include an application layer identifier of the first terminal device.
[0181] Assuming that the second terminal device and the first terminal device establish a unicast connection for the first time based on the direct communication request message #1, after S501, the method 500 may further include S502.
[0182] S502: A direct connection authentication and key establishment process is performed between the second terminal device and the first terminal device.
[0183] Specifically, the specific steps of executing the direct connection authentication and key establishment process between the second terminal device and the first terminal device can refer to the existing technology. For the sake of brevity, the embodiments of this application will not be described in detail.
[0184] It is understood that after the direct connection authentication and key establishment process, the second terminal device and the first terminal device can negotiate the K used in the subsequent unicast communication process. NRP .
[0185] Furthermore, the first terminal device can obtain the nonce#2 from the direct communication request message, the nonce#1 generated by the first terminal device, and K NRP Generate K NRP-sess Furthermore, the first terminal device can use K NRP-sess Generate an EK and an IK. The EK and the IK are used to encrypt and integrity protect the signaling exchanged between the second terminal device and the first terminal device.
[0186] S503: The first terminal device sends a direct connection safety mode command message #1 to the second terminal device. Accordingly, in S503, the second terminal device receives the direct connection safety mode command message #1 from the first terminal device.
[0187] As an example and not a limitation, the direct connection security mode command message #1 may include the following parameters: K NRP-sess LSB of ID and nonce#2.
[0188] Optionally, the direct connection security mode command message #1 may also include K NRP MSB#1 of ID (denoted as K NRP It is understandable that since the direct connection security mode command message #1 is not encrypted, it is easy for a third-party attacker to obtain the K in the direct connection security mode command message #1. NRP ID MSB#1.
[0189] After the second terminal device receives the direct connection security mode command message #1, it can NRP Generate K NRP-sess Furthermore, the second terminal device uses K NRP-sess Generate EK and IK.
[0190] It can be understood that after the second terminal device receives the direct connection security mode command message #1, the second terminal device and the first terminal device can both generate EK and IK. Therefore, the second terminal device and the first terminal device can use EK and IK to encrypt and integrity protect the subsequent interactive signaling.
[0191] S504: The second terminal device sends a direct connection security mode completion message #1 (an example of a first message) encrypted based on the EK to the first terminal device.
[0192] The direct connection security mode completion message #1 may include K NRP LSB#1 of ID (an example of the first parameter, denoted as K NRP ID LSB#1).
[0193] Accordingly, in S504, the first terminal device receives the direct connection security mode completion message #1 from the second terminal device, and can decrypt the direct connection security mode completion message #1 based on the EK to obtain the K included in the direct connection security mode completion message #1. NRP ID LSB#1.
[0194] S505: The first terminal device sends a direct communication acceptance message #1 (an example of a second message) encrypted based on the EK to the second terminal device.
[0195] The direct communication acceptance message #1 may include K NRP MSB#2 of ID (an example of the second parameter, denoted as K NRP IDMSB#2). It should be understood that K NRP ID MSB#2 is different from K NRP ID MSB#1.
[0196] Accordingly, in S505, the second terminal device receives the direct communication acceptance message #1 from the first terminal device, and can decrypt the direct communication acceptance message #1 based on the EK to obtain the K included in the direct communication acceptance message #1. NRP IDMSB#2.
[0197] It can be understood that after the second terminal device receives the direct communication acceptance message #1 from the first terminal device, it indicates that the unicast connection (i.e. Figure 5 Connection 1 shown in FIG, an example of a first unicast connection, has been successfully established.
[0198] S506: The first terminal device and the second terminal device generate K NRP ID (an example of a key identifier).
[0199] It should be understood that the first terminal device and the second terminal device are based on the latest acquired K NRP The LSB and MSB of ID generate K NRP ID. That is, the first terminal device and the second terminal device are based on K NRP ID MSB#2 and K NRP ID LSB#1 generates K NRP ID.
[0200] It can be understood that in S506, the first terminal device and the second terminal device generate K NRP K used by ID NRP IDMSB#2 and K NRP ID LSB#1 is not transmitted in plain text. Therefore, a third-party attacker cannot obtain K NRP ID MSB#2 and K NRP ID LSB#1.
[0201] After the first terminal device establishes connection 1 with the second terminal device, the first terminal device or the second terminal device may initiate a unicast connection request again.
[0202] S507, the second terminal device sends a direct communication request message #2 (an example of a first request message).
[0203] The direct communication request message #2 may include the application layer identifier of the second terminal device, the K generated by the second terminal device during the process of establishing the connection 1, NRP ID.
[0204] As can be seen from the above, it is used to generate K NRP ID K NRP ID MSB#2 and K NRP ID LSB#1 is not transmitted in plain text, so even if a third-party attacker obtains K from direct communication request message #2 NRP ID, and cannot connect connection 1 to this unicast connection ( Figure 5 , an example of a second unicast connection).
[0205] The second terminal device carries K in the direct communication request message #2 NRP For example, there are two types of IDs:
[0206] Case 1:
[0207] While the second terminal device still maintains the connection 1 established with the first terminal device, it initiates a unicast connection for a new service in a broadcast manner, i.e., it sends a direct communication request message #2 in a broadcast manner. Although the second terminal device does not specify which terminal device to establish a unicast connection with, it hopes that if the first terminal device is interested in the new service request, it will reuse the K generated during the process of establishing the connection 1. NRP Therefore, the second terminal device carries K in the direct communication request message sent NRP ID.
[0208] Case 2:
[0209] When both the second terminal device and the first terminal device release connection 1 but still retain the security context of connection 1, the second terminal device specifies to re-establish a unicast connection with the first terminal device. In this case, the direct communication request message #2 may also include the application layer identifier of the first terminal device.
[0210] Correspondingly, in S507, the first terminal device receives the direct communication request message #2 from the second terminal device.
[0211] When the first terminal device still maintains connection 1 established with the second terminal device, after the first terminal device receives the direct communication request message #2 from the second terminal device, it determines whether connection 1 can be reused based on other parameters carried in the direct communication request message, that is, whether new data or services can be transmitted on the unicast link established in connection 1.
[0212] If the first terminal device determines that connection 1 can be reused, S511 to S515 are executed after S507.
[0213] If the first terminal device determines that connection 1 cannot be reused, S508a to S510 and S515 are executed after S507.
[0214] When the first terminal device releases connection 1, after receiving the direct communication request message #2 from the second terminal device, the first terminal device can identify the identity of the second terminal device according to the application layer identifier of the second terminal device. NRP ID determines the K that can reuse connection 1 NRP Therefore, the first terminal device and the second terminal device can omit the direct connection authentication and key establishment process during the process of establishing connection 2. Furthermore, after S507, S508b to S510 and S515 are executed.
[0215] S508a, the first terminal device sends a direct connection security mode command message #2 (an example of a first response message) to the second terminal device.
[0216] The direct connection security mode command message #2 may include K NRP ID.
[0217] As described above, when the first terminal device determines that connection 1 cannot be reused, it sends a direct connection security mode command message #2 to the second terminal device to initiate a security negotiation process for a new unicast connection with the second terminal device. NRP ID is used to indicate that the second terminal device can reuse the K in connection 1 NRP .
[0218] Optionally, the direct connection security mode command message #2 may also include K NRP MSB#3 of ID (denoted as K NRP IDMSB#3).
[0219] S508b: The first terminal device sends a direct connection security mode command message #3 to the second terminal device.
[0220] The direct connection security mode command message #3 may include K NRP MSB#3 of ID (denoted as K NRP ID MSB#3).
[0221] S509, the second terminal device sends a direct connection security mode completion message #2 encrypted based on the EK to the first terminal device.
[0222] Direct connection security mode message #2 may include K NRP LSB#2 of ID (denoted as K NRP ID LSB#2).
[0223] Accordingly, in S509, the first terminal device receives the direct connection security mode completion message #2 from the second terminal device, and decrypts the direct connection security mode completion message #2 based on the EK to obtain the K included in the direct connection security mode completion message #2. NRP ID LSB#2.
[0224] S510, the first terminal device sends a direct communication acceptance message #2 encrypted based on the EK to the second terminal device.
[0225] The direct communication acceptance message #2 may include K NRP MSB#4 of ID (denoted as K NRP ID MSB#4).
[0226] Accordingly, in S510, the second terminal device receives the direct communication acceptance message #2 from the first terminal device, and decrypts the direct communication acceptance message #2 based on the EK to obtain the K included in the direct communication acceptance message #2. NRP ID MSB#4.
[0227] S511: The first terminal device and the second terminal device execute a connection modification process.
[0228] When the first terminal device determines that connection 1 can be reused, it initiates a modification process for the unicast link of connection 1 so that the new service and the previous service are transmitted simultaneously on the unicast link established in connection 1.
[0229] Specifically, the steps of the first terminal device and the second terminal device executing the connection modification process can refer to the existing technology. For the sake of brevity, the embodiments of the present application will not be described in detail.
[0230] S512: The first terminal device sends a connection identifier update request message (an example of a second request message) encrypted based on the EK to the second terminal device.
[0231] The connection identifier update request message may include K NRP MSB#3 of ID (denoted as K NRP ID MSB#3).
[0232] Accordingly, in S512, the second terminal device receives the connection identifier update request message from the first terminal device, and decrypts the connection identifier update request message based on the EK to obtain the K included in the connection identifier update request message. NRP IDMSB#3.
[0233] S513: The second terminal device sends a connection identifier update response message encrypted based on the EK to the first terminal device.
[0234] The connection identifier update response message may include K NRP ID MSB#3 and K NRP LSB#2 of ID (denoted as K NRP IDLSB#2).
[0235] Accordingly, in S513, the first terminal device receives the connection identifier update response message from the second terminal device, and decrypts the connection identifier update response message based on the EK to obtain the K included in the connection identifier update request message. NRP IDMSB#3 and K NRP ID LSB#2.
[0236] S514, the first terminal device sends a link identifier update confirmation (linkidentifier update ack) message encrypted based on the EK to the second terminal device.
[0237] The connection identifier update confirmation message may include K NRP ID LSB#2.
[0238] Accordingly, in S514, the second terminal device receives the connection identifier update confirmation message from the first terminal device, and decrypts the connection identifier update confirmation message based on the EK to obtain the K included in the connection identifier update confirmation message. NRP IDLSB#2.
[0239] S515: The first terminal device and the second terminal device generate K NRP ID.
[0240] It should be understood that the first terminal device and the second terminal device are based on the latest acquired K NRP The LSB and MSB of ID generate K NRP ID.
[0241] If after S507, the method 500 executes S508a to S510, then in S515, the first terminal device and the second terminal device are based on K NRP ID MSB#4 and K NRP ID LSB#2 generates K NRP ID.
[0242] If after S507, the method 500 executes S508b to S510, then in S515, the first terminal device and the second terminal device are based on K NRP ID MSB#4 and K NRP ID LSB#2 generates K NRP ID.
[0243] If after S507, the method 500 executes S511 to S514, then in S515, the first terminal device and the second terminal device are based on K NRP ID MSB#3 and K NRP ID LSB#2 generates K NRP ID.
[0244] In the embodiment of the present application, during the process of establishing a connection 1 between the first terminal device and the second terminal device, the second terminal device carries the information for generating K in the direct connection security mode completion message #1. NRP The MSB#2 of ID is used to generate K NRPThe LSB#1 and MSB#2 of the ID are not transmitted in plain text. In the process of establishing connection 2 between the first terminal device and the second terminal device, even if the second terminal device carries K in the DCR message, NRP ID, a third-party attacker cannot compare the previously obtained MSB#1 with the K NRP The IDs are associated with each other, thereby protecting the connection privacy of the first terminal device and the second terminal device.
[0245] Figure 6 Schematic flow chart of the method provided in the embodiment of the present application is shown. Figure 6 As shown, the method 600 may include S601 to S617, and each step is described in detail below.
[0246] S601: The second terminal device sends a direct communication request message #1. Accordingly, in S601, the first terminal device receives the direct communication request message #1 from the second terminal device.
[0247] S602: A direct connection authentication and key establishment process is performed between the second terminal device and the first terminal device.
[0248] S603: The first terminal device sends a direct connection safety mode command message #1 to the second terminal device. Accordingly, in S603, the second terminal device receives the direct connection safety mode command message #1 from the first terminal device.
[0249] Optionally, the direct connection security mode command message #1 may also include K NRP MSB#1 of ID (denoted as K NRP IDMSB#1).
[0250] S604, the second terminal device sends a direct connection security mode completion message #1 (an example of a first message) encrypted based on the EK to the first terminal device.
[0251] The direct connection security mode completion message #1 may include K NRP LSB#1 of ID (an example of the first parameter, denoted as K NRP ID LSB#1).
[0252] Accordingly, in S604, the first terminal device receives the direct connection security mode completion message #1 from the second terminal device, and can decrypt the direct connection security mode completion message #1 based on the EK to obtain the K included in the direct connection security mode completion message #1. NRP ID LSB#1.
[0253] The manner in which the first terminal device and the second terminal device generate the EK may refer to the description in S502 to S503 above, and for the sake of brevity, this embodiment of the application will not be repeated.
[0254] S605: The first terminal device sends a direct connection security mode confirmation message #1 (an example of a second message) encrypted based on the EK to the second terminal device.
[0255] The direct connection security mode confirmation message #1 may include K NRP MSB#2 of ID (an example of the second parameter, denoted as K NRP ID MSB#2).
[0256] Accordingly, in S605, the second terminal device receives the direct connection security mode confirmation message #1 from the first terminal device, and can decrypt the direct connection security mode confirmation message #1 based on the EK to obtain the K included in the direct connection security mode confirmation message #1. NRP ID MSB#2.
[0257] S606: The second terminal device sends a direct communication acceptance message #1 encrypted based on the EK to the first terminal device.
[0258] It can be understood that after the second terminal device receives the direct communication acceptance message #1 from the first terminal device, it indicates that the unicast connection (i.e. Figure 6 Connection 1 shown in FIG, an example of a first unicast connection, has been successfully established.
[0259] S607: The first terminal device and the second terminal device generate K NRP ID (an example of a key identifier).
[0260] It should be understood that the first terminal device and the second terminal device are based on the latest acquired K NRP The LSB and MSB of ID generate K NRP ID. That is, the first terminal device and the second terminal device are based on K NRP ID MSB#2 and K NRP ID LSB#1 generates K NRP ID.
[0261] It can be understood that in S607, the first terminal device and the second terminal device generate K NRP K used by ID NRP IDMSB#2 and K NRP ID LSB#1 is not transmitted in plain text. Therefore, a third-party attacker cannot obtain K NRP IDMSB#2 and K NRP ID LSB#1.
[0262] After the first terminal device establishes connection 1 with the second terminal device, the first terminal device or the second terminal device may initiate a unicast connection request again.
[0263] S608: The second terminal device sends a direct communication request message #2 (an example of a first request message).
[0264] The direct communication request message #2 may include the application layer identifier of the second terminal device, the K generated by the second terminal device during the process of establishing the connection 1, NRP ID.
[0265] As can be seen from the above, it is used to generate K NRP ID K NRP ID MSB#2 and K NRP ID LSB#1 is not transmitted in plain text, so even if a third-party attacker obtains K from direct communication request message #2 NRP ID, and cannot connect connection 1 to this unicast connection ( Figure 6 , an example of a second unicast connection).
[0266] Correspondingly, in S608, the first terminal device receives the direct communication request message #2 from the second terminal device.
[0267] When the first terminal device still maintains connection 1 established with the second terminal device, after the first terminal device receives the direct communication request message #2 from the second terminal device, it determines whether connection 1 can be reused based on other parameters carried in the direct communication request message, that is, whether new data or services can be transmitted on the unicast link established in connection 1.
[0268] If the first terminal device determines that connection 1 can be reused, S613 to S617 are executed after S608.
[0269] If the first terminal device determines that connection 1 cannot be reused, S609a to S612 and S617 are executed after S608.
[0270] When the first terminal device releases connection 1, after receiving the direct communication request message #2 from the second terminal device, the first terminal device can identify the identity of the second terminal device according to the application layer identifier of the second terminal device. NRP ID determines the K that can reuse connection 1 NRPTherefore, the first terminal device and the second terminal device can omit the direct connection authentication and key establishment process during the process of establishing connection 2. Furthermore, after S507, S609b to S612 and S617 are executed.
[0271] S609a, the first terminal device sends a direct connection security mode command message #2 (an example of a first response message) to the second terminal device.
[0272] The direct connection security mode command message #2 may include K NRP ID.
[0273] Optionally, the direct connection security mode command message #2 may also include K NRP MSB#3 of ID (denoted as K NRP IDMSB#3).
[0274] S609b, the first terminal device sends a direct connection security mode command message #3 to the second terminal device.
[0275] The direct connection security mode command message #3 may include K NRP MSB#3 of ID (denoted as K NRP ID MSB#3).
[0276] S610, the second terminal device sends a direct connection security mode completion message #2 encrypted based on the EK to the first terminal device.
[0277] Direct connection security mode message #2 may include K NRP LSB#2 of ID (denoted as K NRP ID LSB#2).
[0278] Accordingly, in S610, the first terminal device receives the direct connection security mode completion message #2 from the second terminal device, and decrypts the direct connection security mode completion message #2 based on the EK to obtain the K included in the direct connection security mode completion message #2. NRP ID LSB#2.
[0279] S611, the first terminal device sends a direct connection security mode confirmation message #2 encrypted based on the EK to the second terminal device.
[0280] The direct communication acceptance message #2 may include K NRP MSB#4 of ID (denoted as K NRP ID MSB#4).
[0281] Accordingly, in S611, the second terminal device receives the direct connection security mode confirmation message #2 from the first terminal device, and decrypts the direct connection security mode confirmation message #2 based on the EK to obtain the K included in the direct connection security mode confirmation message #2. NRP ID MSB#4.
[0282] S612, the second terminal device sends a direct communication acceptance message #2 encrypted based on the EK to the first terminal device.
[0283] S613: The first terminal device and the second terminal device execute a connection modification process.
[0284] When the first terminal device determines that connection 1 can be reused, it initiates a modification process for the unicast link of connection 1 so that the new service and the previous service are transmitted simultaneously on the unicast link established in connection 1.
[0285] Specifically, the steps of the first terminal device and the second terminal device executing the connection modification process can refer to the existing technology. For the sake of brevity, the embodiments of the present application will not be described in detail.
[0286] S614, the first terminal device sends a connection identifier update request message (an example of a second request message) encrypted based on the EK to the second terminal device.
[0287] The connection identifier update request message may include K NRP MSB#3 of ID (denoted as K NRP ID MSB#3).
[0288] Accordingly, in S614, the second terminal device receives the connection identifier update request message from the first terminal device, and decrypts the connection identifier update request message based on the EK to obtain the K included in the connection identifier update request message. NRP IDMSB#3.
[0289] S615: The second terminal device sends a connection identifier update response message encrypted based on the EK to the first terminal device.
[0290] The connection identifier update response message may include K NRP ID MSB#3 and K NRP LSB#2 of ID (denoted as K NRP IDLSB#2).
[0291] Accordingly, in S615, the first terminal device receives the connection identifier update response message from the second terminal device, and decrypts the connection identifier update response message based on the EK to obtain the K included in the connection identifier update request message. NRP IDMSB#3 and K NRPID LSB#2.
[0292] S616: The first terminal device sends a link identifier update acknowledgment (linkidentifier update ack) message encrypted based on the EK to the second terminal device.
[0293] The connection identifier update confirmation message may include K NRP ID LSB#2.
[0294] Correspondingly, in S616, the second terminal device receives the connection identifier update confirmation message from the first terminal device, and decrypts the connection identifier update confirmation message based on the EK to obtain the K included in the connection identifier update confirmation message. NRP IDLSB#2.
[0295] S617: The first terminal device and the second terminal device generate K NRP ID.
[0296] It should be understood that the first terminal device and the second terminal device are based on the latest acquired K NRP The LSB and MSB of ID generate K NRP ID.
[0297] If after S608, the method 600 executes S609a to S612, then in S617, the first terminal device and the second terminal device are based on K NRP ID MSB#4 and K NRP ID LSB#2 generates K NRP ID.
[0298] If after S608, the method 800 executes S609b to S612, then in S617, the first terminal device and the second terminal device are based on K NRP ID MSB#4 and K NRP ID LSB#2 generates K NRP ID.
[0299] If after S608, the method 600 executes S613 to S616, then in S617, the first terminal device and the second terminal device are based on K NRP ID MSB#3 and K NRP ID LSB#2 generates K NRP ID.
[0300] In the embodiment of the present application, during the process of establishing a connection 1 between the first terminal device and the second terminal device, the second terminal device carries the information for generating K in the direct communication confirmation message #1. NRP The MSB#2 of ID is used to generate KNRP The LSB#1 and MSB#2 of the ID are not transmitted in plain text. In the process of establishing connection 2 between the first terminal device and the second terminal device, even if the second terminal device carries K in the DCR message, NRP ID, a third-party attacker cannot compare the previously obtained MSB#1 with the K NRP The IDs are associated with each other, thereby protecting the connection privacy of the first terminal device and the second terminal device.
[0301] Figure 7 Schematic flow chart of the method provided in the embodiment of the present application is shown. Figure 7 As shown, the method 700 may include S701 to S718, and each step is described in detail below.
[0302] S701: The second terminal device sends a direct communication request message #1. Accordingly, in S701, the first terminal device receives the direct communication request message #1 from the second terminal device.
[0303] S702: A direct connection authentication and key establishment process is performed between the second terminal device and the first terminal device.
[0304] S703: The first terminal device sends a direct connection safety mode command message #1 to the second terminal device. Accordingly, in S503, the second terminal device receives the direct connection safety mode command message #1 from the first terminal device.
[0305] Optionally, the direct connection security mode command message #1 may also include K NRP MSB#1 of ID (denoted as K NRP IDMSB#1).
[0306] S704, the second terminal device sends a direct connection security mode completion message #1 encrypted based on the EK to the first terminal device.
[0307] The direct connection security mode completion message #1 may include K NRP LSB#1 of the ID.
[0308] Accordingly, in S704, the first terminal device receives the direct connection security mode completion message #1 from the second terminal device, and can decrypt the direct connection security mode completion message #1 based on the EK to obtain the K included in the direct connection security mode completion message #1. NRP ID LSB#1.
[0309] The manner in which the first terminal device and the second terminal device generate the EK may refer to the description in S502 to S503 above, and for the sake of brevity, this embodiment of the application will not be repeated.
[0310] S705: The first terminal device sends a direct communication acceptance message #1 encrypted based on the EK to the second terminal device.
[0311] It can be understood that after the second terminal device receives the direct communication acceptance message #1 from the first terminal device, it indicates that the unicast connection (i.e. Figure 5 Connection 1 shown in FIG, an example of a first unicast connection, has been successfully established.
[0312] S706: The second terminal device sends a connection identifier update request message #1 encrypted based on the EK to the first terminal device.
[0313] The connection identifier update request message #1 may include K NRP MSB#2 of ID (an example of the third parameter, denoted as K NRP ID MSB#2).
[0314] Accordingly, in S706, the first terminal device receives the connection identifier update request message #1 from the second terminal device, and can decrypt the connection identifier update request message #1 based on the EK to obtain the K included in the connection identifier update request message #1. NRP ID MSB#2.
[0315] S707, the first terminal device sends a connection identifier update response message #1 encrypted based on the EK to the second terminal device.
[0316] The connection identifier update response message #1 may include K NRP ID MSB#2 and K NRP LSB#2 of ID (an example of the fourth parameter, denoted as K NRP ID LSB#2).
[0317] Accordingly, in S707, the second terminal device receives the connection identifier update response message #1 from the first terminal device, and can decrypt the connection identifier update response message #1 based on the EK to obtain the K included in the connection identifier update response message #1. NRP ID LSB#2.
[0318] S708, the second terminal device sends a connection identifier update confirmation message #1 encrypted based on the EK to the first terminal device.
[0319] The connection identifier update confirmation message #1 may include K NRP ID LSB#2.
[0320] Accordingly, in S708, the second terminal device receives the connection identifier update confirmation message #1 from the first terminal device, and decrypts the connection identifier update confirmation message #1 based on the EK to obtain the K included in the connection identifier update confirmation message #1. NRP ID LSB#2.
[0321] S709: The first terminal device and the second terminal device generate K NRP ID (an example of a key identifier).
[0322] It should be understood that the first terminal device and the second terminal device are based on the latest acquired K NRP The LSB and MSB of ID generate K NRP ID. That is, the first terminal device and the second terminal device are based on K NRP ID MSB#2 and K NRP ID LSB#2 generates K NRP ID.
[0323] It can be understood that in S709, the first terminal device and the second terminal device generate K NRP K used by ID NRP IDMSB#2 and K NRP ID LSB#2 is not transmitted in plain text. Therefore, a third-party attacker cannot obtain K NRP IDMSB#2 and K NRP ID LSB#2.
[0324] After the first terminal device establishes connection 1 with the second terminal device, the first terminal device or the second terminal device may initiate a unicast connection request again.
[0325] S710, the second terminal device sends a direct communication request message #2 (an example of a first request message).
[0326] The direct communication request message #2 may include the application layer identifier of the second terminal device, the K generated by the second terminal device during the process of establishing the connection 1, NRP ID.
[0327] As can be seen from the above, it is used to generate K NRP ID K NRP ID MSB#2 and K NRP ID LSB#1 is not transmitted in plain text, so even if a third-party attacker obtains K from direct communication request message #2 NRP ID, and cannot connect connection 1 to this unicast connection ( Figure 7, an example of a second unicast connection).
[0328] Accordingly, in S710 , the first terminal device receives the direct communication request message # 2 from the second terminal device.
[0329] When the first terminal device still maintains connection 1 established with the second terminal device, after the first terminal device receives the direct communication request message #2 from the second terminal device, it determines whether connection 1 can be reused based on other parameters carried in the direct communication request message, that is, whether new data or services can be transmitted on the unicast link established in connection 1.
[0330] If the first terminal device determines that connection 1 can be reused, S714 to S718 are executed after S710.
[0331] If the first terminal device determines that connection 1 cannot be reused, S711a to S713 and S718 are executed after S710.
[0332] When the first terminal device releases connection 1, after receiving the direct communication request message #2 from the second terminal device, the first terminal device can identify the identity of the second terminal device according to the application layer identifier of the second terminal device. NRP ID determines the K that can reuse connection 1 NRP Therefore, the first terminal device and the second terminal device can omit the direct connection authentication and key establishment process during the process of establishing connection 2. Furthermore, after S710, S711b to S713 and S718 are executed.
[0333] S711a, the first terminal device sends a direct connection security mode command message #2 (an example of a first response message) to the second terminal device.
[0334] The direct connection security mode command message #2 may include K NRP ID.
[0335] Optionally, the direct connection security mode command message #2 may also include K NRP MSB#3 of ID (denoted as K NRP IDMSB#3).
[0336] S711b, the first terminal device sends a direct connection security mode command message #3 to the second terminal device.
[0337] The direct connection security mode command message #3 may include K NRP MSB#3 of ID (denoted as K NRP ID MSB#3).
[0338] S712, the second terminal device sends a direct connection security mode completion message #2 encrypted based on the EK to the first terminal device.
[0339] Direct connection security mode message #2 may include K NRP LSB#3 of ID (denoted as K NRP ID LSB#3).
[0340] Accordingly, in S712, the first terminal device receives the direct connection security mode completion message #2 from the second terminal device, and decrypts the direct connection security mode completion message #2 based on the EK to obtain the K included in the direct connection security mode completion message #2. NRP ID LSB#3.
[0341] S713, the first terminal device sends a direct communication acceptance message #2 encrypted based on the EK to the second terminal device.
[0342] S714: The first terminal device and the second terminal device execute a connection modification process.
[0343] When the first terminal device determines that connection 1 can be reused, it initiates a modification process for the unicast link of connection 1 so that the new service and the previous service are transmitted simultaneously on the unicast link established in connection 1.
[0344] Specifically, the steps of the first terminal device and the second terminal device executing the connection modification process can refer to the existing technology. For the sake of brevity, the embodiments of the present application will not be described in detail.
[0345] S715 , the first terminal device sends a connection identifier update request message #2 (an example of a second request message) encrypted based on the EK to the second terminal device.
[0346] The connection identifier update request message #2 may include K NRP MSB#4 of ID (denoted as K NRP ID MSB#4).
[0347] Accordingly, in S715, the second terminal device receives the connection identifier update request message #2 from the first terminal device, and decrypts the connection identifier update request message #2 based on the EK to obtain the K included in the connection identifier update request message #2. NRP ID MSB#4.
[0348] S716, the second terminal device sends a connection identifier update response message #2 encrypted based on the EK to the first terminal device.
[0349] The connection identifier update response message #2 may include K NRP ID MSB#4 and K NRPLSB#4 of ID (denoted as K NRP ID LSB#4).
[0350] Accordingly, in S716, the first terminal device receives the connection identifier update response message #2 from the second terminal device, and decrypts the connection identifier update response message #2 based on the EK to obtain the K included in the connection identifier update request message #2. NRP ID MSB#4 and K NRP ID LSB#4.
[0351] S717, the first terminal device sends a connection identifier update confirmation message #2 encrypted based on the EK to the second terminal device.
[0352] The connection identifier update confirmation message #2 may include K NRP ID LSB#4.
[0353] Accordingly, in S717, the second terminal device receives the connection identifier update confirmation message #2 from the first terminal device, and decrypts the connection identifier update confirmation message #2 based on the EK to obtain the K included in the connection identifier update confirmation message #2. NRP ID LSB#4.
[0354] S718: The first terminal device and the second terminal device generate K NRP ID.
[0355] It should be understood that the first terminal device and the second terminal device are based on the latest acquired K NRP The LSB and MSB of ID generate K NRP ID.
[0356] If after S710, the method 700 executes S711a to S713, then in S718, the first terminal device and the second terminal device are based on K NRP ID MSB#3 and K NRP ID LSB#3 generates K NRP ID.
[0357] If after S710, the method 700 executes S711b to S713, then in S718, the first terminal device and the second terminal device are based on K NRP ID MSB#3 and K NRP ID LSB#3 generates K NRP ID.
[0358] Optionally, after S713, the second terminal device may actively initiate a connection identifier modification process to update the key identifier.
[0359] If after S710, the method 700 executes S714 to S717, then in S718, the first terminal device and the second terminal device are based on K NRP ID MSB#4 and K NRP ID LSB#4 generates K NRP ID.
[0360] In the embodiment of the present application, during the process of establishing a connection 1 between the first terminal device and the second terminal device, the second terminal device updates the connection identifier used to generate K by triggering the connection identifier update process. NRP The MSB#2 and LSB#2 of ID are used to generate K NRP The LSB#2 and MSB#2 of the ID are not transmitted in plain text. In the process of establishing connection 2 between the first terminal device and the second terminal device, even if the second terminal device carries K in the DCR message, NRP ID, a third-party attacker cannot compare the previously obtained MSB#1 with the K NRP The IDs are associated with each other, thereby protecting the connection privacy of the first terminal device and the second terminal device.
[0361] Above, combined Figures 3 to 7 The method provided in the embodiment of the present application is described in detail. Figures 8 and 9 The device provided in the embodiments of the present application is described in detail.
[0362] Figure 8 : is a schematic block diagram of a communication device provided in an embodiment of the present application. Figure 8 As shown, the communication device 2000 may include a processing unit 2100 and a transceiver unit 2200 .
[0363] In one possible design, the communication device 2000 may correspond to the first terminal device in the above method embodiment, for example, it may be the first terminal device, or a component configured in the first terminal device (such as a chip or a chip system).
[0364] It should be understood that the communication device 2000 may correspond to the first terminal device in the method 300, the method 400, the method 500, the method 600, and the method 700 according to the embodiments of the present application, and the communication device 2000 may include a method for executing Figure 3 Method 300, Figure 4 Method 400, Figure 5 Method 500, Figure 6 Method 600, Figure 7 The units of the method performed by the first terminal device in the method 700 are respectively for implementing Figure 3Method 300, Figure 4 Method 400, Figure 5 Method 500, Figure 6 Method 600, Figure 7 It should be understood that the specific process of each unit performing the above steps has been described in detail in the above method embodiment, and for the sake of brevity, it will not be repeated here.
[0365] It should also be understood that when the communication device 2000 is a first terminal device, the transceiver unit 2200 in the communication device 2000 can be implemented by a transceiver, for example, corresponding to Figure 9 The transceiver 3020 in the terminal device 3000 shown in FIG, the processing unit 2100 in the communication device 2000 may be implemented by at least one processor, for example, corresponding to Figure 9 The processor 3010 in the terminal device 3000 is shown.
[0366] It should also be understood that when the communication device 2000 is a chip or chip system configured in the first terminal device, the transceiver unit 2200 in the communication device 2000 can be implemented through an input / output interface, and the processing unit 2100 in the communication device 2000 can be implemented through a processor, microprocessor or integrated circuit integrated on the chip or chip system.
[0367] In another possible design, the communication device 2000 may correspond to the second terminal device in the above method embodiment, for example, it may be a second terminal device, or a component configured in the second terminal device (such as a chip or a chip system).
[0368] It should be understood that the communication device 2000 may correspond to the second terminal device in the method 300, the method 400, the method 500, the method 600, and the method 700 according to the embodiments of the present application, and the communication device 2000 may include a method for executing Figure 3 Method 300, Figure 4 Method 400, Figure 5 Method 500, Figure 6 Method 600, Figure 7 The units of the method performed by the second terminal device in the method 700 in the communication device 2000 are respectively for implementing Figure 3 Method 300, Figure 4 Method 400, Figure 5 Method 500, Figure 6 Method 600, Figure 7It should be understood that the specific process of each unit performing the above steps has been described in detail in the above method embodiment, and for the sake of brevity, it will not be repeated here.
[0369] It should also be understood that when the communication device 2000 is a second terminal device, the transceiver unit 2200 in the communication device 2000 can be implemented by a transceiver, for example, corresponding to Figure 9 The transceiver 3020 in the terminal device 3000 shown in FIG, the processing unit 2100 in the communication device 2000 may be implemented by at least one processor, for example, corresponding to Figure 9 The processor 3010 in the terminal device 3000 is shown.
[0370] It should also be understood that when the communication device 2000 is a chip or chip system configured in the second terminal device, the transceiver unit 2200 in the communication device 2000 can be implemented through an input / output interface, and the processing unit 2100 in the communication device 2000 can be implemented through a processor, microprocessor or integrated circuit integrated on the chip or chip system.
[0371] Figure 9 This is a schematic diagram of the structure of the terminal device 3000 provided in the embodiment of the present application. The terminal device 3000 can be applied to Figure 1 In the system shown, the functions of the terminal device in the above-described method embodiment are performed. As shown in the figure, the terminal device 3000 includes a processor 3010 and a transceiver 3020. Optionally, the terminal device 3000 also includes a memory 3030. The processor 3010, the transceiver 3020, and the memory 3030 can communicate with each other via internal connection paths to transmit control and / or data signals. The memory 3030 is used to store computer programs, and the processor 3010 is used to call and execute the computer programs from the memory 3030 to control the transceiver 3020 to transmit and receive signals. Optionally, the terminal device 3000 may also include an antenna 3040 for transmitting uplink data or uplink control signaling output by the transceiver 3020 via wireless signals.
[0372] The processor 3010 and the memory 3030 can be combined into a processing device, and the processor 3010 is used to execute the program code stored in the memory 3030 to implement the above functions. In specific implementation, the memory 3030 can also be integrated into the processor 3010, or independent of the processor 3010. The processor 3010 can be combined with the memory 3030 to form a processing device. Figure 8 Corresponding to the processing unit 2100 in .
[0373] The transceiver 3020 can be used with Figure 8The transceiver 2200 in FIG. 2 may also be referred to as a transceiver unit. The transceiver 2020 may include a receiver (or receiver, receiving circuit) and a transmitter (or transmitter, transmitting circuit). The receiver is used to receive signals, and the transmitter is used to transmit signals.
[0374] It should be understood that Figure 9 The terminal device 3000 shown can realize Figures 3 to 7 The method embodiment shown in FIG. 1 involves various processes of the first terminal device. The operations and / or functions of the various modules in the terminal device 3000 are respectively for implementing the corresponding processes in the above method embodiment. For details, please refer to the description of the above method embodiment. To avoid repetition, detailed description is appropriately omitted here.
[0375] The processor 3010 can be used to execute the actions described in the previous method embodiments, which are implemented internally by the first terminal device, such as negotiating an encryption key with the second terminal device and generating a key identifier. The transceiver 3020 can be used to execute the actions described in the previous method embodiments, which are sent by the first terminal device or received from the second terminal device, such as sending a second message or receiving a first message. For details, please refer to the description in the previous method embodiments and will not be repeated here.
[0376] It should also be understood that Figure 9 The terminal device 3000 shown can realize Figures 3 to 7 The method embodiment shown in FIG. 1 involves various processes of the second terminal device. The operations and / or functions of the various modules in the terminal device 3000 are respectively for implementing the corresponding processes in the above method embodiment. For details, please refer to the description of the above method embodiment. To avoid repetition, detailed description is appropriately omitted here.
[0377] The processor 3010 can be used to execute the actions described in the previous method embodiments, implemented internally by the second terminal device, such as negotiating an encryption key with the first terminal device and generating a key identifier. The transceiver 3020 can be used to execute the actions described in the previous method embodiments, such as sending a first message and receiving a second message, by the second terminal device to or from the first terminal device. For details, please refer to the description in the previous method embodiments and will not be repeated here.
[0378] The terminal device 3000 may further include a power supply 3050 for providing power to various devices or circuits in the terminal device.
[0379] In addition, in order to make the functions of the terminal device more complete, the terminal device 3000 may also include one or more of an input unit 3060, a display unit 3070, an audio circuit 3080, a camera 3090 and a sensor 3100, and the audio circuit may also include a speaker 3082, a microphone 3084, etc.
[0380] An embodiment of the present application further provides a processing device, including a processor and an interface; the processor is used to execute the method in any of the above method embodiments.
[0381] It should be understood that the above-mentioned processing device may be one or more chips. For example, the processing device may be a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), a system on chip (SoC), a central processor unit (CPU), a network processor (NP), a digital signal processor (DSP), a microcontroller unit (MCU), a programmable logic device (PLD), or other integrated chips.
[0382] During implementation, each step of the above method can be completed by an integrated logic circuit of the hardware in the processor or by instructions in the form of software. The steps of the method disclosed in conjunction with the embodiments of the present application can be directly embodied as being executed by a hardware processor, or can be executed by a combination of hardware and software modules in the processor. The software module can be located in a storage medium mature in the art such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory, and the processor reads the information in the memory and completes the steps of the above method in conjunction with its hardware. To avoid repetition, it will not be described in detail here.
[0383] It should be noted that the processor in the embodiments of the present application can be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method embodiment can be completed by an integrated logic circuit of the hardware in the processor or by instructions in the form of software. The above processor can be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic device, a discrete gate or transistor logic device, or a discrete hardware component. The various methods, steps, and logic block diagrams disclosed in the embodiments of the present application can be implemented or executed. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor. The steps of the method disclosed in the embodiments of the present application can be directly embodied as being executed by a hardware decoding processor, or can be executed by a combination of hardware and software modules in the decoding processor. The software module can be located in a storage medium mature in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, or electrically erasable programmable memory, registers, etc. The storage medium is located in the memory, and the processor reads the information in the memory and completes the steps of the above method in combination with its hardware.
[0384] It is understood that the memory in the embodiments of the present application may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), and direct RAM bus RAM (DR RAM). It should be noted that the memory of the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.
[0385] According to the method provided in the embodiment of the present application, the present application also provides a computer program product, which includes: a computer program code, which, when executed on a computer, causes the computer to execute Figures 3 to 7 The methods in the illustrated embodiment are respectively executed by the first terminal device and the second terminal device.
[0386] According to the method provided in the embodiment of the present application, the present application also provides a computer-readable storage medium, which stores a program code, and when the program code is run on a computer, the computer executes Figures 3 to 7 The methods in the illustrated embodiment are respectively executed by the first terminal device and the second terminal device.
[0387] According to the method provided in the embodiment of the present application, the present application also provides a system, which includes one or more terminal devices mentioned above.
[0388] The policy control network elements in the aforementioned apparatus embodiments completely correspond to the policy control network elements or terminal devices in the terminal device and method embodiments. The corresponding modules or units perform the corresponding steps. For example, the communication unit (transceiver) performs the receiving or sending steps in the method embodiments, while all other steps except sending and receiving can be performed by the processing unit (processor). The functions of the specific units can be referenced in the corresponding method embodiments. There can be one or more processors.
[0389] As used in this specification, the terms "component," "module," "system," and the like are used to represent computer-related entities, hardware, firmware, a combination of hardware and software, software, or software in execution. For example, a component can be, but is not limited to, a process running on a processor, a processor, an object, an executable file, an execution thread, a program, and / or a computer. By way of illustration, both an application running on a computing device and a computing device can be a component. One or more components can reside in a process and / or an execution thread, and a component can be located on a computer and / or distributed between two or more computers. In addition, these components can be executed from various computer-readable media having various data structures stored thereon. Components can communicate, for example, via local and / or remote processes based on signals having one or more data packets (e.g., data from two components interacting with another component on a local system, a distributed system, and / or a network, such as the Internet interacting with other systems via signals).
[0390] Those skilled in the art will appreciate that the various illustrative logical blocks and steps described in conjunction with the embodiments disclosed herein can be implemented using electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0391] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0392] In the several embodiments provided in this application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0393] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.
[0394] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0395] In the above embodiments, the functions of each functional unit can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions (programs). When the computer program instructions (program) are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website, computer, server or data center to another website, computer, server or data center via wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that includes one or more available media integrated therein. The available medium may be a magnetic medium (eg, a floppy disk, a hard disk, a magnetic tape), an optical medium (eg, a high-density digital video disc (DVD)), or a semiconductor medium (eg, a solid state disk (SSD)).
[0396] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0397] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.
Claims
1. A method for generating a key identifier, characterized in that: include: The communication device negotiates an encryption key EK with the second terminal device; The communication device receives a first message from the second terminal device; The communication device decrypts the first message based on the EK to obtain a first parameter included in the first message; The communication device sends a second message encrypted based on the EK to the second terminal device, where the second message includes a second parameter; The communication device generates a key identifier based on the first parameter and the second parameter, and the key identifier is used to index a key generated by the communication device and the second terminal device during the process of establishing a first unicast connection.
2. The method according to claim 1, characterized in that The first message is a direct connection safety mode completion message during the safety mode activation process; The second message is: a direct connection communication acceptance message in a unicast connection establishment process, or a direct connection security mode confirmation message in a security mode activation process.
3. The method according to claim 1 or 2, characterized in that The first parameter is the most significant bit (MSB) of the key identifier, and the second parameter is the least significant bit (LSB) of the key identifier; or The first parameter is the LSB of the key identifier, and the second parameter is the MSB of the key identifier.
4. The method according to claim 1 or 2, characterized in that When the communication device maintains the first unicast connection, the method further includes: The communication device receives a first request message from the second terminal device, where the first request message is used to request to establish a unicast connection with at least one terminal device, and the first request message includes the key identifier; When the communication device determines that the first unicast connection cannot be reused, the communication device sends a first response message to the second terminal device, and the first response message is used to initiate a security negotiation process for a second unicast connection between the communication device and the second terminal device; wherein the first response message includes the key identifier, and the key identifier is used to indicate that the key is reused in the second unicast connection.
5. The method according to claim 1 or 2, characterized in that When the communication device maintains the first unicast connection, the method further includes: The communication device receives a first request message from the second terminal device, where the first request message is used to request to establish a unicast connection with at least one terminal device, and the first request message includes the key identifier; When the communication device determines that the first unicast connection can be reused, it sends a second request message to the second terminal device, where the second request message is used to request modification of the first unicast connection.
6. The method according to claim 4, characterized in that Before the communication apparatus receives the first request message from the second terminal device, the method further includes: The communication device receives a connection identification update request message from the second terminal device; The communication device decrypts the connection identifier update request message based on the EK to obtain a third parameter included in the connection identifier update request message; The communication device sends a connection identifier update response message encrypted based on the EK to the second terminal device, where the connection identifier update response message includes a fourth parameter; The communication device updates the key identifier based on the third parameter and the fourth parameter.
7. The method according to claim 6, characterized in that The third parameter is the MSB of the key identifier, and the fourth parameter is the LSB of the key identifier; or The third parameter is the LSB of the key identifier, and the fourth parameter is the MSB of the key identifier.
8. The method according to any one of claims 1, 2, 6 or 7, characterized in that The communication device is a first terminal device or a chip in the first terminal device.
9. A communication device, characterized in that: Including transceiver unit and processing unit: The processing unit is used to negotiate an encryption key EK with the second terminal device; The transceiver unit is used to receive a first message from the second terminal device; The processing unit is further configured to decrypt the first message based on the EK to obtain a first parameter included in the first message; The transceiver unit is further configured to send a second message encrypted based on the EK to the second terminal device, where the second message includes a second parameter; The processing unit is further configured to generate a key identifier based on the first parameter and the second parameter, where the key identifier is used to index a key generated by the communication apparatus and the second terminal device during a process of establishing a first unicast connection.
10. The communication device according to claim 9, wherein: The first message is a direct connection safety mode completion message during the safety mode activation process; The second message is: a direct connection communication acceptance message in a unicast connection establishment process, or a direct connection security mode confirmation message in a security mode activation process.
11. The communication device according to claim 9 or 10, characterized in that: The first parameter is the most significant bit (MSB) of the key identifier, and the second parameter is the least significant bit (LSB) of the key identifier; or The first parameter is the LSB of the key identifier, and the second parameter is the MSB of the key identifier.
12. The communication device according to claim 9 or 10, characterized in that The transceiver unit is further configured to receive a first request message from the second terminal device, where the first request message is used to request to establish a unicast connection with at least one terminal device, and the first request message includes the key identifier; The transceiver unit is also used to send a first response message to the second terminal device when it is determined that the first unicast connection cannot be reused, and the first response message is used to initiate a security negotiation process for the second unicast connection between the communication device and the second terminal device; wherein the first response message includes the key identifier, and the key identifier is used to indicate that the key is reused in the second unicast connection.
13. The communication device according to claim 9 or 10, characterized in that The transceiver unit is further configured to receive a first request message from the second terminal device, where the first request message is used to request to establish a unicast connection with at least one terminal device, and the first request message includes the key identifier; The transceiver unit is further configured to, when determining that the first unicast connection can be reused, send a second request message to the second terminal device, where the second request message is used to request modification of the first unicast connection.
14. The communication device according to claim 12, wherein: The transceiver unit is further configured to receive a connection identifier update request message from the second terminal device; The processing unit is further configured to decrypt the connection identifier update request message based on the EK to obtain a third parameter included in the connection identifier update request message; The transceiver unit is further configured to send a connection identifier update response message encrypted based on the EK to the second terminal device, where the connection identifier update response message includes a fourth parameter; The processing unit is further configured to update the key identifier based on the third parameter and the fourth parameter.
15. The communication device according to claim 14, wherein: The third parameter is the MSB of the key identifier, and the fourth parameter is the LSB of the key identifier; or The third parameter is the LSB of the key identifier, and the fourth parameter is the MSB of the key identifier.
16. A communication device, characterized in that: The communication device comprises at least one processor, wherein the at least one processor is configured to execute a computer program stored in a memory, so that the communication device implements the method according to any one of claims 1 to 8.
17. A computer-readable storage medium, characterized in that The invention comprises a computer program which, when being run on a computer, causes the computer to execute the method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Cellular unicast link establishment for vehicle-to-vehicle (V2V) communication
US20190223008A1
Procedures enabling privacy for wtrus using PC5 communication
WO2019245783A1