Method of communication and communication device

BR112025021595A2Pending Publication Date: 2026-09-01
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
BR112025021595
Authority / Receiving Office
BR · BR
Patent Type
Applications
Publication Date
2026-09-01

Smart Images

  • Figure 00000000_0000_ABST
    Figure 00000000_0000_ABST
Patent Text Reader
Need to check novelty before this filing date? Find Prior Art

Description

1 / 126 METHOD OF COMMUNICATION AND COMMUNICATION DEVICE

[001] This application claims priority over Chinese Patent Application No. 202310385227.1, filed with the National Intellectual Property Administration of China on April 7, 2023, and entitled “COMMUNICATION METHOD AND COMMUNICATION APPARATUS”, which is incorporated into the present invention by reference in its entirety. TECHNICAL FIELD

[002] The modalities of this application relate to the field of communication and, more specifically, to a method of communication and a communication device. BACKGROUND

[003] In communication systems, for example, a 5th-generation (5G) communication system, with the rapid development of mobile communication and the widespread use of new types of data services, such as video chat, virtual reality (VR), and augmented reality (AR), increases users' demands regarding communication. For example, device-to-device communication enables direct communication between user equipment (user equipment, UE), effectively increasing communication efficiency, especially in a one-to-many scenario.

[004] However, current communication between devices can compromise network security due to malicious alterations by attackers. Therefore, there is an urgent need for additional measures to reduce potential security risks. SUMMARY

[005] This application provides a method of communication and a communication device to reduce a potential security risk and improve the Petition 870250090954, dated 06 / 10 / 2025, page 121 / 278 2 / 126 Network communication security.

[006] According to a first aspect, a communication method is provided. The method may be performed by a first communication device (e.g., UE transmitter), or it may be performed by a chip or circuit of the first communication device. This is not limited to this application. For ease of description, an example where the method is performed by the first communication device is used below for description.

[007] Optionally, the first communication device and a second communication device in this embodiment of this application may be terminal devices, for example, a mobile phone, a vehicle, an unmanned aerial vehicle or a wearable device, or they may be chips in the terminal device. Furthermore, the terminal device may also be referred to as user equipment. Therefore, the communication device may also be user equipment or a chip in user equipment. This is not specifically limited in this application.

[008] The method includes: A first communication device obtains a security policy corresponding to a proximity-based services group; determines, according to the security policy, whether to perform security protection on a payload field carried in a first message to be sent, and assigns a value to a field other than the payload field in the first message; and sends the first message to a second communication device. The security policy includes a confidentiality security policy and / or an integrity security policy; the confidentiality security policy indicates whether confidentiality security protection is enabled for a message from the proximity-based services group; the integrity security policy indicates whether the confidentiality security protection is enabled for a message from the proximity-based services group. Petition 870250090954, dated 06 / 10 / 2025, page 122 / 278 3 / 126 integrity security indicates whether integrity security protection is enabled for the proximity-based services group message, the proximity-based services group includes at least two members, and the first communication device is one of at least two members.The field other than the payload field includes one or more of the following: an identifier for a proximity-based services group key, an identifier for a proximity-based services group traffic key, an update parameter, confidentiality indication information, integrity indication information, or a message authentication code, MAC, where confidentiality indication information indicates whether confidentiality security protection is enabled, integrity indication information indicates whether integrity security protection is enabled, and security protection includes confidentiality security protection and / or integrity security protection.

[009] According to the solution provided in this request, the format of the first message is redefined, including the payload field and the field different from the payload field. Whether security protection should be performed in the payload field is determined according to the security policy corresponding to the proximity-based services group, and the value is assigned to the field different from the payload field. Furthermore, the proximity-based services group key identifier, the proximity-based services group traffic key identifier, the update parameter, and the confidentiality indication information are decoupled. This can prevent a case where the integrity check fails in a scenario where the security policy is that confidentiality is not required but integrity is required, improving the security of the Petition 870250090954, dated 06 / 10 / 2025, page 123 / 278 4 / 126 network communication and reducing a potential security risk.

[010] With reference to the first aspect, in some implementations of the first aspect, assigning the value to the field other than the payload field in the first message includes: When the confidentiality security policy indicates that confidentiality security protection is not enabled, but the integrity security policy indicates that integrity security protection is enabled, the first communication device sets the MAC to different from 0, and sets at least one of the proximity-based services group key identifier, the proximity-based services group traffic key identifier, and the update parameter to different from 0.

[011] Based on the previous solution, when the confidentiality security policy indicates that confidentiality security protection is not enabled, but the integrity security policy indicates that integrity security protection is enabled, the MAC is set to different from 0, and at least one of the proximity-based services group key identifier, the proximity-based services group traffic key identifier, and the update parameter is set to different from 0. This can prevent a case where the receiving UE cannot perform the integrity check or the integrity check subsequently fails, can prevent the receiving UE from being spoofed, ensure communication security, and reduce a potential security risk to a network.

[012] With reference to the first aspect, in some implementations of the first aspect, assigning the value to the field other than the payload field in the first message includes: When the confidentiality security policy indicates that the confidentiality security protection does not Petition 870250090954, dated 06 / 10 / 2025, page 124 / 278 5 / 126 is enabled, but the integrity security policy indicates that integrity security protection is enabled; the first communication device sets the confidentiality indication information to 0.

[013] Based on the previous solution, when the confidentiality security policy indicates that confidentiality security protection is not enabled, but the integrity security policy indicates that integrity security protection is enabled, the MAC is set to something other than 0, and the confidentiality indication information is set to 0. This can prevent the case where the receiving UE cannot perform integrity verification or the integrity verification subsequently fails, can prevent the receiving UE from being spoofed, ensure communication security, and reduce the potential network security risk.

[014] In this mode of this request, if the values ​​of the proximity-based service group key identifier, the proximity-based service group traffic key identifier, and the update parameter in the first message are 0, it is no longer completely linked to whether confidentiality security protection is enabled. In other words, when confidentiality security protection is not enabled (or disabled), confidentiality indication information can be used for indication or determination. Correspondingly, the values ​​of the proximity-based service group key identifier, the proximity-based service group traffic key identifier, and the update parameter can be 0 or cannot be 0. This is not specifically limited in this request.When confidentiality security protection is enabled, confidentiality indication information can also be used for indication or determination. In this case, the values ​​of the service-based group key identifier are used. Petition 870250090954, dated 06 / 10 / 2025, page 125 / 278 6 / 126 in proximity, the proximity-based services group traffic key identifier, and the update parameter cannot be 0.

[015] With reference to the first aspect, in some implementations of the first aspect, the first communication device determines, according to the security policy, whether to perform security protection on the payload field carried in the first message to be sent, and assigns a value to the field other than the payload field in the first message, including: When the confidentiality security policy indicates that confidentiality security protection is enabled, the first communication device determines to perform confidentiality security protection on the payload field carried in the first message to be sent, and sets a value of at least one of the following: proximity-based services group key identifier, proximity-based services group traffic key identifier, update parameter,and the confidentiality information that is carried in the first message should not be 0.,

[016] Based on the previous solution, when the confidentiality security policy indicates that confidentiality security protection is enabled, the first communication device sets the value of at least one of the proximity-based services group key identifier, the proximity-based services group traffic key identifier, the update parameter, and the confidentiality indication information that is carried in the first message to not be 0.

[017] With reference to the first aspect, in some implementations of the first aspect, the first communication device determines, according to the security policy, whether it should perform security protection in the payload field carried in the first message to be Petition 870250090954, dated 06 / 10 / 2025, page 126 / 278 7 / 126 sent, and assigning the value to the field different from the payload field in the first message includes: When the integrity security policy indicates that integrity security protection is enabled, the first communication device determines to perform integrity security protection on the payload field carried in the first message to be sent, and sets a value of the MAC carried in the first message to be different from 0.

[018] Based on the previous solution, when the integrity security policy indicates that integrity security protection is enabled, the first communication device sets the value of the MAC carried in the first message to be different from 0.

[019] With reference to the first aspect, in some implementations of the first aspect, the first communication device determines, according to the security policy, whether to perform security protection on the payload field carried in the first message to be sent, and assigns a value to the field other than the payload field in the first message, including: When the confidentiality security policy indicates that confidentiality security protection is not enabled, the first communication device determines not to perform confidentiality security protection on the payload field carried in the first message to be sent, and sets a value of at least one of the following: proximity-based services group key identifier, proximity-based services group traffic key identifier, update parameter,and the confidentiality indication information that is carried in the first message as 0.,

[020] Based on the previous solution, when the confidentiality security policy indicates that confidentiality security protection is not enabled, the first communication device sets the value of by Petition 870250090954, dated 06 / 10 / 2025, pp. 127 / 278 8 / 126 minus one of the following: proximity-based services group key identifier, proximity-based services group traffic key identifier, update parameter, and confidentiality indication information that are carried in the first message as 0.

[021] With reference to the first aspect, in some implementations of the first aspect, the first communication device determines, according to the security policy, whether to perform security protection on the payload field carried in the first message to be sent, and assigns a value to the field other than the payload field in the first message, including: When the integrity security policy indicates that integrity security protection is not enabled, the first communication device determines not to perform integrity security protection on the payload field carried in the first message to be sent, and sets a value of the MAC carried in the first message to 0.

[022] Based on the previous solution, when the integrity security policy indicates that integrity security protection is not enabled, the first communication device sets the value of the MAC carried in the first message to 0.

[023] With reference to the first aspect, in some implementations of the first aspect, the first communication device determines, according to the security policy, whether to perform security protection on the payload field carried in the first message to be sent, and assign the value to the field other than the payload field in the first message includes: The first communication device determines, according to a local policy and the security policy, to perform security protection on the payload field carried in the first message, and assign Petition 870250090954, dated 06 / 10 / 2025, pp. 128 / 278 9 / 126 the value to the field different from the payload field in the first message, where the local policy indicates a trigger condition for the first communication device to perform security protection in the payload field.

[024] With reference to the first aspect, in some implementations of the first aspect, the first communication device determines, according to the local policy and the security policy, whether to perform security protection in the payload field, and assign a value to the field other than the payload field in the first message includes: When the security policy indicates that security protection is optionally enabled, the first communication device determines, according to the local policy, whether to perform security protection in the payload field, and assign a value to the field other than the payload field in the first message.

[025] Based on the previous solution, when the security policy indicates that security protection is optionally enabled, the first communication device determines, according to the local policy, whether to perform security protection in the payload field, and assign the value to the field other than the payload field in the first message.

[026] With reference to the first aspect, in some implementations of the first aspect, the first communication device determines, according to the local policy and the security policy, whether to perform security protection in the payload field, and assign a value to a field other than the payload field in the first message, including: When the confidentiality security policy indicates that confidentiality security protection is optionally enabled, and a type of the first communication device is a roadside unit, the first communication device determines not to perform confidentiality security protection in the payload field, and sets a value for the information. Petition 870250090954, dated 06 / 10 / 2025, page 129 / 278 10 / 126 confidentiality indication carried in the field other than the payload field as 0, or sets at least one of the proximity-based services group key identifier, the proximity-based services group traffic key identifier, and the update parameter as 0.

[027] Based on the previous solution, when the confidentiality security policy indicates that confidentiality security protection is optionally enabled, and the type of the first communication device is the roadside unit, the first communication device sets the value of the confidentiality indication information carried in the field other than the payload field to 0, or sets at least one of the proximity-based services group key identifier, the proximity-based services group traffic key identifier, and the update parameter to 0.

[028] With reference to the first aspect, in some implementations of the first aspect, the first communication device determines, according to the local policy and the security policy, whether to perform security protection in the payload field, and assigns a value to the field other than the payload field in the first message, including: When the confidentiality security policy indicates that confidentiality security protection is optionally enabled, and a type of the first communication device is a vehicle, the first communication device determines to perform confidentiality security protection in the payload field, and sets a value of the confidentiality indication information carried in the field other than the payload field to be different from 0, or sets at least one of the proximity-based services group key identifier, the key identifier of Petition 870250090954, dated 06 / 10 / 2025, page 130 / 278 11 / 126 proximity-based service group traffic, and the update parameter is different from 0.

[029] Based on the previous solution, when the confidentiality security policy indicates that confidentiality security protection is optionally enabled, and the type of the first communication device is vehicle, the first communication device sets the value of the confidentiality indication information carried in the field other than the payload field to different from 0, or sets at least one of the proximity-based services group key identifier, the proximity-based services group traffic key identifier, and the update parameter to different from 0.

[030] With reference to the first aspect, in some implementations of the first aspect, the first communication device determines, according to the local policy and the security policy, whether to perform security protection on the payload field, and assign the value to the field other than the payload field in the first message includes: When the integrity security policy indicates that integrity security protection is optionally enabled, and at least two members of the proximity-based services group are roadside units, the first communication device determines not to perform integrity security protection on the payload field, and sets the value of the MAC carried in the field other than the payload field to 0.

[031] Based on the previous solution, when the integrity security policy indicates that integrity security protection is optionally enabled, and the types of at least two members in the proximity-based services group are roadside units, the first communication device determines not to perform integrity security protection. Petition 870250090954, dated 06 / 10 / 2025, page 131 / 278 12 / 126 integrity assurance in the payload field, and sets the value of the MAC carried in the field other than the payload field to 0.

[032] With reference to the first aspect, in some implementations of the first aspect, the first communication device determines, according to the local policy and the security policy, to perform security protection on the payload field, and assign the value to the field other than the payload field in the first message includes: When the integrity security policy indicates that integrity security protection is optionally enabled, and at least two member types in the proximity-based services group are vehicles, the first communication device determines to perform integrity security protection on the payload field, and sets the value of the MAC carried in the field other than the payload field to be different from 0.

[033] Based on the previous solution, when the integrity security policy indicates that integrity security protection is optionally enabled, and the types of at least two members in the proximity-based services group are vehicles, the first communication device determines to perform integrity security protection in the payload field, and sets the value of the MAC carried in the field other than the payload field to different from 0.

[034] With reference to the first aspect, in some implementations of the first aspect, the first communication device determines, according to the security policy, whether to perform security protection on the payload field carried in the first message to be sent, and assigning the value to the field other than the payload field in the first message includes: When the confidentiality security policy indicates that confidentiality security protection is not enabled, and the Petition 870250090954, dated 06 / 10 / 2025, page 132 / 278 13 / 126 integrity security policy indicates that integrity security protection is not enabled, the first communication device sets at least one of the following: proximity-based services group key identifier, proximity-based services group traffic key identifier, and update parameter as different from 0.

[035] With reference to the first aspect, in some implementations of the first aspect, confidentiality indication information is carried in an information header of a PDCP packet of the packet-based data convergence protocol of the first communication device.

[036] With reference to the first aspect, in some implementations of the first aspect, that the first communication device obtains the security policy corresponding to the proximity-based services group includes: The first communication device sends a request message to a network element of the key management function, where the request message includes a group identifier of the proximity-based services group and a security capability of the first communication device, and the request message is used to request the obtaining of the security policy associated with the group identifier; and the first communication device receives the security policy from the network element of the key management function.

[037] Optionally, the security policy is pre-configured.

[038] According to a second aspect, a method of communication is provided. The method may be performed by a second communication device (e.g., UE receiver), or it may be performed by a chip or circuit of the second communication device. This is not limited to this application. For ease of description, an example is given where a second device Petition 870250090954, dated 06 / 10 / 2025, page 133 / 278 The communication method used in the 14 / 126 role is described below.

[039] The method includes: A second communication device receives a first message from a first communication device, where the first message includes a payload field and a field different from the payload field; and the second communication device determines, according to a security policy corresponding to a proximity-based services group, whether to perform security unprotection on the payload field.The field other than the payload field includes one or more of the following: an identifier for a proximity-based services group key, an identifier for a proximity-based services group traffic key, an update parameter, confidentiality indication information, integrity indication information, or a message authentication code, MAC, where confidentiality indication information indicates whether confidentiality security protection is enabled, and integrity indication information indicates whether integrity security protection is enabled.The security policy includes a confidentiality security policy and / or an integrity security policy. The confidentiality security policy indicates whether confidentiality security protection is enabled for a message from the proximity-based services group. The integrity security policy indicates whether integrity security protection is enabled for the message from the proximity-based services group. The proximity-based services group includes at least two members, the second communication device is one of at least two members, and the security protection includes decryption and / or integrity verification.

[040] According to the solution provided in this request, a format of the first message is redefined, including the payload field and the field Petition 870250090954, dated 06 / 10 / 2025, page 134 / 278 15 / 126 different from the payload field, whether security protection should be performed in the payload field is determined according to the security policy corresponding to the proximity-based services group, and the value is assigned to a field other than the payload field. Furthermore, the proximity-based services group key identifier, the proximity-based services group traffic key identifier, the update parameter, and the confidentiality indication information are decoupled. This can prevent a case where integrity verification fails in a scenario where the security policy states that confidentiality is not required but integrity is, improving network communication security and reducing a potential security risk.

[041] With reference to the second aspect, in some implementations of the second aspect, which the second communication device determines, according to the security policy corresponding to the proximity-based services group, whether to perform security deprotection on the payload field includes: When the confidentiality security policy indicates that confidentiality security protection is enabled, the second communication device determines to decrypt the payload field; and / or when the integrity security policy indicates that integrity security protection is enabled, the second communication device determines to perform integrity verification on the payload field.

[042] With reference to the second aspect, in some implementations of the second aspect, which the second communication device determines, according to the security policy corresponding to the proximity-based services group, whether to perform security protection in the payload field includes: When the confidentiality security policy Petition 870250090954, dated 06 / 10 / 2025, page 135 / 278 16 / 126 indicates that confidentiality security protection is not enabled, the second communication device determines not to decrypt the payload field; and / or when the integrity security policy indicates that integrity security protection is not enabled, the second communication device determines not to perform integrity verification on the payload field.

[043] With reference to the second aspect, in some implementations of the second aspect, the second communication device determines, according to the security policy corresponding to the proximity-based services group, whether to perform security protection in the payload field, including: The second communication device determines, according to the security policy and the field different from the payload field, whether to perform security protection in the payload field.

[044] With reference to the second aspect, in some implementations of the second aspect, which the second communication device determines, according to the security policy and the field different from the payload field, whether to perform security protection on the payload field includes: When the integrity security policy indicates that integrity security protection is enabled, and the field different from the payload field does not carry the MAC or a MAC value carried in the field different from the payload field is 0, the second communication device determines that the integrity check on the payload field fails, or the second communication device discards the first message.

[045] With reference to the second aspect, in some implementations of the second aspect, which the second communication device determines, according to the security policy and the different field from the payload field, whether to perform security protection in the payload field includes: Petition 870250090954, dated 06 / 10 / 2025, page 136 / 278 17 / 126 When the integrity security policy indicates that integrity security protection is enabled, and the MAC value carried in the field other than the payload field is different from 0, the second communication device determines to perform the integrity check on the payload field.

[046] With reference to the second aspect, in some implementations of the second aspect, which the second communication device determines, according to the security policy and the field other than the payload field, whether to perform security protection in the payload field includes: When the integrity security policy indicates that integrity security protection is not enabled, and the value of the MAC carried in the field other than the payload field is different from 0, the second communication device determines not to perform integrity checking in the payload field.

[047] With reference to the second aspect, in some implementations of the second aspect, which the second communication device determines, according to the security policy and the field different from the payload field, whether to perform security protection on the payload field includes: When the integrity security policy indicates that integrity security protection is not enabled, and the field different from the payload field does not carry the MAC or the value of the MAC carried in the field different from the payload field is 0, the second communication device determines not to perform integrity checking on the payload field.

[048] With reference to the second aspect, in some implementations of the second aspect, which the second communication device determines, according to the security policy and the different field of the payload field, whether to perform security protection in the payload field includes: Petition 870250090954, dated 06 / 10 / 2025, page 137 / 278 18 / 126 When the integrity security policy indicates that integrity security protection is optionally enabled, and the MAC value carried in the field other than the payload field is different from 0, the second communication device determines whether to perform the integrity check on the payload field.

[049] With reference to the second aspect, in some implementations of the second aspect, which the second communication device determines, according to the security policy and the field different from the payload field, whether to perform security protection in the payload field includes: When the integrity security policy indicates that integrity security protection is optionally enabled, and the field different from the payload field does not carry the MAC or the value of the MAC carried in the field different from the payload field is 0, the second communication device determines not to perform security protection in the payload field.

[050] With reference to the second aspect, in some implementations of the second aspect, which the second communication device determines, according to the security policy and the field other than the payload field, whether to perform security protection on the payload field includes: When the confidentiality security policy indicates that confidentiality security protection is not enabled, and a value of at least one of the proximity-based services group key identifier, the proximity-based services group traffic key identifier, and the update parameter that are carried in the field other than the payload field is different from 0, the second communication device determines not to decrypt the payload field.

[051] With reference to the second aspect, in some implementations of the second aspect, which the second communication device determines, of Petition 870250090954, dated 06 / 10 / 2025, pp. 138 / 278 19 / 126 In accordance with the security policy and the field other than the payload field, if security protection is to be performed in the payload field, it includes: When the confidentiality security policy indicates that confidentiality security protection is not enabled, and the confidentiality indication information carried in the field other than the payload field indicates that confidentiality security protection is enabled, the second communication device determines not to decrypt the payload field.

[052] With reference to the second aspect, in some implementations of the second aspect, which the second communication device determines, according to the security policy and the field different from the payload field, whether to perform security deprotection on the payload field includes: When the confidentiality security policy indicates that confidentiality security protection is enabled, and the confidentiality indication information indicates that confidentiality security protection is not enabled, the second communication device determines to decrypt the payload field.

[053] With reference to the second aspect, in some implementations of the second aspect, which the second communication device determines, according to the security policy and the field different from the payload field, whether to perform security protection on the payload field includes: When the confidentiality security policy indicates that confidentiality security protection is optionally enabled, and the confidentiality indication information indicates that confidentiality security protection is not enabled, the second communication device determines not to decrypt the payload field.

[054] With reference to the second aspect, in some implementations Petition 870250090954, dated 06 / 10 / 2025, page 139 / 278 20 / 126 of the second aspect, which the second communication device determines, according to the security policy and the different field of the payload field, whether to perform security deprotection in the payload field includes: When the confidentiality security policy indicates that confidentiality security protection is optionally enabled, and the confidentiality indication information indicates that confidentiality security protection is enabled, the second communication device determines to decrypt the payload field.

[055] With reference to the second aspect, in some implementations of the second aspect, confidentiality indication information is carried in an information header of a PDCP packet of the packet-based data convergence protocol of the first communication device.

[056] With reference to the second aspect, in some implementations of the second aspect, the second communication device obtains the security policy corresponding to the proximity-based services group as follows: The second communication device sends a request message to a network element of the key management function, where the request message includes a group identifier of the proximity-based services group and a security capability of the second communication device, and the request message is used to request the security policy associated with the group identifier; and the second communication device receives the security policy from the network element of the key management function.

[057] Optionally, the security policy is pre-configured.

[058] For the beneficial effect of the second aspect and some implementations of the second aspect, see accordingly the Petition 870250090954, dated 06 / 10 / 2025, p. 140 / 278 21 / 126 related descriptions of the first aspect. The details are not described again in the present invention.

[059] According to a third aspect, a first communication device is provided, for example, a UE transmitter. The device includes an acquisition unit, configured to obtain a security policy corresponding to a proximity-based services group, where, for example, the acquisition unit may be a transceiver unit, configured to receive the security policy from one side of the network; and a processing unit, configured to: determine, according to the security policy, whether to perform security protection on a payload field carried in a first message to be sent, and assign a value to a field other than the payload field in the first message. The first communication device sends the first message to a second communication device.The security policy includes a confidentiality security policy and / or an integrity security policy; the confidentiality security policy indicates whether confidentiality security protection is enabled for a proximity-based services group message; the proximity-based services group includes at least two members; and the first communication device is one of at least two members. The payload field, other than the payload field, includes one or more of the following: a proximity-based services group key identifier, a proximity-based services group traffic key identifier, an update parameter, confidentiality indication information, or a message authentication code, MAC, where the confidentiality indication information indicates whether confidentiality security protection is enabled, and the security protection includes the protection of... Petition 870250090954, dated 06 / 10 / 2025, p. 141 / 278 22 / 126 security of confidentiality and / or the protection of security integrity.

[060] The transceiver unit can perform receiving and sending in the first aspect, and the processing unit can perform other processing in addition to receiving and sending in the first aspect.

[061] According to a fourth aspect, a second communication device is provided, for example, a receiving UE. The device includes a transceiver unit, configured to receive a first message from a first communication device, where the first message includes a payload field and a field different from the payload field; and a processing unit, configured to determine, according to a security policy corresponding to a proximity-based services group, whether to perform security unprotection on the payload field.The field other than the payload field includes one or more of the following: an identifier for a proximity-based services group key, an identifier for a proximity-based services group traffic key, an update parameter, confidentiality indication information, or a message authentication code, MAC, where the confidentiality indication information indicates whether confidentiality security protection is enabled.The security policy includes a confidentiality security policy and / or an integrity security policy; the confidentiality security policy indicates whether confidentiality security protection is enabled for a message from the proximity-based services group; the proximity-based services group includes at least two members; the second communication device is one of at least two members; and security protection includes decryption and / or integrity verification.

[062] The transceiver unit can perform reception and transmission in Petition 870250090954, dated 06 / 10 / 2025, page 142 / 278 23 / 126 second aspect, and the processing unit can perform other processing besides receiving and sending in the second aspect.

[063] According to a fifth aspect, a communication apparatus is provided, including a transceiver, a processor, and a memory. The processor is configured to control the transceiver to send and receive a signal. The memory is configured to store a computer program. The processor is configured to invoke the computer program from memory and execute the computer program, to enable the communication apparatus to perform the method according to the first aspect or the second aspect and any possible implementation of the first aspect or the second aspect.

[064] Optionally, there is one or more processors and one or more memory modules.

[065] Optionally, the memory can be integrated with the processor, or the memory and processor are arranged separately.

[066] Optionally, the communication device additionally includes a transmitting machine (transmitter) and a receiving machine (receiver).

[067] According to a sixth aspect, a communication system is provided, including one or more of the above first communication device, second communication device, and key management function network element.

[068] According to a seventh aspect, this application provides a computer-readable storage medium. The computer-readable storage medium stores a computer program or code. When the computer program or code is executed on a computer, the computer is enabled to perform the method according to the first aspect or the second aspect and any possible implementation of Petition 870250090954, dated 06 / 10 / 2025, page 143 / 278 24 / 126 first aspect or second aspect.

[069] According to an eighth aspect, a chip is provided, including at least one processor. The at least one processor is coupled to a memory, the memory is configured to store a computer program, and the processor is configured to invoke the computer program from memory and execute the computer program, to enable a communication apparatus in which the chip system is installed to perform the method according to the first aspect or the second aspect and any possible implementation of the first aspect or the second aspect.

[070] The chip may include an input circuit or interface configured to send information or data, and an output circuit or interface configured to receive information or data.

[071] According to a ninth aspect, a computer program product is provided. The computer program product includes computer program code. When the computer program code is executed by a communication device, the communication device is qualified to perform the method according to the first aspect or the second aspect and any possible implementation of the first aspect or the second aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[072] Figure 1 is a diagram of a network architecture 100 to which modalities of this request are applicable; Figure 2 is a schematic flowchart of a communication method 200 according to one modality of this request; Figure 3 is a schematic flowchart of a 300 communication method according to one modality of this request; Petition 870250090954, dated 06 / 10 / 2025, p. 144 / 278 25 / 126 Figure 4 is a schematic flowchart of a 400 communication method according to one modality of this request; Figure 5 is a schematic flowchart of a 500 communication method according to one modality of this request; Figure 6 is a schematic flowchart of a 600 communication method according to one modality of this request; Figure 7 is a schematic flowchart of a 700 communication method according to one modality of this request; Figure 8 is a diagram of the structure of a communication device 1000 according to one embodiment of this application; Figure 9 is a diagram of the structure of a 2000 communication device according to one embodiment of this application; and Figure 10 is a diagram of a 3000 chip system structure according to one embodiment of this application. DESCRIPTION OF THE MODALITIES

[073] Technical solutions for this application are described below with reference to the attached drawings.

[074] The technical solutions provided in this application can be applied to various communication systems, for example, a new radio system (new radio, NR), a long-term evolution system (long-term evolution, LTE), an LTE frequency division duplexing system (frequency division duplexing, FDD) and an LTE time division duplexing system (time division duplexing, TDD). The technical solutions provided in this application can additionally be applied to device-to-device communication (device-to-device, D2D), vehicle-to-everything communication (vehicle-to-everything, V2X), machine-to-machine communication (machine-to-machine, M2M), machine-type communication (communication Petition 870250090954, dated 06 / 10 / 2025, page 145 / 278 26 / 126 type machine, MTC), an Internet of Things (IoT) communication system or other communication system.

[075] In a communication system, a portion operated by an operator may be referred to as a public terrestrial mobile network (Public Terrestrial Mobile Network, PLMN), also known as an operator network or similar. A PLMN is a network established and operated by a government or an authorized operator to provide terrestrial mobile communication services to the public, primarily serving as a public network on which mobile network operators (MNOs) provide mobile broadband access services to users. The PLMN described in embodiments of this application may specifically be a network that meets the requirements of the 3GPP standard, abbreviated as a 3GPP network. The 3GPP network generally includes, but is not limited to, a 5G network, a 4th-generation mobile communication network (4G generation), and other future communication systems such as a 6th-generation network (6G generation).

[076] For ease of description, the 5G network is used as an example for description in the modalities of this application.

[077] Figure 1 is a diagram of a network architecture 100 to which embodiments of this application are applicable. As shown in Figure 1, the network architecture may specifically include the following network elements: 1. User equipment (user equipment, UE) may be referred to as a terminal device, a terminal, an access terminal, a subscriber unit, a subscriber station, a mobile station, a remote station, a remote terminal, a mobile device, a user terminal, a wireless communication device, a user agent, or a user appliance. The terminal device may alternatively be a telephone. Petition 870250090954, dated 06 / 10 / 2025, pp. 146 / 278 27 / 126 cellular, a cordless phone, a Session Initiation Protocol (SIP) phone, a wireless local loop station (WLL), a personal digital assistant (PDA), a portable device with wireless communication function, a computing device or other processing device connected to a wireless modem, a vehicle-mounted device, an unmanned aerial vehicle, a wearable device, a terminal device on a 5G network, a terminal device on an evolved PLMN, or similar. This is not limited to embodiments of this application. The UE may be connected to a next-generation radio access network (next-generation radio access network, NG-RAN) device via a Uu interface. For example, UE No. A and UE No. D shown in Figure 1 are connected to an NG-RAN via Uu interfaces.

[078] Compared to conventional cellular network communication, the UE that supports ProSe communication needs to have a proximity-based service application function (proximity-based service application, ProSe application). Two UEs with the ProSe proximity-based service application function can also be connected to each other via a PC5 interface. For example, as shown in Figure 1, UE No. A and UE No. B are connected to each other via a PC5 interface, UE No. B and UE No. C are connected to each other via a PC5 interface, and UE No. A and UE No. D are connected to each other via a PC5 interface. For a plurality of terminal devices (e.g., UE No. A, UE No. B, UE No. C, and UE No. D) in the same group, during message exchange, to ensure network communication security, the transmitting UE usually performs message security protection.Correspondingly, after receiving the message, the receiving UE also performs security checks on the message to prevent tampering by a malicious attacker. For example, the... Petition 870250090954, dated 06 / 10 / 2025, pp. 147 / 278 28 / 126 UE No. A and UE No. D can separately request, from the operator's network, a security parameter corresponding to the proximity-based services group. UE No. A performs security protection on a message to be sent based on the security parameter and sends the security-protected message to UE No. D. Correspondingly, after receiving the message, UE No. D performs security deprotection on the message based on the security parameter, to effectively ensure the security of the communication.

[079] 2. An access network (access network, AN) provides a network access function for authorized users in a specific area and may utilize transmission tunnels with different quality based on user levels, service requirements, and the like. The access network may be an access network that utilizes different access technologies. Current access network technologies include radio access network technology used in a 3G system, radio access network technology used in a 4G system, NG-RAN technology shown in Figure 1 (e.g., radio access technology used in a 5G system), or similar technologies.

[080] An access network that implements an access network function based on a wireless communication technology may be referred to as a radio access network (radio access network, RAN). The radio access network may manage radio resources, provide an access service to terminals, and additionally complete the forwarding of control signals and user data between terminals and core networks.

[081] The radio access network device may be, for example, a NodeB (NodeB), an evolved NodeB (evolved NodeB, eNB or eNodeB), a next-generation node base station (next-generation node base station, gNB) in a 5G mobile communication system, a base station in a Petition 870250090954, dated 06 / 10 / 2025, pp. 148 / 278 29 / 126 mobile communication system, an access point (access point, AP) in a Wi-Fi wireless hotspot system, or similar, or it may be a radio controller in a cloud radio access network (cloud radio access network, CRAN) scenario. Alternatively, the radio access network device may be a relay station, an access point, a vehicle-mounted device, an unmanned aerial vehicle, a wearable device, a network device in a 5G network, a network device in an evolved PLMN, or similar. A specific technology used by the radio access network device and a specific device form factor are not limited in the embodiments of this application.

[082] 3. An access management network element is primarily used for mobility management and access management, responsible for transmitting user policies between the user device and a policy control function network element (policy control function, PCF), and can be configured to implement different session management functions in a mobility management entity function (mobility management entity, MME), for example, an access authorization (authentication) function.

[083] An access and mobility management function (access and mobility management function, AMF) is configured to establish a NAS connection with the UE and has the same NAS 5G security context as the UE. The NAS 5G security context includes a NAS hierarchy key, key identification information identical to that of the NAS hierarchy key, a UE security resource, and uplink and downlink NAS COUNT values. The NAS hierarchy key includes a NAS encryption key and a NAS integrity security protection key, respectively, used for confidentiality security protection of Petition 870250090954, dated 06 / 10 / 2025, pp. 149 / 278 30 / 126 NAS message and NAS message integrity security protection.

[084] In a 5G communication system, the access management network element may be the AMF network element. In a future communication system, the access management network element may still be the AMF network element or may have another name. This is not limited to this application.

[085] 4. The session management network element is mainly used for session management, allocation and management of user equipment Internet Protocol (IP) addresses, selection and management of user plane functions, termination of interfaces for policy control and billing functions, downlink data notification, and the like.

[086] In the 5G communication system, the session management network element may be a session management function network element (session management function, SMF). In future communication systems, the session management network element may still be the SMF network element or may have another name. This is not limited to this application.

[087] 5. A user plane network element is used for packet routing and forwarding, quality of service (QoS) handling for user plane data, user plane data forwarding, collection of session / flow level billing statistics, bandwidth limiting function and the like.

[088] In the 5G communication system, the user plane network element can be a user plane function (UPF) network element. In the future communication system, the user plane network element may still be a UPF network element or it may have Petition 870250090954, dated 06 / 10 / 2025, pp. 150 / 278 31 / 126 another name. This is not limited to this request.

[089] 6. A data network element is a network for transmitting data.

[090] In the 5G communication system, the data network element may be a DN network element. In the future communication system, the data network element may still be the DN element or may have another name. This is not limited to this application.

[091] 7. A policy control network element supports a unified policy framework for the network to control behavior, provides policy rule information to control plane function network elements (e.g., the AMF network element and the SMF network element) and the like.

[092] In a 4G communication system, the policy control network element may be a network element with policy rules and billing function (policy rules and billing function, PCRF). In a 5G communication system, the policy control network element may be a network element with policy control function (policy control function, PCF). In future communication systems, the policy control network element may still be the PCF network element or may have another name. This is not limited to this application.

[093] 8. A data management network element is configured to perform user equipment identification, access authentication, registration, mobility management and the like.

[094] In the 5G communication system, the data management network element can be a unified data management (UDM) network element. In the 4G communication system, the data management network element can be a Petition 870250090954, dated 06 / 10 / 2025, pp. 151 / 278 32 / 126 Home Subscriber Server (HSS) network element. In future communication systems, the data management network element may still be the UDM network element or may have another name. This is not limited to this application.

[095] 9. A data repository network element is responsible for storing and retrieving subscription data, policy data, application data, and other types of data.

[096] In the 5G communication system, the data repository network element may be a unified data repository network element (unified data repository, UDR). In the future communication system, the data repository network element may still be the UDR network element or may have another name. This is not limited to this request.

[097] 10. A network exposure function entity (network exposure function, NEF) is used to securely expose services and resources provided by 3GPP network functions.

[098] 11. A ProSe application server (application server, AS) can be an application function (application role, AF) of a DN or it can be an AS that provides a ProSe service. An AF with the ProSe application server role has all the AF roles defined in Version 23.501 R15 and related roles used for a ProSe service. In other words, in a user plane architecture, the ProSe application server performs user plane communication with the UE via a UE-RAN-UPF-AF path. The ProSe application server can alternatively communicate with another network function (network role, NF) on a 5G core network (5G core network, 5GC) via a NEF in a control plane architecture, for example, communicating with the PCF via the NEF. If the ProSe application server is a DN AF and the AF is deployed Petition 870250090954, dated 06 / 10 / 2025, page 152 / 278 33 / 126 by a 5GC operator, the ProSe application server can alternatively communicate directly with another NF in the 5GC without via a NEF in a control plane architecture, for example, communicating directly with the PCF. [09 9] 12. A direct discovery name management function 5G (Direct Discovery Name Management Function, DDNMF) has the function of allocating and processing a mapping relationship between a proximity-based service application identifier (ProSe application identifier) ​​and a proximity-based service application code (ProSe application code) for open proximity-based service discovery (ProSe open discovery).In restricted proximity-based services discovery (restricted ProSe direct discovery), DDNMF 5G can communicate with a proximity-based services application server via a PC2 interface to process the authorization of a discovery request (discovery request) and also has the function of not allocating or processing a mapping relationship between an application identifier (application identifier) ​​and codes used in restricted proximity-based services, where the codes used in restricted proximity-based services include a restricted proximity-based services code (ProSe restricted code), a proximity-based services query code (ProSe query code), and a proximity-based services response code (ProSe response code).

[100] In the current standard definition, the 5G DDNMF has PLMN granularity, meaning that there is only one 5G DDNMF per PLMN. The 5G DDNMF can be determined uniquely based on a mobile country code (mobile country code, MCC) and a mobile network code (mobile network code, MNC). Petition 870250090954, dated 06 / 10 / 2025, pp. 153 / 278 34 / 126

[101] 13. An authentication server function (authentication server function, AUSF) can perform authentication and / or authorization on the subscriber based on authentication and / or authorization information stored in the UDM, or generate authentication and / or authorization information from the subscriber via the UDM, after receiving an authentication request initiated by a subscriber. The AUSF can forward the authentication and / or authorization information to the subscriber.

[102] 14. A proximity-based service key management function (ProSe key management function, PKMF) can be responsible for generating and distributing, to a UE that uses proximity-based services, a key used for a PC5 interface connection. The UE needs to interact with a KMF via a control plane to obtain the key used for the PC5 interface. For ease of description, the PKMF can be replaced by the KMF in embodiments of this application.

[103] 15. A network element with proximity-based service anchoring function (ProSe Anchoring Function, PAnF) is configured to store the UE ProSe security context and a 5GPRUK key, so that the PAnF retrieves an associated 5GPRUK based on the 5GPRUK ID after receiving a key fetch request from the AUSF.

[104] In the network architecture shown in Figure 1, the network elements can communicate with each other through the illustrated interfaces. As shown in the figure, the UE and the AMF can interact with each other through an N1 interface, and an interaction message can be called, for example, an N1 message (N1 Message). The RAN and the AMF can interact with each other through an N2 interface, and the N2 interface can be used to send a no-access stratum (NAS) message and the like. The RAN and the UPF can interact with each other through an N3 interface, and the N3 interface Petition 870250090954, dated 06 / 10 / 2025, pp. 154 / 278 35 / 126 can be used to transmit user plane data and the like. The SMF and UPF can interact with each other through an N4 interface, and the N4 interface can be used to transmit information such as tunnel identification information from an N3 connection, data buffer indication information, and a downlink data notification message. The UPF and DN can interact with each other through an N6 interface, and the N6 interface can be used to transmit user plane data and the like. The relationships between other interfaces and network elements are shown in Figure 1. For brevity, details are not described in the present invention.

[105] It should be understood that the network architecture applied to the embodiments of this application is merely an example of a network architecture described from a service-based architecture perspective, and a network architecture applicable to the embodiments of this application is not limited to this. Embodiments of this application are applicable to any network architecture that can implement network element functions. For example, in some network architectures, network element entities of network function, such as an AMF, an SMF network element, a PCF network element, and a UDM network element, are all referred to as network function NF network elements. Alternatively, in some other network architectures, a set of network elements, such as an AMF, an SMF network element, a PCF network element, and a UDM network element, may be referred to as control plane function network elements.Since the UE needs to interact with the KMF and DDNMF via the user plane, network elements such as the KMF and DDNMF can be referred to as user plane network elements.

[106] It should also be understood that the AMF, SMF, UPF, NEF, AUSF, NRF, PCF, UDM and similar terms shown in Figure 1 can be understood Petition 870250090954, dated 06 / 10 / 2025, pp. 155 / 278 36 / 126 network elements, configured to implement different functions in a core network, for example, can be combined as needed to form a network slice. These core network elements can be independent devices or can be integrated into the same device to implement different functions. A specific form of network elements is not limited in this application.

[107] It should be further understood that the names are defined merely to facilitate the distinction between different functions and should not constitute any limitation to this request. This request does not exclude the possibility that another name may be used in the 5G network and in another future network. For example, in the 6G network, some or all network elements may still use 5G terms or may use other names. The names of the interfaces between network elements in Figure 1 are merely illustrative, and the interfaces may have other names during the specific implementation. This is not specifically limited in this request. Furthermore, the names of the messages (or signaling) transmitted between network elements are also merely illustrative and do not constitute any limitation to the functions of the messages.

[108] With the rapid development of mobile communication, the widespread use of new types of data services, for example, video and virtual reality (VR) / augmented reality (AR) services, increases users' demands regarding bandwidth. The technical solutions in this application are primarily applicable to a D2D communication scenario. The scenario can be a ProSe service, a V2X service, or an angle measurement or ranging service (i.e., a ranging service). The network element and key name provided in this application do not constitute any limitation to the service scenario. D2D communication enables direct communication between UEs, and UEs Petition 870250090954, dated 06 / 10 / 2025, pp. 156 / 278 37 / 126 can share spectrum resources with cell users under the control of a cellular network, so that the utilization of spectrum resources is effectively enhanced. D2D communication includes one-to-many communication (one-to-many communication) and one-to-one communication (one-to-one communication). One-to-many communication corresponds to multicast and broadcast communication, and one-to-one communication corresponds to unicast communication. To implement the security of one-to-many communication, the UE side stores a plurality of keys. Specific descriptions of some keys are provided below.

[109] Compared to conventional cellular network communication, the UE that can be used for ProSe communication needs to have the ProSe application function (proximity-based services application). UEs with the ProSe application function communicate with each other via the PC5 interface and can be configured to transmit information in a data plane and a signaling plane. The proximity-based services application server (ProSe Application Server) corresponds to the ProSe application, and the ProSe application server can be the DN application function AF. An AF with the ProSe application server function has all the AF functions defined in Version 23.501 R-15 and the related function used for the ProSe service.

[110] Next, we briefly describe some network elements and keys in this application.

[111] (1) A KMF key management function stores a group-granularity security algorithm and information about group members based on a local configuration. The KMF is used to manage a group key, and the UE can interact with the KMF through a user plane channel. For example, the KMF can be a logical element of Petition 870250090954, dated 06 / 10 / 2025, pp. 157 / 278 38 / 126 network and is integrated into another network element. For example, the KMF could alternatively be a positioning management network element.

[112] (2) A network management function stores KMF address information and is used to manage a group identifier. The network management function stores information about the group members and is used to perform authorization. The network management function and the KMF can be an integrated network element or can be independent network elements. This is not limited to this application.

[113] (3) A proximity-based multimedia internet key for services (ProSe MIKEY Key, PMK) is used to protect the security of a MIKEY message. For ease of description, the PMK may be replaced by the KMF in some embodiments of this application. The key is a key with UE granularity and may be pre-configured and stored in the UE and KMF, or may be sent by the KMF key management function to the UE via a secure transmission channel. The KMF is identified by a KMF ID. For example, the KMF ID is 64 bits.

[114] (4) A proximity-based service group key (ProSe Group Key, PGK) is a key with group granularity, linked to a specific group. A group identifier is used to identify information about a group to which the UE belongs. The PGK is associated with the group identifier and a PGK ID. For example, the group identifier can be a layer 2 group identifier or it can be a group identifier carried in a PDCP layer of the packet-based data convergence protocol. This is not limited to this application. For example, the PGK ID can be an 8-bit identification information. The PGK is sent by the KMF key management function to the UE, and the KMF Petition 870250090954, dated 06 / 10 / 2025, pp. 158 / 278 39 / 126 protects the security of a message carrying the PGK.

[115] (5) A proximity-based service traffic key (ProSe Traffic Key, PTK) is a UE-granular key, and the PTK is uniquely identified by a group identifier, the PGK ID, a group member identifier (group member ID), and a PTK identifier (PTK ID). An input key to derive the PTK is the PGK, and the input parameters include a UE group member ID and the PTK identifier. The group member ID is a unique identifier used to identify the UE in the group. For example, the group member ID might be 24 bits. For example, the PTK ID might be a 16-bit counter, and the PTK ID increments monotonically each time a new PTK is generated.

[116] For example, when PTK is calculated from PGK, the following parameters must be used to form an S input of a key derivation function (key derivation function, KDF) specified in TS 33.220: FC = 0x4A; - P0 = Group member identity (which could be, for example, a Layer 2 source address of the transmitting UE); - L0 = Length of a group member identifier (for example, it could be 0x00 0x03); - P1 = PTK identifier; - L1 = Length of a PTK identity (for example, it could be 0x00 0x02); - P2 = Group identifier; and - L2 = Length of the group identifier (for example, it could be 0x00 0x03).

[117] The input key must be a 256-bit PGK. Petition 870250090954, dated 06 / 10 / 2025, pp. 159 / 278 40 / 126

[118] (6) A proximity-based service encryption key (ProSe Encryption Key, PEK) is used to perform confidentiality security protection on broadcast data. The PTK is a key with UE granularity, an input key to derive the PEK is the PTK, and the input parameters include a constant and a confidentiality algorithm ID that are tagged to calculate the PEK.

[119] (7) A proximity-based service integrity key (ProSe Integrity Key, PIK) is used to perform integrity security protection on broadcast data. The PIK is a key with UE granularity, an input key to derive the PIK is the PTK, and the input parameters include a constant and an integrity algorithm ID that are tagged to calculate the PIK.

[120] For example, when PEK or PIK is calculated from PTK or KD session, the following parameters must be used to form the S entry of the KDF specified in TS 33.220: - FC = 0x4B; - P0 = 0x00, which is used to derive PEK, where 0x01 is used to derive PIK; - L0 = Length of P0 (for example, it could be 0x00 0x01); - P1 = Algorithm identifier, which must be defined as specified in TS 33.401

[21] ; and - L1 = Length of the algorithm identifier (i.e., 0x00 0x01).

[121] The input key must be a 256-bit PTK or a 256-bit KD session.

[122] For an algorithm key with a length of n bits, where n is less than or equal to 256, the n least significant bits of the 256 bits generated by the KDF must be used as the algorithm key. Petition 870250090954, dated 06 / 10 / 2025, pp. 160 / 278 41 / 126

[123] Figure 2 is a schematic flowchart of a 200 communication method according to an embodiment of this application. The 200 method can be applied to the network architecture shown in Figure 1 and is primarily for one-to-many communication security (a broadcast or multicast scenario). The transmitting UE and the receiving UE can be UEs within the network coverage or can be UEs outside the network coverage. A KMF can be a key management network element. As shown in Figure 2, the method includes the following plurality of steps. For a part not described in detail, refer to an existing protocol.

[124] S210: The transmitting UE configures subscription information, and the transmitting UE initiates a service authorization procedure.

[125] Optionally, the subscription information includes an address of the key management network element. The transmitting UE configures the address of the key management network element, and the address is used by the transmitting UE to establish a transmission channel from the user plane to the key management network element.

[126] Optionally, the signature information includes a security parameter. The transmitting UE configures the security parameter used to access the key management network element, for example, a certificate or a (pre-)shared key. The security parameter is used to protect the security of the transmission between the transmitting UE and the key management network element.

[127] For the service authorization procedure initiated by the transmitting UE, in one implementation, the transmitting UE establishes a connection with the network element of the network management function, and the transmitting UE requests, from the network element of the network management function, a parameter no. 1 required for one-to-many communication. Petition 870250090954, dated 06 / 10 / 2025, pp. 161 / 278 42 / 126 Correspondingly, after receiving the request from the transmitting UE, the network element of the network management function determines whether to authorize the request from the transmitting UE and, additionally, whether to provide parameter number 1 to the transmitting UE.

[128] Parameter #1 includes one or more of the following: a group identifier, a security policy, and the KMF address.

[129] (1) The group identifier is used to identify information about a group to which the transmitting UE belongs.

[130] (2) The security policy mainly includes a confidentiality security policy and an integrity security policy. A security policy value includes mandatory or “not mandatory”, and indicates whether security protection is required at a transport layer. For example, the security policy indicates whether confidentiality security protection and / or integrity security protection is / are required at the transport layer.

[131] Optionally, the security policy can be preconfigured in step S210, or it can be received from one side of the network. For example, the security policy is received from the KMF (e.g., transported in a key reply message in step S240), or the security policy is received from the network element of the network management function. Optionally, the security policy corresponds to the group identifier, i.e., the security policy applicable to the group can be uniquely determined based on the group identifier.

[132] The security policy can be explicitly indicated, that is, indicated by the use of an independent information element (information element, IE). For example, the security policy is indicated based on 1-bit indication information, where 1” indicates that the security policy is Petition 870250090954, dated 06 / 10 / 2025, pp. 162 / 278 43 / 126 “mandatory” and “0” indicates that the security policy is “not mandatory”; or “true” indicates that the security policy is “mandatory” and “false” indicates that the security policy is “not mandatory”. Alternatively, the security policy can be indicated implicitly, that is, indicated based on a security algorithm. For example, when the security algorithm is a null algorithm, it indicates that the security policy is “not mandatory”; or when the security algorithm is a non-null algorithm, it indicates that the security policy is “mandatory”. This is not limited to this request.

[133] (3) The KMF address indicates KMF address information from which the transmitting UE obtains a group key.

[134] For example, in a multicast scenario, the network element of the network management function can determine, based on the information of the group members, whether to authorize the transmitting UE request. For example, when the transmitting UE is a member of the group, the network element of the network management function determines to authorize the transmitting UE request and sends parameter no. 1 to the transmitting UE; or when the transmitting UE is not a member of the group, the network element of the network management function determines not to authorize the transmitting UE request and refuses to send parameter no. 1 to the transmitting UE.

[135] For example, in a broadcast scenario, the network element of the network management function does not authorize the request from the transmitting UE. When the transmitting UE requests parameter no. 1, which is necessary for one-to-many communication, the network element of the network management function sends parameter no. 1 to the transmitting UE.

[136] S220: The transmitting UE sends a key request message to the KMF. Correspondingly, the KMF receives the key request message from the transmitting UE. Petition 870250090954, dated 06 / 10 / 2025, pp. 163 / 278 44 / 126

[137] The key request message is used to request the group key, and the key request message includes a transmitting UE security capability and a group identifier (e.g., a group ID).

[138] For example, the group identifier indicates the group key that the transmitting UE expects to obtain. The security capability of the transmitting UE includes a confidentiality algorithm and an integrity algorithm that are supported by the transmitting UE. For example, the confidentiality algorithm supported by the transmitting UE may include, but is not limited to: the null encryption algorithm, the AES-128 algorithm, the SNOW-3G-128 algorithm, the ZUC-128 algorithm and the like, and the algorithm identifiers that correspond to these algorithms are NEA0, NEA1, NEA2 and NEA3, respectively. For another example, the integrity security protection algorithm may include, but is not limited to: the null integrity protection algorithm, the AES-128 algorithm, the SNOW-3G-128 algorithm, the ZUC-128 algorithm and the like, and the algorithm identifiers that correspond to these algorithms are NIA0, NIA1, NIA2 and NIA3, respectively.

[139] For example, the key request message may be a key request message.

[140] S230: KMF checks whether the UE transmitter supports a group security algorithm.

[141] In other words, KMF checks whether the UE transmitter’s security capability includes the group security algorithm.

[142] For example, if the security algorithm supported by the transmitting UE security capability is the null encryption algorithm and the AES-128 algorithm, and the group security algorithm includes the null integrity protection algorithm, the KMF can determine that the transmitting UE Petition 870250090954, dated 06 / 10 / 2025, pp. 164 / 278 45 / 126 does not support the group security algorithm. Alternatively, if the security algorithm supported by the UE transmitter's security capability is the null encryption algorithm, the null integrity protection algorithm, and the AES-128 algorithm, and the group security algorithm includes the AES-128 algorithm, the KMF may determine that the UE transmitter supports the group security algorithm. Alternatively, if the security algorithm supported by the UE transmitter's security capability is the AES-128 algorithm and the SNOW-3G-128 algorithm, and the group security algorithm includes the SNOW-3G-128 algorithm and the ZUC-128 algorithm, the KMF may determine that the UE transmitter supports the group security algorithm.

[143] Optionally, the group security algorithm can be determined by the KMF based on a local configuration.

[144] S240: The KMF sends the key reply message to the transmitting UE. Correspondingly, the transmitting UE receives the key reply message from the KMF.

[145] For example, in step S230, if the KMF determines that the transmitting UE supports the group security algorithm, the KMF can accept the key request from the transmitting UE in step S220, i.e., it can provide the group key to the transmitting UE. The key reply message includes one or more of the following parameters, such as a transmitting UE group member identifier (e.g., a transmitting UE group member ID), a group security algorithm identifier (e.g., a confidentiality algorithm ID and / or an integrity algorithm ID), a PGK, and a PGK ID.

[146] (1) The group member ID is used to mark a transmitting UE identifier in the group.

[147] (2) The group security algorithm identifier indicates a Petition 870250090954, dated 06 / 10 / 2025, pp. 165 / 278 The 46 / 126 security algorithm is used when the transmitting UE performs one-to-many communication within the group, and the group security algorithm identifier includes the confidentiality algorithm identifier and the integrity algorithm identifier.

[148] (3) For specific descriptions of the PGK and PGK ID, see the related descriptions above. The details are not described in the present invention again. Optionally, the PGK and PGK ID may be carried in the key response message in step S240 or in another separate message.

[149] Optionally, in step S230, if the KMF determines that the transmitting UE does not support the group security algorithm, the KMF may reject the transmitting UE's key request in step S220, i.e., refuse to provide parameters such as the group member ID, the group security algorithm identifier, the PGK, and the PGK ID to the transmitting UE. For example, the KMF may send a key reply message to the transmitting UE, where the key reply message indicates that the provision of the group key was refused or the key reply message indicates that the key request failed. Optionally, the key reply message includes a rejection reason. For example, the rejection reason may be that the transmitting UE does not support the group security algorithm.

[150] For example, the key reply message can be a key reply message.

[151] S251: The receiving UE configures subscription information. The receiving UE initiates a service authorization procedure.

[152] S252: The receiving UE sends a key request message to the KMF. Correspondingly, the KMF receives the request message. Petition 870250090954, dated 06 / 10 / 2025, pp. 166 / 278 47 / 126 UE receiver key. Additionally, KMF sends a key reply message to the UE receiver. Correspondingly, the UE receiver receives the key reply message from KMF.

[153] Based on steps S251 and S252, the receiving UE can establish a connection with the network element of the network management function and obtain the group identifier, the security policy (e.g., whether security protection needs to be performed or not), the KMF address, and the like from the network element of the network management function. In addition, when the receiving UE supports the group security algorithm, the receiving UE can also obtain one or more parameters, such as a group member identifier of the receiving UE, a group security algorithm identifier (e.g., a confidentiality algorithm ID and / or an integrity algorithm ID), a PGK, or a KMF PGK ID.

[154] For specific implementations of steps S251 and S252, see the related descriptions in steps S210 to S240. For brevity, the details will not be described again in the present invention.

[155] S260: The UE transmitter derives a security key.

[156] For example, the transmitting UE derives one or more of the following security keys: a PTK, a PIK, or a PEK, to protect a message sent subsequently when the transmitting UE performs one-to-many communication in the group. For specific methods of deriving the PTK, PIK, and PEK, see the related descriptions above. For brevity, the details will not be described again in the present invention.

[157] S270: The EU transmitter performs security protection, for example, confidentiality security protection and integrity security protection, in message no. 1.

[158] Message #1 includes one or more of the following: the Petition 870250090954, dated 06 / 10 / 2025, pp. 167 / 278 48 / 126 group identifier (e.g., group ID), transmitting UE group member identifier (e.g., transmitting UE ID), PGK ID, PTK ID, counter, payload, and MAC. Optionally, ciphertext encoding can be sent to the receiving UE together as part of the payload. Optionally, the PGK ID can be 8 bits, the PTK ID can be 16 bits, and the MAC can be 32 bits.

[159] For example, when the security policy configured on the network side indicates that message no. 1 does not need to be encrypted, i.e., confidentiality security protection does not need to be performed on message no. 1, the transmitting UE can set the PGK ID, PTK ID and counter to 0; or when the security policy indicates that integrity security protection does not need to be performed on message no. 1, the transmitting UE can set the MAC to 0.

[160] In one implementation, the input parameters for performing security protection on message #1 may include the PEK / PIK, the PTK ID, and the counter. Specifically, the algorithm (see TS 33.401) is used with the following modifications: - Direction is always defined as 0; - bearer[0] and bearer[4] are defined as an LCID; - count[0] to count

[15] are defined as the PTK ID; and - The counter is inserted in count

[16] to count

[31] .

[161] A Logical Channel ID (LCID) associated with a PDCP / RLC entity is used as an input for encryption, in order to avoid duplicate key flows.

[162] Confidentiality security protection means performing encryption on the message based on a selected encryption algorithm and an encryption key. For example, the key of Petition 870250090954, dated 06 / 10 / 2025, pp. 168 / 278 49 / 126 cryptography is a PEK. Integrity security protection (integrity protection) means performing integrity protection on the message based on a selected integrity algorithm and an integrity protection key. For example, the integrity protection key is a PIK. Specifically, a physical means or a cryptographic method is used to ensure that information is not tampered with or modified without authorization during and after the generation, transmission, and storage of the information. Integrity security protection can be performed on the information using the cryptographic method in a plurality of ways. For example, a one-way function (e.g., a hash function) is used, and a symmetric key (integrity protection key) and message #1 are used as input parameters to generate the MAC, to implement integrity security protection on message #1.

[163] Optionally, after the transmitting UE performs the security protection on message no. 1, the ciphertext of the confidentiality security protection can be denoted as enc, a calculation result of the integrity security protection can be denoted as MAC, and the counter can be used as a freshness parameter. It should be understood that the freshness parameter is a newly added parameter to the input parameter to prevent a replay attack. The freshness parameter is added to the input parameter to ensure that an output parameter is fresh. For example, a common freshness parameter includes a nonce, a timestamp, a counter value, and the like.

[164] S280: The transmitting EU sends message no. 1. Correspondingly, the receiving UE receives message number 1 from the transmitting UE. Petition 870250090954, dated 06 / 10 / 2025, pp. 169 / 278 50 / 126

[165] For example, the transmitting UE sends message no. 1 by means of broadcast or multicast.

[166] S290: The receiving UE derives the security key, and performs security deprotection on message no. 1.

[167] Based on steps S252 and S270, the receiving UE obtains some or all of the following KMF parameters: the receiving UE group member identifier (e.g., the receiving UE group member ID), the group security algorithm identifier (e.g., the confidentiality algorithm ID and / or the integrity algorithm ID), the PGK, and the PGK ID. Message #1 obtained by the receiving UE from the transmitting UE includes some or all of the following parameters: the group identifier (e.g., the group ID), the transmitting UE group member identifier (e.g., the transmitting UE ID), the PGK ID, the PTK ID, the counter, the payload, and the MAC.

[168] For example, the receiving UE can derive the PGK based on the group ID and PGK ID that are carried in message no. 1, derive the PTK based on the PGK, the transmitting UE ID and the PTK ID, derive the PEK based on the PTK and the confidentiality algorithm constant and ID that are used to calculate the PEK, and derive the PIK based on the PTK and the integrity security protection algorithm constant and ID that are used to calculate the PIK. For specific PGK, PTK and PIK derivation processes, see the related descriptions in step S260. For brevity, the details will not be described again in the present invention.

[169] Optionally, when not all PGK, PTK and counter IDs are 0, this indicates that the transmitting UE encrypts message no. 1, and the receiving UE can decrypt, based on the PEK, the ciphertext of the payload carried in message no. 1, to obtain plaintext. Furthermore, when Petition 870250090954, dated 06 / 10 / 2025, pp. 170 / 278 If MAC address 51 / 126 is not entirely 0, this indicates that the transmitting UE performs integrity security protection on message #1, and the receiving UE can perform integrity security protection verification on message #1 based on PIK.

[170] In one example, decrypting the ciphertext in message no. 1 based on PEK involves performing the decryption calculation or a decryption operation based on the selected encryption algorithm.

[171] In one example, performing the integrity security protection check on message no. 1 based on the PIK involves calculating the value of a MAC based on the selected integrity algorithm and comparing the MAC value with the MAC value carried in message no. 1. If the MAC values ​​are the same, the integrity check can be considered successful; or if the MAC values ​​are different, the integrity check fails. Specifically, the receiving UE can calculate the shared key (integrity protection key) and perform the integrity security protection check on message no. 1. The shared key (integrity protection key) can be used by the receiving UE to verify whether the MAC carried in the received message no. 1 is generated by the transmitting UE, i.e., verify the authenticity of message no. 1 on which the transmitting UE performs the integrity security protection.If the MAC is generated using the shared key (integrity protection key) of the transmitting UE and the receiving UE successfully verifies the digital signature or the MAC using the shared key (integrity protection key), this indicates that message #1 has not been tampered with; or if the MAC is not generated using the shared key (integrity protection key) of the transmitting UE and the receiving UE does not verify the digital signature or the MAC using the shared key (integrity protection key), a. Petition 870250090954, dated 06 / 10 / 2025, pp. 171 / 278 52 / 126 verification failed.

[172] For the solution provided above, for message #1 sent by the transmitting UE, if an attacker changes all MAC values ​​in message #1 that are not 0 to 0, the receiving UE will not perform the integrity security protection check. Consequently, the attacker can tamper with message #1 to spoof the receiving UE, and the security of the communication cannot be guaranteed. Furthermore, when the security policy indicates that confidentiality security protection is not required, but integrity security protection is required, the PGK ID, PTK ID, and counter in message #1 are all set to 0. In this case, the receiving UE cannot derive the PIK based on the parameter in the received message #1, resulting in a failure of the integrity security protection check.

[173] In view of this, this application provides a method of communication and a communication device. A format for a first message is redefined, including a payload field and a field different from the payload field, whether security protection should play in the payload field is determined according to a security policy corresponding to a proximity-based services group, and a value is assigned to the field different from the payload field. In addition, an identifier for a proximity-based services group key, an identifier for a proximity-based services group traffic key, an update parameter, and confidentiality indication information are decoupled.This can prevent a case where integrity verification fails in a scenario where the security policy is that confidentiality is not required but integrity is, improving network communication security and reducing a potential security risk. Petition 870250090954, dated 06 / 10 / 2025, pp. 172 / 278 53 / 126

[174] To facilitate understanding of the modalities of this request, the following descriptions are provided.

[175] First, in this application, unless otherwise indicated or there is a logical conflict, the terms and / or descriptions between different modalities are consistent and can be mutually referenced, and the technical attributes in different modalities can be combined into a new modality based on an internal logical relationship between them.

[176] Secondly, in this request, “at least one” indicates one or more, “a plurality of” indicates two or more. The term “and / or” describes an association relationship between associated objects and indicates that three relationships can exist. For example, A and / or B can indicate the following three cases: A exists alone, A and B exist, and B exists alone, where A and B can be singular or plural. In the descriptions of this request, a “ / ” character usually indicates an “or” relationship between the associated objects. “At least one of the following items (pieces)” or a similar expression refers to any combination of these items, including a single item (piece) or any combination of a plurality of items (pieces). For example, at least one of a, bec can indicate a, b, c, aeb, aec, bec, or a, bec, where each of a, bec can be singular or plural.

[177] Thirdly, in this application, “first,” “second,” and various numbers (e.g., No. 1 and No. 2) are used merely for distinction, to facilitate description, and are not intended to limit the scope of the modalities of this application; for example, they are intended to distinguish between different messages, but not to describe a specific order or sequence. It should be understood that the objects described in this way are interchangeable in an appropriate circumstance, so that a different solution of the modalities of this application may be described. It should be noted that the number of each step in Petition 870250090954, dated 06 / 10 / 2025, pp. 173 / 278 54 / 126 of the modalities in this request is merely a number and does not represent an execution sequence. A specific execution sequence is described using words.

[178] Fourthly, in this application, descriptions such as “when...”, “in a case of...” and “if” mean that a device performs the corresponding processing in a goal case, are not intended to limit time, do not require the device to perform a determining action during implementation and do not mean that there is another limitation.

[179] Fifth, in this application, the terms “include” and “have” and any other variants thereof are intended to encompass non-exclusive inclusion. For example, a process, method, system, product or device that includes a list of steps or units is not necessarily limited to the steps or units expressly listed, but may include other steps or units not expressly listed or inherent in such process, method, product or device.

[180] Sixth, in this application, “indicate” can include a direct indication and an indirect indication. When an indication information indicates A, the indication information can indicate A directly or indicate A indirectly, but it does not indicate that the indication information definitely carries A. In this application, “indication information” can be an explicit indication, that is, a direct indication using signaling or an indication obtained based on a parameter indicated by signaling in combination with another rule or another parameter or obtained by deduction; or it can be an implicit indication, to be more specific, an indication obtained according to a rule or based on a relation or another parameter or obtained by deduction. This is not specifically limited in this application.

[181] Seventh, in this request, a “protocol” can mean a Petition 870250090954, dated 06 / 10 / 2025, pp. 174 / 278 55 / 126 standard protocol in the field of communication, for example, may include a 5G protocol, an NR protocol, and a related protocol applied to a future communication system. This is not limited to this request. “Pre-configuration” may include preset, for example, protocol definition. “Pre-definition” may be implemented by pre-storing the corresponding code or a corresponding table in a device, or it may be implemented in another way to indicate related information. A specific implementation of “pre-definition” is not limited to this request.

[182] Eighth, in this application, “storage” may mean storage in one or more memories. One or more memories may be arranged separately or may be integrated into an encoder, decoder, processor, or communication device. Alternatively, a portion of one or more memories may be arranged separately and a portion of one or more memories is integrated into the decoder, processor, or communication device. A type of memory may be a storage medium in any format. This is not limited to this application.

[183] ​​Ninthly, in this application, “communication” may also be described as “data transmission”, “information transmission”, “data processing” or the like. This is not limited to this application.

[184] The following describes in detail the communication method provided in embodiments of this application with reference to the attached drawings. Embodiments provided in this application are applicable to any communication scenario in which a transmitting device communicates with a receiving device, for example, and can be applied to the communication systems shown in Figure 1 and Figure 2.

[185] In modalities of this request, the message authentication code, MAC is set to 0, indicating integrity protection. Petition 870250090954, dated 06 / 10 / 2025, pp. 175 / 278 56 / 126 is not enabled; or the MAC may be set to false, indicating that integrity protection is not enabled. Conversely, the MAC is not set to 0, indicating that integrity protection is enabled. For example, if the MAC value in the first message is 0, this indicates that integrity security protection is not performed on the payload field in the first message; or if the MAC value in the first message is not 0, this indicates that security protection is performed on the payload field in the first message.

[186] Similarly, at least one of the proximity-based service group key identifiers and the proximity-based service group traffic key identifier is set to 0, indicating that confidentiality protection is not enabled. Alternatively, at least one of the proximity-based service group key identifiers and the proximity-based service group traffic key identifier may be set to false, indicating that confidentiality protection is not enabled. For example, if a value of at least one of the proximity-based service group key identifiers and the proximity-based service group traffic key identifier in the first message is 0, this indicates that the payload field in the first message is not encrypted.

[187] It should be noted that the fact that the field (i.e., the proximity-based services group key identifier, the proximity-based services group traffic key identifier, or the MAC) other than the payload field in the first message is set to 0 or is not 0 is merely an example. Optionally, the value may be assigned to a field other than the payload field in a boolean or string format. This is not limited to this request. To facilitate the Petition 870250090954, dated 06 / 10 / 2025, pp. 176 / 278 57 / 126 understanding, in some embodiments of this application, the value 0 or other than 0 is assigned to a field other than the payload field (i.e., the proximity-based services group key identifier, the proximity-based services group traffic key identifier, or the MAC), indicating whether confidentiality security protection and / or integrity security protection are enabled for the corresponding payload field.

[188] Figure 3 is a schematic flowchart of a 300 communication method according to an embodiment of this application. The 300 method may be performed by a communication device (e.g., a first communication device and a second communication device), or it may be performed by a chip or circuit of the communication device, or it may be implemented by a logic module or software that may implement all or part of the functions of the communication device. This is not limited to this application. An example where the method is performed by the first communication device (e.g., transmitting UE) and the second communication device (e.g., receiving UE) is used below for description. As shown in Figure 3, the method includes the following plurality of steps. For a part not described in detail, refer to the 200 method or an existing protocol.

[189] S310: The first communication device obtains a security policy corresponding to a group of proximity-based services.

[190] The security policy includes a confidentiality security policy and / or an integrity security policy; the confidentiality security policy indicates whether confidentiality security protection is enabled for a proximity-based services group message, and the integrity security policy indicates whether the Petition 870250090954, dated 06 / 10 / 2025, pp. 177 / 278 58 / 126 Security integrity protection is enabled for the proximity-based services group message. For example, a security policy value can include 1 or 0, or a security policy value can include true or false, where the value 1 or true indicates the first communication device to perform security protection on a first message to be sent, and the value 0 or false indicates the first communication device does not perform security protection on a first message to be sent. For ease of description, an example where the security policy value is 1 or 0 is below for description. The proximity-based services group includes at least two members, and the first communication device is one of at least two members.

[191] Optionally, the security policy can be preconfigured in step S310, or it can be received from one side of the network. For example, the security policy is received from a KMF, or the security policy is received from a network element of the network management function. Optionally, the security policy corresponds to a group identifier, i.e., the security policy applicable to the group can be uniquely determined based on the group identifier.

[192] Optionally, the first communication device and the second communication device in this embodiment of this application may be terminal devices, for example, a mobile phone, a vehicle, an unmanned aerial vehicle or a wearable device, or they may be chips in the terminal device. In addition, the terminal device may also be referred to as user equipment. Therefore, the communication device may also be user equipment or a chip in user equipment. This is not specifically limited in this application.

[193] It should be understood that the member described in the present invention is Petition 870250090954, dated 06 / 10 / 2025, pp. 178 / 278 59 / 126 a terminal device. The technical solutions in this application are primarily applicable to a secure one-to-many communication scenario between terminal devices. The security policy corresponding to the proximity-based services group can be understood as one where all members belonging to the same group use the same security policy in an information transmission process. For example, a network device configures the same security policy for all members of the group; for example, confidentiality security protection is enabled and integrity security protection is not enabled. For example, a group includes five UEs: UE 1 to UE 5. When any UEs in the five UEs receive and send messages to each other, confidentiality security protection is performed on the messages, and integrity protection is not performed.Furthermore, the confidentiality security policy indicates whether confidentiality security protection is enabled for the proximity-based services group message, and the integrity security policy indicates whether integrity security protection is enabled for the proximity-based services group message. It can be understood that when any UEs in the five UEs receive and send messages to each other, for example, when UE 1 (i.e., the first communication device) sends a message to UE 2 (i.e., the second communication device), UE 1 determines, according to the confidentiality security policy, whether to perform confidentiality security protection on the message. Correspondingly, after receiving the message, UE 2 determines, according to the confidentiality security policy, whether to decrypt the message and so on. Similarly, UE 1 determines, according to the integrity security policy, whether to perform the protection of Petition 870250090954, dated 06 / 10 / 2025, pp. 179 / 278 60 / 126 message integrity security. Correspondingly, after receiving the message, UE 2 determines, according to the integrity security policy, whether to perform message integrity verification and the like.

[194] For example, one way in which the first communication device obtains the security policy might be as follows: The first communication device sends a request message to the key management function network element, where the request message includes a group identifier of the proximity-based services group and a security capability of the first communication device, and the request message is used to request the security policy associated with the group identifier. Correspondingly, the key management function network element receives the request message from the first communication device, and sends the security policy to the first communication device. Correspondingly, the first communication device receives the security policy from the key management function network element.

[195] Optionally, the security policy is pre-configured on the first communication device.

[196] S320: The first communication device determines, according to the security policy, whether to perform security protection on the payload field (payload) carried in the first message to be sent and assigns a value to a field other than the payload field in the first message.

[197] The field other than the payload field includes a first safety parameter and / or a second safety parameter. The first safety parameter may also indicate whether the safety protection of Petition 870250090954, dated 06 / 10 / 2025, pp. 180 / 278 61 / 126 confidentiality is performed, and the second security parameter may also indicate whether integrity security protection is performed. The first security parameter includes one or more of the following: an identifier of a proximity-based services group key (e.g., a PGK ID), an identifier of a proximity-based services group traffic key (e.g., a PTK ID), an update parameter (e.g., a counter value), or confidentiality indication information. The second security parameter includes integrity indication information or a MAC. Confidentiality indication information indicates whether confidentiality security protection is enabled, integrity indication information indicates whether integrity security protection is enabled, and security protection includes confidentiality security protection and / or integrity security protection.It should be understood that the specific content included in the first security parameter and / or the second security parameter is merely an example. Another parameter used to perform the confidentiality security protection in the first message also belongs to the first security parameter, and another parameter used to perform the integrity security protection in the first message also belongs to the second security parameter. This is not limited to this request. For ease of understanding and description, an example where the first security parameter is at least one of the following: PGK ID, PTK ID, and the counter or confidentiality indication information, and the second security parameter is at least one of the following: MAC and integrity indication information is used below for description.

[198] For example, the first message includes the group identifier. Petition 870250090954, dated 06 / 10 / 2025, pp. 181 / 278 62 / 126 (group ID), a group member identifier (group member ID), the PGK ID, the PTK ID, the counter, the payload and the MAC, and a format of the first message is shown as follows: Group identifier, Group member identifier, PGK ID, PTK ID, Counter, MAC payload.

[199] Optionally, confidentiality indication information and / or integrity indication information are carried in an information header of a PDCP data packet from the first communication device. For example, confidentiality indication information or integrity indication information may be 1 bit. For example, when confidentiality security protection is enabled, a confidentiality indication information value may be 1; or when confidentiality security protection is not enabled, a confidentiality indication information value may be 0. When integrity security protection is enabled, an integrity indication information value may be 1; or when integrity security protection is not enabled, an integrity indication information value may be 0.Confidentiality indication information may be carried in the first message along with one or more of the proximity-based services group key identifier, the proximity-based services group traffic key identifier, and the update parameter. Integrity indication information may be carried in the first message along with the MAC address. This is not limited to this request.

[200] The following specifically describes an implementation in which when the security policy indicates that security protection needs to be performed on the first message (for example, the security policy value is 1) or does not need to be performed on the first message (for Petition 870250090954, dated 06 / 10 / 2025, pp. 182 / 278 63 / 126 example, the security policy value is 0), the first communication device determines whether to perform security protection on the payload field carried in the first message, and assigns the value to the field other than the payload field in the first message.

[201] In this modality of this request, when the first communication device determines, according to the confidentiality security policy, to perform confidentiality protection in the payload field in the first message, the payload field carries the encrypted text of the content of the message to be sent; or when the first communication device determines, according to the confidentiality security policy, not to perform confidentiality protection in the payload field in the first message, the payload field carries the plain text of the content of the message to be sent.

[202] For example, when the confidentiality security policy indicates that confidentiality security protection is enabled, the first communication device determines to perform confidentiality security protection on the payload field carried in the first message to be sent, and sets a value of at least one of the proximity-based services group key identifier, the proximity-based services group traffic key identifier, the update parameter, and the confidentiality indication information carried in the first message to not be 0.

[203] For example, when the confidentiality security policy indicates that confidentiality security protection is not enabled, the first communication device determines not to perform confidentiality security protection on the payload field carried in the first message to be sent, and sets a value of at least one of the Petition 870250090954, dated 06 / 10 / 2025, pp. 183 / 278 64 / 126 proximity-based services group key identifier, proximity-based services group traffic key identifier, update parameter, and confidentiality indication information that are carried in the first message as 0.

[204] For example, if the network configures that confidentiality protection needs to be performed, the first communication device sets the PGK ID, PTK ID, and counter in the first message to different from 0, based on a selected encryption algorithm, and encrypts the payload in the first message. If the network configures that confidentiality protection is not performed, the first communication device sets the PGK ID, PTK ID, and counter in the first message to 0 or different from 0.

[205] For example, when the integrity security policy indicates that integrity security protection is enabled, the first communication device determines whether to perform integrity security protection on the payload field carried in the first message to be sent, and sets a value of the MAC carried in the first message to be different from 0, that is, it does not set all MAC values ​​to 0, or assigns a value to the MAC based on the calculation method or usage rule in Figure 2.

[206] For example, when the integrity security policy indicates that integrity security protection is not enabled, the first communication device determines not to perform integrity security protection on the payload field carried in the first message to be sent, and sets all MAC values ​​carried in the first message to 0.

[207] For example, if the network is configured to require integrity protection, the first communication device calculates, with Petition 870250090954, dated 06 / 10 / 2025, pp. 184 / 278 Based on a selected integrity algorithm, the MAC address is transported in the first message. If the network is configured so that integrity protection is not performed, the first communication device sets all MAC values ​​in the first message to 0, or does not transport the MAC address in the first message to be sent.

[208] For example, when the confidentiality security policy indicates that confidentiality security protection is not enabled, but the integrity security policy indicates that integrity security protection is enabled, the first communication device sets the MAC as different from 0, and sets at least one of the proximity-based services group key identifier, the proximity-based services group traffic key identifier, and the update parameter as different from 0, that is, it does not set at least one of the proximity-based services group key identifier, the proximity-based services group traffic key identifier, and the update parameter as 0.

[209] For example, when the confidentiality security policy indicates that confidentiality security protection is not enabled, but the integrity security policy indicates that integrity security protection is enabled, the first communication device sets the confidentiality indication information to 0.

[210] For example, if the network is configured so that confidentiality protection is not performed and integrity protection is performed, the first communication device sets a security information value (e.g., PGK ID, PTK ID, and counter) to be different from 0 in the first message, or sets the confidentiality indication information value to 0, and sets the MAC in the first message. Petition 870250090954, dated 06 / 10 / 2025, pages 185 / 278 66 / 126 equals anything other than 0.

[211] For example, if the network is configured so that confidentiality protection and integrity protection are not performed, the first communication device sets a security information value (for example, the PGK ID, the PTK ID and the counter) to be different from 0 in the first message, or sets the confidentiality indication information value to 0, and sets all MAC values ​​in the first message to 0.

[212] S330: The first communication device sends the first message to the second communication device. Correspondingly, the second communication device receives the first message from the first communication device.

[213] S340: The second communication device determines, according to the security policy corresponding to the proximity-based services group, whether to perform security protection in the payload field.

[214] Security breaching includes decryption and / or integrity verification. For specific implementations of decryption and integrity verification, see the related descriptions of method 200. For brevity, details will not be described again in the present invention.

[215] The following specifically describes an implementation in which, when the security policy indicates that security protection needs to be performed on the first message (for example, the security policy value is 1) or does not need to be performed on the first message (for example, the security policy value is 0), the second communication device can determine, according to the security policy corresponding to the proximity-based services group, whether it should Petition 870250090954, dated 06 / 10 / 2025, pp. 186 / 278 67 / 126 perform safety protection in the payload field.

[216] For example, when the confidentiality security policy indicates that confidentiality security protection is enabled, the second communication device determines to decrypt the payload field.

[217] For example, when the confidentiality security policy indicates that confidentiality security protection is not enabled, the second communication device determines not to decrypt the payload field.

[218] For example, if the network is configured to require confidentiality protection, the second communication device performs a decryption operation based on the selected encryption algorithm. If the network is configured to not require confidentiality protection, the second communication device does not decrypt the first message.

[219] For example, when the integrity security policy indicates that integrity security protection is enabled, the second communication device determines to perform the integrity check on the payload field.

[220] For example, when the integrity security policy indicates that integrity security protection is not enabled, the second communication device determines not to perform integrity verification in the payload field.

[221] For example, if the network is configured to require integrity protection, the second communication device performs integrity checking on the first message based on the selected integrity algorithm. If the network is configured not to perform integrity protection, the second communication device performs integrity checking on the first message based on the selected integrity algorithm. Petition 870250090954, dated 06 / 10 / 2025, pages 187 / 278 68 / 126 is performed, the second communication device does not perform the integrity check on the first message.

[222] When the security policy indicates that security protection needs to be performed on the first message (for example, the security policy value is 1) or does not need to be performed on the first message (for example, the security policy value is 0), the second communication device may additionally determine, according to the security policy corresponding to the proximity-based services group and the value of the field other than the payload field carried in the first message, whether to perform security protection on the payload field.

[223] For example, the second communication device compares whether the security policy that corresponds to the proximity-based services group and that is configured by the network device matches the value of the field different from the payload field carried in the first message received. If the two values ​​do not match, the second communication device can discard the first message. On the other hand, if the two values ​​match, the second communication device can additionally determine, according to the security policy or the field value, whether to perform security unprotection.

[224] For example, when the integrity security policy indicates that integrity security protection is enabled, and the field other than the payload field carried in the first message does not carry the MAC, or all MAC values ​​carried in the field other than the payload field carried in the first message are 0, this indicates that an indication of integrity security protection (e.g., the MAC) carried in the first message does not match the integrity security policy. Petition 870250090954, dated 06 / 10 / 2025, pages 188 / 278 69 / 126 integrity configured on the network side. In this case, the second communication device may determine that the integrity check in the payload field fails, or the second communication device discards the first message.

[225] For example, when the integrity security policy indicates that integrity security protection is enabled, and the MAC value in the payload field carried in the first message is different from 0, the second communication device determines to perform the integrity check on the payload field.

[226] For example, when the integrity security policy configured on the network side indicates that integrity security protection is required (e.g., the value is 1), if all MAC values ​​carried in the first message are 0 or the MAC is not carried, this indicates that the integrity security protection indication carried in the first message does not match the integrity security policy configured on the network side. In this case, the second communication device discards the first message. If not all MAC values ​​carried in the first message are 0, this indicates that the integrity security protection indication (e.g., the MAC) carried in the first message matches the integrity security policy configured on the network side.In this case, the second communication device performs an integrity check on the first message. For example, it calculates a MAC address value based on the selected integrity algorithm and compares this MAC address with the MAC address carried in the first message to determine if the MAC addresses are the same, thus verifying the integrity of the first message received. If the MAC addresses are the same, the integrity check is successful. If the values... Petition 870250090954, dated 06 / 10 / 2025, pp. 189 / 278 If the MAC addresses 70 / 126 are different, the integrity protection check fails.

[227] For example, when the integrity security policy indicates that integrity security protection is not enabled, and the MAC value in the payload field carried in the first message is different from 0, the second communication device determines not to perform integrity checking on the payload field.

[228] For example, when the integrity security policy indicates that integrity security protection is not enabled, and the field other than the payload field carried in the first message does not carry the MAC, or all MAC values ​​carried in the field other than the payload field carried in the first message are 0, the second communication device determines not to perform integrity checking on the payload field.

[229] For example, when the integrity security policy configured on the network side indicates that integrity security protection is not required (e.g., the value is 0), if the MAC value carried in the first message is 0 or the MAC is not carried, it indicates that the integrity security protection indication (e.g., the MAC) carried in the first message matches the integrity security policy configured on the network side. In this case, the second communication device does not perform the integrity check on the first message. If the MAC value carried in the first message is not 0, this indicates that the integrity security protection indication carried in the first message does not match the integrity security policy configured on the network side.In this case, the second communication device discards the first message, or the second communication device does not perform the integrity check on the first message. Petition 870250090954, dated 06 / 10 / 2025, pp. 190 / 278 71 / 126

[230] Optionally, if the network is configured so that integrity protection is not performed, the second communication device may ignore the MAC value carried in the first message, and not perform the integrity check on the first message, or consider that the integrity check on the first message was successful.

[231] For example, when the confidentiality security policy indicates that confidentiality security protection is not enabled, and the value of at least one of the proximity-based services group key identifier, the proximity-based services group traffic key identifier, and the update parameter that are carried in the field other than the payload field carried in the first message is not 0, the second communication device determines not to decrypt the payload field.

[232] For example, when the confidentiality security policy indicates that confidentiality security protection is not enabled, and the confidentiality indication information carried in the field other than the payload field carried in the first message indicates that confidentiality security protection is enabled, the second communication device determines that the confidentiality indication information carried in the field other than the payload field indicates that confidentiality security protection is enabled, and does not decrypt the payload field.

[233] For example, when the confidentiality security policy configured on the network side indicates that confidentiality security protection is not required (for example, the value is 0), if all the PGK ID, PTK ID, and counter values ​​carried in the first message are 0, and / or if the confidentiality indication information value Petition 870250090954, dated 06 / 10 / 2025, pp. 191 / 278 If the value 72 / 126 carried in the first message is 0, this indicates that a confidentiality security protection indication (e.g., PGK ID, PTK ID, counter, or confidentiality indication information) carried in the first message matches the confidentiality security policy configured on the network side, and the second communication device does not decrypt the first message. If none of the values ​​for the PGK ID, PTK ID, and counter carried in the first message is 0, and / or if the value of the confidentiality indication information carried in the first message is 1, it indicates that the confidentiality security protection indication carried in the first message does not match the confidentiality security policy configured on the network side, and the second communication device discards the first message, or the second communication device does not decrypt the first message.

[234] For example, when the confidentiality security policy indicates that confidentiality security protection is enabled, and the confidentiality indication information indicates that confidentiality security protection is not enabled (for example, the value of at least one of the proximity-based services group key identifier, the proximity-based services group traffic key identifier, and the update parameter that are carried in the field other than the payload field is different from 0, or the confidentiality indication information carried in the field other than the payload field indicates that confidentiality security protection is not enabled), the second communication device determines to decrypt the payload field.

[235] For example, when the confidentiality security policy Petition 870250090954, dated 06 / 10 / 2025, pp. 192 / 278 73 / 126 indicates that confidentiality security protection is enabled, and the confidentiality indication information indicates that confidentiality security protection is enabled (for example, the value of at least one of the proximity-based services group key identifier, the proximity-based services group traffic key identifier, and the update parameter that are carried in the field other than the payload field is different from 0, or the confidentiality indication information carried in the field other than the payload field indicates that confidentiality security protection is enabled), the second communication device determines to decrypt the payload field.

[236] For example, when the confidentiality security policy configured on the network side indicates that confidentiality security protection is required (for example, the value is 1), if none of the PGK ID, PTK ID, and counter values ​​carried in the first message are 0, and / or if the confidentiality indication information value carried in the first message is 1, it indicates that the confidentiality security protection indication (for example, the PGK ID, the PTK ID, the counter, or the confidentiality indication information) carried in the first message does not match the confidentiality security policy configured on the network side, and the second communication device discards the first message, or decrypts the first message.If none of the PGK ID, PTK ID, and counter values ​​carried in the first message are 0, and / or if the value of the confidentiality indication information carried in the first message is 0, this indicates that the confidentiality security protection indication carried in the first message matches the security policy of. Petition 870250090954, dated 06 / 10 / 2025, pp. 193 / 278 74 / 126 confidentiality is configured on the network side, and the second communication device decrypts the first message.

[237] According to the solution provided in this application, the format of the first message is redefined, including the payload field and the field different from the payload field, whether security protection should be performed in the payload field is determined according to the security policy corresponding to the proximity-based services group, and the value is assigned to the field different from the payload field. In addition, the proximity-based services group key identifier, the proximity-based services group traffic key identifier, the update parameter, and the confidentiality indication information are decoupled. This can prevent a case where integrity verification fails in a scenario where the security policy is that confidentiality is not required but integrity is required, improving network communication security and reducing a potential security risk.

[238] Based on the solution shown in Figure 2, the security policy currently configured on the network side is at a group granularity, to indicate whether message #1 needs to be protected by security. Consequently, the security requirements of different UEs in the group cannot be met, and adaptability and flexibility are weak. For example, when the receiving UE in the group is a roadside unit (roadside unit), message #1 has no confidentiality security protection requirement. When the UE in the group is a vehicle, message #1 has a confidentiality security protection requirement. If the security policy indicates that message #1 needs to be protected by security, when broadcasting the message to the vehicle, the roadside unit always needs to perform a cryptographic calculation. Additionally, to Petition 870250090954, dated 06 / 10 / 2025, pp. 194 / 278 75 / 126 receiving message #1, the vehicle always needs to perform a decryption calculation. This increases the complexity of the calculation, signaling overhead, and communication delay. Therefore, the following method 400 is provided to meet the security requirements of different UEs in a group, increasing the value of a security policy, and improving adaptability and flexibility. Correspondingly, the receiving UE can additionally determine, according to the security policy and a field value different from the payload field carried in message #1, whether to perform security deprotection on message #1.

[239] Figure 4 is a schematic flowchart of a 400 communication method according to an embodiment of this application. The 400 method may be performed by a communication device (e.g., a first communication device and a second communication device), or it may be performed by a chip or circuit of the communication device, or it may be implemented by a logic module or software that may implement all or part of the functions of the communication device. This is not limited to this application. An example where the method is performed by the first communication device (e.g., UE transmitter) and the second communication device (e.g., UE receiver) is used below for description. As shown in Figure 4, the method includes the following plurality of steps. For a part not described in detail, refer to the 200 method, the 300 method, or an existing protocol.

[240] S410: The first communication device obtains a security policy corresponding to a group of proximity-based services.

[241] A security policy value includes “preferred”, and indicates that security protection is optionally performed on the first message to be sent. Petition 870250090954, dated 06 / 10 / 2025, pp. 195 / 278 76 / 126

[242] S420: The first communication device determines, according to the security policy and a local policy, whether to perform security protection on a payload field carried in the first message to be sent, and assign a value to a field other than the payload field in the first message.

[243] The following specifically describes an implementation in which when the security policy indicates that security protection is optionally performed on the first message (for example, the security policy value is “preferred”), the first communication device determines whether to perform security protection on the payload field carried on the first message, and assigns the value to the field other than the payload field on the first message.

[244] For example, when the security policy indicates that security protection is optionally enabled, the first communication device determines, according to the local policy, whether to perform security protection in the payload field, and assign the value to the field other than the payload field in the first message.

[245] Local policy indicates a triggering condition for the first communication device to perform security protection in the payload field. For example, when a terminal type of the first communication device is a roadside unit, confidentiality security protection is not performed, and integrity security protection is optionally performed. When a terminal type of the first communication device is the vehicle, confidentiality security protection is performed, and integrity security protection is optionally performed. For another example, when the first communication device is in an enclosed environment, the protection of Petition 870250090954, dated 06 / 10 / 2025, pp. 196 / 278 77 / 126 confidentiality security and / or integrity security protection are / are not performed. For another example, when the performance or a capability of the first communication device's terminal is insufficient to support the activation of security protection, confidentiality security protection and / or integrity security protection are / are not performed. For another example, for a specific service scenario (session establishment, service registration request, or similar), the first communication device needs to perform confidentiality security protection and / or integrity security protection.

[246] For example, when the confidentiality security policy indicates that confidentiality security protection is optionally enabled, and a type of the first communication device is a roadside unit, the first communication device determines not to perform confidentiality security protection in the payload field, and sets a value of confidentiality indication information carried in the field other than the payload field to 0, or sets at least one of an identifier of a proximity-based services group key, an identifier of a proximity-based services group traffic key, and an update parameter to 0.

[247] For example, when the confidentiality security policy indicates that confidentiality security protection is optionally enabled, and a type of the first communication device is a vehicle, the first communication device determines to perform confidentiality security protection in the payload field, and sets a value of confidentiality indication information carried in the field other than the payload field to different from 0, or sets at least one of an identifier of a service-based group key. Petition 870250090954, dated 06 / 10 / 2025, pp. 197 / 278 78 / 126 proximity, an identifier for a proximity-based service group traffic key, and an update parameter other than 0.

[248] For example, if the network configures that confidentiality protection is optionally performed, and a confidentiality security policy value is “preferred”, the first communication device determines, based on a terminal type of the first communication device, for example, a roadside unit, not to perform confidentiality security protection on the first message, and sets the PGK ID, PTK ID, and counter values ​​on the first message to 0, or sets the confidentiality indication information value to 0. Optionally, a MAC address on the first message is set to 0 or to something other than 0.

[249] S430: The first communication device sends the first message to the second communication device. Correspondingly, the second communication device receives the first message from the first communication device.

[250] S440: The second communication device determines, according to the security policy corresponding to the proximity-based services group and the field different from the payload field, whether to perform security protection in the payload field.

[251] Security breaches include decryption and / or integrity verification.

[252] The following specifically describes an implementation in which, when the security policy indicates that security protection is optionally performed on the first message (for example, the security policy value is “preferred”), the second communication device determines, according to the security policy corresponding to the group of Petition 870250090954, dated 06 / 10 / 2025, pages 198 / 278 79 / 126 proximity-based services and the field different from the payload field, if safety protection must be performed in the payload field.

[253] For example, the second communication device compares whether the security policy that corresponds to the proximity-based services group and that is configured by a network device matches the different payload field carried in the first message received. Because the security policy value is “preferred,” regardless of whether the value of the different payload field in the first message is 0 or different from 0, the second communication device can consider that the security policy matches the different payload field, and the second communication device can additionally determine, based on the values ​​of the other fields (e.g., PTK ID, PGK ID, counter, confidentiality indication information, and MAC), whether to perform security unprotection.

[254] For example, when the integrity security policy indicates that integrity security protection is optionally enabled, and the value of the MAC carried in the field other than the payload field is different from 0, the second communication device determines to perform the integrity check on the payload field.

[255] For example, when the integrity security policy indicates that integrity security protection is optionally enabled, and the field other than the payload field does not carry the MAC or the value of the MAC carried in the field other than the payload field is 0, the second communication device determines not to perform security protection on the payload field.

[256] For example, when the integrity security policy configured on the network side indicates that integrity security protection Petition 870250090954, dated 06 / 10 / 2025, pp. 199 / 278 If 80 / 126 is optionally enabled (e.g., the value is “preferred”), if the MAC value carried in the first message is 0 or the MAC is not carried, the second communication device does not perform the integrity check on the first message, or considers that the integrity check on the first message was successful. If not all MAC values ​​carried in the first message are 0, the second communication device performs the integrity check on the first message, for example, it calculates a MAC value based on a selected integrity algorithm, and compares the MAC value with the MAC value carried in the first message to determine if the MAC values ​​are the same, verifying the integrity of the first message received. If the MAC values ​​are the same, the integrity protection check is successful. If the MAC values ​​are different, the integrity protection check fails.

[257] For example, when the confidentiality security policy indicates that confidentiality security protection is optionally enabled, and the confidentiality indication information indicates that confidentiality security protection is not enabled, the second communication device determines not to decrypt the payload field.

[258] For example, when the confidentiality security policy indicates that confidentiality security protection is optionally enabled, and the confidentiality indication information indicates that confidentiality security protection is enabled, the second communication device determines to decrypt the payload field.

[259] For example, when the confidentiality security policy configured on the network side indicates that confidentiality security protection is optionally enabled (for example, the value is Petition 870250090954, dated 06 / 10 / 2025, pages 200 / 278 81 / 126 “preferred”), if the value of the confidentiality indication information carried in the first message is 0, the second communication device does not decrypt the first message, or considers that the first message was successfully decrypted. If the value of the confidentiality indication information carried in the first message is 1, the second communication device decrypts the first message, for example, it performs a decryption operation on the payload field in the first message based on a selected confidentiality algorithm.

[260] It should be noted that method 300 and method 400 are described separately based on the format of the first message, the parameter value included in the field different from the payload field in the first message, and the addition of the security policy value configured by the network device. This can avoid a case where the second communication device cannot perform integrity verification or the verification fails after receiving the first message, and flexibility and adaptability are improved. The two methods can be implemented independently or in combination. This is not specifically limited in this application.

[261] Figure 5 is a schematic flowchart of a 500 communication method according to an embodiment of this application. The 500 communication method is for one-to-many communication security (a broadcast or multicast scenario). In this implementation, whether confidentiality security protection and integrity security protection must be performed on a message is determined by the transmitting UE according to both a confidentiality security policy configured on one side of the network and a local policy. Petition 870250090954, dated 06 / 10 / 2025, pp. 201 / 278 82 / 126 shown in Figure 5, the method includes the following plurality of steps. For a part not described in detail, refer to method 200, method 400, or an existing protocol.

[262] S510: UE transmitter configures subscription information, and the UE transmitter initiates a service authorization procedure.

[263] For example, the transmitting UE obtains a parameter n° A required for one-to-many communication, where parameter n° A includes one or more of a group identifier, a security policy n° A, and a KMF address. Security policy n° A mainly includes a confidentiality security policy n° A and an integrity security policy n° A. A value of security policy n° A can include “mandatory”, “not mandatory”, or “preferred”, and indicates whether security protection is required at a transport layer. For example, when the value of security policy n° A is “preferred”, it indicates that the transmitting UE optionally performs security protection on the message to be sent n° A. In other words, the transmitting UE can perform security protection on message n° A, or it can not perform security protection on message n° A.The security protection in the present invention includes confidentiality security protection and integrity security protection.

[264] In this modality of this request, the transmitting UE and receiving UE belong to the same group (for example, a proximity-based services group), and have the same group identifier (for example, a group ID of the proximity-based services group). Optionally, security policy no. A is at a group granularity, and is associated with the group ID. In other words, a plurality of UEs in the same group corresponds to the same security policy, i.e., plurality Petition 870250090954, dated 06 / 10 / 2025, pp. 202 / 278 83 / 126 of EUs uses the same security policy when receiving and sending message no. A.

[265] S520: The transmitting UE sends a key request message no. A (i.e., a request message) to the KMF. Correspondingly, the KMF receives the key request message no. A from the transmitting UE.

[266] The request message includes the group identifier and a security capability of the transmitting UE, and the request message is used to request to obtain the security policy associated with the group identifier.

[267] S530: KMF checks whether the UE transmitter supports a group security algorithm.

[268] Security policy #A and the group security algorithm can be consistent. For example, when security policy #A indicates that security protection is not required, the group security algorithm is a null algorithm; when security policy #A indicates that security protection is required, the group security algorithm is a non-null algorithm, for example, a group encryption algorithm and a group integrity protection algorithm; or when the value of security policy #A is “preferred”, the group security algorithm is a null algorithm and a non-null algorithm.

[269] S540: KMF sends a key reply message no. A to the transmitting UE. Correspondingly, the transmitting UE receives the key reply message no. A from KMF.

[270] The key reply message #A includes the security policy associated with the group identifier, for example, security policy #A.

[271] S551: UE receiver performs service configuration and authorization. Petition 870250090954, dated 06 / 10 / 2025, pp. 203 / 278 84 / 126

[272] S552: The receiving UE sends a key request message no. B to the KMF. Correspondingly, the KMF receives the key request message no. B from the receiving UE. Additionally, the KMF sends a key reply message no. B to the receiving UE. Correspondingly, the receiving UE receives the key reply message no. B from the KMF.

[273] Based on steps S551 and S552, the receiving UE can establish a connection with a network element of the network management function, and obtain the group identifier, security policy no. A, KMF address, and the like from the network element of the network management function. Optionally, security policy no. A is associated with the group ID. In addition, when the receiving UE supports the group security algorithm, the receiving UE can also obtain one or more parameters, such as a group member identifier from the receiving UE, a group security algorithm identifier (e.g., a confidentiality algorithm ID and / or an integrity algorithm ID), a PGK, or a KMF PGK ID.

[274] S560: The transmitting UE derives a security key, for example, one or more of a PTK, a PIK, and a PEK, or another key used for confidentiality protection and / or integrity protection. This is not specifically limited in this application.

[275] For specific implementations of steps S510 to S560 and content or explanations of the messages exchanged, see the related descriptions in steps S210 to S260 of method 200. For brevity, the details will not be described again in the present invention.

[276] S570: The transmitting EU determines, in accordance with security policy No. A, whether to perform security protection on message No. A.

[277] Security policy no. A includes the security policy of Petition 870250090954, dated 06 / 10 / 2025, pp. 204 / 278 85 / 126 confidentiality no. A and / or integrity security policy no. A, and security protection includes confidentiality security protection and / or integrity security protection.

[278] For example, message No. A that is broadcast or multicast includes one or more of the following parameters such as the group identifier (e.g., the group ID), a transmitting UE group member ID (e.g., a transmitting UE ID), a PGK ID, a PTK ID, a counter (e.g., a first security parameter), a payload, and a MAC (e.g., a second security parameter). For ease of description, the PGK ID, PTK ID, and counter parameters related to confidentiality security protection may be collectively referred to as a confidentiality security protection indication, and the MAC parameter related to integrity security protection may be referred to as an integrity security protection indication. The details are not repeated in the related section below.It should be noted that the parameters included in the confidentiality security statement and the integrity security statement are merely examples provided to facilitate understanding of the solution and should not constitute any limitation to the technical solutions of this application. Another parameter related to confidentiality security protection and another parameter related to integrity security protection may also be included in the confidentiality security statement and the integrity security statement, and also fall within the scope of this application. This is not limited to this application.

[279] Optionally, for ease of understanding and description, an example where the first security parameter (or confidentiality security protection indication) is at least one of the PGK ID, the PTK ID, and the counter or confidentiality indication information, and the Petition 870250090954, dated 06 / 10 / 2025, pages 205 / 278 86 / 126 second security parameter (or integrity security protection indication) is the MAC address used below for description.

[280] Optionally, the PGK ID, the PTK ID, and the counter can be carried in a header (header) of a PDCP data packet from the transmitting UE.

[281] Optionally, message No. A may carry indication No. A information (i.e., confidentiality indication information) to indicate whether confidentiality security protection is enabled. For example, indication No. A information may be 1 bit. For example, when confidentiality security protection is enabled, a value of indication No. A information may be 1; or when confidentiality security protection is not enabled, a value of indication No. A information may be 0. For ease of description or understanding, indication No. A information may be used as part of the confidentiality security protection indication.

[282] Optionally, the indication information No. A may be carried in the header of the UE transmitter's PDCP data packet along with the PGK ID, the PTK ID, and the counter.

[283] In this implementation, indication information #A is added to message #A, so that the receiving UE can determine, based on indication information #A and the MAC value, whether the transmitting UE performs security protection on message #A. This avoids a case where, when confidentiality security protection is not enabled but integrity security protection is enabled, the integrity check security protection performed by the receiving UE on message #A fails because all PGK ID, PTK ID, and counter on message #A are set to 0. Petition 870250090954, dated 06 / 10 / 2025, pages 206 / 278 87 / 126

[284] In an implementation, when security policy no. A configured on the network side is mandatory or “non-mandatory”, the transmitting UE can determine, according to security policy no. A, whether to perform security protection on message no. A.

[285] For example, when security policy No. A is not mandatory, the transmitting UE does not perform confidentiality security protection and integrity security protection on message No. A. Correspondingly, all PGK ID, PTK ID, counter, and MAC in message No. A are set to 0. When security policy No. A is mandatory, the transmitting UE performs confidentiality security protection and integrity security protection on message No. A. Correspondingly, none of the PGK ID, PTK ID, counter, and MAC in message No. A is 0. For a specific implementation in which the transmitting UE performs security protection on message No. A, refer to the related descriptions in step S270 of method 200. For brevity, the details will not be described again in the present invention.

[286] Optionally, when message No. A does not carry indication information No. A, whether the values ​​of the PGK ID, PTK ID, and counter parameters that are associated with confidentiality security protection are 0 is determined by whether confidentiality security protection and integrity security protection are enabled. For specific implementation, see an example in Table 1. Correspondingly, the receiving UE can determine, according to the security policy No. A configured on the network side, whether the transmitting UE performs security protection on message No. A.

[287] Specifically, when confidentiality security protection is disabled, the PGK ID, PTK ID values ​​of Petition 870250090954, dated 06 / 10 / 2025, pages 207 / 278 88 / 126 associated parameters, and the counter are set to something other than 0, so that the receiving UE can determine, according to security policy #A configured on the network side, whether the transmitting UE performs security protection on message #A, and additionally determine whether decryption or integrity check security protection needs to be performed on message #A. This avoids a case where, in an existing solution, when confidentiality security protection is not enabled but integrity security protection is enabled, the integrity check security protection performed by the receiving UE on message #A fails because all PGK IDs, PTK IDs, and the counter on message #A are set to 0.

[288] Table 1 is an example of specific parameter values ​​that are carried in broadcast or multicast message No. A and that are obtained when the transmitting UE enables / disables confidentiality security protection and integrity security protection. It should be understood that Table 1 is merely an example provided for ease of understanding and may be subject to further changes. The content and manner of expression of message No. A are not limited in this modality of this application. Table 1 Confidentiality security protection Integrity security protection PGK ID PTK ID MAC counter Enabled Enabled Not equal to 0 Not equal to 0 Not equal to 0 Enabled Disabled Not equal to 0 Not equal to 0 0 Disabled Enabled Not equal to 0 Not equal to 0 Not equal to 0 Disabled Disabled 0 0 0 0

[289] As shown in Table 1, if the transmitting UE determines, in accordance with security policy No. A configured on the network side and policy Petition 870250090954, dated 06 / 10 / 2025, pages 208 / 278 If the transmitting UE determines, according to security policy #A configured on the network side and local policy #A, that integrity security protection is enabled, the MAC value is different from 0; or if the transmitting UE determines, according to security policy #A configured on the network side and local policy #A, that integrity security protection is not enabled, the MAC value is 0. If the transmitting UE determines, according to security policy #A configured on the network side and local policy #A, that confidentiality security protection is enabled, regardless of whether integrity security protection is enabled, the PGK ID, PTK ID, and counter values ​​are different from 0. If the transmitting UE determines, according to security policy #A configured on the network side and local policy #A, that both confidentiality security protection and integrity security protection are disabled, the PGK ID, PTK ID, and counter values ​​are 0.If the transmitting UE determines, according to security policy #A configured on the network side and local policy #A, that confidentiality security protection is disabled but integrity security protection is enabled, the transmitting UE sets the values ​​of the PGK ID, PTK ID, and counter to be different from 0. In other words, in this implementation, whether the values ​​of the PGK ID, PTK ID, and counter parameters associated with confidentiality security protection are 0 is determined by whether confidentiality security protection and integrity security protection are enabled.

[290] In another implementation, when security policy no. A configured on the network side is “preferred”, the transmitting UE can determine, according to security policy no. A and local policy no. A, whether to perform security protection on message no. A.

[291] Local policy no. A may indicate a trigger condition for the transmitting EU to perform security protection on message no. A. By Petition 870250090954, dated 06 / 10 / 2025, pages 209 / 278 90 / 126 For example, when a UE1 type is a roadside unit, the confidentiality security protection is not performed; or when a UE1 type is a vehicle, the confidentiality security protection is performed. Alternatively, when the UE1 is in an enclosed environment, the confidentiality security protection and / or integrity security protection are / are not performed; or when the UE1 is in an open or insecure environment, the confidentiality security protection and / or integrity security protection are / are performed. For another example, when the performance or a capability of the UE1 terminal is insufficient to support the activation of the security protection, the confidentiality security protection and / or integrity security protection are / are not performed.For another example, for a specific service scenario (session establishment, service registration request, or similar), UE 1 performs confidentiality security protection, integrity security protection, and / or similar functions. The above is merely an example provided to facilitate understanding of the solution and does not constitute any limitation on the technical solutions of this application.

[292] Optionally, local policy no. A can be preconfigured in step S410, or it can be received from the network side. For example, local policy no. A is received from the KMF or the network element of the network management function.

[293] For example, when security policy No. A configured on the network side is “preferred”, it indicates that the transmitting UE optionally performs security protection on message No. A. Therefore, additionally, the transmitting UE can determine, according to local policy No. A, whether it should perform security protection. For example, when the UE type in the group is the roadside unit, the broadcast message Petition 870250090954, dated 06 / 10 / 2025, pages 210 / 278 91 / 126 or multicast No. A does not have a confidentiality security protection requirement, and confidentiality security protection is not performed; or when the EU type in the group is the vehicle, the broadcast or multicast No. A message has a confidentiality security protection requirement, and confidentiality security protection is performed.

[294] In this embodiment of this request, whether the PGK ID, PTK ID, and counter values ​​in message #A are 0 is no longer completely linked to whether confidentiality security protection is enabled. In other words, when confidentiality security protection is not enabled (or disabled), indication information #A (i.e., confidentiality indication information) can be used for indication or determination. Correspondingly, the PGK ID, PTK ID, and counter values ​​can be 0 or can be different from 0. This is not specifically limited in this request. When confidentiality security protection is enabled, indication information #A can also be used for indication or determination. Correspondingly, the PGK ID, PTK ID, and counter values ​​are different from 0.Similarly, when integrity security protection is not enabled (or is disabled), indication information #B (i.e., integrity indication information) can be used for indication or determination. For example, a value of indication information #B is 0, and correspondingly, the MAC value is also 0. When integrity security protection is enabled, indication information #B can be used for indication or determination. For example, a value of indication information #B is 1, and correspondingly, the MAC value is different from 0.

[295] Table 2 is an example of specific parameter values ​​that Petition 870250090954, dated 06 / 10 / 2025, pp. 211 / 278 92 / 126 are carried in broadcast or multicast message No. A and are obtained when the transmitting UE enables / disables confidentiality security protection and integrity security protection. Each parameter of message No. A shown in Table 2 can be a specific parameter value or a previously agreed-upon encoded value between the transmitting UE and the receiving UE. It should be understood that Table 2 is merely an example provided for ease of understanding, and Table 2 may undergo further changes. The content and manner of expression of message No. A are not limited in this embodiment of this application. Table 2 Security protection of confidentiality Security protection of integrity PGK ID PTK ID Counter Indication information No. A Indication information No. B MAC Enabled Enabled Not equal to 0 Not equal to 0 Not equal to 0 1 1 Not equal to 0 Enabled Disabled Not equal to 0 Not equal to 0 Not equal to 0 1 0 0 Disabled Enabled Not equal to 0 Not equal to 0 Not equal to 0 0 1 Not equal to 0 Disabled Disabled 0 or not equal to 0 0 or not equal to 0 0 or not equal to 0 0 0 0

[296] As shown in Table 1, if the transmitting UE determines, according to security policy No. A configured on the network side and local policy No. A, that integrity security protection is enabled, the MAC value is different from 0; or if the transmitting UE determines, according to security policy No. A configured on the network side and local policy No. A, that integrity security protection is not enabled, the MAC value is 0. If the transmitting UE determines, according to security policy No. A configured on the network side and local policy No. A, that confidentiality security protection is enabled, the value of indication information No. A is 1, and the corresponding values ​​of the PGK ID, PTK ID, and counter are Petition 870250090954, dated 06 / 10 / 2025, pp. 212 / 278 93 / 126 different from 0; or if the transmitting EU determines, according to security policy #A configured on the network side and local policy #A, that confidentiality security protection is not enabled, the value of indication information #A is 0, and the values ​​of the PGK ID, PTK ID, and counter may be 0, or may be different from 0. This is not limited to this request. In other words, in this implementation, whether confidentiality security protection is enabled can be determined based on the value of indication information #A, and the values ​​of the PGK ID, PTK ID, and counter parameters that are associated with confidentiality security protection do not constitute a sole basis for determining whether confidentiality security protection is enabled.

[297] S580: The transmitting UE sends message no. A. Correspondingly, the receiving UE receives message no. A from the transmitting UE.

[298] For example, the transmitting UE sends message no. A by means of broadcast or multicast.

[299] S590: The receiving UE derives the security key, and determines, in accordance with security policy no. A, whether to perform security deprotection on message no. A.

[300] For a specific implementation where the receiving UE derives the security key (for example, one or more of the PTK, PIK, and PEK), see the related descriptions in step S290 of method 200. For brevity, the details will not be described again in the present invention.

[301] For example, security policy #A includes confidentiality security policy #A and integrity security policy #A. For example, the receiving UE looks up the corresponding security policy #A locally based on the group ID carried in the message. Petition 870250090954, dated 06 / 10 / 2025, pp. 213 / 278 94 / 126 received #A and key reply message #B received in steps S551 and S552. Optionally, when the receiving UE does not find security policy #A corresponding to the group ID, the receiving UE may optionally send a request message to the network side (e.g., a PKM) to obtain security policy #A corresponding to the group ID; or the receiving UE may alternatively choose to discard the received message #A. This is not specifically limited in this request.

[302] In one implementation, when the value of security policy #A configured on the network side is “mandatory”, the receiving UE determines to perform security override on message #A; or when the value of security policy #A configured on the network side is “not mandatory”, the receiving UE determines not to perform security override on message #A. In other words, in this implementation, the indication information #A carried in message #A (for example, for indication information #A, see Table 1) is ignored.

[303] For example, when the confidentiality security policy #A configured on the network side is “mandatory”, the receiving UE decrypts the ciphertext of the payload in message #A; or when the confidentiality security policy #A configured on the network side is “non-mandatory”, the receiving UE does not decrypt the payload in message #A. When the integrity security policy #A configured on the network side is “mandatory”, the receiving UE performs integrity check security protection on message #A, that is, it verifies whether the MAC obtained through calculation by the receiving UE is the same as the MAC carried in the received message #A; or when the integrity security policy #A configured on the network side is “non-mandatory”, the receiving UE does not perform integrity check security protection on the message. Petition 870250090954, dated 06 / 10 / 2025, pp. 214 / 278 95 / 126 No. A.

[304] In another implementation, the receiving EU determines, in accordance with security policy no. A and the confidentiality security protection indication and the integrity security protection indication that are carried in message no. A, whether to perform security unprotection on message no. A.

[305] For example, the receiving UE can verify whether the confidentiality security protection indication (e.g., PGK ID, PTK ID, counter, and indication information #A) and the integrity security protection indication (e.g., MAC) carried in message #A match the security policy #A configured on the network side. To be specific, the receiving UE verifies whether the confidentiality security protection indication indicated by the PGK ID, PTK ID, and counter values ​​carried in message #A matches the confidentiality security protection indication indicated by the configured confidentiality security policy #A, and the receiving UE verifies whether the integrity security protection indication indicated by the MAC value carried in message #A matches the integrity security protection indication indicated by the configured integrity security policy #A.

[306] For example, when integrity security policy #A configured on the network side indicates that integrity security protection is required (e.g., the value is 1), it indicates that the transmitting UE performs integrity security protection on message #A. If the MAC value carried in message #A is different from 0, this indicates that the integrity security protection indication (e.g., the MAC) carried in message #A corresponds to integrity security policy #A. Petition 870250090954, dated 06 / 10 / 2025, pages 215 / 278 96 / 126 configured on the network side. On the other hand, if the MAC value carried in message #A is 0, this indicates that the integrity security protection indication carried in message #A does not match the integrity security policy #A configured on the network side.

[307] For example, when integrity security policy #A configured on the network side indicates that integrity security protection is not required (e.g., the value is 0), it indicates that the transmitting UE does not perform integrity security protection on message #A. If the MAC value carried in message #A is 0, this indicates that the integrity security protection indication (e.g., the MAC) carried in message #A matches the integrity security policy #A configured on the network side. Conversely, if the MAC value carried in message #A is different from 0, this indicates that the integrity security protection indication carried in message #A does not match the integrity security policy #A configured on the network side.Alternatively, in this case, the receiving UE may not consider the MAC value, but determine, according to integrity security policy #A, whether to perform security unprotection on message #A.

[308] For example, when the confidentiality security policy No. A configured on the network side indicates that confidentiality security protection is required (e.g., the value is 1), it indicates that the transmitting UE performs confidentiality security protection on message No. A. If none of the PGK ID, PTK ID, and counter values ​​carried in message No. A are 0, and / or the value of the indication information No. A carried in message No. A is 1, it indicates that the confidentiality security protection indication (e.g., the PGK ID, the PTK ID, and the counter) carried in message No. A corresponds to Petition 870250090954, dated 06 / 10 / 2025, pp. 216 / 278 97 / 126 confidentiality security policy #A configured on the network side. On the other hand, if all the PGK ID, PTK ID, and counter values ​​carried in message #A are 0, and / or the value of the indication information #A carried in message #A is 0, this indicates that the confidentiality security protection indication carried in message #A does not match the confidentiality security policy #A configured on the network side.

[309] For example, when the confidentiality security policy No. A configured on the network side indicates that confidentiality security protection is not required (e.g., the value is 0), it indicates that the transmitting UE does not perform confidentiality security protection on message No. A. If all the PGK ID, PTK ID, and counter values ​​carried in message No. A are 0, and / or the value of the indication information No. A carried in message No. A is 0, this indicates that the confidentiality security protection indication (e.g., the PGK ID, PTK ID, and counter) carried in message No. A matches the confidentiality security policy No. A configured on the network side.On the other hand, if none of the PGK ID, PTK ID, and counter values ​​carried in message #A are 0, and / or the value of the indication information #A carried in message #A is 1, it indicates that the confidentiality security protection indication carried in message #A does not match the confidentiality security policy #A configured on the network side. Alternatively, in this case, the receiving UE may not consider the value of the confidentiality security protection indication, but determine, according to confidentiality security policy #A, whether to perform security protection on message #A.

[310] For example, when security policy no. A is configured in Petition 870250090954, dated 06 / 10 / 2025, pp. 217 / 278 98 / 126 on the network side indicates that security protection is optionally performed (e.g., the value is “preferred”), indicating that the transmitting UE optionally performs security protection on message #A. In this case, regardless of the values ​​of the confidentiality security protection indication (e.g., PGK ID, PTK ID, and counter) and the integrity security protection indication (e.g., MAC) that are carried in message #A, the receiving UE can consider that the confidentiality security protection indication and the integrity security protection indication that are carried in message #A correspond to security policy #A configured on the network side.

[311] The receiving UE can determine whether to perform security protection on message No. A by determining whether the confidentiality security protection indication and the integrity security protection indication that are carried on message No. A correspond to the security policy No. A configured on the network side.

[312] For example, if the confidentiality security protection indication and the integrity security protection indication carried in message No. A do not match the security policy No. A configured on the network side, the receiving UE may discard message No. A. If the confidentiality security protection indication and the integrity security protection indication carried in message No. A match the security policy No. A configured on the network side, the receiving UE may determine, based on the security policy No. A configured on the network side and the confidentiality security protection indication and the integrity security protection indication carried in message No. A, whether to perform deprotection of Petition 870250090954, dated 06 / 10 / 2025, pages 218 / 278 99 / 126 security in message no. A.

[313] For example, when the confidentiality security policy value No. A is mandatory, and the confidentiality security protection indication carried in message No. A, for example, all PGK ID values, PTK ID, and counter are different from 0 and / or the value of indication information No. A is 1, the receiving UE determines to decrypt the payload in message No. A. When the confidentiality security policy value No. A is not mandatory, and the confidentiality security protection indication carried in message No. A, for example, all PGK ID values, PTK ID, and counter are 0 and / or the value of indication information No. A is 0, the receiving UE determines not to decrypt the payload in message No. A.When the confidentiality security policy value #A is "preferred", and the confidentiality security protection indication carried in message #A, for example, the value of indication information #A is 1, the receiving UE determines to decrypt the payload in message #A. When the integrity security policy value #A is "mandatory", and the integrity security protection indication carried in message #A, for example, all MAC values ​​are different from 0, the receiving UE determines to perform integrity verification on the payload in message #A. When the integrity security policy value #A is "not mandatory", and the integrity security protection indication carried in message #A, for example, all MAC values ​​are different from 0, the receiving UE determines to perform integrity verification on the payload in message #A.When the integrity security policy value #A is "preferred", and the integrity security protection indication carried in message #A, for example, all MAC values ​​are 0, the receiving UE determines no. Petition 870250090954, dated 06 / 10 / 2025, pp. 219 / 278 100 / 126 perform integrity verification on the payload in message No. A. For specific implementations of decryption and security protection of integrity verification, refer to the related descriptions in step S290 of method 200. For brevity, the details will not be described again in the present invention.

[314] According to the method disclosed in this application, the receiving UE determines, based on the security policy configured on the network side rather than solely on the value of the parameter carried in message no. A, whether security protection needs to be performed on message no. A. This prevents an attacker from tampering with message no. A. The values ​​of different parameters in message no. A are set. This avoids a case where integrity check security protection fails in a scenario where the security policy indicates that confidentiality security protection is not required but integrity security protection is required. The value of the security policy is added so that whether security protection of message no. A is enabled is more flexible.

[315] Figure 6 is a schematic flowchart of a 600 communication method according to an embodiment of this application, and the method is for one-to-many communication security (a broadcast or multicast scenario). Compared to the 500 method, in the 600 method, whether integrity security protection should be performed on a message #A is determined by an integrity security policy #A configured on one side of the network, and whether confidentiality security protection should be performed on message #A is determined by the transmitting UE according to both a confidentiality security policy #A configured on the network side and a local policy #A. As shown in Figure 6, the method includes the following plurality of steps. For Petition 870250090954, dated 06 / 10 / 2025, pp. 220 / 278 101 / 126 If a part is not described in detail, refer to method 200, method 500, or an existing protocol.

[316] S610: UE transmitter configures subscription information, and the UE transmitter initiates a service authorization procedure.

[317] For example, the transmitting UE obtains a parameter n° A required for one-to-many communication, where parameter n° A includes one or more of a group identifier, a security policy n° A, and a KMF address. Security policy n° A mainly includes a confidentiality security policy n° A and an integrity security policy n° A, and indicates whether security protection is required at a transport layer. For example, a confidentiality security policy n° A value can include “mandatory”, “not mandatory”, or “preferred”, and an integrity security policy n° A value can include “mandatory” or “not mandatory”. In other words, when the confidentiality security policy n° A value is “preferred”, the transmitting UE optionally performs confidentiality security protection on a message to be sent n° A.In other words, the transmitting UE may implement confidentiality security protection on message No. A, or it may not implement confidentiality security protection on message No. A, to meet the flexibility requirements of different transmitting UEs.

[318] S620: The transmitting UE sends a key request message no. A to the KMF. Correspondingly, the KMF receives the key request message no. A from the transmitting UE.

[319] S630: KMF checks whether the UE transmitter supports a group security algorithm.

[320] S640: KMF sends a key reply message #A to Petition 870250090954, dated 06 / 10 / 2025, pages 221 / 278 102 / 126 the UE transmitter. Correspondingly, the UE transmitter receives the key response message No. A from KMF.

[321] S651: UE receiver performs service configuration and authorization.

[322] S652: The receiving UE sends a key request message #B to the KMF. Correspondingly, the KMF receives the key request message #B from the receiving UE. Additionally, the KMF sends a key reply message #B to the receiving UE. Correspondingly, the receiving UE receives the key reply message #B from the KMF.

[323] S660: The transmitting EU derives a security key, for example, one or more of a PTK, a PIK, and a PEK, or another key used for confidentiality protection and / or integrity protection. This is not specifically limited in this application.

[324] For specific implementations of steps S610 to S660 and content or explanations of the messages exchanged, refer to the related descriptions in steps S510 to S560 of method 600. For brevity, the details will not be described again in the present invention. One difference lies in the fact that, in method 700, the value of the confidentiality security policy no. A may include “mandatory”, “not mandatory”, or “preferred”, and the value of the integrity security policy no. A may include “mandatory” or “not mandatory”.

[325] S670: The transmitting EU determines, in accordance with confidentiality security policy No. A, whether to perform confidentiality security protection on message No. A.

[326] In an implementation, when the confidentiality security policy No. A configured on the network side is “mandatory” or “non-mandatory”, the transmitting UE may determine, in accordance with the policy of Petition 870250090954, dated 06 / 10 / 2025, pp. 222 / 278 103 / 126 confidentiality security no. A, message no. A must be encrypted.

[327] For example, when confidentiality security policy No. A is “non-mandatory”, the transmitting UE does not perform confidentiality security protection on message No. A. Correspondingly, a PGK ID, a PTK ID, a counter, or confidentiality indication information on message No. A is all set to 0. When confidentiality security policy No. A is “mandatory”, the transmitting UE performs confidentiality security protection on message No. A. Correspondingly, none of a PGK ID, a PTK ID, and a counter on message No. A is 0, and confidentiality indication information is set to 1. For a specific implementation in which the transmitting UE performs confidentiality security protection on message No. A, refer to the related descriptions in step S270 of method 200. For brevity, the details will not be described again in the present invention.

[328] In this embodiment of this request, if the PGK ID, PTK ID, and counter values ​​in message #A are 0, they are no longer fully linked to whether confidentiality security protection is enabled. In other words, when confidentiality security protection is not enabled (or disabled), the confidentiality indication information can be used for indication or determination. Correspondingly, the PGK ID, PTK ID, and counter values ​​can be 0 or can be different from 0. This is not specifically limited in this request. When confidentiality security protection is enabled, the confidentiality indication information can also be used for indication or determination. Correspondingly, the PGK ID, PTK ID, and counter values ​​can be different from 0.

[329] In another implementation, the transmitting UE determines, of Petition 870250090954, dated 06 / 10 / 2025, pp. 223 / 278 104 / 126 In accordance with confidentiality security policy No. A and local policy No. A, confidentiality security protection must be performed on message No. A.

[330] Local policy no. A may indicate a trigger condition for the transmitting UE to perform security protection on message no. A. For a specific example, see the related descriptions of method 600. Details are not described in the present invention again. Optionally, local policy no. A may be pre-configured in step S610, or it may be received from the network side. For example, local policy no. A is received from the KMF or a network element of the network management function.

[331] For example, when the confidentiality security policy No. A configured on the network side is “preferred”, it indicates that the transmitting UE optionally performs confidentiality security protection on message No. A. Additionally, the transmitting UE can determine, according to local policy No. A, whether to perform confidentiality security protection. For example, when a UE type in the group is a roadside unit, broadcast or multicast message No. A has no confidentiality security protection requirement, and confidentiality security protection is not performed; or when a UE type in the group is a vehicle, broadcast or multicast message No. A has a confidentiality security protection requirement, and confidentiality security protection is performed.

[332] Based on the two previous implementations, the transmitting EU can determine, in accordance with confidentiality security policy No. A and local policy No. A, whether to perform confidentiality security protection on message No. A. Additionally, the transmitting EU can determine, in accordance with integrity security policy No. A Petition 870250090954, dated 06 / 10 / 2025, pp. 224 / 278 If 105 / 126 is configured on the network side, integrity security protection must be performed on message #A. The value of integrity security policy #A is "mandatory" or "not mandatory".

[333] For example, when integrity security policy No. A configured on the network side is “mandatory” or “non-mandatory”, the transmitting UE can determine, according to integrity security policy No. A, whether to perform integrity security protection on message No. A. For example, when integrity security policy No. A is “non-mandatory”, the transmitting UE does not perform integrity security protection on message No. A. Correspondingly, a MAC value in message No. A is different from 0. When integrity security policy No. A is “mandatory”, the transmitting UE performs integrity security protection on message No. A. Correspondingly, all MAC values ​​in message No. A are 0, or the message to be sent No. A does not carry a MAC part.For a specific implementation where the UE transmitter performs security protection on message No. A, refer to the related descriptions in step S570 of method 600. For brevity, the details will not be described again in the present invention.

[334] S680: The transmitting EU sends message no. A. Correspondingly, the receiving UE receives message number A from the transmitting UE.

[335] For example, the transmitting UE sends message no. A by means of broadcast or multicast.

[336] S691: The receiving UE derives the security key and determines, in accordance with integrity security policy No. A, whether to perform integrity protection verification on message No. A.

[337] For a specific implementation where the receiving UE derives the Petition 870250090954, dated 06 / 10 / 2025, pages 225 / 278 106 / 126 security key (e.g., PTK, PIK, or PEK), see related descriptions in step S590 of method 600. For brevity, details will not be described again in the present invention.

[338] For example, the receiving UE locally searches for the corresponding security policy #A based on the group ID carried in received message #A and the key reply message #B received in steps S651 and S652. Optionally, when the receiving UE does not find the security policy #A corresponding to the group ID, the receiving UE may optionally send a request message to the network side (e.g., a PKM) to obtain the security policy #A corresponding to the group ID; or the receiving UE may alternatively choose to discard received message #A. This is not specifically limited in this request.

[339] For example, when integrity security policy No. A configured on the network side is “mandatory,” the receiving UE performs integrity protection verification on message No. A, i.e., it verifies that the MAC is correct. For specific implementations of decryption and integrity verification security protection, see the related descriptions in step S290 of method 200. For brevity, the details will not be described again in the present invention. When integrity security policy No. A configured on the network side is “non-mandatory,” the receiving UE does not perform integrity protection verification on message No. A.

[340] S692: When the integrity protection check is successful, the receiving EU determines, in accordance with confidentiality security policy No. A, whether to decrypt message No. A.

[341] In one implementation, when the confidentiality security policy No. A configured on the network side is “mandatory”, the UE Petition 870250090954, dated 06 / 10 / 2025, pages 226 / 278 107 / 126 receiver decrypts the ciphertext of a payload in message #A; when the confidentiality security policy value #A configured on the network side is “not mandatory”, the receiving UE does not decrypt the ciphertext of a payload in message #A; or when the confidentiality security policy value #A configured on the network side is “preferred”, the receiving UE optionally decrypts the ciphertext of a payload in message #A.

[342] In another implementation, the receiving EU determines, in accordance with confidentiality security policy no. A and a confidentiality security protection indication carried in message no. A, whether to decrypt message no. A.

[343] Specifically, the receiving UE can first determine whether the confidentiality security protection indication (e.g., PGK ID, PTK ID, counter, and confidentiality indication information) carried in message No. A corresponds to the confidentiality security policy No. A configured on the network side. To be specific, the receiving UE verifies whether the confidentiality security protection indication indicated by the PGK ID, PTK ID, and counter values ​​or the confidentiality indication information value carried in message No. A corresponds to the confidentiality security protection indication indicated by the configured confidentiality security policy No. A. For a specific implementation to determine whether the two cases described correspond, refer to the related descriptions in step S590 of method 600. For brevity, the details will not be described again in the present invention.

[344] Additionally, if the two indicated cases match, the receiving UE determines, based on the PTK ID, PGK ID, and values Petition 870250090954, dated 06 / 10 / 2025, pp. 227 / 278 108 / 126 counter or the value of the confidentiality indication information carried in message no. A, the payload field in message no. A must be decrypted.

[345] For example, when the confidentiality security protection indication carried in message no. A includes the PTK ID, the PGK ID, and the counter, but does not include the confidentiality indication information, if all the values ​​of the PTK ID, the PGK ID, and the counter are 0, this indicates that the transmitting UE performs confidentiality security protection on message no. A, and the receiving UE does not decrypt the ciphertext of the payload in message no. A. On the other hand, if none of the values ​​of the PTK ID, the PGK ID, and the counter is 0, the receiving UE can decrypt the ciphertext of the payload in message no. A.

[346] For example, when the confidentiality security protection indication carried in message No. A includes the PTK ID, the PGK ID, the counter, and the confidentiality indication information, regardless of whether the PTK ID, PGK ID, and counter values ​​are 0, the receiving UE can determine, based on the confidentiality indication information, whether to decrypt the payload ciphertext in message No. A. If the confidentiality indication information value is 0, the receiving UE cannot decrypt the payload ciphertext in message No. A. On the other hand, if the confidentiality indication information value is 1, the receiving UE can decrypt the payload ciphertext in message No. A.

[347] According to the method disclosed in this request, the transmitting EU determines, in accordance with confidentiality security policy No. A and local policy No. A, whether to enable confidentiality security protection, so that a confidentiality security mechanism is more Petition 870250090954, dated 06 / 10 / 2025, pages 228 / 278 109 / 126 flexible and the overloads on one transmitting end and one receiving end are reduced.

[348] Figure 7 is a schematic flowchart of a 700 communication method according to an embodiment of this application, and the method is for one-to-many communication security (a broadcast or multicast scenario). Compared to the 600 method, in the 700 method, whether confidentiality security protection should be performed on a message is determined by a confidentiality security policy configured on one side of the network, and whether integrity security protection should be performed on message is determined by the transmitting UE according to both an integrity security policy configured on the network side and a local policy. As shown in Figure 7, the method includes the following plurality of steps. For a part that is not described in detail, refer to method 200 to method 600 or an existing protocol.

[349] S710: UE transmitter configures subscription information, and the UE transmitter initiates a service authorization procedure.

[350] For example, the transmitting UE obtains a parameter n° α required for one-to-many communication, where parameter n° α includes one or more group identifiers, a security policy n° α, and a KMF address. Security policy n° α mainly includes a confidentiality security policy n° α and an integrity security policy n° α, and indicates whether security protection is required at a transport layer. For example, a confidentiality security policy n° α value can include “mandatory” or “not mandatory”, and an integrity security policy n° α value can include “mandatory”, “not mandatory”, or “preferred”. In other words, when the value of Petition 870250090954, dated 06 / 10 / 2025, pp. 229 / 278 110 / 126 integrity security policy no. α is “preferred”, the transmitting UE optionally performs integrity security protection on a message to be sent no. α. In other words, the transmitting UE may perform integrity security protection on message no. α, or may not perform integrity security protection on message no. α, to meet the flexibility requirements of different transmitting UEs.

[351] S720: The transmitting UE sends a key request message no. α to the KMF. Correspondingly, the KMF receives the key request message no. α from the transmitting UE.

[352] S730: KMF checks whether the UE transmitter supports a group security algorithm.

[353] S740: The KMF sends a key reply message no. α to the transmitting UE. Correspondingly, the transmitting UE receives the key reply message no. α from the KMF.

[354] S751: UE receiver performs service configuration and authorization.

[355] S752: The receiving UE sends a key request message no. β to the KMF. Correspondingly, the KMF receives the key request message no. β from the receiving UE. Additionally, the KMF sends a key reply message no. β to the receiving UE. Correspondingly, the receiving UE receives the key reply message no. β from the KMF.

[356] S760: The transmitting UE derives a security key, for example, one or more of a PTK, a PIK, and a PEK, or another key used for confidentiality protection and / or integrity protection. This is not specifically limited in this application.

[357] For specific implementations of steps S710 to S760 and content or explanations of the messages exchanged, see the descriptions. Petition 870250090954, dated 06 / 10 / 2025, pp. 230 / 278 111 / 126 related in steps S610 to S660 of method 600. For brevity, the details will not be described again in the present invention. One difference lies in the fact that, in method 700, the integrity security policy value no. α can include “mandatory”, “non-mandatory”, or “preferred”, and the confidentiality security policy value no. α can include “mandatory” or “non-mandatory”.

[358] S770: The transmitting EU determines, in accordance with integrity security policy no. α, whether to perform integrity security protection on message no. α.

[359] In an implementation, when the integrity security policy no. α configured on the network side is “mandatory” or “non-mandatory”, the transmitting UE can determine, according to the integrity security policy no. α, whether to verify the integrity of message no. α.

[360] For example, when integrity security policy no. α is “non-mandatory”, the transmitting UE does not perform integrity security protection on message no. α. Correspondingly, all values ​​of a MAC in message no. α are set to 0. When integrity security policy no. α is “mandatory”, the transmitting UE performs integrity security protection on message no. α. Correspondingly, a value of a MAC in message no. α is different from 0. For a specific implementation in which the transmitting UE performs integrity security protection on message no. α, refer to the related descriptions in step S270 of method 200. For brevity, the details will not be described again in the present invention.

[361] In another implementation, the transmitting UE determines, in accordance with integrity security policy no. α and a local policy no. α, Petition 870250090954, dated 06 / 10 / 2025, pp. 231 / 278 112 / 126 if integrity security protection must be performed on message no. α.

[362] Local policy no. α may indicate a trigger condition for the transmitting UE to perform security protection on message no. α. For a specific example, see the related descriptions of method 500. The details are not described in the present invention again. Optionally, local policy no. α may be pre-configured in step S710, or it may be received from the network side. For example, local policy no. α is received from the KMF or a network element of the network management function.

[363] For example, when integrity security policy no. α configured on the network side is “preferred”, it indicates that the transmitting UE optionally performs integrity security protection on message no. α. Additionally, the transmitting UE can determine, according to local policy no. α, whether to perform integrity security protection. For example, when a UE type in the group is a roadside unit, broadcast or multicast message no. α has no integrity security protection requirement, and integrity security protection is not performed; or when a UE type in the group is a vehicle, broadcast or multicast message no. α has an integrity security protection requirement, and integrity security protection is performed.

[364] Based on the two previous implementations, the transmitting UE can determine, according to integrity security policy no. α and local policy no. α, whether to perform integrity security protection on message no. α.

[365] In addition, the transmitting EU can determine, in accordance with the confidentiality security policy no. α configured on the network side, whether to perform confidentiality security protection on the message. Petition 870250090954, dated 06 / 10 / 2025, pp. 232 / 278 113 / 126 No. α. The value of the confidentiality security policy No. α is "mandatory" or "non-mandatory". For example, when the confidentiality security policy No. α configured on the network side is "mandatory" or "non-mandatory", the transmitting UE can determine, according to the confidentiality security policy No. α, whether to perform confidentiality security protection on message No. α. For example, when the confidentiality security policy No. α is "non-mandatory", the transmitting UE does not perform confidentiality security protection on message No. α. Correspondingly, the MAC value on message No. α is different from 0. When the confidentiality security policy No. α is "mandatory", the transmitting UE performs confidentiality security protection on message No. α. Correspondingly, all MAC values ​​on message No. α are 0.For a specific implementation where the UE transmitter performs security protection on message no. α, refer to the related descriptions in step S570 of method 500. For brevity, the details will not be described again in the present invention.

[366] S780: The UE transmitter sends message no. α. Correspondingly, the receiving UE receives message number α from the transmitting UE.

[367] For example, the transmitting UE sends message no. α by means of broadcast or multicast.

[368] S790: The receiving UE derives the security key and determines, according to security policy no. α, whether to perform security deprotection on message no. α.

[369] For specific implementations of decryption and integrity security protection verification included in security unprotection, see the related descriptions in step S290 of method 200. For Petition 870250090954, dated 06 / 10 / 2025, pp. 233 / 278 114 / 126 For brevity, the details will not be described again in the present invention. For a specific implementation in which the receiving UE derives the security key (e.g., PTK, PIK, or PEK), refer to the related descriptions in step S590 of method 500. For brevity, the details will not be described again in the present invention.

[370] For example, the receiving UE locally searches for the corresponding security policy no. α based on the group ID carried in the received message no. α and the key reply message no. β received in steps S751 and S752. Optionally, when the receiving UE does not find the security policy no. α corresponding to the group ID, the receiving UE may send a network-side request message (e.g., a PKM) to obtain the security policy no. α corresponding to the group ID; or the receiving UE may alternatively choose to discard the received message no. α. This is not specifically limited in this request.

[371] For example, when the confidentiality security policy no. α configured on the network side is “mandatory”, the receiving UE will decrypt the ciphertext of a payload in message no. α. When the value of the confidentiality security policy no. α configured on the network side is “not mandatory”, the receiving UE will not decrypt the ciphertext of a payload in message no. α.

[372] For example, when the confidentiality security policy no. α configured on the network side is “not required”, if all values ​​of a PTK ID, a PGK ID, and a counter that are carried in message no. α are 0, or a confidentiality indication information value carried in message no. α is 0, the receiving UE does not decrypt the ciphertext of the payload in message no. α; or if a confidentiality indication information value carried in message no. α is 1, the UE Petition 870250090954, dated 06 / 10 / 2025, pp. 234 / 278 115 / 126 The receiver may discard message #α or consider that the ciphertext of the payload in message #α was not decrypted.

[373] For example, when the confidentiality security policy no. α configured on the network side is “mandatory”, if a confidentiality security protection indication transmitted in message no. α includes the PTK ID, the PGK ID, the counter, and the confidentiality indication information, regardless of whether the PTK ID, PGK ID, and counter values ​​are 0, the receiving UE can determine, based on the confidentiality indication information, whether to decrypt the ciphertext of the payload in message no. α.

[374] For example, when integrity security policy no. α configured on the network side is “mandatory”, the receiving UE performs an integrity protection check on message no. α, that is, it checks if the MAC is correct. When integrity security policy no. α configured on the network side is “non-mandatory”, the receiving UE does not perform an integrity protection check on message no. α. When integrity security policy no. α configured on the network side is “preferred”, the receiving UE optionally performs the integrity protection check on message no. α. For example, the receiving UE determines, based on the value of the MAC transmitted in message no. α, whether to perform the integrity protection check.

[375] Specifically, the receiving UE can first determine whether an integrity security protection value (e.g., PGK ID, PTK ID, counter, and confidentiality indication information) carried in message no. α matches the integrity security policy no. α configured on the network side. To be more specific, the receiving UE checks whether the MAC value carried in message no. α is the same Petition 870250090954, dated 06 / 10 / 2025, pages 235 / 278 116 / 126 that the MAC value obtained by calculation using a configured integrity algorithm. If the MAC values ​​are equal, the integrity check is successful. If the MAC values ​​are different, the integrity check fails. For a specific implementation to determine whether the integrity security protection indication corresponds to integrity security policy no. α, refer to the related descriptions in step S590 of method 500. For brevity, the details will not be described again in the present invention.

[376] According to the method disclosed in this application, the receiving UE determines, based on the security policy configured on the network side, rather than solely on the value of the parameter carried in message no. A, whether security protection needs to be performed on message no. A. This prevents an attacker from tampering with message no. A. The values ​​of the different parameters in message no. A are defined. This avoids a case where the integrity security protection check fails in a scenario where the security policy indicates that confidentiality security protection is not required, but integrity security protection is required. The security policy value is added, so that enabling security protection for message no. A is more flexible.

[377] As described above in detail in the embodiments on one side of the communication method of this application with reference to Figure 1 to Figure 7. The following describes in detail embodiments on one side of the communication apparatus of this application with reference to Figure 8 and Figure 9. It should be understood that the descriptions of the apparatus embodiments correspond to the descriptions of the method embodiments. Therefore, for a part that is not described in detail, refer to the previous method embodiments.

[378] Figure 8 is a block diagram of a communication device. Petition 870250090954, dated 06 / 10 / 2025, pp. 236 / 278 117 / 126 1000 according to an embodiment of this application. As shown in Figure 8, device 1000 may include a transceiver unit 1010 and a processing unit 1020. The transceiver unit 1010 may communicate with the outside, and the processing unit 1020 is configured to process data. The transceiver unit 1010 may also be referred to as a communication interface or transceiver unit.

[379] In a possible project, device 1000 can implement the steps or procedures performed by the first communication device in the previous method modes. Processing unit 1020 is configured to perform the operations related to processing the first communication device in the previous method modes. Transceiver unit 1010 is configured to perform the operations related to sending / receiving the first communication device in the previous method modes.

[380] In another possible design, device 1000 can implement the steps or procedures performed by the second communication device in the previous method modalities. Processing unit 1020 is configured to perform processing-related operations performed by the second communication device in the previous method modalities. Transceiver unit 1010 is configured to perform sending / receiving-related operations performed by the second communication device in the previous method modalities.

[381] It should be understood that the device 1000 in the present invention is implemented in the form of a functional unit. The term “unit” in the present invention may refer to an application-specific integrated circuit (ASIC), an electronic circuit, a processor (e.g., a shared processor, a processor Petition 870250090954, dated 06 / 10 / 2025, pp. 237 / 278 A dedicated 118 / 126 or a group processor) configured to execute one or more software or firmware programs, a memory, a merged logic circuit, and / or another suitable component that supports the described function. In an optional example, a person skilled in the art may understand that device 1000 may specifically be the transmitting end in the prior embodiments and may be configured to perform the procedures and / or steps corresponding to the transmitting end in the prior method embodiments; or device 1000 may specifically be the receiving end in the prior embodiments and may be configured to perform the procedures and / or steps corresponding to the receiving end in the prior method embodiments. To avoid repetition, details are not described again in the present invention.

[382] Device 1000 in the previous solutions has the function of implementing the corresponding steps performed by the transmitting end in the previous methods. Alternatively, device 1000 in the previous solutions has the function of implementing the corresponding steps performed by the receiving end in the previous methods. The function can be implemented by hardware or it can be implemented by executing the corresponding software by hardware. The hardware or software includes one or more modules corresponding to the previous functions. For example, the transceiver unit can be replaced by a transceiver (for example, a transmitting unit in the transceiver unit can be replaced by a transmitter, and a receiving unit in the transceiver unit can be replaced by a receiver).Another unit, for example, a processing unit, can be replaced by a processor to separately perform the sending and receiving operations and a related processing operation in each mode of the method. Petition 870250090954, dated 06 / 10 / 2025, pages 238 / 278 119 / 126

[383] Furthermore, the transceiver unit may alternatively be a transceiver circuit (for example, it may include a receiver circuit and a transmitter circuit), and the processing unit may be a processing circuit. In embodiments of this application, the apparatus in Figure 8 may be the receiving end or the transmitting end in the preceding embodiments, or it may be a chip or a system of chips, for example, a system on a chip (SoC). The transceiver unit may be an input / output circuit or a communication interface. The processing unit is a processor, a microprocessor, or an integrated circuit integrated into the chip. This is not limited to the present invention.

[384] Figure 9 is a block diagram of a communication device 2000 according to an embodiment of this application. As shown in Figure 9, the device 2000 includes a processor 2010 and a transceiver 2020. The processor 2010 and the transceiver 2020 communicate with each other via an internal connection path. The processor 2010 is configured to execute instructions, to control the transceiver 2020 to send a signal and / or receive a signal.

[385] Optionally, the 2000 device may additionally include a 2030 memory. The 2030 memory communicates with the 2010 processor and the 2020 transceiver via the internal connection path. The 2030 memory is configured to store instructions, and the 2010 processor can execute the instructions stored in the 2030 memory.

[386] In one possible implementation, device 2000 is configured to implement the procedures and steps corresponding to the first communication device in the previous method modes.

[387] In another possible implementation, device 2000 is configured to implement the procedures and steps corresponding to Petition 870250090954, dated 06 / 10 / 2025, pp. 239 / 278 120 / 126 second communication device in the previous method modalities.

[388] It should be understood that device 2000 may specifically be the transmitting end or the receiving end in the previous embodiments, or it may be a chip or a system of chips. Correspondingly, transceiver 2020 may be a chip transceiver circuit. This is not limited in the present invention. Specifically, device 2000 may be configured to perform the steps and / or procedures corresponding to the transmitting end or the receiving end in the previous method embodiments.

[389] Optionally, the 2030 memory may include read-only memory and random-access memory, and provide instructions and data to the processor. A portion of the memory may additionally include non-volatile random-access memory. For example, the memory may additionally store information about a device type. The 2010 processor may be configured to execute the instructions stored in memory. When the 2010 processor executes the instructions stored in memory, the 2010 processor is configured to perform steps and / or procedures in the modes of the previous method, corresponding to the transmit end or the receive end.

[390] In an implementation process, the steps of the previous methods can be implemented using a hardware integrated logic circuit in the processor or using instructions in software. The steps of the method disclosed with reference to the embodiments of this application can be performed directly by a hardware processor or can be performed by a combination of hardware in the processor and a software module. The software module can be located in a storage medium mature in the art, for example, an access memory. Petition 870250090954, dated 06 / 10 / 2025, pp. 240 / 278 121 / 126 random, a flash memory, a read-only memory, a programmable read-only memory, an electrically erasable programmable memory, or a register. The storage medium is located in the memory, and the processor reads the information from the memory and completes the steps of the previous methods in combination with the processor hardware. To avoid repetition, the details are not described again in the present invention.

[391] It should be noted that the processor, in embodiments of this application, may be an integrated circuit chip and possess signal processing capability. In an implementation process, the steps in the preceding method embodiments may be implemented using a hardware integrated logic circuit in the processor or using instructions in software form. The processor may be a general-purpose processor, a digital signal processor, an application-specific integrated circuit, a field-programmable gate array or other programmable logic device, a discrete gate logic device or transistor, or a discrete hardware component. The processor, in embodiments of this application, may implement or perform the methods, steps, and logic block diagrams disclosed in embodiments of this application. The general-purpose processor may be a microprocessor, or the processor may be any conventional or similar processor.The steps of the methods disclosed with reference to the embodiments of this application can be performed and completed directly by a hardware decoding processor, or they can be performed and completed using 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, for example, a random access memory, a flash memory, a read-only memory, a programmable read-only memory, a programmable memory. Petition 870250090954, dated 06 / 10 / 2025, pp. 241 / 278 122 / 126 electrically erasable or a register. The storage medium is located in memory, and the processor reads the information from memory and completes the steps of the previous methods in combination with the processor hardware.

[392] It can be understood that the memory in this embodiment of this application can be volatile memory or non-volatile memory, or it can include both volatile and non-volatile memory. Non-volatile memory can be read-only memory (read-only memory, ROM), programmable read-only memory (programmable ROM, PROM), erasable programmable read-only memory (erasable PROM, EPROM), electrically erasable programmable read-only memory (electrically EPROM, EEPROM), or flash memory. Volatile memory can be random access memory (random access memory, RAM) and is used as an external cache.By way of example, but not limitation, many forms of RAMs are available, for example, static random access memory, dynamic random access memory, synchronous dynamic random access memory, double-rate synchronous dynamic random access memory, enhanced synchronous dynamic random access memory, synchronized synchronous dynamic random access memory, and direct Rambus random access memory. It should be noted that the memory of the systems and methods described in this descriptive report includes, but is not limited to, these memories and any memory of another appropriate type.

[393] Figure 10 is a diagram of a 3000 chip system according to an embodiment of this application. As shown in Figure 10, the 3000 chip system (which may also be called a processing system) includes a 3010 logic circuit and an input / output interface (interface of Petition 870250090954, dated 06 / 10 / 2025, pp. 242 / 278 123 / 126 input / output) 3020.

[394] Logic circuit 3010 can be a processing circuit in chip system 3000. Logic circuit 3010 can be coupled and connected to a storage unit and invoke instructions in the storage unit, so that chip system 3000 can implement the methods and functions in the embodiments of this application. Input / output interface 3020 can be an input / output circuit in chip system 3000 and outputs information processed by chip system 3000 or inserts data to be processed or signaling information into chip system 3000 for processing.

[395] In one solution, the 3000 chip system is configured to implement operations performed by the first communication device in the previous method modes.

[396] In another solution, the 3000 chip system is configured to implement operations performed by the second communication device in the previous method modes.

[397] One embodiment of this application additionally provides a computer-readable storage medium. The computer-readable storage medium stores computer instructions used to implement the methods performed by the devices (for example, the first communication device, the second communication device, and the key management network element) in the preceding method embodiments.

[398] One embodiment of this application additionally provides a computer program product including instructions. When the instructions are executed by a computer, the computer is enabled to implement the methods performed by the devices (for example, the first communication device, the second communication device, and the Petition 870250090954, dated 06 / 10 / 2025, pp. 243 / 278 124 / 126 key management network element) in the previous method modes.

[399] One embodiment of this application further provides a communication system, including one or more of the first communication device, second communication device, and previous key management network element.

[400] For explanations and beneficial effects of the related content in any of the devices provided above, refer to the corresponding method embodiments provided above. The details are not described again in the present invention.

[401] A person skilled in the art may be aware that the units and steps of the algorithm in the examples described with reference to the embodiments disclosed in this descriptive report may be implemented by electronic hardware or by a combination of software and electronic hardware. The performance of the functions by hardware or software depends on specific applications and the design constraints of the technical solutions. A person skilled in the art may use different methods to implement the functions described for each specific application, but the implementation should not be considered to go beyond the scope of this application.

[402] It may be clearly understood by a person skilled in the art that, for ease and brevity of description, for a detailed working process of the above system, apparatus and unit, refer to a corresponding process in the embodiments of the above method. The details are not described again in the present invention.

[403] In the various embodiments provided in this application, it should be understood that the system, apparatus and method disclosed may be implemented in other ways. For example, the embodiment of the apparatus described is merely Petition 870250090954, dated 06 / 10 / 2025, pages 244 / 278 125 / 126 an example. For example, the division into units is merely a logical function division and may be another division in a real implementation. For example, a plurality of units or components may be combined or integrated into another system, or some functionalities may be ignored or not performed. Furthermore, the mutual couplings, direct couplings, or communication connections shown or discussed may be implemented through some interfaces. Indirect couplings or communication connections between devices or units may be implemented electronically, mechanically, or in another way.

[404] The units described as separate components may or may not be physically separate, and the components displayed as units may or may not be physical units, may be located in one position or may be distributed across a plurality of network units. Some or all of the units may be selected based on the actual requirements to achieve the objectives of the modal solutions.

[405] In addition, the functional units in the embodiments of this application may be integrated into a processing unit, or each of the units may exist physically in isolation, or two or more units may be integrated into a unit.

[406] When functions are implemented in the form of a functional software unit and sold or used as a stand-alone product, the functions may be stored on a computer-readable storage medium. Based on this understanding, the technical solutions of this application, essentially, either the part that contributes to conventional technology, or some of the technical solutions, may be implemented in the form of a software product. The computer software product is stored on a storage medium and includes various instructions to instruct a Petition 870250090954, dated 06 / 10 / 2025, pages 245 / 278 126 / 126 computer device (which may be a personal computer, a server, or a network device) to perform all or part of the steps of the methods in embodiments of this application. The aforementioned storage medium includes any medium that can store program code, for example, a USB flash drive, a removable hard disk, a read-only memory, a random access memory, a magnetic disk, or an optical disk.

[407] The descriptions above are merely specific implementations of this application, but are not intended to limit the scope of protection of this application. Any variation or substitution easily understood by a person skilled in the art within the technical scope disclosed in this application will be within the scope of protection of this application. Therefore, the scope of protection of this application will be subject to the scope of protection of the claims. Petition 870250090954, dated 06 / 10 / 2025, pages 246 / 278

Claims

1 / 9 CLAIMS 1. A communication method, characterized in that it comprises: obtaining, by a first communication device, a security policy corresponding to a proximity-based services group, wherein the security policy comprises a confidentiality security policy and / or an integrity security policy, the confidentiality security policy indicating whether confidentiality security protection is enabled for a message from the proximity-based services group, the integrity security policy indicating whether integrity security protection is enabled for the message from the proximity-based services group, the proximity-based services group comprising at least two members, and the first communication device being one of at least two members; determining, by the first communication device in accordance with the security policy,Security protection must be performed on a payload field carried in the first message to be sent, and a value must be assigned to a field other than the payload field in the first message, wherein the field other than the payload field comprises one or more of the following: an identifier of a proximity-based services group key, an identifier of a proximity-based services group traffic key, an update parameter, confidentiality indication information, integrity indication information, or a message authentication code, MAC, the confidentiality indication information indicates whether confidentiality security protection is enabled, the integrity indication information indicates whether integrity security protection is enabled, and the security protection comprises confidentiality security protection and / or Petition 870250090954, dated 06 / 10 / 2025.pg. 270 / 278 2 / 9 security integrity protection; and send, via the first communication device, the first message to a second communication device.

2. Method according to claim 1, characterized in that the assignment of the value to the field other than the payload field in the first message comprises: when the confidentiality security policy indicates that confidentiality security protection is not enabled, but the integrity security policy indicates that integrity security protection is enabled, setting, by the first communication device, the MAC as different from 0, and setting at least one of the proximity-based services group key identifier, the proximity-based services group traffic key identifier, and the update parameter as different from 0.

3. Method, according to claim 1 or 2, characterized in that the assignment of the value to the field other than the payload field in the first message comprises: when the confidentiality security policy indicates that confidentiality security protection is not enabled, but the integrity security policy indicates that integrity security protection is enabled, setting, by the first communication device, the confidentiality indication information as 0.

4. Method according to claim 1, characterized in that the determination, by the first communication device according to the security policy, to perform security protection on the payload field carried in the first message to be sent, and to assign a value to a field other than the payload field in the first message comprises Petition 870250090954, dated 06 / 10 / 2025, pp. 271 / 278 3 / 9 one or more of the following: when the confidentiality security policy indicates that confidentiality security protection is enabled, determining, by the first communication device, to perform confidentiality security protection on the payload field carried in the first message to be sent, and setting a value of at least one of the following: proximity-based services group key identifier, proximity-based services group traffic key identifier, update parameter,and the confidentiality indication information carried in the first message as different from 0; when the integrity security policy indicates that integrity security protection is enabled, determine, by the first communication device, to perform integrity security protection on the payload field carried in the first message to be sent, and set a value of the MAC carried in the first message as different from 0; when the confidentiality security policy indicates that confidentiality security protection is not enabled, determine, by the first communication device, not to perform confidentiality security protection on the payload field carried in the first message to be sent, and set a value of at least one of the following: proximity-based services group key identifier, proximity-based services group traffic key identifier,the update parameter, and the confidentiality indication information that is carried in the first message as 0; or when the integrity security policy indicates that integrity security protection is not enabled, determine, by the first communication device, not to perform integrity security protection in the payload field carried in the first message to be sent, and set a MAC value carried in the first message as 0.

5. A method, according to any one of claims 1 to 4, characterized in that the determination, by the first communication device according to the security policy, to perform security protection on the payload field carried in the first message to be sent, and to assign a value to a field other than the payload field in the first message, comprises: determining, by the first communication device according to a local policy and the security policy, to perform security protection on the payload field carried in the first message, and assigning a value to a field other than the payload field in the first message, wherein the local policy indicates a triggering condition for the first communication device to perform security protection on the payload field.

6. Method, according to claim 5, characterized in that the determination, by the first communication device in accordance with the local policy and the security policy, to perform security protection in the payload field, and to assign a value to the field other than the payload field in the first message comprises: when the security policy indicates that security protection is optionally enabled, determining, by the first communication device in accordance with the local policy, to perform security protection in the payload field, and assigning a value to the field other than the payload field in the first message.

7. Method, according to claim 5 or 6, characterized in that the determination, by the first communication device according to Petition 870250090954, dated 06 / 10 / 2025, pp. 273 / 278 5 / 9, the local policy and the security policy, to perform security protection in the payload field, and assign a value to the field other than the payload field in the first message, comprises one or more of the following: when the confidentiality security policy indicates that confidentiality security protection is optionally enabled, and a type of the first communication device is a roadside unit, determining, by the first communication device, not to perform confidentiality security protection in the payload field, and setting a value of the confidentiality indication information carried in the field other than the payload field as 0,or set at least one of the proximity-based services group key identifier, the proximity-based services group traffic key identifier, and the update parameter to 0; or when the confidentiality security policy indicates that confidentiality security protection is optionally enabled, and a type of the first communication device is a vehicle, determine, by the first communication device, to perform confidentiality security protection in the payload field, and set a value of the confidentiality indication information carried in the field other than the payload field to different from 0, or set at least one of the proximity-based services group key identifier, the proximity-based services group traffic key identifier, and the update parameter to different from 0.

8. Method, according to claim 1, characterized in that the determination, by the first communication device according to the security policy, of whether security protection should be performed on the payload field carried in the first message to be sent, and assigning a value to the field other than the payload field in the first message comprises: when the confidentiality security policy indicates that confidentiality security protection is not enabled, and the integrity security policy indicates that integrity security protection is not enabled, setting, by the first communication device, at least one of the proximity-based services group key identifier, the proximity-based services group traffic key identifier, and the update parameter as different from 0.

9. A method, according to any one of claims 1 to 8, characterized in that confidentiality indication information is carried in an information header of a PDCP packet of the packet-based data convergence protocol of the first communication device.

10. A method, according to any one of claims 1 to 9, characterized in that obtaining, by the first communication device, the security policy corresponding to the proximity-based services group comprises: sending, by the first communication device, a request message to a network element of the key management function, wherein the request message comprises a group identifier of the proximity-based services group and a security capability of the first communication device, and the request message is used to request the obtaining of the security policy associated with the group identifier; and receiving, by the first communication device, the security policy of the network element of the key management function. Petition 870250090954, dated 06 / 10 / 2025, pp. 275 / 278 7 / 9 11. A communication method, characterized in that it comprises: receiving, by a second communication device, a first message from a first communication device, wherein the first message comprises a payload field and a field other than the payload field, the field other than the payload field comprising a message authentication code, MAC; and determining, by the second communication device in accordance with an integrity security policy corresponding to a proximity-based services group, whether to perform integrity verification on the payload field, wherein the integrity security policy indicates whether integrity security protection is enabled for a message from the proximity-based services group, the proximity-based services group comprises at least two members, the second communication device is one of at least two members.

12. Method, according to claim 11, characterized in that the determination, by the second communication device in accordance with the integrity security policy corresponding to the proximity-based services group, of whether to perform integrity verification in the payload field comprises: when the integrity security policy indicates that integrity security protection is enabled, determining, by the second communication device, whether to perform integrity verification in the payload field.

13. Method, according to claim 11 or 12, characterized in that the determination, by the second communication device in accordance with the integrity security policy corresponding to the proximity-based services group, whether integrity verification should be performed in the payload field comprises: Petition 870250090954, dated 06 / 10 / 2025, pp. 276 / 278 8 / 9 determining, by the second communication device in accordance with the integrity security policy and the field different from the payload field, whether integrity verification should be performed in the payload field.

14. Method, according to claim 13, characterized in that the determination of, by the second communication device according to the integrity security policy and the field different from the payload field, whether integrity verification in the payload field must be performed comprises: when the integrity security policy indicates that integrity security protection is enabled, and the field different from the payload field does not carry the MAC or a MAC value carried in the field different from the payload field is 0, discarding, by the second communication device, the first message.

15. Method, according to claim 13, characterized in that the determination, by the second communication device according to the integrity security policy and the field other than the payload field, whether to perform integrity verification on the payload field comprises: when the integrity security policy indicates that integrity security protection is optionally enabled, and the field other than the payload field does not carry the MAC or the value of the MAC carried in the field other than the payload field is 0, determining, by the second communication device, whether to perform integrity verification on the payload field.

16. A method, according to any one of claims 11 to 15, characterized in that the method further comprises: sending, by the second communication device, a request message to a network element of the key management function, wherein the request message comprises a group identifier of the proximity-based services group and a security capability of the second communication device, and the request message is used to request the obtaining of the integrity security policy associated with the group identifier; and receiving, by the second communication device, the integrity security policy of the network element of the key management function.

17. Communication apparatus, characterized in that it is configured to perform the method defined in any one of claims 1 to 16.

18. Computer-readable storage medium, characterized in that the computer-readable storage medium stores instructions, and when the instructions are executed, the computer is enabled to perform the method defined in any one of claims 1 to 16. Petition 870250090954, dated 06 / 10 / 2025, pp. 278 / 278