Communication method and communication device

By determining a security algorithm that can achieve both confidentiality protection and integrity protection, and security protection of messages based on the security algorithm and shared security key, the confidentiality security protection algorithm and integrity security protection algorithm are solved. 组合存在的安全隐患问题,实现了安全、高效的消息传输。

CN119450460APending Publication Date: 2025-02-14HUAWEI TECH CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202310985716.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-08-04
Publication Date
2025-02-14

AI Technical Summary

Technical Problem

When transmitting messages between the terminal device and the network side, the combination of confidential security protection algorithm and integrity security protection algorithm poses security risks and is difficult to effectively solve.

Method used

By determining a security algorithm that can achieve both confidentiality protection and integrity protection, and security protection is performed on the message based on the security algorithm and the shared security key, the combined use of the algorithm is avoided.

Benefits of technology

It realizes that when transmitting messages between the terminal device and the network side, avoids security risks, and reduces the complexity of key derivation and the need for key storage space.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119450460A_ABST
    Figure CN119450460A_ABST
Patent Text Reader

Abstract

A communication method is provided, comprising a network device determining a security algorithm, the security algorithm comprising a portion for confidentiality protection and a portion for integrity protection. And the network equipment activates security protection between the network equipment and the terminal equipment based on the security algorithm and the security key, wherein the security key is a key shared between the terminal equipment and the network equipment. And the network equipment receives the security-protected uplink message from the terminal equipment, performs integrity verification on the uplink message by using the security key as an input key of the integrity-protected part in the security algorithm, and decrypts the uplink message by using the security key as an input key of the confidentiality-protected part in the security algorithm. The security algorithm not only can realize confidentiality protection, but also can realize integrity protection, so that the network equipment can perform integrity verification and decryption based on the same security key, thereby avoiding potential safety hazards existing in the combination of a confidentiality security protection algorithm and an integrity security protection algorithm.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of communications, and more specifically, to a communication method and a communication device. Background Art

[0002] When the network device starts the non-access stratum (NAS) security mode control procedure (SMC) or the access stratum (AS) security mode control procedure, after the network side sends a security mode command (SMC) message to the terminal side, the terminal device responds to the SMC message and replies a security mode complete (SMP) message to the network side.

[0003] The terminal device and the network side can negotiate a security protection algorithm based on the SMC process to protect the messages transmitted between the terminal device and the network side. For example, the terminal device and the network side can negotiate the algorithms required for confidentiality security protection and integrity security protection based on the SMC process. In the case where the message to be transmitted needs to be protected by confidentiality security and integrity security, how to avoid the security risks of the combination of confidentiality security protection algorithm and integrity security protection algorithm has become an urgent problem to be solved. Summary of the invention

[0004] The present application provides a communication method in order to avoid the potential security risks of the combination of a confidentiality security protection algorithm and an integrity security protection algorithm.

[0005] In a first aspect, a communication method is provided. The method may be executed by a network device or by a component (such as a chip or a circuit) of the network device, and the present application does not limit this.

[0006] The communication method comprises: determining a security algorithm, wherein the security algorithm comprises a part for performing confidentiality protection and a part for performing integrity protection; activating security protection between the network device and the terminal device based on the security algorithm and a security key, wherein the security key is a key shared between the terminal device and the network device; receiving a security-protected uplink message from the terminal device, performing integrity verification on the security-protected uplink message using the security key as an input key for the integrity-protected part in the security algorithm, and decrypting the security-protected uplink message using the security key as an input key for the confidentiality-protected part in the security algorithm.

[0007] The network device uses the security key as the input key of the integrity protection part in the security algorithm to verify the integrity of the uplink message, including: the network device uses part or all of the information elements carried in the uplink message, and uses the security key as the input key of the integrity protection part in the security algorithm to verify the integrity of the uplink message. In addition, the network device uses the security key as the input key of the confidentiality protection part in the security algorithm to decrypt the security-protected uplink message, including: the network device uses the security key as the input key of the confidentiality protection part in the security algorithm to decrypt part or all of the information elements carried in the security-protected uplink message.

[0008] Based on the above scheme, the security algorithm determined by the network device can achieve both confidentiality protection and integrity protection. The network device can perform integrity verification and decryption of uplink messages based on the same security key and the security algorithm, thereby avoiding the security risks of the combination of the confidentiality security protection algorithm and the integrity security protection algorithm. For example, the confidentiality security protection algorithm and the integrity security protection algorithm are used to perform security protection on messages transmitted between the terminal device and the network device (such as AMF or access network device), specifically including: first performing integrity security protection on the message based on the integrity security protection algorithm, and then using the result of the integrity security protection as the input parameter of the confidentiality security protection algorithm to perform confidentiality security protection on the message. When the result of the integrity security protection is used as the input parameter of the confidentiality security protection, there may be algorithm splicing, and algorithm splicing brings security risks.

[0009] Moreover, in the above scheme, both confidentiality protection and integrity protection can be achieved based on the same security key. The use of the same security key can also reduce the complexity of key deduction and save key storage space.

[0010] In combination with the first aspect, in certain implementations of the first aspect, after activating the security protection between the network device and the terminal device based on the security algorithm and the security key, the method also includes: performing security protection on a security mode command message to be sent based on the security algorithm, the security mode command message to be sent including a first parameter and a second parameter, and sending a security mode command message with security protection to the terminal device, the security mode command message with security protection including a first ciphertext, a first message authentication code MAC and the first parameter, wherein the first ciphertext is obtained by performing confidentiality protection on the second parameter based on the security algorithm, and the first MAC is calculated by performing integrity protection on the first parameter and the first ciphertext based on the security algorithm.

[0011] Based on the above scheme, the security mode command message with security protection sent by the network device carries a first ciphertext obtained by performing confidentiality protection on the second parameter based on the security algorithm, and a first MAC obtained by performing integrity protection calculation on the first parameter and the first ciphertext based on the security algorithm. In addition, the security algorithm also includes the first parameter required for the terminal device to perform security verification. The network device uses the security algorithm to perform confidentiality and integrity security protection on the security mode command message, so that certain parameters can be transmitted through the security mode command message under confidentiality protection, thereby improving security. In addition, the security mode command message also carries the first parameter in plain text, so that the security mode command message can be securely verified according to the first parameter after being received.

[0012] In combination with the first aspect, in certain implementations of the first aspect, the first parameter includes at least one of the following: an identifier of the security algorithm, security capability information of the replayed terminal device, a key identifier of the first key, or first key change indication information, wherein the first key is used to determine the security key.

[0013] Based on the above scheme, the first parameter carried in the security mode command message of security protection may include: the identifier of the security algorithm, the security capability information of the replayed terminal device, the first key change indication information, or the key identifier of the first key, etc. There are many ways to enable the terminal device to implement security verification based on the first parameter. For example, the terminal device can verify whether the security mode command message has been tampered with based on the security capability information of the replayed terminal device; for another example, the terminal device can determine the key of the security algorithm based on the key identifier of the first key, and perform integrity verification, etc., which can further improve the security of message transmission.

[0014] In combination with the first aspect, in certain implementations of the first aspect, the security-protected safety mode command message also includes first indication information, and the first indication information is used to indicate the length of the first parameter and / or to indicate the position of the first parameter in the security-protected safety mode command message.

[0015] Based on the above scheme, the security mode command message can also carry first indication information to indicate the specific position and / or length of the above-mentioned first parameter, so that the terminal device can quickly and accurately read the first parameter from the security mode command message of the security protection based on the first indication information, thereby reducing processing delays.

[0016] In combination with the first aspect, in some implementations of the first aspect, the security mode command message for security protection includes a first packet header type indication, and the first packet header type indication is used to indicate that the security mode command message for security protection is based on the security algorithm.

[0017] In combination with the first aspect, in certain implementations of the first aspect, after activating security protection between itself and the terminal device based on the security algorithm and the security key, the method further includes: using the security key as the input key of the integrity protection part to perform integrity protection on the security mode command message to be sent; and sending the integrity-protected security mode command message to the terminal device.

[0018] Based on the above scheme, the network device can perform integrity security protection on the integrity protection part of the security algorithm based on the security mode command message to be transmitted. There is no need to select an integrity security protection algorithm, nor is there a need to transmit the identifier of the integrity security protection algorithm to the terminal device. The terminal device can perform integrity security verification based on the integrity protection part of the security algorithm, which can reduce signaling overhead.

[0019] In combination with the first aspect, in certain implementations of the first aspect, after determining the security algorithm, the method further includes: determining a first integrity security protection algorithm based on the security algorithm; performing integrity protection on a security mode command message to be sent based on the first integrity security protection algorithm, and sending the integrity-protected security mode command message to the terminal device.

[0020] Based on the above solution, the network device can further determine the first integrity security protection algorithm required for integrity protection of the security mode command message according to the determined security algorithm. In this technical solution, the security mode command message sent by the network device does not need to carry the identifier of the first integrity security protection algorithm, because the terminal device can also determine the first integrity security protection algorithm based on the security algorithm and perform integrity verification, which can reduce signaling overhead.

[0021] In combination with the first aspect, in some implementations of the first aspect, after performing integrity protection on the security mode command message to be sent based on the first integrity security protection algorithm, the method further includes: deleting the first integrity security protection algorithm in the security context.

[0022] Based on the above scheme, after the network device performs integrity protection on the security mode command message to be sent based on the first integrity security protection algorithm, the network device can delete the first integrity security protection algorithm in the security context, because subsequently transmitted messages can be security protected based on the determined security algorithm without the need to be security protected based on the first integrity security protection algorithm. Compared with the scheme of saving all determined security protection algorithms as security context, storage overhead can be reduced.

[0023] In combination with the first aspect, in certain implementations of the first aspect, the integrity protection of the security mode command message to be sent based on the first integrity security protection algorithm includes: using the security key as the input key of the first integrity security protection algorithm to perform integrity protection on the security mode command message to be sent.

[0024] Based on the above solution, the network device can use the above security key to perform integrity protection on the security mode command message to be sent based on the first integrity security protection algorithm, without the need to determine a key separately, thereby reducing processing complexity.

[0025] In combination with the first aspect, in certain implementations of the first aspect, determining the first integrity security protection algorithm based on the security algorithm includes: using an algorithm after the confidentiality protection part in the security algorithm is cleared as the first integrity security protection algorithm; or, determining the first integrity security protection algorithm based on the correspondence between the security algorithm and the first integrity security protection algorithm and the security algorithm.

[0026] Based on the above scheme, the network device can determine the first integrity security protection algorithm based on the security algorithm in different ways, including but not limited to: directly leaving the confidentiality protection part of the selected security algorithm blank and using it as the first integrity security protection algorithm; or, determining the first integrity security protection algorithm based on the locally stored correspondence (i.e., the correspondence between the security algorithm and the first integrity security protection algorithm) and the selected security algorithm. This improves the flexibility of the scheme.

[0027] In combination with the first aspect, in some implementations of the first aspect, if the security algorithm is a SNOW-AEAD algorithm, then the first integrity security protection algorithm is a SNOW integrity security protection algorithm; or, if the security algorithm is a ZUC-AEAD algorithm, then the first integrity security protection algorithm is a ZUC integrity security protection algorithm; or, if the security algorithm is an AES-AEAD algorithm, then the first integrity security protection algorithm is an AES integrity security protection algorithm.

[0028] In combination with the first aspect, in certain implementations of the first aspect, the method also includes: determining a second integrity security protection algorithm, and performing integrity protection on a security mode command message to be sent based on the second integrity security protection algorithm; sending an integrity-protected security mode command message to a terminal device, the integrity-protected security mode command message including an identifier of the security algorithm and an identifier of the second integrity security protection algorithm.

[0029] Based on the above solution, the network device can determine a second integrity security protection algorithm, which is used to perform integrity security protection on the security mode command message to be transmitted, and the above security algorithm is used to implement confidentiality and integrity security protection on the message transmitted after the security mode command message. Specifically, in the technical solution, the message transmitted after the security mode command message between the network device and the terminal device is protected by the security algorithm, avoiding the security risks existing in the combination of the confidentiality security protection algorithm and the integrity security protection algorithm.

[0030] In combination with the first aspect, in certain implementations of the first aspect, after performing integrity protection on the security mode command message to be sent based on the second integrity security protection algorithm, the method further includes: deleting the second integrity security protection algorithm in the security context.

[0031] Based on the above scheme, after the network device performs integrity protection on the security mode command message to be sent based on the second integrity security protection algorithm, the second integrity security protection algorithm can be deleted from the security context, because subsequently transmitted messages can be security protected based on the determined security algorithm and there is no need to perform security protection based on the second integrity security protection algorithm. Compared with the scheme of saving all determined security protection algorithms as security context, storage overhead can be reduced.

[0032] In combination with the first aspect, in certain implementations of the first aspect, the method also includes: determining a third integrity security protection algorithm, and performing security protection on a security mode command message to be sent based on the third integrity security protection algorithm; sending an integrity-protected security mode command message to a terminal device, the integrity-protected security mode command message including an identifier of the third integrity security protection algorithm and second indication information, the second indication information being used to indicate that a message transmitted after the security mode command message is to be security protected based on the security algorithm.

[0033] In combination with the first aspect, in some implementations of the first aspect, the identifier of the third integrity security protection algorithm is used to determine the security algorithm.

[0034] In combination with the first aspect, in some implementations of the first aspect, the method further includes: determining the security algorithm based on a correspondence between the third integrity security protection algorithm and the security algorithm, and the third integrity security protection algorithm.

[0035] Based on the above solution, the network device determines a third integrity security protection algorithm, activates the third integrity security protection algorithm, and performs integrity security protection on the security mode command message to be transmitted based on the third integrity security protection algorithm. Further, the network device carries second indication information in the security mode command message, and the second indication information indicates that the message transmitted after the security mode command message is subjected to confidentiality and integrity security protection based on the security algorithm.

[0036] Specifically, the third integrity security protection algorithm can determine the security algorithm, so that the network device and the terminal device can implement the security protection method of the message transmitted after the negotiated security mode command message through the identifier of the third integrity security protection algorithm carried in the security mode command message. In this technical solution, the subsequent messages transmitted between the network device and the terminal device are protected by the security algorithm, avoiding the security risks of the combination of the confidentiality security protection algorithm and the integrity security protection algorithm.

[0037] In combination with the first aspect, in certain implementations of the first aspect, after performing integrity protection on the security mode command message to be sent based on the first integrity security protection algorithm, the method further includes: deleting the third integrity security protection algorithm in the security context.

[0038] Based on the above scheme, after the network device performs integrity protection on the security mode command message to be sent based on the third integrity security protection algorithm, the third integrity security protection algorithm can be deleted from the security context, because subsequently transmitted messages can be security protected based on the determined security algorithm and there is no need to perform security protection based on the third integrity security protection algorithm. Compared with the scheme of saving all determined security protection algorithms as security context, storage overhead can be reduced.

[0039] In combination with the first aspect, in some implementations of the first aspect, determining the security algorithm includes: selecting the security algorithm according to a priority of at least one security algorithm, wherein the security algorithm is one of the at least one security algorithm.

[0040] Based on the above solution, when the network device is selecting a security algorithm, if the network device has multiple security algorithms stored locally, considering the priorities of different security algorithms, a security algorithm with a higher priority can be selected as the above security algorithm.

[0041] In combination with the first aspect, in some implementations of the first aspect, the security algorithm is an authenticated encryption AEAD algorithm with associated data.

[0042] In combination with the first aspect, in certain implementations of the first aspect, the security protected uplink message includes a security mode response message.

[0043] Based on the above scheme, the network device receives a security mode response message (e.g., a security mode completion message) from the terminal device. The security mode response message is based on the confidentiality and integrity security protection of the security algorithm. The security mode response message implements confidentiality and integrity security protection based on a single security algorithm, avoiding the security risks of the combination of the confidentiality security protection algorithm and the integrity security protection algorithm.

[0044] In combination with the first aspect, in certain implementations of the first aspect, the security-protected uplink message header includes a second packet header type indication, and the second packet header type indication is used to indicate that the security-protected uplink message is security-protected based on the security algorithm.

[0045] In combination with the first aspect, in certain implementations of the first aspect, the security mode command message sent by the above-mentioned network device to the terminal device (such as the above-mentioned security-protected security mode command message or the integrity-protected security mode command message) is used to indicate the activation of security protection between the terminal device and the network device.

[0046] In a second aspect, a communication method is provided. The method may be executed by a terminal device, or by a component (such as a chip or a circuit) of the terminal device, which is not limited in the present application.

[0047] The communication method comprises: determining a security algorithm, wherein the security algorithm comprises a part for performing confidentiality protection and a part for performing integrity protection; activating security protection between the terminal device and the network device based on the security algorithm and a security key, wherein the security key is a key shared between the terminal device and the network device; performing security protection on an uplink message to be sent based on the security algorithm and the security key, and sending the security-protected uplink message to the network device, wherein the performing security protection on the uplink message to be sent based on the security algorithm and the security key comprises:

[0048] The security key is used as an input key of the integrity protection part in the security algorithm to perform integrity protection on the uplink message to be sent, and the security key is used as an input key of the confidentiality protection part in the security algorithm to perform confidentiality protection on the uplink message to be sent.

[0049] In combination with the second aspect, in certain implementations of the second aspect, a security mode command message of security protection is received from the network device, the security mode command message of security protection is used to instruct the terminal device to activate security protection between the terminal device and the network device, the security mode command message of security protection includes a first ciphertext, a first message authentication code MAC and a first parameter, the security algorithm and the security key are determined according to the first parameter; the security key is used as an input key for the integrity protection part of the security algorithm, and the first ciphertext and the first parameter are used as input parameters for the integrity protection part of the security algorithm to calculate the MAC, and the security mode command message of security protection is integrity verified based on the first MAC and the calculated MAC; if the integrity verification passes, the first ciphertext is decrypted using the security key as the input key for the confidentiality protection part of the security algorithm to obtain the second parameter.

[0050] In combination with the second aspect, in certain implementations of the second aspect, the first parameter includes at least one of the following: an identifier of the security algorithm, security capability information of the replayed terminal device, a key identifier of the first key, or indication information of change of the first key, wherein the first key is used to determine the security key.

[0051] In combination with the second aspect, in certain implementations of the second aspect, the security protection safety mode command message also includes first indication information, and the first indication information is used to indicate the length of the first parameter and / or to indicate the position of the first parameter in the security protection safety mode command message; the method also includes: determining the first parameter based on the first indication information.

[0052] In combination with the second aspect, in some implementations of the second aspect, the security mode command message for security protection includes a first packet header type indication, and the first packet header type indication is used to indicate that the security mode command message for security protection is based on the security algorithm.

[0053] In conjunction with the second aspect, in some implementations of the second aspect, determining the security algorithm includes: receiving a security mode command message for integrity protection from the network device; determining the security algorithm according to an identifier of the security algorithm;

[0054] The method further includes integrity verifying the integrity-protected security mode command message using the security key as an input key of an integrity-protected portion of the security algorithm.

[0055] In conjunction with the second aspect, in some implementations of the second aspect, determining the security algorithm includes: receiving a security mode command message for integrity protection from the network device; determining the security algorithm according to an identifier of the security algorithm;

[0056] The method further includes: determining a first integrity security protection algorithm according to the security algorithm; and performing integrity verification on the integrity-protected security mode command message based on the first integrity security protection algorithm.

[0057] In combination with the second aspect, in some implementations of the second aspect, after the integrity verification succeeds, the method further includes: deleting the first integrity security protection algorithm in the security context.

[0058] In combination with the second aspect, in certain implementations of the second aspect, the integrity verification of the integrity-protected security mode command message based on the first integrity security protection algorithm includes: using the security key as the input key of the first integrity security protection algorithm to perform integrity verification on the integrity-protected security mode command message.

[0059] In combination with the second aspect, in certain implementations of the second aspect, determining the first integrity security protection algorithm based on the security algorithm includes: using an algorithm after the confidentiality protection part in the security algorithm is cleared as the first integrity security protection algorithm; or, determining the first integrity security protection algorithm based on the correspondence between the security algorithm and the first integrity security protection algorithm and the security algorithm.

[0060] In combination with the second aspect, in certain implementations of the second aspect, if the security algorithm is a SNOW-AEAD algorithm, then the first integrity security protection algorithm is the SNOW integrity security protection algorithm; or, if the security algorithm is a ZUC-AEAD algorithm, then the first integrity security protection algorithm is the ZUC integrity security protection algorithm; or, if the security algorithm is an AES-AEAD algorithm, then the first integrity security protection algorithm is the AES integrity security protection algorithm.

[0061] In combination with the second aspect, in certain implementations of the second aspect, determining the security algorithm includes: receiving an integrity-protected security mode command message from the network device, the integrity-protected security mode command message including an identifier of the security algorithm and an identifier of the second integrity security protection algorithm; performing integrity verification on the integrity-protected security mode command message based on the second integrity security protection algorithm, and determining the security algorithm based on the identifier of the security algorithm.

[0062] In combination with the second aspect, in some implementations of the second aspect, after the integrity verification succeeds, the method further includes: deleting the second integrity security protection algorithm in the security context.

[0063] In combination with the second aspect, in certain implementations of the second aspect, determining the security algorithm includes: receiving an integrity-protected security mode command message from the network device, the integrity-protected security mode command message including an identifier of the third integrity security protection algorithm and second indication information, the second indication information being used to indicate that a message transmitted after the security mode command message is security-protected based on the security algorithm; performing integrity verification on the integrity-protected security mode command message based on the third integrity security protection algorithm, and determining the security algorithm based on the third integrity security protection algorithm.

[0064] In combination with the second aspect, in some implementations of the second aspect, after the integrity verification is successful and the security algorithm is determined based on the third integrity security protection algorithm, the method further includes: deleting the third integrity security protection algorithm in the security context.

[0065] In combination with the second aspect, in some implementations of the second aspect, the security algorithm is an authenticated encryption AEAD algorithm with associated data.

[0066] In combination with the second aspect, in certain implementations of the second aspect, the security-protected uplink message includes a security mode response message.

[0067] The technical effects of the method shown in the above second aspect and its possible design can refer to the technical effects in the first aspect and its possible design.

[0068] In a third aspect, a communication device is provided, which is used to implement the method shown in the first aspect. The device includes: a transceiver unit and a processing unit, wherein the transceiver unit is used to send and receive information, and the processing unit is used to perform internal processing actions.

[0069] In a fourth aspect, a communication device is provided, which is used to implement the method shown in the second aspect. The device includes: a transceiver unit and a processing unit, wherein the transceiver unit is used to send and receive information, and the processing unit is used to perform internal processing actions.

[0070] In a fifth aspect, a communication system is provided, comprising a network device and a terminal device, wherein the network device is used to execute the method shown in the above-mentioned first aspect, and the terminal device executes the method shown in the above-mentioned second aspect.

[0071] In a sixth aspect, a communication device is provided, which includes: a memory for storing programs; a processor for executing the programs stored in the memory, and when the programs stored in the memory are executed, the processor is used to execute the methods provided in the above aspects.

[0072] In a seventh aspect, the present application provides a processor for executing the methods provided in the above aspects. In the process of executing these methods, the process of sending the above information and obtaining / receiving the above information in the above methods can be understood as the process of the processor outputting the above information and the process of the processor receiving the input above information. When outputting the above information, the processor outputs the above information to the transceiver so that it can be transmitted by the transceiver. After being output by the processor, the above information may also need to be processed otherwise before reaching the transceiver. Similarly, when the processor receives the input information, the transceiver obtains / receives the above information and inputs it into the processor. Furthermore, after the transceiver receives the above information, the above information may need to be processed otherwise before being input into the processor.

[0073] Based on the above principle, for example, the receiving request message mentioned in the above method can be understood as the processor receiving input information.

[0074] For the operations such as transmission, sending and acquisition / reception involved in the processor, unless otherwise specified, or unless they conflict with their actual functions or internal logic in the relevant descriptions, they can be more generally understood as processor output, reception, input and other operations, rather than transmission, sending and receiving operations performed directly by the RF circuit and antenna.

[0075] In the implementation process, the processor may be a processor specifically used to execute these methods, or a processor that executes computer instructions in a memory to execute these methods, such as a general-purpose processor. The memory may be a non-transitory memory, such as a read-only memory (ROM), which may be integrated with the processor on the same chip or may be separately arranged on different chips. The embodiment of the present application does not limit the type of memory and the arrangement of the memory and the processor.

[0076] In an eighth aspect, a computer-readable storage medium is provided, which stores a program code for execution by a device, wherein the program code includes code for executing the methods provided in the above aspects.

[0077] According to a ninth aspect, a computer program product comprising instructions is provided. When the computer program product is run on a computer, the computer is used to execute the methods provided in the above aspects.

[0078] In a tenth aspect, a chip is provided, which includes a processor and a communication interface. The processor reads instructions stored in a memory through the communication interface to execute the methods provided in the above aspects.

[0079] Optionally, as an implementation manner, the chip may further include a memory, in which instructions are stored, and the processor is used to execute the instructions stored in the memory. When the instructions are executed, the processor is used to execute the methods provided by the above aspects. BRIEF DESCRIPTION OF THE DRAWINGS

[0080] Figure 1 is a schematic diagram of a network architecture 100 .

[0081] Figure 2 (a) and (b) are schematic diagrams of how to use the authentication encryption algorithm.

[0082] Figure 3 It is a schematic flow chart of a NAS SMC process.

[0083] Figure 4 It is a schematic flow chart of the AS SMC process.

[0084] Figure 5 It is a schematic flow chart of a communication method provided by the present application.

[0085] Figure 6 It is a schematic flow chart of another communication method provided by the present application.

[0086] Figure 7 It is a schematic flow chart of another communication method provided by the present application.

[0087] Figure 8 It is a schematic flow chart of another communication method provided by the present application.

[0088] Fig. 9 It is a schematic flow chart of another communication method provided by the present application.

[0089] Fig.10 It is a schematic block diagram of a communication device 10 provided in an embodiment of the present application.

[0090] Fig.11 It is a schematic diagram of another communication device 20 provided in an embodiment of the present application.

[0091] Fig.12 It is a schematic diagram of a chip system 30 provided in an embodiment of the present application. DETAILED DESCRIPTION

[0092] The technical solution in this application will be described below in conjunction with the accompanying drawings.

[0093] The technical solution provided in this application can be applied to various communication systems, such as: new radio (NR) system, long term evolution (LTE) system, LTE frequency division duplex (FDD) system, LTE time division duplex (TDD) system, etc. The technical solution provided in this application can also be applied to device to device (D2D) communication, vehicle to everything (V2X) communication, machine to machine (M2M) communication, machine type communication (MTC), and Internet of things (IoT) communication system or other communication systems.

[0094] In the communication system, the part operated by the operator can be called a public land mobile network (PLMN), or an operator network, etc. PLMN is a network established and operated by the government or an operator approved by it for the purpose of providing land mobile communication services to the public. It is mainly a public network in which mobile network operators (MNO) provide mobile broadband access services to users. The PLMN described in the embodiment of the present application may specifically be a network that meets the requirements of the 3GPP standard, referred to as a 3GPP network. 3GPP networks generally include but are not limited to 5G networks, fourth-generation mobile communications (4th-generation, 4G) networks, and other future communication systems, such as (6th-generation, 6G) networks, etc. This technical solution is also applicable to SNPN (Stand-alone Non-Public Network).

[0095] For the convenience of description, the embodiments of the present application will be described using PLMN or 5G network as an example.

[0096] Figure 1 The diagram is a schematic diagram of a network architecture 100, taking the 5G network architecture based on the service-oriented architecture in the non-roaming scenario defined in the 3GPP standardization process as an example. As shown in the figure, the network architecture may include three parts, namely, the terminal device part, the DN and the operator network PLMN part. The functions of the network elements of each part are briefly described below.

[0097] The terminal equipment part may include a terminal device 110, which may also be referred to as a user equipment (UE). The terminal device 110 in the present application is a device with wireless transceiver functions, which may communicate with one or more core network (CN) devices via an access network device (or may also be referred to as an access device) in a radio access network (RAN) 140. The terminal device 110 may also be referred to as an access terminal, a terminal, a user unit, a user station, a mobile station, a mobile station, a remote station, a remote terminal, a mobile device, a user terminal, a user agent or a user device, etc. The terminal device 110 may be deployed on land, including indoors or outdoors, handheld or vehicle-mounted; it may also be deployed on the water (e.g., a ship, etc.); it may also be deployed in the air (e.g., on an airplane, a balloon, and a satellite, etc.). The terminal device 110 may be a cellular phone, a cordless phone, a session initiation protocol (SIP) phone, a smart phone, a mobile phone, a wireless local loop (WLL) station, a personal digital assistant (PDA), etc. Alternatively, the terminal device 110 may also be a handheld device with wireless communication function, a computing device or other device connected to a wireless modem, a vehicle-mounted device, a wearable device, a drone device or a terminal in the Internet of Things or the Internet of Vehicles, a terminal in any form in a 5G network and future networks, a relay user device or a terminal in a future evolved 6G network, etc. Among them, the relay user device may be, for example, a 5G residential gateway (RG). For example, the terminal device 110 can be a virtual reality (VR) terminal, an augmented reality (AR) terminal, a wireless terminal in industrial control, a wireless terminal in self-driving, a wireless terminal in remote medical, a wireless terminal in smart grid, a wireless terminal in transportation safety, a wireless terminal in smart city, a wireless terminal in smart home, etc. The terminal device here refers to a 3GPP terminal. The embodiment of the present application does not limit the type or type of terminal device. For ease of explanation, the following description of the present application takes UE as an example to refer to the terminal device.

[0098] The operator network PLMN part may include but is not limited to the (radio) access network ((R)AN) 120 and the core network (CN) part.

[0099] (R)AN 120 can be regarded as a sub-network of the operator network, and is an implementation system between the service nodes in the operator network and the terminal device 110. To access the operator network, the terminal device 110 first passes through (R)AN 120, and then can connect to the service nodes of the operator network through (R)AN 120. The access network device (RAN device) in the embodiment of the present application is a device that provides wireless communication functions for the terminal device 110, and can also be called a network device. The RAN device includes but is not limited to: the next generation node base station (gNB) in the 5G system, the evolved node B (eNB) in the long term evolution (LTE), the radio network controller (RNC), the node B (NB), the base station controller (BSC), the base transceiver station (BTS), the home base station (for example, home evolved node B, or home node B, HNB), the base band unit (BBU), the transmission point (TRP), the transmitting point (TP), the small base station device (pico), the mobile switching center, or the network device in the future network. In systems using different wireless access technologies, the names of the devices with access network device functions may be different. For the convenience of description, in all embodiments of the present application, the above-mentioned devices that provide wireless communication functions for the terminal device 110 are collectively referred to as access network devices or RAN or AN for short. It should be understood that this document does not limit the specific type of access network equipment.

[0100] The CN part may include but is not limited to the following NFs: user plane function (UPF) 130, network exposure function (NEF) 131, network function repository function (NRF) 132, policy control function (PCF) 133, unified data management function (UDM) 134, unified data repository function (UDR) 135, network data analytics function (NWDAF) 136, authentication server function (AUSF) 137, access and mobility management function (AMF) 138, session management function (SMF) 139.

[0101] The data network DN 140, which may also be referred to as a packet data network (PDN), is usually a network located outside the operator network, such as a third-party network. Of course, in some implementations, the DN may also be deployed by the operator, that is, the DN is part of the PLMN. This application does not limit whether the DN belongs to the PLMN. The operator network PLMN may access multiple data networks DN 140, and multiple services may be deployed on the data network DN 140, which may provide services such as data and / or voice to the terminal device 110. For example, the data network DN 140 may be a private network of a smart factory, and the sensors installed in the workshop of the smart factory may be the terminal devices 110. The control server in which the sensors are deployed in the data network DN 140 may provide services for the sensors. The sensors may communicate with the control server, obtain instructions from the control server, and transmit the collected sensor data to the control server according to the instructions. For another example, the data network DN 140 may be an internal office network of a company, and the mobile phones or computers of the company's employees may be the terminal devices 110, and the employees' mobile phones or computers may access information, data resources, etc. on the company's internal office network. The terminal device 110 can establish a connection with the operator network through an interface (such as N1, etc.) provided by the operator network, and use data and / or voice services provided by the operator network. The terminal device 110 can also access the data network DN 140 through the operator network, and use the operator services deployed on the data network DN 140, and / or services provided by a third party.

[0102] The following is a brief description of the NF functions included in CN.

[0103] 1. UPF 130 is a gateway provided by the operator and is the gateway for communication between the operator network and the data network DN 140. UPF 130 includes user-plane related functions such as data packet routing and transmission, data packet detection, service usage reporting, quality of service (QoS) processing, legal monitoring, uplink data packet detection, downlink data packet storage, etc.

[0104] 2. NEF 131 is a control plane function provided by the operator. It mainly enables third parties to use the services provided by the network, supports the network to open its capabilities, event and data analysis, provides PLMN security configuration information from external applications, and converts the interactive information inside and outside the PLMN. It provides an API interface for the operator network to be open to the outside world, and provides it for the interaction between external servers and internal operator networks.

[0105] 3. NRF 132 is a control plane function provided by the operator, which can be used to maintain real-time information of network functions and services in the network. For example, it supports network service discovery, maintains the services supported by the NF profile of the NF instance, supports service discovery of the service communication proxy (SCP), maintains the SCP profile of the SCP instance, sends notifications about newly registered, unregistered, and updated NFs and SCPs, and maintains the health status of NF and SCP operations.

[0106] 4. PCF 133 is a control plane function provided by the operator. It supports a unified policy framework to govern network behavior, provide policy rules to other control functions, and contract information related to policy decisions.

[0107] 5. UDM 134 is a control plane function provided by the operator, which is responsible for storing information such as the subscriber permanent identifier (SUPI) of the subscriber in the operator network, the generic public subscription identifier (GPSI) of the subscriber, and credentials. The confidentiality of the SUPI will be protected during transmission, and the confidentiality-protected SUPI is called a hidden user subscription identifier (SUCI). The information stored in UDM 134 can be used for authentication and authorization of the terminal device 110 to access the operator network. The subscribers of the above-mentioned operator network can specifically be users who use the services provided by the operator network, such as users who use China Telecom's mobile phone core card (subscriber identity module, SIM) card, or users who use China Mobile's mobile phone core card. The credentials of the above-mentioned subscribers can be a small file storing long-term keys stored in the mobile phone core card or information related to the encryption of the mobile phone core card, which is used for authentication and / or authorization. It should be noted that permanent identifiers, credentials, security contexts, authentication data (cookies), and tokens are equivalent to verification / authentication and authorization-related information. In the embodiments of the present application, no distinction or restriction is made for the sake of convenience of description.

[0108] 6. UDR 135 is a control plane function provided by the operator, which provides the functions of storing and retrieving subscription data for UDM, storing and retrieving policy data for PCF, storing and retrieving user's NF group ID information, etc.

[0109] 7. NWDAF 136 is a control plane function provided by the operator. Its main function is to collect data from NF, external application function AF and operation, administration and maintenance (OAM) system, etc., and provide NWDAF service registration, data opening and analysis data to NF and AF. In this application, NWDAF is mainly responsible for security-related data analysis. Therefore, in this application, NWDAF can also be understood as a network element with security analysis function. The network element with security analysis function is called NWDAF only as an example. There may be other network element names in the future, and this application does not limit this.

[0110] 8. AUSF 137 is a control plane function provided by the operator, and is usually used for primary authentication, i.e., authentication between the terminal device 110 (subscriber) and the operator network. After receiving the authentication request initiated by the subscriber, AUSF 137 may authenticate and / or authorize the subscriber through the authentication information and / or authorization information stored in UDM 134, or generate the authentication and / or authorization information of the subscriber through UDM 134. AUSF 137 may feed back the authentication information and / or authorization information to the subscriber.

[0111] 9. AMF 138 is a control plane network function provided by the operator network, responsible for access control and mobility management of the terminal device 110 accessing the operator network, such as mobility status management, allocation of user temporary identity, authentication and authorization of users, etc.

[0112] AMF 138 is used to establish a non-access stratum (NAS) connection with the UE and has the same 5G NAS security context as the UE. The 5G NAS security context includes KAMF, key identification information with the same NAS layer key, UE security capabilities, and uplink NAS COUNT value and downlink NAS COUNT value. NAS layer keys include NAS confidentiality protection keys and NAS integrity security protection keys, which are used for confidentiality security protection and integrity security protection of NAS messages respectively.

[0113] 10. SMF 139 is a control plane network function provided by the operator network, responsible for managing the PDU session of the terminal device 110. The PDU session is a channel for transmitting PDUs. The terminal device needs to transmit PDUs to and from the data network DN 140 through the PDU session. SMF 139 is responsible for establishing, maintaining and deleting PDU sessions. SMF 139 includes session management (such as session establishment, modification and release, including tunnel maintenance between the user plane function UPF 130 and (R)AN 120), selection and control of UPF 130, service and session continuity (SSC) mode selection, roaming and other session-related functions.

[0114] 11. AF 141 is a control plane network function provided by the operator network, which is used to provide application layer information. It can interact with the policy framework through the network open function network element or directly interact with the policy framework to make policy decision requests, etc. It can be located inside or outside the operator network.

[0115] It is understandable that the above network elements or functions can be physical entities in hardware devices, software instances running on dedicated hardware, or virtualized functions instantiated on a shared platform (e.g., a cloud platform). In short, an NF can be implemented by hardware or software.

[0116] Figure 1 Among them, Nnef, Nnrf, Npcf, Nudm, Nudr, Nnwdaf, Nausf, Namf, Nsmf, N1, N2, N3, N4, and N6 are interface serial numbers. For example, the meaning of the above interface serial numbers can refer to the meaning defined in the 3GPP standard protocol, and this application does not limit the meaning of the above interface serial numbers. It should be noted that the interface name between the various network functions in the figure is only an example. In the specific implementation, the interface name of the system architecture may also be other names, which is not limited by this application. In addition, the name of the message (or signaling) transmitted between the above-mentioned network elements is also only an example, and does not constitute any limitation on the function of the message itself.

[0117] For the convenience of explanation, in the embodiments of the present application, the network functions (such as NEF 131 ... SMF139) are collectively referred to as NFs, that is, the NFs described later in the embodiments of the present application can be replaced by any network function. Figure 1 Only some network functions are schematically described. The NF described below is not limited to Figure 1 The network functions shown in .

[0118] It should be understood that the above-mentioned network architecture applied to the embodiment of the present application is only a network architecture described from the perspective of a service-oriented architecture, and the network architecture applicable to the embodiment of the present application is not limited to this. Any network architecture that can realize the functions of the above-mentioned network elements is applicable to the embodiment of the present application.

[0119] It should also be understood that the AMF, SMF, UPF, NEF, AUSF, NRF, PCF, and UDM shown in the figure can be understood as network elements used to implement different functions in the core network, for example, they can be combined into network slices as needed. These core network network elements can be independent devices or integrated into the same device to implement different functions. This application does not limit the specific form of the above network elements.

[0120] It should also be understood that the above naming is only defined for the convenience of distinguishing different functions and should not constitute any limitation to this application. This application does not exclude the possibility of using other naming in 5G networks and other future networks. For example, in a 6G network, some or all of the above network elements may use the terminology in 5G, or may use other names.

[0121] To facilitate understanding of the embodiments of the present application, some basic concepts involved in the present application are briefly described.

[0122] 1. NAS security context:

[0123] Exemplarily, the NAS security context can be divided into a full NAS security context and a partial NAS security context from the perspective of completeness.

[0124] The partial NAS security context includes: Kamf and its associated key identifier (ngKSI), UE security capabilities, uplink NAS counter values, and downlink NAS counter values. Compared with the partial NAS security context, the full NAS security context also includes integrity security protection keys and confidentiality security protection (or encryption security protection) keys, as well as the selected integrity security protection algorithm and confidentiality security protection algorithm.

[0125] Exemplarily, from the perspective of source, NAS security context can be divided into native NAS security context and mapped NAS security context.

[0126] Among them, Kamf in the native NAS security context is generated by executing the main authentication process and is identified by the native ngKSI; Kamf in the mapped NAS security context is generated by other keys during the network interaction process from different generations (such as generated by 4G keys during the interaction process from 4G to 5G), and is identified by the mapped ngKSI.

[0127] For example, from the perspective of status, NAS security contexts can be divided into current and non-current. A current NAS security context refers to a security context that has been recently activated; a non-current NAS security context refers to a security context that is not in use.

[0128] As can be seen from the above, the specific types of NAS security contexts may include mapped, fully native or partially native security contexts. The status may be active or inactive. Exemplarily, after the UE and the core network complete the primary authentication, a partial native context is generated, and the status is inactive. The AMF initiates a NAS security mode control (SMC) process to the UE, and after the NAS SMC succeeds, a fully native NAS context is generated, and the status is active.

[0129] 2. Activate security protection based on confidentiality security protection algorithm: refers to configuring confidentiality security protection key and confidentiality security protection algorithm.

[0130] Furthermore, after activating security protection based on the confidentiality security protection algorithm, the sender can use the confidentiality security protection key and the confidentiality security protection algorithm to perform confidentiality protection (e.g., encrypt) on the outgoing message; the receiver can use the confidentiality security protection key and the confidentiality security protection algorithm to decrypt the received message (e.g., decrypt).

[0131] 3. Activate security protection based on integrity security protection algorithm: refers to configuring integrity security protection key and integrity security protection algorithm.

[0132] Furthermore, after activating security protection based on the integrity security protection algorithm, the sender can use the integrity security protection key and the integrity security protection algorithm to perform integrity security protection on the sent message, that is, calculate the MAC used for integrity security protection; the receiver can use the integrity security protection key and the integrity security protection algorithm to perform integrity security verification on the received message, that is, determine whether the received MAC is correct.

[0133] 4. Security algorithm that can achieve both confidentiality security protection and integrity security protection: The security algorithm involved in this application that can achieve both confidentiality security protection and integrity security protection can be called an authenticated encryption algorithm. An authenticated encryption algorithm is an authenticated encryption with associated data (AEAD) algorithm. The AEAD algorithm (also called AEAD mode) can achieve both confidentiality security protection and integrity security protection of data. In other words, the AEAD algorithm can achieve both confidentiality security protection and integrity security protection of data at the same time, and it can also be understood that the AEAD algorithm can achieve both confidentiality security protection and integrity security protection of data with a single key (AEAD key) as the input key.

[0134] For ease of understanding, combined Figure 2 (a) and (b) briefly introduce how to use the authenticated encryption algorithm.

[0135] from Figure 2 As can be seen from (a) and (b), the authenticated encryption algorithm includes a part for confidentiality protection and a part for integrity protection.

[0136] from Figure 2 In (a), it can be seen that the sender can perform confidentiality protection (e.g., encryption) on the parameter to be protected based on the security key and the confidentiality protection part to obtain the ciphertext; in addition, the sender can perform integrity protection operation on the parameter to be protected based on the security key, the integrity protection part and the ciphertext to obtain the MAC. The parameter to be protected is transmitted to the receiving end in plain text.

[0137] For example, the sender uses the parameters to be protected for confidentiality and the security key as the input of the confidentiality protection part, performs confidentiality protection, and outputs the ciphertext; and uses the ciphertext, the security key, and the parameters to be protected for integrity as the input of the integrity protection part, performs integrity protection operation to obtain MAC. It can be understood that after the parameters to be protected for confidentiality are protected for confidentiality, the ciphertext is obtained, and the ciphertext will be protected for integrity, that is, the parameters to be protected for confidentiality will be protected for confidentiality and integrity.

[0138] from Figure 2It can be seen from (b) in the figure that the receiving end can perform integrity protection operations based on the security key, the parameter to be integrity verified, the received ciphertext and the integrity-protected part to obtain MAC. It should be understood that, in the absence of a security attack, the parameter to be integrity verified is also the aforementioned parameter to be integrity-secured; in addition, the receiving end can decrypt the ciphertext (e.g., decrypt it) based on the security key, the ciphertext and the confidentiality-protected part to obtain the decrypted parameter (e.g., the plaintext obtained by decrypting the ciphertext). It should be understood that, in the absence of a security attack, the decrypted parameter is also the aforementioned parameter to be confidentiality-secured.

[0139] For example, the receiving end uses the received parameters to be verified for integrity, security keys, and ciphertext as the input of the integrity protection part, performs integrity protection operation to obtain MAC, compares the MAC obtained by itself with the received MAC to see if they are consistent, and implements integrity security protection (e.g., integrity verification). The receiving end can also use the ciphertext and security key as the input of the confidentiality protection part, perform confidentiality protection removal (e.g., decryption), and output the parameters for confidentiality protection removal.

[0140] From the above, we can see that for the sender, confidentiality protection is encryption; for the receiver, integrity protection is integrity verification, and confidentiality protection is decryption.

[0141] For example, if Figure 2 The authenticated encryption algorithm shown in (a) and (b) is the AEAD algorithm.

[0142] For the sender, the input of the AEAD algorithm includes plaintext (e.g., Figure 2 Parameters to be protected for confidentiality shown in (a)), additional authenticated data (AAD) (e.g., Figure 2 The parameters to be protected by integrity security as shown in (a) of Figure 2 The plaintext part will be encrypted by the AEAD key to obtain the ciphertext (eg, Figure 2 The ciphertext shown in (a) in the figure is used as the input of the integrity protection part. Among them, AAD is the part that does not perform confidentiality security protection but performs integrity security protection. The output of the AEAD algorithm includes the ciphertext part and the MAC part. Among them, the AEAD key can be used for both confidentiality security protection and integrity security protection, so it can also be called a single key.

[0143] For the receiving end, the input of the AEAD algorithm includes ciphertext, AAD and AEAD key. Among them, the ciphertext, AAD and AEAD key will be used as the input of the integrity protection part, and the ciphertext and AEAD key will be used as the input of the confidentiality protection part.

[0144] Exemplarily, AAD may be carried in a message as plain text and transmitted between the sender and the receiver, or it may be a known parameter shared by the sender and the receiver.

[0145] In this application, the following relationship exists between the authentication encryption algorithm and the integrity security protection algorithm and the confidentiality security protection algorithm:

[0146] 1) The authentication encryption algorithm can be used to determine the corresponding integrity security protection algorithm.

[0147] As an optional method, the authenticated encryption algorithm is used to determine the corresponding integrity security protection algorithm, including:

[0148] The algorithm after the confidentiality protection part of the authenticated encryption algorithm is cleared can be considered as an integrity security protection algorithm. The confidentiality protection part being cleared can be understood as a confidentiality protection part null mechanism (null-scheme). When the confidentiality protection part is cleared, the parameters to be protected in the confidentiality protection part of the input part and the ciphertext of the output part of the confidentiality protection part are the same, that is, the confidentiality protection part does not achieve confidentiality protection.

[0149] Optionally, the integrity security protection algorithm determined in this way can also be called the integrity security protection algorithm of the authenticated encryption algorithm.

[0150] As another optional method, the authentication encryption algorithm is used to determine the corresponding integrity security protection algorithm, including:

[0151] According to the preset rules, determine the integrity security protection algorithm corresponding to the authentication encryption algorithm. The preset rules can be the correspondence between the authentication encryption algorithm and the integrity security protection algorithm. For example: the correspondence between the integrity security protection algorithm and the authentication encryption algorithm can be: the SNOW-AEAD algorithm corresponds to the SNOW integrity security protection algorithm, the ZUC-AEAD algorithm corresponds to the ZUC integrity security protection algorithm, the AES-AEAD algorithm corresponds to the AES integrity security protection algorithm, and so on. Then the SNOW-AEAD algorithm and the corresponding relationship can determine the SNOW integrity security protection algorithm, the ZUC-AEAD algorithm and the corresponding relationship can determine the ZUC integrity security protection algorithm, and the others are similar and will not be repeated. In addition, the correspondence between the integrity security protection algorithm and the authentication encryption algorithm can also be referred to as the mapping relationship between the integrity security protection algorithm and the authentication encryption algorithm, which is not limited in this application.

[0152] Exemplarily, the method of omitting the confidentiality protection part in the authentication encryption algorithm to obtain the integrity security protection algorithm is called mapping, and this application does not limit this. Therefore, the authentication encryption algorithm can be used to determine the corresponding integrity security protection algorithm, which can also be understood as the authentication encryption algorithm can be used to map the corresponding integrity security protection algorithm.

[0153] 2) The authenticated encryption algorithm can be used to determine the corresponding confidentiality security protection algorithm.

[0154] As an optional method, the authenticated encryption algorithm is used to determine the corresponding confidentiality security protection algorithm, including:

[0155] The algorithm after the integrity protection part of the authentication encryption algorithm is cleared can be considered as a confidentiality security protection algorithm. Among them, the integrity protection part can be understood as a null scheme. When the integrity protection part is cleared, the output MAC is a constant (such as all zeros), that is, the integrity protection part does not achieve integrity protection.

[0156] Optionally, the confidentiality security protection algorithm determined in this way can also be called a confidentiality security protection algorithm of the authenticated encryption algorithm.

[0157] As another optional method, the authenticated encryption algorithm is used to determine the corresponding confidentiality security protection algorithm, including:

[0158] According to the preset rules, determine the confidentiality security protection algorithm corresponding to the authentication encryption algorithm. The preset rules can be the corresponding relationship between the authentication encryption algorithm and the confidentiality security protection algorithm. For example: the corresponding relationship between the confidentiality security protection algorithm and the authentication encryption algorithm can be: the SNOW-AEAD algorithm corresponds to the SNOW confidentiality security protection algorithm, the ZUC-AEAD algorithm corresponds to the ZUC confidentiality security protection algorithm, the AES-AEAD algorithm corresponds to the AES confidentiality security protection algorithm, and so on. Then the SNOW-AEAD algorithm and the corresponding relationship can determine the SNOW confidentiality security protection algorithm, the ZUC-AEAD algorithm and the corresponding relationship can determine the ZUC confidentiality security protection algorithm, and the others are similar and will not be repeated. In addition, the corresponding relationship between the confidentiality security protection algorithm and the authentication encryption algorithm can also be referred to as the mapping relationship between the confidentiality security protection algorithm and the authentication encryption algorithm, which is not limited in this application.

[0159] Exemplarily, the method of omitting the integrity protection part in the authentication encryption algorithm to obtain the confidentiality security protection algorithm is called mapping, and this application does not limit this. Therefore, the authentication encryption algorithm can be used to determine the corresponding confidentiality security protection algorithm, which can also be understood as the authentication encryption algorithm can be used to map the corresponding confidentiality security protection algorithm.

[0160] 3) The integrity security protection algorithm can be used to determine the corresponding authentication encryption algorithm.

[0161] Exemplarily, the integrity security protection algorithm is used to determine the corresponding authentication encryption algorithm, including:

[0162] According to the preset rules, determine the authentication encryption algorithm corresponding to the integrity security protection algorithm. The preset rule can be the correspondence between the authentication encryption algorithm and the integrity security protection algorithm. For example, see the description in 1) above. The SNOW integrity security protection algorithm can determine the SNOW-AEAD algorithm, the ZUC integrity security protection algorithm can determine the ZUC-AEAD algorithm, and the others are similar and will not be repeated.

[0163] Exemplarily, the correspondence between the authentication encryption algorithm and the integrity security protection algorithm can also be referred to as the mapping relationship between the authentication encryption algorithm and the integrity security protection algorithm. Therefore, the integrity security protection algorithm can be used to determine the corresponding authentication encryption algorithm, which can also be understood as the integrity security protection algorithm can be used to map the corresponding authentication encryption algorithm.

[0164] 4) The confidentiality security protection algorithm can be used to determine the corresponding authentication encryption algorithm.

[0165] Exemplarily, the confidentiality security protection algorithm is used to determine the corresponding authentication encryption algorithm, including:

[0166] According to the preset rules, determine the authentication encryption algorithm corresponding to the confidentiality security protection algorithm. The preset rules can be the correspondence between the authentication encryption algorithm and the confidentiality security protection algorithm. For example, see the description in 2) above. The SNOW confidentiality security protection algorithm can determine the SNOW-AEAD algorithm, the ZUC confidentiality security protection algorithm can determine the ZUC-AEAD algorithm, and the others are similar and will not be repeated.

[0167] Exemplarily, the correspondence between the authentication encryption algorithm and the confidentiality security protection algorithm can also be referred to as the mapping relationship between the authentication encryption algorithm and the confidentiality security protection algorithm. Therefore, the confidentiality security protection algorithm can be used to determine the corresponding authentication encryption algorithm, which can also be understood as the confidentiality security protection algorithm can be used to map the corresponding authentication encryption algorithm.

[0168] 5. NAS SMC process:

[0169] For example, the functions of the NAS SMC process are as follows:

[0170] (1) After the primary authentication is completed, the AMF initiates a NAS security mode command (SMC) message to convert the partial native context into a full native context for subsequent use;

[0171] (2) Changing the NAS security algorithm in the current NAS security context. For example, in scenarios where an AMF change occurs (such as N2-handover or mobility registration), the NAS security algorithm in the current NAS security context needs to be changed.

[0172] (3) Change the uplink NAS count value in the most recent NAS security mode complete (SMP) message to refresh the KgNB;

[0173] (4) Send the selected EPS NAS security algorithm to the UE.

[0174] For ease of understanding, combined Figure 3 This section describes the NAS SMC process in detail.

[0175] Figure 3 It is a schematic flow chart of the NAS SMC process, which includes the following steps:

[0176] S310, AMF configures a priority list of algorithms allowed to be used.

[0177] Exemplarily, a NAS integrity security protection algorithm priority list is configured on the AMF (e.g., the NAS integrity security protection algorithms configured on the AMF include the AES integrity security protection algorithm, the SNOW integrity security protection algorithm, the ZUC integrity security protection algorithm, the empty integrity security protection algorithm, etc., wherein the priorities of the configured multiple integrity security protection algorithms are ranked from high to low as the AES integrity security protection algorithm, the SNOW integrity security protection algorithm, the ZUC integrity security protection algorithm, and the empty integrity security protection algorithm) and a NAS confidentiality security protection algorithm priority list (e.g., the NAS confidentiality security protection algorithms configured on the AMF include the ZUC confidentiality security protection algorithm, the AES confidentiality security protection algorithm, the SNOW confidentiality security protection algorithm, and the empty integrity security protection algorithm, wherein the priorities of the configured multiple confidentiality security protection algorithms are ranked from high to low as the ZUC confidentiality security protection algorithm, the AES confidentiality security protection algorithm, the SNOW confidentiality security protection algorithm, and the empty integrity security protection algorithm).

[0178] AMF obtains UE security capabilities and selects NAS integrity security protection algorithm and NAS confidentiality security protection algorithm according to UE security capabilities and algorithm priority list. For example, if UE security capabilities include supported NAS integrity security protection algorithms such as AES integrity security protection algorithm and SNOW integrity security protection algorithm, then the integrity security protection algorithm selected by AMF is AES integrity security protection algorithm; for another example, if UE security capabilities include supported NAS confidentiality security protection algorithms such as AES confidentiality security protection algorithm and ZUC confidentiality security protection algorithm, then the confidentiality security protection algorithm selected by AMF is ZUC confidentiality security protection algorithm.

[0179] S320, AMF activates NAS integrity security protection.

[0180] Before sending the NAS SMC message, the AMF activates NAS integrity security protection.

[0181] Exemplarily, the AMF calculates the integrity security protection key Knasint. Further, the AMF performs integrity security protection calculation on the NAS SMC message and obtains the NAS MAC. Exemplarily, the calculation input key of the NAS MAC is Knasint, the input parameters are the bearer identifier, the direction parameter, the value of the counter, and the information element in the NAS SMC message to be protected, and the security protection algorithm used is the selected integrity security protection algorithm.

[0182] Among them, the bearer identifier is used to distinguish different bearers. For example, in a 3GPP connection, the bearer identifier can be "0x01", and in a non-3GPP connection, the bearer identifier can be "0x02"; the direction parameter is used to distinguish whether it is an uplink message or a downlink message. For example, in an uplink message, the direction parameter takes a value of 0, and in a downlink message, the direction parameter takes a value of 1; the value of the counter is used as a freshness parameter to prevent replay attacks; the information element in the NAS SMC message to be protected can be a selected EPS security protection algorithm, an international mobile station equipment identity and software version (IMEISV) request indication, etc.;

[0183] It should be noted that the NAS SMC message performs integrity security protection but does not perform confidentiality security protection, because the UE side needs to use the parameters in the message (such as ngKSI, etc.) to obtain the key and algorithm for integrity verification.

[0184] S330, AMF sends a NAS SMC message to the UE.

[0185] The NAS SMC message includes but is not limited to the selected confidentiality security protection algorithm, the selected integrity security protection algorithm, ngKSI, the replayed UE security capability, Kamf change indication, etc. Among them, the selected confidentiality algorithm and the selected integrity security protection algorithm are part of the NAS security context, which are used by the UE and AMF to negotiate the security protection algorithm for subsequent security protection. ngKSI is used to identify Kamf. The replayed security capability is used to verify whether the security capability has been tampered with, that is, to prevent downgrade attacks, and the Kamf change indication is used to instruct the UE to calculate a new Kamf.

[0186] The NAS SMC message includes a "Security Header Type" information element, which is used to indicate the protection mode of the NAS message. When the NAS message is a NAS SMC message, the value of this information element is 0011, which is used to identify the use of 5G NAS security context for integrity security protection;

[0187] It should be noted that the confidentiality security protection algorithm and integrity security protection algorithm carried in the NAS SMC message will subsequently be part of the security context.

[0188] S340, AMF activates confidentiality protection of uplink NAS messages.

[0189] After sending the NAS SMC message, the AMF activates the de-confidentiality protection (e.g., decryption) of the uplink NAS messages.

[0190] S350, the UE verifies the NAS SMC message.

[0191] Exemplarily, the UE obtains the corresponding Knasint according to ngKSI, and performs integrity check according to the integrity security protection algorithm carried in the message. If the integrity check succeeds, the UE activates integrity security protection and confidentiality security protection of the uplink NAS message and decryption operation of the downlink message.

[0192] S360, UE sends a NAS SMP message to AMF.

[0193] If the verification in step S350 is successful, the UE sends a NAS SMP message to the AMF, which is integrity-protected and confidentiality-protected. For example, the integrity-protection key is Knasint, the integrity-protection algorithm is the integrity-protection algorithm selected in step S330, the confidentiality-protection key is Knasenc, and the confidentiality-protection algorithm is the confidentiality-protection algorithm selected in step S330. Among them, NAS MAC is used for integrity-protection. The AMF receives the NAS SMP message, and decrypts and performs integrity verification on the message.

[0194] When the NAS message is a NAS SMP message, the value of this information element is 0100, which is used to identify the use of 5G NAS security context for confidentiality and integrity security protection.

[0195] S370, AMF activates confidentiality protection for NAS downlink messages.

[0196] After receiving the NAS SMP message, the AMF activates confidentiality protection (e.g., encryption) for NAS downstream messages.

[0197] It should be noted that in the existing security mechanism, confidentiality security protection and integrity security protection are independent of each other, that is, the key and algorithm are isolated.

[0198] 6. AS SMC process:

[0199] For example, the AS SMC process is mainly used to negotiate the radio resource control (RRC) and user plane (UP) algorithms and to activate RRC security. The RRC reconfiguration message is mainly used to activate UP security.

[0200] For ease of understanding, combined Figure 4 Introduce the AS SMC process in detail.

[0201] Figure 4 It is a schematic flow chart of the AS SMC process, including the following steps:

[0202] S410: The access network device configures a priority list of algorithms allowed to be used.

[0203] Exemplarily, an AS integrity security protection algorithm priority list is configured on the access network device (e.g., the AS integrity security protection algorithms configured on the access network device include AES integrity security protection algorithm, SNOW integrity security protection algorithm, ZUC integrity security protection algorithm, empty integrity security protection algorithm, etc., wherein the priorities of the configured multiple integrity security protection algorithms are ranked from high to low as AES integrity security protection algorithm, SNOW integrity security protection algorithm, ZUC integrity security protection algorithm, empty integrity security protection algorithm) and an AS confidentiality security protection algorithm priority list (e.g., the AS confidentiality security protection algorithms configured on the access network device include ZUC confidentiality security protection algorithm, AES confidentiality security protection algorithm, SNOW confidentiality security protection algorithm, empty integrity security protection algorithm, wherein the priorities of the configured multiple confidentiality security protection algorithms are ranked from high to low as ZUC confidentiality security protection algorithm, AES confidentiality security protection algorithm, SNOW confidentiality security protection algorithm, empty integrity security protection algorithm).

[0204] The access network device receives the UE security capability and selects the AS integrity security protection algorithm and the AS confidentiality security protection algorithm according to the UE security capability and the algorithm priority list. For example, if the UE security capability includes the supported AS integrity security protection algorithm as the AES integrity security protection algorithm and the SNOW integrity security protection algorithm, the integrity security protection algorithm selected by the access network device is the AES integrity security protection algorithm; for another example, if the UE security capability includes the supported AS confidentiality security protection algorithm as the AES confidentiality security protection algorithm and the ZUC confidentiality security protection algorithm, the confidentiality security protection algorithm selected by the access network device is the ZUC confidentiality security protection algorithm.

[0205] S420, activate RRC integrity security protection.

[0206] Before sending the AS SMC message, the access network device activates RRC integrity security protection.

[0207] Exemplarily, the access network device performs integrity security protection calculation on the AS SMC message and obtains MAC-I. Exemplarily, the calculation input key of AS MAC is Krrcint, the input parameters are the bearer identifier, direction parameter, counter value, etc., and the security protection algorithm used is the selected integrity security protection algorithm.

[0208] Among them, the bearer identifier is used to distinguish different bearers. For example, in a 3GPP connection, the bearer identifier can be "0x01", and in a non-3GPP connection, the bearer identifier can be "0x02"; the direction parameter is used to distinguish whether it is an uplink message or a downlink message. For example, in an uplink message, the direction parameter takes a value of 0, and in a downlink message, the direction parameter takes a value of 1; the value of the counter is used as a freshness parameter to prevent replay attacks.

[0209] It should be noted that only integrity security protection is performed in the AS SMC message, but confidentiality security protection is not performed, because the UE side needs to use the parameters in the message (such as ngKSI, etc.) to obtain the key and algorithm for integrity verification.

[0210] S430, the access network device sends an AS SMC message to the UE.

[0211] The AS SMC message includes but is not limited to the selected confidentiality security protection algorithm and the selected integrity security protection algorithm. The selected confidentiality algorithm and the selected integrity security protection algorithm are part of the AS security context and are used by the UE and the access network device to negotiate the security protection algorithm for subsequent security protection.

[0212] It should be noted that the security protection algorithms for RRC messages and UP messages can be unified, that is, the selected confidentiality security protection algorithm and the selected integrity security protection algorithm are applicable to both the security protection of RRC messages and the security protection of UP messages; the security protection algorithms for RRC messages and UP messages can be independent, that is, the message includes the selected RRC confidentiality security protection algorithm, the selected RRC integrity security protection algorithm, the selected UP confidentiality security protection algorithm, and the selected UP integrity security protection algorithm.

[0213] S440, the access network device activates confidentiality protection of uplink RRC messages.

[0214] After sending the AS SMC message, the access network device activates the de-confidentiality protection (eg, decryption) of the uplink RRC message.

[0215] S450, the UE verifies the AS SMC message.

[0216] Exemplarily, the UE obtains the corresponding Krrcint and performs integrity check according to the integrity security protection algorithm carried in the message. If the integrity check succeeds, the UE activates integrity security protection and confidentiality security protection of the uplink RRC message and decryption operation of the downlink message.

[0217] S460, the UE sends an AS SMP message to the access network device.

[0218] If the verification in step S450 is successful, the UE sends an AS SMP message to the access network device, which is integrity security protected and confidentiality security protected. Exemplarily, the integrity security protection key is Krrcint, the integrity security protection algorithm is the selected integrity security protection algorithm carried by the AS SMC message in step S430, the confidentiality security protection key is Krrcenc, and the confidentiality security protection algorithm is the selected confidentiality security protection algorithm carried in the AS SMC message in step S430.

[0219] S470, the UE activates RRC uplink message confidentiality.

[0220] After sending the AS SMP message, the UE activates RRC uplink message confidentiality protection.

[0221] S480, the access network device activates RRC downlink message confidentiality protection.

[0222] After receiving the AS SMP message, the access network device activates RRC downlink message confidentiality (eg, encryption).

[0223] It should be noted that in the existing security mechanism, confidentiality security protection and integrity security protection are independent of each other, that is, the key and algorithm are isolated.

[0224] In addition, in order to facilitate understanding of the embodiments of the present application, the following points are explained.

[0225] First, in this application, "used for indication" may include being used for direct indication and being used for indirect indication. When describing that a certain indication information is used for indicating A, it may include that the indication information directly indicates A or indirectly indicates A, but it does not mean that A must be included in the indication information.

[0226] The information indicated by the indication information is called the information to be indicated. In the specific implementation process, there are many ways to indicate the information to be indicated. The information to be indicated can be sent as a whole, or divided into multiple sub-information and sent separately, and the sending period and / or sending time of these sub-information can be the same or different. The specific sending method is not limited in this application. Among them, the sending period and / or sending time of these sub-information can be pre-defined, for example, pre-defined according to the protocol, or can be configured by the transmitting end device by sending configuration information to the receiving end device.

[0227] Second, "at least one" shown in the present application refers to one or more, and "multiple" refers to two or more. In addition, in the embodiments of the present application, "first", "second" and various digital numbers (for example, "#1", "#2", etc.) are only for the convenience of description, and are not used to limit the scope of the embodiments of the present application. The size of the sequence number of each process below does not mean the order of execution, and the execution order of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present application. It should be understood that the objects described in this way can be interchanged in appropriate circumstances, so that the schemes other than the embodiments of the present application can be described. In addition, in the embodiments of the present application, the words "510", "520" and the like are only for the convenience of description, and are not to limit the order of execution steps.

[0228] Third, in this application, the words "exemplary" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "exemplary" or "for example" in this application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present the relevant concepts in a specific way.

[0229] Fourth, the "storage" involved in the embodiments of the present application may refer to storage in one or more memories. The one or more memories may be separately set or integrated in an encoder or decoder, a processor, or a communication device. The one or more memories may also be partially separately set and partially integrated in a decoder, a processor, or a communication device. The type of memory may be any form of storage medium, which is not limited by the present application.

[0230] Fifth, the “protocol” involved in the embodiments of the present application may refer to a standard protocol in the communication field, for example, it may include an LTE protocol, an NR protocol, and related protocols used in future communication systems, which is not limited in the present application.

[0231] Sixth, in the embodiments of the present application, "under the circumstances", "when", and "if" can sometimes be used interchangeably. It should be pointed out that when the distinction between them is not emphasized, the meanings they intend to express are the same.

[0232] Seventh, in the embodiments of the present application, various terms and English abbreviations, such as radio resource control (RRC), etc., are illustrative examples given for the convenience of description and should not constitute any limitation to the present application. The present application does not exclude the possibility of defining other terms that can achieve the same or similar functions in existing or future protocols.

[0233] Eighth, the term "and / or" in this article is only a description of the association relationship of the associated objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.

[0234] Combination of the above Figure 1 Briefly introduces the scenarios in which the communication method provided in the embodiments of the present application can be applied, and introduces the basic concepts that may be involved in the embodiments of the present application, and combines the basic concepts with the Figure 3 and Figure 4 Introduced the NASSMC process and AS SMC process. Figure 3 and Figure 4 In the process shown, confidentiality security protection and integrity security protection are based on confidentiality security protection algorithm and integrity security protection algorithm respectively, that is, if the message transmitted between the terminal device and the network device (such as AMF or access network device) is subjected to confidentiality security protection and integrity security protection, it is necessary to be based on confidentiality security protection algorithm and integrity security protection algorithm (such as Figure 3 Step S330 or Figure 4 The algorithms carried in step S430 include a selected confidentiality security protection algorithm and a selected integrity security protection algorithm) to perform confidentiality security protection and integrity security protection respectively.

[0235] In the case where confidentiality security protection and integrity security protection are required, the combination of confidentiality security protection algorithm and integrity security protection algorithm has security risks. For example, the confidentiality security protection algorithm and integrity security protection algorithm are used to perform security protection on messages transmitted between terminal devices and network devices (such as AMF or access network devices), specifically including: firstly perform integrity security protection on the message based on the integrity security protection algorithm, and then use the result of the integrity security protection as the input parameter of the confidentiality security protection algorithm to perform confidentiality security protection on the message. When the result of the integrity security protection is used as the input parameter of the confidentiality security protection, there may be algorithm splicing, which will bring security risks.

[0236] The present application provides a communication method which can be applied in Figure 1 In the communication system shown, confidentiality security protection and integrity security protection are intended to be achieved.

[0237] It should be understood that the embodiments shown below do not particularly limit the specific structure of the execution subject of the method provided in the embodiments of the present application, as long as it is possible to communicate according to the method provided in the embodiments of the present application by running a program that records the code of the method provided in the embodiments of the present application. For example, the execution subject of the method provided in the embodiments of the present application may be a network device, or a functional module in the network device that can call and execute a program.

[0238] Figure 5 It is a schematic flow chart of a communication method provided by the present application. In the communication method, the network device determines a security algorithm that can realize both confidentiality security protection and integrity security protection, and after determining the security algorithm, activates the security algorithm to perform security protection on the uplink message. Since the security algorithm determined by the network device can realize both confidentiality security protection and integrity security protection, the network device can perform integrity verification and decryption based on the same security key when performing security verification on the corresponding uplink message, thereby avoiding the security risks existing in the combination of the confidentiality security protection algorithm and the integrity security protection algorithm. Among them, the combination of the confidentiality security protection algorithm and the integrity security protection algorithm can be understood as: integrity protection or verification based on the integrity security protection algorithm and the key #1 corresponding to the integrity security protection algorithm, and confidentiality protection or decryption based on the confidentiality security protection algorithm and the key #2 corresponding to the confidentiality security protection algorithm, that is, confidentiality security protection and integrity security protection are respectively realized based on different algorithms and different keys.

[0239] For ease of understanding, the security risks of the combination of confidentiality security protection algorithm and integrity security protection algorithm are briefly introduced, including: using confidentiality security protection algorithm and integrity security protection algorithm to perform security protection on messages transmitted between terminal devices and network devices (such as AMF or access network devices), specifically including: firstly perform integrity security protection on the message based on the integrity security protection algorithm, and then use the result of integrity security protection as the input parameter of confidentiality security protection algorithm to perform confidentiality security protection on the message. When the result of integrity security protection is used as the input parameter of confidentiality security protection, there may be algorithm splicing, which brings security risks.

[0240] The following Figure 5 The security algorithm involved in the illustrated embodiment may be the authenticated encryption algorithm introduced above, including a part for confidentiality protection and a part for integrity protection, a security algorithm that can achieve both confidentiality security protection and integrity security protection. For example, the security algorithm is an AEAD algorithm. The security algorithm and the authenticated encryption algorithm in each embodiment of the present application may be described interchangeably.

[0241] The following Figure 5The security key involved in the illustrated embodiment is an input key of the security algorithm, and integrity security protection and confidentiality security protection are performed based on the security key and the security algorithm, or integrity verification and decryption are performed on the received message. The security key is a key shared between the terminal device and the network device, for example, the security key is a key generated during the primary authentication process, or the security key is a key derived from the key generated during the primary authentication process.

[0242] Specifically, the communication method comprises the following steps:

[0243] S510, the network device determines a security algorithm.

[0244] The network device can be Figure 1 The AMF shown in , may also be an access network device. It should be understood that the name of the network device is not limited in this embodiment, and any device that can implement the functions of the network device in this embodiment can be considered as the network device involved in this embodiment.

[0245] As a possible implementation method, the network device is AMF, and the security algorithm determined by the network device in this embodiment is used to provide security protection for NAS messages transmitted between the terminal device and the AMF. For example, the security algorithm is used to provide security protection for the security mode command message, security mode completion message transmitted in the NASSMC process, and NAS messages transmitted after the NAS SMC process.

[0246] As another possible implementation, the network device is an access network device, and the security algorithm determined by the network device in this embodiment is used to provide security protection for AS messages transmitted between the terminal device and the access network device. For example, the security algorithm is used to provide security protection for RRC messages (such as security mode command messages and security mode completion messages) transmitted in the AS SMC process; for another example, the security algorithm is used to provide security protection for user plan (UP) messages transmitted after the AS SMC process.

[0247] It should be noted that, when the network device is an access network device, the security algorithm selected by the network device can provide security protection for both RRC messages and UP messages; or, the security algorithm selected by the network device is the algorithm used for security protection of RRC messages, and the network device selects other integrity security protection algorithms, confidentiality security protection algorithms, or other authentication encryption algorithms for security protection of UP messages. For example, the network device selects multiple algorithms (such as integrity security protection algorithms, confidentiality security protection algorithms, and security algorithms), and can determine the security protection algorithm to be used based on the user plane message security protection requirements.

[0248] It should be understood that this embodiment does not limit whether the network device further determines an algorithm other than the security algorithm.

[0249] In this embodiment, at least one security algorithm is configured on the network device, the priority of the at least one security algorithm is different, and each security algorithm can implement both confidentiality security protection and integrity security protection. Among them, the algorithm list that includes the at least one security algorithm and can characterize the priority relationship of the at least one security algorithm is called the first algorithm priority list.

[0250] As an example but not limitation, the first algorithm priority list configured on the network device includes AES AEAD algorithm, SNOW AEAD algorithm, ZUC AEAD algorithm and null algorithm, etc., wherein the priorities of the configured multiple authentication encryption algorithms are ranked from high to low as AES AEAD algorithm, SNOW AEAD algorithm, ZUC AEAD algorithm and null algorithm.

[0251] Exemplarily, the integrity security protection algorithm priority list and confidentiality security protection algorithm priority list configured on the network device in this embodiment can be compatible with the integrity security protection algorithm priority list and confidentiality security protection algorithm priority list configured on the network device in the existing mechanism.

[0252] For example, in this embodiment, in addition to the above-mentioned first algorithm priority list, the network device is also configured with an integrity security protection algorithm priority list and a confidentiality security protection algorithm priority list.

[0253] Among them, the priority list of integrity security protection algorithms includes: AES integrity security protection algorithm, SNOW integrity security protection algorithm, ZUC integrity security protection algorithm, empty integrity security protection algorithm, etc. The priority from high to low is: AES integrity security protection algorithm, SNOW integrity security protection algorithm, ZUC integrity security protection algorithm, empty integrity security protection algorithm.

[0254] The priority list of confidentiality security protection algorithms includes: ZUC confidentiality security protection algorithm, AES confidentiality security protection algorithm, SNOW confidentiality security protection algorithm, null integrity security protection algorithm, etc. The priority from high to low is: ZUC confidentiality security protection algorithm, AES confidentiality security protection algorithm, SNOW confidentiality security protection algorithm, null integrity security protection algorithm.

[0255] Optionally, when the network device is configured with the above-mentioned first algorithm priority list, and is compatible with the existing mechanism and is configured with an integrity security protection algorithm priority list and a confidentiality security protection algorithm priority list, the network device may also be configured with an algorithm selection policy, which is used to indicate the principles for selecting algorithms.

[0256] As a possible implementation method, the network device selects a security algorithm as follows: the network device selects a security algorithm based on UE security capabilities, an algorithm priority list (e.g., a first algorithm priority list, an integrity security protection algorithm priority list and / or a confidentiality security protection algorithm priority list), and / or an algorithm selection policy.

[0257] For example, the algorithm selection policy is configured on the network device, and the algorithm selection policy may be to give priority to the algorithms in the first algorithm priority list. That is, when both the UE and the network device support the same security algorithm (e.g., AEAD algorithm), the security algorithm is selected according to the first algorithm priority list, otherwise the integrity security protection algorithm and the confidentiality security protection algorithm are selected according to the integrity security protection algorithm priority list and the confidentiality security protection algorithm priority list.

[0258] For example, the algorithm selection strategy may also be to give priority to the integrity security protection algorithm and the confidentiality security protection algorithm, that is, when both the UE and the network device support the same integrity security protection algorithm, the integrity security protection algorithm is selected for security protection according to the integrity security protection algorithm priority list; and / or, when both the UE and the network device support the same confidentiality security protection algorithm, the confidentiality security protection algorithm is selected for security protection according to the confidentiality security protection algorithm priority list.

[0259] As another possible implementation manner, the network device may select a security algorithm by: the network device selects a security algorithm according to whether there is a first algorithm priority list locally.

[0260] For example, when a first algorithm priority list, an integrity security protection algorithm priority list, and a confidentiality security protection algorithm priority list are configured on a network device, the network device preferentially selects a security algorithm from the first algorithm priority list according to the UE security capability.

[0261] For example, when an integrity security protection algorithm priority list and a confidentiality security protection algorithm priority list are configured on a network device, and a first algorithm priority list is not configured, the network device selects a security algorithm based on the UE security capabilities, the integrity security protection algorithm priority list, and the confidentiality security protection algorithm priority list.

[0262] It should be understood that the above two possible implementations are just examples of how the network device determines a security algorithm. The network device can also randomly select a security algorithm; for example, the network device can determine the security algorithm based on historical communication data. Examples are not given here one by one.

[0263] In addition, in this embodiment, the network device determines the security algorithm, and further includes: selecting an integrity security protection algorithm and / or a confidentiality security protection algorithm, and determining the security algorithm based on the selected integrity security protection algorithm and / or confidentiality security protection algorithm. Specifically, the method of determining the security algorithm based on the integrity security protection algorithm has been described in the foregoing text, and will not be described in detail here; the method of determining the security algorithm based on the confidentiality security protection algorithm has also been described in the foregoing text, and will not be described in detail here.

[0264] Exemplarily, in this embodiment, before the network device determines the security algorithm, it determines that the trigger condition is met. It can be understood that: the network device selects the security algorithm when the trigger condition is met. The trigger condition includes but is not limited to: after the main authentication is completed, the network device determines to initiate the security mode command process; or the scenario in which the network device changes; or the network device determines to change the uplink count value, etc.

[0265] As can be seen from the above, the security algorithm determined by the network device in this embodiment can be an authentication encryption algorithm that can achieve both confidentiality security protection and integrity security protection; or it can also be a confidentiality security protection algorithm and an integrity security protection algorithm; or it can also be an authentication encryption algorithm, a confidentiality security protection algorithm, and an integrity security protection algorithm. This embodiment is described below by taking the security algorithm determined by the network device as an example.

[0266] S520, the network device activates security protection between the network device and the terminal device based on the security algorithm and the security key.

[0267] Specifically, the network device activates security protection between the network device and the terminal device based on the security algorithm and the security key, including: the network device configures the security algorithm and the security key corresponding to the security algorithm.

[0268] S521, the terminal device activates security protection between the network device and the terminal device based on the security algorithm and the security key.

[0269] Specifically, the terminal device activates security protection between the network device and the terminal device based on the security algorithm and the security key, including: the terminal device configures the security algorithm and the security key corresponding to the security algorithm.

[0270] In this embodiment, there is no limitation on the sequence between S520 and S521; the network device may first activate the security protection between the network device and the terminal device based on the security algorithm and the security key, or the terminal device may first activate the security protection between the network device and the terminal device based on the security algorithm and the security key.

[0271] After the terminal device activates the security protection between the network device and the terminal device based on the security algorithm and the security key, the terminal device can perform security protection on the uplink message to be sent based on the security algorithm, obtain the securely protected uplink message and send it to the network device; after the network device activates the security protection between the network device and the terminal device based on the security algorithm and the security key, the network device can perform integrity verification and decryption on the received securely protected uplink message based on the security algorithm. Figure 5 The method flow shown also includes:

[0272] S530, the network device receives a security protection uplink message from the terminal device.

[0273] Exemplarily, the security-protected uplink messages in this embodiment include, but are not limited to: NAS messages, RRC messages, or UP messages.

[0274] S540, the network device performs integrity verification and decryption on the security-protected uplink message.

[0275] Specifically, since the network device activates security protection between the network device and the terminal device based on the security algorithm and the security key, the network device uses the security key as the input key of the integrity protection part in the security algorithm to verify the integrity of the uplink message, and uses the security key as the input key of the confidentiality protection part in the security algorithm to decrypt the uplink message.

[0276] It should be understood that the use of the security key as the input key of the integrity protection part in the security algorithm described in this embodiment represents that the security key is not a derived key, but an input key of the integrity protection part; similarly, the use of the security key as the input key of the confidentiality protection part in the security algorithm described in this embodiment represents that the security key is not a derived key, but an input key of the confidentiality protection part.

[0277] Exemplarily, the network device uses the security key as an input key of the integrity protection part in the security algorithm to verify the integrity of the uplink message, including: the network device can perform integrity verification on the uplink message according to the plaintext parameters carried in the uplink message.

[0278] The network device uses the security key as the input key of the confidentiality protection part in the security algorithm to decrypt the uplink message, including: the network device uses the security key as the input key of the confidentiality protection part in the security algorithm to decrypt the ciphertext carried in the uplink message.

[0279] For ease of understanding, the security algorithm is taken as an example of the AEAD algorithm, and the network device obtains the corresponding security key (ie, the AEAD key) according to the security algorithm. In addition, the network device uses the plaintext parameter (AAD), ciphertext, and AEAD key carried in the uplink message as the input of the integrity protection part of the AEAD algorithm to obtain the MAC value, and determines whether the MAC is consistent with the MAC value carried in the uplink message to determine whether the MAC value carried in the uplink message is correct.

[0280] When the integrity check succeeds (that is, the MAC value carried in the uplink message is correct), the network device uses the security key and the security algorithm to decrypt the ciphertext carried in the uplink message.

[0281] Exemplarily, the security protection uplink message in this embodiment is a security protection uplink message transmitted after the network device sends a security mode command message to the terminal device. For example, the security protection uplink message can be a security mode response message (such as a security mode completion message).

[0282] The SMC process between network devices and terminal devices may be performed in the following ways:

[0283] Method 1: The security mode command message sent by the network device to the terminal device is protected based on the determined security algorithm.

[0284] In the case shown in method 1, the network device performs security protection on the security mode command message to be sent based on the security algorithm, and the security mode command message to be sent includes a first parameter and a second parameter. The network device sends a securely protected security mode command message to the terminal device, and the securely protected security mode command message includes a first ciphertext, a first message authentication code MAC, and a first parameter, wherein the first ciphertext is obtained by performing confidentiality protection (such as encryption) on the second parameter based on the security algorithm, and the first MAC is calculated by performing integrity protection on the first parameter and the first ciphertext based on the security algorithm. The specific contents of the first ciphertext, the first message authentication code MAC, the first parameter, and the second parameter can be found in Figure 6 The embodiment shown.

[0285] Accordingly, after receiving the secure mode command message of security protection, the terminal device performs integrity verification and decryption on the secure mode command message of security protection based on the security algorithm. Specifically, the terminal device uses the security key as the input key of the integrity protection part in the security algorithm to perform integrity verification on the secure mode command message of security protection, and uses the security key as the input key of the confidentiality protection part in the security algorithm to decrypt the secure mode command message of security protection.

[0286] For ease of understanding, the following will be combined Figure 6 In the case shown in method 1, the SMC process executed between the network device and the terminal device is described in detail and will not be described in detail here.

[0287] Method 2: The security mode command message sent by the network device to the terminal device is integrity protected based on the integrity protection part of the determined security algorithm, or the security mode command message sent by the network device to the terminal device is integrity protected based on a first integrity security protection algorithm further determined based on the determined security algorithm.

[0288] In the case shown in the second mode, the network device uses the security key as the input key of the integrity protection part to perform integrity protection on the security mode command message to be sent; or the network device determines the first integrity security protection algorithm according to the security algorithm, and performs integrity protection on the security mode command message to be sent based on the first integrity security protection algorithm. The network device sends the integrity-protected security mode command message to the terminal device, and the integrity-protected security mode command message includes an identifier of the security algorithm.

[0289] Accordingly, after receiving the integrity-protected security mode command message, the terminal device performs integrity verification and decryption on the integrity-protected security mode command message based on the integrity-protected part in the security algorithm. Specifically, the security key is used as the input key of the integrity-protected part in the security algorithm to perform integrity verification on the integrity-protected security mode command message. Or,

[0290] After receiving the integrity-protected security mode command message, the terminal device determines a first integrity security protection algorithm, and performs integrity verification and decryption on the integrity-protected security mode command message based on the first integrity security protection algorithm. Specifically, the security key is used as an input key of the first integrity security protection algorithm to perform integrity verification on the integrity-protected security mode command message.

[0291] For ease of understanding, the following will be combined Figure 8In the case shown in method 1, the SMC process executed between the network device and the terminal device is described in detail and will not be described in detail here.

[0292] Mode 3: The security mode command message sent by the network device to the terminal device is integrity protected based on the second integrity security protection algorithm. In the case shown in Mode 3, the network device can determine the second integrity security protection algorithm and the security algorithm.

[0293] In the case shown in mode 3, the network device determines the second integrity security protection algorithm, and performs integrity protection on the security mode command message to be sent based on the second integrity security protection algorithm. The network device sends an integrity-protected security mode command message to the terminal device, and the integrity-protected security mode command message includes an identifier of the security algorithm and an identifier of the second integrity security protection algorithm.

[0294] Correspondingly, after receiving the integrity-protected security mode command message, the terminal device performs integrity verification on the integrity-protected security mode command message based on the second integrity security protection algorithm.

[0295] For ease of understanding, the following will be combined Figure 7 In the case shown in method three, the SMC process executed between the network device and the terminal device is described in detail and will not be described in detail here.

[0296] Mode 4: The security mode command message sent by the network device to the terminal device is integrity protected based on the third integrity security protection algorithm. In the case shown in Mode 4, the above security algorithm is determined based on the third integrity security protection algorithm.

[0297] In the case shown in mode 4, the network device determines the third integrity security protection algorithm, and performs integrity protection on the security mode command message to be sent based on the third integrity security protection algorithm. The network device sends an integrity-protected security mode command message to the terminal device, and the integrity-protected security mode command message includes an identifier of the third integrity security protection algorithm and second indication information, and the second indication information is used to indicate that the message transmitted after the security mode command message is security-protected based on the security algorithm.

[0298] Correspondingly, after receiving the integrity-protected security mode command message, the terminal device performs integrity verification on the integrity-protected security mode command message based on the third integrity security protection algorithm, and further determines a security algorithm based on the third integrity security protection algorithm based on the second indication information, and the uplink message to be sent is security protected based on the security algorithm.

[0299] For ease of understanding, the following will be combined Fig. 9In the case shown in method 4, the SMC process executed between the network device and the terminal device is described in detail and will not be described in detail here.

[0300] Figure 6 It is a schematic flow chart of another communication method provided by the present application. In this communication method, the network device determines a security algorithm that can realize both confidentiality security protection and integrity security protection, and after determining the security algorithm, activates the security algorithm to perform security protection on the downlink message. The downlink message includes a security mode command message, so that certain parameters in the security mode command message can be transmitted through the security mode command message under confidentiality protection, thereby improving security. In addition, the network device and the terminal device can negotiate to use the security algorithm to perform security protection on the message to be transmitted (such as the security mode command message, the message to be transmitted after the security mode command message), avoiding the security risks of the combination of the confidentiality security protection algorithm and the integrity security protection algorithm. For example, in this scheme, when performing confidentiality security protection and integrity security protection on the message, there is no need to perform security protection based on the confidentiality security protection algorithm and the integrity security protection algorithm respectively. The confidentiality security protection and integrity security protection of the message are both performed based on the security algorithm, avoiding the splicing between different algorithms, thereby avoiding the security risks of the combination of the confidentiality security protection algorithm and the integrity security protection algorithm.

[0301] If the network device performs confidentiality and integrity security protection based on the security algorithm, the security mode command message sent by the network device carries a first ciphertext obtained by performing confidentiality based on the security algorithm, and a first MAC obtained by performing integrity security protection based on the authentication encryption algorithm.

[0302] The first ciphertext involved in the following embodiments is a ciphertext obtained based on the confidentiality of the security algorithm.

[0303] Specifically, the first ciphertext is a ciphertext obtained by partially protecting the confidentiality of the algorithm confidentiality of the security algorithm. The parameter in the security mode command message that is protected by the confidentiality of the security algorithm is called the second parameter, that is, the first ciphertext is a ciphertext obtained after protecting the confidentiality of the second parameter based on the security algorithm. The second parameter can also be called the input parameter of the part protected by the algorithm confidentiality of the security algorithm, or the parameter to be protected based on the confidentiality of the security algorithm, etc.

[0304] It should be understood that the second parameter may be a parameter with high security requirements in the security mode command message. The confidentiality of the second parameter is protected (eg, encrypted) based on a security algorithm, thereby improving the security of the second parameter transmission.

[0305] Specifically, the second parameter includes one or more of the following: EPS security algorithm, international mobile station equipment identity, or software version IMEISV request indication and other information.

[0306] Optionally, if the security mode command message independently carries the security protection algorithm corresponding to the RRC message and the security protection algorithm corresponding to the user plane message, the security protection algorithm corresponding to the user plane message can also be used as a parameter for confidentiality protection based on the security algorithm in the security mode command message, that is, the second parameter can also include the identifier of the security protection algorithm corresponding to the user plane message. For example, the security protection algorithm corresponding to the user plane message selected by the network device includes a confidentiality security protection algorithm and an integrity security protection algorithm, then the second parameter can also include the identifier of the confidentiality security protection algorithm corresponding to the user plane message and the identifier of the integrity security protection algorithm. Among them, the security protection algorithm corresponding to the user plane message can also be called the security protection algorithm corresponding to the user plane; similarly, the security protection algorithm corresponding to the RRC message can also be called the security protection algorithm corresponding to the RRC.

[0307] It should be understood that Figure 2 In the AEAD algorithm shown, the second parameter is input as the plaintext part to the confidentiality protection part of the algorithm, so that the output ciphertext is the first ciphertext.

[0308] The first MAC involved in the following embodiments is obtained by performing integrity security protection based on a security algorithm.

[0309] Specifically, the first MAC is obtained by performing integrity security protection on the first parameter and the first ciphertext based on the security algorithm. The first parameter refers to a parameter for integrity security protection in the security mode command message, or a parameter for which confidentiality is not performed in the security mode command message. The first parameter is specifically a parameter to be integrity-protected based on the security algorithm, and can also be referred to as an input parameter of the algorithm integrity security protection part of the security algorithm other than the first ciphertext.

[0310] It should be understood that the first parameter is a parameter required by the terminal device for security verification. Therefore, the first parameter is carried in the security mode command message in plain text and transmitted to the terminal device, so that the terminal device can perform security verification on the security mode command message based on the first parameter. Performing integrity security protection on the first parameter without performing confidentiality security protection can improve security while ensuring that the terminal device can obtain sufficient information for security verification.

[0311] The first parameter includes one or more of the following: an identifier of a security algorithm, security capability information of a replayed terminal device, first key change indication information, or a key identifier of the first key, etc. The first key is used to determine the security key, for example, the first key is the above security key or the first key is used to derive the above security key.

[0312] Exemplarily, the parameters specifically included in the first parameter may be agreed upon in advance by the terminal device and the network element. For example, the first parameter may be pre-configured in advance through a standard or protocol to include an identifier of a security algorithm and first key change indication information.

[0313] Security algorithm identification: used to identify the algorithm for security protection. After receiving the security algorithm identification, the terminal device selects the corresponding security algorithm and performs security verification of the security mode command message, including integrity verification and decryption.

[0314] Replayed terminal device security capability information: used by the terminal device to discover whether the terminal device's security capability has been tampered with. Exemplarily, the terminal device compares whether the terminal device's security capability information sent by itself and the received replayed terminal device's security capability information are consistent. If they are consistent, the terminal device determines that the received message has not been tampered with; if they are inconsistent, the terminal device determines that the received message has been tampered with. The terminal device may subsequently choose to reselect a cell or re-initiate the registration process, and this application does not impose any restrictions on this.

[0315] Key identifier of the first key: used to identify the first key generated by the main authentication process. Exemplarily, it is used to identify Kamf, and the terminal device searches for the corresponding Kamf according to the received ngKSI. Among them, the key generated by the main authentication process is kept as part of the security context, such as the first key is the NAS key in the NAS security context.

[0316] First key change indication information: used to indicate that a new key needs to be calculated. Exemplarily, the Kamf change indication is used to indicate that a new Kamf needs to be calculated.

[0317] Optionally, if the security mode command message independently carries the security protection algorithm corresponding to the RRC message and the security protection algorithm corresponding to the user plane message, the security protection algorithm corresponding to the user plane message can also be used as a parameter for integrity security protection in the security mode command message, that is, the first parameter can also include an identifier of the security protection algorithm corresponding to the user plane message. For example, if the security protection algorithm corresponding to the user plane message selected by the network device includes a confidentiality security protection algorithm and an integrity security protection algorithm, then the first parameter also includes an identifier of the confidentiality security protection algorithm and an identifier of the integrity security protection algorithm corresponding to the user plane message.

[0318] It should be understood that Figure 2 In the AEAD algorithm shown, the first parameter is input as the AAD part into the integrity security protection part of the algorithm, and the first ciphertext is also input into the integrity security protection part, thereby outputting the first MAC.

[0319] Specifically, the communication method comprises the following steps:

[0320] S610, the network device determines a security algorithm.

[0321] In this embodiment, since the network device can perform security protection on the security mode command message to be sent based on the determined security algorithm, the network device can determine the security algorithm before sending the security mode command message in this embodiment. The specific method for determining the security algorithm can refer to the above Figure 5 The description of step S510 in the illustrated embodiment will not be repeated here.

[0322] S620: The network device activates security protection between the network device and the terminal device based on the security algorithm and the security key.

[0323] In this embodiment, the network device activates the security protection between the network device and the terminal device based on the security algorithm and the security key. Figure 5 The description of step S520 in the illustrated embodiment will not be repeated here.

[0324] Specifically, in this embodiment, the network device activates security protection between the network device and the terminal device, and obtains a first ciphertext for confidentiality protection and a first message authentication code MAC for integrity security protection based on a security algorithm.

[0325] Exemplarily, the network device obtains a first ciphertext with confidentiality protection based on a security algorithm, including: the network device uses a security key as an input key of the confidentiality protection part in the security algorithm to perform confidentiality protection on a second parameter to obtain the first ciphertext. The second parameter is an input parameter of the confidentiality protection part of the security algorithm, and the second parameter can be a parameter with high security requirements in the security mode command message. The security key can be a key generated for the main authentication process. The description of the second parameter and the security key can refer to the description above, which will not be repeated here.

[0326] For example, if the security algorithm is an AEAD algorithm, the second parameter is the plaintext input to the confidentiality-protected part of the AEAD algorithm, the security key is the AEAD key, and the first ciphertext is the output of the confidentiality-protected part of the AEAD algorithm.

[0327] Exemplarily, the network device obtains a first MAC for integrity security protection based on a security algorithm, including: the network device uses a security key as an input key of the integrity protection part of the security algorithm to perform integrity check on a first parameter and a first ciphertext to obtain the first MAC. The first parameter is an input parameter of the integrity security protection part of the security algorithm, and the first parameter may be a parameter for integrity security protection in a security mode command message.

[0328] For example, if the security algorithm is an AEAD algorithm, the second parameter is the plaintext input to the confidentiality protection part of the AEAD algorithm, the first parameter is the AAD input to the integrity security protection part of the AEAD algorithm, the security key is the AEAD key, the first ciphertext is the output of the confidentiality protection part of the AEAD algorithm, and the first ciphertext is also the input to the integrity protection part of the AEAD algorithm, and the first MAC is the output of the integrity protection part of the AEAD algorithm.

[0329] S630: The network device sends a security mode command message to the terminal device.

[0330] The security mode command message involved in this embodiment is a security mode command message based on security algorithm security protection. For the convenience of description, the security mode command message with security protection is referred to as the security mode command message in this embodiment.

[0331] Specifically, the security mode command message carries a first ciphertext, a first MAC, and a first parameter.

[0332] As a possible implementation, if the network device is AMF, the security mode command message is NAS SMC. Exemplarily, if the security mode command message is NAS SMC, the first parameter carried in the NAS SMC may be information such as ngKSI, replayed UE security capabilities, and Kamf change indication. Among them, ngKSI is understood as the key identifier of the first key in the first parameter, the replayed UE security capabilities are understood as the security capability information of the replayed terminal device in the first parameter, and the Kamf change indication is understood as the first key change indication information in the first parameter.

[0333] As another possible implementation manner, if the network device is an access network device, the security mode command message is AS SMC.

[0334] In this implementation, if the security protection algorithms of the RRC message and the UP message are independent, that is, the AS SMC includes the security protection algorithm corresponding to the selected RRC message and the security protection algorithm corresponding to the selected UP message.

[0335] For example, the security protection algorithms selected by the access network device for protecting the UP message are an integrity security protection algorithm and a confidentiality security protection algorithm. The identifier of the integrity security protection algorithm and the identifier of the confidentiality security protection algorithm corresponding to the UP message can be carried in the AS SMC as part of the first ciphertext, or the identifier of the integrity security protection algorithm and the identifier of the confidentiality security protection algorithm corresponding to the UP message can be carried in the AS SMC as part of the first parameter.

[0336] Optionally, the security mode command message header carries a first header type indication, and the first header type indication is used to indicate that the security mode command message is securely protected based on an authenticated encryption algorithm (e.g., an AEAD algorithm). Exemplarily, the first header type indication can reuse an existing header type indication information field (e.g., a security header type information element in a NAS message), but selects other values, such as 0101; the first header type can also be additional indication information, using additional bits for indication.

[0337] Optionally, the security mode command message header carries first indication information, and the first indication information is used to indicate the length of the first parameter and / or to indicate the position of the first parameter in the security mode command message. The first indication information may also be used as a part of the above-mentioned first parameter.

[0338] For example, the length of the first parameter is 16 bits, bits 1 to 16 in the security mode command message payload are the first parameter, and the value after bit 16 is the first ciphertext and the first MAC part.

[0339] Optionally, after sending the security mode command message, the network device may activate security protection based on a security algorithm for uplink messages, wherein the uplink messages include messages received from the terminal device, and the security protection based on the security algorithm for uplink messages includes decrypting and integrity checking the received uplink messages based on the security algorithm.

[0340] S640, the terminal device verifies the security mode command message.

[0341] After receiving the security mode command message, the terminal device can perform security verification on the security mode command message according to the first parameter carried in the security mode command message, wherein the security verification includes but is not limited to: integrity verification, decryption, and / or anti-replay verification.

[0342] Exemplarily, the first parameter includes an identifier of a security algorithm, and the terminal device performs a security check on the security mode command message according to the first parameter, including: the terminal device performs a security check on the security mode command message according to the security algorithm.

[0343] Specifically, the terminal device performs security verification on the security mode command message according to the security algorithm, including: the terminal device performs integrity verification and decryption on the security mode command message according to the security algorithm.

[0344] For ease of understanding, the security algorithm is an AEAD algorithm as an example for explanation, and the terminal device obtains the corresponding security key (ie, AEAD key) according to the security algorithm. In addition, the terminal device uses the first parameter (AAD), the first ciphertext, and the AEAD key as inputs of the integrity protection part of the AEAD algorithm to obtain a MAC value, and determines whether the first MAC is consistent with the MAC to determine whether the first MAC is correct.

[0345] When the integrity check succeeds (that is, the first MAC is correct), the terminal device decrypts the first ciphertext using the security key and the security algorithm.

[0346] Optionally, the first parameter also includes a key identifier of the first key, and the terminal device can determine the first key according to the key identifier of the first key, and the first key can be the above-mentioned security key, and perform integrity verification and decryption on the security mode command message based on the security key and the security algorithm. The specific integrity verification and decryption methods can refer to the above description, which will not be repeated here.

[0347] Optionally, the first parameter also includes first key change indication information, and the terminal device can determine to perform key derivation according to the first key change indication information. Specifically, after the terminal device determines the first key, it performs key derivation on the first key to obtain a security key, and performs integrity verification and decryption on the security mode command message based on the security key and the security algorithm. The specific integrity verification and decryption methods can refer to the above description, which will not be repeated here.

[0348] Optionally, the first parameter also includes the security capability information of the replayed terminal device. In addition to performing integrity verification and decryption on the security mode command message according to the security algorithm, the terminal device can compare the security capability information of the terminal device sent by itself with the security capability information of the replayed terminal device received to see if they are consistent. If they are consistent, the terminal device determines that the received message has not been tampered with; if they are inconsistent, the terminal device determines that the received message has been tampered with.

[0349] Exemplarily, when the terminal device security check succeeds (e.g., the integrity check succeeds, or both the integrity check and decryption succeed), the terminal device saves the security context, which includes the security algorithm, that is, the security algorithm is part of the security context.

[0350] It should be noted that if the network device is AMF, the security context saved by the terminal device is the NAS security context; if the network device is an access network device, the security context saved by the terminal device is the AS security context.

[0351] As described above, it can be seen that if the network device is an access network device, and the RRC message and the UP message can use different security protection algorithms, in this case, the AS security context saved by the terminal device includes both the security protection algorithm corresponding to the RRC message (i.e., the security algorithm), and the security protection algorithm corresponding to the UP message (the security protection algorithm selected by the access network device for the UP message, such as a confidentiality security protection algorithm and / or an integrity security protection algorithm, etc.), that is, when the network device is an access network device, the AS security context saved by the terminal device includes the RRC security context and the UP security context.

[0352] Exemplarily, when the security mode command message carries a first packet header type indication, the terminal device can determine whether to use a security algorithm based on the first packet header type indication.

[0353] For example, when the security mode command message header includes a first packet header type indication and the security algorithm carried in the security mode command message is a security algorithm, the terminal device determines to use the security algorithm for security verification and security protection of subsequent messages.

[0354] For another example, when the security mode command message header includes a first header type indication and the security algorithm carried in the security mode command message is not an authentication encryption algorithm, the terminal device discards the full mode command message.

[0355] Exemplarily, when the security mode command message carries the first indication information, the terminal device may obtain the first parameter from the security mode command message according to the first indication information.

[0356] If the security check succeeds in step S640, the terminal device activates the integrity security protection and confidentiality security protection of the uplink message based on the security algorithm. The uplink message includes the message sent to the network device, and the security protection of the uplink message based on the security algorithm includes confidentiality and integrity security protection of the uplink message to be sent based on the security algorithm.

[0357] Optionally, the terminal device may also send a security mode response message to the network device. The security mode response message includes a security mode completion message or a security mode failure message.

[0358] S650, the terminal device sends a security mode response message to the network device.

[0359] The security mode command message involved in this embodiment is a security mode response message based on security algorithm security protection. For the convenience of description, the security mode response message with security protection is referred to as the security mode response message in this embodiment.

[0360] If the security check succeeds in step S640, the terminal device sends a security mode completion message to the network device.

[0361] If the security check fails in step S640, the terminal device sends a security mode failure message to the network device.

[0362] Exemplarily, the terminal device performs integrity security protection and confidentiality security protection on the information elements in the security mode response message based on the security algorithm. For example, based on the security algorithm, the terminal device performs confidentiality protection on some information elements in the security mode response message to obtain a second ciphertext, and based on the security algorithm, the terminal device performs integrity security protection on some information elements in the security mode response message to obtain a second MAC.

[0363] In this embodiment, the second MAC is obtained by performing integrity security protection on the first parameter and the first ciphertext based on the security algorithm. The description of the first parameter can refer to the previous text and will not be repeated here. The second ciphertext is the ciphertext obtained for the confidentiality of the second parameter based on the algorithm confidentiality part of the security algorithm. The description of the second parameter can refer to the previous text and will not be repeated here.

[0364] Then the terminal device sends a security mode response message to the network device, where the security mode response message carries the second MAC and the second ciphertext.

[0365] Optionally, the security mode response message header carries a second packet header type indication, and the second packet header type indication is used to indicate that the security mode response message is securely protected based on an authenticated encryption algorithm (eg, an AEAD algorithm).

[0366] Exemplarily, the network device receives a security mode response message, and the network device performs integrity verification and decryption on information elements in the security mode response message based on a security algorithm.

[0367] S660, the network device verifies the security mode response message.

[0368] The specific security verification method can refer to the method in the above step S540 regarding the network device performing integrity verification and decryption on the uplink message, which will not be repeated here.

[0369] As described above, in this embodiment, the network device activates the security protection of the uplink message after sending the security mode command message. In addition, in this embodiment, the network device activates the security protection of the uplink message after receiving the security mode response message. For example, when the network device receives the security mode completion message of the terminal device, the security protection of the uplink message based on the security algorithm can be activated. Among them, the uplink message includes a message received from the terminal device (such as a security mode response message), and the security protection of the uplink message based on the security algorithm includes decrypting and integrity checking the received uplink message based on the security algorithm.

[0370] The present application also provides another communication method, in which a network device can select a second integrity security protection algorithm and a security algorithm that can achieve both confidentiality security protection and integrity security protection, wherein the second integrity security protection algorithm is used to perform integrity security protection on a security mode command message to be transmitted, and the security algorithm is used to achieve confidentiality and integrity security protection for a message transmitted after the security mode command message.

[0371] In this communication method, after the network device selects the security algorithm, it does not immediately activate the security algorithm, but carries the identifier of the security algorithm in the security mode command message, so that the network device and the terminal device can negotiate the security protection method of the message transmitted after the security mode command message through the identifier of the security algorithm carried in the security mode command message. In this communication method, the subsequent messages transmitted between the network device and the terminal device are protected by the security algorithm, avoiding the security risks of the combination of the confidentiality security protection algorithm and the integrity security protection algorithm.

[0372] Combine the following Figure 7 This communication method is described in detail. Figure 7 It is a schematic flow chart of another communication method provided by the present application. It includes the following steps:

[0373] S710, the network device selects a security algorithm and a second integrity security protection algorithm.

[0374] In this embodiment, the first algorithm priority list, the integrity security protection algorithm priority list, and the confidentiality security protection algorithm priority list configured locally by the network device can refer to the above Figure 5 The description of the algorithm priority list locally configured by the network device in step S510 of the communication method shown is not repeated here.

[0375] The difference from the above step S510 is that in the process of selecting a security algorithm, the network device in this embodiment not only selects a security algorithm that can achieve both confidentiality security protection and integrity security protection, but also selects a second integrity security protection algorithm.

[0376] For example, the network device not only obtains a security algorithm according to the security algorithm selection logic shown in the above step S510, but also selects an integrity security protection algorithm according to the security capability information of the terminal device.

[0377] It should be understood that this embodiment does not limit how the network device selects the second integrity security protection algorithm. Reference may be made to the method for selecting the integrity security protection algorithm by the network device in the prior art, which will not be repeated here.

[0378] It should also be understood that the second integrity security protection algorithm selected by the network device in this embodiment is used for security protection of the security mode command message, and the security algorithm is used for integrity security protection and confidentiality security protection of subsequent messages of the security mode command message.

[0379] S720: The network device activates security protection based on a second integrity security protection algorithm.

[0380] Specifically, the network device activates security protection for downlink messages based on the second integrity security protection algorithm, and temporarily does not activate security protection for downlink messages based on the security algorithm.

[0381] Specifically, the network device activates security protection based on the second integrity security protection algorithm, including: configuring the second integrity security protection algorithm and a key corresponding to the second integrity security protection algorithm.

[0382] Further, the network device obtains a fourth MAC for integrity security protection based on the second integrity security protection algorithm. For example, the network device performs integrity security protection on part or all of the information elements in the security mode command message.

[0383] For example, if the network device is AMF, the description of step S720 can refer to the above Figure 3 The description of step S320 in the communication method shown is not repeated here.

[0384] For example, if the network device is an access network device, the description of step S720 can refer to the above Figure 4 The description of step S420 in the communication method shown is not repeated here.

[0385] S730: The network device sends a security mode command message to the terminal device.

[0386] The security mode command message involved in this embodiment is a security mode command message with integrity protection based on the second integrity security protection algorithm. For the convenience of description, the security mode command message with integrity protection in this embodiment is referred to as the security mode command message.

[0387] Optionally, if the network device is AMF, the security mode command message is NAS SMC.

[0388] Optionally, if the network device is an access network device, the security mode command message is AS SMC.

[0389] The security mode command message includes an identifier of a security algorithm, an identifier of a second integrity security protection algorithm, and a fourth MAC.

[0390] It should be noted that the identifier of the security algorithm carried in the security mode command message will subsequently be used as part of the security context, and the second integrity security protection algorithm is used to protect the security mode command message, that is, the second integrity security protection algorithm is a temporary security context or is not part of the security context.

[0391] Exemplarily, if the network device is an AMF, the information included in the security mode command message, in addition to the information of the security algorithm identifier, can refer to the above Figure 3 The description of the information included in the NAS SMC message in step S330 in the communication method shown is not repeated here.

[0392] Exemplarily, if the network device is an access network device, the information included in the security mode command message, in addition to the above-mentioned security algorithm identifier, can refer to the above-mentioned Figure 4 Description of the information included in the AS SMC message in step S430 of the communication method shown. For example, if the security protection algorithms corresponding to the RRC message and the UP message are shared, the AS SMC may carry an identifier of the security algorithm and an identifier of the second integrity security protection algorithm. For another example, if the security protection algorithms of the RRC message and the UP message are independent, the AS SMC includes an identifier of the second integrity security protection algorithm and an identifier of the security algorithm corresponding to the RRC message, and the AS SMC also includes an identifier of the confidentiality security protection algorithm corresponding to the UP message, an identifier of the integrity security protection algorithm corresponding to the UP message, or an identifier of the authentication encryption algorithm corresponding to the UP message.

[0393] Optionally, the security mode command message also includes a third parameter required for the terminal device to perform integrity verification. The third parameter refers to a parameter for integrity security protection in the security mode command message, or a parameter for which confidentiality is not performed in the security mode command message. The third parameter is specifically a parameter to be integrity-protected based on the second integrity security protection algorithm. It should be understood that the third parameter is a parameter required for the terminal device to perform security verification. Therefore, the second text parameter is carried in the security mode command message in plain text and transmitted to the terminal device, so that the terminal device can perform security verification on the security mode command message based on the third parameter. Performing integrity security protection on the third parameter without performing confidentiality security protection can improve security while ensuring that the terminal device can obtain sufficient information for security verification. Exemplarily, if the security protection algorithms of the RRC message and the UP message are independent, the identifier of the security algorithm corresponding to the RRC message, the identifier of the confidentiality security protection algorithm corresponding to the UP message, the identifier of the integrity security protection algorithm corresponding to the UP message, or the identifier of the authentication encryption algorithm corresponding to the UP message can all be used as the content of the third parameter.

[0394] Optionally, after the network device sends the security mode command message, the network device may activate uplink message security protection based on the security algorithm. The uplink message includes a message received from the terminal device, and the security protection of the uplink message based on the security algorithm includes decrypting and integrity checking the received uplink message based on the security algorithm. Specifically, the description of the security protection of the uplink message based on the security algorithm of the network device can be referred to Figure 6 The manner in which the terminal device verifies the security mode command message in the illustrated embodiment will not be described in detail here.

[0395] S740, the terminal device verifies the security mode command message.

[0396] For example, if the network device is AMF, the terminal device can verify the security mode command message in the manner described above. Figure 3 The description of the UE checking the NAS SMC message in step S350 in the communication method shown is not repeated here.

[0397] For example, if the network device is an access network device, the terminal device can verify the security mode command message in the manner described above. Figure 4 The description of the UE checking the AS SMC message in step S450 in the communication method shown is not repeated here.

[0398] If the verification is successful, the terminal device stores the security algorithm as part of the security context.

[0399] Optionally, after the verification is completed, the terminal device deletes or does not store the second integrity security protection algorithm.

[0400] For example, the security mode command message is an AS SMC message, and the security protection algorithms of the RRC message and the UP message are shared (e.g., a shared security algorithm). The AS SMC message includes the security protection algorithms corresponding to the RRC message and the UP message. After the terminal device completes the verification based on the second integrity security protection algorithm, it saves the security algorithm in the RRC security context and the UP security context, and deletes or does not store the second integrity security protection algorithm.

[0401] For example, the security mode command message is an AS SMC message, and the security protection algorithms of the RRC message and the UP message are independent. The AS SMC message includes the security protection algorithm corresponding to the RRC message (e.g., security algorithm), and the security protection algorithm corresponding to the UP message (e.g., at least one of authentication encryption algorithm #1, integrity security protection algorithm #1, or confidentiality security protection algorithm #1). After the terminal device completes the verification based on the second integrity security protection algorithm, it saves the security algorithm in the RRC security context, deletes or does not store the second integrity security protection algorithm, and saves the security protection algorithm corresponding to the UP message in the UP security context (e.g., saves at least one of authentication encryption algorithm #1, integrity security protection algorithm #1, or confidentiality security protection algorithm #1).

[0402] For another example, the security mode command message is a NAS SMC message. After the terminal device completes verification based on the second integrity security protection algorithm, it saves the security algorithm in the NAS security context, and deletes or does not store the second integrity security protection algorithm.

[0403] If the security check succeeds in step S740, the terminal device activates the integrity security protection and confidentiality security protection of the uplink message based on the security algorithm. The uplink message includes the message sent to the network device, and the security protection of the uplink message based on the security algorithm includes confidentiality and integrity security protection of the uplink message to be sent based on the security algorithm.

[0404] S750, the terminal device sends a security mode response message to the network device.

[0405] In this embodiment, the terminal device sends a security mode response message to the network device. For details, please refer to Figure 6 The description of the terminal device sending a security mode response message to the network device in the communication method shown is not repeated here.

[0406] Exemplarily, the network device receives a security mode response message, and the network device performs integrity verification and decryption on information elements in the security mode response message based on a security algorithm.

[0407] S760, the network device verifies the security mode response message.

[0408] The specific security verification method can refer to the method in the above step S640 regarding the terminal device performing security verification on the security mode command message, which will not be repeated here.

[0409] As described above, in this embodiment, the network device activates the security protection of the uplink message after sending the security mode command message. In addition, in this embodiment, the network device activates the security protection of the uplink message after receiving the security mode response message. For example, when the network device receives the security mode completion message of the terminal device, the security protection of the uplink message based on the security algorithm can be activated. Among them, the uplink message includes a message received from the terminal device (such as a security mode response message), and the security protection of the uplink message based on the security algorithm includes decrypting and integrity checking the received uplink message based on the security algorithm.

[0410] The present application also provides another communication method, in which a network device can select a security algorithm that can achieve both confidentiality security protection and integrity security protection, and the security algorithm is used to achieve confidentiality and integrity security protection for messages transmitted after the security mode command message. The first integrity security protection algorithm for integrity security protection of the security mode command message to be transmitted is determined based on the security algorithm. Therefore, when selecting a security protection algorithm, the network device can select a security algorithm, and then determine the first integrity security protection algorithm based on the selected security algorithm, and perform integrity security protection on the security mode command message to be transmitted based on the first integrity security protection algorithm.

[0411] In this communication method, after the network device selects the security algorithm, it carries the identifier of the security algorithm in the security mode command message, so that the network device and the terminal device can implement the security protection method of the message transmitted after the negotiated security mode command message through the identifier of the security algorithm carried in the security mode command message.

[0412] In the communication method, the subsequent messages transmitted between the network device and the terminal device are protected by the security algorithm, thereby avoiding the potential security risks of the combination of the confidentiality security protection algorithm and the integrity security protection algorithm. Furthermore, in the technical solution, the security mode command message sent by the network device only needs to include the identifier of the security algorithm, and does not need to carry the identifier of the first integrity security protection algorithm, because the terminal device can determine the first integrity security protection algorithm based on the security algorithm, which can reduce signaling overhead.

[0413] Combine the following Figure 8 This communication method is described in detail. Figure 8 This is a schematic flow chart of another communication method provided by the present application. It includes the following steps:

[0414] S810, the network device determines a security algorithm.

[0415] Exemplarily, the network device may select the security algorithm. Specifically, the description of selecting the security algorithm may refer to the above Figure 5 The description of step S510 in the communication method shown is not repeated here.

[0416] Exemplarily, the network device may select an integrity security protection algorithm and / or a confidentiality security protection algorithm, and determine the security algorithm based on the selected integrity security protection algorithm #1 and / or confidentiality security protection algorithm.

[0417] In this embodiment, the security algorithm determined by the network device can be used to determine the first integrity security protection algorithm.

[0418] As a possible implementation manner, the network device uses the algorithm obtained by clearing the confidentiality part in the security algorithm as the first integrity security protection algorithm.

[0419] As another possible implementation, the network device determines the first integrity security protection algorithm based on the corresponding relationship and the security algorithm, and the corresponding relationship includes the corresponding relationship between the security algorithm and the first integrity security protection algorithm. Optionally, the corresponding relationship may also include the corresponding relationship between other authentication encryption algorithms and integrity security protection algorithms, which is not limited in this embodiment.

[0420] For example, the correspondence between multiple integrity security protection algorithms and multiple authenticated encryption algorithms is: the SNOW-AEAD algorithm corresponds to the SNOW integrity security protection algorithm, the ZUC-AEAD algorithm corresponds to the ZUC integrity security protection algorithm, and the AES-AEAD algorithm corresponds to the AES integrity security protection algorithm.

[0421] If the security algorithm is the SNOW-AEAD algorithm, the first integrity security protection algorithm is the SNOW integrity security protection algorithm; or, if the security algorithm is the ZUC-AEAD algorithm, the first integrity security protection algorithm is the ZUC integrity security protection algorithm; or, if the security algorithm is the AES-AEAD algorithm, the first integrity security protection algorithm is the AES integrity security protection algorithm.

[0422] As another possible implementation, the network device directly uses the integrity protection part of the security algorithm as the first integrity security protection algorithm (or the network device determines to use the integrity protection part of the security algorithm). For example, the network device considers all the cells of the security mode command message as the input of the integrity protection part of the security algorithm, without confidentiality transmission of the cells. In this implementation, the first integrity security protection algorithm is the security algorithm, and the security algorithm does not implement the confidentiality security protection function.

[0423] S820, the network device activates security protection based on the first integrity security protection algorithm or the security algorithm.

[0424] Specifically, the network device may activate security protection for downlink messages, for example, performing integrity security protection on downlink messages.

[0425] Exemplarily, the network device activates security protection based on a first integrity security protection algorithm, including: configuring the first integrity security protection algorithm and a key corresponding to the first integrity security protection algorithm.

[0426] Exemplarily, the network device activates security protection based on a security algorithm, including: configuring a security algorithm and a security key corresponding to the security algorithm.

[0427] Further, the network device uses the security key as the input key of the integrity protected part to perform integrity protection on the security mode command message to be sent; or the network device determines the first integrity security protection algorithm according to the security algorithm, and performs integrity protection on the security mode command message to be sent based on the first integrity security protection algorithm. For example, the network device obtains a third MAC for integrity security protection based on the first integrity security protection algorithm or the integrity protected part of the security algorithm.

[0428] It should be understood that Figure 2 In the AEAD algorithm shown, the network device uses part or all of the information elements of the downlink message as the input of the AAD part of the AEAD algorithm, and uses the AEAD key to output the third MAC. Therefore, part or all of the information elements of the downlink message are protected by integrity security, but not by confidentiality. The downlink message is specifically a security mode command message.

[0429] Exemplarily, if the network device is AMF, the description of the integrity security protection in step S820 can refer to the above Figure 3 The description of step S320 in the communication method shown is not repeated here.

[0430] For example, if the network device is an access network device, the description of the integrity security protection in step S820 can refer to the above Figure 4The description of step S420 in the communication method shown is not repeated here.

[0431] In this embodiment, the network device activates the security protection process based on the first integrity security protection algorithm and Figure 3 In step S320 shown in FIG. 1 , the AMF activates NAS integrity security protection or Figure 4 The communication method shown in FIG. 4 is similar to the one in which the access network device activates RRC integrity security protection in step S420, except that:

[0432] In this embodiment, the first integrity security protection algorithm is an integrity security protection algorithm determined based on a security algorithm, or an algorithm in which a confidentiality security protection function in the security algorithm is not enabled. For details, see the description of S820.

[0433] S830, the network device sends a security mode command message to the terminal device.

[0434] The security mode command message involved in this embodiment is a security mode command message based on the first integrity security protection algorithm or security algorithm integrity protection. For the convenience of description, the security mode command message with integrity protection in this embodiment is referred to as the security mode command message.

[0435] Optionally, if the network device is AMF, the security mode command message is NAS SMC.

[0436] Optionally, if the network device is an access network device, the security mode command message is AS SMC.

[0437] The security mode command message includes an identifier of a security algorithm and a third MAC.

[0438] It should be noted that the identifier of the security algorithm carried in the security mode command message will be used as part of the security context later.

[0439] Exemplarily, if the network device is an AMF, the information included in the security mode command message, in addition to the information of the security algorithm identifier, can refer to the above Figure 3 The description of the information included in the NAS SMC message in step S330 in the communication method shown is not repeated here.

[0440] Exemplarily, if the network device is an access network device, the information included in the security mode command message, in addition to the above-mentioned security algorithm identifier, can refer to the above-mentioned Figure 4Description of the information included in the AS SMC message in step S430 of the communication method shown. For example, if the security protection algorithms corresponding to the RRC message and the UP message are shared, the AS SMC may carry an identifier of the security algorithm and an identifier of the first integrity security protection algorithm. For another example, if the security protection algorithms of the RRC message and the UP message are independent, the AS SMC includes an identifier of the first integrity security protection algorithm and an identifier of the security algorithm corresponding to the RRC message, and the AS SMC also includes an identifier of the confidentiality security protection algorithm corresponding to the UP message, an identifier of the integrity security protection algorithm corresponding to the UP message, or an identifier of the authentication encryption algorithm corresponding to the UP message.

[0441] Optionally, the security mode command message also includes a third parameter required by the terminal device to perform integrity check. For an explanation of the third parameter, please refer to Figure 7 The description of the third parameter in the communication method shown is not repeated here.

[0442] Optionally, after the network device sends the security mode command message, the network device may activate uplink message security protection based on the security algorithm. The uplink message includes a message received from the terminal device, and the security protection of the uplink message based on the security algorithm includes decrypting and integrity checking the received uplink message based on the security algorithm. Specifically, the description of the security protection of the uplink message based on the security algorithm of the network device can be referred to Figure 5 The manner in which the terminal device verifies the security mode command message in the illustrated embodiment will not be described in detail here.

[0443] S840, the terminal device verifies the security mode command message.

[0444] The terminal device receives the security mode command message and performs an integrity check on the security mode command message.

[0445] The terminal device determines the security algorithm based on the identifier of the security algorithm carried by the security mode command message. In other words, the terminal device determines that the security mode command message is integrity protected based on the security algorithm (or the first integrity security protection algorithm corresponding to the security algorithm, or the integrity protected part of the security algorithm). Further, the terminal device performs an integrity check on the security mode command message based on the security algorithm (or the first integrity security protection algorithm corresponding to the security algorithm, or the integrity protected part of the security algorithm).

[0446] As a possible implementation, the terminal device may perform integrity check on the security mode command message based on the integrity protected portion of the security algorithm. For example, the third MAC is integrity protected based on the integrity protected portion of the security algorithm.

[0447] In this implementation, the terminal device uses the integrity protection part of the security algorithm to perform integrity check on the security mode command message. The terminal device uses the security mode command message (part or all of the information elements of the security mode command message, such as the third parameter mentioned above) and the key corresponding to the security algorithm as the input of the integrity protection part of the security algorithm. Figure 2 In the AEAD algorithm shown, the terminal device uses the AEAD key and inputs the security mode command message as the AAD part, thereby outputting a MAC, and determining whether the third MAC is consistent with the MAC to determine whether the third MAC is correct, thereby achieving integrity verification.

[0448] Exemplarily, the terminal device may perform integrity check based on the third parameter carried in the security mode command message and the integrity protected part of the security algorithm, and the third parameter includes parameters required for performing integrity check based on the integrity protected part of the security algorithm. For example, the third parameter includes an identifier of the security algorithm, security capability information of the replayed terminal device, first key change indication information, or a key identifier of the first key, etc.

[0449] In this implementation, the terminal device can refer to the method for performing integrity check on the security mode command message. Figure 5 In the embodiment shown, step S540 is a description of the terminal device performing integrity check on the security mode command message. For example, the security algorithm is Figure 2 The AEAD algorithm shown, the terminal device obtains the corresponding security key (i.e., AEAD key) according to the security algorithm. Further, the terminal device uses the third parameter (AAD) and the AEAD key as the input of the integrity protection part of the AEAD algorithm to obtain the MAC value, and determines whether the third MAC is consistent with the MAC to determine whether the third MAC is correct, thereby implementing integrity verification.

[0450] As another possible implementation, the terminal device may perform integrity check on the security mode command message based on the first integrity security protection algorithm. This implementation corresponds to the following situation: the third MAC of the security mode command message is obtained by integrity security protection based on the first integrity security protection algorithm.

[0451] In this implementation, the terminal device determines the first integrity security protection algorithm. Specifically, the terminal device determines the security algorithm according to the identifier of the security algorithm, and further determines the first integrity security protection algorithm.

[0452] In this implementation, Figure 8 The method flow shown may also include:

[0453] S841, the terminal device determines a first integrity security protection algorithm.

[0454] As a possible implementation method, the terminal device uses the algorithm with the confidentiality part in the security algorithm cleared as the first integrity security protection algorithm.

[0455] As another possible implementation, the terminal device determines the first integrity security protection algorithm according to the corresponding relationship and the security algorithm. The description of the corresponding relationship can refer to the description in the above step S710, which will not be repeated here.

[0456] As another possible implementation, the network device directly uses the security algorithm as the first integrity security protection algorithm and performs integrity verification based on the security algorithm without decryption.

[0457] Exemplarily, in this embodiment, after the terminal device determines the first integrity security protection algorithm, the method of verifying the security mode command message based on the first integrity security protection algorithm can refer to the method of integrity verification performed by the terminal device in the prior art.

[0458] For example, if the network device is AMF, the terminal device can verify the security mode command message in the manner described above. Figure 3 The description of the UE checking the NAS SMC message in step S350 in the communication method shown is not repeated here.

[0459] For example, if the network device is an access network device, the terminal device can verify the security mode command message in the manner described above. Figure 4 The description of the UE checking the AS SMC message in step S450 in the communication method shown is not repeated here.

[0460] If the verification is successful, the terminal device stores the security algorithm as part of the security context.

[0461] Optionally, after the verification is completed, the terminal device deletes or does not store the first integrity security protection algorithm.

[0462] For example, the security mode command message is an AS SMC message, and the security protection algorithms of the RRC message and the UP message are shared (e.g., a shared security algorithm). After the terminal device completes the verification based on the first integrity security protection algorithm, it saves the security algorithm in the RRC security context and the UP security context, and deletes or does not store the first integrity security protection algorithm.

[0463] For example, the security mode command message is an AS SMC message, and the security protection algorithms of the RRC message and the UP message are independent. The AS SMC message includes the security protection algorithm corresponding to the RRC message (e.g., security algorithm), and the security protection algorithm corresponding to the UP message (e.g., at least one of authentication encryption algorithm #1, integrity security protection algorithm #1, or confidentiality security protection algorithm #1). After the terminal device completes the verification based on the first integrity security protection algorithm, it saves the security algorithm in the RRC security context, deletes or does not store the first integrity security protection algorithm, and saves the security protection algorithm corresponding to the UP message in the UP security context (e.g., saves at least one of authentication encryption algorithm #1, integrity security protection algorithm #1, or confidentiality security protection algorithm #1).

[0464] For another example, the security mode command message is a NAS SMC message. After the terminal device completes verification based on the first integrity security protection algorithm, it saves the security algorithm in the NAS security context, and deletes or does not store the first integrity security protection algorithm.

[0465] If the security check succeeds in step S840, the terminal device activates the integrity security protection and confidentiality security protection of the uplink message based on the security algorithm. The uplink message includes the message sent to the network device, and the security protection of the uplink message based on the security algorithm includes confidentiality and integrity security protection of the uplink message to be sent based on the security algorithm.

[0466] S850, the terminal device sends a security mode response message to the network device.

[0467] In this embodiment, the terminal device sends a security mode response message to the network device. For details, please refer to Figure 5 The description of the terminal device sending a security mode response message to the network device in the communication method shown is not repeated here.

[0468] S860, the network device verifies the security mode response message.

[0469] Exemplarily, the network device receives the security mode response message, and the network device performs integrity check and decryption on the information element in the security mode response message based on the security algorithm. The specific security check method can refer to the method of the network device performing integrity check and decryption on the uplink message in the above step S540, which will not be repeated here.

[0470] As described above, in this embodiment, the network device activates the security protection of the uplink message after sending the security mode command message. In addition, in this embodiment, the network device activates the security protection of the uplink message after receiving the security mode response message. For example, when the network device receives the security mode completion message of the terminal device, the security protection of the uplink message based on the security algorithm can be activated. Among them, the uplink message includes a message received from the terminal device (such as a security mode response message), and the security protection of the uplink message based on the security algorithm includes decrypting and integrity checking the received uplink message based on the security algorithm.

[0471] The present application also provides another communication method, in which the network device selects a third integrity security protection algorithm, activates the third integrity security protection algorithm, and performs integrity security protection on the security mode command message to be transmitted based on the third integrity security protection algorithm. Further, the network device carries a fifth MAC, an identifier of the third integrity security protection algorithm, and second indication information in the security mode command message, and the second indication information indicates that the message transmitted after the security mode command message is subjected to confidentiality and integrity security protection based on the security algorithm.

[0472] The third integrity security protection algorithm can determine the security algorithm, so that the network device and the terminal device can implement the security protection method of the message transmitted after the negotiated security mode command message through the identifier of the third integrity security protection algorithm carried in the security mode command message. In this technical solution, the subsequent messages transmitted between the network device and the terminal device are protected by the security algorithm, avoiding the security risks of the combination of the confidentiality security protection algorithm and the integrity security protection algorithm.

[0473] Combine the following Fig. 9 This communication method is described in detail. Fig. 9 This is a schematic flow chart of another communication method provided by the present application. It includes the following steps:

[0474] S910, the network device determines a third integrity security protection algorithm.

[0475] Exemplarily, the network device may select the third integrity security protection algorithm. Specifically, the way in which the network device selects the third integrity security protection algorithm may refer to the way in which the network device selects the integrity security protection algorithm in the prior art.

[0476] For example, if the network device is AMF, the method for the network device to select the third integrity security protection algorithm can refer to the above Figure 3 The description of the AMF selecting the integrity security protection algorithm in step S310 of the communication method shown is not repeated here.

[0477] For example, if the network device is an access network device, the method for the network device to select the third integrity security protection algorithm can refer to the above Figure 4 The description of the access network device selecting the integrity security protection algorithm in step S410 of the communication method shown is not repeated here.

[0478] Exemplarily, the network device may select an authenticated encryption algorithm, and determine the third integrity security protection algorithm based on the selected authenticated encryption algorithm.

[0479] Optionally, in this embodiment, the network device may also select a confidentiality security protection algorithm, which will not be described in detail here.

[0480] S920, the network device activates security protection based on the third integrity security protection algorithm.

[0481] Specifically, the network device may activate security protection for downlink messages, for example, performing integrity security protection on downlink messages.

[0482] Exemplarily, the network device activates security protection based on the third integrity security protection algorithm, including: configuring the third integrity security protection algorithm and a key corresponding to the third integrity security protection algorithm. Further, the network device obtains a fifth MAC of integrity security protection based on the third integrity security protection algorithm.

[0483] Exemplarily, if the network device is an AMF, the method for the network device to activate security protection based on the third integrity security protection algorithm can refer to the above Figure 3 The description of activating NAS integrity security protection in step S320 in the communication method shown is not repeated here.

[0484] Exemplarily, if the network device is an access network device, the method for the network device to activate the security protection based on the third integrity security protection algorithm can refer to the above Figure 4 The description of activating RRC integrity security protection in step S420 in the communication method shown is not repeated here.

[0485] S930, the network device sends a security mode command message to the terminal device.

[0486] The security mode command message involved in this embodiment is a security mode command message based on the third integrity security protection algorithm or security algorithm integrity protection. For the convenience of description, the security mode command message with integrity protection in this embodiment is referred to as the security mode command message.

[0487] Optionally, if the network device is AMF, the security mode command message is NAS SMC.

[0488] Optionally, if the network device is an access network device, the security mode command message is AS SMC.

[0489] The security mode command message includes an identifier of a third integrity security protection algorithm, a fifth MAC and second indication information. The second indication information is used to indicate that the message transmitted after the security mode command message is subjected to confidentiality and integrity security protection based on the security algorithm. The third integrity security protection algorithm is used to determine the security algorithm.

[0490] Exemplarily, the second indication information may be a 1-bit value. For example, when the second indication information takes a value of 1, it indicates that the message following the security mode command message uses a security algorithm. When the second indication information takes a value of 0 or is not carried, it indicates that the message following the security mode command message does not use a security algorithm.

[0491] Exemplarily, the second indication information may also be an identifier of a specific security algorithm. When the security mode command message carries the identifier of the security algorithm, it indicates that the message after the security mode command message uses the security algorithm; when the identifier of the security algorithm is not carried, it indicates that the message after the security mode command message does not use the security algorithm.

[0492] Exemplarily, the triggering condition for the network device to determine that a message following the security mode command message uses a security algorithm may include at least one of the following conditions:

[0493] 1) In the above step S910, the network device selects a third integrity security protection algorithm and a confidentiality security protection algorithm, and the third integrity security protection algorithm and the confidentiality security protection algorithm are the same type of algorithms, for example, the third integrity security protection algorithm and the confidentiality security protection algorithm are both AES algorithms, and for another example, the third integrity security protection algorithm and the confidentiality security protection algorithm are both SNOW algorithms;

[0494] 2) In the above step S910, the algorithm selection policy is configured on the network device to give priority to the authentication encryption algorithm.

[0495] Exemplarily, if the network device is AMF, the information included in the security mode command message, in addition to the second indication information, can refer to the above Figure 3 The description of the information included in the NAS SMC message in step S330 in the communication method shown is not repeated here.

[0496] Exemplarily, if the network device is an access network device, the information included in the security mode command message, in addition to the second indication information, can refer to the above Figure 4Description of the information included in the AS SMC message in step S430 of the communication method shown. For example, if the security protection algorithms corresponding to the RRC message and the UP message are shared, the AS SMC may carry an identifier of the security algorithm and an identifier of the third integrity security protection algorithm. For another example, if the security protection algorithms of the RRC message and the UP message are independent, the AS SMC includes the identifier of the third integrity security protection algorithm and the security algorithm corresponding to the RRC message, and the AS SMC also includes the identifier of the confidentiality security protection algorithm corresponding to the UP message, the identifier of the integrity security protection algorithm corresponding to the UP message, or the identifier of the authentication encryption algorithm corresponding to the UP message.

[0497] Optionally, the security mode command message also includes a third parameter required by the terminal device to perform integrity check. For an explanation of the third parameter, please refer to Figure 7 The description of the third parameter in the communication method shown is not repeated here.

[0498] Optionally, after the network device sends the security mode command message, the network device may activate the uplink message security protection based on the security algorithm. Specifically, the description of the uplink message security protection based on the security algorithm of the network device can refer to Figure 5 The manner in which the terminal device verifies the security mode command message in the illustrated embodiment will not be described in detail here.

[0499] As a possible implementation, after the network device selects the third integrity security protection algorithm, it determines a security algorithm based on the third integrity security protection algorithm. The uplink message includes a message received from the terminal device, and the security protection of the uplink message based on the security algorithm includes decrypting and integrity checking the received uplink message based on the security algorithm.

[0500] For example, the integrity security protection algorithm includes the AES integrity security protection algorithm, the SNOW integrity security protection algorithm, the ZUC integrity security protection algorithm, the null integrity security protection algorithm, etc. When the third integrity security protection algorithm is the AES integrity security protection algorithm, the security algorithm is the AES authentication encryption algorithm; or, when the third integrity security protection algorithm is the SNOW integrity security protection algorithm, the security algorithm is the SNOW integrity security protection algorithm; or, when the third integrity security protection algorithm is the ZUC integrity security protection algorithm, the security algorithm is the ZUC authentication encryption algorithm; or, when the third integrity security protection algorithm is the null integrity security protection algorithm, the security algorithm is the null algorithm.

[0501] As another possible implementation, the network device selects a security algorithm before determining the third integrity security protection algorithm, and the third integrity security protection algorithm is determined based on the security algorithm. The method for determining the third integrity security protection algorithm based on the security algorithm can refer to the method for determining the first integrity security protection algorithm based on the security algorithm, which will not be repeated here.

[0502] S940, the terminal device verifies the security mode command message.

[0503] Exemplarily, the way in which the terminal device in this embodiment verifies the security mode command message based on the third integrity security protection algorithm can refer to the way in which the terminal device performs integrity verification in the prior art.

[0504] For example, if the network device is AMF, the terminal device can verify the security mode command message in the manner described above. Figure 3 The description of the UE checking the NAS SMC message in step S350 in the communication method shown is not repeated here.

[0505] For example, if the network device is an access network device, the terminal device can verify the security mode command message in the manner described above. Figure 4 The description of the UE checking the AS SMC message in step S450 in the communication method shown is not repeated here.

[0506] Optionally, after the verification is completed, the terminal device deletes or does not store the third integrity security protection algorithm.

[0507] If the security check succeeds in step S940, the terminal device determines the security algorithm according to the second indication information and the identifier of the third integrity security protection algorithm. Further, the terminal device stores the security algorithm as part of the security context. Figure 8 The method flow shown may also include:

[0508] S950, the terminal device determines a security algorithm.

[0509] For example, when the second indication information indicates that the message transmitted after the security mode command message is based on the security algorithm for confidentiality and integrity security protection, the terminal device determines the security algorithm based on the third integrity security protection algorithm. The manner in which the terminal device determines the security algorithm based on the third integrity security protection algorithm can refer to the description of the network device determining the security algorithm based on the third integrity security protection algorithm, which will not be repeated here.

[0510] For example, the security mode command message is an AS SMC message, and the security protection algorithms of the RRC message and the UP message are shared (e.g., a shared security algorithm). After the terminal device completes the verification based on the third integrity security protection algorithm, it saves the security algorithm in the RRC security context and the UP security context, and deletes or does not store the third integrity security protection algorithm.

[0511] For example, the security mode command message is an AS SMC message, and the security protection algorithms of the RRC message and the UP message are independent. After the terminal device completes the verification based on the third integrity security protection algorithm, it saves the security algorithm in the RRC security context, deletes or does not store the third integrity security protection algorithm, and saves the security protection algorithm corresponding to the UP message in the UP security context (for example, saving at least one of the authentication encryption algorithm #1, integrity security protection algorithm #1, or confidentiality security protection algorithm #1 corresponding to the UP message).

[0512] For another example, the security mode command message is a NAS SMC message. After the terminal device completes verification based on the third integrity security protection algorithm, it saves the security algorithm in the NAS security context, and deletes or does not store the third integrity security protection algorithm.

[0513] Exemplarily, after the terminal device determines the security algorithm, the terminal device can activate integrity security protection and confidentiality security protection of uplink messages based on the security algorithm. The uplink message includes a message sent to the network device, and the security protection of the uplink message based on the security algorithm includes confidentiality security protection and integrity security protection for the uplink message to be sent based on the security algorithm.

[0514] S960, the terminal device sends a security mode response message to the network device.

[0515] The above-mentioned uplink message includes the security mode response message. For the description of the terminal device sending the security mode response message to the network device in this embodiment, please refer to Figure 6 The description of the terminal device sending a security mode response message to the network device in the communication method shown is not repeated here.

[0516] Exemplarily, the network device receives a security mode response message, and the network device performs integrity verification and decryption on information elements in the security mode response message based on a security algorithm.

[0517] S970, the network device verifies the security mode response message.

[0518] The specific security verification method can refer to the method in the above step S540 regarding the network device performing integrity verification and decryption on the uplink message, which will not be repeated here.

[0519] As described above, in this embodiment, the network device activates the security protection of the uplink message after sending the security mode command message. In addition, in this embodiment, the network device activates the security protection of the uplink message after receiving the security mode response message. For example, when the network device receives the security mode completion message of the terminal device, the security protection of the uplink message based on the security algorithm can be activated. Among them, the uplink message includes a message received from the terminal device (such as a security mode response message), and the security protection of the uplink message based on the security algorithm includes decrypting and integrity checking the received uplink message based on the security algorithm.

[0520] It should be understood that the sequence numbers of the above processes do not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0521] It should also be understood that in the various embodiments of the present application, unless otherwise specified or there is a logical conflict, the terms and / or descriptions between different embodiments are consistent and can be referenced to each other, and the technical features in different embodiments can be combined to form new embodiments according to their internal logical relationships.

[0522] It should also be understood that in some of the above embodiments, the devices in the existing network architecture are mainly used as examples for exemplary description (such as network devices, terminal devices, etc.), and it should be understood that the specific form of the device is not limited in the embodiments of the present application. For example, devices that can achieve the same function in the future are applicable to the embodiments of the present application.

[0523] It can be understood that in the above-mentioned various method embodiments, the methods and operations implemented by devices (such as network devices, terminal devices) can also be implemented by components of the devices (such as chips or circuits).

[0524] Above, combined Figures 3 to 6 The communication method provided by the embodiment of the present application is described in detail. The above communication method is mainly introduced from the perspective of interaction between the network device and the terminal device. It can be understood that in order to realize the above functions, the network device and the terminal device include hardware structures and / or software modules corresponding to the execution of each function.

[0525] Those skilled in the art should be aware that, in combination with the units and algorithm steps of each example described in the embodiments disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is performed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0526] The following combination Figures 10 to 12 The communication device provided by the present application is described in detail. It should be understood that the description of the device embodiment corresponds to the description of the method embodiment. Therefore, the content not described in detail can be referred to the method embodiment above, and some content will not be repeated for the sake of brevity.

[0527] The embodiment of the present application can divide the functional modules of the transmitting end device or the receiving end device according to the above method example. For example, each functional module can be divided corresponding to each function, or two or more functions can be integrated into one processing module. The above integrated module can be implemented in the form of hardware or in the form of software functional modules. It should be noted that the division of modules in the embodiment of the present application is schematic and is only a logical functional division. There may be other division methods in actual implementation. The following is an example of dividing each functional module corresponding to each function.

[0528] Fig.10 1 is a schematic block diagram of a communication device 10 provided in an embodiment of the present application. The device 10 includes a transceiver module 11 and a processing module 12. The transceiver module 11 can implement corresponding communication functions, and the processing module 12 is used to perform data processing, or in other words, the transceiver module 11 is used to perform operations related to receiving and sending, and the processing module 12 is used to perform other operations besides receiving and sending. The transceiver module 11 can also be called a communication interface or a communication unit.

[0529] Optionally, the device 10 may further include a storage module 13, which may be used to store instructions and / or data. The processing module 12 may read the instructions and / or data in the storage module so that the device implements the actions of the devices in the aforementioned method embodiments.

[0530] In one design, the apparatus 10 may correspond to the network device in the above method embodiment, or a component (such as a chip) of the network device.

[0531] The device 10 can implement the steps or processes executed by the network device in the above method embodiment, wherein the transceiver module 11 can be used to execute the transceiver related operations of the network device in the above method embodiment, and the processing module 12 can be used to execute the processing related operations of the network device in the above method embodiment.

[0532] In one possible implementation, the processing module 12 is used to determine a security algorithm, the security algorithm includes a part for confidentiality protection and a part for integrity protection; based on the security algorithm and the security key, the security protection between the network device and the terminal device is activated, and the security key is a key shared between the terminal device and the network device. The transceiver module 11 is used to receive an uplink message from the terminal device. The processing module 12 is used to use the security key as an input key for the integrity protection part of the security algorithm to verify the integrity of the uplink message, and use the security key as an input key for the confidentiality protection part of the security algorithm to decrypt the uplink message.

[0533] Wherein, when the device 10 is used to perform Figure 5 When the method is performed, the transceiver module 11 can be used to execute the steps of sending and receiving information in the method, such as step S530; the processing module 12 can be used to execute the processing steps in the method, such as steps S510, S520 and S540.

[0534] When the device 10 is used to perform Figure 6 When the method is performed, the transceiver module 11 can be used to execute the steps of sending and receiving information in the method, such as steps S630 and S650; the processing module 12 can be used to execute the processing steps in the method, such as steps S610, S620 and S660.

[0535] When the device 10 is used to perform Figure 7 When performing the method in the method, the transceiver module 11 can be used to execute the steps of sending and receiving information in the method, such as steps S730 and S750; the processing module 12 can be used to execute the processing steps in the method, such as steps S710, S720 and S760.

[0536] When the device 10 is used to perform Figure 8 When performing the method in the method, the transceiver module 11 can be used to execute the steps of sending and receiving information in the method, such as steps S830 and S850; the processing module 12 can be used to execute the processing steps in the method, such as steps S810, S820 and S860.

[0537] When the device 10 is used to perform Fig. 9 When the method is performed, the transceiver module 11 can be used to execute the steps of sending and receiving information in the method, such as steps S930 and S960; the processing module 12 can be used to execute the processing steps in the method, such as steps S910, S920 and S970.

[0538] It should be understood that the specific process of each unit executing the above corresponding steps has been described in detail in the above method embodiment, and for the sake of brevity, it will not be repeated here.

[0539] In another design, the apparatus 10 may correspond to the terminal device in the above method embodiment, or be a component (such as a chip) of the terminal device.

[0540] The device 10 can implement the steps or processes executed by the terminal device in the above method embodiment, wherein the transceiver module 11 can be used to execute the transceiver related operations of the terminal device in the above method embodiment, and the processing module 12 can be used to execute the processing related operations of the terminal device in the above method embodiment.

[0541] In one possible implementation, the processing module 12 is used to determine a security algorithm, the security algorithm includes a part for confidentiality protection and a part for integrity protection; activate security protection between the terminal device and the network device based on the security algorithm and a security key, the security key is a key shared between the terminal device and the network device; perform security protection on the uplink message to be sent based on the security algorithm and the security key, and send the security-protected uplink message to the network device, wherein the security protection of the uplink message to be sent based on the security algorithm and the security key includes: using the security key as an input key of the integrity protection part in the security algorithm to perform integrity protection on the uplink message to be sent, and using the security key as an input key of the confidentiality protection part in the security algorithm to perform confidentiality protection on the uplink message to be sent. The transceiver module 11 is used to send the uplink message to the network device.

[0542] Wherein, when the device 10 is used to perform Figure 5 When the method is performed, the transceiver module 11 can be used to execute the steps of sending and receiving information in the method, such as step S530; the processing module 12 can be used to execute the processing steps in the method, such as step S521.

[0543] When the device 10 is used to perform Figure 6 When the method is performed, the transceiver module 11 can be used to execute the steps of sending and receiving information in the method, such as steps S630 and S650; the processing module 12 can be used to execute the processing steps in the method, such as step S640.

[0544] When the device 10 is used to perform Figure 7 When the method is performed, the transceiver module 11 can be used to execute the steps of sending and receiving information in the method, such as steps S730 and S750; the processing module 12 can be used to execute the processing steps in the method, such as step S740.

[0545] When the device 10 is used to perform Figure 8When the method is performed, the transceiver module 11 can be used to execute the steps of sending and receiving information in the method, such as steps S830 and S850; the processing module 12 can be used to execute the processing steps in the method, such as steps S841 and S840.

[0546] When the device 10 is used to perform Fig. 9 When the method is performed, the transceiver module 11 can be used to execute the steps of sending and receiving information in the method, such as steps S930 and S960; the processing module 12 can be used to execute the processing steps in the method, such as steps S940 and S950.

[0547] It should be understood that the specific process of each unit executing the above corresponding steps has been described in detail in the above method embodiment, and for the sake of brevity, it will not be repeated here.

[0548] It should also be understood that the device 10 here is embodied in the form of a functional module. The term "module" here may refer to an application specific integrated circuit (ASIC), an electronic circuit, a processor (such as a shared processor, a dedicated processor or a group processor, etc.) and a memory for executing one or more software or firmware programs, a merged logic circuit and / or other suitable components that support the described functions. In an optional example, those skilled in the art may understand that the device 10 may be specifically a mobile management network element in the above-mentioned embodiment, and may be used to execute the various processes and / or steps corresponding to the mobile management network element in the above-mentioned method embodiments; or, the device 10 may be specifically a terminal device in the above-mentioned embodiment, and may be used to execute the various processes and / or steps corresponding to the terminal device in the above-mentioned method embodiments. To avoid repetition, it will not be repeated here.

[0549] The device 10 of each of the above schemes has the function of implementing the corresponding steps performed by the device (such as terminal device, network device) in the above method. This function can be implemented by hardware, or by hardware executing the corresponding software implementation. The hardware or software includes one or more modules corresponding to the above functions; for example, the transceiver module can be replaced by a transceiver (for example, the sending unit in the transceiver module can be replaced by a transmitter, and the receiving unit in the transceiver module can be replaced by a receiver), and other units, such as processing modules, can be replaced by processors to respectively perform the transceiver operations and related processing operations in each method embodiment.

[0550] In addition, the transceiver module 11 may also be a transceiver circuit (for example, may include a receiving circuit and a sending circuit), and the processing module may be a processing circuit.

[0551] Fig.112 is a schematic diagram of another communication device 20 provided in an embodiment of the present application. The device 20 includes a processor 21, and the processor 21 is used to execute a computer program or instruction stored in a memory 22, or read data / signaling stored in the memory 22 to execute the method in each method embodiment above. Optionally, there are one or more processors 21.

[0552] Alternatively, if Fig.11 As shown, the device 20 also includes a memory 22, which is used to store computer programs or instructions and / or data. The memory 22 can be integrated with the processor 21, or can also be separately set. Optionally, the memory 22 is one or more.

[0553] Alternatively, if Fig.11 As shown, the device 20 further includes a transceiver 23, and the transceiver 23 is used for receiving and / or sending signals. For example, the processor 21 is used to control the transceiver 23 to receive and / or send signals.

[0554] As a solution, the device 20 is used to implement the operations performed by the network device in each of the above method embodiments.

[0555] As another solution, the device 20 is used to implement the operations performed by the terminal device in the above various method embodiments.

[0556] It should be understood that the processor mentioned in the embodiments of the present application may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.

[0557] It should also be understood that the memory mentioned in the embodiments of the present application may be a volatile memory and / or a non-volatile memory. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM). For example, RAM can be used as an external cache. By way of example and not limitation, RAM includes the following forms: static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct rambus RAM (DR RAM).

[0558] It should be noted that when the processor is a general-purpose processor, DSP, ASIC, FPGA or other programmable logic device, discrete gate or transistor logic device, discrete hardware component, the memory (storage module) can be integrated into the processor.

[0559] It should also be noted that the memory described herein is intended to include, but is not limited to, these and any other suitable types of memory.

[0560] Fig.12 Schematic diagram of a chip system 30 provided in an embodiment of the present application. The chip system 30 (or also referred to as a processing system) includes a logic circuit 31 and an input / output interface 32.

[0561] Among them, the logic circuit 31 can be a processing circuit in the chip system 30. The logic circuit 31 can be coupled to the storage unit and call the instructions in the storage unit so that the chip system 30 can implement the methods and functions of each embodiment of the present application. The input / output interface 32 can be an input / output circuit in the chip system 30, outputting information processed by the chip system 30, or inputting data or signaling information to be processed into the chip system 30 for processing.

[0562] As a solution, the chip system 30 is used to implement the operations performed by the network device and the terminal device in the above various method embodiments.

[0563] For example, the logic circuit 31 is used to implement the processing-related operations performed by the network device and the terminal device in the above method embodiment; the input / output interface 32 is used to implement the sending and / or receiving-related operations performed by the network device and the terminal device in the above method embodiment.

[0564] An embodiment of the present application also provides a computer-readable storage medium on which computer instructions for implementing the methods executed by the network device and the terminal device in the above-mentioned method embodiments are stored.

[0565] For example, when the computer program is executed by a computer, the computer can implement the methods performed by the network device and the terminal device in each embodiment of the above method.

[0566] An embodiment of the present application also provides a computer program product, comprising instructions, which, when executed by a computer, implement the methods performed by the network device and the terminal device in the above-mentioned method embodiments.

[0567] An embodiment of the present application also provides a communication system, including the aforementioned network device and terminal device.

[0568] The explanation of the relevant contents and beneficial effects of any of the above-mentioned devices can be referred to the corresponding method embodiments provided above, which will not be repeated here.

[0569] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0570] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. For example, the computer can be a personal computer, a server, or a network device, etc. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions can be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that contains one or more available media integrations. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a magnetic tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid state disk (SSD)). For example, the aforementioned available medium includes, but is not limited to, various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0571] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A communication method, characterized in that: Applied to a network device or a chip in the network device, the method comprising: Determine a security algorithm, wherein the security algorithm includes a part for performing confidentiality protection and a part for performing integrity protection; activating security protection between the network device and the terminal device based on the security algorithm and the security key, where the security key is a key shared between the terminal device and the network device; Receive a security-protected uplink message from the terminal device, use the security key as an input key for the integrity protection part of the security algorithm to perform integrity verification on the security-protected uplink message, and use the security key as an input key for the confidentiality protection part of the security algorithm to decrypt the security-protected uplink message.

2. The method according to claim 1, characterized in that After activating security protection between the network device and the terminal device based on the security algorithm and the security key, the method further includes: Based on the security algorithm, security protection is performed on the security mode command message to be sent, wherein the security mode command message to be sent includes a first parameter and a second parameter, Sending a security-protected secure mode command message to the terminal device, wherein the security-protected secure mode command message includes a first ciphertext, a first message authentication code MAC, and the first parameter, The first ciphertext is obtained by performing confidentiality protection on the second parameter based on the security algorithm, and the first MAC is obtained by performing integrity protection calculation on the first parameter and the first ciphertext based on the security algorithm.

3. The method according to claim 2, characterized in that The first parameter includes at least one of the following: The identifier of the security algorithm, the security capability information of the replayed terminal device, the key identifier of the first key, or the change indication information of the first key, wherein the first key is used to determine the security key.

4. The method according to claim 2 or 3, characterized in that: The security-protected safe mode command message further includes first indication information, where the first indication information is used to indicate a length of the first parameter and / or to indicate a position of the first parameter in the security-protected safe mode command message.

5. The method according to any one of claims 2 to 4, characterized in that The security-protected security mode command message includes a first packet header type indication, and the first packet header type indication is used to indicate that the security-protected security mode command message performs security protection based on the security algorithm.

6. The method according to claim 1, characterized in that After activating security protection between the terminal device and the terminal device based on the security algorithm and the security key, the method further includes: Using the security key as an input key of the integrity protected part, integrity protecting the security mode command message to be sent; An integrity-protected security mode command message is sent to the terminal device, wherein the integrity-protected security mode command message includes an identifier of the security algorithm.

7. The method according to claim 1, characterized in that After determining the security algorithm, the method further includes: Determining a first integrity security protection algorithm according to the security algorithm; Performing integrity protection on the security mode command message to be sent based on the first integrity security protection algorithm, An integrity-protected security mode command message is sent to a terminal device, wherein the integrity-protected security mode command message includes an identifier of the security algorithm.

8. The method according to claim 7, characterized in that The performing integrity protection on the security mode command message to be sent based on the first integrity security protection algorithm includes: The security key is used as an input key of the first integrity security protection algorithm to perform integrity protection on the security mode command message to be sent.

9. The method according to claim 7 or 8, characterized in that: The determining a first integrity security protection algorithm according to the security algorithm comprises: The algorithm after the confidentiality protection part in the security algorithm is cleared is used as the first integrity security protection algorithm; or The first integrity security protection algorithm is determined according to the corresponding relationship between the security algorithm and the first integrity security protection algorithm and the security algorithm.

10. The method according to claim 9, characterized in that If the security algorithm is the SNOW-AEAD algorithm, then the first integrity security protection algorithm is the SNOW integrity security protection algorithm; or, If the security algorithm is the ZUC-AEAD algorithm, then the first integrity security protection algorithm is the ZUC integrity security protection algorithm; or, If the security algorithm is the AES-AEAD algorithm, the first integrity security protection algorithm is the AES integrity security protection algorithm.

11. The method according to claim 1, characterized in that: The method further comprises: Determine a second integrity security protection algorithm, and perform integrity protection on the security mode command message to be sent based on the second integrity security protection algorithm; An integrity-protected security mode command message is sent to a terminal device, wherein the integrity-protected security mode command message includes an identifier of the security algorithm and an identifier of the second integrity security protection algorithm.

12. The method according to claim 1, characterized in that The method further comprises: Determine a third integrity security protection algorithm, and perform security protection on the security mode command message to be sent based on the third integrity security protection algorithm; An integrity-protected security mode command message is sent to a terminal device, wherein the integrity-protected security mode command message includes an identifier of the third integrity security protection algorithm and second indication information, wherein the second indication information is used to indicate that a message transmitted after the security mode command message is to be security-protected based on the security algorithm.

13. The method according to claim 12, characterized in that The determining of the security algorithm comprises: The security algorithm is determined according to the corresponding relationship between the third integrity security protection algorithm and the security algorithm, and the third integrity security protection algorithm.

14. The method according to any one of claims 1 to 12, characterized in that The determining of the security algorithm comprises: The security algorithm is selected according to a priority of at least one security algorithm, wherein the security algorithm is one of the at least one security algorithm.

15. The method according to any one of claims 1 to 14, characterized in that The security algorithm is an authenticated encryption AEAD algorithm with associated data.

16. The method according to any one of claims 1 to 15, characterized in that The security-protected uplink message includes a security mode response message.

17. The method according to any one of claims 1 to 16, characterized in that The security-protected uplink message header includes a second packet header type indication, and the second packet header type indication is used to indicate that the security-protected uplink message is security-protected based on the security algorithm.

18. A communication method, characterized in that: Applied to a terminal device or a chip in the terminal device, the method comprising: Determine a security algorithm, wherein the security algorithm includes a part for performing confidentiality protection and a part for performing integrity protection; activating security protection between the terminal device and the network device based on the security algorithm and the security key, where the security key is a key shared between the terminal device and the network device; Performing security protection on the uplink message to be sent based on the security algorithm and the security key, and sending the security-protected uplink message to the network device, wherein the performing security protection on the uplink message to be sent based on the security algorithm and the security key includes: The security key is used as an input key of the integrity protection part in the security algorithm to perform integrity protection on the uplink message to be sent, and the security key is used as an input key of the confidentiality protection part in the security algorithm to encrypt the uplink message to be sent.

19. The method according to claim 18, characterized in that The method further comprises: receiving a security protection safety mode command message from the network device, wherein the security protection safety mode command message is used to activate security protection between the terminal device and the network device, The security mode command message of the security protection includes a first ciphertext, a first message authentication code MAC and a first parameter; The determining of the security algorithm comprises: determining the security algorithm and the security key according to the first parameter; The method further includes: using the security key as an input key of the integrity protection part in the security algorithm, calculating a MAC using the first ciphertext and the first parameter as input parameters of the integrity protection part in the security algorithm, and performing integrity verification on the security-protected security mode command message based on the first MAC and the calculated MAC; If the integrity verification passes, the first ciphertext is decrypted using the security key as an input key of a confidentiality protection part in the security algorithm to obtain a second parameter.

20. The method according to claim 19, characterized in that The first parameter includes at least one of the following: The identifier of the security algorithm, the security capability information of the replayed terminal device, the key identifier of the first key, or the first key change indication information, wherein the first key is used to determine the security key.

21. The method according to claim 19 or 20, characterized in that The security protection safety mode command message further includes first indication information, where the first indication information is used to indicate a length of the first parameter and / or to indicate a position of the first parameter in the security protection safety mode command message; The method further comprises: The first parameter is determined according to the first indication information.

22. The method according to any one of claims 19 to 21, characterized in that The security-protected security mode command message includes a first packet header type indication, and the first packet header type indication is used to indicate that the security-protected security mode command message performs security protection based on the security algorithm.

23. The method according to claim 18, characterized in that The determining of the security algorithm comprises: receiving an integrity-protected security mode command message from the network device, wherein the integrity-protected security mode command message includes an identifier of the security algorithm; Determining the security algorithm according to the identifier of the security algorithm; The method further comprises: The integrity-protected security mode command message is integrity verified using the security key as an input key for an integrity-protected portion of the security algorithm.

24. The method according to claim 18, characterized in that The determining of the security algorithm comprises: receiving an integrity-protected security mode command message from the network device, wherein the integrity-protected security mode command message includes an identifier of the security algorithm; Determining the security algorithm according to the identifier of the security algorithm; The method further comprises: Determining a first integrity security protection algorithm according to the security algorithm; The integrity-protected security mode command message is integrity verified based on the first integrity security protection algorithm.

25. The method according to claim 24, characterized in that The performing integrity verification on the integrity-protected security mode command message based on the first integrity security protection algorithm includes: The security key is used as an input key of the first integrity security protection algorithm to perform integrity verification on the integrity-protected security mode command message.

26. The method according to claim 24 or 25, characterized in that The determining a first integrity security protection algorithm according to the security algorithm comprises: The algorithm after the confidentiality protection part in the security algorithm is cleared is used as the first integrity security protection algorithm; or The first integrity security protection algorithm is determined according to the corresponding relationship between the security algorithm and the first integrity security protection algorithm and the security algorithm.

27. The method according to claim 26, characterized in that If the security algorithm is the SNOW-AEAD algorithm, the first integrity security protection algorithm is the SNOW integrity security protection algorithm; or, if the security algorithm is the ZUC-AEAD algorithm, the first integrity security protection algorithm is the ZUC integrity security protection algorithm; or, if the security algorithm is the AES-AEAD algorithm, the first integrity security protection algorithm is the AES integrity security protection algorithm.

28. The method according to claim 18, characterized in that The determining of the security algorithm comprises: receiving an integrity-protected security mode command message from the network device, the integrity-protected security mode command message including an identifier of the security algorithm and an identifier of the second integrity security protection algorithm; The integrity of the integrity-protected security mode command message is verified based on the second integrity security protection algorithm, and the security algorithm is determined according to the identifier of the security algorithm.

29. The method according to claim 18, characterized in that The determining of the security algorithm comprises: receiving an integrity-protected security mode command message from the network device, the integrity-protected security mode command message including an identifier of the third integrity security protection algorithm and second indication information, the second indication information being used to indicate that a message transmitted after the security mode command message is security-protected based on the security algorithm; The integrity-protected security mode command message is integrity verified based on the third integrity security protection algorithm, and the security algorithm is determined according to the third integrity security protection algorithm.

30. The method according to any one of claims 18 to 29, characterized in that The security algorithm is an authenticated encryption AEAD algorithm with associated data.

31. The method according to any one of claims 18 to 30, characterized in that The security-protected uplink message includes a security mode response message.

32. The method according to any one of claims 18 to 31, characterized in that The security-protected uplink message header includes a second packet header type indication, and the second packet header type indication is used to indicate that the security-protected uplink message is security-protected based on the security algorithm.

33. A communication device, characterized in that: include: One or more functional modules for executing the method according to any one of claims 1 to 17, or one or more functional modules for executing the method according to any one of claims 18 to 32.

34. A communication device, characterized in that: include: A processor, configured to execute a computer program stored in a memory, so that the apparatus performs the method according to any one of claims 1 to 17, or so that the apparatus performs the method according to any one of claims 18 to 32.

35. A computer program product, characterized in that The computer program product comprises instructions for performing the method of any one of claims 1 to 32.

36. A computer-readable storage medium, characterized in that: include: The computer-readable storage medium stores a computer program; when the computer program is executed on a computer, the computer is caused to perform the method according to any one of claims 1 to 32.

37. A chip, characterized in that: The chip is installed in a communication device, and the chip includes a processor and a communication interface. When the processor reads instructions through the communication interface and runs, the communication device executes the method as described in any one of claims 1 to 32.

Citation Information

Cited By

  • Communication method and communication apparatus

    EP4746472A1

  • Communication method and communication apparatus

    WO2025031157A1