Communication method and communication device

By interacting with public keys between the terminal and the network device and generating a shared key, the problem of low information security during random access is solved, the encryption protection of information is realized, and communication security is improved.

CN119922743APending Publication Date: 2025-05-02HUAWEI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311435752.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-10-30
Publication Date
2025-05-02

AI Technical Summary

Technical Problem

During the random access process, since the information interacting between the network device and the terminal device does not involve identity verification, and the information is transmitted through, there are security vulnerabilities and are easily attacked, resulting in information leakage.

Method used

By interacting with each other's public keys, the terminal and the network device can generate a shared key, encrypt the message based on the shared key, ensuring the security of the information.

Benefits of technology

It effectively reduces the leakage of information during random access, improves communication security, and prevents malicious attackers from tampering with and leaking information.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119922743A_ABST
    Figure CN119922743A_ABST
Patent Text Reader

Abstract

The invention provides a communication method and a communication device, which are used for improving the communication security technology. The method comprises the following steps: network equipment sends a public key of the network equipment and an encryption algorithm list supported by the network equipment to a terminal; the terminal sends an identifier of an encryption algorithm selected by the terminal and a public key of the terminal device to the network device, and the first message further comprises a random access preamble or a random access reason value; the network device encrypts the second message according to an encryption algorithm selected by the terminal and a shared key and sends the second message, and the shared key is obtained according to the second public key and a private key of the network device; and the terminal decrypts the second message according to the first encryption algorithm and the shared key. According to the method, the network equipment and the terminal carry out key negotiation in the random access process, so that information leakage in the random access process can be reduced, and the communication security is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of communication security technology, and in particular to a communication method and a communication device. Background Art

[0002] The terminal device initiates random access to access the network device, thereby realizing service transmission between the terminal device and the network device. However, in the random access process, since the information exchanged between the network device and the terminal device does not involve identity authentication, and a lot of information in the random access process is transparently transmitted, the random access process has security vulnerabilities and is easy to be attacked. For example, a terminal device can leak information to other devices through the network device, and the communication security is low. Summary of the invention

[0003] The present application provides a communication method and a communication device for protecting information security in a random access process and reducing information leakage caused by attacks.

[0004] In order to achieve the above purpose, the embodiment of the present application adopts the following technical solution:

[0005] In a first aspect, an embodiment of the present application provides a communication method, which can be performed by a first communication device. The first communication device can be a terminal, or the first communication device is a component for implementing the functions of the terminal. For example, the first communication device is a unit / module, circuit or chip inside the terminal. The method provided in the first aspect is described below by taking the first communication device as the terminal itself as an example.

[0006] The communication method includes: a terminal receives a first message, sends a first message, receives a second message, and decrypts the second message according to a first encryption algorithm and a shared key. The first information indicates a first public key and at least one encryption algorithm. The first message indicates the first encryption algorithm and the second public key. At least one encryption algorithm is an encryption algorithm supported by the network device, and the first encryption algorithm belongs to at least one encryption algorithm. The first message also includes a random access preamble or a random access reason value. The shared key is obtained according to the first public key and the first private key, and the first private key is a private key of the terminal.

[0007] In this scheme, the terminal obtains the public key and the supported encryption algorithm of the network device through the first information, and notifies the network device of the public key of the terminal and the first encryption algorithm used through the first message. That is, based on the first information and the first message, the network device and the terminal exchange each other's public keys. In this way, the subsequent network device and the terminal can obtain the shared key based on the obtained public key and their own private key, and encrypt the message to be sent based on the shared key. For example, the network device encrypts the second message based on the obtained shared key. Since the shared key can only be generated based on the private key and the public key, and the private keys of different terminals are different, even if another terminal obtains the second message, because it cannot obtain the shared key, it cannot decrypt the second message and cannot obtain the content of the second message, thereby reducing the leakage of the content of the second message and improving communication security. It can be understood that during the random access process, the messages exchanged between the terminal and the network device do not involve identity authentication or information integrity verification. In this way, malicious attackers can tamper with the content carried by the messages exchanged during the random access process and leak the information through the network device broadcast. In this solution, the first message also includes a random access preamble or a random access reason value, that is, the first message and the second message can be messages in the random access process. Therefore, this solution can reduce the leakage of information in the random access process and improve communication security.

[0008] In one implementation, the shared key is obtained based on the first public key and the first private key, including: the shared key is obtained based on the first public key, the first private key and the first parameter.

[0009] The first parameter may be a terminal-specific parameter, or the first parameter may be a parameter associated with a specific terminal. The scheme derives a shared key through the first parameter. Even if one terminal knows the key of another terminal in advance, it cannot determine the shared key used by the other terminal because it does not know the first parameter used by the other terminal, which can further improve communication security.

[0010] In one implementation, the first parameter includes one or more of the following: a temporary cell radio network temporary identification (TC-RNTI), a synchronization signal index, or a random access resource index.

[0011] In one implementation, the first message is scrambled by a sequence generated by a preamble sequence index and / or a synchronization signal index.

[0012] By using the preamble code sequence index and / or the synchronization signal index to scramble the first message, the decoding complexity of the first message at the receiving end can be increased, thereby further improving communication security.

[0013] In one implementation, the first message also includes a message verification code. When the first message includes a random access preamble, the message verification code is obtained by encrypting the random access preamble, an identifier of the first encryption algorithm, and a second public key using a first encryption algorithm and a shared key.

[0014] In this scheme, the terminal encrypts the random access preamble, the identifier of the first encryption algorithm and the second public key through the first encryption algorithm and the shared key, obtains the message verification code, carries it in the first message and sends it to the network device, that is, the terminal performs integrity protection on the first message, so that the network device determines whether the terminal maliciously initiates random access, thereby improving communication security. It can be understood that different terminals use different shared keys. If there are many first messages sent using the same shared key, and the message verification code in the first message is encrypted using the same shared key, then it means that there is a terminal that maliciously initiates random access.

[0015] In one implementation, the first message also includes a message verification code. When the first message includes a random access reason value, the message verification code is obtained by encrypting the random access reason value, an identifier of the first encryption algorithm and a second public key using a first encryption algorithm and a shared key.

[0016] In this solution, the terminal performs integrity protection on the first message, so that the network device determines whether the terminal maliciously initiates random access, thereby improving communication security.

[0017] In one implementation, before receiving the first information, the method further includes: the terminal receives certificate information, the certificate information includes a public key provided by an institution that issues the certificate; and the terminal performs signature verification on the certificate information according to the public key provided by the institution that issues the certificate.

[0018] In this solution, the network device can also send some content of the digital certificate to the terminal device to facilitate the terminal device to verify whether the network device is legitimate, so as to avoid the terminal from interacting with a fake network device. For example, if the terminal verifies that the network device is not legitimate, it may not receive the first information.

[0019] In a second aspect, an embodiment of the present application provides a communication method that can be performed by a second communication device. The second communication device can be a network device, or the second communication device is a component for implementing the function of the network device. For example, the second communication device is a unit / module, circuit or chip inside the network device. The method provided by the second aspect is described below by taking the second communication device as the network device itself as an example.

[0020] The communication method includes: a network device sends a first message, receives a first message, encrypts a second message according to a first encryption algorithm and a shared key, and sends the encrypted second message. The first message indicates a first public key and at least one encryption algorithm. The at least one encryption algorithm is an encryption algorithm supported by the network device, and the first encryption algorithm belongs to at least one encryption algorithm. The first message indicates the first encryption algorithm and a second public key, and the second public key is a public key of the terminal. The shared key is obtained according to the second public key and the second private key, and the second private key is a private key of the network device.

[0021] In one implementation, the shared key is obtained based on the first public key and the first private key, including: the shared key is obtained based on the first public key, the first private key and the first parameter, and the first parameter includes one or more of the following: TC-RNTI, synchronization signal index, or random access resource index.

[0022] In one implementation, the first message is scrambled by a sequence generated by a preamble sequence index and / or a synchronization signal index.

[0023] In one implementation, the first message also includes a message verification code. When the first message includes a random access preamble, the message verification code is obtained by encrypting the random access preamble, an identifier of the first encryption algorithm, and a second public key using a first encryption algorithm and a shared key.

[0024] In one implementation, the first message also includes a message verification code. When the first message includes a random access reason value, the message verification code is obtained by encrypting the random access reason value, an identifier of the first encryption algorithm and a second public key using a first encryption algorithm and a shared key.

[0025] In one implementation, before sending the first information, the method further includes: the network device obtains certificate information and sends the certificate information. The certificate information includes a public key provided by an institution that issues the certificate, and the public key is used to perform signature verification on the certificate.

[0026] Regarding the beneficial effects of the second aspect and each implementation method, reference may be made to the beneficial effects of the aforementioned first aspect and each implementation method, which will not be repeated here.

[0027] In a third aspect, an embodiment of the present application provides a communication method, which can be performed by a first communication device. The first communication device can be a terminal, or the first communication device is a component for implementing the functions of the terminal. For example, the first communication device is a unit / module, circuit or chip inside the terminal. The method provided in the third aspect is described below by taking the first communication device as the terminal itself as an example.

[0028] The communication method includes: a terminal receives a first message, sends a first message, receives a second message, encrypts a third message according to a first encryption algorithm and a shared key, and sends the encrypted third message. The first information indicates a first public key and at least one encryption algorithm, at least one encryption algorithm is an encryption algorithm supported by the network device, and the first encryption algorithm belongs to at least one encryption algorithm. The first message indicates the first encryption algorithm and the second public key, and the second public key is the public key of the terminal. The shared key used by the network device is obtained according to the second public key and the second private key, and the second private key is the private key of the network device. The shared key used by the terminal is obtained according to the first public key and the first private key, and the first private key is the private key of the terminal.

[0029] The difference from the solution provided in the first aspect is that in this solution, after the terminal obtains the shared key, the third message to be sent to the network device can be encrypted, and the network device may not encrypt the second message. In this solution, the terminal and the network device exchange their public keys in advance, and then obtain the shared key based on the obtained public key and its own private key, and encrypt the message to be sent based on the shared key to improve communication security.

[0030] In one implementation, the method further includes: the terminal decrypting the second message according to the first encryption algorithm and the shared key.

[0031] In one implementation, the shared key is obtained based on the first public key and the first private key, including: the shared key is obtained based on the first public key, the first private key and the first parameter, and the first parameter includes one or more of the following: TC-RNTI, synchronization signal index, or random access resource index.

[0032] In one implementation, the first message is scrambled by a sequence generated by a preamble sequence index and / or a synchronization signal index.

[0033] In one implementation, the first message also includes a message verification code. When the first message includes a random access preamble, the message verification code is obtained by encrypting the random access preamble, an identifier of the first encryption algorithm, and a second public key using a first encryption algorithm and a shared key.

[0034] In one implementation, the first message also includes a message verification code. When the first message includes a random access reason value, the message verification code is obtained by encrypting the random access reason value, an identifier of the first encryption algorithm and a second public key using a first encryption algorithm and a shared key.

[0035] In one implementation, before receiving the first information, the method further includes: the terminal receives certificate information, the certificate information includes a public key provided by an institution that issues the certificate; and the terminal performs signature verification on the certificate information according to the public key provided by the institution that issues the certificate.

[0036] Regarding the beneficial effects of the third aspect and each implementation method, reference may be made to the beneficial effects of the aforementioned first aspect and each implementation method, which will not be repeated here.

[0037] In a fourth aspect, an embodiment of the present application provides a communication method that can be performed by a second communication device. The second communication device can be a network device, or the second communication device is a component for implementing the function of the network device. For example, the second communication device is a unit / module, circuit or chip inside the network device. The method provided in the fourth aspect is described below by taking the second communication device as the network device itself as an example.

[0038] The communication method includes: the network device sends a first message, receives a first message, sends a second message, and decrypts a third message according to a first encryption algorithm and a shared key. The first information indicates a first public key and at least one encryption algorithm. At least one encryption algorithm is an encryption algorithm supported by the network device, and the first encryption algorithm belongs to at least one encryption algorithm. The first message includes a random access preamble, an identifier of the first encryption algorithm, and a second public key, the second public key is a public key of the terminal, and an encryption algorithm supported by the network device. The shared key is obtained according to the second public key and the second private key, and the second private key is a private key of the network device.

[0039] In one implementation, before sending the second message, the method further includes: the network device encrypting the second message according to the first encryption algorithm and the shared key.

[0040] In one implementation, the shared key is obtained based on the first public key and the first private key, including: the shared key is obtained based on the first public key, the first private key and the first parameter, and the first parameter includes one or more of the following: TC-RNTI, synchronization signal index, or random access resource index.

[0041] In one implementation, the first message is scrambled by a sequence generated by a preamble sequence index and / or a synchronization signal index.

[0042] In one implementation, the first message also includes a message verification code. When the first message includes a random access preamble, the message verification code is obtained by encrypting the random access preamble, an identifier of the first encryption algorithm, and a second public key using a first encryption algorithm and a shared key.

[0043] In one implementation, the first message also includes a message verification code. When the first message includes a random access reason value, the message verification code is obtained by encrypting the random access reason value, an identifier of the first encryption algorithm and a second public key using a first encryption algorithm and a shared key.

[0044] In one implementation, before receiving the first information, the method further includes: the network device obtains certificate information and sends the certificate information, where the certificate information includes a public key provided by an institution that issues the certificate.

[0045] Regarding the beneficial effects of the fourth aspect and each implementation method, reference may be made to the beneficial effects of the aforementioned first aspect and each implementation method, which will not be repeated here.

[0046] In a fifth aspect, an embodiment of the present application provides a communication method, which can be performed by a first communication device. The first communication device may be a terminal, or the first communication device may be a component for implementing the functions of the terminal. For example, the first communication device may be a unit / module, a circuit or a chip inside the terminal. The method provided in the fifth aspect is described below by taking the first communication device as the terminal itself as an example.

[0047] The communication method includes: the terminal receives the first information, sends the first message, and receives the second message, and decrypts the second message according to the first encryption algorithm and the shared key. The first information indicates the first public key and at least one encryption algorithm, and the first public key is the public key of the network device. At least one encryption algorithm is an encryption algorithm supported by the network device, and the first encryption algorithm belongs to at least one encryption algorithm. The first message indicates the first encryption algorithm and the second public key, the second public key is the public key of the terminal, and the first message is scrambled by a sequence generated by a preamble sequence index and / or a synchronization signal index. The first message also includes a random access preamble or a random access reason value. The shared key is obtained based on the first public key and the first private key, and the first private key is the private key of the terminal.

[0048] Accordingly, in a sixth aspect, an embodiment of the present application provides a communication method that can be performed by a second communication device. The second communication device can be a network device, or the second communication device can be a component for implementing the functions of the network device. For example, the second communication device is a unit / module, circuit or chip inside the network device. The method provided in the sixth aspect is described below by taking the second communication device as the network device itself as an example. Of course, the method provided in the sixth aspect can also be implemented by a unit / module, circuit or chip inside the network device.

[0049] The communication method includes: a network device sends a first message, receives a first message, and encrypts a second message according to a first encryption algorithm and a shared key. The first information indicates a first public key and at least one encryption algorithm, and at least one encryption algorithm is an encryption algorithm supported by the network device. The first message indicates a first encryption algorithm and a second public key, and the second public key is a public key of the terminal. The first message is scrambled by a sequence generated by a preamble sequence index and / or a synchronization signal index. The first encryption algorithm belongs to at least one encryption algorithm. The first message also includes a random access preamble or a random access reason value. The shared key is obtained based on the second public key and the second private key, and the first private key is a private key of the network device.

[0050] In the method provided in the fifth aspect or the sixth aspect, the network device and the terminal exchange each other's public keys during the random access process, and subsequently encrypt the message to be sent based on the shared key. This scheme can reduce the leakage of information during the random access process and improve communication security. In addition, the terminal can also scramble the first message through a sequence generated by a preamble code sequence index and / or a synchronization signal index to further improve communication security.

[0051] In a seventh aspect, an embodiment of the present application provides a communication method, which can be performed by a first communication device and a second communication device. The first communication device may be a terminal, or the first communication device may be a component for implementing the functions of the terminal. For example, the first communication device is a unit / module, a circuit or a chip inside the terminal. The second communication device may be a network device, or the second communication device may be a component for implementing the functions of the network device. For example, the second communication device is a unit / module, a circuit or a chip inside the network device. The method provided in the seventh aspect is described below by taking the first communication device as the terminal itself and the second communication device as the network device itself as an example.

[0052] The communication method includes: a network device sends a first message to a terminal, the first message indicates a first public key and at least one encryption algorithm, and the at least one encryption algorithm is an encryption algorithm supported by the network device; the terminal sends a first message to the network device, the first message indicates a first encryption algorithm and a second public key; the network device encrypts a second message according to the first encryption algorithm and a shared key, and sends a second message, the shared key is obtained according to the second public key and the first private key, the first private key is the private key of the network device, and the first encryption algorithm belongs to at least one encryption algorithm; the terminal receives the second message, decrypts the second message according to the first encryption algorithm and the shared key, the shared key is obtained according to the first public key and the second private key, and the second private key is the private key of the terminal. The first message also includes a random access preamble or a random access reason value.

[0053] In an eighth aspect, an embodiment of the present application provides a communication method, which can be performed by a first communication device and a second communication device. The first communication device may be a terminal, or the first communication device may be a component for implementing the functions of the terminal. For example, the first communication device is a unit / module, a circuit or a chip inside the terminal. The second communication device may be a network device, or the second communication device may be a component for implementing the functions of the network device. For example, the second communication device is a unit / module, a circuit or a chip inside the network device. The method provided in the eighth aspect is described below by taking the first communication device as the terminal itself and the second communication device as the network device itself as an example.

[0054] The communication method includes: a network device sends a first message to a terminal, the first message indicates a first public key and at least one encryption algorithm, and the at least one encryption algorithm is an encryption algorithm supported by the network device; the terminal sends a first message to the network device, the first message indicates a first encryption algorithm and a second public key, and the first encryption algorithm belongs to at least one encryption algorithm; the network device sends a second message to the terminal; the terminal encrypts a third message according to the first encryption algorithm and a shared key, and sends the encrypted third message to the network device. The shared key is obtained according to the first public key and the first private key, and the first private key is the private key of the terminal.

[0055] Ninthly, an embodiment of the present application provides a communication device, which has the function of implementing the behaviors in the method examples of the first to sixth aspects above. The beneficial effects can be found in the relevant descriptions of the first to sixth aspects and will not be repeated here. For example, the communication device may be a terminal in the first aspect, the third aspect, or the fifth aspect, or the communication device may be a network device in the second aspect, the fourth aspect, or the sixth aspect. For another example, the communication device may be a device that can support the terminal to implement the functions required by the method provided in the first aspect, the third aspect, or the fifth aspect, for example, the communication device may be a chip or a chip system in the terminal. Or, for another example, the communication device may be a device that can support the network device to implement the functions required by the method provided in the second aspect, the fourth aspect, or the sixth aspect, for example, the communication device may be a chip or a chip system in the network device.

[0056] In one possible design, the communication device includes a baseband device and a radio frequency device.

[0057] In one possible design, the communication device includes corresponding means or modules for executing the method of any aspect from the first aspect to the sixth aspect. For example, the communication device includes a processing unit (sometimes also referred to as a processing module or processor) and / or a transceiver unit (sometimes also referred to as a transceiver module or transceiver). The transceiver unit can implement the sending function and the receiving function. When the transceiver unit implements the sending function, it can be called a sending unit (sometimes also referred to as a sending module). When the transceiver unit implements the receiving function, it can be called a receiving unit (sometimes also referred to as a receiving module). The sending unit and the receiving unit can be the same functional unit, which is called a transceiver unit, and the functional unit can implement the sending function and the receiving function; or, the sending unit and the receiving unit can be different functional units, and the transceiver unit is a general term for these functional units. These units (modules) can perform the corresponding functions in the method examples of any aspect from the first aspect to the sixth aspect above. Please refer to the detailed description in the method examples for details, which will not be repeated here.

[0058] In the tenth aspect, an embodiment of the present application provides a communication device, which may be the communication device in the ninth aspect of the above-mentioned embodiment, or a chip or chip system arranged in the communication device in the ninth aspect. The communication device includes a communication interface and a processor, and optionally, also includes a memory. Among them, the memory is used to store computer programs or instructions or data, and the processor is coupled to the memory and the communication interface. When the processor reads the computer program or instructions or data, the communication device executes the method executed by the terminal in the above-mentioned method embodiment. For example, the communication device may be a terminal or a functional module in the terminal, such as a baseband chip and a radio frequency chip. Alternatively, when the processor reads the computer program or instructions or data, the communication device executes the method executed by the network device in the above-mentioned method embodiment. For example, the communication device may be a network device or a functional module in the network device, such as a baseband chip and a radio frequency chip.

[0059] In the eleventh aspect, an embodiment of the present application provides a chip system, which includes a processor and may also include a communication interface for implementing the method described in any of the first to fourth aspects. Optionally, the chip system also includes a memory. The memory is used to store a computer program (also referred to as code, or instruction). The processor is used to call and run a computer program from the memory, so that a device equipped with a chip system executes the method in the first aspect and any possible implementation thereof, or a device equipped with a chip system executes the method in the second aspect and any possible implementation thereof, or a device equipped with a chip system executes the method in the third aspect and any possible implementation thereof, or a device equipped with a chip system executes the method in the fourth aspect and any possible implementation thereof, or a device equipped with a chip system executes the method in the fifth aspect and any possible implementation thereof, or a device equipped with a chip system executes the method in the sixth aspect and any possible implementation thereof. The chip system may be composed of a chip, or may include a chip and other discrete devices.

[0060] In a twelfth aspect, an embodiment of the present application provides a communication device, which includes an input / output interface and a logic circuit. The input / output interface is used to input and / or output information. The input / output interface can be an interface circuit, an output circuit, an input circuit, a pin or a related circuit, etc. The logic circuit is used to execute the method described in any aspect of the first aspect to the sixth aspect.

[0061] In the specific implementation process, the above-mentioned communication device can be a chip, the input circuit can be an input pin, the output circuit can be an output pin, and the logic circuit can be a transistor, a gate circuit, a trigger, and various logic circuits. The input signal received by the input circuit can be, for example, but not limited to, received and input by a receiver, and the signal output by the output circuit can be, for example, but not limited to, output to a transmitter and transmitted by the transmitter, and the input circuit and the output circuit can be the same circuit, which is used as an input circuit and an output circuit at different times. This application does not limit the specific implementation of the input and output interface and the logic circuit.

[0062] In one implementation, when the communication device is a wireless communication device, the wireless communication device may be a terminal device such as a mobile phone. The interface circuit may be a radio frequency processing chip in the wireless communication device, and the processing circuit may be a baseband processing chip in the wireless communication device.

[0063] In a thirteenth aspect, an embodiment of the present application provides a communication system, the communication system comprising a terminal and a network device. The terminal is used to implement the function of the method described in the first aspect, and the network device is used to implement the function of the method described in the second aspect; or the terminal is used to implement the function of the method described in the third aspect, and the network device is used to implement the function of the method described in the fourth aspect; or the terminal is used to implement the function of the method described in the fifth aspect, and the network device is used to implement the function of the method described in the sixth aspect.

[0064] In the fourteenth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium is used to store a computer program or instruction, which, when executed, enables the method described in the first aspect and any possible implementation thereof to be implemented, or enables the method described in the second aspect and any possible implementation thereof to be implemented, or enables the method described in the third aspect and any possible implementation thereof to be implemented, or enables the method described in the fourth aspect and any possible implementation thereof to be implemented, or enables the method described in the fifth aspect and any possible implementation thereof to be implemented, or enables the method described in the sixth aspect and any possible implementation thereof to be implemented.

[0065] In the fifteenth aspect, the embodiments of the present application also provide a computer program product comprising instructions, which, when executed on a computer, enables the method described in the first aspect and any possible implementation thereof to be implemented, or enables the method described in the second aspect and any possible implementation thereof to be implemented, or enables the method described in the third aspect and any possible implementation thereof to be implemented, or enables the method described in the fourth aspect and any possible implementation thereof to be implemented, or enables the method described in the fifth aspect and any possible implementation thereof to be implemented, or enables the method described in the sixth aspect and any possible implementation thereof to be implemented.

[0066] The beneficial effects of the above-mentioned ninth to fifteenth aspects and their implementation methods can refer to the description of the beneficial effects of the first to sixth aspects and any possible implementation methods thereof. BRIEF DESCRIPTION OF THE DRAWINGS

[0067] Figure 1 A schematic diagram of a communication system provided in an embodiment of the present application;

[0068] Figure 2 An example schematic diagram of a SPARROW attack provided in an embodiment of the present application;

[0069] Figure 3 A schematic diagram of the process of DH key negotiation and generation of a shared key provided in an embodiment of the present application;

[0070] Figure 4 A flow chart of a communication method 400 provided in an embodiment of the present application;

[0071] Figure 5 A schematic diagram of a shared key derivation process provided in an embodiment of the present application;

[0072] Figure 6 A flow chart of a communication method 600 provided in an embodiment of the present application;

[0073] Figure 7 A flow chart of a communication method 700 provided in an embodiment of the present application;

[0074] Figure 8 A schematic diagram of the structure of a communication device provided in an embodiment of the present application;

[0075] Fig. 9 Another structural schematic diagram of a communication device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0076] The method provided by the embodiment of the present application can prevent malicious attack devices from leaking information, improve the reliability of identifying malicious attack devices tampering with information, and thus improve communication security. The solution provided by the embodiment of the present application is further introduced below in conjunction with the accompanying drawings.

[0077] The technical solution provided in the embodiments of the present application can be applied to the communication system related to the 3rd Generation Partnership Project (3GPP), for example, the long term evolution (LTE) communication system, the sixth generation (5G) mobile communication system, or can also be applied to other next generation mobile communication systems, such as the sixth generation (6G) communication system, or other similar communication systems. Other similar communication systems may include wireless fidelity (WIFI), vehicle to everything (V2X), Internet of Things (IoT) system, narrowband Internet of Things (NB-IoT) system, and the like.

[0078] See also Figure 1 , shows a communication system applicable to the embodiment of the present application. The communication system includes a wireless access network 100 and a core network 200. Optionally, the communication system may also include an Internet 300 ( Figure 1 Take this as an example).

[0079] The wireless access network 100 may include at least one network device and at least one terminal. For example, the wireless access network 100 includes two network devices 110a and 110b and terminals 120a to 120j. Figure 1 The network architecture shown is only for illustration, and the number of terminals and / or network devices may be less or more. The communication system described in the embodiment of the present application is to more clearly illustrate the technical solution of the embodiment of the present application, and does not constitute a limitation on the communication system applicable to the embodiment of the present application. For example, the communication system may also include other devices, such as wireless relay devices and wireless backhaul devices. Figure 1 Not drawn in the figure. It is known to those skilled in the art that, with the evolution of network architecture, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems. When the technical solutions in the embodiments of the present application are applied to other communication systems, the devices, components, modules, etc. in the embodiments can be replaced with corresponding devices, components, modules in other communication systems without limitation.

[0080] The network devices involved in the embodiments of the present application are mainly access network devices. Therefore, in the following text, unless otherwise specified, the "network devices" refer to radio access network (RAN) devices, which can be referred to as access network devices for short. RAN can be a 3GPP-related cellular system, for example, a 5G mobile communication system, or a future-oriented evolution system (such as a 6G mobile communication system). RAN can also be an open access network (open RAN, O-RAN or ORAN), a cloud radio access network (cloud radio access network, CRAN), or a virtualized radio access network (virtualized RAN, vRAN), etc. RAN can also be a communication system that is a fusion of two or more of the above systems. RAN devices can also be called RAN nodes, RAN entities, or access nodes, etc.

[0081] In one possible scenario, the RAN node may be a base station, an evolved NodeB (eNodeB), an access point (AP), a transmission reception point (TRP), a next generation NodeB (gNB), a next generation base station in a 6G mobile communication system, a base station in a future mobile communication system, etc. The RAN node may be a macro base station, a micro base station, an indoor station, a relay node, a donor node / host node, or a wireless controller, etc. The RAN node may also be a server, a wearable device, a vehicle or an onboard device, etc. For example, the RAN node in the V2X technology may be a road side unit (RSU).

[0082] In another possible scenario, the RAN node may be a module or unit that completes part of the functions of the base station; or multiple RAN nodes collaborate to assist the terminal device in achieving wireless access, and different RAN nodes respectively implement part of the functions of the base station. For example, the RAN node may be a centralized unit (CU), a distributed unit (DU) or a radio unit (RU), etc. The functions of the CU may be implemented by one entity, or by different entities. For example, the functions of the CU may be further divided, that is, the control plane and the user plane may be separated and implemented by different entities, namely, the control plane CU entity (i.e., CU-control plane (CP) entity) and the user plane CU entity (i.e., CU-user plane (UP) entity). The CU-CP entity and the CU-UP entity may be coupled with the DU to jointly complete the functions of the RAN node. The CU and the DU may be separately set, or may be included in the same network element, such as a baseband unit (BBU).

[0083] In different systems, CU (or CU-CP and CU-UP), DU or RU may also have different names, but those skilled in the art can understand their meanings. For example, in the Open-RAN (ORAN) system, CU may also be called O-CU (Open CU), DU may also be called O-DU, CU-CP may also be called O-CU-CP, CU-UP may also be called O-CU-UP, and RU may also be called O-RU. For the convenience of description, CU, CU-CP, CU-UP, DU and RU are used as examples for description in this application. Any unit of CU (or CU-CP, CU-UP), DU and RU in this application may be implemented by a software module, a hardware module, or a combination of a software module and a hardware module.

[0084] CU and DU can be configured according to the protocol layer functions of the wireless network they implement: for example, CU is configured to implement the functions of the packet data convergence protocol (PDCP) layer and the protocol layers above (such as the radio resource control (RRC) layer and / or the service data adaptation protocol (SDAP) layer, etc.); DU is configured to implement the functions of the protocol layers below the PDCP layer (such as the radio link control (RLC), MAC layer, and / or the physical (PHY) layer, etc.). For another example, CU is configured to implement the functions of the protocol layers above the PDCP layer (such as the RRC layer and / or the SDAP layer), and DU is configured to implement the functions of the PDCP layer and the protocol layers below (such as the RLC layer, the MAC layer, and / or the PHY layer, etc.). For a detailed description of each of the above-mentioned protocol layers, reference may be made to the relevant technical specifications of 3GPP or the technical specifications of other applicable communication protocols. The above division of the processing functions of CU and DU according to the protocol layer is only an example, and can also be divided in other ways, which is not limited by the present application. For example, in one design, the CU or DU can also be divided into partial processing functions with protocol layers. In one design, part of the functions of the RLC layer and the functions of the protocol layers above the RLC layer are set in the CU, and the remaining functions of the RLC layer and the functions of the protocol layers below the RLC layer are set in the DU.

[0085] In the embodiments of the present application, the device for realizing the function of the network device can be the network device itself, or a device that can support the network device to realize the function, such as a chip system or a combination device or component that can realize the function of the network device, and the device can be installed in the network device. The embodiments of the present application do not limit the specific technology and specific device form adopted by the network device.

[0086] In the embodiments of the present application, anything that can communicate data with a base station can be regarded as a terminal. A terminal is also referred to as a terminal device, a terminal apparatus, a user equipment (UE), a mobile station, or a mobile terminal. The terminal can be widely used in various scenarios, such as D2D communication, V2X communication, machine-type communication (MTC), IoT, virtual reality, augmented reality, industrial control, automatic driving, telemedicine, smart grid, smart furniture, smart office, smart wear, smart transportation, or smart city. For example, the terminal device can be: a mobile phone, a computer, a mobile internet device (MID), a wearable device, a virtual reality (VR) device, an augmented reality (AR) device, a station (STA) mechanical arm, a camera, a robot, or a smart home device (such as a TV, an air conditioner, a sweeper, a speaker, a set-top box), a relay, a customer premise equipment (CPE), etc.

[0087] The various terminals introduced above, if located on a vehicle (e.g., placed / installed in a vehicle), can all be considered as vehicle-mounted terminals. The vehicle-mounted terminal can be a vehicle-mounted module, a vehicle-mounted module, a vehicle-mounted component, a vehicle-mounted chip or a vehicle-mounted unit built into the vehicle as one or more components or units, and the vehicle can implement the method of the present application through the built-in vehicle-mounted module, vehicle-mounted module, vehicle-mounted component, vehicle-mounted chip or vehicle-mounted unit. The vehicle-mounted terminal can be a complete vehicle device, a vehicle-mounted module, a vehicle, an on-board unit (on board unit, OBU), a roadside unit (roadside unit, RSU), a vehicle-mounted system (or a vehicle-mounted sending unit) (telematics box, T-box), a chip or a system on chip (system on chip, SOC), etc. The above chip or SOC can be installed in a vehicle, OBU, RSU or T-box.

[0088] In the embodiments of the present application, the device for realizing the function of the terminal may be the terminal device itself, or may be a device capable of supporting the terminal to realize the function, such as a chip system or a combination device or component capable of realizing the terminal function, and the device may be installed in the terminal. The embodiments of the present application do not limit the specific technology and specific device form adopted by the terminal. In the embodiments of the present application, the terminal and the terminal device are replaceable.

[0089] Before introducing specific embodiments, some technical terms involved in this application are introduced in detail.

[0090] (1) Random access process

[0091] The random access process includes 2-step random access and 4-step random access. First, 4-step random access is introduced. 4-step random access involves 4 types of random access messages, which are random access message 1 to random access message 4. Random access message 1 is a random access preamble, which can be referred to as message 1 (message1, Msg1). Random access message 2 is a response message to random access message 1, also known as a random response message, which can be referred to as message 2 (Msg2). Random access message 3 and random access message 4 are used to resolve contention conflicts for the contention access mechanism. Random access message 3 is also known as Msg3, which can carry a random access cause value. Random access message 4 is also known as a conflict resolution message / contention resolution message / Msg4, which can carry the content carried by random access message 3. Any terminal can send Msg1 and Msg3 to the network device, and accordingly, the network device responds to Msg1 with Msg2 and responds to Msg3 with Msg4. (2) Stealth pirating attack by RACH rebroadcast overwriting (SPARROW)

[0092] SPARROW attacks involve using MAC layer protocols to achieve covert communications by using other people's networks for remote communications. In the present application, covert communications include but are not limited to data leakage, remote commands, control activities, etc. For example, for example, vulnerabilities in MAC layer protocols can allow unauthorized devices (i.e. malicious attack devices) to leak unsecured information through the service provider's infrastructure. Figure 1 For example, the unauthorized device may be terminal 120a, the infrastructure of the service provider may be network device 110a, and terminal 120a may leak unsafe information to terminal 120e through network device 110a.

[0093] It is understandable that the messages exchanged during the random access process are transmitted at the MAC layer. Since the terminal has not entered the RRC connection state, the network device and the terminal cannot align the key. Therefore, most of the information exchanged during the random access process has no protection mechanism set up, there are security vulnerabilities, and the information is easily leaked. A typical SPARROW attack is to leak information during the random access process.

[0094] For example, see Figure 2 , Figure 2 An example of a SPARROW attack is shown. Figure 2 In the example, the first terminal and the second terminal are both located within the coverage of the network device. It can be understood that, taking the random access performed by the first terminal as an example, the process includes S201-S204.

[0095] S201, a first terminal sends a random access preamble (RA-preamble) to a network device. The random access preamble is Msg1. After sending Msg1, the first terminal starts a random access response time window (ra-ResponseWindow) to detect Msg2 from the network device within the random access response time window.

[0096] S202. The network device sends a response message of the random access preamble to the first terminal.

[0097] In response to Msg1, the network device sends Msg2 to the first terminal. Msg2 is the response message of the random access preamble. If the Msg2 carries the identifier (ID) of the RA-preamble, the first terminal considers that the RA response is successful and subsequently executes S203. If the first terminal does not receive the Msg2 corresponding to Msg1 in the random access response time window, the first terminal considers that the RA response has failed. The first terminal does not receive the Msg2 corresponding to Msg1; or, the first terminal receives Msg2, but the identifier of the RA-preamble in the Msg2 is not the identifier of Msg1. When the first terminal considers that the RA response has failed, it may initiate the random access process again until the number of times the random access process is initiated is equal to the maximum number of random access attempts.

[0098] S203. The first terminal sends a random access message 3 to the network device.

[0099] The first terminal receives Msg2 and may send a random access message 3, namely Msg3, to the network device. Msg3 may be an RRC Setup Request message transmitted during the RRC establishment process, including the RRC connection establishment reason and the identifier (ID) of the first terminal. The ID of the first terminal may be an S-temporary mobile subscriber identity (S-TMSI) or a random number. Msg3 may also be an RRC Resume Request message during the RRC recovery process or an RRC Re-establishment Request message during the RRC reconstruction process. If Msg3 is an RRC Re-establishment Request, the ID of the first terminal included in Msg3 may be composed of the cell radio network temporary identifier (C-RNTI), the physical cell ID and the short integrity message authentication code (MAC-I).

[0100] S204. The network device broadcasts a response message to the random access message 3.

[0101] After receiving Msg3, the network device may broadcast a response message of random access message 3, namely Msg4, which may include the content carried by Msg3. Msg4 may be carried on a physical downlink shared channel (PDSCH) scheduled by a physical downlink control channel (PDCCH).

[0102] The principle of resolving contention conflicts between Msg3 and Msg4 is: after the first terminal sends Msg3, it can start the contention resolution timer and detect Msg4 from the network device within the timing duration of the timer. In one scenario, C-RNTI MAC CE is included in Msg3. If UE1 can successfully parse the PDCCH of Msg4 based on C-RNTI, it is considered that random access is successful, and the first terminal stops the contention resolution timer, otherwise the contention resolution timer is not stopped. In another scenario, the common control channel (CCCH) service data unit (SDU) sent by UE1 in Msg3 includes a contention resolution identity. CCCH SDU, for example, carries the content of the RRC Setup Request message. If the first terminal detects Msg4 carried by PDSCH scheduled by PDCCH, and successfully parses the PDCCH of Msg4 using TC-RNTI, and can successfully parse the contention resolution identity MAC CE in Msg4, and the identity in the MAC CE is the same as the contention resolution identity carried by Msg3 sent by the first terminal (i.e., MAC PDU decoding is successful), then the first terminal considers that random access is successful, the first terminal stops the contention resolution timer, and sets TC-RNTI to C-RNTI. If the contention resolution timer times out, the first terminal will discard the TC-RNTI and consider that the contention resolution has failed.

[0103] Since Msg4 broadcasted by the network device contains the content carried by Msg3, and when the first terminal attempts to access the network device for the first time, the messages (Msg1 to Msg4) exchanged between the first terminal and the network device do not involve identity authentication or information integrity verification, if the first terminal is a malicious attacker, it can tamper with the content carried by Msg3 and conduct covert communication by broadcasting Msg4 by the network device. For example, the first terminal can carry the content (such as information A) that it wants to disclose to the second terminal in Msg3 ( Figure 2 Taking this as an example), it is sent to the network device; the network device responds to the Msg3 and broadcasts Msg4, which carries the content included in Msg3 (for example, information A). The second terminal is located in the coverage area of ​​the network device and can receive Msg4 from the network device to obtain information A. It can be understood that since the Msg3 and Msg4 exchanged between the first terminal and the network device do not involve identity authentication, they can avoid being legally intercepted and cannot track malicious attackers, and the communication security is low.

[0104] like Figure 2 The process shown enables the first terminal to leak information to other devices covered by the network device by tampering with the content contained in Msg3 during the random access process before completing the network identity authentication. As the network coverage expands, malicious attackers can leak information to a longer distance. For example, the first terminal will leak information to the second terminal covered by the network device through the network device, and the second terminal can continue to leak information to the third terminal through the network device. The third terminal and the second terminal are located in the coverage of the same network device, and the network device and the network device covering the first terminal can be the same network device or different network devices.

[0105] Above Figure 2 Take 4-step random access as an example. In the 2-step random access process, 2 types of random access messages are involved, and these 2 random access messages are random access message 1 (also called random access message A, abbreviated as MsgA) ~ random access message 2 (also called random access message B, abbreviated as MsgB). It can be understood that the random access message 1 / random access message A in the 2-step random access process is equivalent to the random access message 1 and random access message 3 in the 4-step random access process; the random access message 2 / random access message B in the 2-step random access process is equivalent to the random access message 2 and random access message 4 in the 4-step random access process. For details, please refer to the introduction of the aforementioned 4-step random access process, which will not be repeated here. In an embodiment of the present application, MsgA can be replaced with Msg1 or Msg3, and accordingly, MsgB can be replaced with Msg2 or Msg4. Alternatively, Msg1 can be replaced with MsgA, Msg2 can be replaced with MsgB; Msg3 can be replaced with MsgA, and Msg4 can be replaced with MsgB.

[0106] (3) Diffie-Hellman (DH) Key Negotiation

[0107] DH key negotiation is actually exchanging part of the content used to generate a shared key to create a shared key that can be used for encryption and / or security verification. The communicating parties encrypt and / or secure the information to be exchanged based on the shared key. Taking the communicating parties as device A and device B as an example, device A can generate a shared key based on the private key stored locally on device A and the public key from device B; device B can generate a shared key based on the local private key of device B and the public key from device A. Device A encrypts or secures the information sent to device B based on the generated shared key, and accordingly, device B decrypts or securely verifies the information received from device A based on the generated shared key.

[0108] DH key negotiation is actually the exchange of public keys between the two communicating parties. Figure 3 , Figure 3 This is a schematic diagram of the DH key negotiation and the process of generating a shared key provided by the embodiments of this application. Figure 3 Take the negotiation of the DH key between device A and device B as an example.

[0109] As Figure 3 shown, before device A and device B negotiate the DH key, they need to exchange some public parameters for determining the public keys exchanged between device A and device B. These public parameters are public and can be obtained by any device. For example, when device A connects to device B, it can send the public parameters p and g to device B. Among them, p is a prime number, and g is a generator for generating p. Device A can generate a random number Xa as the private key of device A according to p, and then determine the public key Ya of device A according to Xa, g, and p. Among them, Ya = (g Xa ) mod p, "mod" is for modulo operation, and Xa < p. Device A sends Ya to device B. Device B receives Ya and calculates the shared key K according to Ya and the private key Xb of device B, K = (Ya Xb ) mod p, Xb < p. Similarly, device B generates a random number Xb as the private key of device B according to p, and then determines the public key Yb of device B according to Xb, g, and p. Among them, Yb = (g Xb ) mod p, "mod" is for modulo operation. Device B sends Yb to device A. Device A receives the public key Yb of device B and calculates the shared key K according to Yb and the private key Xa of device A, K = (Yb Xa ) mod p. Among them, the K generated by device A and the K generated by device B are a pair of DH keys, and the two are the same, that is, the shared key K = g XaXb (mod p).

[0110] Xa is saved locally on device A, and Xb is stored locally on device B. Device A sends Ya to device B, and device B sends Yb to device A. Since the shared key K of device A needs to be generated according to Xa, and the shared key K of device B needs to be generated according to Xb, even if Ya or Yb is obtained by a malicious attacker during the transmission process, the malicious attacker cannot generate the shared key K, which helps to reduce the leakage of information.

[0111] (4) Digital certificate

[0112] A digital certificate is also called a digital identification, which includes the certificate issuing authority, validity period, public key owner information, the public key, and the signature result obtained by digitally signing the certificate issuing authority, validity period, public key owner information and the public key through the local private key of the certificate authority (CA) server. Since the CA server is an authoritative and impartial third-party organization, applying the digital certificate to the device in the communication system can enable the device to establish a secure transmission channel and identity authentication based on the certificate issued by the CA server.

[0113] Taking device A as an example, device A can send the public key, information of device A (i.e., the public key holder), domain name and other information as a certificate application to CA. After receiving the application from device A, the CA verifies the legitimacy of device A. If there is no abnormality, CA will use a hash algorithm to perform a hash operation on the plaintext information (e.g., the issuing authority of the certificate, validity period, the public key sent by device A to the outside, information of device A, etc.) to obtain an information summary, and then encrypt the information summary with the local private key of CA to generate a digital signature. The combination of the digital signature and the above plaintext information is the digital certificate. CA obtains the digital certificate and can issue the digital certificate to device A.

[0114] When device A and device B communicate, device A can send its digital certificate to device B. When device B receives the digital certificate from device A, it can use the CA's public key to verify the signature of the digital certificate. If the verification is successful, it means that the identity of device B is legal and the public key of device B contained in the digital certificate can be used. It should be noted that the CA's public key needs to be distributed using a certificate. Therefore, device A must install the CA's certificate to obtain the CA's public key. Suppose that device C tampered with device B's digital certificate midway, then when device A uses the CA's private key to verify the signature of the digital certificate, the verification fails. Since the signature of the digital certificate depends on the CA's private key, device C cannot obtain the CA's private key. After modifying device B's digital certificate, it cannot calculate the digital signature corresponding to the digital certificate. It can be seen that identity authentication can be achieved based on digital certificates.

[0115] (5) Integrity protection refers to the sender combining the regularly changing parameters with the information to be transmitted with certain operations to obtain the message authentication code for integrity (MAC-I). Correspondingly, the receiver can use the same parameters and the same rules to calculate the expected MAC-I (XMAC-I). By verifying the MAC-I and XMAC-I, it can determine whether the received data is complete, thereby achieving the purpose of protecting the data integrity. If the MAC-I and XMAC-I are consistent, the receiver can confirm that the information from the sender has not been tampered with.

[0116] It should be noted that the present application can encrypt and / or integrity verify one or more messages exchanged during the random access process based on DH key negotiation. To facilitate the understanding of the scheme mentioned in the embodiment of the present application, the technical terms involved in the embodiment of the present application are first introduced. In the embodiment of the present application, "integrity verification" can also be referred to as integrity verification / integrity protection, abbreviated as integrity verification / integrity check / integrity. In the embodiment of the present application, "encryption" and "integrity verification" can be independent algorithms. Alternatively, "encryption" also includes "integrity verification". In other words, "encryption" includes both encryption and integrity verification.

[0117] From the above analysis, it can be seen that the malicious attack device can leak information through the network device during the random access process. In view of this, the solution provided by the embodiment of the present application is proposed. In the embodiment of the present application, one or more messages exchanged during the random access process are encrypted and / or integrity verified to improve communication security.

[0118] The technical solution provided by the embodiments of the present application is described below in conjunction with the accompanying drawings.

[0119] In various embodiments of the present application, "when", "if" and "if" all mean that the device will make corresponding processing under certain objective circumstances, which does not limit the time, nor does it require that the device must have a judgment action when it is implemented, nor does it mean that there are other limitations. Unless otherwise specified, "if" and "if" are interchangeable, and "when" and "in the case of" are interchangeable. "When" and "if" / "if" are interchangeable.

[0120] In the embodiments of the present application, the number of nouns, unless otherwise specified, means "singular noun or plural noun", that is, "one or more". "At least one" means one or more, and "plural" means two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. For example, A / B means: A or B. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c means: a, b, c, a and b, a and c, b and c, or a and b and c, where a, b, c can be single or multiple.

[0121] The ordinal numbers such as "first" and "second" mentioned in the embodiments of the present application are used to distinguish multiple objects, and are not used to limit the size, content, order, timing, priority or importance of multiple objects. For example, the first group of terminals and the second group of terminals refer to two different terminal groups, and do not represent the difference in content, priority or importance of the two terminal groups. For a technical feature, the technical features in the technical feature are distinguished by "A", "B", "C" and "D", and there is no order of precedence or size between the technical features described by "A", "B", "C" and "D". For example, the method A and method B in this article are only to distinguish different conjugate processing methods, and do not limit the order of precedence or size between method A and method B, as well as the priority or importance, etc.

[0122] The following describes the communication method provided in the embodiment of the present application by taking the communication method provided in the embodiment of the present application as an example in which the communication method is performed by a network device and a terminal. The steps performed by the network device can be implemented by the RAN device itself, or by a component in the RAN device (such as a baseband chip, or other processing units or processor modules). For example, the network device can be Figure 1 A network device in, for example, network device 110a, or may be Figure 1 The steps performed by the terminal may be implemented by the terminal itself, or by a component (such as a chip, a processing unit, or a processor module) in the first terminal. The terminal may be Figure 1 The terminal shown, such as terminal 120a, or may be Figure 1 The chip (system) in the terminal.

[0123] The communication method provided in the embodiment of the present application combines the DH key negotiation process with the random access process to realize encryption and / or complete protection of one or more information exchanged during the random access process, thereby effectively ensuring the security of communication. In the embodiment of the present application, the first public key is the public key of the network device, denoted by Y NB , the first private key is the private key of the terminal, denoted by X UE ; The second public key is the public key of the terminal, denoted by Y UE , the second private key is the private key of the network device, denoted by X NB , the shared key is recorded as K. In the embodiment of the present application, obtaining the shared key, obtaining the shared key, generating the shared key, and determining the shared key are interchangeable. For example, obtaining the shared key according to the first private key and the first public key can be replaced by obtaining / generating / determining the shared key according to the first private key and the first public key.

[0124] See also Figure 4 , Figure 4 A flow chart of a communication method 400 provided in an embodiment of the present application. Figure 4 The method is described from the perspective of the interaction between the network device and the terminal. It should be understood that the communication method 400 can also be implemented by other devices, such as a chip or a communication device with communication functions. Figure 4 As shown, the process of the communication method 400 includes the following steps.

[0125] S401. A network device sends first information to a terminal, where the first information indicates a first public key and at least one encryption algorithm.

[0126] Accordingly, the terminal receives the first information from the network device. The first information can be used to notify the terminal of the public key of the network device and the encryption algorithm supported by the network device. For example, the first information indicates the first public key Y NB and at least one encryption algorithm. For example, the first information includes a first public key Y NB and an encryption algorithm list, where the encryption algorithm list can be used to indicate at least one encryption algorithm supported by the network device.

[0127] The network device sends the first public key Y through the first information NB Sent to the terminal for the terminal to use according to the first public key Y NB and the private key of the terminal (ie X UE ) obtains a shared key K, thereby using the shared key K to encrypt and / or secure the information to be sent, or using the shared key K to decrypt and / or secure the received information, so as to effectively ensure that the information is not leaked during the communication process. The network device notifies the terminal of the encryption algorithm supported by the network device through the first information, so as to avoid the inability to communicate normally due to the mismatch between the encryption algorithm selected by the terminal and the encryption algorithm supported by the network device.

[0128] Optionally, the network device may also send a digital certificate issued by a certificate issuing authority for the network device to the terminal. Accordingly, the terminal may determine the legitimacy of the network device by performing signature verification on the digital certificate. For details, please refer to the relevant content of the aforementioned digital certificate, which will not be repeated here. If the terminal determines that the network device is not legal, the terminal may not receive the first information. The terminal not receiving the first information includes the terminal receiving the first information and discarding the first information; or the terminal refusing to receive the first information. If the network device is issued a digital certificate, the network device may also send some content included in the digital certificate to the terminal. For example, the first information may also include one or more of the following contents: the issuing authority of the digital certificate, the validity period of the digital certificate, the identity information of the network device, etc.

[0129] The first information may be carried in a system message, and the system message may be a system information block 1 (SIB1). In this case, the network device sending the first information may be replaced by the network device broadcasting the first information. It should be noted that the embodiment of the present application does not limit the signaling that carries the first information. For example, the first information may also be carried in RRC signaling.

[0130] As mentioned above Figure 2 It can be seen that since Msg1 to Msg4 do not involve identity authentication or information integrity verification, the terminal can tamper with the content carried by Msg3 and perform covert communication by broadcasting Msg4 through the network device. To this end, in the embodiment of the present application, the network device uses the first information to enable the terminal to generate a shared key. In the subsequent interaction process, the terminal can encrypt and / or secure the information to be sent according to the generated shared key to improve communication security.

[0131] S402: The terminal sends a first message to the network device, where the first message indicates a first encryption algorithm and a second public key, and the first message also includes a random access preamble or a random access reason value.

[0132] Accordingly, the network device receives the first message from the terminal. The terminal can send the public key of the terminal (ie, Y UE ) and the encryption algorithm used by the terminal are notified to the network device. For example, the first message indicates that the second public key Y UE Assuming that the first encryption algorithm is the encryption algorithm used by the terminal, the first message may include the second public key Y UE It is understandable that the first encryption algorithm is an encryption algorithm supported by the network device, and the terminal can receive the first information and select the first encryption algorithm from the encryption algorithm list.

[0133] In one implementation, the identifier of the first encryption algorithm and the second public key may be sent together with the random access preamble, that is, the first message may also include the random access preamble. For example, in a 2-step random access process, the first message may be Msg1 / MsgA, that is, the random access preamble, the identifier of the first encryption algorithm and the second public key are included in Msg1 / MsgA. For another example, in a 4-step random access process, when the terminal sends the first message, it is actually when the terminal sends Msg1, and the identifier of the first encryption algorithm and the second public key are also sent along with Msg1.

[0134] In another implementation, the identifier of the first encryption algorithm and the second public key may be sent together with Msg3. Alternatively, the identifier and the public key of the first encryption algorithm may be carried in Msg3. In this case, the first message may be Msg3, and the first message includes the identifier of the first encryption algorithm and the second public key. It is understandable that Msg3 also carries a random access cause value, that is, the first message may also include a random access cause value.

[0135] In the above two implementations, when the terminal attempts to access the network device for the first time, it will send the second public key Y UE Notify the network device. In this way, the network device uses the second public key Y UE A shared key K may be generated, based on which a message sent to a terminal during a random access process may be encrypted and / or secured, thereby improving communication security.

[0136] S403: The network device sends a second message.

[0137] The network device receives the first message, and in response to the first message, may send a second message to the terminal. Accordingly, the terminal receives the second message from the network device. It can be understood that the second message is a response message to the first message. According to different implementations of the first message, the second message is also different. The second message is a corresponding message of the first message, which can be replaced by describing that when the first message includes a random access preamble, the second message is Msg2; or, when the first message is Msg3, the second message is Msg4; or, when the first message is MsgA, the second message is MsgB.

[0138] The network device receives the first message and can obtain the second public key Y from the first message UE , according to the second public key Y UE and the private key of the network device (the second private key X in this article) NB ) generates a shared key. When the network device sends the second message, the second message may be encrypted according to the shared key K to prevent the content carried by the second message from being leaked.

[0139] S404: The terminal may decrypt the second message according to the first encryption algorithm and the generated shared key.

[0140] The terminal can obtain the first public key Y from the first information NB , according to the first public key Y NB and the first private key X UE The shared key K is obtained, and the second message is decrypted using the shared key K to obtain the content carried by the second message.

[0141] In the communication method 400, the terminal and the network device can generate a shared key K by exchanging their respective public keys during the random access process. In this way, the network device can subsequently encrypt the second message sent to the terminal based on the shared key K to prevent the content carried by the second message from being leaked. For example, when the first message is Msg3 and the second message is Msg4, the network device broadcasts the second message. Although other terminals can receive the second message, since the shared key K used to encrypt the second message is generated by a private key and a public key, and the corresponding private keys of each terminal are kept by each terminal itself, and each terminal does not know each other's private keys, other terminals cannot obtain the shared key, and cannot decrypt the second message, which can prevent the content carried by Msg4 from being leaked.

[0142] It is understandable that if the first message includes a random access preamble, that is, the first message is Msg1 in the random intervention process, the network device can also encrypt Msg2 sent to the terminal based on the shared key K. The embodiment of the present application does not limit whether the network device encrypts and / or secures Msg2. For example, the first message includes a random access preamble, an identifier of a first encryption algorithm, and a second public key. After receiving the first message, the network device sends Msg2 to the terminal. The Msg2 can be encrypted based on the shared key K generated by the network device, or it can not be encrypted based on the shared key K generated by the network device.

[0143] Similarly, the terminal generates a shared key K, and can also encrypt and / or secure messages sent to the network device based on the shared key K. For example, the first message includes a random access preamble, an identifier of the first encryption algorithm, and a second public key Y UE After receiving the second message, the terminal may further execute S405.

[0144] S405: The terminal sends a third message to the network device.

[0145] Correspondingly, the network device receives a third message from the terminal, and the third message may be Msg3. When the first message includes a random access preamble and the second message is Msg2, the terminal may further send Msg3 to the network device after receiving the second message.

[0146] The terminal may encrypt and / or secure the third message based on the generated shared key K. Alternatively, the terminal may not encrypt the third message.

[0147] It should be noted that whether the network device encrypts and / or secures the second message is independent of whether the terminal encrypts and / or secures the third message. For example, when the first message includes a random access preamble, the network device may encrypt and / or secure the second message to be sent based on the generated shared key K. When the network device encrypts and / or secures the second message based on the generated shared key K, the terminal receives the second message and executes S404. Afterwards, the terminal may encrypt and / or secure the third message to be sent based on the generated shared key K, or may not encrypt and / or secure the third message. When the network device does not encrypt and / or secure the second message, the terminal receives the second message and does not execute S404. Therefore, S404 is not a step that must be executed. Figure 4 Afterwards, the terminal may encrypt and / or secure the third message to be sent based on the generated shared key K, or may not encrypt and / or secure the third message.

[0148] In addition, after the terminal and the network device exchange their respective public keys with each other, the two determine whether to encrypt and / or secure the messages to be sent. For example, the network device receives the third message and broadcasts Msg4. Msg4 can be encrypted based on the shared key and can also be secured. After the terminal receives Msg4, it can send Msg5 to the network device, and the Msg5 can be encrypted and / or secured based on the shared key. Msg5, for example, is an RRC setup complete message, an RRC resume complete message, or an RRC re-establishment complete message. After Msg5, the terminal and the network device can exchange downlink information transfer (DLInformationTransfer) messages, uplink information transfer (ULInformationTransfer) messages, etc.

[0149] As mentioned above, since the terminals do not know each other's private keys, the communication method 400 can reduce the leakage of information from the terminal (e.g., terminal A) to other devices (e.g., terminal B) through Msg3 and Msg4 sent by the network device, or reduce SPARROW attacks. This is because the shared key used to encrypt Msg3 / Msg4 is generated based on the private key of the device sending Msg3 / Msg4 and the public key of the device receiving Msg3 / Msg4. The private keys of each device are maintained by itself, and each other does not know each other's private keys. It is naturally impossible for the devices to generate a shared key K for each other, thereby achieving the purpose of information protection. In a possible scenario, a terminal may leak its private key to other terminals. Continuing with the above example, terminal A may leak its private key to terminal B. In this case, terminal B can also generate a shared key K based on the private key of terminal A and the public key of the network device (i.e., the first public key). In this case, if terminal A tampers with the content in Msg3 (for example, Msg3 includes the information that terminal A wants to disclose), even if the network device encrypts the broadcast Msg4, terminal B can still obtain the information disclosed by terminal A. This is because terminal B can generate the shared key used by terminal A and obtain the information disclosed by terminal A by decrypting the received Msg4.

[0150] In order to further improve the security of communication, in an embodiment of the present application, the shared key used by the terminal and the network device can also be combined with its own private key and the other party's public key to deduce the shared key based on the information that the terminal and the network device only know each other. For the convenience of description, the embodiment of the present application refers to the information that the terminal and the network device only know each other as the first parameter, or in other words, the first parameter in the embodiment of the present application is a terminal-specific (UE specific) parameter, or the first parameter can be a parameter associated with a specific terminal (UE associated). For example, the first parameter may include one or more of the following: TC-RNTI, synchronization signal and physical broadcast channel block (synchronization signal and physical broadcast channel (PBCH) block, SSB) index (referred to as synchronization signal index), or random access resource index. The random access resource index can replace the random access preamble index. Then, the shared key K used by the terminal can be obtained / generated based on the private key of the terminal and the public key of the network device and the first parameter; the shared key K used by the network device can be obtained / generated based on the public key of the terminal and the private key of the network device and the first parameter.

[0151] For example, see Figure 5 , Figure 5 Figure 1 is a schematic diagram of the shared key derivation process. Figure 5 As shown, the terminal uses the first public key YeNB and the first private key X UE Generate an initial shared key, and then deduce the final shared key K based on the first parameter and the initial shared key. UE and the first private key X NB Generate an initial shared key, and then deduce the final shared key K based on the first parameter and the initial shared key. The terminal and the network device use the shared key K for encryption or security. In other words, the first parameter and the initial shared key are input parameters for generating the key stream. When generating the key stream, the terminal uses the first parameter and the initial shared key. Correspondingly, when generating the key stream, the terminal also uses the first parameter and the initial shared key. In other words, the first parameter and the initial shared key are input parameters for generating the security information MAC-I. When generating the security information MAC-I, the terminal uses the first parameter and the initial shared key. Correspondingly, when verifying the security information XMAC-I, the terminal also uses the first parameter and the initial shared key.

[0152] It is understandable that, for terminal A, the information of TC-RNTI, SSB index and random access preamble index are all information known only to terminal A and the network device. Terminal B cannot know the TC-RNTI, SSB index and random access preamble index of terminal A. In this case, even if terminal B knows the private key of terminal A in advance, it cannot obtain the shared key K that terminal A actually wants to use. The embodiment of the present application obtains the shared key K by combining the information that only the terminal and the network device know to each other with their respective private keys and the other party's public key to further improve the security of communication.

[0153] In one implementation, in the method provided in the present application, the first message may also be fully protected so that the network device determines whether there is a terminal that maliciously initiates random access.

[0154] The integrity verification of the first message can be understood as calculating some contents included in the first message, and the obtained calculation result can be used to verify the integrity of the first message. The calculation result can be sent together with the first message, or the calculation result can be carried in the first message. For the convenience of description, the embodiment of the present application refers to the calculation result as a message authentication code. It should be noted that the embodiment of the present application does not limit the specific name of the calculation result, for example, the calculation result can also be called MAC-I.

[0155] When the first message includes a random access preamble, the first message also includes a message verification code, which uses the first encryption algorithm and the shared key K to encrypt the random access preamble, the identifier of the first encryption algorithm, and the second public key Y. UEAlternatively, the terminal uses the first encryption algorithm and the shared key K to encrypt the random access preamble, the identifier of the first encryption algorithm, and the second public key Y UE Encrypt to obtain the message verification code.

[0156] When the first message includes a random access cause value or the first message is Msg3, the first message also includes a message verification code, which uses the first encryption algorithm and the shared key K to encrypt the random access cause, the first encryption algorithm, and the second public key Y. UE Alternatively, the terminal uses the first encryption algorithm and the shared key K to encrypt the random access reason, the first encryption algorithm and the second public key Y UE It should be noted that the random access reason, the first encryption algorithm and the second public key Y contained in the first message are used here. UE For example, if the first message also includes other content, the message authentication code can be obtained by using the first encryption algorithm and the shared key K to encrypt the random access reason, the first encryption algorithm, and the second public key Y. UE And the other contents are encrypted.

[0157] For the network device, receiving the first message, obtaining the identifier of the first encryption algorithm and the second public key Y in the first message UE The network device uses the second public key Y UE and the second private key X eNB Obtain the shared key K, or according to the second public key Y UE and the second private key X NB The network device may perform integrity verification on the message verification code in the first message according to the identifier of the first algorithm and the shared key K to obtain a verification result. If the verification result is consistent with the content carried by the first message except the message verification code, it can be determined that the content in the first message has not been tampered with and the terminal does not maliciously initiate random access.

[0158] It is understandable that different terminals use different shared keys. If there are many first messages sent using the same shared key, and the message verification code in the first message is encrypted using the same shared key, then it means that there is a terminal that maliciously initiates random access. Therefore, the embodiment of the present application enables the network device to determine whether the terminal maliciously initiates random access by fully protecting the first message. If the network device determines that the terminal maliciously initiates random access, the network device does not respond to the first message to improve communication security. If the terminal does not maliciously initiate random access and does not receive a response from the network device, the shared key can be replaced and the first message can be sent again using the replaced shared key.

[0159] It should be noted that, in one implementation, the first message may not be fully secured, that is, the first message does not include a message verification code, which can reduce the load of the first message and reduce the impact on uplink coverage.

[0160] In one implementation, the first message may be scrambled to increase the decoding complexity of the first message by the other end, thereby further improving communication security. The terminal may scramble the first message using information known to both the terminal and the network device. For example, the terminal may scramble the first message using a random access preamble index and / or an SSB index. Scrambling the first message using a random access preamble index and / or an SSB index includes scrambling the first message using a sequence generated by the random access preamble index and / or the SSB index. In other words, the first message is scrambled by a sequence generated by a random access preamble index and / or an SSB index. This makes it impossible for other terminals to parse the first message, thereby achieving the purpose of protecting the content carried by the first message.

[0161] The embodiment of the present application reduces SPARROW attacks by performing DH key negotiation during the random access process. The embodiment of the present application does not limit the timing of DH key negotiation. For example, the terminal can use the second public key Y UE With Msg1 notified to the network device; for another example, the terminal can use Msg3 to send the second public key Y UE Notify the network device. For the network device, whether the message sent to the terminal is encrypted based on the shared key K can be determined by the network device. For the terminal, after obtaining the shared key K, whether the information sent to the network device is encrypted based on the shared key K is also determined by the terminal. For ease of understanding, the following two examples (i.e., the first example and the second example) are used as examples to introduce the method provided in the embodiment of the present application. In the first example, the terminal sends the second public key Y UE In the second example, the terminal sends the second public key Y to the network device through Msg3. UE Take the notification to the network device as an example.

[0162] First example:

[0163] See also Figure 6 , Figure 6 The flow chart of the communication method 600 provided in the embodiment of the present application is as follows. The communication method 600 comprises the following steps:

[0164] S601. A network device sends first information to a terminal, where the first information indicates a first public key and at least one encryption algorithm.

[0165] The specific implementation of S601 can refer to the relevant content of S401 above, which will not be repeated here. Optionally, the network device can also send a digital certificate issued by a certificate authority to the terminal, and accordingly, the terminal can verify the legitimacy of the network device by signing the digital certificate.

[0166] S602: The terminal sends a first message to a network device, where the first message indicates a first encryption algorithm and a second public key, and the first message also includes a random access preamble.

[0167] In S602, the first message includes a random access preamble. The terminal sends the second public key Y UE As Msg1 is sent to the network device, the details may refer to the relevant contents of S402 above, which will not be described again. Optionally, the terminal may perform complete protection on the first message.

[0168] S603: The network device sends a second message.

[0169] The second message is a response message to the first message, for example, the first message is Msg1, and the second message is Msg2. Optionally, the network device may encrypt and / or secure the second message based on the shared key K to improve communication security ( Figure 6 Take this as an example). Alternatively, the network device may not encrypt and / or protect the second message. For details, refer to the relevant content of the aforementioned S403, which will not be repeated here. It can be understood that if the network device encrypts the second message, the terminal decrypts the second message accordingly.

[0170] S604: The terminal sends a third message to the network device, where the third message includes a random access cause value.

[0171] The third message is Msg3. The terminal encrypts the third message based on the first encryption algorithm and the shared key K to include the content carried by the third message. The specific implementation of the terminal encrypting the third message can refer to the relevant content of the aforementioned S405.

[0172] S605. The network device broadcasts a fourth message, where the fourth message is a response message to the third message.

[0173] The fourth message is Msg4. After receiving the third message, the network device may broadcast the fourth message in response to the third message. The fourth message may carry the content included in the third message. The network device may encrypt the fourth message based on the first encryption algorithm and the shared key K. In this case, even if the fourth message is received by other terminals, since the other terminals cannot obtain the shared key K, they cannot obtain the content carried by the fourth message, thereby reducing the leakage of the content carried by the third message due to the broadcast of the fourth message by the network device, thereby improving the security of communication.

[0174] Second example:

[0175] See also Figure 7 , Figure 7 The flow chart of the communication method 700 provided in the embodiment of the present application is as follows. The difference between the communication method 700 and the communication method 600 is that the terminal sends the second public key and the first encryption algorithm to the network device through Msg3. For the repetitive parts, please refer to the relevant contents of the aforementioned communication method 600, which will not be repeated here. The communication method 700 includes the following steps:

[0176] S701. A network device sends first information to a terminal, where the first information indicates a first public key and at least one encryption algorithm.

[0177] S702: The terminal sends a random access preamble to the network device.

[0178] S703: The network device sends a second message.

[0179] S704: The terminal sends a third message to the network device, where the third message includes a random access reason value, an identifier of the first encryption algorithm, and a second public key.

[0180] The third message is Msg3. The difference from S604 is that the terminal sends the second public key and the first encryption algorithm to the network device through Msg3. For the specific implementation, reference may be made to the relevant content of S402 above.

[0181] S705. The network device broadcasts a fourth message, where the fourth message is a response message to the third message.

[0182] The fourth message is Msg4. After receiving the third message, the network device may broadcast the fourth message in response to the third message. The fourth message may carry the content included in the third message. The network device may encrypt the fourth message based on the first encryption algorithm and the shared key K. In this case, even if the fourth message is received by other terminals, since the other terminals cannot obtain the shared key K, they cannot obtain the content carried by the fourth message, thereby reducing the leakage of the content carried by the third message due to the broadcast of the fourth message by the network device, thereby improving the security of communication.

[0183] The embodiments provided in the present application described above respectively introduce the methods provided in the embodiments of the present application from the perspective of the interaction between the terminal and the network device. Among them, the steps performed by the terminal can be implemented by different functional entities constituting the terminal. The steps performed by the network device can be implemented by different functional entities constituting the network device. For example, the network device can be a CU-DU architecture, the CU can generate a second message, and the DU can send a second message. In order to implement the various functions in the method provided in the above-mentioned embodiments of the present application, the terminal and the network device may include a hardware structure and / or a software module to implement the above-mentioned functions in the form of a hardware structure, a software module, or a hardware structure plus a software module. Whether one of the above-mentioned functions is executed in the form of a hardware structure, a software module, or a hardware structure plus a software module depends on the specific application and design constraints of the technical solution.

[0184] The following describes the communication device used to implement the above method in the embodiment of the present application in conjunction with the accompanying drawings. Therefore, the above contents can be used in subsequent embodiments, and repeated contents will not be repeated.

[0185] Figure 8 Schematic block diagram of a communication device 800 provided in an embodiment of the present application. The communication device 800 may be a network device or a terminal in the above-mentioned embodiment. For example, the communication device 800 may be Figure 1 The communication device 800 is a network device or terminal in the network device; or, the communication device 800 is a chip (system) in the network device or a chip (system) in the terminal; or, the communication device 800 is a software module of the network device or the terminal. The communication device 800 can implement the functions or steps implemented by the terminal or the network device in the above-mentioned various method embodiments. The communication device 800 may include a processing module 810 and a transceiver module 820. Optionally, a storage module may be included, which may be used to store instructions (codes or programs) and / or data. The storage module may be, for example, a memory. The processing module 810 and the transceiver module 820 may be coupled to the storage module. For example, the processing module 810 may read instructions (codes or programs) and / or data in the storage module to implement the corresponding method. When the communication device 800 is a chip in the terminal, the storage module may be a storage module in the chip, such as a register, a cache, etc. For example, the storage module may also be a storage module located outside the chip in the network device / terminal, such as a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, a random access memory (RAM), etc. The above-mentioned units may be independently arranged or partially or fully integrated.

[0186] In one possible implementation, the processing module 810 may be a processor or a controller, such as a general-purpose central processing unit (CPU), a general-purpose processor, a digital signal processing (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, transistor logic devices, hardware components or any combination thereof. It may implement or execute various exemplary logic blocks, modules and circuits described in conjunction with the disclosure of the present application. The processor may also be a combination that implements a computing function, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, and the like. The transceiver module 820 is a transceiver, an interface circuit, a bus, a pin or other possible communication interface for receiving signals from other devices. For example, when the device is implemented in the form of a chip, the transceiver module 820 is an interface circuit for the chip to receive signals from other chips or devices, or an interface circuit for the chip to send signals to other chips or devices.

[0187] For example, the communication device 800 can correspond to the behavior and function of the terminal in the above method embodiment. The communication device 800 can be a terminal, or a component (such as a chip or circuit) applied to a terminal, or a chip or a chipset in a terminal or a part of a chip used to perform the function of a related method, or a software module capable of implementing the method executed by the terminal in the above method (such as communication method 400 or communication method 600 or communication method 700), without limitation.

[0188] For example, the communication device 800 may implement Figure 4 or Figure 6 or Figure 7 For example, the transceiver module 820 may be used to execute Figure 4 S401, S402, S403, S405 in the embodiment shown, and / or other processes for supporting the technology described herein; the processing module 810 can be used to execute Figure 4 S404 in the illustrated embodiment, and / or other processes for performing the techniques described herein.

[0189] In one implementation, the transceiver module 820 is used to receive the first information, send the first message, and receive the second message. The first information indicates a first public key and at least one encryption algorithm list, the first public key is the public key of the network device, and the at least one encryption algorithm is an encryption algorithm supported by the network device. The first message indicates a first encryption algorithm and a second public key, the second public key is the public key of the communication device 800, the first encryption algorithm belongs to at least one encryption algorithm, and the first message also includes a random access preamble or a random access reason value. The processing module 810 is used to decrypt the second message according to the first encryption algorithm and a shared key, the shared key is obtained according to the first public key and the first private key, and the first private key is the private key of the communication device 800.

[0190] As an optional implementation method, the shared key is obtained based on the first public key and the first private key, including: the shared key is obtained based on the first public key, the first private key and the first parameter, wherein the first parameter includes one or more of the following: TC-RNTI, a synchronization signal index, or a random access resource index.

[0191] As an optional implementation manner, the first message is scrambled by a sequence generated by a preamble code sequence index and / or a synchronization signal index.

[0192] As an optional implementation method, the first message also includes a message verification code. When the first message includes a random access preamble, the message verification code is obtained by encrypting the random access preamble, the identifier of the first encryption algorithm and the second public key using a first encryption algorithm and a shared key.

[0193] As an optional implementation method, the first message also includes a message verification code. When the first message includes a random access reason value, the message verification code is obtained by encrypting the random access reason value, the identifier of the first encryption algorithm and the second public key using a first encryption algorithm and a shared key.

[0194] As an optional implementation, before receiving the first information, the transceiver module 820 is further configured to receive certificate information including a public key provided by the institution that issued the certificate. The processing module 810 is further configured to perform signature verification on the certificate information according to the public key provided by the institution that issued the certificate.

[0195] In another implementation, the transceiver module 820 is used to receive the first information, send the first message, receive the second message, and send the third message. The first information indicates the first public key and at least one encryption algorithm, the first public key is the public key of the network device, and the at least one encryption algorithm is an encryption algorithm supported by the network device. The first message indicates the first encryption algorithm and the second public key, the second public key is the public key of the communication device 800, the first encryption algorithm belongs to at least one encryption algorithm supported by the network device, and the first message also includes a random access preamble or a random access reason value. The processing module 810 is also used to encrypt the third message according to the first encryption algorithm and the shared key. The shared key is obtained according to the first public key and the first private key, and the first private key is the private key of the communication device 800.

[0196] As an optional implementation manner, the processing module 810 is further configured to decrypt the second message according to the first encryption algorithm and the shared key.

[0197] As an optional implementation method, the shared key is obtained based on the first public key and the first private key, including: the shared key is obtained based on the first public key, the first private key and the first parameter, wherein the first parameter includes one or more of the following: TC-RNTI, a synchronization signal index, or a random access resource index.

[0198] As an optional implementation manner, the first message is scrambled by a sequence generated by a preamble code sequence index and / or a synchronization signal index.

[0199] As an optional implementation method, the first message also includes a message verification code. When the first message includes a random access preamble, the message verification code is obtained by encrypting the random access preamble, the identifier of the first encryption algorithm and the second public key using a first encryption algorithm and a shared key.

[0200] As an optional implementation, before receiving the first information, the transceiver module 820 is further configured to receive certificate information including a public key provided by the institution that issued the certificate. The processing module 810 is further configured to perform signature verification on the certificate information according to the public key provided by the institution that issued the certificate.

[0201] In another implementation, the transceiver module 820 is used to receive the first information, send the first message and receive the second message. The first information indicates the first public key and at least one encryption algorithm, the first public key is the public key of the network device, and the at least one encryption algorithm is an encryption algorithm supported by the network device. The first message indicates the first encryption algorithm and the second public key, the second public key is the public key of the communication device 800, the first encryption algorithm belongs to at least one encryption algorithm supported by the network device, and the first message also includes a random access preamble or a random access reason value. The first message is encrypted by a sequence generated by a preamble sequence index and / or a synchronization signal index. The processing module 810 is also used to decrypt the second message according to the first encryption algorithm and a shared key. The shared key is obtained based on the first public key and the first private key, and the first private key is the private key of the communication device 800.

[0202] For another example, the communication device 800 can correspond to the behavior and function of the network device in the above method embodiment. The communication device 800 can be a network device, or a component (such as a chip or circuit) used in a network device, or a chip or a chipset in a network device or a part of a chip used to perform related method functions, or a software module that can implement the method executed by the network device in the above method (such as communication method 400 or communication method 600 or communication method 700), without limitation.

[0203] In one implementation, the transceiver module 820 is used to send a first message, receive a first message, and send a second message. The first information indicates a first public key and at least one encryption algorithm list, and at least one encryption algorithm is an encryption algorithm supported by the communication device 800. The first message indicates a first encryption algorithm and a second public key, the second public key is a public key of the terminal, and the first encryption algorithm belongs to at least one encryption algorithm supported by the communication device 800. The processing module 810 is used to encrypt the second message according to the first encryption algorithm and the shared key. The second message is a response message to the first message, and the shared key is obtained according to the second public key and the second private key, and the second private key is the private key of the communication device 800.

[0204] As an optional implementation method, the shared key is obtained based on the first public key and the first private key, including: the shared key is obtained based on the first public key, the first private key and the first parameter, wherein the first parameter includes one or more of the following: TC-RNTI, a synchronization signal index, or a random access resource index.

[0205] As an optional implementation manner, the first message is scrambled by a sequence generated by a preamble code sequence index and / or a synchronization signal index.

[0206] As an optional implementation method, the first message also includes a message verification code. When the first message includes a random access preamble, the message verification code is obtained by encrypting the random access preamble, the identifier of the first encryption algorithm and the second public key using a first encryption algorithm and a shared key.

[0207] As an optional implementation method, the first message also includes a message verification code. When the first message includes a random access reason value, the message verification code is obtained by encrypting the random access reason value, the identifier of the first encryption algorithm and the second public key using a first encryption algorithm and a shared key.

[0208] As an optional implementation, before receiving the first information, the transceiver module 820 is further configured to send certificate information, where the certificate information includes a public key provided by an institution that issues the certificate.

[0209] In another implementation, the transceiver module 820 is used to send the first information, receive the first message, and send the second message. The first information indicates the first public key and at least one encryption algorithm list, and at least one encryption algorithm is an encryption algorithm supported by the communication device 800. The first message includes a random access preamble, an identifier of the first encryption algorithm, and a second public key, the second public key is the public key of the terminal, and the first encryption algorithm belongs to at least one encryption algorithm supported by the communication device 800. The processing module 810 is used to decrypt the third message according to the first encryption algorithm and the shared key, the shared key is obtained according to the second public key and the second private key, and the second private key is the private key of the communication device 800.

[0210] As an optional implementation manner, before sending the second message, the processing module 810 is further configured to encrypt the second message according to the first encryption algorithm and the shared key.

[0211] As an optional implementation method, the shared key is obtained based on the first public key and the first private key, including: the shared key is obtained based on the first public key, the first private key and the first parameter, wherein the first parameter includes one or more of the following: TC-RNTI, a synchronization signal index, or a random access resource index.

[0212] As an optional implementation manner, the first message is scrambled by a sequence generated by a preamble code sequence index and / or a synchronization signal index.

[0213] As an optional implementation method, the first message also includes a message verification code. When the first message includes a random access preamble, the message verification code is obtained by encrypting the random access preamble, the identifier of the first encryption algorithm and the second public key using a first encryption algorithm and a shared key.

[0214] As an optional implementation, before receiving the first information, the transceiver module 820 is further configured to send certificate information, where the certificate information includes a public key provided by an institution that issues the certificate.

[0215] In another implementation, the transceiver module 820 is used to send the first information, receive the first message and send the second message. Among them, the first information indicates the first public key and at least one encryption algorithm, the first public key is the public key of the network device, and the at least one encryption algorithm is an encryption algorithm supported by the network device. The first message indicates the first encryption algorithm and the second public key, the second public key is the public key of the communication device 800, the first encryption algorithm belongs to at least one encryption algorithm supported by the network device, and the first message also includes a random access preamble or a random access reason value. The first message is scrambled by a sequence generated by a preamble sequence index and / or a synchronization signal index. The processing module 810 is also used to encrypt the second message according to the first encryption algorithm and a shared key. The shared key is obtained based on the second public key and the second private key, and the second private key is the private key of the communication device 800.

[0216] When the communication device 800 is a chip-type device or circuit, the transceiver module may be an input / output circuit and / or a communication interface; the processing module may be an integrated processor or microprocessor or integrated circuit.

[0217] Fig. 9 Schematic block diagram of a communication device 900 provided in an embodiment of the present application. The communication device 900 may be a network device or a first terminal in the above-mentioned embodiment. For example, the communication device 900 may be Figure 1 The network device or terminal in the communication device 900; or the communication device 900 is a chip (system) in the network device terminal. In the embodiment of the present application, the chip system can be composed of a chip, or can include a chip and other discrete devices. For specific functions, please refer to the description in the above method embodiment.

[0218] The communication device 900 includes one or more processors 901, which are used to implement or support the communication device 900 to implement the functions of the terminal or network device in the method provided in the embodiment of the present application. Please refer to the detailed description in the method example for details, which will not be repeated here. The processor 901 may also be referred to as a processing unit or a processing module, which may implement certain control functions. The processor 901 may be a general-purpose processor or a dedicated processor, etc. For example, it may include: a baseband processor, a central processing unit, an application processor, a modem processor, a graphics processor, an image signal processor, a digital signal processor, a video codec processor, a controller, a memory, and / or a neural network processor, etc. The baseband processor may be used to process communication protocols and communication data. The central processing unit may be used to control the communication device 900 (e.g., a network device or a terminal device), execute software programs and / or process data. Different processors may be independent devices, or they may be integrated in one or more processors, for example, integrated in one or more application-specific integrated circuits.

[0219] In one design, the processor 901 may include a program 903 (sometimes also referred to as code or instruction), and the program 903 may be executed on the processor 901 to enable the communication device 900 to perform the method described in the following embodiments. In another possible design, the communication device 900 includes a circuit ( Fig. 9 (not shown), the circuit is used to implement the network device or terminal function in the above embodiments.

[0220] In one design, the communication device 900 may include one or more memories 902 on which a program 904 (sometimes also referred to as code or instruction) is stored. The program 904 may be executed on the processor 901 so that the communication device 900 performs the method described in the above method embodiment, for example Figure 4 , Figure 6 or Figure 7 The process shown.

[0221] In one design, the processor 901 and / or the memory 902 may include an artificial intelligence (AI) module 907 and an AI module 908, and the AI ​​module is used to implement AI-related functions. The AI ​​module may be implemented by software, hardware, or a combination of software and hardware. For example, the AI ​​module may include a RAN intelligent controller (RAN intelligent controller, RIC) module. For example, the AI ​​module may be a near real-time RIC or a non-real-time RIC.

[0222] In a possible design, data may also be stored in the processor 901 and / or the memory 902. The processor and the memory may be provided separately or integrated together.

[0223] In a possible design, the communication device 900 may further include a transceiver 905 and / or an antenna 906. The processor 901 may also be sometimes referred to as a processing unit, which controls the communication device 900. The transceiver 905 may also be sometimes referred to as a transceiver unit, a transceiver, a transceiver circuit, or a transceiver, etc., which is used to implement the transceiver function of the communication device through the antenna 906.

[0224] In a possible design, the communication device 900 may also include one or more of the following components: a wireless communication module, an audio module, an external memory interface, an internal memory, a universal serial bus (USB) interface, a power management module, an antenna, a speaker, a microphone, an input / output module, a sensor module, a motor, a camera, or a display screen, etc. It is understood that in some embodiments, the communication device 900 may include more or fewer components, or some components may be integrated, or some components may be separated. These components may be implemented in hardware, software, or a combination of software and hardware.

[0225] The communication device in the above embodiment may be a terminal (or network device), or a circuit, or a chip applied to a terminal (or network device) or other combined devices, components, etc. having the above terminal (or network device). When the communication device is a terminal (or network device), the transceiver module may be a transceiver, which may include an antenna and a radio frequency circuit, etc., and the processing module may be a processor, such as a CPU. When the communication device is a component having the functions of the above terminal (or network device), the transceiver module may be a radio frequency unit, and the processing module may be a processor. When the communication device is a chip system, the communication device may be an FPGA, a dedicated ASIC, a system on chip (SoC), a CPU, a network processor (NP), a DSP, a microcontroller unit (MCU), a programmable logic device (PLD) or other integrated chips. The processing module may be a processor of a chip system. The transceiver module or the communication interface may be an input / output interface or an interface circuit of a chip system. For example, the interface circuit may be a code / data read / write interface circuit. The interface circuit can be used to receive code instructions (the code instructions are stored in the memory, can be read directly from the memory, or can be read from the memory through other devices) and transmit them to the processor; the processor can be used to run the code instructions to execute the method in the above method embodiment. For another example, the interface circuit can also be a signal transmission interface circuit between the communication processor and the transceiver.

[0226] The embodiment of the present application also provides a communication system. Specifically, the communication system includes a network device and a terminal. Exemplarily, the communication system includes a Figure 4 or Figure 6 or Figure 7 Terminals and network devices with related functions. Please refer to the relevant description in the above method embodiment for details, which will not be repeated here.

[0227] The present application also provides a computer-readable storage medium including instructions, which, when executed on a computer, causes the computer to execute Figure 4 or Figure 6 or Figure 7 A method executed by a terminal or a network device.

[0228] The present application also provides a computer program product, including instructions, which, when executed on a computer, causes the computer to execute Figure 4 or Figure 6 or Figure 7 A method executed by a terminal or a network device.

[0229] The embodiment of the present application provides a chip system, which includes a processor and may also include a memory, for implementing the functions of the terminal device or the network device in the above method. The chip system may be composed of a chip, or may include a chip and other discrete devices.

[0230] In order to achieve the above Figure 8-Figure 9 In order to realize the functions of the communication device, the embodiment of the present application further provides a chip, including a processor, for supporting the communication device to realize the functions involved in the terminal or network device in the above method embodiment. In one possible design, the chip is connected to a memory or the chip includes a memory, and the memory is used to store the necessary computer programs or instructions and data of the communication device.

[0231] It should be understood that in the various embodiments of the present application, the size of the serial numbers of the above-mentioned processes does 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.

[0232] Those of ordinary skill in the art will appreciate that the various illustrative logical blocks and steps described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software 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 beyond the scope of this application.

[0233] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0234] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are 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. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0235] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0236] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the part of the technical solution of the present application that contributes essentially or the part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard disks, read-only memories (ROM), RAM, magnetic disks or optical disks.

[0237] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

Claims

1. A communication method, applied to a terminal, characterized in that: include: Receiving first information, the first information indicating a first public key and at least one encryption algorithm, the first public key is a public key of a network device, and the at least one encryption algorithm is an encryption algorithm supported by the network device; Sending a first message, where the first message indicates a first encryption algorithm and a second public key, where the second public key is a public key of the terminal, and the first encryption algorithm belongs to the at least one encryption algorithm, wherein the first message further includes a random access preamble code or a random access cause value; receiving a second message; The second message is decrypted according to the first encryption algorithm and a shared key, where the shared key is obtained according to the first public key and a first private key, and the first private key is a private key of the terminal device.

2. The method according to claim 1, characterized in that The shared key is obtained according to the first public key and the first private key, including: The shared key is obtained according to the first public key, the first private key and a first parameter, where the first parameter includes one or more of the following: a temporary cell radio network temporary identifier TC-RNTI, a synchronization signal index, or a random access resource index.

3. The method according to claim 1 or 2, characterized in that The first message is scrambled by a sequence generated by a preamble sequence index and / or a synchronization signal index.

4. The method according to any one of claims 1 to 3, characterized in that The first message also includes a message verification code, wherein: When the first message includes the random access preamble, the message authentication code is obtained by encrypting the random access preamble, the identifier of the first encryption algorithm and the second public key by using the first encryption algorithm and the shared key; or When the first message includes a random access cause value, the message authentication code is obtained by encrypting the random access cause value, an identifier of the first encryption algorithm and the second public key by using the first encryption algorithm and the shared key.

5. The method according to any one of claims 1 to 4, characterized in that Before receiving the first information, the method further includes: Receiving certificate information, the certificate information including a public key provided by an institution that issued the certificate; The certificate information is signed and verified according to the public key provided by the institution that issued the certificate.

6. A communication method, characterized in that: include: Sending first information, where the first information indicates a first public key and at least one encryption algorithm, where the first public key is a public key of a network device, and the at least one encryption algorithm is an encryption algorithm supported by the network device; receiving a first message, the first message indicating a first encryption algorithm and a second public key, the second public key being a public key of a terminal, and the first encryption algorithm belonging to the at least one encryption algorithm; The second message is encrypted according to the first encryption algorithm and the shared key, and the encrypted second message is sent, the shared key is obtained according to the second public key and the second private key, and the second private key is the private key of the network device.

7. The method according to claim 6, characterized in that The shared key is obtained according to the second public key and the second private key, including: The shared key is obtained according to the second public key, the second private key and a first parameter, where the first parameter includes one or more of the following: a temporary cell radio network temporary identifier TC-RNTI, a synchronization signal index, or a random access resource index.

8. The method according to claim 6 or 7, characterized in that The first message is scrambled by a sequence generated by a preamble sequence index and / or an index of a synchronization signal.

9. The method according to any one of claims 6 to 8, characterized in that The first message also includes a message verification code; Wherein, when the first message includes the random access preamble, the message authentication code is obtained by encrypting the random access preamble, the identifier of the first encryption algorithm and the second public key by using the first encryption algorithm and the shared key; or, When the first message includes a random access cause value, the message authentication code is obtained by encrypting the random access cause value, an identifier of the first encryption algorithm and the second public key by using the first encryption algorithm and the shared key.

10. The method according to any one of claims 6 to 9, characterized in that Before sending the first information, the method further includes: Acquire certificate information, the certificate information including a public key provided by an institution that issued the certificate, the public key being used to perform signature verification on the certificate; The certificate information is sent.

11. A communication method, characterized in that: include: Receiving first information, the first information indicating a first public key and at least one encryption algorithm, the first public key is a public key of a network device, and the at least one encryption algorithm is an encryption algorithm supported by the network device; Sending a first message, where the first message includes a random access preamble, an identifier of a first encryption algorithm, and a second public key, where the second public key is a public key of a terminal, and the first encryption algorithm belongs to the at least one encryption algorithm; receiving a second message; The third message is encrypted according to the first encryption algorithm and a shared key, and the encrypted third message is sent, the shared key is obtained according to the first public key and a first private key, and the first private key is a private key of the terminal.

12. The method according to claim 11, characterized in that The method further comprises: The second message is decrypted according to the first encryption algorithm and the shared key.

13. The method according to claim 11 or 12, characterized in that: The shared key is obtained according to the first public key and the first private key, including: The shared key is obtained according to the first public key, the first private key and a first parameter, where the first parameter includes one or more of the following: a temporary cell radio network temporary identifier TC-RNTI, a synchronization signal index, or a random access resource index.

14. The method according to any one of claims 11 to 13, characterized in that The first message is scrambled by a sequence generated by a preamble sequence index and / or an index of a synchronization signal.

15. The method according to any one of claims 11 to 14, characterized in that The first message also includes a message verification code, which is obtained by encrypting the random access preamble, the identifier of the first encryption algorithm and the second public key using the first encryption algorithm and the shared key.

16. The method according to any one of claims 11 to 15, characterized in that Before receiving the first information, the method further includes: Receiving certificate information, the certificate information including a public key provided by an institution that issued the certificate; The certificate information is signed and verified according to the public key provided by the institution that issued the certificate.

17. A communication method, characterized in that: include: Sending first information, where the first information indicates a first public key and at least one encryption algorithm, where the first public key is a public key of a network device, and the at least one encryption algorithm is an encryption algorithm supported by the network device; receiving a first message, the first message including a random access preamble, an identifier of a first encryption algorithm, and a second public key, the second public key being a public key of a terminal, and the first encryption algorithm belonging to the at least one encryption algorithm; sending a second message; The third message is decrypted according to the first encryption algorithm and a shared key, where the shared key is obtained according to the second public key and a second private key, and the second private key is a private key of the network device.

18. The method according to claim 17, characterized in that Before sending the second message, the method further includes: The second message is encrypted according to the first encryption algorithm and the shared key.

19. The method according to claim 17 or 18, characterized in that The shared key is obtained according to the second public key and the second private key, including: The shared key is obtained according to the second public key, the second private key and a first parameter, where the first parameter includes one or more of the following: a temporary cell radio network temporary identifier TC-RNTI, a synchronization signal index, or a random access resource index.

20. The method according to any one of claims 17 to 19, characterized in that The first message is scrambled by a sequence generated by a preamble sequence index and / or an index of a synchronization signal.

21. The method according to any one of claims 17 to 20, characterized in that The first message also includes a message verification code, which is obtained by encrypting the random access preamble, the identifier of the first encryption algorithm and the second public key using the first encryption algorithm and the shared key.

22. The method according to any one of claims 17 to 21, characterized in that Before sending the first information, the method further includes: Acquire certificate information, the certificate information including a public key provided by an institution that issued the certificate, the public key being used to perform signature verification on the certificate; The certificate information is sent.

23. A communication device, characterized in that: The communication device includes a processing unit and a transceiver unit, and the processing unit is coupled to the transceiver unit to execute the method according to any one of claims 1 to 5, or the method according to any one of claims 6 to 10, or the method according to any one of claims 11 to 16, or the method according to any one of claims 17 to 22.

24. A communication device, characterized in that: The communication device includes a processor and a memory, the memory is used to store a computer program, and the processor is used to execute the computer program stored in the memory, so that the communication device performs the method as described in any one of claims 1 to 5, or the communication device performs the method as described in any one of claims 6 to 10, or the communication device performs the method as described in any one of claims 11 to 16, or the communication device performs the method as described in any one of claims 17 to 22.

25. A computer-readable storage medium, characterized in that: The computer-readable storage medium is used to store a computer program. When the computer program is run on a computer, the computer executes the method as claimed in any one of claims 1 to 5, or the computer executes the method as claimed in any one of claims 6 to 10, or the computer executes the method as claimed in any one of claims 11 to 16, or the computer executes the method as claimed in any one of claims 17 to 22.

26. A computer program product, characterized in that The computer program product comprises a computer program, which, when executed on a computer, enables the computer to execute the method as claimed in any one of claims 1 to 5, or enables the computer to execute the method as claimed in any one of claims 6 to 10, or enables the computer to execute the method as claimed in any one of claims 11 to 16, or enables the computer to execute the method as claimed in any one of claims 17 to 22.

27. A chip system, characterized in that: The chip system comprises: A processor and an interface, wherein the processor is used to call and run instructions from the interface, and when the processor executes the instructions, the method according to any one of claims 1 to 5 is implemented, or the method according to any one of claims 6 to 10 is implemented, or the method according to any one of claims 11 to 16 is implemented, or the method according to any one of claims 17 to 22 is implemented.