WO2021047276A1 - Key generation method and device - Google Patents

Key generation method and device Download PDF

Info

Publication number
WO2021047276A1
WO2021047276A1 PCT/CN2020/101713 CN2020101713W WO2021047276A1 WO 2021047276 A1 WO2021047276 A1 WO 2021047276A1 CN 2020101713 W CN2020101713 W CN 2020101713W WO 2021047276 A1 WO2021047276 A1 WO 2021047276A1
Authority
WO
WIPO (PCT)
Prior art keywords
terminal
key
communication
request
identification
Prior art date
Application number
PCT/CN2020/101713
Other languages
French (fr)
Chinese (zh)
Inventor
张博
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2021047276A1 publication Critical patent/WO2021047276A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W12/00Security arrangements; Authentication; Protecting privacy or anonymity
    • H04W12/04Key management, e.g. using generic bootstrapping architecture [GBA]
    • H04W12/041Key generation or derivation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W12/00Security arrangements; Authentication; Protecting privacy or anonymity
    • H04W12/04Key management, e.g. using generic bootstrapping architecture [GBA]
    • H04W12/043Key management, e.g. using generic bootstrapping architecture [GBA] using a trusted network node as an anchor
    • H04W12/0431Key distribution or pre-distribution; Key agreement

Definitions

  • the embodiments of the present application relate to the field of communication technologies, and in particular, to a method and device for generating a key.
  • the terminal 1 may send data to a user plane function (UPF) through the base station, and the UPF forwards the data to the terminal 2 through the base station. Then a logical channel is established between terminal 1 and terminal 2 for service communication between them.
  • UPF user plane function
  • the terminal 1 and the terminal 2 can also communicate directly.
  • the embodiments of the present application provide a key generation method and device to solve the problem of how to complete key negotiation when multiple terminals communicate directly through a PC5 interface.
  • a key generation method is provided, which is applied to a system in which multiple terminals communicate directly.
  • any two terminals in the system are represented by a first terminal and a second terminal, and the first terminal and The interaction process between the second terminal will introduce the key generation method provided in this application.
  • the first terminal sends a communication request to the second terminal, the second terminal receives a communication request from the first terminal, the communication request is used to request the establishment of communication with the second terminal, and the communication request includes the identification of the first terminal And the identifier of the service; the identifier of the service is used to indicate the service for establishing communication between the first terminal and the second terminal.
  • the second terminal determines the first security key according to the shared key and the service identifier; the second terminal returns a communication response to the first terminal according to the communication request; the first terminal receives The second terminal receives a communication response, and the communication response is used to respond to the communication request; the first terminal determines a first security key according to the shared key and the identifier of the service, wherein the first The security key is a security key for communication protection between the first terminal and the second terminal.
  • the first terminal and the second terminal are the first security key determined according to the service identifier, the first security key is used for a specific service indicated by the service identifier, thereby enabling different The keys used between different businesses are different, which achieves the effect of key isolation between different businesses.
  • the communication request further includes one or more of the following information: the identity of the shared key, the type of service, the application layer identity of the first terminal, and the application of the second terminal Layer ID, Layer 2 ID of the first terminal, Layer 2 ID of the second terminal, instructions for PC5 interface signaling transmission, instructions for PC5 interface radio resource control RRC transmission, for PC5 interface users
  • the communication response includes one or more of the following information: identification of the shared key, type of service, application layer identification of the first terminal, application layer of the second terminal ID, the layer 2 ID of the first terminal, the layer 2 ID of the second terminal, the instruction for PC5 interface signaling transmission, the instruction for PC5 interface RRC transmission, the instruction for PC5 interface user plane data transmission Indication, the identifier of the DRB, the identifier of the data flow, the identifier of the PC5 unicast link of the first terminal, the identifier of the PC5 unicast link of the second terminal or the terminal-to-terminal communication group.
  • the first terminal determines the first security key according to the shared key and the service identifier, which can also be implemented in the following manner: The first terminal determines the first security key according to the shared key, the identifier of the service, and the one or more types of information included in the communication request. In this way, the first terminal determines the first security key according to the information carried in the communication request, which can not only realize the key isolation between different services, but also realize the key isolation between the parameters of the information.
  • the communication request includes an indication for PC5 interface radio resource control RRC transmission
  • the first terminal may determine the first security secret based on the shared key and the indication for PC5 interface radio resource control RRC transmission included in the communication request. Key, the determined first security key is used to protect the security of the first terminal and the second terminal when RRC is transmitted through the PC5 interface.
  • the first terminal determines the first security key according to the shared key and the service identifier, which can also be implemented in the following manner: The first terminal determines the first security key according to the shared key, the identifier of the service, and the one or more types of information included in the communication response. In this way, the first terminal determines the first security key according to the information carried in the communication response, which can not only realize the key isolation between different services, but also realize the key isolation between the parameters of the information.
  • the communication request includes an instruction for PC5 interface radio resource control RRC transmission
  • the first terminal may determine the first security secret based on the shared key and the instruction for PC5 interface radio resource control RRC transmission carried in the communication response. Key, the determined first security key is used to protect the security of the first terminal and the second terminal when RRC is transmitted through the PC5 interface.
  • the first terminal receives the communication response from the second terminal, and the first terminal determines the first security key, there is no strict execution sequence between these two steps.
  • the order can be exchanged with each other.
  • the first terminal may generate the first security key according to the shared key and the parameters in the communication request, so that there is no need to determine the first security key after receiving the communication response.
  • the first security key is determined according to the parameters in the communication response, so that it is necessary to perform the step of determining the first security key after the communication response is received.
  • the second terminal determines the first security key according to the shared key and the service identifier, which can be implemented in the following manner: the second terminal determines the first security key according to the shared key, the The identification of the service and the one or more types of information included in the communication request determine the first security key.
  • the second terminal determines the first security key according to the information carried in the communication request, which can not only realize the key isolation between different services, but also realize the key isolation between the parameters of the information.
  • the communication request includes an indication for PC5 interface radio resource control RRC transmission, and the second terminal may determine the first security secret based on the shared key and the indication for PC5 interface radio resource control RRC transmission included in the communication request. Key, the determined first security key is used to protect the security of the first terminal and the second terminal when RRC is transmitted through the PC5 interface.
  • the second terminal determines the first security key according to the shared key and the service identifier, which can be implemented in the following manner: the second terminal according to the shared key, the service ID The identification and the one or more types of information included in the communication response determine the first security key.
  • the second terminal determines the first security key according to the information carried in the communication response, which can not only realize the key isolation between different services, but also realize the key isolation between the parameters of the information.
  • the communication request includes an indication for PC5 interface radio resource control RRC transmission
  • the second terminal may determine the first security secret based on the shared key and the indication for PC5 interface radio resource control RRC transmission carried in the communication response. Key, the determined first security key is used to protect the security of the first terminal and the second terminal when RRC is transmitted through the PC5 interface.
  • the key negotiated between the first terminal and the second terminal can be for a certain parameter, such as for the service indicated by the service ID, or for the RRC transmission of the PC5 interface, or for the DRB indicated by the DRB ID of.
  • the key negotiated between the first terminal and the second terminal may be isolated between different parameters whose granularity is the parameter when the key is applied.
  • the communication request further includes a first message verification code MAC and/or a first indication, and the first MAC is used to verify whether the communication request is a legitimate request, and the first indication It is used to instruct the second terminal to obtain the shared key through an application layer or obtain the shared key through an operator network.
  • the second terminal judges whether the first terminal and the second terminal belong to the same network according to the identifier of the first terminal. By judging whether the first terminal and the second terminal belong to the same network, it can be determined whether to obtain the shared key through the application layer or through the operator network. The way to obtain the shared key can be expanded.
  • the second terminal determines that the first terminal and the second terminal belong to the same network, and sends a non-access stratum NAS request to the first network function NF.
  • the NAS request is used to request all The shared secret key.
  • the shared key can be obtained through the operator's network.
  • the key agreement between the first terminal and the second terminal may be completed according to the AMF key.
  • the NAS request includes at least one of the following information: the identifier of the first terminal, the message verification code MAC, or the first indication; the first indication is used to indicate that the NAS request is used for Telematics communication.
  • the second terminal receives a NAS response from the first NF, and the NAS response includes the shared key.
  • the shared key can be obtained through the operator network.
  • the first NF is AMF
  • the shared key provided by the first NF is AMF key
  • the first terminal and the second terminal can complete key negotiation according to the AMF key.
  • the communication response also carries a second indication, and the second indication is used to instruct the first terminal to obtain the shared key through the application layer or obtain the shared secret through the operator network. key.
  • the first terminal sends a registration request to the network device, the registration request is used to request to register the identity of the first terminal, the registration request includes a third instruction, and the third instruction It is used to instruct the first terminal to request the use of a service for communication between the terminal and the terminal; the first terminal receives the identification of the first terminal from the network device.
  • the network device here may be a core network device, such as AMF.
  • the first terminal can request to register the identification used for key negotiation by sending a registration request to the network device.
  • the network device returns the identification of the first terminal to the first terminal, which may be an identification allocated according to the registration request for key negotiation.
  • the first terminal adopts the identifier for key negotiation and the second terminal for key negotiation, since the identifier is allocated by the network side for key negotiation, it can avoid the disclosure of other types of identifiers (such as 5G). -GUTI), the less 5G-GUTI is used, the more safety performance can be improved.
  • 5G 5G
  • a method for generating a key is provided, and the execution subject of the method is NF, for example, denoted as first NF.
  • the method can be implemented in the following manner: a first network function NF receives a key request, the key request includes the identification of the first terminal; the first NF determines a shared key according to the identification of the first terminal ; The first NF sends the shared key to the second terminal.
  • the shared key is used by the first terminal to generate a first security key.
  • the first security key is a security key for communication protection between the first terminal and the second terminal.
  • the shared key can be provided to the terminal through the operator network.
  • the first NF is AMF
  • the shared key provided by the first NF is AMF key
  • the first terminal and the second terminal can complete key negotiation according to the AMF key. .
  • the key request is sent by the second terminal.
  • the second terminal sends a key request to the first NF, and the first NF receives the key request from the second terminal.
  • the second terminal belongs to the first NF.
  • the key request is sent by the second terminal through a second NF. That is, the second terminal sends a key request to the second NF, and the second NF sends the key request to the first NF. In this case, it is possible that the second terminal belongs to the second NF, and the first terminal belongs to the first NF.
  • the key request further includes a message verification code MAC; the first NF verifies the MAC and determines that the MAC verification passes.
  • the key request further includes one or more of the following information: the identification of the shared key, the identification of the service, the type of the service, the application layer identification of the first terminal, the The application layer identifier of the second terminal, the layer 2 identifier of the first terminal, the layer 2 identifier of the second terminal, an indication for PC5 interface signaling transmission, an indication for PC5 interface radio resource control RRC transmission, It is used for the instruction of PC5 interface user plane data transmission, the identifier of the data radio bearer DRB, the identifier of the data flow, the identifier of the PC5 unicast link of the first terminal or the identifier of the terminal-to-terminal communication group.
  • the information included in the key request may be carried in a container.
  • the first terminal sends the container to the second terminal, and the second terminal sends the container to the first NF; or, the first terminal sends the container to the second terminal, and the second terminal sends the container to the second NF.
  • the second NF sends the container to the first NF.
  • the first NF determines the shared key according to the identification of the first terminal and the one or more types of information in the key request.
  • the first NF after determining the shared key, the first NF sends the shared key to the second terminal, which may be implemented in the following manner: the first NF sends the shared key to the second NF, The second NF sends the shared key to the second terminal, or the second NF generates a key according to the shared key, and sends the generated key to the second terminal. Or, the first NF directly sends the shared key to the second terminal.
  • a device in a third aspect, may be a terminal, a device in the terminal, or a device that can be matched and used with the terminal.
  • the device may include modules that perform one-to-one correspondence of the methods/operations/steps/actions performed by the first terminal described in the first aspect, or the device may include modules that perform the methods/operations/steps/actions described in the first aspect.
  • the module corresponding to the method/operation/step/action executed by the second terminal.
  • the module can be a hardware circuit, software, or a combination of hardware circuit and software.
  • the device may include a processing module and a communication module.
  • the communication module is used to send a communication request to the second terminal, and the communication request is used to request communication with the second terminal.
  • the communication request includes the identity of the first terminal and the identity of the service;
  • the communication module is further configured to receive a communication response from the second terminal;
  • the communication response is used to respond to the communication request;
  • the processing module is configured to determine a first security key according to the shared key and the service identifier; wherein, the first security key is the security of communication protection between the first terminal and the second terminal Key.
  • the processing unit is configured to determine the first security key according to the shared key, the identifier of the service, and the one or more types of information included in the communication request.
  • the communication module is further configured to send a registration request to a network device, the registration request is used to request registration of the identity of the first terminal, the registration request includes a third instruction, the The third indication is used to indicate that the first terminal requests to use the service of communication between the terminal and the terminal; and used to receive the identification of the first terminal from the network device.
  • a communication module configured to receive a communication request from the first terminal, the communication request including the identification ID of the first terminal And the identification of the service; the processing module is used to determine the first security key according to the shared key and the identification of the service; wherein, the first security key is the difference between the first terminal and the second terminal A security key for inter-communication protection; the communication module is further configured to return a communication response to the first terminal according to the communication request.
  • the processing module is configured to determine the first security key according to the shared key, the identifier of the service, and the one or more types of information included in the communication request.
  • the processing module is further configured to: determine whether the first terminal and the second terminal belong to the same network according to the identity of the first terminal; determine whether the first terminal and the second terminal belong to the same network; The second terminal belongs to the same network; the communication module is also used to send a non-access stratum NAS request to the first network function NF, and the NAS request is used to request the shared key.
  • the NAS request includes at least one of the following information: the identifier of the first terminal, the message verification code MAC, or the first indication; the first indication is used to indicate that the NAS request is used for Car networking communication; the communication module is further configured to receive a NAS response from the first NF, and the NAS response includes the shared key.
  • the communication request further includes one or more of the following information: identification of the shared key, type of service, layer 2 identification of the first terminal, layer 2 identification data of the second terminal.
  • identification of the shared key type of service
  • layer 2 identification of the first terminal layer 2 identification data of the second terminal
  • the ID of the radio bearer DRB the ID of the data flow, the ID of the PC5 unicast link of the first terminal, or the ID of the terminal-to-terminal communication group.
  • the communication request further includes a first message verification code MAC and/or a first indication
  • the first MAC is used to check whether the communication request is a legal request
  • the first indication is used to indicate
  • the second terminal obtains the shared key through an application layer or obtains the shared key through an operator network.
  • the communication response carries a second indication, and the second indication is used to instruct the first terminal to obtain the shared key through an application layer or obtain the shared key through an operator network.
  • a device in a fourth aspect, may be a network function NF, denoted as the first NF, may also be a device in the NF, or a device that can be used in conjunction with the NF.
  • the device may include modules that perform one-to-one correspondence of the methods/operations/steps/actions performed by the first NF described in the second aspect.
  • the module can be a hardware circuit, software, or a combination of hardware circuit and software.
  • the device may include a processing module and a communication module.
  • the communication module is configured to receive a key request, the key request is sent by a second terminal, or the key request is sent by the second terminal through a second NF, the key
  • the request includes the identification of the first terminal;
  • the processing module is configured to determine the shared key according to the identification of the first terminal;
  • the communication module is also configured to send the shared key to the second terminal, or And is also used to send the shared key to the second terminal through the second NF.
  • the key request further includes a message verification code MAC; the processing module is further configured to verify the MAC and determine that the MAC verification passes.
  • the key request further includes one or more of the following information: the identification of the shared key, the identification of the service, the type of the service, the layer 2 identification of the first terminal, the The layer 2 identification of the second terminal, the identification of the data radio bearer DRB, the identification of the data flow, the identification of the PC5 unicast link of the first terminal, or the identification of the terminal-to-terminal communication group.
  • the processing module is configured to determine the shared key according to the identification of the first terminal and the one or more types of information in the key request.
  • an embodiment of the present application provides a device, the device includes a communication interface and a processor, and the communication interface is used for communication between the device and other devices, for example, data or signal transmission and reception.
  • the communication interface may be a transceiver, circuit, bus, module, or other type of communication interface; other devices may be other terminals or NFs.
  • the processor is configured to execute the method executed by the first terminal or the second terminal described in the first aspect.
  • the device may also include a memory for storing instructions called by the processor. The memory is coupled with the processor, and when the processor executes the instructions stored in the memory, the method executed by the first terminal or the second terminal described in the first aspect can be implemented.
  • a communication interface is used to send a communication request to the second terminal, and the communication request is used to request communication with the The second terminal establishes communication, and the communication request includes the identification of the first terminal and the identification of the service; the communication interface is also used to receive a communication response from the second terminal; the communication response is used to respond to the Communication request; a processor, configured to determine a first security key according to the shared key and the identifier of the service; wherein, the first security key is the communication between the first terminal and the second terminal Security key for protection.
  • the processing unit is configured to determine the first security key according to the shared key, the identifier of the service, and the one or more types of information included in the communication request.
  • the communication interface is further used to send a registration request to a network device, the registration request is used to request to register the identity of the first terminal, the registration request includes a third indication, the The third indication is used to indicate that the first terminal requests to use the service of communication between the terminal and the terminal; and used to receive the identification of the first terminal from the network device.
  • a communication interface for receiving a communication request from the first terminal, the communication request including the identification ID of the first terminal And the identification of the service; the processor is configured to determine a first security key according to the shared key and the identification of the service; wherein, the first security key is the difference between the first terminal and the second terminal A security key for inter-communication protection; the communication interface is also used to return a communication response to the first terminal according to the communication request.
  • the processor is configured to determine the first security key according to the shared key, the identifier of the service, and the one or more types of information included in the communication request.
  • the processor is further configured to: determine whether the first terminal and the second terminal belong to the same network according to the identity of the first terminal; and determine whether the first terminal and the second terminal belong to the same network;
  • the second terminal belongs to the same network;
  • the communication interface is also used to send a non-access stratum NAS request to the first network function NF, and the NAS request is used to request the shared key.
  • the NAS request includes at least one of the following information: the identifier of the first terminal, the message verification code MAC, or the first indication; the first indication is used to indicate that the NAS request is used for Internet of Vehicles communication; the communication interface is also used to receive a NAS response from the first NF, and the NAS response includes the shared key.
  • the communication request further includes one or more of the following information: identification of the shared key, type of service, layer 2 identification of the first terminal, layer 2 identification data of the second terminal.
  • identification of the shared key type of service
  • layer 2 identification of the first terminal layer 2 identification data of the second terminal
  • the ID of the radio bearer DRB the ID of the data flow, the ID of the PC5 unicast link of the first terminal, or the ID of the terminal-to-terminal communication group.
  • the communication request further includes a first message verification code MAC and/or a first indication
  • the first MAC is used to check whether the communication request is a legal request
  • the first indication is used to indicate
  • the second terminal obtains the shared key through an application layer or obtains the shared key through an operator network.
  • the communication response carries a second indication, and the second indication is used to instruct the first terminal to obtain the shared key through an application layer or obtain the shared key through an operator network.
  • an apparatus in a sixth aspect, includes a communication interface and a processor, and the communication interface is used for communication between the apparatus and other devices, for example, data or signal transmission and reception.
  • the communication interface may be a transceiver, circuit, bus, module, or other type of communication interface; other devices may be terminals or other NFs.
  • the processor is used to execute the method described in the second aspect above.
  • the device may also include a memory for storing instructions called by the processor. The memory is coupled with the processor, and when the processor executes the instructions stored in the memory, the method described in the second aspect can be implemented.
  • the communication interface is configured to receive a key request, the key request is sent by a second terminal, or the key request is sent by the second terminal through a second NF, and the key
  • the request includes the identification of the first terminal;
  • the processor is configured to determine the shared key according to the identification of the first terminal;
  • the communication interface is further configured to send the shared key to the second terminal, or And is also used to send the shared key to the second terminal through the second NF.
  • the key request further includes a message verification code MAC; the processor is further configured to verify the MAC and determine that the MAC verification passes.
  • the key request further includes one or more of the following information: the identification of the shared key, the identification of the service, the type of the service, the layer 2 identification of the first terminal, the The layer 2 identification of the second terminal, the identification of the data radio bearer DRB, the identification of the data flow, the identification of the PC5 unicast link of the first terminal, or the identification of the terminal-to-terminal communication group.
  • the processor is configured to determine the shared key according to the identification of the first terminal and the one or more types of information in the key request.
  • the embodiments of the present application also provide a computer-readable storage medium.
  • the computer-readable storage medium stores computer-readable instructions.
  • the computer can execute The method described in one aspect or any one of the possible designs of the first aspect.
  • the embodiments of the present application also provide a computer-readable storage medium, including instructions, which, when run on a computer, cause the computer to execute as described in the second aspect or any one of the possible designs in the second aspect. The method described.
  • the embodiments of the present application also provide a computer program product, including instructions, which when run on a computer, cause the computer to execute the design described in the first aspect or any one of the possible designs in the first aspect Method, or implement the method as described in the second aspect or any one of the possible designs of the second aspect.
  • an embodiment of the present application provides a chip system, which includes a processor and may also include a memory, for implementing the method described in the first aspect or any one of the possible designs of the first aspect.
  • the chip system can be composed of chips, or it can include chips and other discrete devices.
  • an embodiment of the present application provides a chip system.
  • the chip system includes a processor and may also include a memory for implementing the above-mentioned second aspect or any one of the possible designs of the second aspect. method.
  • the chip system can be composed of chips, or it can include chips and other discrete devices.
  • an embodiment of the present application provides a communication system, the communication system including the device described in the third aspect or the fifth aspect, and the device described in the fourth aspect or the sixth aspect.
  • FIG. 1 is one of the schematic diagrams of the communication system architecture in an embodiment of the application
  • Figure 2 is one of the schematic diagrams of the key generation method in the embodiment of the application.
  • FIG. 3a is a schematic diagram of a method for obtaining a shared key through an operator in an embodiment of the application
  • FIG. 3b is the second schematic diagram of the flow of the key generation method according to the embodiment of this application.
  • FIG. 4 is a schematic diagram of the process of registering the identification used for key negotiation by the first terminal in an embodiment of the application
  • Figure 5 is one of the schematic diagrams of the device structure in an embodiment of the application.
  • Fig. 6 is the second schematic diagram of the device structure in the embodiment of the application.
  • FIG. 7 is the second schematic diagram of the communication system architecture in the embodiment of the application.
  • the embodiments of the present application provide a method and device for generating a key.
  • the method and device are based on the same inventive concept. Since the principles of the method and device to solve the problem are similar, the implementation of the device and the method can be referred to each other, and the repetition will not be repeated. .
  • “and/or” describes the association relationship of the associated objects, indicating that there can be three types of relationships, for example, A and/or B, which can mean: A alone exists, and both A and B exist separately. There are three cases of B.
  • the character "/" generally indicates that the associated objects before and after are in an "or” relationship. At least one involved in this application refers to one or more; multiple refers to two or more.
  • the communication method provided in the embodiments of the present application can be applied to a fourth generation (4th generation, 4G) communication system, a fifth generation (5th generation, 5G) communication system, or various future communication systems. Specifically, it can be applied to a communication scenario of the Internet of Vehicles, and can be applied to a terminal-to-terminal communication system, such as a vehicle-to-everything (V2X) communication system.
  • 4G fourth generation
  • 5th generation, 5G fifth generation
  • various future communication systems Specifically, it can be applied to a communication scenario of the Internet of Vehicles, and can be applied to a terminal-to-terminal communication system, such as a vehicle-to-everything (V2X) communication system.
  • V2X vehicle-to-everything
  • FIG. 1 shows the architecture of a possible communication system to which the key generation method provided in the embodiment of the present application is applicable.
  • Figure 1 shows that the communication system is a V2X communication system.
  • the V2X communication system includes one or more terminals.
  • the terminal in the V2X communication system is also called user equipment (UE), mobile station (MS), mobile terminal (MT), etc., which provide users with voice or data connectivity.
  • the device can also be an IoT device.
  • terminals include handheld devices with wireless connection functions, vehicle-mounted devices, and so on.
  • the terminal can be: mobile phone (mobile phone), tablet computer, notebook computer, palm computer, mobile internet device (MID), wearable device (such as smart watch, smart bracelet, pedometer, etc.), Vehicles, vehicle-mounted equipment (for example, cars, bicycles, electric vehicles, airplanes, ships, trains, high-speed rail, etc.), virtual reality (VR) equipment, augmented reality (AR) equipment, industrial control (industrial control) Wireless terminals, smart home equipment (for example, refrigerators, TVs, air conditioners, electric meters, etc.), smart robots, workshop equipment, wireless terminals in self-driving, and wireless terminals in remote medical surgery ,
  • the terminal in Figure 1 takes UE as an example, including UE A, UE B, UE C, and UE D.
  • a connection is established between the terminal and the terminal through the PC 5 interface, and communication can be directly carried out.
  • the two UEs are connected through a PC5 interface.
  • the terminal can also be connected to the access network equipment through a Uu port.
  • the access network equipment in Figure 1 is represented by the next generation radio access network (NG-RAN).
  • An access network device is a node in a radio access network (RAN), which may also be called a base station, or a RAN node (or device).
  • the access network equipment is connected to the core network.
  • RAN radio access network
  • the core network in Figure 1 is represented by a 5G core network (5G core, 5GC), and 5GC includes one or more network functions (network functions, NF), and NF may also be referred to as a network function entity or a network function network element.
  • 5GC includes authentication management function (authentication management function, AMF), session management function (session management function, SMF), unified data storage (Unified Data Repository, UDR), unified data management function (unified data management, Examples of network functions such as UDM), policy control function (PCF), network exposure function (NEF), application function (AF) and user plane function (UPF) .
  • AMF authentication management function
  • SMF session management function
  • UDR Unified Data Repository
  • unified data management function unified data management
  • Examples of network functions such as UDM), policy control function (PCF), network exposure function (NEF), application function (AF) and user plane function (UPF) .
  • AMF is used for access and mobility management functions
  • AUSF is used for authentication server functions;
  • Each terminal may generate data for V2X applications.
  • the terminal and the terminal directly establish communication based on the PC5 interface, that is, the terminal communicates directly based on the wireless capability.
  • the UE A and UE B shown in FIG. 1 establish communication through the PC5 interface.
  • the terminal may transmit V2X application data to the base station based on the Uu interface.
  • UE A sends the data of the V2X application to the UPF through the base station, and then the UPF forwards the data of the V2X application to the UE D through the base station.
  • UE A and UE D have established a logical channel for V2X service communication between them.
  • the UE sends V2X application data to the V2X application server through the base station and UPF, and the V2X application server sends the V2X application data to the UED through the UPF and the base station.
  • the UE sends the V2X application data to another base station through the base station, and then the other base station sends the V2X application data to the UE D.
  • the base stations to which the two UEs are connected may be the same or different.
  • the communication mode between the terminal and the terminal includes: unicast, multicast or broadcast.
  • the communication system shown in FIG. 1 is a possible system to which the embodiments of this application are applicable.
  • the embodiments of the present application can also be applied to other systems besides the V2X communication system.
  • the method in the embodiment of the present application includes key negotiation between two terminals. When applied to a V2X communication system, it can be the key negotiation between the two terminals on the PC5 interface. This method can also be extended to key negotiation between any two devices.
  • the specific process of the key generation method provided by the embodiment of the present application is as follows. This method takes the communication between any two terminals as an example to introduce the method of generating the key.
  • the two terminals of the communicating parties may be referred to as the first terminal and the second terminal.
  • the first terminal sends a communication request to the second terminal, and the second terminal receives the communication request from the first terminal.
  • the communication request includes one or more of the following information:
  • the identity of the first terminal is used to identify the identity of the first terminal.
  • the identifier may be a permanent identifier (identity, ID), or other identifiers, such as 5G-global unique temporary identifier (GUTI), generic public subscription identifier (GPSI) Or a registered temporary identifier dedicated to key negotiation (denoted as UE ID).
  • ID a permanent identifier
  • GUI 5G-global unique temporary identifier
  • GPSI generic public subscription identifier
  • UE ID registered temporary identifier dedicated to key negotiation
  • the second terminal may store the ID of the first terminal.
  • the service identifier or the application program identifier is used to identify the service or application program interacting between the first terminal and the second terminal.
  • the identifier may be used to indicate that the service interacted between the first terminal and the second terminal is a V2X service, or the identifier may be used to indicate that the application program interacted between the first terminal and the second terminal is a V2X application.
  • the service identifier or the application program identifier is an intelligent transportation systems application identifier (ITS-A ID).
  • the type of service can be used to indicate that the service is a V2X service.
  • the type of the service is a service provider ID (provider service ID, PSID), which indicates that the type of the service is a service provider.
  • the identification of the shared key It is used to identify a shared key pre-stored or determined by the first terminal, and the shared key is a shared key between the first terminal and the second terminal.
  • the shared key of the second terminal may be obtained from the first NF after the subsequent second terminal receives the communication request.
  • the application layer ID of the first terminal is marked as application layer ID1.
  • Application layer ID of the second terminal For example, it is recorded as application layer ID2.
  • Layer 2 ID (layer2 ID1) of the first terminal may be a layer between the application layer and the physical layer. Or it can also be called a source layer 2 (source layer 2) ID.
  • source layer 2 source layer 2
  • the layer 2 ID of the first terminal is layer 2 ID1
  • the source side layer 2 ID of the first terminal is source layer 2 ID1.
  • Layer 2 ID (layer2 ID2) of the second terminal can also be called a source layer 2 (source layer 2) ID.
  • the layer 2 ID of the second terminal is layer 2 ID2, or the source side layer 2 ID of the second terminal is source layer 2 ID2.
  • An indication used for PC5 interface signaling (that is, an indication of PC5-S), that is, used to indicate signaling transmission between the first terminal and the second terminal.
  • PC5-RRC indication used for radio resource control (RRC) transmission on the PC5 interface, which is used to indicate RRC transmission between the first terminal and the second terminal.
  • Instructions for data transmission of the user plane (UP) of the PC5 interface that is, instructions for user plane transmission between the first terminal and the second terminal.
  • the data flow ID (flow ID) is used to distinguish different flows or to identify the type of flow.
  • the flow ID is used to identify the data flow as a quality of service (QoS) flow.
  • QoS quality of service
  • PC5 unicast link ID The identification of the PC5 unicast link of the first terminal (PC5 unicast link ID), for example, it is recorded as PC5 unicast link ID1.
  • the identification of the group or the indication of the group is used to identify the group that the first terminal wants to access, and the group indication is used to indicate the group that the first terminal wants to access.
  • a group is a group for terminal-to-terminal communication.
  • the second terminal determines the first security key.
  • the second terminal determines that it wants to establish communication with the first terminal, and then determines the security key, which is recorded as the first security key here.
  • the first security key determined by the second terminal is a security key for communication protection between the first terminal and the second terminal.
  • the second terminal may determine the first security key based on the shared key and the generation parameter indicated by the information included in the communication request.
  • the first security key determined by the second terminal is based on the generation parameters indicated by the information included in the communication request as the granularity, and different generation parameters correspond to different keys, so as to achieve the effect of key isolation.
  • the second terminal can determine the first security key based on the shared key and the identification of the service, then the determined first security key is only indicated by the identification of the service For different services, the first security keys determined by the identifiers of different services are different.
  • the communication request includes the type of service
  • the second terminal can determine the first security key based on the shared key and the type of service. Then the determined first security key is only used for the type of service, and different The first security key determined by the type of service is different.
  • the communication request includes the ID of the DRB
  • the second terminal can determine the first security key based on the shared key and the ID of the DRB, and the determined first security key is only used for the ID indicated by the DRB.
  • the first security keys determined by different DRB identifiers are different.
  • the second terminal may determine the first security key based on the shared key and the identifier of the flow, then the determined first security key is only used for the flow indicated by the identifier of the flow, and the identifiers of different flows The determined first security key is different.
  • the communication request includes an instruction for PC5 interface signaling transmission
  • the second terminal can determine the first security key based on the shared key and the instruction for PC5 interface signaling transmission, then the first security is determined
  • the key is used to protect the security of the first terminal and the second terminal when transmitting signaling through the PC5 interface.
  • the communication request includes an instruction for PC5 interface radio resource control RRC transmission
  • the second terminal may determine the first security key based on the shared key and the instruction for PC5 interface radio resource control RRC transmission, then it is determined
  • the first security key of is used to protect the security of the first terminal and the second terminal when transmitting RRC through the PC5 interface.
  • the second terminal may determine the first security key based on the shared key, and the identification of the PC5 unicast link of the first terminal and/or the identification of the PC5 unicast link of the second terminal, then the first security is determined
  • the key is only used for the identification of the PC5 unicast link of the first terminal and/or the identification of the PC5 unicast link of the second terminal.
  • the second terminal determines the first security key based on the generation parameters indicated by the shared key and other information in the communication request.
  • the second terminal returns a communication response to the first terminal, and the first terminal receives the communication response from the second terminal.
  • the communication response is used to respond to the communication request sent by the first terminal.
  • the communication response may include one or more types of information:
  • the identity of the second terminal can be a permanent identification ID or other identifications, such as 5G-GUTI, GPSI, or a registered temporary identification dedicated to key negotiation.
  • the first terminal may store the ID of the second terminal.
  • the service identifier which is used to identify the service interacted by the first terminal and the second terminal. It can also be the identity of the application. Please refer to the description of point 2) above.
  • the identification of the shared key It is used to identify a shared key pre-stored or determined by the second terminal, and the shared key is a shared key between the first terminal and the second terminal.
  • the application layer identifier of the first terminal For example, it is marked as application layer ID1.
  • the application layer identifier of the second terminal is recorded as application layer ID2.
  • the layer 2 identification of the first terminal can also be called a source layer 2 (source layer 2) ID.
  • the layer 2 ID of the first terminal is layer 2 ID1
  • the source side layer 2 ID of the first terminal is source layer 2 ID1.
  • the layer 2 identification of the second terminal can also be called a source layer 2 (source layer 2) ID.
  • the layer 2 ID of the second terminal is layer 2 ID2, or the source side layer 2 ID of the second terminal is source layer 2 ID2.
  • PC5-U instruction An instruction for user plane data transmission of the PC5 interface (PC5-U instruction), that is, an instruction for user plane transmission between the first terminal and the second terminal.
  • the identification of DRB It may be the identifier of the DRB carried in the communication request sent by the first terminal, or may be the identifier of the DRB selected by the second terminal after receiving the communication request.
  • the identifier of the data stream flow Used to distinguish different flows or to identify the type of flow.
  • the flow ID is used to identify the data flow as a QoS flow.
  • PC5 unicast link ID The identification of the PC5 unicast link of the first terminal (PC5 unicast link ID), for example, it is recorded as PC5 unicast link ID1.
  • PC5 unicast link ID The identification of the PC5 unicast link of the second terminal (PC5 unicast link ID), for example, it is recorded as PC5 unicast link ID2.
  • the identification of the group or the indication of the group is used to identify the group that the first terminal wants to access, and the group indication is used to indicate the group that the first terminal wants to access.
  • a group is a group for terminal-to-terminal communication.
  • the information included in the aforementioned communication response may be determined according to the information included in the communication request, for example, it may correspond to the same information.
  • the first terminal determines the first security key.
  • Step S204 can also be executed immediately after step S201.
  • the first terminal may determine the first security key according to the shared key and the generation parameter.
  • the generation parameter may be the generation parameter indicated by the information included in the communication request.
  • the first terminal may execute after S201 without waiting for the communication response to be received. Of course, it may also be executed after receiving the communication response. Execute after communication response.
  • the generation parameter may be the generation parameter indicated by the information included in the communication request and/or the communication response. In this case, the first terminal receives the communication response according to the information in the communication response.
  • the indicated generation parameters are used to determine the first security key.
  • the first security key determined by the first terminal is a security key for communication protection between the first terminal and the second terminal, and can be specifically used for a security key for communication protection with a granularity of generation parameters.
  • the first terminal may determine the first security key based on the shared key and the identity of the service, then the determined first security key is only used for the service indicated by the identity of the service, and the identity of different services is determined The first security key that comes out is different.
  • Both the above-mentioned first terminal and the second terminal determine the first security key based on the shared key.
  • the shared key may be obtained through authentication or negotiation between the first terminal and the second terminal, or may be predefined.
  • the authentication process can be authentication based on symmetric (for example, certificate or identity-based cryptography), authentication based on symmetric key, or authentication based on Internet key exchange version 2 (IKEv2) , IP security (IPsec) authentication, or authentication based on transport layer security (TLS), or authentication based on username and password.
  • IKEv2 Internet key exchange version 2
  • IPsec IP security
  • TLS transport layer security
  • the first terminal and the second terminal also need to perform a process of authentication or negotiation of a shared key, and the first terminal and the second terminal save the shared key respectively.
  • the shared key is used to generate or determine the first security key.
  • the first terminal and/or the second terminal may obtain the shared key through the application layer, and may also obtain the shared key through the operator network. If the shared key is obtained through the application layer, the first terminal/second terminal can obtain the shared key through the above-mentioned authentication or negotiation method, or a predefined shared key. If the shared key is obtained through an operator's network, the first terminal and the second terminal need to belong to the same operator, and the first terminal/second terminal can obtain it from the network device.
  • the communication request sent by the first terminal to the second terminal in S201 may also carry an indication 1, which is used to indicate whether the second terminal obtains the shared key through the application layer or through the operator network. The second terminal determines the way to acquire the shared key according to the instruction 1.
  • the second terminal returns a communication response to the first terminal to carry indication 2, which is used to indicate whether the first terminal obtains the shared key through the application layer or through the operator network.
  • the first terminal determines the way of acquiring the shared key according to the instruction 2.
  • the optional method of obtaining the shared key through the operator network and the method of determining the first security key are as follows.
  • the method of obtaining the shared key by the operator and the method of determining the first security key are as follows. Any number of continuous or discontinuous steps in the embodiment shown in Figure 3a can form a solution that needs to be protected in this application, because the embodiment shown in Figure 3a involves multiple execution subjects, and any one of the execution subjects involves part or All operations can form a solution for the execution subject.
  • S303 to S309 may form a solution that needs to be protected in the embodiment of the present application, and the remaining steps are optional steps.
  • the first terminal sends a communication request to the second terminal, and the second terminal receives the communication request from the first terminal.
  • the information that the communication request may include is one or more of the information described in 1) to 15) above.
  • the identification of the first terminal in the communication request may include the ID of the first terminal, where the ID of the first terminal It may be the 5G-GUTI of the first terminal, or the UE ID, or GPSI, or SUCI.
  • the UE ID is the UE identification used for this key agreement service.
  • the communication request may also include the address of the first NF. It is also possible that the identification of the first terminal includes the address information of the first NF.
  • the first terminal and the first NF share some parameters in advance.
  • the first terminal and the first NF respectively store the identification of the first terminal, the key K, and the key identification Key ID.
  • K is the key shared between the first terminal and the first NF.
  • K can include AMF key (denoted as Kamf), NAS key (including encryption key Knasenc and integrity protection). Knasint), or any one or more of anchor keys.
  • the security anchor function (SEAF) is deployed in the AMF.
  • the first NF may be a security anchor function (SEAF)
  • K may be a SEAF key (denoted as K_seaf).
  • the first NF is the authentication server function (authentication server function, AUSF), then K here may include AUSF key (denoted as K_AUSF), NAS key (including encryption key Knasenc and integrity protection key Knasint), or anchor secret Any one or more of the keys.
  • the first NF may be a base station, and the base station is represented by gNB, then K here may be gNB key (denoted as K_gNB ), NAS key (including encryption key Knasenc and integrity protection key Knasint), or anchor key Any one or more of them.
  • the key ID is an indication of the shared key between the first terminal and the first NF, for example, the key ID is ngKSI, AUSF key ID, SEAF key ID, base station key ID.
  • NF is AMF
  • first NF is the first AMF
  • second NF is the second AMF
  • NF is AUSF
  • first NF is the first AUSF
  • second NF is the second AUSF
  • the NF is a base station
  • the first NF is the first base station
  • the second NF is the second base station.
  • the first NF may be the first AUSF
  • the second NF may be the second AMF.
  • the first NF may be the first AMF
  • the second NF may be the second base station.
  • the second NF can be AMF, SEAF, AUSF, or a base station; the first NF can be AMF, SEAF, AUSF, or a base station, etc. without limitation.
  • the communication request sent by the first terminal to the second terminal may also include a message authentication code (message authentication code, MAC), which may be recorded as MAC1 here.
  • MAC1 can be used to verify the authentication of the parameters included in the communication request by the network function.
  • the calculation of MAC1 can be based on the key K, or based on the integrity protection key derived from the key K, or based on the NAS protection key shared between the first terminal and the first AMF; or based on the first terminal and the first AMF. Calculated by the RRC protection key shared between a terminal and the first base station. In addition to the aforementioned various keys, the calculation of MAC1 may also be based on the information included in the aforementioned communication request. For example, the value of MAC1 can be calculated based on the integrity protection key Knasint derived from the NAS protection key. For other MAC calculation methods in the embodiments of the present application, please refer to the calculation method of MAC1 here.
  • the communication request may include a container, and the container may carry 5G-GUTI1 and/or ngKSI.
  • the container may also include MAC1 and other parameters carried in the communication request. For other parameters, refer to the parameters carried in the communication request in the embodiment shown in FIG. 2.
  • the container in the communication request also carries a piece of information that is the same as that in the container; it is also possible to carry some information outside the container in the communication request, such as carrying 5G-GUTI1 and/or ngKSI .
  • the container is sent to the second terminal through a message, and the information outside the container in the communication request is sent to the second terminal through another message. It is also possible that the container carries part of other parameters in the communication request.
  • the container may also include an indication for indicating that the contents of all the containers are used to request end-to-end key negotiation. The network element that subsequently processes the container can use this instruction to determine the container's request.
  • the second terminal may perform subsequent operations according to the 5G-GUTI1 carried in the communication request, and the container will be sent by the second terminal to the first NF. There is no restriction on whether 5G-GUTI is inside or outside the container.
  • the second terminal determines whether the first terminal and the second terminal belong to the same network.
  • Possibility 1 Determine whether the service network accessed by the first terminal and the second terminal are the same.
  • Possibility 2 Determine whether the home network where the first terminal and the second terminal are located is the same.
  • the network identifier in SUCI is used to determine the home network of the first terminal for judgment;
  • the network identifier in 5G-GUTI is used to determine whether it belongs to the same service network;
  • the UE ID is used to determine the service network or the home network;
  • the GPSI is used to determine the home network Network, etc.; it is determined that the service network or the home network is the same through the address where the first NF is located. If there is the possibility of other identification, it can also be judged.
  • the communication request is rejected, and a rejection message is sent to the first terminal.
  • the optional rejection message includes a rejection indication, indicating the reason for rejection.
  • obtain the shared key through the application layer and continue to negotiate the security key with the first terminal.
  • the first security key can be negotiated according to the method shown in FIG. 2 .
  • the second terminal may determine whether the first terminal and the second terminal belong to the same network through the identifier of the first terminal, for example, determine whether the first terminal and the second terminal belong to the same operator through the 5G-GUTI of the first terminal.
  • the second terminal may determine whether the network identifier and the network accessed by the second terminal belong to the same network according to the network identifier in 5G-GUTI1. For example, according to the mobile network code (mobile network code, MNC) and mobile country code (MCC) of the network included in 5G-GUTI1, the second terminal determines whether it is connected to the MNC and MCC of the service network it is connected to. the same.
  • MNC mobile network code
  • MCC mobile country code
  • the network identification here may also be separately sent by the first terminal to the second terminal in the communication request.
  • the second terminal determines the home network and/or the service network according to the received network identifier, and then executes the foregoing determination.
  • the second terminal sends the identity of the first terminal to the first NF, and the first NF obtains the identity of the first terminal.
  • the second terminal When the second terminal sends the identity of the first terminal to the first NF, it may also send other parameters or information to the first NF.
  • the second terminal sends a request message to the first NF, for example recorded as request message 1, and the request message 1 carries the identity of the first terminal and other parameters or information.
  • the request message 1 may also carry indication information, which is used to indicate that the request message 1 is a request related to communication between the terminal and the terminal, for example, indicating that the request message 1 is a request related to the Internet of Vehicles key agreement or is V2X key agreement related request.
  • the second terminal may directly send a key request to the first NF, and the key request may be a NAS message, and the NAS message carries the identity of the first terminal.
  • the second terminal may directly send the identity of the first terminal to the first NF.
  • the NAS message carries a container.
  • the second terminal may send the identity of the first terminal to the first NF through the second NF.
  • the method may be implemented through S304 to S306.
  • the second terminal may send the identity of the first terminal to the first NF through the second NF.
  • the second terminal sends a request message (denoted as request message 2) to the second NF, and the second NF receives the request message 2 from the second terminal.
  • request message 2 a request message (denoted as request message 2)
  • the request message 2 may include the container in the communication request sent by the first terminal.
  • the request message 2 may also include the ID of the second terminal in addition to the container.
  • the ID of the second terminal is recorded as UE ID2.
  • the request message 2 may also include an indication information for indicating that the request message 2 is a request related to communication between the terminal and the terminal, for example, indicating that the request message 2 is an Internet of Vehicles key Negotiation related requests or V2X key negotiation related requests.
  • the second NF may be an AMF serving the second terminal, or may be an AMF selected by the base station after the second terminal sends to the base station.
  • the second NF checks the request message 2 and determines the first NF.
  • the second NF verifies the correctness of the request message 2 received from the second terminal.
  • the verification action is optional.
  • the second NF can be verified by itself, or can be verified by requesting other NFs.
  • the second NF may determine the security context of the UE ID2 through the ID of the second terminal for verification, and verify the integrity protection of the request message 2.
  • the second NF determines another NF that previously served the second terminal through the UE ID2, requests this NF to check and returns the result. After the verification is passed, continue to the next steps.
  • the action checked here is optional and not restricted.
  • the second NF determines according to the indication information that the request message 2 is related to the communication between the terminal and the terminal, for example, indicating that the request message 2 is related to the Internet of Vehicles key negotiation.
  • the request or V2X key agreement related request is related to the request message 2 if the request message 2 includes indication information.
  • the second NF determines the first NF served by the first terminal according to the identity of the first terminal (for example, 5G-GUTI1) and/or the address of the first NF carried in the request message 2.
  • the second NF may determine the first NF according to the address of the first NF carried in the request message 2.
  • the second NF may also send the identity of the first terminal (for example, GPSI) to other NFs (for example, UDM, UDR), obtain the address of the first NF from the other NF, and then determine the first NF.
  • the identity of the first terminal for example, GPSI
  • other NFs for example, UDM, UDR
  • the second NF may also determine whether the first terminal and the second terminal belong to the same network.
  • the specific determination method is the same as the above determination.
  • the second NF sends a key request to the first NF; the first NF receives the key request from the second NF.
  • the key request carries the container received from the second terminal.
  • the key request also carries part or all of the same information as in the container in addition to the container, or other parameters not carried in the container.
  • parameters refer to the communication request carried in the embodiment shown in FIG. 2 Information or parameters.
  • the first NF determines a key K1, which can be used as the aforementioned shared key.
  • the request message (the above request message 1 or request message 2) received by the first NF from the second terminal carries the message verification code MAC1
  • the first NF will also check MAC1, and after confirming that the verification MAC1 is passed, perform the confirmation sharing The key process.
  • the first NF confirms the security context of the first terminal according to 5G-GUTI1 and ngKSI in the container, for example, determines Kamf.
  • K1 is derived based on Kamf.
  • K1 can be derived based on Kamf and generation parameters.
  • the first NF also receives indication information from the container, and determines, according to the indication information, that this message is used for a request related to vehicle networking key negotiation or a V2X key negotiation related request, or end-to-end key negotiation.
  • these generation parameters may also be sent to the first NF through the second terminal and the second NF.
  • the generation parameters can refer to the information included in the above communication request or communication response;
  • generating K1 may also use at least one of the following parameters: NAS uplink or downlink count value, end-to-end communication indication, service identifier, and service type.
  • the identifier and type of the service can be sent to the first NF in the container.
  • the first NF verifies the authenticity of the parameters in the container according to the security context of the first terminal. For example, verify the correctness of MAC1.
  • the verification method may be based on the NAS security key verification method, which is not limited in the embodiment of the present application.
  • the first NF sends the shared key K1 to the second terminal, and the second terminal obtains the shared key K1.
  • the first NF may directly send the response message 1 of the request message 1 to the second terminal, and the second terminal obtains the shared key from the response message 1.
  • the first NF sends K1 to the second terminal through the second NF, and this manner can be implemented through S309 to S311.
  • the first NF returns a key response to the second NF, and the second NF receives the key response from the first NF.
  • the key response is used to respond to the key request.
  • K1 is carried in the key response.
  • the second NF determines the key K2 according to K1.
  • the manner of determining the key K2 can refer to the manner of determining K1, that is, the second NF derives K2 according to K1 and the generation parameter, and the generation parameter can refer to the information carried in the above communication request or communication response.
  • This step can be omitted.
  • the second NF sends a response message 2 of the request message 2 to the second terminal, and the second terminal receives the response message 2 from the second NF.
  • the response message 2 carries the key K2.
  • the key K2 is the shared key.
  • the response message 2 only needs to carry the key K1, and the key K1 is the shared key.
  • the second NF may protect the transmission of K1 or K2 through security context encryption between the second NF and the second terminal.
  • the second terminal determines the first security key K3.
  • the second terminal may further derive K3 according to the key K1 or K2 carried in the response message 2. Or the second terminal derives K3 according to the key K1 carried in the response message 1.
  • the key K1 or K2 is used as the shared key
  • K3 is the first security key.
  • the second terminal may also directly use the key K1 or K2 carried in the response message 2 as the first security key; or, the second terminal may directly use the key K1 carried in the response message 1 as the first security key.
  • the second terminal calculates the value of the message verification code MAC2 according to the first security key K3, or obtains the integrity protection key K3int based on K3, performs integrity protection on the communication response based on K3int, and obtains the value of MAC2 .
  • the second terminal returns a communication response to the first terminal.
  • the first terminal receives the communication response from the second terminal.
  • step S203 For this step, reference may be made to the description of step S203 in the embodiment shown in FIG. 2.
  • the communication response may also include MAC2.
  • the first terminal determines the first security key K3.
  • the first security key is the first security key in the embodiment shown in FIG. 2.
  • the first terminal generates K1 in the same manner as the first NF, and then generates K3; or generates K2 according to K1, and then generates K3.
  • the generation method is the same as described above.
  • the first terminal derives K3 according to Kamf.
  • the first terminal derives K1 according to Kamf, and can refer to the first NF to determine the operation of K1.
  • the operation of K2 can be determined with reference to the first NF; the first terminal then obtains K3 according to K2, and the operation of K3 can be determined with reference to the second terminal.
  • the first terminal checks the correctness of MAC2 according to the first key K3, or uses K3int to check the correctness of MAC2 after obtaining K3int based on K3. If the verification fails, a verification failure response is sent to the second terminal. Optionally, a failure indication is sent to the second terminal, indicating that the MAC2 check fails. If the verification is successful, the key negotiation is completed.
  • the first terminal determines MAC3 and sends MAC3 to the second terminal, and the second terminal receives MAC3 from the first terminal.
  • the first terminal calculates MAC3 according to K3 or K3int.
  • the input parameters of MAC3 may also include at least one of the information carried in the aforementioned communication request or communication response.
  • the second terminal checks MAC3.
  • the second terminal checks MAC3 according to K3 or K3int. If the verification is passed, it means that the first terminal and the second terminal have completed mutual authentication.
  • the identifier of the first terminal may also be GPSI. If the identifier of the first terminal is GPSI, then the 5G-GUTI in the above embodiment may be replaced with GPSI to form a solution It also belongs to the protection scope of the embodiments of the present application.
  • the above-mentioned identification of the first terminal may also be an identification used for key negotiation (denoted as UE ID).
  • the 5G-GUTI in the embodiment described in FIG. 3a can be replaced with the identifier for negotiating the key, and the formed solution also falls within the protection scope of the embodiment of the present application.
  • the identity of the first terminal in Figure 3a is represented by 5G-GUTI/UE ID/GPSI, indicating that the identity of the first terminal can be any of these three types. It is understandable that the identity of the first terminal can also have Other manifestations.
  • the service network identity where the first terminal is located may also be transmitted.
  • the second terminal may determine whether it belongs to the same service network according to the service network identity where the first terminal is received. If it does not belong, the communication request is rejected. If it belongs, continue execution.
  • the home network identity where the first terminal is located can also be transmitted.
  • the second terminal can determine whether it belongs to the same home network according to the received home network identity of the first terminal. If it does not belong, the communication request is rejected. If it belongs, continue execution.
  • the sent UE identifier may also include the service network identifier where the first terminal is located.
  • the second terminal may determine whether it belongs to the same service network according to the received service network identifier where the first terminal is located. If it does not belong, the communication request is rejected. If it belongs, continue execution.
  • the sent UE identity may also include the home network identity where the first terminal is located.
  • the second terminal may determine whether it belongs to the same home network according to the received home network identity of the first terminal. If it does not belong, the communication request is rejected. If it belongs, continue execution.
  • the identifier of the aforementioned UE may also be SUCI.
  • the second terminal can actually belong to the same home network according to the network identifier in the SUCI. If it does not belong, the communication request is rejected. If it belongs, continue execution.
  • the second NF is AMF. After the second NF verifies that the MAC is passed, the identity of the first terminal in the container message is sent to the first NF. It may also send at least one of instruction information, key identification, etc. At this time, the first NF does not need to verify the MAC.
  • the NF is AMF
  • the first NF is the first AMF
  • the second NF is the second AMF.
  • the key provided by the embodiment of this application The production method is as follows.
  • the first terminal sends a communication request to the second terminal, and the second terminal receives the communication request from the first terminal.
  • the information that the communication request may include is one or more of the information described in 1) to 15) above.
  • the identification of the first terminal in the communication request may include the ID of the first terminal, where the ID of the first terminal It may be the 5G-GUTI of the first terminal, or the UE ID, or GPSI, or SUCI.
  • the UE ID is the UE identification used for this key agreement service.
  • the communication request may also include the address of the first AMF. It is also possible that the identification of the first terminal includes the address information of the first AMF.
  • the communication request may also include a message authentication code (message authentication code, MAC), which may be recorded as MAC1 here.
  • MAC1 can be used to verify the authentication of the parameters included in the communication request by the network function.
  • the communication request may include a NAS container (container) in which 5G-GUTI1 and/or ngKSI is carried, and the container may also include MAC1 and other parameters carried in the communication request.
  • the container in the communication request also carries a piece of information that is the same as that in the container; it is also possible to carry some information outside the container in the communication request, such as carrying 5G-GUTI1 and/or ngKSI .
  • the container is sent to the second terminal through a message, and the information outside the container in the communication request is sent to the second terminal through another message.
  • the container carries part of other parameters in the communication request.
  • the container may also include an indication for indicating that the contents of all the containers are used to request end-to-end key negotiation.
  • the network element that subsequently processes the container can use this instruction to determine the container's request.
  • the second terminal sends a first NAS message to the second AMF, and the second AMF receives the first NAS message from the second terminal.
  • the first NAS message carries the identity of the first terminal, and may also carry the NAS container received from the first terminal.
  • the first NAS message here is the request message 2 described in S303 in FIG. 3a, and the related description can refer to the description of the request message 2, which will not be repeated here.
  • the second AMF sends a key request (key request) to the first AMF, and the first AMF receives the key request from the second AMF.
  • the first AMF determines the key K1.
  • the first AMF may first verify the NAS container, for example, MAC1 carried in the NAS container, the first AMF checks MAC1, and after confirming that the verification MAC1 is passed, the key K1 is determined.
  • the first AMF returns a key response to the second AMF, and the second AMF receives the key response from the first AMF.
  • the second NF sends the key K1 to the second terminal, and the second terminal receives the key K1 from the second NF.
  • the second terminal determines the first security key K3. Refer to S312.
  • the second terminal returns a communication response to the first terminal.
  • the first terminal receives the communication response from the second terminal.
  • the first terminal determines the first security key K3. Same as S313.
  • first terminal and the second terminal in FIG. 3b For other undescribed operations of the first terminal and the second terminal in FIG. 3b, reference may be made to the description of the first terminal and the second terminal in FIG. 3a.
  • first AMF in FIG. 3b For other undescribed operations of the first AMF in FIG. 3b, reference may be made to the description of the first NF in FIG. 3a.
  • second AMF in FIG. 3b For other undescribed operations of the second AMF in FIG. 3b, reference may be made to the description of the second NF in FIG. 3a.
  • the parameters or information carried in the message and signaling can also correspond to the related description in Fig. 3a, and will not be repeated.
  • the first AMF and the second AMF may also be the same AMF.
  • the identity of the first terminal is the UE ID
  • the first terminal needs to register the identity for key negotiation.
  • a possible registration process is given below. Any multiple continuous or discontinuous steps in the embodiment shown in FIG. 4 can form a solution, which falls within the protection scope of the embodiments of the present application.
  • the identification of the first terminal may be an identification used to negotiate a key, or may also be understood as an identification used to determine the key derivation of communication protection between the terminal and the terminal, or for other understanding.
  • the first terminal sends a registration request to the AMF, and the AMF receives the registration request from the first terminal.
  • the registration request carries the identity of the first terminal.
  • the identity identifier is a subscription concealed identifier (SUCI).
  • the real identity of the first terminal is called a subscription permanent identifier (SUPI), and the ciphertext encrypted by the SUPI with a key is SUCI.
  • the identity is 5G-GUTI.
  • the registration request also carries an indication (for example, marked as indicator1), which is used to indicate that the first terminal needs to use the service of communication between the terminal and the terminal, such as the Internet of Vehicles service; or, it is used to indicate that the registration request is used for Request to register the logo associated with the vehicle network.
  • an indication for example, marked as indicator1
  • the registration request is used for Request to register the logo associated with the vehicle network.
  • the registration request also carries an application identifier (ID), which is used to indicate a service identifier for terminal-to-terminal communication that the first terminal will use, such as a V2X application ID.
  • ID application identifier
  • the registration request also carries a type of service, which is used to indicate the type of communication service between the terminal and the terminal that the first terminal will use.
  • the AMF sends the identity identifier and the service network identifier of the first terminal to the AUSF, and the AUSF receives the identity identifier and the service network identifier of the first terminal from the AMF.
  • the identity of the first terminal sent by the AMF to the AUSF comes from the identity carried in the registration request, for example, the identity is SUCI.
  • the AMF may also send an indication (for example, indicator1) to the AUSF.
  • an indication for example, indicator1
  • the AMF can also send the application ID to the AUSF.
  • AMF can also send the type of service to AUSF.
  • the AMF sends the instruction and the application ID to the AUSF, for example, the instruction and the application ID are obtained from the registration request.
  • AUSF sends the identity identifier and service network identifier of the first terminal to UDM, and UDM receives the identity identifier and service network identifier of the first terminal from AUSF.
  • the AUSF sends the identity identifier and the service network identifier of the first terminal received from the AMF to the UDM.
  • AUSF also sends the indicator1 to UDM;
  • AUSF also sends the application ID to UDM.
  • AUSF can also send the type of service to UDM.
  • the UDM determines whether to allow the first terminal to use the service of communication between the terminal and the terminal, such as the Internet of Vehicles service, according to the subscription data of the first terminal and indicator1;
  • UDM determines whether to allow the first terminal to use the service of communication between the terminal and the terminal, such as the service indicated by the V2X application ID, according to the subscription data of the first terminal and the application ID and/or service type.
  • UDM sends an authentication vector to AUSF, and AUSF receives the authentication vector SUPI from UDM.
  • UDM also sends SUPI to AUSF, and AUSF also receives SUPI from UDM.
  • an indication (denoted as indicator2) is sent to the AUSF.
  • AUSF receives this indication from UDM.
  • AUSF sends an authentication vector to AMF, and AMF receives the authentication vector from AUSF.
  • AUSF also sends SUPI to AMF, and AMF also receives SUPI from AUSF.
  • S406 Perform mutual authentication between the first terminal, AMF and AUSF.
  • Authentication includes, for example, 5G AKA, EAP AKA'. After the authentication is successful, execute S407.
  • AUSF sends Kseaf and SUPI to AMF, and AMF receives Kseaf and SUPI from AUSF.
  • AUSF also sends indicator2 to AMF, and AMF receives this indicator2 from AUSF.
  • the AMF sends a request message (request) to the UDM to request the subscription information of the UE.
  • the UDM sends a response (response) to the AMF, and the AMF receives the response from the UDM.
  • the response carries the subscription data of the first terminal.
  • the AMF determines whether to allow the first terminal to use the service of communication between the terminal and the terminal. For example, the AMF may determine whether to allow the first terminal to use the service of communication between the terminal and the terminal according to the subscription data of the first terminal and the indicator1. Optionally, the AMF judges whether to allow the first terminal to use the service of communication between the terminal and the terminal according to the subscription data of the first terminal, and the application ID and/or the type of the service.
  • this operation may be performed by UDM or AMF.
  • the subsequent steps may be divided into the following possibilities.
  • the above authentication process is optional. It can also be that the UE has been authenticated and registered to the 5G network. At this time, the UE only initiates a registration process, or other NAS request; requests to obtain the identity of the first terminal from the network for end-to-end communication. After the AMF receives the UE's request, the following possibilities are performed. Optionally, the AMF determines, according to the subscription information, that the UE is allowed to use the service of the communication between the terminal and the terminal.
  • the AMF generates an identification (UE ID) and/or key indication of the first terminal.
  • the UE ID is the temporary identification of the first terminal, which may include the location or name information of the AMF.
  • the temporary identification of the first terminal may include at least one of the following: network identification where AMF is located, MNC where AMF is located, MCC where AMF is located, area address where AMF is located, group ID where AMF is located, set address where AMF is located, AMF Pointer, AMF IP address, fully qualified domain name (FQDN), instance ID, NAI address.
  • the key indication can be used to indicate the AMF key (Kamf) in the current first terminal authentication.
  • the AMF key (Kamf) in the above-mentioned embodiment.
  • the AMF sends the generated identification of the first terminal to the first terminal, and the first terminal receives the identification of the first terminal from the AMF.
  • the AMF can also send the key indication to the first terminal.
  • the first terminal receives the key indication from the AMF.
  • the AMF and the UE derive the basic key according to the AMF key.
  • the key indication is used to indicate this basic key.
  • the derivation of the basic key is not restricted.
  • the derived parameters may include at least one of the following, end-to-end communication identification, service type sent by the UE, application identification, etc.
  • the AMF sends an indication (denoted as indicator3) to the base station, and the base station receives the indication from the AMF.
  • the indicator3 is used to instruct the base station to allocate the temporary identity and/or key indication of the first terminal to the first terminal.
  • AMF will also generate the base station key and send the base station key to the base station.
  • the base station generates an identification (UE ID) and/or key indication of the first terminal.
  • the identifier of the first terminal is the temporary identifier of the first terminal, which may include the location or name information of the base station.
  • the identity of the first terminal includes at least one of the following: the network identity where the base station is located, the MNC where the base station is located, the MCC where the base station is located; the address of the area where the base station is located; the group ID where the base station is located; the collective address where the base station is located; Pointer; the IP address of the base station, FQDN, instance ID, NAI address, etc.
  • the first terminal can find the base station serving the first terminal through the identifier of the first terminal.
  • the key indication may be used to indicate the base station key in the current first terminal authentication, for example, the gNB key ( K_gNB ) described in the above-mentioned embodiment.
  • the base station sends the generated identification and/or key indication of the first terminal to the first terminal, and the first terminal receives the identification and/or key indication of the first terminal from the base station.
  • the base station and the UE derive the basic key according to the gNB key.
  • the key indication is used to indicate this basic key.
  • the derivation of the basic key is not restricted.
  • the derived parameters may include at least one of the following, end-to-end communication identification, service type sent by the UE, application identification, etc.
  • the first possibility and the second possibility mentioned above respectively introduce the situation where the AMF and the base station generate the identity and/or key indication of the first terminal.
  • the third possibility is given below.
  • the AUSF generates the identity and/or key indication of the first terminal.
  • the third possibility may be executed after UDM determines that the first terminal is allowed to use the service of communication between the terminal and the terminal.
  • AUSF After performing mutual authentication between S406AMF and AUSF, AUSF generates the identification and/or key indication of the first terminal. Send to AMF in S407. In the process of establishing a secure connection between the first terminal and the AMF or after the secure connection is established, the AMF sends the identification and/or key indication of the first terminal received from the AUSF to the first terminal.
  • the identity of the first terminal here includes the location or name information of the AUSF, for example, the identity of the first terminal includes at least one of the following: the network identity where the AUSF is located; routing instructions; the MNC where the AUSF is located, the MCC where the AUSF is located; the area address where the AUSF is located ; Group ID where AUSF is located; Set address where AUSF is located; AUSF pointer; AUSF's IP address, FQDN, instance ID, NAI address, etc.
  • the first terminal can find the AUSF serving the first terminal through the identifier of the first terminal.
  • the key indication can be used to indicate the AUSF key in the current first terminal authentication. For example, the AUSF key ( K_AUSF ) described in the above-mentioned embodiment.
  • AUSF and UE derive the basic key according to the AUSF key.
  • the key indication is used to indicate this basic key.
  • the derivation of the basic key is not restricted.
  • the derived parameters may include at least one of the following, end-to-end communication identification, service type sent by the UE, application identification, etc.
  • the update process can be performed according to the above method.
  • request message 1, request message 2, key request, response message 1, response message 2, or key response, etc. can all be called other names.
  • the above is a description of key negotiation in the Internet of Vehicles scenario, and it can also be a specific key negotiation scenario without limitation.
  • the methods provided in the embodiments of the present application are introduced from the perspective of interaction between the first terminal, the second terminal, the first NF, and the second NF respectively.
  • the terminal and the NF may include a hardware structure and/or software module, and the above functions are implemented in the form of a hardware structure, a software module, or a hardware structure plus a software module. Whether a certain function of the above-mentioned functions is executed by a hardware structure, a software module, or a hardware structure plus a software module depends on the specific application and design constraint conditions of the technical solution.
  • an embodiment of the present application further provides an apparatus 500.
  • the apparatus 500 may be a first terminal, a second terminal, or a first NF, or a first terminal or a second terminal. Or a device in the first NF, or a device that can be matched and used with the first terminal, the second terminal, or the first NF.
  • the device 500 may include a one-to-one corresponding module for executing the method/operation/step/action performed by the first terminal, the second terminal or the first NF in the above method embodiment, and the module may be a hardware circuit, It can also be implemented by software, or a combination of hardware circuits and software.
  • the device may include a processing module 501 and a communication module 502.
  • the communication module 502 is configured to send a communication request to the second terminal.
  • the communication request is used to request the establishment of communication with the second terminal.
  • the communication request includes the identity of the first terminal and the identity of the service.
  • the communication module 502 is also used to receive a communication response from the second terminal; the communication response is used to respond to a communication request;
  • the processing module 501 is configured to determine a first security key according to the shared key and the service identifier; where the first security key is a security key for communication protection between the first terminal and the second terminal.
  • the communication module 502 is configured to receive a communication request from the first terminal, the communication request including the identification ID of the first terminal and the identification of the service;
  • the processing module 501 is configured to determine a first security key according to the shared key and the service identifier; where the first security key is a security key for communication protection between the first terminal and the second terminal;
  • the communication module 502 is further configured to return a communication response to the first terminal according to the communication request.
  • the communication module 502 is configured to receive a key request, the key request is sent by the second terminal, or the key request is sent by the second terminal through the second NF, and the key request includes the identity of the first terminal;
  • the processing module 501 is configured to determine a shared key according to the identity of the first terminal;
  • the communication module 502 is also configured to send the shared key to the second terminal, or, is also configured to send the shared key to the second terminal through the second NF.
  • the processing module 501 and the communication module 502 may also be used to perform other corresponding steps or operations performed by the first terminal, the second terminal, or the first NF in the foregoing method embodiment, which will not be repeated here.
  • the division of modules in the embodiments of this application is illustrative, and it is only a logical function division. In actual implementation, there may be other division methods.
  • the functional modules in the various embodiments of this application can be integrated into one process. In the device, it can also exist alone physically, or two or more modules can be integrated into one module.
  • the above-mentioned integrated modules can be implemented in the form of hardware or software function modules.
  • an apparatus 600 provided in an embodiment of this application is used to implement the functions of the first terminal, the second terminal, or the first NF in the foregoing method.
  • the device 600 may be the first terminal, the second terminal, or the first NF, or may be the first terminal, the second terminal, or the device in the first NF, or may be able to communicate with the first terminal, the second terminal, or the first NF. Match the device used.
  • the device may be a chip system.
  • the chip system may be composed of chips, or may include chips and other discrete devices.
  • the apparatus 600 includes at least one processor 620, configured to implement the functions of the first terminal, the second terminal, or the first NF in the method provided in the embodiment of the present application.
  • the device 600 may also include a communication interface 610.
  • the communication interface may be a transceiver, a circuit, a bus, a module, or other types of communication interfaces, which are used to communicate with other devices through a transmission medium.
  • the communication interface 610 is used for the device in the device 600 to communicate with other devices.
  • the other device when the apparatus 600 is the first terminal, the other device may be the second terminal.
  • the other device When the device 600 is the second terminal, the other device may be the first terminal or the first NF.
  • the apparatus 600 is the first NF, the other device may be the second terminal or the second NF.
  • the processor 620 uses the communication interface 610 to send and receive data, and is used to implement the method described in the foregoing method embodiment.
  • the communication interface 610 is used to send a communication request to the second terminal.
  • the communication request is used to request to establish communication with the second terminal.
  • the communication request includes the identity of the first terminal and the identity of the service. .
  • the communication interface 610 is also used to receive a communication response from the second terminal; the communication response is used to respond to a communication request.
  • the processor 620 is configured to determine a first security key according to the shared key and the service identifier; where the first security key is a security key for communication protection between the first terminal and the second terminal.
  • the communication interface 610 is used to receive a communication request from the first terminal, the communication request includes the identification ID of the first terminal and the identification of the service; the processor 620 is used to, according to the shared key and the identification of the service, Determine the first security key; where the first security key is a security key for communication protection between the first terminal and the second terminal; the communication interface 610 is also used to return a communication response to the first terminal according to the communication request.
  • the communication interface 610 is used to receive a key request, which is sent by the second terminal, or the key request is sent by the second terminal through the second NF, and the key request includes the first The identifier of a terminal; the processor 620 is configured to determine the shared key according to the identifier of the first terminal; the communication interface 610 is also configured to send the shared key to the second terminal, or is also configured to send the shared key to the second terminal through the second NF The terminal sends the shared key.
  • the processor 620 and the communication interface 610 may also be used to execute other corresponding steps or operations performed by the first terminal, the second terminal, or the first NF in the foregoing method embodiment, which will not be repeated here.
  • the device 600 may further include at least one memory 630 for storing program instructions and/or data.
  • the memory 630 and the processor 620 are coupled.
  • the coupling in the embodiments of the present application is an indirect coupling or communication connection between devices, units or modules, and may be in electrical, mechanical or other forms, and is used for information exchange between devices, units or modules.
  • the processor 620 may cooperate with the memory 630 to operate.
  • the processor 620 may execute program instructions stored in the memory 630. At least one of the at least one memory may be included in the processor.
  • connection medium between the aforementioned communication interface 610, the processor 620, and the memory 630 is not limited in the embodiment of the present application.
  • the memory 630, the communication interface 620, and the transceiver 610 are connected by a bus 640 in FIG. 6.
  • the bus is represented by a thick line in FIG. 6, and the connection mode between other components is only for schematic illustration. , Is not limited.
  • the bus can be divided into an address bus, a data bus, a control bus, and so on. For ease of representation, only one thick line is used in FIG. 6, but it does not mean that there is only one bus or one type of bus.
  • the processor may be a general-purpose processor, a digital signal processor, an application specific integrated circuit, a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, or a discrete hardware component, which may implement or Perform the methods, steps, and logical block diagrams disclosed in the embodiments of the present application.
  • the general-purpose processor may be a microprocessor or any conventional processor or the like.
  • the steps of the method disclosed in the embodiments of the present application may be directly embodied as being executed and completed by a hardware processor, or executed and completed by a combination of hardware and software modules in the processor.
  • the memory may be a non-volatile memory, such as a hard disk drive (HDD) or a solid-state drive (SSD), etc., or a volatile memory (volatile memory), for example Random-access memory (random-access memory, RAM).
  • the memory is any other medium that can be used to carry or store desired program codes in the form of instructions or data structures and that can be accessed by a computer, but is not limited to this.
  • the memory in the embodiments of the present application may also be a circuit or any other device capable of realizing a storage function for storing program instructions and/or data.
  • part or all of the operations and functions performed by the first terminal, the second terminal, the first NF, or the second NF described can be completed by a chip or an integrated circuit.
  • an embodiment of the present application further provides a chip including a processor for supporting the device to implement the first terminal, the second terminal, and the first terminal, the second terminal, and the first terminal in the foregoing method embodiment.
  • the chip is connected to a memory or the chip includes a memory, and the memory is used to store the necessary program instructions and data of the device.
  • the embodiment of the present application provides a computer storage medium storing a computer program, and the computer program includes instructions for executing the method embodiments provided in the foregoing embodiments.
  • the embodiments of the present application provide a computer program product containing instructions, which when run on a computer, cause the computer to execute the method embodiments provided in the foregoing embodiments.
  • the embodiment of the present application also provides a communication system.
  • the communication system includes at least one of a first terminal 701, a second terminal 702, and a first NF703.
  • the first NF may be an access network device, such as a base station, or a core network device, such as AMF. among them:
  • the first terminal 701 sends a communication request to the second terminal 702, and the second terminal 702 receives the communication request from the first terminal 701.
  • the communication request is used by the first terminal 701 to request to establish communication with the second terminal 702, and the communication request includes the identity of the first terminal 701 and the identity of the service;
  • the second terminal 702 determines the first security key according to the shared key and the identifier of the service; where the first security key is a security key for communication protection between the first terminal and the second terminal.
  • the second terminal 702 returns a communication response to the first terminal 701 according to the communication request.
  • the first terminal 701 receives the communication response from the second terminal 702.
  • the communication response is used to respond to the communication request.
  • the first terminal 701 determines the security key according to the shared key and the identifier of the service, where the security key determined by the first terminal 701 is also the security key for communication protection between the first terminal 701 and the second terminal 702, and The same as the above-mentioned first security key, it can also be recorded as the first security key.
  • the second terminal 702 determines whether the first terminal 701 and the second terminal 702 belong to the same network according to the identity of the first terminal 701.
  • the second terminal 702 determines that the first terminal 701 and the second terminal 702 belong to the same network, the second terminal 702 sends a request message to the first network function NF703, and the request message is used to request a shared key.
  • the first network function NF703 receives the request message.
  • the request message may be called a key request.
  • the key request is sent by the second terminal.
  • the communication system may also include a second NF.
  • the key request is for the second terminal to pass the second terminal. Second, sent by the NF, the key request includes the identity of the first terminal;
  • the first NF703 determines the shared key according to the identity of the first terminal
  • the first NF703 sends the shared key to the second terminal, or the first NF703 sends the shared key to the second terminal through the second NF.
  • the first terminal 701 may also perform other operations performed by the first terminal in the foregoing method embodiment.
  • the second terminal 702 may also perform other operations performed by the second terminal in the foregoing method embodiment.
  • the first NF703 can perform other operations performed by the first NF703 in the foregoing method embodiment.
  • the second NF may perform other operations performed by the second NF in the foregoing method embodiment.
  • the first terminal 701, the second terminal 702, or the first NF703 included in the communication system may all be the devices shown in FIG. 5.
  • the first terminal 701, the second terminal 702, or the first NF703 included in the communication system are all It may be the device shown in FIG. 6 described above.
  • this application can be provided as methods, systems, or computer program products. Therefore, this application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, this application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
  • computer-usable storage media including but not limited to disk storage, CD-ROM, optical storage, etc.
  • These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing equipment to work in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including the instruction device.
  • the device implements the functions specified in one process or multiple processes in the flowchart and/or one block or multiple blocks in the block diagram.
  • These computer program instructions can also be loaded on a computer or other programmable data processing equipment, so that a series of operation steps are executed on the computer or other programmable equipment to produce computer-implemented processing, so as to execute on the computer or other programmable equipment.
  • the instructions provide steps for implementing the functions specified in one process or multiple processes in the flowchart and/or one block or multiple blocks in the block diagram.

Abstract

The embodiments of the present application disclose a key generation method and device, being used for completing key negotiation when direct communication is performed between terminals by means of a PC5 interface. Taking key negotiation between a first terminal and a second terminal as an example, said method comprises: a first terminal sending a communication request to a second terminal, the communication request being used to request for the establishment of communication with the second terminal, the communication request comprising the identifier of the first terminal and the identifier of a service; the first terminal receiving from the second terminal a communication response to the communication request; and the first terminal acquiring a shared key, and determining a security key according to the shared key and the identifier of the service, the security key being a security key for communication protection between the first terminal and the second terminal. Said method is able to complete key negotiation between the first terminal and the second terminal by means of the negotiation process.

Description

一种密钥生成方法及装置Method and device for generating key
相关申请的交叉引用Cross-references to related applications
本申请要求在2019年09月12日提交中国专利局、申请号为201910864831.6、申请名称为“一种密钥生成方法及装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of a Chinese patent application filed with the Chinese Patent Office on September 12, 2019, the application number is 201910864831.6, and the application name is "a key generation method and device", the entire content of which is incorporated into this application by reference in.
技术领域Technical field
本申请实施例涉及通信技术领域,尤其涉及一种密钥生成方法及装置。The embodiments of the present application relate to the field of communication technologies, and in particular, to a method and device for generating a key.
背景技术Background technique
在移动通信网络的车联网场景下,定义了多种终端之间的通信方式。例如,终端1可以通过基站发送数据到用户面功能(user plane function,UPF),UPF通过基站将数据转发给终端2。那么终端1与终端2之间就建立了一个逻辑信道,用于它们之间的业务通信。In the Internet of Vehicles scenario of the mobile communication network, a variety of communication methods between terminals are defined. For example, the terminal 1 may send data to a user plane function (UPF) through the base station, and the UPF forwards the data to the terminal 2 through the base station. Then a logical channel is established between terminal 1 and terminal 2 for service communication between them.
终端1和终端2之间也可以直接通信。在车联网场景下,终端与终端之间可以具有PC5接口。多个终端之间可以通过它们之间的PC5接口直接通信。The terminal 1 and the terminal 2 can also communicate directly. In the Internet of Vehicles scenario, there may be a PC5 interface between the terminal and the terminal. Multiple terminals can communicate directly through the PC5 interface between them.
那么,多个终端之间通过PC5接口直接通信时,如何完成密钥协商是需要解决的问题。Then, when multiple terminals communicate directly through the PC5 interface, how to complete the key agreement is a problem that needs to be solved.
发明内容Summary of the invention
本申请实施例提供一种密钥生成方法及装置,用以解决多个终端之间通过PC5接口直接通信时如何完成密钥协商的问题。The embodiments of the present application provide a key generation method and device to solve the problem of how to complete key negotiation when multiple terminals communicate directly through a PC5 interface.
本申请实施例提供的具体技术方案如下:The specific technical solutions provided by the embodiments of this application are as follows:
第一方面,提供一种密钥生成方法,该方法应用于多个终端直接通信的系统中,例如,该系统中的任意两个终端用第一终端和第二终端表示,以第一终端和第二终端之间的交互过程来介绍一下本申请提供的密钥生成方法。第一终端向第二终端发送通信请求,第二终端从第一终端接收通信请求,所述通信请求用于请求与所述第二终端建立通信,所述通信请求包括所述第一终端的标识和业务的标识;业务的标识用于指示第一终端与第二终端建立通信的业务。所述第二终端根据共享密钥和所述业务的标识,确定第一安全密钥;所述第二终端根据所述通信请求,向所述第一终端返回通信响应;所述第一终端从所述第二终端接收通信响应,所述通信响应用于响应所述通信请求;所述第一终端根据共享密钥和所述业务的标识,确定第一安全密钥,其中,所述第一安全密钥为所述第一终端与所述第二终端之间通信保护的安全密钥。通过上述方法,能够实现终端与终端之间直接通信时的密钥协商。并且由于第一终端和第二终端是根据业务的标识确定的第一安全密钥,因此该第一安全密钥是用于该业务的标识所指示的某个特定的业务的,从而能够使得不同的业务之间使用的密钥是不同的,达到不同业务之间密钥隔离的效果。In the first aspect, a key generation method is provided, which is applied to a system in which multiple terminals communicate directly. For example, any two terminals in the system are represented by a first terminal and a second terminal, and the first terminal and The interaction process between the second terminal will introduce the key generation method provided in this application. The first terminal sends a communication request to the second terminal, the second terminal receives a communication request from the first terminal, the communication request is used to request the establishment of communication with the second terminal, and the communication request includes the identification of the first terminal And the identifier of the service; the identifier of the service is used to indicate the service for establishing communication between the first terminal and the second terminal. The second terminal determines the first security key according to the shared key and the service identifier; the second terminal returns a communication response to the first terminal according to the communication request; the first terminal receives The second terminal receives a communication response, and the communication response is used to respond to the communication request; the first terminal determines a first security key according to the shared key and the identifier of the service, wherein the first The security key is a security key for communication protection between the first terminal and the second terminal. Through the above method, it is possible to realize key negotiation when the terminal communicates directly with the terminal. And because the first terminal and the second terminal are the first security key determined according to the service identifier, the first security key is used for a specific service indicated by the service identifier, thereby enabling different The keys used between different businesses are different, which achieves the effect of key isolation between different businesses.
在一个可能的设计中,所述通信请求还包括以下一种或多种信息:所述共享密钥的标识、业务的类型、所述第一终端的应用层标识、所述第二终端的应用层标识、所述第一终端的层2标识、所述第二终端的层2标识、用于PC5接口信令传输的指示、用于PC5接口 无线资源控制RRC传输的指示、用于PC5接口用户面数据传输的指示、数据无线承载DRB的标识、数据流flow的标识、所述第一终端的PC5单播链接的标识或终端到终端通信群组的标识。In a possible design, the communication request further includes one or more of the following information: the identity of the shared key, the type of service, the application layer identity of the first terminal, and the application of the second terminal Layer ID, Layer 2 ID of the first terminal, Layer 2 ID of the second terminal, instructions for PC5 interface signaling transmission, instructions for PC5 interface radio resource control RRC transmission, for PC5 interface users The indication of plane data transmission, the identification of the data radio bearer DRB, the identification of the data flow, the identification of the PC5 unicast link of the first terminal or the identification of the terminal-to-terminal communication group.
在一个可能的设计中,所述通信响应包括以下一种或多种信息:所述共享密钥的标识、业务的类型、所述第一终端的应用层标识、所述第二终端的应用层标识、所述第一终端的层2标识、所述第二终端的层2标识、用于PC5接口信令传输的指示、用于PC5接口RRC传输的指示、用于PC5接口用户面数据传输的指示、DRB的标识、数据流flow的标识、所述第一终端的PC5单播链接的标识、所述第二终端的PC5单播链接的标识或终端到终端通信群组的标识。In a possible design, the communication response includes one or more of the following information: identification of the shared key, type of service, application layer identification of the first terminal, application layer of the second terminal ID, the layer 2 ID of the first terminal, the layer 2 ID of the second terminal, the instruction for PC5 interface signaling transmission, the instruction for PC5 interface RRC transmission, the instruction for PC5 interface user plane data transmission Indication, the identifier of the DRB, the identifier of the data flow, the identifier of the PC5 unicast link of the first terminal, the identifier of the PC5 unicast link of the second terminal or the terminal-to-terminal communication group.
在一个可能的设计中,如果通信请求中携带上述一个或多个信息,那么所述第一终端根据共享密钥和所述业务的标识,确定第一安全密钥,还可以通过以下方式实现:所述第一终端根据共享密钥、所述业务的标识和所述通信请求中包括的所述一种或多种信息,确定第一安全密钥。这样第一终端根据通信请求中携带的信息来确定第一安全密钥,不仅能够实现不同业务之间的密钥隔离,还能够实现针对该信息的参数之间的密钥隔离。例如,通信请求中包括用于PC5接口无线资源控制RRC传输的指示,第一终端可以基于共享密钥和通信请求中包括的用于PC5接口无线资源控制RRC传输的指示,来确定第一安全密钥,则确定的第一安全密钥用于保护第一终端与第二终端在通过PC5接口传输RRC时的安全性。In a possible design, if the communication request carries one or more of the above information, then the first terminal determines the first security key according to the shared key and the service identifier, which can also be implemented in the following manner: The first terminal determines the first security key according to the shared key, the identifier of the service, and the one or more types of information included in the communication request. In this way, the first terminal determines the first security key according to the information carried in the communication request, which can not only realize the key isolation between different services, but also realize the key isolation between the parameters of the information. For example, the communication request includes an indication for PC5 interface radio resource control RRC transmission, and the first terminal may determine the first security secret based on the shared key and the indication for PC5 interface radio resource control RRC transmission included in the communication request. Key, the determined first security key is used to protect the security of the first terminal and the second terminal when RRC is transmitted through the PC5 interface.
在一个可能的设计中,如果通信响应中携带上述一个或多个信息,那么所述第一终端根据共享密钥和所述业务的标识,确定第一安全密钥,还可以通过以下方式实现:所述第一终端根据共享密钥、所述业务的标识和所述通信响应中包括的所述一种或多种信息,确定第一安全密钥。这样第一终端根据通信响应中携带的信息来确定第一安全密钥,不仅能够实现不同业务之间的密钥隔离,还能够实现针对该信息的参数之间的密钥隔离。例如,通信请求中包括用于PC5接口无线资源控制RRC传输的指示,第一终端可以基于共享密钥和通信响应中携带的用于PC5接口无线资源控制RRC传输的指示,来确定第一安全密钥,则确定的第一安全密钥用于保护第一终端与第二终端在通过PC5接口传输RRC时的安全性。In a possible design, if the communication response carries one or more of the above-mentioned information, the first terminal determines the first security key according to the shared key and the service identifier, which can also be implemented in the following manner: The first terminal determines the first security key according to the shared key, the identifier of the service, and the one or more types of information included in the communication response. In this way, the first terminal determines the first security key according to the information carried in the communication response, which can not only realize the key isolation between different services, but also realize the key isolation between the parameters of the information. For example, the communication request includes an instruction for PC5 interface radio resource control RRC transmission, and the first terminal may determine the first security secret based on the shared key and the instruction for PC5 interface radio resource control RRC transmission carried in the communication response. Key, the determined first security key is used to protect the security of the first terminal and the second terminal when RRC is transmitted through the PC5 interface.
需要说明的是,所述第一终端从所述第二终端接收通信响应,以及所述第一终端确定第一安全密钥,这两个步骤之间没有严格的执行顺序。可以互相交换顺序。第一终端可以根据共享密钥和通信请求中的参数来生成第一安全密钥,这样就不用在接收到通信响应后再确定第一安全密钥。还有一种情况是在接收到通信响应后,根据通信响应中的参数来确定第一安全密钥,这样需要再接收到通信响应后,再执行确定第一安全密钥的步骤。It should be noted that, the first terminal receives the communication response from the second terminal, and the first terminal determines the first security key, there is no strict execution sequence between these two steps. The order can be exchanged with each other. The first terminal may generate the first security key according to the shared key and the parameters in the communication request, so that there is no need to determine the first security key after receiving the communication response. In another case, after receiving the communication response, the first security key is determined according to the parameters in the communication response, so that it is necessary to perform the step of determining the first security key after the communication response is received.
类似的,在一个可能的设计中,所述第二终端根据共享密钥和所述业务的标识,确定第一安全密钥,可以通过以下方式实现:所述第二终端根据共享密钥、所述业务的标识和所述通信请求中包括的所述一种或多种信息,确定第一安全密钥。这样第二终端根据通信请求中携带的信息来确定第一安全密钥,不仅能够实现不同业务之间的密钥隔离,还能够实现针对该信息的参数之间的密钥隔离。例如,通信请求中包括用于PC5接口无线资源控制RRC传输的指示,第二终端可以基于共享密钥和通信请求中包括的用于PC5接口无线资源控制RRC传输的指示,来确定第一安全密钥,则确定的第一安全密钥用于保护第一终端与第二终端在通过PC5接口传输RRC时的安全性。Similarly, in a possible design, the second terminal determines the first security key according to the shared key and the service identifier, which can be implemented in the following manner: the second terminal determines the first security key according to the shared key, the The identification of the service and the one or more types of information included in the communication request determine the first security key. In this way, the second terminal determines the first security key according to the information carried in the communication request, which can not only realize the key isolation between different services, but also realize the key isolation between the parameters of the information. For example, the communication request includes an indication for PC5 interface radio resource control RRC transmission, and the second terminal may determine the first security secret based on the shared key and the indication for PC5 interface radio resource control RRC transmission included in the communication request. Key, the determined first security key is used to protect the security of the first terminal and the second terminal when RRC is transmitted through the PC5 interface.
在一个可能的设计中,所述第二终端根据共享密钥和所述业务的标识,确定第一安全密钥,可以通过以下方式实现:所述第二终端根据共享密钥、所述业务的标识和所述通信响应中包括的所述一种或多种信息,确定第一安全密钥。这样第二终端根据通信响应中携带的信息来确定第一安全密钥,不仅能够实现不同业务之间的密钥隔离,还能够实现针对该信息的参数之间的密钥隔离。例如,通信请求中包括用于PC5接口无线资源控制RRC传输的指示,第二终端可以基于共享密钥和通信响应中携带的用于PC5接口无线资源控制RRC传输的指示,来确定第一安全密钥,则确定的第一安全密钥用于保护第一终端与第二终端在通过PC5接口传输RRC时的安全性。In a possible design, the second terminal determines the first security key according to the shared key and the service identifier, which can be implemented in the following manner: the second terminal according to the shared key, the service ID The identification and the one or more types of information included in the communication response determine the first security key. In this way, the second terminal determines the first security key according to the information carried in the communication response, which can not only realize the key isolation between different services, but also realize the key isolation between the parameters of the information. For example, the communication request includes an indication for PC5 interface radio resource control RRC transmission, and the second terminal may determine the first security secret based on the shared key and the indication for PC5 interface radio resource control RRC transmission carried in the communication response. Key, the determined first security key is used to protect the security of the first terminal and the second terminal when RRC is transmitted through the PC5 interface.
这样第一终端与第二终端之间协商的密钥可以是针对某一个参数的,比如针对业务标识所指示的业务的,或者是针对PC5接口RRC传输的,或者针对DRB的标识所指示的DRB的。这样,第一终端与第二终端之间协商的密钥可以是以参数为粒度的不同参数之间在应用密钥时是隔离的。In this way, the key negotiated between the first terminal and the second terminal can be for a certain parameter, such as for the service indicated by the service ID, or for the RRC transmission of the PC5 interface, or for the DRB indicated by the DRB ID of. In this way, the key negotiated between the first terminal and the second terminal may be isolated between different parameters whose granularity is the parameter when the key is applied.
在一个可能的设计中,所述通信请求中还包括第一消息验证码MAC和/或第一指示,所述第一MAC用于校验所述通信请求是否为合法请求,所述第一指示用于指示所述第二终端通过应用层获取所述共享密钥或者通过运营商网络获取所述共享密钥。In a possible design, the communication request further includes a first message verification code MAC and/or a first indication, and the first MAC is used to verify whether the communication request is a legitimate request, and the first indication It is used to instruct the second terminal to obtain the shared key through an application layer or obtain the shared key through an operator network.
在一个可能的设计中,所述第二终端根据所述第一终端的标识,判断所述第一终端和所述第二终端是否属于同一网络。通过判断第一终端和第二终端是否属于同一网络,能够确定通过应用层获取共享密钥还是通过运营商网络获取共享密钥。可以拓展获取共享密钥的途径。In a possible design, the second terminal judges whether the first terminal and the second terminal belong to the same network according to the identifier of the first terminal. By judging whether the first terminal and the second terminal belong to the same network, it can be determined whether to obtain the shared key through the application layer or through the operator network. The way to obtain the shared key can be expanded.
在一个可能的设计中,所述第二终端确定所述第一终端和所述第二终端属于同一网络,向第一网络功能NF发送非接入层NAS请求,所述NAS请求用于请求所述共享密钥。这样,可以通过运营商网络获取共享密钥,例如,可能根据AMF key完成第一终端和第二终端之间的密钥协商。In a possible design, the second terminal determines that the first terminal and the second terminal belong to the same network, and sends a non-access stratum NAS request to the first network function NF. The NAS request is used to request all The shared secret key. In this way, the shared key can be obtained through the operator's network. For example, the key agreement between the first terminal and the second terminal may be completed according to the AMF key.
在一个可能的设计中,所述NAS请求中包括以下至少一种信息:所述第一终端的标识、消息验证码MAC或第一指示;所述第一指示用于指示所述NAS请求用于车联网通信。In a possible design, the NAS request includes at least one of the following information: the identifier of the first terminal, the message verification code MAC, or the first indication; the first indication is used to indicate that the NAS request is used for Telematics communication.
在一个可能的设计中,所述第二终端从所述第一NF接收NAS响应,所述NAS响应中包括所述共享密钥。这样,可以通过运营商网络获取共享密钥,例如,第一NF为AMF,第一NF提供的共享密钥为AMF key,第一终端和第二终端可以根据AMF key完成密钥协商。In a possible design, the second terminal receives a NAS response from the first NF, and the NAS response includes the shared key. In this way, the shared key can be obtained through the operator network. For example, the first NF is AMF, the shared key provided by the first NF is AMF key, and the first terminal and the second terminal can complete key negotiation according to the AMF key.
在一个可能的设计中,所述通信响应中还携带第二指示,所述第二指示用于指示所述第一终端通过应用层获取所述共享密钥或者通过运营商网络获取所述共享密钥。In a possible design, the communication response also carries a second indication, and the second indication is used to instruct the first terminal to obtain the shared key through the application layer or obtain the shared secret through the operator network. key.
在一个可能的设计中,所述第一终端向网络设备发送注册请求,所述注册请求用于请求注册所述第一终端的标识,所述注册请求中包括第三指示,所述第三指示用于指示所述第一终端请求使用终端与终端之间通信的业务;所述第一终端从所述网络设备接收所述第一终端的标识。例如,这里的网络设备可以是核心网设备,比如为AMF。第一终端通过向网络设备发送注册请求,能够请求注册用于协商密钥的标识。网络设备向第一终端返回第一终端的标识,可以是根据注册请求分配的用于协商密钥的标识。当第一终端采用该用于协商密钥的标识与第二终端之间进行密钥协商时,由于该标识是网络侧分配的用于协商密钥的,能够避免泄露其他类型的标识(例如5G-GUTI),5G-GUTI使用次数越少,越能提高安全性能。In a possible design, the first terminal sends a registration request to the network device, the registration request is used to request to register the identity of the first terminal, the registration request includes a third instruction, and the third instruction It is used to instruct the first terminal to request the use of a service for communication between the terminal and the terminal; the first terminal receives the identification of the first terminal from the network device. For example, the network device here may be a core network device, such as AMF. The first terminal can request to register the identification used for key negotiation by sending a registration request to the network device. The network device returns the identification of the first terminal to the first terminal, which may be an identification allocated according to the registration request for key negotiation. When the first terminal adopts the identifier for key negotiation and the second terminal for key negotiation, since the identifier is allocated by the network side for key negotiation, it can avoid the disclosure of other types of identifiers (such as 5G). -GUTI), the less 5G-GUTI is used, the more safety performance can be improved.
第二方面,提供一种密钥生成方法,该方法的执行主体为NF,例如记为第一NF。该方法可以通过以下方式实现:第一网络功能NF接收密钥请求,所述密钥请求包括所述第一终端的标识;所述第一NF根据所述第一终端的标识,确定共享密钥;所述第一NF向所述第二终端发送所述共享密钥。所述共享密钥用于第一终端生成第一安全密钥。第一安全密钥为所述第一终端与所述第二终端之间通信保护的安全密钥。这样,可以通过运营商网络来向终端提供共享密钥,例如,第一NF为AMF,第一NF提供的共享密钥为AMF key,第一终端和第二终端可以根据AMF key完成密钥协商。In a second aspect, a method for generating a key is provided, and the execution subject of the method is NF, for example, denoted as first NF. The method can be implemented in the following manner: a first network function NF receives a key request, the key request includes the identification of the first terminal; the first NF determines a shared key according to the identification of the first terminal ; The first NF sends the shared key to the second terminal. The shared key is used by the first terminal to generate a first security key. The first security key is a security key for communication protection between the first terminal and the second terminal. In this way, the shared key can be provided to the terminal through the operator network. For example, the first NF is AMF, the shared key provided by the first NF is AMF key, and the first terminal and the second terminal can complete key negotiation according to the AMF key. .
在一个可能的设计中,所述密钥请求是第二终端发送的。第二终端向第一NF发送密钥请求,第一NF从第二终端接收该密钥请求。第二终端是归属于该第一NF的。In a possible design, the key request is sent by the second terminal. The second terminal sends a key request to the first NF, and the first NF receives the key request from the second terminal. The second terminal belongs to the first NF.
或者,所述密钥请求是所述第二终端通过第二NF发送的。即第二终端向第二NF发送密钥请求,第二NF向第一NF发送该密钥请求。这种情况下可能第二终端是归属于第二NF的,第一终端是归属于第一NF的。Alternatively, the key request is sent by the second terminal through a second NF. That is, the second terminal sends a key request to the second NF, and the second NF sends the key request to the first NF. In this case, it is possible that the second terminal belongs to the second NF, and the first terminal belongs to the first NF.
在一个可能的设计中,所述密钥请求还包括消息验证码MAC;所述第一NF校验所述MAC,确定所述MAC校验通过。In a possible design, the key request further includes a message verification code MAC; the first NF verifies the MAC and determines that the MAC verification passes.
在一个可能的设计中,所述密钥请求还包括以下一种或多种信息:所述共享密钥的标识、业务的标识、业务的类型、所述第一终端的应用层标识、所述第二终端的应用层标识、所述第一终端的层2标识、所述第二终端的层2标识、用于PC5接口信令传输的指示、用于PC5接口无线资源控制RRC传输的指示、用于PC5接口用户面数据传输的指示、数据无线承载DRB的标识、数据流flow的标识、所述第一终端的PC5单播链接的标识或终端到终端通信群组的标识。密钥请求中包括的这些信息可能携带于一个container中。由第一终端将该container发送至第二终端,第二终端发送至第一NF;或者,由第一终端将该container发送至第二终端,第二终端将该container发送至第二NF,第二NF将该container发送至第一NF。In a possible design, the key request further includes one or more of the following information: the identification of the shared key, the identification of the service, the type of the service, the application layer identification of the first terminal, the The application layer identifier of the second terminal, the layer 2 identifier of the first terminal, the layer 2 identifier of the second terminal, an indication for PC5 interface signaling transmission, an indication for PC5 interface radio resource control RRC transmission, It is used for the instruction of PC5 interface user plane data transmission, the identifier of the data radio bearer DRB, the identifier of the data flow, the identifier of the PC5 unicast link of the first terminal or the identifier of the terminal-to-terminal communication group. The information included in the key request may be carried in a container. The first terminal sends the container to the second terminal, and the second terminal sends the container to the first NF; or, the first terminal sends the container to the second terminal, and the second terminal sends the container to the second NF. The second NF sends the container to the first NF.
在一个可能的设计中,所述第一NF根据所述第一终端的标识以及所述密钥请求中的所述一种或多种信息,确定所述共享密钥。In a possible design, the first NF determines the shared key according to the identification of the first terminal and the one or more types of information in the key request.
在一个可能的设计中,第一NF在确定共享密钥后,向所述第二终端发送所述共享密钥,可能是通过以下方式实现的:第一NF向第二NF发送共享密钥,第二NF将共享密钥发送给第二终端,或者第二NF根据共享密钥再生成一个密钥,将生成的密钥发送给第二终端。或者,第一NF直接将共享密钥发送给第二终端。In a possible design, after determining the shared key, the first NF sends the shared key to the second terminal, which may be implemented in the following manner: the first NF sends the shared key to the second NF, The second NF sends the shared key to the second terminal, or the second NF generates a key according to the shared key, and sends the generated key to the second terminal. Or, the first NF directly sends the shared key to the second terminal.
第三方面,提供一种装置,该装置可以是终端,也可以是终端中的装置,或者是能够和终端匹配使用的装置。一种设计中,该装置可以包括执行第一方面中所描述的第一终端执行的方法/操作/步骤/动作所一一对应的模块,或者,该装置可以包括执行第一方面中所描述的第二终端执行的方法/操作/步骤/动作所一一对应的模块。该模块可以是硬件电路,也可是软件,也可以是硬件电路结合软件实现。一种设计中,该装置可以包括处理模块和通信模块。In a third aspect, a device is provided. The device may be a terminal, a device in the terminal, or a device that can be matched and used with the terminal. In one design, the device may include modules that perform one-to-one correspondence of the methods/operations/steps/actions performed by the first terminal described in the first aspect, or the device may include modules that perform the methods/operations/steps/actions described in the first aspect. The module corresponding to the method/operation/step/action executed by the second terminal. The module can be a hardware circuit, software, or a combination of hardware circuit and software. In one design, the device may include a processing module and a communication module.
示例性地,当该装置用于执行第一方面中的第一终端所执行的操作时:通信模块,用于向第二终端发送通信请求,所述通信请求用于请求与所述第二终端建立通信,所述通信请求包括所述第一终端的标识和业务的标识;所述通信模块,还用于从所述第二终端接收通信响应;所述通信响应用于响应所述通信请求;处理模块,用于根据共享密钥和所述业务的标识,确定第一安全密钥;其中,所述第一安全密钥为所述第一终端与所述第二终端 之间通信保护的安全密钥。Exemplarily, when the device is used to perform the operation performed by the first terminal in the first aspect: the communication module is used to send a communication request to the second terminal, and the communication request is used to request communication with the second terminal. To establish communication, the communication request includes the identity of the first terminal and the identity of the service; the communication module is further configured to receive a communication response from the second terminal; the communication response is used to respond to the communication request; The processing module is configured to determine a first security key according to the shared key and the service identifier; wherein, the first security key is the security of communication protection between the first terminal and the second terminal Key.
在一个可能的设计中,所述处理单元用于:根据共享密钥、所述业务的标识和所述通信请求中包括的所述一种或多种信息,确定第一安全密钥。In a possible design, the processing unit is configured to determine the first security key according to the shared key, the identifier of the service, and the one or more types of information included in the communication request.
在一个可能的设计中,所述通信模块还用于:向网络设备发送注册请求,所述注册请求用于请求注册所述第一终端的标识,所述注册请求中包括第三指示,所述第三指示用于指示所述第一终端请求使用终端与终端之间通信的业务;以及用于从所述网络设备接收所述第一终端的标识。In a possible design, the communication module is further configured to send a registration request to a network device, the registration request is used to request registration of the identity of the first terminal, the registration request includes a third instruction, the The third indication is used to indicate that the first terminal requests to use the service of communication between the terminal and the terminal; and used to receive the identification of the first terminal from the network device.
示例性地,当该装置用于执行第一方面中的第一终端所执行的操作时:通信模块,用于从第一终端接收通信请求,所述通信请求包括所述第一终端的标识ID和业务的标识;处理模块,用于根据共享密钥和所述业务的标识,确定第一安全密钥;其中,所述第一安全密钥为所述第一终端与所述第二终端之间通信保护的安全密钥;所述通信模块,还用于根据所述通信请求,向所述第一终端返回通信响应。Exemplarily, when the device is used to perform an operation performed by the first terminal in the first aspect: a communication module, configured to receive a communication request from the first terminal, the communication request including the identification ID of the first terminal And the identification of the service; the processing module is used to determine the first security key according to the shared key and the identification of the service; wherein, the first security key is the difference between the first terminal and the second terminal A security key for inter-communication protection; the communication module is further configured to return a communication response to the first terminal according to the communication request.
在一个可能的设计中,所述处理模块用于:根据共享密钥、所述业务的标识和所述通信请求中包括的所述一种或多种信息,确定第一安全密钥。In a possible design, the processing module is configured to determine the first security key according to the shared key, the identifier of the service, and the one or more types of information included in the communication request.
在一个可能的设计中,所述处理模块还用于:根据所述第一终端的标识,判断所述第一终端和所述第二终端是否属于同一网络;确定所述第一终端和所述第二终端属于同一网络;所述通信模块还用于向第一网络功能NF发送非接入层NAS请求,所述NAS请求用于请求所述共享密钥。In a possible design, the processing module is further configured to: determine whether the first terminal and the second terminal belong to the same network according to the identity of the first terminal; determine whether the first terminal and the second terminal belong to the same network; The second terminal belongs to the same network; the communication module is also used to send a non-access stratum NAS request to the first network function NF, and the NAS request is used to request the shared key.
在一个可能的设计中,所述NAS请求中包括以下至少一种信息:所述第一终端的标识、消息验证码MAC或第一指示;所述第一指示用于指示所述NAS请求用于车联网通信;所述通信模块还用于,从所述第一NF接收NAS响应,所述NAS响应中包括所述共享密钥。In a possible design, the NAS request includes at least one of the following information: the identifier of the first terminal, the message verification code MAC, or the first indication; the first indication is used to indicate that the NAS request is used for Car networking communication; the communication module is further configured to receive a NAS response from the first NF, and the NAS response includes the shared key.
无论该装置用于执行第一方面中的第一终端所执行的操作,还是用于执行第一方面中的第二终端所执行的操作,还可以有以下可选的实施方式:Regardless of whether the device is used to perform operations performed by the first terminal in the first aspect or used to perform operations performed by the second terminal in the first aspect, the following optional implementation manners are also possible:
可选的,所述通信请求还包括以下一种或多种信息:所述共享密钥的标识、业务的类型、所述第一终端的层2标识、所述第二终端的层2标识数据无线承载DRB的标识、数据流flow的标识、所述第一终端的PC5单播链接的标识或终端到终端通信群组的标识。Optionally, the communication request further includes one or more of the following information: identification of the shared key, type of service, layer 2 identification of the first terminal, layer 2 identification data of the second terminal The ID of the radio bearer DRB, the ID of the data flow, the ID of the PC5 unicast link of the first terminal, or the ID of the terminal-to-terminal communication group.
可选的,所述通信请求中还包括第一消息验证码MAC和/或第一指示,所述第一MAC用于校验所述通信请求是否为合法请求,所述第一指示用于指示所述第二终端通过应用层获取所述共享密钥或者通过运营商网络获取所述共享密钥。Optionally, the communication request further includes a first message verification code MAC and/or a first indication, the first MAC is used to check whether the communication request is a legal request, and the first indication is used to indicate The second terminal obtains the shared key through an application layer or obtains the shared key through an operator network.
可选的,所述通信响应中携带第二指示,所述第二指示用于指示所述第一终端通过应用层获取所述共享密钥或者通过运营商网络获取所述共享密钥。Optionally, the communication response carries a second indication, and the second indication is used to instruct the first terminal to obtain the shared key through an application layer or obtain the shared key through an operator network.
第四方面,提供一种装置,该装置可以是网络功能NF,记为第一NF,也可以是NF中的装置,或者是能够和NF匹配使用的装置。一种设计中,该装置可以包括执行第二方面中所描述的第一NF执行的方法/操作/步骤/动作所一一对应的模块。该模块可以是硬件电路,也可是软件,也可以是硬件电路结合软件实现。一种设计中,该装置可以包括处理模块和通信模块。In a fourth aspect, a device is provided. The device may be a network function NF, denoted as the first NF, may also be a device in the NF, or a device that can be used in conjunction with the NF. In one design, the device may include modules that perform one-to-one correspondence of the methods/operations/steps/actions performed by the first NF described in the second aspect. The module can be a hardware circuit, software, or a combination of hardware circuit and software. In one design, the device may include a processing module and a communication module.
示例性地,通信模块,用于接收密钥请求,所述密钥请求是第二终端发送的,或者,所述密钥请求是所述第二终端通过第二NF发送的,所述密钥请求包括所述第一终端的标识;处理模块,用于根据所述第一终端的标识,确定共享密钥;所述通信模块还用于向所 述第二终端发送所述共享密钥,或者,还用于通过所述第二NF向所述第二终端发送所述共享密钥。Exemplarily, the communication module is configured to receive a key request, the key request is sent by a second terminal, or the key request is sent by the second terminal through a second NF, the key The request includes the identification of the first terminal; the processing module is configured to determine the shared key according to the identification of the first terminal; the communication module is also configured to send the shared key to the second terminal, or And is also used to send the shared key to the second terminal through the second NF.
在一个可能的设计中,所述密钥请求还包括消息验证码MAC;所述处理模块还用于:校验所述MAC,确定所述MAC校验通过。In a possible design, the key request further includes a message verification code MAC; the processing module is further configured to verify the MAC and determine that the MAC verification passes.
在一个可能的设计中,所述密钥请求还包括以下一种或多种信息:所述共享密钥的标识、业务的标识、业务的类型、所述第一终端的层2标识、所述第二终端的层2标识、数据无线承载DRB的标识、数据流flow的标识、所述第一终端的PC5单播链接的标识或终端到终端通信群组的标识。In a possible design, the key request further includes one or more of the following information: the identification of the shared key, the identification of the service, the type of the service, the layer 2 identification of the first terminal, the The layer 2 identification of the second terminal, the identification of the data radio bearer DRB, the identification of the data flow, the identification of the PC5 unicast link of the first terminal, or the identification of the terminal-to-terminal communication group.
在一个可能的设计中,所述处理模块用于:根据所述第一终端的标识以及所述密钥请求中的所述一种或多种信息,确定所述共享密钥。In a possible design, the processing module is configured to determine the shared key according to the identification of the first terminal and the one or more types of information in the key request.
第五方面,本申请实施例提供一种装置,所述装置包括通信接口和处理器,所述通信接口用于该装置与其它设备进行通信,例如数据或信号的收发。示例性的,通信接口可以是收发器、电路、总线、模块或其它类型的通信接口;其它设备可以为其它终端或者NF。处理器用于执行上述第一方面描述的第一终端或第二终端执行的方法。所述装置还可以包括存储器,用于存储处理器调用的指令。所述存储器与所述处理器耦合,所述处理器执行所述存储器中存储的指令时,可以实现上述第一方面描述的第一终端或第二终端执行的方法。In a fifth aspect, an embodiment of the present application provides a device, the device includes a communication interface and a processor, and the communication interface is used for communication between the device and other devices, for example, data or signal transmission and reception. Exemplarily, the communication interface may be a transceiver, circuit, bus, module, or other type of communication interface; other devices may be other terminals or NFs. The processor is configured to execute the method executed by the first terminal or the second terminal described in the first aspect. The device may also include a memory for storing instructions called by the processor. The memory is coupled with the processor, and when the processor executes the instructions stored in the memory, the method executed by the first terminal or the second terminal described in the first aspect can be implemented.
在一个可能的设计中,当该装置用于执行第一方面中的第一终端所执行的操作时:通信接口,用于向第二终端发送通信请求,所述通信请求用于请求与所述第二终端建立通信,所述通信请求包括所述第一终端的标识和业务的标识;所述通信接口,还用于从所述第二终端接收通信响应;所述通信响应用于响应所述通信请求;处理器,用于根据共享密钥和所述业务的标识,确定第一安全密钥;其中,所述第一安全密钥为所述第一终端与所述第二终端之间通信保护的安全密钥。In a possible design, when the device is used to perform operations performed by the first terminal in the first aspect: a communication interface is used to send a communication request to the second terminal, and the communication request is used to request communication with the The second terminal establishes communication, and the communication request includes the identification of the first terminal and the identification of the service; the communication interface is also used to receive a communication response from the second terminal; the communication response is used to respond to the Communication request; a processor, configured to determine a first security key according to the shared key and the identifier of the service; wherein, the first security key is the communication between the first terminal and the second terminal Security key for protection.
在一个可能的设计中,所述处理单元用于:根据共享密钥、所述业务的标识和所述通信请求中包括的所述一种或多种信息,确定第一安全密钥。In a possible design, the processing unit is configured to determine the first security key according to the shared key, the identifier of the service, and the one or more types of information included in the communication request.
在一个可能的设计中,所述通信接口还用于:向网络设备发送注册请求,所述注册请求用于请求注册所述第一终端的标识,所述注册请求中包括第三指示,所述第三指示用于指示所述第一终端请求使用终端与终端之间通信的业务;以及用于从所述网络设备接收所述第一终端的标识。In a possible design, the communication interface is further used to send a registration request to a network device, the registration request is used to request to register the identity of the first terminal, the registration request includes a third indication, the The third indication is used to indicate that the first terminal requests to use the service of communication between the terminal and the terminal; and used to receive the identification of the first terminal from the network device.
示例性地,当该装置用于执行第一方面中的第一终端所执行的操作时:通信接口,用于从第一终端接收通信请求,所述通信请求包括所述第一终端的标识ID和业务的标识;处理器,用于根据共享密钥和所述业务的标识,确定第一安全密钥;其中,所述第一安全密钥为所述第一终端与所述第二终端之间通信保护的安全密钥;所述通信接口,还用于根据所述通信请求,向所述第一终端返回通信响应。Exemplarily, when the device is used to perform an operation performed by the first terminal in the first aspect: a communication interface for receiving a communication request from the first terminal, the communication request including the identification ID of the first terminal And the identification of the service; the processor is configured to determine a first security key according to the shared key and the identification of the service; wherein, the first security key is the difference between the first terminal and the second terminal A security key for inter-communication protection; the communication interface is also used to return a communication response to the first terminal according to the communication request.
在一个可能的设计中,所述处理器用于:根据共享密钥、所述业务的标识和所述通信请求中包括的所述一种或多种信息,确定第一安全密钥。In a possible design, the processor is configured to determine the first security key according to the shared key, the identifier of the service, and the one or more types of information included in the communication request.
在一个可能的设计中,所述处理器还用于:根据所述第一终端的标识,判断所述第一终端和所述第二终端是否属于同一网络;确定所述第一终端和所述第二终端属于同一网络;所述通信接口还用于向第一网络功能NF发送非接入层NAS请求,所述NAS请求用于请求所述共享密钥。In a possible design, the processor is further configured to: determine whether the first terminal and the second terminal belong to the same network according to the identity of the first terminal; and determine whether the first terminal and the second terminal belong to the same network; The second terminal belongs to the same network; the communication interface is also used to send a non-access stratum NAS request to the first network function NF, and the NAS request is used to request the shared key.
在一个可能的设计中,所述NAS请求中包括以下至少一种信息:所述第一终端的标识、消息验证码MAC或第一指示;所述第一指示用于指示所述NAS请求用于车联网通信;所述通信接口还用于,从所述第一NF接收NAS响应,所述NAS响应中包括所述共享密钥。In a possible design, the NAS request includes at least one of the following information: the identifier of the first terminal, the message verification code MAC, or the first indication; the first indication is used to indicate that the NAS request is used for Internet of Vehicles communication; the communication interface is also used to receive a NAS response from the first NF, and the NAS response includes the shared key.
无论该装置用于执行第一方面中的第一终端所执行的操作,还是用于执行第一方面中的第二终端所执行的操作,还可以有以下可选的实施方式:Regardless of whether the device is used to perform operations performed by the first terminal in the first aspect or used to perform operations performed by the second terminal in the first aspect, the following optional implementation manners are also possible:
可选的,所述通信请求还包括以下一种或多种信息:所述共享密钥的标识、业务的类型、所述第一终端的层2标识、所述第二终端的层2标识数据无线承载DRB的标识、数据流flow的标识、所述第一终端的PC5单播链接的标识或终端到终端通信群组的标识。Optionally, the communication request further includes one or more of the following information: identification of the shared key, type of service, layer 2 identification of the first terminal, layer 2 identification data of the second terminal The ID of the radio bearer DRB, the ID of the data flow, the ID of the PC5 unicast link of the first terminal, or the ID of the terminal-to-terminal communication group.
可选的,所述通信请求中还包括第一消息验证码MAC和/或第一指示,所述第一MAC用于校验所述通信请求是否为合法请求,所述第一指示用于指示所述第二终端通过应用层获取所述共享密钥或者通过运营商网络获取所述共享密钥。Optionally, the communication request further includes a first message verification code MAC and/or a first indication, the first MAC is used to check whether the communication request is a legal request, and the first indication is used to indicate The second terminal obtains the shared key through an application layer or obtains the shared key through an operator network.
可选的,所述通信响应中携带第二指示,所述第二指示用于指示所述第一终端通过应用层获取所述共享密钥或者通过运营商网络获取所述共享密钥。Optionally, the communication response carries a second indication, and the second indication is used to instruct the first terminal to obtain the shared key through an application layer or obtain the shared key through an operator network.
第六方面,提供一种装置,所述装置包括通信接口和处理器,所述通信接口用于该装置与其它设备进行通信,例如数据或信号的收发。示例性的,通信接口可以是收发器、电路、总线、模块或其它类型的通信接口;其它设备可以为终端或其他NF。处理器用于执行上述第二方面描述的方法。所述装置还可以包括存储器,用于存储处理器调用的指令。所述存储器与所述处理器耦合,所述处理器执行所述存储器中存储的指令时,可以实现上述第二方面描述的方法。In a sixth aspect, an apparatus is provided. The apparatus includes a communication interface and a processor, and the communication interface is used for communication between the apparatus and other devices, for example, data or signal transmission and reception. Exemplarily, the communication interface may be a transceiver, circuit, bus, module, or other type of communication interface; other devices may be terminals or other NFs. The processor is used to execute the method described in the second aspect above. The device may also include a memory for storing instructions called by the processor. The memory is coupled with the processor, and when the processor executes the instructions stored in the memory, the method described in the second aspect can be implemented.
示例性地,通信接口,用于接收密钥请求,所述密钥请求是第二终端发送的,或者,所述密钥请求是所述第二终端通过第二NF发送的,所述密钥请求包括所述第一终端的标识;处理器,用于根据所述第一终端的标识,确定共享密钥;所述通信接口还用于向所述第二终端发送所述共享密钥,或者,还用于通过所述第二NF向所述第二终端发送所述共享密钥。Exemplarily, the communication interface is configured to receive a key request, the key request is sent by a second terminal, or the key request is sent by the second terminal through a second NF, and the key The request includes the identification of the first terminal; the processor is configured to determine the shared key according to the identification of the first terminal; the communication interface is further configured to send the shared key to the second terminal, or And is also used to send the shared key to the second terminal through the second NF.
在一个可能的设计中,所述密钥请求还包括消息验证码MAC;所述处理器还用于:校验所述MAC,确定所述MAC校验通过。In a possible design, the key request further includes a message verification code MAC; the processor is further configured to verify the MAC and determine that the MAC verification passes.
在一个可能的设计中,所述密钥请求还包括以下一种或多种信息:所述共享密钥的标识、业务的标识、业务的类型、所述第一终端的层2标识、所述第二终端的层2标识、数据无线承载DRB的标识、数据流flow的标识、所述第一终端的PC5单播链接的标识或终端到终端通信群组的标识。In a possible design, the key request further includes one or more of the following information: the identification of the shared key, the identification of the service, the type of the service, the layer 2 identification of the first terminal, the The layer 2 identification of the second terminal, the identification of the data radio bearer DRB, the identification of the data flow, the identification of the PC5 unicast link of the first terminal, or the identification of the terminal-to-terminal communication group.
在一个可能的设计中,所述处理器用于:根据所述第一终端的标识以及所述密钥请求中的所述一种或多种信息,确定所述共享密钥。In a possible design, the processor is configured to determine the shared key according to the identification of the first terminal and the one or more types of information in the key request.
第七方面,本申请实施例中还提供一种计算机可读存储介质,所述计算机存储介质中存储有计算机可读指令,当所述计算机可读指令在计算机上运行时,使得计算机执行如第一方面或第一方面中任一种可能的设计中所述的方法。In a seventh aspect, the embodiments of the present application also provide a computer-readable storage medium. The computer-readable storage medium stores computer-readable instructions. When the computer-readable instructions run on the computer, the computer can execute The method described in one aspect or any one of the possible designs of the first aspect.
第八方面,本申请实施例中还提供一种计算机可读存储介质,包括指令,当其在计算机上运行时,使得计算机执行如第二方面或第二方面中任一种可能的设计中所述的方法。In an eighth aspect, the embodiments of the present application also provide a computer-readable storage medium, including instructions, which, when run on a computer, cause the computer to execute as described in the second aspect or any one of the possible designs in the second aspect. The method described.
第九方面,本申请实施例中还提供一种计算机程序产品,包括指令,当其在计算机上运行时,使得计算机执行如第一方面或第一方面中任一种可能的设计中所述的方法,或者 执行如第二方面或第二方面中任一种可能的设计中所述的方法。In the ninth aspect, the embodiments of the present application also provide a computer program product, including instructions, which when run on a computer, cause the computer to execute the design described in the first aspect or any one of the possible designs in the first aspect Method, or implement the method as described in the second aspect or any one of the possible designs of the second aspect.
第十方面,本申请实施例提供了一种芯片系统,该芯片系统包括处理器,还可以包括存储器,用于实现上述第一方面或第一方面中任一种可能的设计中所述的方法。该芯片系统可以由芯片构成,也可以包含芯片和其他分立器件。In a tenth aspect, an embodiment of the present application provides a chip system, which includes a processor and may also include a memory, for implementing the method described in the first aspect or any one of the possible designs of the first aspect. . The chip system can be composed of chips, or it can include chips and other discrete devices.
第十一方面,本申请实施例提供了一种芯片系统,该芯片系统包括处理器,还可以包括存储器,用于实现上述第二方面或第二方面中任一种可能的设计中所述的方法。该芯片系统可以由芯片构成,也可以包含芯片和其他分立器件。In an eleventh aspect, an embodiment of the present application provides a chip system. The chip system includes a processor and may also include a memory for implementing the above-mentioned second aspect or any one of the possible designs of the second aspect. method. The chip system can be composed of chips, or it can include chips and other discrete devices.
第十二方面,本申请实施例提供了一种通信系统,所述通信系统包括第三方面或者第五方面所述的装置、和第四方面或者第六方面所述的装置。In a twelfth aspect, an embodiment of the present application provides a communication system, the communication system including the device described in the third aspect or the fifth aspect, and the device described in the fourth aspect or the sixth aspect.
附图说明Description of the drawings
图1为本申请实施例中通信系统架构示意图之一;FIG. 1 is one of the schematic diagrams of the communication system architecture in an embodiment of the application;
图2为本申请实施例中密钥生成方法流程示意图之一;Figure 2 is one of the schematic diagrams of the key generation method in the embodiment of the application;
图3a为本申请实施例中通过运营商获取共享密钥的方式示意图;FIG. 3a is a schematic diagram of a method for obtaining a shared key through an operator in an embodiment of the application;
图3b为本申请实施例密钥生成方法流程示意图之二;FIG. 3b is the second schematic diagram of the flow of the key generation method according to the embodiment of this application;
图4为本申请实施例中第一终端注册该用于协商密钥的标识流程示意图;FIG. 4 is a schematic diagram of the process of registering the identification used for key negotiation by the first terminal in an embodiment of the application;
图5为本申请实施例中装置结构示意图之一;Figure 5 is one of the schematic diagrams of the device structure in an embodiment of the application;
图6为本申请实施例中装置结构示意图之二;Fig. 6 is the second schematic diagram of the device structure in the embodiment of the application;
图7为本申请实施例中通信系统架构示意图之二。FIG. 7 is the second schematic diagram of the communication system architecture in the embodiment of the application.
具体实施方式detailed description
下面将结合附图,对本申请实施例进行详细描述。The embodiments of the present application will be described in detail below in conjunction with the accompanying drawings.
本申请实施例提供一种密钥生成方法及装置,方法和装置是基于同一发明构思的,由于方法及装置解决问题的原理相似,因此装置与方法的实施可以相互参见,重复之处不再赘述。本申请实施例的描述中,“和/或”,描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。字符“/”一般表示前后关联对象是一种“或”的关系。本申请中所涉及的至少一个是指一个或多个;多个,是指两个或两个以上。另外,需要理解的是,在本申请的描述中,“第一”、“第二”等词汇,仅用于区分描述的目的,而不能理解为指示或暗示相对重要性,也不能理解为指示或暗示顺序。本申请实施例中消息或请求或响应中“包括”信息,可以理解为消息或请求或响应中“携带”信息。The embodiments of the present application provide a method and device for generating a key. The method and device are based on the same inventive concept. Since the principles of the method and device to solve the problem are similar, the implementation of the device and the method can be referred to each other, and the repetition will not be repeated. . In the description of the embodiments of the present application, “and/or” describes the association relationship of the associated objects, indicating that there can be three types of relationships, for example, A and/or B, which can mean: A alone exists, and both A and B exist separately. There are three cases of B. The character "/" generally indicates that the associated objects before and after are in an "or" relationship. At least one involved in this application refers to one or more; multiple refers to two or more. In addition, it should be understood that in the description of this application, words such as "first" and "second" are only used for the purpose of distinguishing description, and cannot be understood as indicating or implying relative importance, nor can it be understood as indicating Or imply the order. The "including" information in the message or request or response in the embodiments of the present application can be understood as the "carrying" information in the message or request or response.
本申请实施例提供的通信方法可以应用于第四代(4th generation,4G)通信系统、第五代(5th generation,5G)通信系统或未来的各种通信系统。具体的,可以应用于车联网的通信场景,可以应用于终端到终端通信的系统,例如车辆对外界(vehicle to everything,V2X)通信系统。The communication method provided in the embodiments of the present application can be applied to a fourth generation (4th generation, 4G) communication system, a fifth generation (5th generation, 5G) communication system, or various future communication systems. Specifically, it can be applied to a communication scenario of the Internet of Vehicles, and can be applied to a terminal-to-terminal communication system, such as a vehicle-to-everything (V2X) communication system.
图1示出了本申请实施例提供的密钥生成方法适用的一种可能的通信系统的架构。图1示出了该通信系统为一种V2X通信系统。FIG. 1 shows the architecture of a possible communication system to which the key generation method provided in the embodiment of the present application is applicable. Figure 1 shows that the communication system is a V2X communication system.
参阅图1所示,V2X通信系统中包括一个或多个终端。V2X通信系统中的终端又称之为用户设备(user equipment,UE)、移动台(mobile station,MS)、移动终端(mobile terminal, MT)等,是一种向用户提供语音或数据连通性的设备,也可以是物联网设备。例如,终端包括具有无线连接功能的手持式设备、车载设备等。目前,终端可以是:手机(mobile phone)、平板电脑、笔记本电脑、掌上电脑、移动互联网设备(mobile internet device,MID)、可穿戴设备(例如智能手表、智能手环、计步器等),车辆、车载设备(例如,汽车、自行车、电动车、飞机、船舶、火车、高铁等)、虚拟现实(virtual reality,VR)设备、增强现实(augmented reality,AR)设备、工业控制(industrial control)中的无线终端、智能家居设备(例如,冰箱、电视、空调、电表等)、智能机器人、车间设备、无人驾驶(self driving)中的无线终端、远程手术(remote medical surgery)中的无线终端、智能电网(smart grid)中的无线终端、运输安全(transportation safety)中的无线终端、智慧城市(smart city)中的无线终端,或智慧家庭(smart home)中的无线终端、飞行设备(例如,智能机器人、热气球、无人机、飞机)等。As shown in Figure 1, the V2X communication system includes one or more terminals. The terminal in the V2X communication system is also called user equipment (UE), mobile station (MS), mobile terminal (MT), etc., which provide users with voice or data connectivity. The device can also be an IoT device. For example, terminals include handheld devices with wireless connection functions, vehicle-mounted devices, and so on. At present, the terminal can be: mobile phone (mobile phone), tablet computer, notebook computer, palm computer, mobile internet device (MID), wearable device (such as smart watch, smart bracelet, pedometer, etc.), Vehicles, vehicle-mounted equipment (for example, cars, bicycles, electric vehicles, airplanes, ships, trains, high-speed rail, etc.), virtual reality (VR) equipment, augmented reality (AR) equipment, industrial control (industrial control) Wireless terminals, smart home equipment (for example, refrigerators, TVs, air conditioners, electric meters, etc.), smart robots, workshop equipment, wireless terminals in self-driving, and wireless terminals in remote medical surgery , The wireless terminal in the smart grid, the wireless terminal in the transportation safety, the wireless terminal in the smart city, or the wireless terminal in the smart home, and flying equipment (such as , Smart robots, hot air balloons, drones, airplanes), etc.
图1中的终端以UE为例,包括UE A、UE B、UE C和UE D。V2X通信系统中,终端与终端之间通过PC 5接口建立连接,可以直接进行通信。如图1中所示,UE A、UE B、UE C和UE D中,两个UE之间通过PC5接口连接。终端还可以与接入网设备通过Uu口连接,图1中接入网设备用下一代无线接入网(next generation radio access network,NG-RAN)表示。接入网设备为无线接入网(radio access network,RAN)中的节点,又可以称为基站,还可以称为RAN节点(或设备)。接入网设备与核心网连接。The terminal in Figure 1 takes UE as an example, including UE A, UE B, UE C, and UE D. In the V2X communication system, a connection is established between the terminal and the terminal through the PC 5 interface, and communication can be directly carried out. As shown in Figure 1, in UE A, UE B, UE C, and UE D, the two UEs are connected through a PC5 interface. The terminal can also be connected to the access network equipment through a Uu port. The access network equipment in Figure 1 is represented by the next generation radio access network (NG-RAN). An access network device is a node in a radio access network (RAN), which may also be called a base station, or a RAN node (or device). The access network equipment is connected to the core network.
图1中核心网用5G核心网(5G core,5GC)表示,5GC中包括一个或多个网络功能(network function,NF),NF也可以称为网络功能实体或网络功能网元。图1中5GC中以包括认证管理功能(authentication management function,AMF)、会话管理功能(session management function,SMF)、统一数据存储(Unified Data Repository,UDR)、统一的数据管理功能(unified data management,UDM)、策略控制功能(policy control function,PCF)、网络开放功能(network exposure function,NEF)、应用功能(application function,AF)和用户面功能(user plane function,UPF)几种网络功能为例。其中,AMF用于接入和移动管理功能,AUSF用于认证服务器功能;The core network in Figure 1 is represented by a 5G core network (5G core, 5GC), and 5GC includes one or more network functions (network functions, NF), and NF may also be referred to as a network function entity or a network function network element. In Figure 1, 5GC includes authentication management function (authentication management function, AMF), session management function (session management function, SMF), unified data storage (Unified Data Repository, UDR), unified data management function (unified data management, Examples of network functions such as UDM), policy control function (PCF), network exposure function (NEF), application function (AF) and user plane function (UPF) . Among them, AMF is used for access and mobility management functions, and AUSF is used for authentication server functions;
每一个终端都有可能产生V2X应用的数据。终端与终端之间通信的链路方式可以包括多种。例如,终端与终端基于PC5接口直接建立通信,即终端基于无线能力进行直连的通信。图1中所示的UE A与UE B通过PC5接口之间建立通信。又例如,终端可以基于Uu接口向基站传输V2X应用的数据。例如UE A通过基站发送V2X应用的数据至UPF,之后UPF再将V2X应用的数据通过基站转发至UE D。此时UE A与UE D建立了一个逻辑信道,用于它们之间的V2X业务通信。还包括另一种可能,就是UE通过基站和UPF发送V2X应用的数据到V2X应用服务器,V2X应用服务器再经过UPF和基站发送V2X应用的数据至UE D。还包括另一种可能,就是UE通过基站发送V2X应用的数据到另一个基站,再由另一个基站发送V2X应用的数据至UE D。这里两个UE连接的基站可以相同也可以不同。Each terminal may generate data for V2X applications. There are multiple communication link modes between the terminal and the terminal. For example, the terminal and the terminal directly establish communication based on the PC5 interface, that is, the terminal communicates directly based on the wireless capability. The UE A and UE B shown in FIG. 1 establish communication through the PC5 interface. For another example, the terminal may transmit V2X application data to the base station based on the Uu interface. For example, UE A sends the data of the V2X application to the UPF through the base station, and then the UPF forwards the data of the V2X application to the UE D through the base station. At this time, UE A and UE D have established a logical channel for V2X service communication between them. Another possibility is that the UE sends V2X application data to the V2X application server through the base station and UPF, and the V2X application server sends the V2X application data to the UED through the UPF and the base station. Another possibility is that the UE sends the V2X application data to another base station through the base station, and then the other base station sends the V2X application data to the UE D. Here, the base stations to which the two UEs are connected may be the same or different.
在V2X通信系统中,终端与终端之间的通信模式包括:单播、组播或广播。In the V2X communication system, the communication mode between the terminal and the terminal includes: unicast, multicast or broadcast.
当一个终端向另一个终端发送V2X应用的数据时,需要进行PC5接口的密钥协商,以保证PC5通信的安全性。When a terminal sends V2X application data to another terminal, it needs to perform key negotiation on the PC5 interface to ensure the security of PC5 communication.
图1所示的通信系统为本申请实施例适用的一种可能的系统。本申请实施例还可以应用到除V2X通信系统之外的其它系统中。本申请实施例的方法包括两个终端之间的密钥协 商,当应用到V2X通信系统中时,可以为两个终端之间对PC5接口的密钥协商。该方法还可以扩展到任意两个设备之间的密钥协商。The communication system shown in FIG. 1 is a possible system to which the embodiments of this application are applicable. The embodiments of the present application can also be applied to other systems besides the V2X communication system. The method in the embodiment of the present application includes key negotiation between two terminals. When applied to a V2X communication system, it can be the key negotiation between the two terminals on the PC5 interface. This method can also be extended to key negotiation between any two devices.
下面将详细介绍一下本申请实施例提供的密钥生成方法。The key generation method provided in the embodiments of the present application will be described in detail below.
如图2所示,本申请实施例提供的密钥生成方法的具体流程如下所述。该方法以任意两个终端之间的通信为例,介绍生成密钥的方法。通信双方的这两个终端可以称为第一终端和第二终端。As shown in FIG. 2, the specific process of the key generation method provided by the embodiment of the present application is as follows. This method takes the communication between any two terminals as an example to introduce the method of generating the key. The two terminals of the communicating parties may be referred to as the first terminal and the second terminal.
S201、第一终端向第二终端发送通信请求,第二终端从第一终端接收该通信请求。S201: The first terminal sends a communication request to the second terminal, and the second terminal receives the communication request from the first terminal.
该通信请求包括以下一种或多种信息:The communication request includes one or more of the following information:
1)第一终端的标识。第一终端的标识用于识别第一终端的身份。例如,该标识可以为永久标识(identity,ID)、也可以为其它标识,例如5G-全球唯一临时标识符(global unique temporary identifier,GUTI)、通用公共订阅标识符(generic public subscription identifier,GPSI)或注册的专用于密钥协商的临时标识(记为UE ID)。1) The identity of the first terminal. The identity of the first terminal is used to identify the identity of the first terminal. For example, the identifier may be a permanent identifier (identity, ID), or other identifiers, such as 5G-global unique temporary identifier (GUTI), generic public subscription identifier (GPSI) Or a registered temporary identifier dedicated to key negotiation (denoted as UE ID).
可选的,第二终端会保存有第一终端的ID。Optionally, the second terminal may store the ID of the first terminal.
2)业务的标识或者应用程序的标识,用于标识第一终端与第二终端之间交互的业务或应用程序。举例来说,该标识可以用于指示第一终端与第二终端之间交互的业务为V2X业务,或该标识可以用于指示第一终端与第二终端之间交互的应用程序为V2X应用。例如,业务的标识或者应用程序的标识为智能交通系统应用程序标识(intelligent transport systems application identifier,ITS-A ID)。2) The service identifier or the application program identifier is used to identify the service or application program interacting between the first terminal and the second terminal. For example, the identifier may be used to indicate that the service interacted between the first terminal and the second terminal is a V2X service, or the identifier may be used to indicate that the application program interacted between the first terminal and the second terminal is a V2X application. For example, the service identifier or the application program identifier is an intelligent transportation systems application identifier (ITS-A ID).
3)业务的类型。举例来说,业务的类型可以用于指示该业务为V2X业务。例如,该业务的类型为服务提供者标识(provider service ID,PSID),表示该业务的类型为服务提供者。3) Type of business. For example, the type of service can be used to indicate that the service is a V2X service. For example, the type of the service is a service provider ID (provider service ID, PSID), which indicates that the type of the service is a service provider.
4)共享密钥的标识。用于标识第一终端预先保存的或者确定的共享密钥,共享密钥为第一终端与第二终端之间共享的密钥。这里第二终端的共享密钥可以为后续第二终端在接收到通信请求后,从第一NF获得的。4) The identification of the shared key. It is used to identify a shared key pre-stored or determined by the first terminal, and the shared key is a shared key between the first terminal and the second terminal. Here, the shared key of the second terminal may be obtained from the first NF after the subsequent second terminal receives the communication request.
5)第一终端的应用层标识(application layer ID)。例如记为application layer ID1。5) The application layer ID of the first terminal. For example, it is marked as application layer ID1.
6)第二终端的应用层标识(application layer ID)。例如记为application layer ID2。6) Application layer ID of the second terminal. For example, it is recorded as application layer ID2.
7)第一终端的层2标识(layer2 ID1)。其中,层2可以为应用层与物理层之间的层。或者也可以称为源侧层2(source layer 2)ID。例如第一终端的层2标识为layer2 ID1,或者第一终端的源侧层2ID为source layer 2 ID1。7) Layer 2 ID (layer2 ID1) of the first terminal. Among them, layer 2 may be a layer between the application layer and the physical layer. Or it can also be called a source layer 2 (source layer 2) ID. For example, the layer 2 ID of the first terminal is layer 2 ID1, or the source side layer 2 ID of the first terminal is source layer 2 ID1.
8)第二终端的层2标识(layer2 ID2)。或者也可以称为源侧层2(source layer 2)ID。例如第二终端的层2标识为layer2 ID2,或者第二终端的源侧层2ID为source layer 2 ID2。8) Layer 2 ID (layer2 ID2) of the second terminal. Or it can also be called a source layer 2 (source layer 2) ID. For example, the layer 2 ID of the second terminal is layer 2 ID2, or the source side layer 2 ID of the second terminal is source layer 2 ID2.
9)用于PC5接口信令传输(signaling)的指示(即PC5-S的指示),即用于指示第一终端与第二终端之间的信令传输。9) An indication used for PC5 interface signaling (signaling) (that is, an indication of PC5-S), that is, used to indicate signaling transmission between the first terminal and the second terminal.
10)用于PC5接口无线资源控制(radio resource control,RRC)传输的指示(PC5-RRC的指示),用于指示第一终端与第二终端之间的RRC传输。10) An indication (PC5-RRC indication) used for radio resource control (RRC) transmission on the PC5 interface, which is used to indicate RRC transmission between the first terminal and the second terminal.
11)用于PC5接口用户面(user plane,UP)数据传输的指示(PC5-U的指示),即用于指示第一终端与第二终端之间的用户面传输。11) Instructions for data transmission of the user plane (UP) of the PC5 interface (instruction of PC5-U), that is, instructions for user plane transmission between the first terminal and the second terminal.
12)数据无线承载(data radio bearer,DRB)的标识。12) Identification of data radio bearer (DRB).
13)数据流的标识(flow ID),用于区分不同的flow或用于标识flow的类型。例如,该flow ID用于标识该数据流为业务质量(quality of service,QoS)flow。13) The data flow ID (flow ID) is used to distinguish different flows or to identify the type of flow. For example, the flow ID is used to identify the data flow as a quality of service (QoS) flow.
14)第一终端的PC5单播链接的标识(PC5 unicast link ID),例如记为PC5 unicast link ID1。14) The identification of the PC5 unicast link of the first terminal (PC5 unicast link ID), for example, it is recorded as PC5 unicast link ID1.
15)群组的标识或群组的指示。群组的标识用于标识第一终端希望接入的群组,群组的指示用于指示第一终端希望接入的群组。群组为终端到终端通信的群组。15) The identification of the group or the indication of the group. The group identifier is used to identify the group that the first terminal wants to access, and the group indication is used to indicate the group that the first terminal wants to access. A group is a group for terminal-to-terminal communication.
S202、第二终端确定第一安全密钥。S202. The second terminal determines the first security key.
第二终端确定要建立与第一终端之间的通信,则确定安全密钥,这里记为第一安全密钥。The second terminal determines that it wants to establish communication with the first terminal, and then determines the security key, which is recorded as the first security key here.
具体地,第二终端确定的第一安全密钥为第一终端与第二终端之间通信保护的安全密钥。第二终端可以基于共享密钥和通信请求包括的信息所指示的生成参数,来确定第一安全密钥。第二终端确定的第一安全密钥是以通信请求中包括的信息所指示的生成参数为粒度的,不同的生成参数对应不同的密钥,以达到密钥隔离的效果。Specifically, the first security key determined by the second terminal is a security key for communication protection between the first terminal and the second terminal. The second terminal may determine the first security key based on the shared key and the generation parameter indicated by the information included in the communication request. The first security key determined by the second terminal is based on the generation parameters indicated by the information included in the communication request as the granularity, and different generation parameters correspond to different keys, so as to achieve the effect of key isolation.
举例来说,通信请求中包括业务的标识,第二终端可以基于共享密钥和业务的标识来确定第一安全密钥,那么确定的第一安全密钥是仅用于该业务的标识所指示的业务的,不同的业务的标识确定出来的第一安全密钥是不同的。For example, if the communication request includes the identification of the service, the second terminal can determine the first security key based on the shared key and the identification of the service, then the determined first security key is only indicated by the identification of the service For different services, the first security keys determined by the identifiers of different services are different.
又例如,通信请求中包括业务的类型,第二终端可以基于共享密钥和业务的类型来确定第一安全密钥,那么确定的第一安全密钥是仅用于该业务的类型,不同的业务的类型确定出来的第一安全密钥是不同的。For another example, the communication request includes the type of service, and the second terminal can determine the first security key based on the shared key and the type of service. Then the determined first security key is only used for the type of service, and different The first security key determined by the type of service is different.
又例如,通信请求中包括DRB的标识,第二终端可以基于共享密钥和DRB的标识来确定第一安全密钥,那么确定的第一安全密钥是仅用于该DRB的标识所指示的DRB的,不同的DRB的标识确定出来的第一安全密钥是不同的。For another example, the communication request includes the ID of the DRB, and the second terminal can determine the first security key based on the shared key and the ID of the DRB, and the determined first security key is only used for the ID indicated by the DRB. For DRB, the first security keys determined by different DRB identifiers are different.
又例如,第二终端可以基于共享密钥和flow的标识来确定第一安全密钥,那么确定的第一安全密钥是仅用于该flow的标识所指示的flow的,不同的flow的标识确定出来的第一安全密钥是不同的。For another example, the second terminal may determine the first security key based on the shared key and the identifier of the flow, then the determined first security key is only used for the flow indicated by the identifier of the flow, and the identifiers of different flows The determined first security key is different.
又例如,通信请求中包括用于PC5接口信令传输的指示,第二终端可以基于共享密钥和该用于PC5接口信令传输的指示来确定第一安全密钥,则确定的第一安全密钥用于保护第一终端与第二终端在通过PC5接口传输信令的安全性。For another example, the communication request includes an instruction for PC5 interface signaling transmission, and the second terminal can determine the first security key based on the shared key and the instruction for PC5 interface signaling transmission, then the first security is determined The key is used to protect the security of the first terminal and the second terminal when transmitting signaling through the PC5 interface.
又例如,通信请求中包括用于PC5接口无线资源控制RRC传输的指示,第二终端可以基于共享密钥和该用于PC5接口无线资源控制RRC传输的指示来确定第一安全密钥,则确定的第一安全密钥用于保护第一终端与第二终端在通过PC5接口传输RRC时的安全性。For another example, the communication request includes an instruction for PC5 interface radio resource control RRC transmission, and the second terminal may determine the first security key based on the shared key and the instruction for PC5 interface radio resource control RRC transmission, then it is determined The first security key of is used to protect the security of the first terminal and the second terminal when transmitting RRC through the PC5 interface.
又例如,第二终端可以基于共享密钥,以及第一终端的PC5单播链接的标识和/或第二终端的PC5单播链接的标识来确定第一安全密钥,那么确定的第一安全密钥是仅用于该及第一终端的PC5单播链接的标识和/或第二终端的PC5单播链接的标识的。第二终端基于共享密钥和通信请求中的其它信息所指示的生成参数来确定第一安全密钥,可以参照上述几个举例的过程和效果,在此不再赘述。For another example, the second terminal may determine the first security key based on the shared key, and the identification of the PC5 unicast link of the first terminal and/or the identification of the PC5 unicast link of the second terminal, then the first security is determined The key is only used for the identification of the PC5 unicast link of the first terminal and/or the identification of the PC5 unicast link of the second terminal. The second terminal determines the first security key based on the generation parameters indicated by the shared key and other information in the communication request. The processes and effects of the above-mentioned several examples can be referred to, which will not be repeated here.
S203、第二终端向第一终端返回通信响应,第一终端从第二终端接收通信响应。S203. The second terminal returns a communication response to the first terminal, and the first terminal receives the communication response from the second terminal.
通信响应用于响应第一终端发送的通信请求。可选的,通信响应中可以包括一种或多种信息:The communication response is used to respond to the communication request sent by the first terminal. Optionally, the communication response may include one or more types of information:
(1)、第二终端的标识。该标识可以为永久标识ID、也可以为其它标识,例如5G-GUTI、GPSI或注册的专用于密钥协商的临时标识。(1) The identity of the second terminal. The identification can be a permanent identification ID or other identifications, such as 5G-GUTI, GPSI, or a registered temporary identification dedicated to key negotiation.
可选的,第一终端会保存有第二终端的ID。Optionally, the first terminal may store the ID of the second terminal.
(2)、业务的标识,该业务的标识用于标识第一终端与第二终端交互的业务。也可以是应用程序的标识。可以参照上述对第2)点的描述。(2) The service identifier, which is used to identify the service interacted by the first terminal and the second terminal. It can also be the identity of the application. Please refer to the description of point 2) above.
(3)、业务的类型,可以参照上述第3)点的描述。(3) For the type of service, please refer to the description in point 3) above.
(4)、共享密钥的标识。用于标识第二终端预先保存的或者确定的共享密钥,共享密钥为第一终端与第二终端之间共享的密钥。(4) The identification of the shared key. It is used to identify a shared key pre-stored or determined by the second terminal, and the shared key is a shared key between the first terminal and the second terminal.
(5)、第一终端的应用层标识。例如记为application layer ID1。(5) The application layer identifier of the first terminal. For example, it is marked as application layer ID1.
(6)、第二终端的应用层标识。例如记为application layer ID2。(6) The application layer identifier of the second terminal. For example, it is recorded as application layer ID2.
(7)、第一终端的层2标识。或者也可以称为源侧层2(source layer 2)ID。例如第一终端的层2标识为layer2 ID1,或者第一终端的源侧层2ID为source layer 2 ID1。(7) The layer 2 identification of the first terminal. Or it can also be called a source layer 2 (source layer 2) ID. For example, the layer 2 ID of the first terminal is layer 2 ID1, or the source side layer 2 ID of the first terminal is source layer 2 ID1.
(8)、第二终端的层2标识。或者也可以称为源侧层2(source layer 2)ID。例如第二终端的层2标识为layer2 ID2,或者第二终端的源侧层2ID为source layer 2 ID2。(8) The layer 2 identification of the second terminal. Or it can also be called a source layer 2 (source layer 2) ID. For example, the layer 2 ID of the second terminal is layer 2 ID2, or the source side layer 2 ID of the second terminal is source layer 2 ID2.
(9)、用于PC5接口信令传输的指示。(即PC5-S的指示)。用于指示第一终端与第二终端之间的信令传输。(9) Indication for PC5 interface signaling transmission. (That is, the instructions of PC5-S). Used to indicate the signaling transmission between the first terminal and the second terminal.
(10)、用于PC5接口RRC传输(signalling)的指示(PC5-RRC的指示),用于指示第一终端与第二终端之间的RRC传输。(10) An indication for RRC transmission (signalling) of the PC5 interface (indication of PC5-RRC), which is used to indicate the RRC transmission between the first terminal and the second terminal.
(11)、用于PC5接口用户面数据传输的指示(PC5-U的指示),即用于指示第一终端与第二终端之间的用户面传输。(11) An instruction for user plane data transmission of the PC5 interface (PC5-U instruction), that is, an instruction for user plane transmission between the first terminal and the second terminal.
(12)、DRB的标识。可以是第一终端发送的通信请求中携带的DRB的标识,也可以为第二终端接收到通信请求后选择的DRB的标识。(12) The identification of DRB. It may be the identifier of the DRB carried in the communication request sent by the first terminal, or may be the identifier of the DRB selected by the second terminal after receiving the communication request.
(13)、数据流flow的标识。用于区分不同的flow或用于标识flow的类型。例如,该flow ID用于标识该数据流为QoS flow。(13) The identifier of the data stream flow. Used to distinguish different flows or to identify the type of flow. For example, the flow ID is used to identify the data flow as a QoS flow.
(14)、第一终端的PC5单播链接的标识(PC5 unicast link ID),例如记为PC5 unicast link ID1。(14) The identification of the PC5 unicast link of the first terminal (PC5 unicast link ID), for example, it is recorded as PC5 unicast link ID1.
(15)、第二终端的PC5单播链接的标识(PC5 unicast link ID),例如记为PC5 unicast link ID2。(15) The identification of the PC5 unicast link of the second terminal (PC5 unicast link ID), for example, it is recorded as PC5 unicast link ID2.
(16)、群组的标识或群组的指示。群组的标识用于标识第一终端希望接入的群组,群组的指示用于指示第一终端希望接入的群组。群组为终端到终端通信的群组。(16) The identification of the group or the indication of the group. The group identifier is used to identify the group that the first terminal wants to access, and the group indication is used to indicate the group that the first terminal wants to access. A group is a group for terminal-to-terminal communication.
上述通信响应中包括信息可以根据通信请求中包括的信息确定,例如,可以是对应的相同的信息。The information included in the aforementioned communication response may be determined according to the information included in the communication request, for example, it may correspond to the same information.
S204、第一终端确定第一安全密钥。S204. The first terminal determines the first security key.
本步骤可以与S202和S203之间没有严格的执行顺序,可以在S201之后立即执行。步骤S204也可以在步骤S201之后立即执行。There may be no strict execution sequence between this step and S202 and S203, and it may be executed immediately after S201. Step S204 can also be executed immediately after step S201.
第一终端可以根据共享密钥和生成参数确定第一安全密钥。在一种情况下,该生成参数可以是通信请求包括的信息所指示的生成参数,这种情况下,第一终端可以在S201之后无需等待接收到通信响应就可以执行,当然也可以在接收到通信响应后执行。在另一种情况下,该生成参数可以是通信请求和/或通信响应中包括的信息所指示的生成参数,这种情况下,第一终端在接收到通信响应后根据通信响应中的信息所指示的生成参数,来确定第一安全密钥。第一终端根据共享密钥和生成参数确定第一安全密钥的方法和效果可以参考S202中第二终端执行的操作。第一终端确定出来的第一安全密钥是第一终端与第二终 端之间通信保护的安全密钥,具体可以用于以生成参数为粒度的通信保护的安全密钥。The first terminal may determine the first security key according to the shared key and the generation parameter. In one case, the generation parameter may be the generation parameter indicated by the information included in the communication request. In this case, the first terminal may execute after S201 without waiting for the communication response to be received. Of course, it may also be executed after receiving the communication response. Execute after communication response. In another case, the generation parameter may be the generation parameter indicated by the information included in the communication request and/or the communication response. In this case, the first terminal receives the communication response according to the information in the communication response. The indicated generation parameters are used to determine the first security key. For the method and effect of the first terminal determining the first security key according to the shared key and the generation parameters, reference may be made to the operation performed by the second terminal in S202. The first security key determined by the first terminal is a security key for communication protection between the first terminal and the second terminal, and can be specifically used for a security key for communication protection with a granularity of generation parameters.
例如,第一终端可以基于共享密钥和业务的标识来确定第一安全密钥,那么确定的第一安全密钥是仅用于该业务的标识所指示的业务的,不同的业务的标识确定出来的第一安全密钥是不同的。For example, the first terminal may determine the first security key based on the shared key and the identity of the service, then the determined first security key is only used for the service indicated by the identity of the service, and the identity of different services is determined The first security key that comes out is different.
上述第一终端和第二终端均基于共享密钥来确定第一安全密钥。共享密钥可以为第一终端和第二终端认证或协商得到的,也可以是预定义的。其中认证过程可以为基于分对称(例如证书或者基于身份密码技术)的认证,也可以是基于对称密钥的认证,或者为基于因特网密钥交换版本2(internet key exchange version 2,IKEv2)的认证,IP安全(IP security,IPsec)认证,或者为基于传输层安全(transport layer security,TLS)的认证,或者为基于用户名口令的认证。在S201之前,第一终端和第二终端还需要执行认证或协商共享密钥的过程,第一终端和第二终端分别保存共享密钥。在后续步骤中该共享密钥用于生成或确定第一安全密钥。Both the above-mentioned first terminal and the second terminal determine the first security key based on the shared key. The shared key may be obtained through authentication or negotiation between the first terminal and the second terminal, or may be predefined. The authentication process can be authentication based on symmetric (for example, certificate or identity-based cryptography), authentication based on symmetric key, or authentication based on Internet key exchange version 2 (IKEv2) , IP security (IPsec) authentication, or authentication based on transport layer security (TLS), or authentication based on username and password. Before S201, the first terminal and the second terminal also need to perform a process of authentication or negotiation of a shared key, and the first terminal and the second terminal save the shared key respectively. In subsequent steps, the shared key is used to generate or determine the first security key.
第一终端和/或第二终端可以通过应用层获取共享密钥,也可以通过运营商网络获取共享密钥。若通过应用层获取共享密钥,则第一终端/第二终端可以通过上述的认证或协商方式获得共享密钥,或者预定义共享密钥。若通过运营商网络获取共享密钥,则需要第一终端和第二终端属于同一运营商,第一终端/第二终端可以向网络设备获取。在一个可能的实施方式中,在S201第一终端向第二终端发送通信请求中还可以携带指示1,用于指示第二终端通过应用层获取共享密钥还是通过运营商网络获取共享密钥。第二终端根据该指示1确定获取共享密钥的方式。类似的,在S203第二终端向第一终端返回通信响应中携带指示2,用于指示第一终端通过应用层获取共享密钥还是通过运营商网络获取共享密钥。第一终端根据该指示2确定获取共享密钥的方式。The first terminal and/or the second terminal may obtain the shared key through the application layer, and may also obtain the shared key through the operator network. If the shared key is obtained through the application layer, the first terminal/second terminal can obtain the shared key through the above-mentioned authentication or negotiation method, or a predefined shared key. If the shared key is obtained through an operator's network, the first terminal and the second terminal need to belong to the same operator, and the first terminal/second terminal can obtain it from the network device. In a possible implementation manner, the communication request sent by the first terminal to the second terminal in S201 may also carry an indication 1, which is used to indicate whether the second terminal obtains the shared key through the application layer or through the operator network. The second terminal determines the way to acquire the shared key according to the instruction 1. Similarly, in S203, the second terminal returns a communication response to the first terminal to carry indication 2, which is used to indicate whether the first terminal obtains the shared key through the application layer or through the operator network. The first terminal determines the way of acquiring the shared key according to the instruction 2.
以第二终端为例,可选的通过运营商网络获取共享密钥的方式以及确定第一安全密钥的方式如下所述。Taking the second terminal as an example, the optional method of obtaining the shared key through the operator network and the method of determining the first security key are as follows.
在图2所示的密钥生成方法的基础上,如图3a所示,通过运营商获取共享密钥的方式以及确定第一安全密钥的方式如下所述。图3a所示的实施例中的任意多个连续或非连续的步骤可以形成本申请需要保护的方案,因为图3a所示的实施例中涉及多个执行主体,任意一个执行主体涉及的部分或全部操作可以形成针对该执行主体的方案。例如,S303~S309可以形成本申请实施例需要保护的方案,其余步骤为可选步骤。On the basis of the key generation method shown in FIG. 2, as shown in FIG. 3a, the method of obtaining the shared key by the operator and the method of determining the first security key are as follows. Any number of continuous or discontinuous steps in the embodiment shown in Figure 3a can form a solution that needs to be protected in this application, because the embodiment shown in Figure 3a involves multiple execution subjects, and any one of the execution subjects involves part or All operations can form a solution for the execution subject. For example, S303 to S309 may form a solution that needs to be protected in the embodiment of the present application, and the remaining steps are optional steps.
S301、第一终端向第二终端发送通信请求,第二终端从第一终端接收该通信请求。S301. The first terminal sends a communication request to the second terminal, and the second terminal receives the communication request from the first terminal.
该通信请求可以包括的信息如上述1)~15)所述的信息中的一种或多种,该通信请求中的第一终端的标识可以包括第一终端的ID,这里第一终端的ID可以为,第一终端的5G-GUTI,或者UE ID,或者GPSI,或者SUCI。UE ID为用于此密钥协商业务的UE标识。The information that the communication request may include is one or more of the information described in 1) to 15) above. The identification of the first terminal in the communication request may include the ID of the first terminal, where the ID of the first terminal It may be the 5G-GUTI of the first terminal, or the UE ID, or GPSI, or SUCI. The UE ID is the UE identification used for this key agreement service.
该通信请求中还可以包括第一NF的地址。也可能第一终端的标识中包括第一NF的地址信息。The communication request may also include the address of the first NF. It is also possible that the identification of the first terminal includes the address information of the first NF.
第一终端和第一NF事先共享一些参数,例如第一终端和第一NF分别保存了第一终端的标识、密钥K和密钥标识Key ID。这里K为第一终端与第一NF之间共享的密钥,例如,第一NF为AMF,则这里K可以包括AMF key(记为Kamf)、NAS key(包括加密密钥Knasenc和完整性保护密钥Knasint)、或者锚密钥中的任一种或多种。此时安全锚功能(security anchor function,SEAF)部署在AMF内。例如,第一NF可以为安全锚点功能 (security anchor function,SEAF),则这里的K可以为SEAF key(记为K_seaf)。例如,第一NF为认证服务器功能(authentication server function,AUSF),则这里K可以包括AUSF key(记为K_AUSF)、NAS key(包括加密密钥Knasenc和完整性保护密钥Knasint)、或者锚密钥中的任一种或多种。例如,第一NF可以为基站,基站用gNB表示,则这里的K可以为gNB key(记为K_ gNB)、NAS key(包括加密密钥Knasenc和完整性保护密钥Knasint)、或者锚密钥中的任一种或多种。这里密钥标识(key ID)为第一终端与第一NF之间共享密钥指示,例如该密钥标识为ngKSI,AUSF密钥标识,SEAF密钥标识,基站密钥标识。 The first terminal and the first NF share some parameters in advance. For example, the first terminal and the first NF respectively store the identification of the first terminal, the key K, and the key identification Key ID. Here K is the key shared between the first terminal and the first NF. For example, if the first NF is AMF, then K can include AMF key (denoted as Kamf), NAS key (including encryption key Knasenc and integrity protection). Knasint), or any one or more of anchor keys. At this time, the security anchor function (SEAF) is deployed in the AMF. For example, the first NF may be a security anchor function (SEAF), and K here may be a SEAF key (denoted as K_seaf). For example, the first NF is the authentication server function (authentication server function, AUSF), then K here may include AUSF key (denoted as K_AUSF), NAS key (including encryption key Knasenc and integrity protection key Knasint), or anchor secret Any one or more of the keys. For example, the first NF may be a base station, and the base station is represented by gNB, then K here may be gNB key (denoted as K_gNB ), NAS key (including encryption key Knasenc and integrity protection key Knasint), or anchor key Any one or more of them. Here, the key ID (key ID) is an indication of the shared key between the first terminal and the first NF, for example, the key ID is ngKSI, AUSF key ID, SEAF key ID, base station key ID.
NF为AMF时,第一NF为第一AMF,第二NF为第二AMF;When NF is AMF, the first NF is the first AMF, and the second NF is the second AMF;
NF为AUSF时,第一NF为第一AUSF,第二NF为第二AUSF;When NF is AUSF, the first NF is the first AUSF, and the second NF is the second AUSF;
NF为基站时,第一NF为第一基站,第二NF为第二基站。When the NF is a base station, the first NF is the first base station, and the second NF is the second base station.
可选的,也可以为第一NF为第一AUSF,第二NF为第二AMF。Optionally, the first NF may be the first AUSF, and the second NF may be the second AMF.
可选的,也可以为第一NF为第一AMF,第二NF为第二基站。Optionally, the first NF may be the first AMF, and the second NF may be the second base station.
其他可能性,第二NF可以为AMF,SEAF,AUSF,或者基站;第一NF可以为AMF,SEAF,AUSF,或者基站等不做限制。For other possibilities, the second NF can be AMF, SEAF, AUSF, or a base station; the first NF can be AMF, SEAF, AUSF, or a base station, etc. without limitation.
第一终端向第二终端发送的通信请求中还可以包括消息认证码(message authentication code,MAC),这里可以记为MAC1。MAC1可以用于网络功能校验通信请求中包括的参数的认证。The communication request sent by the first terminal to the second terminal may also include a message authentication code (message authentication code, MAC), which may be recorded as MAC1 here. MAC1 can be used to verify the authentication of the parameters included in the communication request by the network function.
MAC1的计算可以为基于密钥K,或者基于密钥K推衍得到的完整性保护密钥计算的,或者基于第一终端与第一AMF之间共享的NAS保护密钥计算的;或者基于第一终端与第一基站之间共享的RRC保护密钥计算的。除上述各种密钥之外,MAC1的计算还可以基于上述通信请求中包括的信息。例如,计算MAC1的值可以基于NAS保护密钥推演得到的完整性保护密钥Knasint计算的。本申请实施例中其它MAC的计算方式可以参照这里计算MAC1的方式。The calculation of MAC1 can be based on the key K, or based on the integrity protection key derived from the key K, or based on the NAS protection key shared between the first terminal and the first AMF; or based on the first terminal and the first AMF. Calculated by the RRC protection key shared between a terminal and the first base station. In addition to the aforementioned various keys, the calculation of MAC1 may also be based on the information included in the aforementioned communication request. For example, the value of MAC1 can be calculated based on the integrity protection key Knasint derived from the NAS protection key. For other MAC calculation methods in the embodiments of the present application, please refer to the calculation method of MAC1 here.
通信请求中可以包括一个容器(container),在该container中携带5G-GUTI1和/或ngKSI,该container中还可以包括MAC1和通信请求中携带的其他参数。其它参数可以参照图2所示实施例中通信请求中携带的参数。或者在通信请求中包括一个container的基础上,在通信请求中container外还携带一份与container中相同的信息;也可以在通信请求中container外携带一部分信息,如携带5G-GUTI1和/或ngKSI。或者,将container通过一个消息发送给第二终端,将上述通信请求中container外的信息通过另一个消息发送给第二终端。也可能,container中携带通信请求中其他参数的一部分。可选的,container中还可以包括一个指示,用于指示所有container的内容用于请求端到端的密钥协商。后续处理container的网元,可以通过这个指示确定container的请求。The communication request may include a container, and the container may carry 5G-GUTI1 and/or ngKSI. The container may also include MAC1 and other parameters carried in the communication request. For other parameters, refer to the parameters carried in the communication request in the embodiment shown in FIG. 2. Or on the basis of including a container in the communication request, the container in the communication request also carries a piece of information that is the same as that in the container; it is also possible to carry some information outside the container in the communication request, such as carrying 5G-GUTI1 and/or ngKSI . Alternatively, the container is sent to the second terminal through a message, and the information outside the container in the communication request is sent to the second terminal through another message. It is also possible that the container carries part of other parameters in the communication request. Optionally, the container may also include an indication for indicating that the contents of all the containers are used to request end-to-end key negotiation. The network element that subsequently processes the container can use this instruction to determine the container's request.
第二终端可以根据通信请求中携带的5G-GUTI1执行后续的操作,而container会由第二终端发送至第一NF。这里不限制5G-GUTI是在container内部还是外部。The second terminal may perform subsequent operations according to the 5G-GUTI1 carried in the communication request, and the container will be sent by the second terminal to the first NF. There is no restriction on whether 5G-GUTI is inside or outside the container.
S302、可选的,第二终端判断第一终端与第二终端是否属于同一网络。S302. Optionally, the second terminal determines whether the first terminal and the second terminal belong to the same network.
这里通过第一终端的标识和或第一NF所在的地址的判断可以分为两种可能性。可能性1:判断第一终端和第二终端接入的服务网络是否相同。可能性2:判断第一终端和第二终端所在的归属网络是否相同。例如通过SUCI中的网络标识确定第一终端所在的归属网络,进行判断;通过5G-GUTI中的网络标识进行判断是否属于同一个服务网络;通过UE ID确定服务网络或者归属网络;通过GPSI确定归属网络等;通过第一NF所在的地址 判定服务网络或者归属网络相同。如果存在其他标识的可能性,也可以进行判断。Here, the judgment based on the identification of the first terminal and or the address where the first NF is located can be divided into two possibilities. Possibility 1: Determine whether the service network accessed by the first terminal and the second terminal are the same. Possibility 2: Determine whether the home network where the first terminal and the second terminal are located is the same. For example, the network identifier in SUCI is used to determine the home network of the first terminal for judgment; the network identifier in 5G-GUTI is used to determine whether it belongs to the same service network; the UE ID is used to determine the service network or the home network; the GPSI is used to determine the home network Network, etc.; it is determined that the service network or the home network is the same through the address where the first NF is located. If there is the possibility of other identification, it can also be judged.
如果第一终端与第二终端不属于同一网络,则拒绝通信请求,并发送拒绝消息至第一终端。可选的拒绝消息包括拒绝指示,指示拒绝的原因。又或者,如果第一终端与第二终端不属于同一网络,则通过应用层获取共享密钥,并继续与第一终端协商安全密钥,可以按照图2所示的方法协商第一安全密钥。If the first terminal and the second terminal do not belong to the same network, the communication request is rejected, and a rejection message is sent to the first terminal. The optional rejection message includes a rejection indication, indicating the reason for rejection. Or, if the first terminal and the second terminal do not belong to the same network, obtain the shared key through the application layer and continue to negotiate the security key with the first terminal. The first security key can be negotiated according to the method shown in FIG. 2 .
如果第一终端与第二终端属于同一网络,则继续执行S303。If the first terminal and the second terminal belong to the same network, continue to perform S303.
第二终端可以通过第一终端的标识来判断第一终端与第二终端是否属于同一网络,例如通过第一终端的5G-GUTI来判断第一终端与第二终端是否属于同一运营商。The second terminal may determine whether the first terminal and the second terminal belong to the same network through the identifier of the first terminal, for example, determine whether the first terminal and the second terminal belong to the same operator through the 5G-GUTI of the first terminal.
例如可以是第二终端根据5G-GUTI1中的网络标识,判断该网络标识与自身接入的网络是否属于同一个网络。如第二终端根据5G-GUTI1中包括的网络的移动设备网络代码(mobile network code,MNC)和移动设备国家代码(mobile country code,MCC),判断是否与自己接入的服务网络的MNC和MCC相同。For example, the second terminal may determine whether the network identifier and the network accessed by the second terminal belong to the same network according to the network identifier in 5G-GUTI1. For example, according to the mobile network code (mobile network code, MNC) and mobile country code (MCC) of the network included in 5G-GUTI1, the second terminal determines whether it is connected to the MNC and MCC of the service network it is connected to. the same.
可能性,这里是否同一网络可以理解为同一运营商网络。Possibility, whether the same network can be understood as the same operator network.
可选的,这里网络标识也可以由第一终端在通信请求中单独发送给第二终端。第二终端根据接收到的网络标识判定归属网络和/或服务网络,再执行上述判断。Optionally, the network identification here may also be separately sent by the first terminal to the second terminal in the communication request. The second terminal determines the home network and/or the service network according to the received network identifier, and then executes the foregoing determination.
S303、第二终端向第一NF发送第一终端的标识,第一NF获取第一终端的标识。S303. The second terminal sends the identity of the first terminal to the first NF, and the first NF obtains the identity of the first terminal.
第二终端向第一NF发送第一终端的标识时,还可以向第一NF发送其它的参数或信息。When the second terminal sends the identity of the first terminal to the first NF, it may also send other parameters or information to the first NF.
可选的,第二终端向第一NF发送请求消息,例如记为请求消息1,在请求消息1中携带第一终端的标识、其它的参数或信息。在请求消息1中还可以携带指示信息,该指示信息用于指示该请求消息1是终端与终端之间通信相关的请求,例如,指示该请求消息1是车联网密钥协商相关的请求或者是V2X密钥协商相关的请求。Optionally, the second terminal sends a request message to the first NF, for example recorded as request message 1, and the request message 1 carries the identity of the first terminal and other parameters or information. The request message 1 may also carry indication information, which is used to indicate that the request message 1 is a request related to communication between the terminal and the terminal, for example, indicating that the request message 1 is a request related to the Internet of Vehicles key agreement or is V2X key agreement related request.
可选的,第二终端可能直接向第一NF发送密钥请求,该密钥请求可以是NAS消息,该NAS消息中携带第一终端的标识。例如,第一NF为第一终端和第二终端服务的场景下,第二终端可以直接向第一NF发送第一终端的标识。可选的,NAS消息携带container。Optionally, the second terminal may directly send a key request to the first NF, and the key request may be a NAS message, and the NAS message carries the identity of the first terminal. For example, in a scenario where the first NF serves the first terminal and the second terminal, the second terminal may directly send the identity of the first terminal to the first NF. Optionally, the NAS message carries a container.
可选的,第二终端可能通过第二NF向第一NF发送第一终端的标识,例如该方法可以通过S304~S306实现。例如,当第一NF为第一终端服务,第二NF为第二终端服务,这种场景下,第二终端可以通过第二NF向第一NF发送第一终端的标识。Optionally, the second terminal may send the identity of the first terminal to the first NF through the second NF. For example, the method may be implemented through S304 to S306. For example, when the first NF serves the first terminal and the second NF serves the second terminal, in this scenario, the second terminal may send the identity of the first terminal to the first NF through the second NF.
S304、第二终端向第二NF发送请求消息(记为请求消息2),第二NF从第二终端接收该请求消息2。S304. The second terminal sends a request message (denoted as request message 2) to the second NF, and the second NF receives the request message 2 from the second terminal.
该请求消息2中可以包括上述第一终端发送的通信请求中的container。可选的,该请求消息2中在container外还可以包括第二终端的ID。第二终端的ID记为UE ID2。可选的,该请求消息2中还可以包括一个指示信息,该指示信息用于指示该请求消息2是指示终端与终端之间通信相关的请求,例如,指示该请求消息2是车联网密钥协商相关的请求或者是V2X密钥协商相关的请求。The request message 2 may include the container in the communication request sent by the first terminal. Optionally, the request message 2 may also include the ID of the second terminal in addition to the container. The ID of the second terminal is recorded as UE ID2. Optionally, the request message 2 may also include an indication information for indicating that the request message 2 is a request related to communication between the terminal and the terminal, for example, indicating that the request message 2 is an Internet of Vehicles key Negotiation related requests or V2X key negotiation related requests.
第二NF可以是为第二终端服务的AMF,也可以是第二终端发送给基站后,由基站选择的AMF。The second NF may be an AMF serving the second terminal, or may be an AMF selected by the base station after the second terminal sends to the base station.
S305、第二NF校验该请求消息2,并确定第一NF。S305. The second NF checks the request message 2 and determines the first NF.
第二NF校验从第二终端接收到的请求消息2的正确性。校验动作可选。第二NF可以自己校验,也可以通过请求其他NF进行校验。例如,第二NF可以通过第二终端的ID 确定UE ID2的安全上下文来进行校验,验证请求消息2的完整性保护。例如,第二NF通过UE ID2确定另一个之前为第二终端服务的NF,请求此NF校验并返回结果。校验通过后,继续后续步骤。这里校验的动作为可选动作,不做限制。The second NF verifies the correctness of the request message 2 received from the second terminal. The verification action is optional. The second NF can be verified by itself, or can be verified by requesting other NFs. For example, the second NF may determine the security context of the UE ID2 through the ID of the second terminal for verification, and verify the integrity protection of the request message 2. For example, the second NF determines another NF that previously served the second terminal through the UE ID2, requests this NF to check and returns the result. After the verification is passed, continue to the next steps. The action checked here is optional and not restricted.
可选的,如果该请求消息2中包括指示信息,则第二NF根据该指示信息确定此请求消息2和终端与终端之间通信相关,例如,指示该请求消息2是车联网密钥协商相关的请求或者是V2X密钥协商相关的请求。Optionally, if the request message 2 includes indication information, the second NF determines according to the indication information that the request message 2 is related to the communication between the terminal and the terminal, for example, indicating that the request message 2 is related to the Internet of Vehicles key negotiation. The request or V2X key agreement related request.
第二NF根据该请求消息2中携带的第一终端的标识(例如5G-GUTI1)和/或第一NF的地址,确定为第一终端服务的第一NF。The second NF determines the first NF served by the first terminal according to the identity of the first terminal (for example, 5G-GUTI1) and/or the address of the first NF carried in the request message 2.
第二NF可以根据请求消息2中携带的第一NF的地址确定第一NF。第二NF也可以发送第一终端的标识(例如,GPSI)至其他NF(例如,UDM,UDR),从其他NF获取第一NF的地址,进而确定第一NF。The second NF may determine the first NF according to the address of the first NF carried in the request message 2. The second NF may also send the identity of the first terminal (for example, GPSI) to other NFs (for example, UDM, UDR), obtain the address of the first NF from the other NF, and then determine the first NF.
可选的,也可以第二NF确定第一终端与第二终端是否属于同一网络。具体判定方法与上面的判定相同。Optionally, the second NF may also determine whether the first terminal and the second terminal belong to the same network. The specific determination method is the same as the above determination.
S306、第二NF向第一NF发送密钥请求;第一NF从第二NF接收密钥请求。S306. The second NF sends a key request to the first NF; the first NF receives the key request from the second NF.
密钥请求中携带从第二终端接收的container。或者,密钥请求中在container外还携带与container中相同的部分或全部信息,也可以携带container中没有携带的其他参数,其他参数可以参考图2所示的实施例中的通信请求中携带的信息或参数。The key request carries the container received from the second terminal. Alternatively, the key request also carries part or all of the same information as in the container in addition to the container, or other parameters not carried in the container. For other parameters, refer to the communication request carried in the embodiment shown in FIG. 2 Information or parameters.
S307、第一NF确定密钥K1,该密钥K1可以作为上述共享密钥。S307. The first NF determines a key K1, which can be used as the aforementioned shared key.
若第一NF从第二终端接收到的请求消息(上述请求消息1或请求消息2)中携带消息验证码MAC1,则第一NF还会校验MAC1,确定校验MAC1通过后,执行确定共享密钥的过程。If the request message (the above request message 1 or request message 2) received by the first NF from the second terminal carries the message verification code MAC1, the first NF will also check MAC1, and after confirming that the verification MAC1 is passed, perform the confirmation sharing The key process.
以NF为AMF为例,第一NF根据container中的5G-GUTI1和ngKSI确认第一终端的安全上下文,例如确定Kamf。并基于Kamf推衍得到K1。具体可以基于Kamf和生成参数推衍得到K1。Taking NF as AMF as an example, the first NF confirms the security context of the first terminal according to 5G-GUTI1 and ngKSI in the container, for example, determines Kamf. K1 is derived based on Kamf. Specifically, K1 can be derived based on Kamf and generation parameters.
可选的,第一NF还从container中接收到指示信息,根据指示信息确定此消息用于车联网密钥协商相关的请求或者是V2X密钥协商相关的请求,或者端到端的密钥协商。Optionally, the first NF also receives indication information from the container, and determines, according to the indication information, that this message is used for a request related to vehicle networking key negotiation or a V2X key negotiation related request, or end-to-end key negotiation.
可选的,这些生成参数也可以通过第二终端和第二NF发送至第一NF。例如,生成参数可以参照上文中通信请求或通信响应中的包括的信息;Optionally, these generation parameters may also be sent to the first NF through the second terminal and the second NF. For example, the generation parameters can refer to the information included in the above communication request or communication response;
可选的,生成K1还可能使用以下参数的至少一项:NAS上行或下行计数值,端到端通信指示,业务的标识,业务的类型。业务的标识和类型可以在container中发送给第一NF。Optionally, generating K1 may also use at least one of the following parameters: NAS uplink or downlink count value, end-to-end communication indication, service identifier, and service type. The identifier and type of the service can be sent to the first NF in the container.
可选的,第一NF根据第一终端的安全上下文校验container内参数的认证性。例如校验MAC1的正确性。例如校验方式可以基于NAS安全密钥校验的方式,该校验方式本申请实施例不做限制。Optionally, the first NF verifies the authenticity of the parameters in the container according to the security context of the first terminal. For example, verify the correctness of MAC1. For example, the verification method may be based on the NAS security key verification method, which is not limited in the embodiment of the present application.
S308、第一NF向第二终端发送共享密钥K1,第二终端获取共享密钥K1。S308. The first NF sends the shared key K1 to the second terminal, and the second terminal obtains the shared key K1.
可选的,第一NF可以直接向第二终端发送请求消息1的响应消息1,第二终端从该响应消息1中获取共享密钥。Optionally, the first NF may directly send the response message 1 of the request message 1 to the second terminal, and the second terminal obtains the shared key from the response message 1.
或者,第一NF通过第二NF向第二终端发送K1,这种方式可以通过S309~S311实现。Or, the first NF sends K1 to the second terminal through the second NF, and this manner can be implemented through S309 to S311.
S309、第一NF向第二NF返回密钥响应,第二NF从第一NF接收该密钥响应。S309. The first NF returns a key response to the second NF, and the second NF receives the key response from the first NF.
该密钥响应用于响应密钥请求。密钥响应中携带K1。The key response is used to respond to the key request. K1 is carried in the key response.
S310、第二NF根据K1确定密钥K2。S310. The second NF determines the key K2 according to K1.
确定密钥K2的方式可以参照确定K1的方式,即第二NF根据K1和生成参数推演K2,生成参数可以参照上文中通信请求或通信响应中携带的信息。The manner of determining the key K2 can refer to the manner of determining K1, that is, the second NF derives K2 according to K1 and the generation parameter, and the generation parameter can refer to the information carried in the above communication request or communication response.
该步骤可以省略。This step can be omitted.
S311、第二NF向第二终端发送请求消息2的响应消息2,第二终端从第二NF接收响应消息2。S311. The second NF sends a response message 2 of the request message 2 to the second terminal, and the second terminal receives the response message 2 from the second NF.
该响应消息2携带密钥K2。密钥K2即共享密钥。The response message 2 carries the key K2. The key K2 is the shared key.
如果S310省略,则响应消息2携带密钥K1即可,密钥K1即共享密钥。If S310 is omitted, the response message 2 only needs to carry the key K1, and the key K1 is the shared key.
可选的,第二NF可以通过第二NF与第二终端之间的安全上下文加密保护K1或K2的发送。Optionally, the second NF may protect the transmission of K1 or K2 through security context encryption between the second NF and the second terminal.
S312、第二终端确定第一安全密钥K3。S312. The second terminal determines the first security key K3.
第二终端可能会根据响应消息2中携带的密钥K1或者K2,进一步推演得到K3。或者第二终端根据响应消息1中携带的密钥K1推演得到K3。这种情况下,密钥K1或者K2作为共享密钥,K3为第一安全密钥,确定第一安全密钥的方法可以参照图2所示的实施例的描述。The second terminal may further derive K3 according to the key K1 or K2 carried in the response message 2. Or the second terminal derives K3 according to the key K1 carried in the response message 1. In this case, the key K1 or K2 is used as the shared key, and K3 is the first security key. For the method of determining the first security key, refer to the description of the embodiment shown in FIG. 2.
第二终端也可能直接将响应消息2中携带的密钥K1或者K2作为第一安全密钥;或者,第二终端也可能直接将响应消息1中携带的密钥K1作为第一安全密钥。The second terminal may also directly use the key K1 or K2 carried in the response message 2 as the first security key; or, the second terminal may directly use the key K1 carried in the response message 1 as the first security key.
可选的,第二终端根据第一安全密钥K3计算消息验证码MAC2的值,或者根据K3推衍得到完整性保护密钥K3int之后,基于K3int对通信响应做完整性保护,得到MAC2的值。Optionally, the second terminal calculates the value of the message verification code MAC2 according to the first security key K3, or obtains the integrity protection key K3int based on K3, performs integrity protection on the communication response based on K3int, and obtains the value of MAC2 .
S313、第二终端向第一终端返回通信响应。第一终端从第二终端接收通信响应。S313. The second terminal returns a communication response to the first terminal. The first terminal receives the communication response from the second terminal.
该步骤可以参考图2所示的实施例中的S203步骤中的描述。For this step, reference may be made to the description of step S203 in the embodiment shown in FIG. 2.
可选的,该通信响应中还可以包括MAC2。Optionally, the communication response may also include MAC2.
S314、第一终端确定第一安全密钥K3。S314. The first terminal determines the first security key K3.
第一安全密钥即为图2所示的实施例中的第一安全密钥。The first security key is the first security key in the embodiment shown in FIG. 2.
这里第一终端采用上述第一NF相同的方式生成K1,再生成K3;或者根据K1生成K2后,再生成K3。生成方式与上面描述的相同。Here, the first terminal generates K1 in the same manner as the first NF, and then generates K3; or generates K2 according to K1, and then generates K3. The generation method is the same as described above.
以NF为AMF为例,第一终端根据Kamf推衍得到K3。例如:第一终端根据Kamf推衍得到K1,可以参照第一NF确定K1的操作。根据K1确定K2,可以参照第一NF确定K2的操作;第一终端再根据K2得到K3,可以参照第二终端确定K3的操作。Taking NF as AMF as an example, the first terminal derives K3 according to Kamf. For example, the first terminal derives K1 according to Kamf, and can refer to the first NF to determine the operation of K1. To determine K2 according to K1, the operation of K2 can be determined with reference to the first NF; the first terminal then obtains K3 according to K2, and the operation of K3 can be determined with reference to the second terminal.
若通信响应中携带MAC2,第一终端根据第一密钥K3校验MAC2的正确性,或者根据K3推衍得到K3int后,采用K3int校验MAC2的正确性。如果校验不通过,则发送校验失败响应至第二终端。可选发送失败指示给第二终端,指示MAC2校验失败。校验成功则完成密钥协商。If the communication response carries MAC2, the first terminal checks the correctness of MAC2 according to the first key K3, or uses K3int to check the correctness of MAC2 after obtaining K3int based on K3. If the verification fails, a verification failure response is sent to the second terminal. Optionally, a failure indication is sent to the second terminal, indicating that the MAC2 check fails. If the verification is successful, the key negotiation is completed.
S315、可选的,第一终端确定MAC3,并将MAC3发送给第二终端,第二终端从第一终端接收MAC3。S315. Optionally, the first terminal determines MAC3 and sends MAC3 to the second terminal, and the second terminal receives MAC3 from the first terminal.
第一终端根据K3或者K3int计算MAC3。MAC3的输入参数还可以包括上述通信请求或通信响应中携带的信息中的至少一项。The first terminal calculates MAC3 according to K3 or K3int. The input parameters of MAC3 may also include at least one of the information carried in the aforementioned communication request or communication response.
S316、可选的,第二终端校验MAC3。S316. Optionally, the second terminal checks MAC3.
第二终端根据K3或者K3int校验MAC3。如果校验通过,则代表第一终端与第二终 端之间完成双向认证。The second terminal checks MAC3 according to K3 or K3int. If the verification is passed, it means that the first terminal and the second terminal have completed mutual authentication.
可选的,上述第一终端的标识除了可以是5G-GUTI之外,还可以是GPSI,若第一终端的标识为GPSI,则可将上述实施例中5G-GUTI替换为GPSI,形成的方案也属于本申请实施例所保护的范围。Optionally, in addition to the 5G-GUTI, the identifier of the first terminal may also be GPSI. If the identifier of the first terminal is GPSI, then the 5G-GUTI in the above embodiment may be replaced with GPSI to form a solution It also belongs to the protection scope of the embodiments of the present application.
可选的,上述第一终端的标识还可以是用于协商密钥的标识(记为UE ID)。则可将图3a所述的实施例中5G-GUTI替换为该用于协商密钥的标识,形成的方案也属于本申请实施例所保护的范围。图3a中第一终端的标识用5G-GUTI/UE ID/GPSI来表示,表明第一终端的标识可以是这三种中的任意一种,可以理解的是,第一终端的标识还可以有其它表现形式。Optionally, the above-mentioned identification of the first terminal may also be an identification used for key negotiation (denoted as UE ID). Then, the 5G-GUTI in the embodiment described in FIG. 3a can be replaced with the identifier for negotiating the key, and the formed solution also falls within the protection scope of the embodiment of the present application. The identity of the first terminal in Figure 3a is represented by 5G-GUTI/UE ID/GPSI, indicating that the identity of the first terminal can be any of these three types. It is understandable that the identity of the first terminal can also have Other manifestations.
可选的,也可以除发送UE标识之外,还发送第一终端所在的服务网络标识,此时第二终端可以根据接收到第一终端所在的服务网络标识,确定是否属于同一个服务网络。如果不属于,则拒绝通信请求。如果属于,则继续执行。Optionally, in addition to sending the UE identity, the service network identity where the first terminal is located may also be transmitted. In this case, the second terminal may determine whether it belongs to the same service network according to the service network identity where the first terminal is received. If it does not belong, the communication request is rejected. If it belongs, continue execution.
可选的,也可以发送UE标识之外,再发送第一终端所在的归属网络标识,此时第二终端可以根据接收到第一终端所在的归属网络标识,确定是否属于同一个归属网络。如果不属于,则拒绝通信请求。如果属于,则继续执行。Optionally, in addition to the UE identity, the home network identity where the first terminal is located can also be transmitted. In this case, the second terminal can determine whether it belongs to the same home network according to the received home network identity of the first terminal. If it does not belong, the communication request is rejected. If it belongs, continue execution.
可选的,也可以发送UE标识包括第一终端所在的服务网络标识,此时第二终端可以根据接收到第一终端所在的服务网络标识,确定是否属于同一个服务网络。如果不属于,则拒绝通信请求。如果属于,则继续执行。Optionally, the sent UE identifier may also include the service network identifier where the first terminal is located. In this case, the second terminal may determine whether it belongs to the same service network according to the received service network identifier where the first terminal is located. If it does not belong, the communication request is rejected. If it belongs, continue execution.
可选的,也可以发送UE标识包括第一终端所在的归属网络标识,此时第二终端可以根据接收到第一终端所在的归属网络标识,确定是否属于同一个归属网络。如果不属于,则拒绝通信请求。如果属于,则继续执行。Optionally, the sent UE identity may also include the home network identity where the first terminal is located. In this case, the second terminal may determine whether it belongs to the same home network according to the received home network identity of the first terminal. If it does not belong, the communication request is rejected. If it belongs, continue execution.
可选的,上述UE的标识也可以为SUCI。此时第二终端可以根据SUCI中的网络标识确实是否属于同一个归属网络。如果不属于,则拒绝通信请求。如果属于,则继续执行。Optionally, the identifier of the aforementioned UE may also be SUCI. At this time, the second terminal can actually belong to the same home network according to the network identifier in the SUCI. If it does not belong, the communication request is rejected. If it belongs, continue execution.
可选的,第二NF为AMF。第二NF校验MAC通过后,再发送container消息中的第一终端的标识至第一NF。还可能发送指示信息,密钥标识等至少一项。此时第一NF不需校验MAC。Optionally, the second NF is AMF. After the second NF verifies that the MAC is passed, the identity of the first terminal in the container message is sent to the first NF. It may also send at least one of instruction information, key identification, etc. At this time, the first NF does not need to verify the MAC.
基于图3a所描述的实施例,若NF为AMF时,第一NF为第一AMF,第二NF为第二AMF,这种情况下,如图3b所示,本申请实施例提供的密钥生成方法如下所述。Based on the embodiment described in Fig. 3a, if the NF is AMF, the first NF is the first AMF, and the second NF is the second AMF. In this case, as shown in Fig. 3b, the key provided by the embodiment of this application The production method is as follows.
S301b、第一终端向第二终端发送通信请求,第二终端从第一终端接收该通信请求。S301b. The first terminal sends a communication request to the second terminal, and the second terminal receives the communication request from the first terminal.
该通信请求可以包括的信息如上述1)~15)所述的信息中的一种或多种,该通信请求中的第一终端的标识可以包括第一终端的ID,这里第一终端的ID可以为,第一终端的5G-GUTI,或者UE ID,或者GPSI,或者SUCI。UE ID为用于此密钥协商业务的UE标识。The information that the communication request may include is one or more of the information described in 1) to 15) above. The identification of the first terminal in the communication request may include the ID of the first terminal, where the ID of the first terminal It may be the 5G-GUTI of the first terminal, or the UE ID, or GPSI, or SUCI. The UE ID is the UE identification used for this key agreement service.
该通信请求中还可以包括第一AMF的地址。也可能第一终端的标识中包括第一AMF的地址信息。The communication request may also include the address of the first AMF. It is also possible that the identification of the first terminal includes the address information of the first AMF.
通信请求中还可以包括消息认证码(message authentication code,MAC),这里可以记为MAC1。MAC1可以用于网络功能校验通信请求中包括的参数的认证。The communication request may also include a message authentication code (message authentication code, MAC), which may be recorded as MAC1 here. MAC1 can be used to verify the authentication of the parameters included in the communication request by the network function.
通信请求中可以包括一个NAS容器(container),在该container中携带5G-GUTI1和/或ngKSI,该container中还可以包括MAC1和通信请求中携带的其他参数。其它参数可以参照图2所示实施例中通信请求中携带的参数。或者在通信请求中包括一个container的基 础上,在通信请求中container外还携带一份与container中相同的信息;也可以在通信请求中container外携带一部分信息,如携带5G-GUTI1和/或ngKSI。或者,将container通过一个消息发送给第二终端,将上述通信请求中container外的信息通过另一个消息发送给第二终端。也可能,container中携带通信请求中其他参数的一部分。可选的,container中还可以包括一个指示,用于指示所有container的内容用于请求端到端的密钥协商。后续处理container的网元,可以通过这个指示确定container的请求。The communication request may include a NAS container (container) in which 5G-GUTI1 and/or ngKSI is carried, and the container may also include MAC1 and other parameters carried in the communication request. For other parameters, refer to the parameters carried in the communication request in the embodiment shown in FIG. 2. Or on the basis of including a container in the communication request, the container in the communication request also carries a piece of information that is the same as that in the container; it is also possible to carry some information outside the container in the communication request, such as carrying 5G-GUTI1 and/or ngKSI . Alternatively, the container is sent to the second terminal through a message, and the information outside the container in the communication request is sent to the second terminal through another message. It is also possible that the container carries part of other parameters in the communication request. Optionally, the container may also include an indication for indicating that the contents of all the containers are used to request end-to-end key negotiation. The network element that subsequently processes the container can use this instruction to determine the container's request.
本步骤的其它相关描述还可以参照上述S301的描述,重复之处不再赘述。For other related descriptions of this step, reference may also be made to the description of S301 above, and the repetitions are not repeated here.
S302b、第二终端向第二AMF发送第一NAS消息,第二AMF从第二终端接收该第一NAS消息。S302b. The second terminal sends a first NAS message to the second AMF, and the second AMF receives the first NAS message from the second terminal.
第一NAS消息携带第一终端的标识,还可以携带从第一终端接收到的NAS container。The first NAS message carries the identity of the first terminal, and may also carry the NAS container received from the first terminal.
这里的第一NAS消息即图3a中S303中所述的请求消息2,相关描述可以参照请求消息2的描述,在此不再赘述。The first NAS message here is the request message 2 described in S303 in FIG. 3a, and the related description can refer to the description of the request message 2, which will not be repeated here.
S303b、第二AMF向第一AMF发送密钥请求(key request),第一AMF从第二AMF接收该密钥请求。S303b. The second AMF sends a key request (key request) to the first AMF, and the first AMF receives the key request from the second AMF.
本步骤可以参照上述S306的描述,密钥请求可以参照S306中的密钥请求的描述。For this step, refer to the description of S306 above, and for the key request, refer to the description of the key request in S306.
S304b、第一AMF确定密钥K1。S304b. The first AMF determines the key K1.
第一AMF可以先验证NAS container,例如,NAS container中携带的MAC1,第一AMF校验MAC1,确定校验MAC1通过后,确定密钥K1。The first AMF may first verify the NAS container, for example, MAC1 carried in the NAS container, the first AMF checks MAC1, and after confirming that the verification MAC1 is passed, the key K1 is determined.
S305b、第一AMF向第二AMF返回密钥响应,第二AMF从第一AMF接收该密钥响应。S305b. The first AMF returns a key response to the second AMF, and the second AMF receives the key response from the first AMF.
S306b、第二NF向第二终端发送密钥K1,第二终端从第二NF接收密钥K1。S306b. The second NF sends the key K1 to the second terminal, and the second terminal receives the key K1 from the second NF.
S307b、第二终端确定第一安全密钥K3。参考S312。S307b. The second terminal determines the first security key K3. Refer to S312.
S308b、第二终端向第一终端返回通信响应。第一终端从第二终端接收通信响应。S308b. The second terminal returns a communication response to the first terminal. The first terminal receives the communication response from the second terminal.
同S313。Same as S313.
S309b、第一终端确定第一安全密钥K3。同S313。S309b. The first terminal determines the first security key K3. Same as S313.
图3b中第一终端和第二终端的其它未描述的操作可以参照图3a中对第一终端和第二终端的描述。图3b中对第一AMF的其它未描述的操作可以参照图3a中对第一NF的描述。图3b中对第二AMF的其它未描述的操作可以参照图3a中对第二NF的描述。消息和信令中携带的参数或信息也可以对应图3a中的相关描述,不再赘述。第一AMF与第二AMF也可以为同一个AMF。For other undescribed operations of the first terminal and the second terminal in FIG. 3b, reference may be made to the description of the first terminal and the second terminal in FIG. 3a. For other undescribed operations of the first AMF in FIG. 3b, reference may be made to the description of the first NF in FIG. 3a. For other undescribed operations of the second AMF in FIG. 3b, reference may be made to the description of the second NF in FIG. 3a. The parameters or information carried in the message and signaling can also correspond to the related description in Fig. 3a, and will not be repeated. The first AMF and the second AMF may also be the same AMF.
第一终端的标识为UE ID这种情况下,第一终端需要注册该用于协商密钥的标识。如图4所示,以下给出一种可能的注册流程。图4所述的实施例中的任意多个连续或不连续的步骤均可形成一种方案,属于本申请实施例保护的范围。在下述描述中,第一终端的标识可以是用于协商密钥的标识,或者也可以理解为用于确定终端与终端之间通信保护的密钥推演的标识,或者作其它理解。In the case where the identity of the first terminal is the UE ID, the first terminal needs to register the identity for key negotiation. As shown in Figure 4, a possible registration process is given below. Any multiple continuous or discontinuous steps in the embodiment shown in FIG. 4 can form a solution, which falls within the protection scope of the embodiments of the present application. In the following description, the identification of the first terminal may be an identification used to negotiate a key, or may also be understood as an identification used to determine the key derivation of communication protection between the terminal and the terminal, or for other understanding.
S401、第一终端发送注册请求至AMF,AMF从第一终端接收该注册请求。S401: The first terminal sends a registration request to the AMF, and the AMF receives the registration request from the first terminal.
其中该注册请求携带该第一终端的身份标识。例如该身份标识为订阅封装标识(subscription concealed identifier,SUCI)。第一终端的真实身份称为订阅永久标识(subscription permanent identifier,SUPI),SUPI通过密钥加密后的密文为SUCI。又或者,该身份标识为5G-GUTI。The registration request carries the identity of the first terminal. For example, the identity identifier is a subscription concealed identifier (SUCI). The real identity of the first terminal is called a subscription permanent identifier (SUPI), and the ciphertext encrypted by the SUPI with a key is SUCI. Or, the identity is 5G-GUTI.
可选的,该注册请求还携带指示(例如记为indicator1),用于指示该第一终端需要使用终端与终端之间通信的业务,例如车联网业务;或者,用于指示该注册请求用于请求注册与车辆网相关的标识。Optionally, the registration request also carries an indication (for example, marked as indicator1), which is used to indicate that the first terminal needs to use the service of communication between the terminal and the terminal, such as the Internet of Vehicles service; or, it is used to indicate that the registration request is used for Request to register the logo associated with the vehicle network.
可选的,该注册请求还携带应用标识(ID),用于指示该第一终端会使用的终端与终端之间通信的业务标识,例如V2X应用ID。Optionally, the registration request also carries an application identifier (ID), which is used to indicate a service identifier for terminal-to-terminal communication that the first terminal will use, such as a V2X application ID.
可选的,该注册请求还携带业务的类型,用于指示该第一终端会使用的终端与终端之间通信的业务的类型。Optionally, the registration request also carries a type of service, which is used to indicate the type of communication service between the terminal and the terminal that the first terminal will use.
S402、AMF向AUSF发送该第一终端的身份标识和服务网络标识,AUSF从AMF接收该第一终端的身份标识和服务网络标识。S402. The AMF sends the identity identifier and the service network identifier of the first terminal to the AUSF, and the AUSF receives the identity identifier and the service network identifier of the first terminal from the AMF.
AMF向AUSF发送的第一终端的身份标识来自于注册请求中携带的身份标识,例如,该身份标识为SUCI。The identity of the first terminal sent by the AMF to the AUSF comes from the identity carried in the registration request, for example, the identity is SUCI.
可选的,AMF还可以向AUSF发送指示(例如为indicator1)。Optionally, the AMF may also send an indication (for example, indicator1) to the AUSF.
可选的,AMF还可以向AUSF发送应用ID。Optionally, the AMF can also send the application ID to the AUSF.
可选的,AMF还可以向AUSF发送业务的类型。Optionally, AMF can also send the type of service to AUSF.
AMF根据注册请求,向AUSF发送指示和应用ID,例如从注册请求中获取该指示和该应用ID。According to the registration request, the AMF sends the instruction and the application ID to the AUSF, for example, the instruction and the application ID are obtained from the registration request.
S403、AUSF向UDM发送第一终端的身份标识和服务网络标识,UDM从AUSF接收该第一终端的身份标识和服务网络标识。S403. AUSF sends the identity identifier and service network identifier of the first terminal to UDM, and UDM receives the identity identifier and service network identifier of the first terminal from AUSF.
AUSF将从AMF接收到的第一终端的身份标识和服务网络标识发送给UDM。The AUSF sends the identity identifier and the service network identifier of the first terminal received from the AMF to the UDM.
可选的,AUSF还向UDM发送该indicator1;Optionally, AUSF also sends the indicator1 to UDM;
可选的,AUSF还向UDM发送该应用ID。Optionally, AUSF also sends the application ID to UDM.
可选的,AUSF还可以向UDM发送业务的类型。Optionally, AUSF can also send the type of service to UDM.
可选的,UDM根据该第一终端的签约数据和indicator1,判断是否允许该第一终端使用该终端与终端之间通信的业务,例如车联网业务;Optionally, the UDM determines whether to allow the first terminal to use the service of communication between the terminal and the terminal, such as the Internet of Vehicles service, according to the subscription data of the first terminal and indicator1;
可选的,UDM根据该第一终端的签约数据,以及应用ID和/或业务的类型,判断是否允许该第一终端使用终端与终端之间通信的业务,例如V2X应用ID指示的业务。Optionally, UDM determines whether to allow the first terminal to use the service of communication between the terminal and the terminal, such as the service indicated by the V2X application ID, according to the subscription data of the first terminal and the application ID and/or service type.
S404、UDM向AUSF发送认证向量,AUSF从UDM接收该认证向量SUPI。S404. UDM sends an authentication vector to AUSF, and AUSF receives the authentication vector SUPI from UDM.
可选的,UDM还向AUSF发送SUPI,AUSF还从UDM接收SUPI。Optionally, UDM also sends SUPI to AUSF, and AUSF also receives SUPI from UDM.
可选的,如果UDM判定允许该第一终端使用该终端与终端之间通信的业务,则向AUSF发送指示(记为indicator2)。AUSF从UDM接收该指示。Optionally, if the UDM determines that the first terminal is allowed to use the service of the communication between the terminal and the terminal, an indication (denoted as indicator2) is sent to the AUSF. AUSF receives this indication from UDM.
S405、AUSF向AMF发送认证向量,AMF从AUSF接收该认证向量。S405. AUSF sends an authentication vector to AMF, and AMF receives the authentication vector from AUSF.
可选的,AUSF还向AMF发送SUPI,AMF还从AUSF接收SUPI。Optionally, AUSF also sends SUPI to AMF, and AMF also receives SUPI from AUSF.
S406、第一终端、AMF与AUSF之间执行双向认证。S406: Perform mutual authentication between the first terminal, AMF and AUSF.
认证例如包括5G AKA,EAP AKA’。认证成功后,执行S407。Authentication includes, for example, 5G AKA, EAP AKA'. After the authentication is successful, execute S407.
S407、AUSF向AMF发送Kseaf和SUPI,AMF从AUSF接收Kseaf和SUPI。S407. AUSF sends Kseaf and SUPI to AMF, and AMF receives Kseaf and SUPI from AUSF.
可选的,AUSF还向AMF发送indicator2,AMF从AUSF接收该indicator2。Optionally, AUSF also sends indicator2 to AMF, and AMF receives this indicator2 from AUSF.
S408、AMF向UDM发送请求消息(request),请求获得UE的签约信息。S408. The AMF sends a request message (request) to the UDM to request the subscription information of the UE.
S409、UDM向AMF发送响应(response),AMF从UDM接收该响应。S409. The UDM sends a response (response) to the AMF, and the AMF receives the response from the UDM.
该响应中携带该第一终端的签约数据。The response carries the subscription data of the first terminal.
可选的,AMF判断是否允许该第一终端使用该终端与终端之间通信的业务。例如, AMF可以根据该第一终端的签约数据和indicator1,判断是否允许该第一终端使用该终端与终端之间通信的业务。可选的,AMF根据该第一终端的签约数据,以及应用ID和/或业务的类型判断是否允许该第一终端使用终端与终端之间通信的业务。Optionally, the AMF determines whether to allow the first terminal to use the service of communication between the terminal and the terminal. For example, the AMF may determine whether to allow the first terminal to use the service of communication between the terminal and the terminal according to the subscription data of the first terminal and the indicator1. Optionally, the AMF judges whether to allow the first terminal to use the service of communication between the terminal and the terminal according to the subscription data of the first terminal, and the application ID and/or the type of the service.
如上所述,判断是否允许该第一终端使用该终端与终端之间通信的业务,该操作可能由UDM执行,也可能由AMF来执行。As described above, to determine whether the first terminal is allowed to use the service of communication between the terminal and the terminal, this operation may be performed by UDM or AMF.
不管是AMF执行该判断还是UDM执行该判断,如果确定该第一终端被允许使用该终端与终端之间通信的业务,则后续步骤可能分为以下几种可能性。Regardless of whether the AMF performs the judgment or the UDM performs the judgment, if it is determined that the first terminal is allowed to use the service of communication between the terminal and the terminal, the subsequent steps may be divided into the following possibilities.
其他可能性,上述认证流程为可选的。也可以为UE已认证并注册到5G网络。此时UE仅发起注册流程,或者其他NAS请求;请求从网络获得第一终端的标识,用于端到端之间通信。AMF接收到UE的请求之后,则执行以下可能性。可选的,AMF根据签约信息确定UE允许使用终端与终端之间通信的业务。For other possibilities, the above authentication process is optional. It can also be that the UE has been authenticated and registered to the 5G network. At this time, the UE only initiates a registration process, or other NAS request; requests to obtain the identity of the first terminal from the network for end-to-end communication. After the AMF receives the UE's request, the following possibilities are performed. Optionally, the AMF determines, according to the subscription information, that the UE is allowed to use the service of the communication between the terminal and the terminal.
第一种可能性:The first possibility:
S410a、AMF生成第一终端的标识(UE ID)和/或密钥指示。S410a. The AMF generates an identification (UE ID) and/or key indication of the first terminal.
这里UE ID为第一终端的临时标识,可以包括AMF的位置或名称信息。例如第一终端的临时标识可以包括以下至少一项:AMF所在的网络标识、AMF所在的MNC、AMF所在的MCC、AMF所在的区域地址、AMF所在的群组ID、AMF所在的集合地址、AMF的指针、AMF的IP地址、完整的域名(fully qualified domain name,FQDN)、实例(instance)ID、NAI地址。以使第一终端可以通过该第一终端的临时标识找到为该第一终端服务的AMF。密钥指示可以用来表示当前第一终端认证中的AMF key(Kamf)。例如上文所述的实施例中的AMF key(Kamf)。Here, the UE ID is the temporary identification of the first terminal, which may include the location or name information of the AMF. For example, the temporary identification of the first terminal may include at least one of the following: network identification where AMF is located, MNC where AMF is located, MCC where AMF is located, area address where AMF is located, group ID where AMF is located, set address where AMF is located, AMF Pointer, AMF IP address, fully qualified domain name (FQDN), instance ID, NAI address. In this way, the first terminal can find the AMF serving the first terminal through the temporary identity of the first terminal. The key indication can be used to indicate the AMF key (Kamf) in the current first terminal authentication. For example, the AMF key (Kamf) in the above-mentioned embodiment.
S411a、AMF向第一终端发送生成的第一终端的标识,第一终端从AMF接收该第一终端的标识。S411a. The AMF sends the generated identification of the first terminal to the first terminal, and the first terminal receives the identification of the first terminal from the AMF.
AMF还可以向第一终端发送该密钥指示。第一终端从AMF接收该密钥指示。The AMF can also send the key indication to the first terminal. The first terminal receives the key indication from the AMF.
上述流程还可能,AMF和UE根据AMF key推衍得到基础密钥。这里密钥指示用来指示此基础密钥。基础密钥的推衍不做限制。例如,推衍参数可以包括,以下至少一项,端到端通信标识,UE发送的业务类型,应用标识等。The above process is also possible, the AMF and the UE derive the basic key according to the AMF key. Here the key indication is used to indicate this basic key. The derivation of the basic key is not restricted. For example, the derived parameters may include at least one of the following, end-to-end communication identification, service type sent by the UE, application identification, etc.
第二种可能性:The second possibility:
S410b、AMF向基站发送指示(记为indicator3),基站从AMF接收该指示。S410b. The AMF sends an indication (denoted as indicator3) to the base station, and the base station receives the indication from the AMF.
该indicator3用于指示基站为该第一终端分配第一终端的临时标识和/或密钥指示。The indicator3 is used to instruct the base station to allocate the temporary identity and/or key indication of the first terminal to the first terminal.
AMF也会生成基站密钥,并向基站发送该基站密钥。AMF will also generate the base station key and send the base station key to the base station.
S411b、基站生成第一终端的标识(UE ID)和/或密钥指示。S411b: The base station generates an identification (UE ID) and/or key indication of the first terminal.
这里第一终端的标识为第一终端的临时标识,可以包括基站的位置或名称信息。例如第一终端的标识包括以下的至少一项:基站所在的网络标识,基站所在的MNC,基站所在的MCC;基站所在的区域地址;基站所在的群组ID;基站所在的集合地址;基站的指针;基站的IP地址,FQDN,instance ID,NAI地址等。第一终端可以通过第一终端的标识找到为第一终端服务的基站。密钥指示可以用来表示当前第一终端认证中的基站key,例如上文所述的实施例中描述的gNB key(K_ gNB)。 Here, the identifier of the first terminal is the temporary identifier of the first terminal, which may include the location or name information of the base station. For example, the identity of the first terminal includes at least one of the following: the network identity where the base station is located, the MNC where the base station is located, the MCC where the base station is located; the address of the area where the base station is located; the group ID where the base station is located; the collective address where the base station is located; Pointer; the IP address of the base station, FQDN, instance ID, NAI address, etc. The first terminal can find the base station serving the first terminal through the identifier of the first terminal. The key indication may be used to indicate the base station key in the current first terminal authentication, for example, the gNB key ( K_gNB ) described in the above-mentioned embodiment.
S412b、基站向第一终端发送生成的第一终端的标识和/或密钥指示,第一终端从基站接收第一终端的标识和/或密钥指示。S412b. The base station sends the generated identification and/or key indication of the first terminal to the first terminal, and the first terminal receives the identification and/or key indication of the first terminal from the base station.
上述流程还可能,基站和UE根据gNB key推衍得到基础密钥。这里密钥指示用来指 示此基础密钥。基础密钥的推衍不做限制。例如,推衍参数可以包括,以下至少一项,端到端通信标识,UE发送的业务类型,应用标识等。The above process is also possible. The base station and the UE derive the basic key according to the gNB key. Here the key indication is used to indicate this basic key. The derivation of the basic key is not restricted. For example, the derived parameters may include at least one of the following, end-to-end communication identification, service type sent by the UE, application identification, etc.
上述第一种可能性和第二种可能性,分别介绍了由AMF和基站生成第一终端的标识和/或密钥指示的情况,下面给出第三种可能性。在第三种可能性中由AUSF生成第一终端的标识和/或密钥指示。第三种可能性可以是在UDM确定该第一终端被允许使用该终端与终端之间通信的业务之后执行的。The first possibility and the second possibility mentioned above respectively introduce the situation where the AMF and the base station generate the identity and/or key indication of the first terminal. The third possibility is given below. In the third possibility, the AUSF generates the identity and/or key indication of the first terminal. The third possibility may be executed after UDM determines that the first terminal is allowed to use the service of communication between the terminal and the terminal.
第三种可能性:The third possibility:
在S406AMF与AUSF之间执行双向认证之后,AUSF生成第一终端的标识和/或密钥指示。在S407发送给AMF。在第一终端与AMF之间建立安全连接过程中或者建立安全连接之后,AMF将从AUSF接收到的第一终端的标识和/或密钥指示发送给第一终端。这里第一终端的标识包括AUSF的位置或名称信息,例如第一终端的标识包括以下至少一项:AUSF所在的网络标识;路由指示;AUSF所在的MNC,AUSF所在的MCC;AUSF所在的区域地址;AUSF所在的群组ID;AUSF所在的集合地址;AUSF的指针;AUSF的IP地址,FQDN,instance ID,NAI地址等等。第一终端可以通过该第一终端的标识找到为第一终端服务的AUSF。密钥指示可以用来表示当前第一终端认证中的AUSF key。例如上文所述的实施例中描述的AUSF key(K_ AUSF)。 After performing mutual authentication between S406AMF and AUSF, AUSF generates the identification and/or key indication of the first terminal. Send to AMF in S407. In the process of establishing a secure connection between the first terminal and the AMF or after the secure connection is established, the AMF sends the identification and/or key indication of the first terminal received from the AUSF to the first terminal. The identity of the first terminal here includes the location or name information of the AUSF, for example, the identity of the first terminal includes at least one of the following: the network identity where the AUSF is located; routing instructions; the MNC where the AUSF is located, the MCC where the AUSF is located; the area address where the AUSF is located ; Group ID where AUSF is located; Set address where AUSF is located; AUSF pointer; AUSF's IP address, FQDN, instance ID, NAI address, etc. The first terminal can find the AUSF serving the first terminal through the identifier of the first terminal. The key indication can be used to indicate the AUSF key in the current first terminal authentication. For example, the AUSF key ( K_AUSF ) described in the above-mentioned embodiment.
上述流程还可能,AUSF和UE根据AUSF key推衍得到基础密钥。这里密钥指示用来指示此基础密钥。基础密钥的推衍不做限制。例如,推衍参数可以包括,以下至少一项,端到端通信标识,UE发送的业务类型,应用标识等。The above process is also possible. AUSF and UE derive the basic key according to the AUSF key. Here the key indication is used to indicate this basic key. The derivation of the basic key is not restricted. For example, the derived parameters may include at least one of the following, end-to-end communication identification, service type sent by the UE, application identification, etc.
在一种可能的实施方式中,若5G-GUTI更新,上述第一终端的标识也需要更新,那么可以按照上述方法执行更新的过程。In a possible implementation manner, if the 5G-GUTI is updated, and the identification of the first terminal described above also needs to be updated, the update process can be performed according to the above method.
需要说明的是,本申请实施例中所涉及的一些消息或信令的名称只是示例性的称呼,还可以称作其它名称,本申请不作限定。例如请求消息1、请求消息2、密钥请求、响应消息1、响应消息2或密钥响应等均可以称为其它名称。另外,上述是围绕车联网场景密钥协商做的描述,也可以为具体密钥协商的场景,不做限制。It should be noted that the names of some messages or signaling involved in the embodiments of the present application are only exemplary names, and may also be referred to as other names, which are not limited in the present application. For example, request message 1, request message 2, key request, response message 1, response message 2, or key response, etc. can all be called other names. In addition, the above is a description of key negotiation in the Internet of Vehicles scenario, and it can also be a specific key negotiation scenario without limitation.
上述本申请提供的实施例中,分别从第一终端、第二终端、第一NF以及第二NF之间交互的角度对本申请实施例提供的方法进行了介绍。为了实现上述本申请实施例提供的方法中的各功能,终端和NF可以包括硬件结构和/或软件模块,以硬件结构、软件模块、或硬件结构加软件模块的形式来实现上述各功能。上述各功能中的某个功能以硬件结构、软件模块、还是硬件结构加软件模块的方式来执行,取决于技术方案的特定应用和设计约束条件。In the foregoing embodiments provided in the present application, the methods provided in the embodiments of the present application are introduced from the perspective of interaction between the first terminal, the second terminal, the first NF, and the second NF respectively. In order to realize each function in the method provided in the above embodiments of the present application, the terminal and the NF may include a hardware structure and/or software module, and the above functions are implemented in the form of a hardware structure, a software module, or a hardware structure plus a software module. Whether a certain function of the above-mentioned functions is executed by a hardware structure, a software module, or a hardware structure plus a software module depends on the specific application and design constraint conditions of the technical solution.
如图5所示,基于同一技术构思,本申请实施例还提供了一种装置500,该装置500可以是第一终端、第二终端或第一NF,也可以是第一终端、第二终端或第一NF中的装置,或者是能够和第一终端、第二终端或第一NF匹配使用的装置。一种设计中,该装置500可以包括执行上述方法实施例中第一终端、第二终端或第一NF执行的方法/操作/步骤/动作所一一对应的模块,该模块可以是硬件电路,也可是软件,也可以是硬件电路结合软件实现。一种设计中,该装置可以包括处理模块501和通信模块502。As shown in FIG. 5, based on the same technical concept, an embodiment of the present application further provides an apparatus 500. The apparatus 500 may be a first terminal, a second terminal, or a first NF, or a first terminal or a second terminal. Or a device in the first NF, or a device that can be matched and used with the first terminal, the second terminal, or the first NF. In one design, the device 500 may include a one-to-one corresponding module for executing the method/operation/step/action performed by the first terminal, the second terminal or the first NF in the above method embodiment, and the module may be a hardware circuit, It can also be implemented by software, or a combination of hardware circuits and software. In one design, the device may include a processing module 501 and a communication module 502.
当用于执行第一终端执行的方法时:When used to execute the method executed by the first terminal:
通信模块502,用于向第二终端发送通信请求,通信请求用于请求与第二终端建立通信,通信请求包括第一终端的标识和业务的标识。The communication module 502 is configured to send a communication request to the second terminal. The communication request is used to request the establishment of communication with the second terminal. The communication request includes the identity of the first terminal and the identity of the service.
该通信模块502,还用于从第二终端接收通信响应;通信响应用于响应通信请求;The communication module 502 is also used to receive a communication response from the second terminal; the communication response is used to respond to a communication request;
处理模块501,用于根据共享密钥和业务的标识,确定第一安全密钥;其中,第一安全密钥为第一终端与第二终端之间通信保护的安全密钥。The processing module 501 is configured to determine a first security key according to the shared key and the service identifier; where the first security key is a security key for communication protection between the first terminal and the second terminal.
当用于执行第二终端执行的方法时:When used to execute the method executed by the second terminal:
通信模块502,用于从第一终端接收通信请求,通信请求包括第一终端的标识ID和业务的标识;The communication module 502 is configured to receive a communication request from the first terminal, the communication request including the identification ID of the first terminal and the identification of the service;
处理模块501,用于根据共享密钥和业务的标识,确定第一安全密钥;其中,第一安全密钥为第一终端与第二终端之间通信保护的安全密钥;The processing module 501 is configured to determine a first security key according to the shared key and the service identifier; where the first security key is a security key for communication protection between the first terminal and the second terminal;
通信模块502,还用于根据通信请求,向第一终端返回通信响应。The communication module 502 is further configured to return a communication response to the first terminal according to the communication request.
当用于执行第一NF执行的方法时:When used to execute the method executed by the first NF:
通信模块502,用于接收密钥请求,密钥请求是第二终端发送的,或者,密钥请求是第二终端通过第二NF发送的,密钥请求包括第一终端的标识;The communication module 502 is configured to receive a key request, the key request is sent by the second terminal, or the key request is sent by the second terminal through the second NF, and the key request includes the identity of the first terminal;
处理模块501,用于根据第一终端的标识,确定共享密钥;The processing module 501 is configured to determine a shared key according to the identity of the first terminal;
通信模块502还用于向第二终端发送共享密钥,或者,还用于通过第二NF向第二终端发送共享密钥。The communication module 502 is also configured to send the shared key to the second terminal, or, is also configured to send the shared key to the second terminal through the second NF.
处理模块501和通信模块502还可以用于执行上述方法实施例第一终端、第二终端或第一NF执行的其它对应的步骤或操作,在此不再一一赘述。The processing module 501 and the communication module 502 may also be used to perform other corresponding steps or operations performed by the first terminal, the second terminal, or the first NF in the foregoing method embodiment, which will not be repeated here.
本申请实施例中对模块的划分是示意性的,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,另外,在本申请各个实施例中的各功能模块可以集成在一个处理器中,也可以是单独物理存在,也可以两个或两个以上模块集成在一个模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。The division of modules in the embodiments of this application is illustrative, and it is only a logical function division. In actual implementation, there may be other division methods. In addition, the functional modules in the various embodiments of this application can be integrated into one process. In the device, it can also exist alone physically, or two or more modules can be integrated into one module. The above-mentioned integrated modules can be implemented in the form of hardware or software function modules.
如图6所示为本申请实施例提供的装置600,用于实现上述方法中第一终端、第二终端或第一NF的功能。该装置600可以是第一终端、第二终端或第一NF,也可以是第一终端、第二终端或第一NF中的装置,或者是能够和第一终端、第二终端或第一NF匹配使用的装置。As shown in FIG. 6, an apparatus 600 provided in an embodiment of this application is used to implement the functions of the first terminal, the second terminal, or the first NF in the foregoing method. The device 600 may be the first terminal, the second terminal, or the first NF, or may be the first terminal, the second terminal, or the device in the first NF, or may be able to communicate with the first terminal, the second terminal, or the first NF. Match the device used.
其中,该装置可以为芯片系统。本申请实施例中,芯片系统可以由芯片构成,也可以包含芯片和其他分立器件。装置600包括至少一个处理器620,用于实现本申请实施例提供的方法中第一终端、第二终端或第一NF的功能。装置600还可以包括通信接口610。Among them, the device may be a chip system. In the embodiments of the present application, the chip system may be composed of chips, or may include chips and other discrete devices. The apparatus 600 includes at least one processor 620, configured to implement the functions of the first terminal, the second terminal, or the first NF in the method provided in the embodiment of the present application. The device 600 may also include a communication interface 610.
在本申请实施例中,通信接口可以是收发器、电路、总线、模块或其它类型的通信接口,用于通过传输介质和其它设备进行通信。例如,通信接口610用于装置600中的装置可以和其它设备进行通信。In the embodiment of the present application, the communication interface may be a transceiver, a circuit, a bus, a module, or other types of communication interfaces, which are used to communicate with other devices through a transmission medium. For example, the communication interface 610 is used for the device in the device 600 to communicate with other devices.
示例性地,装置600是第一终端时,该其它设备可以是第二终端。装置600是第二终端时,该其它装置可以是第一终端或第一NF。装置600是第一NF时,该其它设备可以是第二终端或第二NF。处理器620利用通信接口610收发数据,并用于实现上述方法实施例所述的方法。Exemplarily, when the apparatus 600 is the first terminal, the other device may be the second terminal. When the device 600 is the second terminal, the other device may be the first terminal or the first NF. When the apparatus 600 is the first NF, the other device may be the second terminal or the second NF. The processor 620 uses the communication interface 610 to send and receive data, and is used to implement the method described in the foregoing method embodiment.
示例性地,当实现第一终端的功能时,通信接口610用于向第二终端发送通信请求,通信请求用于请求与第二终端建立通信,通信请求包括第一终端的标识和业务的标识。通信接口610还用于从第二终端接收通信响应;通信响应用于响应通信请求。处理器620用于根据共享密钥和业务的标识,确定第一安全密钥;其中,第一安全密钥为第一终端与第二终端之间通信保护的安全密钥。Exemplarily, when the function of the first terminal is implemented, the communication interface 610 is used to send a communication request to the second terminal. The communication request is used to request to establish communication with the second terminal. The communication request includes the identity of the first terminal and the identity of the service. . The communication interface 610 is also used to receive a communication response from the second terminal; the communication response is used to respond to a communication request. The processor 620 is configured to determine a first security key according to the shared key and the service identifier; where the first security key is a security key for communication protection between the first terminal and the second terminal.
当实现第二终端的功能时,通信接口610用于从第一终端接收通信请求,通信请求包括第一终端的标识ID和业务的标识;处理器620用于根据共享密钥和业务的标识,确定第一安全密钥;其中,第一安全密钥为第一终端与第二终端之间通信保护的安全密钥;通信接口610还用于根据通信请求,向第一终端返回通信响应。When the function of the second terminal is implemented, the communication interface 610 is used to receive a communication request from the first terminal, the communication request includes the identification ID of the first terminal and the identification of the service; the processor 620 is used to, according to the shared key and the identification of the service, Determine the first security key; where the first security key is a security key for communication protection between the first terminal and the second terminal; the communication interface 610 is also used to return a communication response to the first terminal according to the communication request.
当实现第一NF的功能时,通信接口610用于接收密钥请求,密钥请求是第二终端发送的,或者,密钥请求是第二终端通过第二NF发送的,密钥请求包括第一终端的标识;处理器620,用于根据第一终端的标识,确定共享密钥;通信接口610还用于向第二终端发送共享密钥,或者,还用于通过第二NF向第二终端发送共享密钥。When the function of the first NF is implemented, the communication interface 610 is used to receive a key request, which is sent by the second terminal, or the key request is sent by the second terminal through the second NF, and the key request includes the first The identifier of a terminal; the processor 620 is configured to determine the shared key according to the identifier of the first terminal; the communication interface 610 is also configured to send the shared key to the second terminal, or is also configured to send the shared key to the second terminal through the second NF The terminal sends the shared key.
处理器620和通信接口610还可以用于执行上述方法实施例第一终端、第二终端或第一NF执行的其它对应的步骤或操作,在此不再一一赘述。The processor 620 and the communication interface 610 may also be used to execute other corresponding steps or operations performed by the first terminal, the second terminal, or the first NF in the foregoing method embodiment, which will not be repeated here.
装置600还可以包括至少一个存储器630,用于存储程序指令和/或数据。存储器630和处理器620耦合。本申请实施例中的耦合是装置、单元或模块之间的间接耦合或通信连接,可以是电性,机械或其它的形式,用于装置、单元或模块之间的信息交互。处理器620可能和存储器630协同操作。处理器620可能执行存储器630中存储的程序指令。所述至少一个存储器中的至少一个可以包括于处理器中。The device 600 may further include at least one memory 630 for storing program instructions and/or data. The memory 630 and the processor 620 are coupled. The coupling in the embodiments of the present application is an indirect coupling or communication connection between devices, units or modules, and may be in electrical, mechanical or other forms, and is used for information exchange between devices, units or modules. The processor 620 may cooperate with the memory 630 to operate. The processor 620 may execute program instructions stored in the memory 630. At least one of the at least one memory may be included in the processor.
本申请实施例中不限定上述通信接口610、处理器620以及存储器630之间的具体连接介质。本申请实施例在图6中以存储器630、通信接口620以及收发器610之间通过总线640连接,总线在图6中以粗线表示,其它部件之间的连接方式,仅是进行示意性说明,并不引以为限。所述总线可以分为地址总线、数据总线、控制总线等。为便于表示,图6中仅用一条粗线表示,但并不表示仅有一根总线或一种类型的总线。The specific connection medium between the aforementioned communication interface 610, the processor 620, and the memory 630 is not limited in the embodiment of the present application. In the embodiment of the present application, the memory 630, the communication interface 620, and the transceiver 610 are connected by a bus 640 in FIG. 6. The bus is represented by a thick line in FIG. 6, and the connection mode between other components is only for schematic illustration. , Is not limited. The bus can be divided into an address bus, a data bus, a control bus, and so on. For ease of representation, only one thick line is used in FIG. 6, but it does not mean that there is only one bus or one type of bus.
在本申请实施例中,处理器可以是通用处理器、数字信号处理器、专用集成电路、现场可编程门阵列或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件,可以实现或者执行本申请实施例中的公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者任何常规的处理器等。结合本申请实施例所公开的方法的步骤可以直接体现为硬件处理器执行完成,或者用处理器中的硬件及软件模块组合执行完成。In the embodiments of the present application, the processor may be a general-purpose processor, a digital signal processor, an application specific integrated circuit, a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, or a discrete hardware component, which may implement or Perform the methods, steps, and logical block diagrams disclosed in the embodiments of the present application. The general-purpose processor may be a microprocessor or any conventional processor or the like. The steps of the method disclosed in the embodiments of the present application may be directly embodied as being executed and completed by a hardware processor, or executed and completed by a combination of hardware and software modules in the processor.
在本申请实施例中,存储器可以是非易失性存储器,比如硬盘(hard disk drive,HDD)或固态硬盘(solid-state drive,SSD)等,还可以是易失性存储器(volatile memory),例如随机存取存储器(random-access memory,RAM)。存储器是能够用于携带或存储具有指令或数据结构形式的期望的程序代码并能够由计算机存取的任何其他介质,但不限于此。本申请实施例中的存储器还可以是电路或者其它任意能够实现存储功能的装置,用于存储程序指令和/或数据。In the embodiment of the present application, the memory may be a non-volatile memory, such as a hard disk drive (HDD) or a solid-state drive (SSD), etc., or a volatile memory (volatile memory), for example Random-access memory (random-access memory, RAM). The memory is any other medium that can be used to carry or store desired program codes in the form of instructions or data structures and that can be accessed by a computer, but is not limited to this. The memory in the embodiments of the present application may also be a circuit or any other device capable of realizing a storage function for storing program instructions and/or data.
在本申请上述实施例提供的方法中,所描述的第一终端、第二终端、第一NF或第二NF所执行的操作和功能中的部分或全部,可以用芯片或集成电路来完成。In the method provided in the foregoing embodiments of the present application, part or all of the operations and functions performed by the first terminal, the second terminal, the first NF, or the second NF described can be completed by a chip or an integrated circuit.
为了实现上述图5或图6所述的装置的功能,本申请实施例还提供一种芯片,该芯片包括处理器,用于支持该装置实现上述方法实施例中第一终端、第二终端、第一NF或第二NF所涉及的功能。在一种可能的设计中,该芯片与存储器连接或者该芯片包括存储器,该存储器用于保存该装置必要的程序指令和数据。In order to realize the functions of the device described in FIG. 5 or FIG. 6, an embodiment of the present application further provides a chip including a processor for supporting the device to implement the first terminal, the second terminal, and the first terminal, the second terminal, and the first terminal in the foregoing method embodiment. The function involved in the first NF or the second NF. In a possible design, the chip is connected to a memory or the chip includes a memory, and the memory is used to store the necessary program instructions and data of the device.
本申请实施例提供了一种计算机存储介质,存储有计算机程序,该计算机程序包括用于执行上述实施例提供的方法实施例的指令。The embodiment of the present application provides a computer storage medium storing a computer program, and the computer program includes instructions for executing the method embodiments provided in the foregoing embodiments.
本申请实施例提供了一种包含指令的计算机程序产品,当其在计算机上运行时,使得 计算机执行上述实施例提供的方法实施例。The embodiments of the present application provide a computer program product containing instructions, which when run on a computer, cause the computer to execute the method embodiments provided in the foregoing embodiments.
基于同一技术构思,本申请实施例还提供一种通信系统。如图7所示,通信系统包括第一终端701、第二终端702和第一NF703中的至少一个。第一NF可能是接入网设备,例如基站,也可能是核心网设备,例如AMF。其中:Based on the same technical concept, the embodiment of the present application also provides a communication system. As shown in FIG. 7, the communication system includes at least one of a first terminal 701, a second terminal 702, and a first NF703. The first NF may be an access network device, such as a base station, or a core network device, such as AMF. among them:
第一终端701向第二终端702发送通信请求,第二终端702从第一终端701接收通信请求。该通信请求用于第一终端701请求与第二终端702建立通信,该通信请求包括第一终端701的标识和业务的标识;The first terminal 701 sends a communication request to the second terminal 702, and the second terminal 702 receives the communication request from the first terminal 701. The communication request is used by the first terminal 701 to request to establish communication with the second terminal 702, and the communication request includes the identity of the first terminal 701 and the identity of the service;
第二终端702根据共享密钥和该业务的标识,确定第一安全密钥;其中,第一安全密钥为第一终端与所述第二终端之间通信保护的安全密钥。The second terminal 702 determines the first security key according to the shared key and the identifier of the service; where the first security key is a security key for communication protection between the first terminal and the second terminal.
第二终端702根据通信请求,向第一终端701返回通信响应。第一终端701从第二终端702接收通信响应。该通信响应用于响应该通信请求。The second terminal 702 returns a communication response to the first terminal 701 according to the communication request. The first terminal 701 receives the communication response from the second terminal 702. The communication response is used to respond to the communication request.
第一终端701根据共享密钥和该业务的标识,确定安全密钥,这里第一终端701所确定的安全密钥也是第一终端701与第二终端702之间通信保护的安全密钥,且与上述第一安全密钥相同,也可以记为第一安全密钥。The first terminal 701 determines the security key according to the shared key and the identifier of the service, where the security key determined by the first terminal 701 is also the security key for communication protection between the first terminal 701 and the second terminal 702, and The same as the above-mentioned first security key, it can also be recorded as the first security key.
可选的,第二终端702根据第一终端701的标识,判断第一终端701和第二终端702是否属于同一网络。Optionally, the second terminal 702 determines whether the first terminal 701 and the second terminal 702 belong to the same network according to the identity of the first terminal 701.
若第二终端702确定第一终端701和第二终端702属于同一网络,则第二终端702向第一网络功能NF703发送请求消息,所述请求消息用于请求共享密钥。If the second terminal 702 determines that the first terminal 701 and the second terminal 702 belong to the same network, the second terminal 702 sends a request message to the first network function NF703, and the request message is used to request a shared key.
第一网络功能NF703接收请求消息,该请求消息可以称为密钥请求,密钥请求是第二终端发送的,或者,该通信系统还包括第二NF,该密钥请求是第二终端通过第二NF发送的,密钥请求包括第一终端的标识;The first network function NF703 receives the request message. The request message may be called a key request. The key request is sent by the second terminal. Alternatively, the communication system may also include a second NF. The key request is for the second terminal to pass the second terminal. Second, sent by the NF, the key request includes the identity of the first terminal;
第一NF703根据第一终端的标识,确定共享密钥;The first NF703 determines the shared key according to the identity of the first terminal;
第一NF703向第二终端发送共享密钥,或者,第一NF703通过第二NF向第二终端发送共享密钥。The first NF703 sends the shared key to the second terminal, or the first NF703 sends the shared key to the second terminal through the second NF.
可选的,第一终端701还可以执行上述方法实施例中第一终端所执行的其它操作。第二终端702还可以执行上述方法实施例中第二终端所执行的其它操作。第一NF703可以执行上述方法实施例中第一NF703所执行的其它操作。第二NF可以执行上述方法实施例中第二NF所执行的其它操作。Optionally, the first terminal 701 may also perform other operations performed by the first terminal in the foregoing method embodiment. The second terminal 702 may also perform other operations performed by the second terminal in the foregoing method embodiment. The first NF703 can perform other operations performed by the first NF703 in the foregoing method embodiment. The second NF may perform other operations performed by the second NF in the foregoing method embodiment.
该通信系统包括的第一终端701、第二终端702或第一NF703均可以是上述图5所示的装置,当然,该通信系统包括的第一终端701、第二终端702或第一NF703均可以是上述图6所示的装置。The first terminal 701, the second terminal 702, or the first NF703 included in the communication system may all be the devices shown in FIG. 5. Of course, the first terminal 701, the second terminal 702, or the first NF703 included in the communication system are all It may be the device shown in FIG. 6 described above.
本领域内的技术人员应明白,本申请的实施例可提供为方法、系统、或计算机程序产品。因此,本申请可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本申请可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。Those skilled in the art should understand that the embodiments of the present application can be provided as methods, systems, or computer program products. Therefore, this application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, this application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
本申请是参照根据本申请实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器 以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。This application is described with reference to flowcharts and/or block diagrams of methods, devices (systems), and computer program products according to embodiments of this application. It should be understood that each process and/or block in the flowchart and/or block diagram, and the combination of processes and/or blocks in the flowchart and/or block diagram can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing equipment to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing equipment are generated It is a device that realizes the functions specified in one process or multiple processes in the flowchart and/or one block or multiple blocks in the block diagram.
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing equipment to work in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including the instruction device. The device implements the functions specified in one process or multiple processes in the flowchart and/or one block or multiple blocks in the block diagram.
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions can also be loaded on a computer or other programmable data processing equipment, so that a series of operation steps are executed on the computer or other programmable equipment to produce computer-implemented processing, so as to execute on the computer or other programmable equipment. The instructions provide steps for implementing the functions specified in one process or multiple processes in the flowchart and/or one block or multiple blocks in the block diagram.
尽管已描述了本申请的优选实施例,但本领域内的技术人员一旦得知了基本创造性概念,则可对这些实施例作出另外的变更和修改。所以,所附权利要求意欲解释为包括优选实施例以及落入本申请范围的所有变更和修改。Although the preferred embodiments of the present application have been described, those skilled in the art can make additional changes and modifications to these embodiments once they learn the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications falling within the scope of the present application.
显然,本领域的技术人员可以对本申请实施例进行各种改动和变型而不脱离本申请实施例的精神和范围。这样,倘若本申请实施例的这些修改和变型属于本申请权利要求及其等同技术的范围之内,则本申请也意图包含这些改动和变型在内。Obviously, those skilled in the art can make various changes and modifications to the embodiments of the present application without departing from the spirit and scope of the embodiments of the present application. In this way, if these modifications and variations of the embodiments of the present application fall within the scope of the claims of the present application and their equivalent technologies, the present application is also intended to include these modifications and variations.

Claims (32)

  1. 一种密钥生成方法,其特征在于,包括:A method for generating a key, characterized in that it comprises:
    第一终端向第二终端发送通信请求,所述通信请求用于请求与所述第二终端建立通信,所述通信请求包括所述第一终端的标识和业务的标识;The first terminal sends a communication request to the second terminal, where the communication request is used to request to establish communication with the second terminal, and the communication request includes the identity of the first terminal and the identity of the service;
    所述第一终端从所述第二终端接收通信响应;所述通信响应用于响应所述通信请求;The first terminal receives a communication response from the second terminal; the communication response is used to respond to the communication request;
    所述第一终端根据共享密钥和所述业务的标识,确定第一安全密钥;其中,所述第一安全密钥为所述第一终端与所述第二终端之间通信保护的安全密钥。The first terminal determines the first security key according to the shared key and the service identifier; wherein, the first security key is the security of communication protection between the first terminal and the second terminal Key.
  2. 如权利要求1所述的方法,其特征在于,所述通信请求还包括以下一种或多种信息:所述共享密钥的标识、业务的类型、所述第一终端的层2标识、所述第二终端的层2标识数据无线承载DRB的标识、数据流flow的标识、所述第一终端的PC5单播链接的标识或终端到终端通信群组的标识。The method according to claim 1, wherein the communication request further includes one or more of the following information: the identity of the shared key, the type of service, the layer 2 identity of the first terminal, the The layer 2 identifier of the second terminal identifies the data radio bearer DRB identifier, the identifier of the data flow flow, the identifier of the PC5 unicast link of the first terminal, or the terminal-to-terminal communication group identifier.
  3. 如权利要求2所述的方法,其特征在于,所述第一终端根据共享密钥和所述业务的标识,确定第一安全密钥,包括:The method according to claim 2, wherein the first terminal determining the first security key according to the shared key and the service identifier comprises:
    所述第一终端根据共享密钥、所述业务的标识和所述通信请求中包括的所述一种或多种信息,确定第一安全密钥。The first terminal determines the first security key according to the shared key, the identifier of the service, and the one or more types of information included in the communication request.
  4. 如权利要求1~3任一项所述的方法,其特征在于,所述通信请求中还包括第一消息验证码MAC和/或第一指示,所述第一MAC用于校验所述通信请求是否为合法请求,所述第一指示用于指示所述第二终端通过应用层获取所述共享密钥或者通过运营商网络获取所述共享密钥。The method according to any one of claims 1 to 3, wherein the communication request further includes a first message verification code MAC and/or a first indication, and the first MAC is used to verify the communication Whether the request is a legal request, the first indication is used to instruct the second terminal to obtain the shared key through an application layer or obtain the shared key through an operator network.
  5. 如权利要求1~4任一项所述的方法,其特征在于,所述通信响应中携带第二指示,所述第二指示用于指示所述第一终端通过应用层获取所述共享密钥或者通过运营商网络获取所述共享密钥。The method according to any one of claims 1 to 4, wherein the communication response carries a second indication, and the second indication is used to instruct the first terminal to obtain the shared key through an application layer Or obtain the shared key through the operator's network.
  6. 如权利要求1~5任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 1 to 5, wherein the method further comprises:
    所述第一终端向网络设备发送注册请求,所述注册请求用于请求注册所述第一终端的标识,所述注册请求中包括第三指示,所述第三指示用于指示所述第一终端请求使用终端与终端之间通信的业务;The first terminal sends a registration request to the network device, the registration request is used to request to register the identity of the first terminal, the registration request includes a third indication, and the third indication is used to indicate the first The terminal requests to use the service of communication between the terminal and the terminal;
    所述第一终端从所述网络设备接收所述第一终端的标识。The first terminal receives the identifier of the first terminal from the network device.
  7. 一种密钥生成方法,其特征在于,包括:A method for generating a key, characterized in that it comprises:
    第二终端从第一终端接收通信请求,所述通信请求包括所述第一终端的标识ID和业务的标识;The second terminal receives a communication request from the first terminal, where the communication request includes the identification ID of the first terminal and the identification of the service;
    所述第二终端根据共享密钥和所述业务的标识,确定第一安全密钥;其中,所述第一安全密钥为所述第一终端与所述第二终端之间通信保护的安全密钥;The second terminal determines the first security key according to the shared key and the service identifier; wherein, the first security key is the security of communication protection between the first terminal and the second terminal Key
    所述第二终端根据所述通信请求,向所述第一终端返回通信响应。The second terminal returns a communication response to the first terminal according to the communication request.
  8. 如权利要求7所述的方法,其特征在于,所述通信请求还包括以下一种或多种信息:所述共享密钥的标识、业务的类型、所述第一终端的层2标识、所述第二终端的层2标识、数据无线承载DRB的标识、数据流flow的标识、所述第一终端的PC5单播链接的标识或终端到终端通信群组的标识。The method according to claim 7, wherein the communication request further includes one or more of the following information: the identity of the shared key, the type of service, the layer 2 identity of the first terminal, the The layer 2 identification of the second terminal, the identification of the data radio bearer DRB, the identification of the data flow, the identification of the PC5 unicast link of the first terminal, or the identification of the terminal-to-terminal communication group.
  9. 如权利要求8所述的方法,其特征在于,所述第二终端根据共享密钥和所述业务 的标识,确定第一安全密钥,包括:The method according to claim 8, wherein the second terminal determining the first security key according to the shared key and the service identifier comprises:
    所述第二终端根据共享密钥、所述业务的标识和所述通信请求中包括的所述一种或多种信息,确定第一安全密钥。The second terminal determines the first security key according to the shared key, the identifier of the service, and the one or more types of information included in the communication request.
  10. 如权利要求7~9任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 7-9, wherein the method further comprises:
    所述第二终端根据所述第一终端的标识,判断所述第一终端和所述第二终端是否属于同一网络;所述第二终端确定所述第一终端和所述第二终端属于同一网络,向第一网络功能NF发送请求消息,所述请求消息用于请求所述共享密钥。The second terminal determines whether the first terminal and the second terminal belong to the same network according to the identity of the first terminal; the second terminal determines that the first terminal and the second terminal belong to the same network The network sends a request message to the first network function NF, where the request message is used to request the shared key.
  11. 如权利要求10所述的方法,其特征在于,所述请求消息中包括以下至少一种信息:所述第一终端的标识、消息验证码MAC或第一指示;所述第一指示用于指示所述请求消息用于车联网通信;The method according to claim 10, wherein the request message includes at least one of the following information: an identifier of the first terminal, a message verification code (MAC) or a first indication; the first indication is used to indicate The request message is used for vehicle networking communication;
    所述第二终端从所述第一NF接收所述请求消息的响应消息,所述响应消息中包括所述共享密钥。The second terminal receives a response message of the request message from the first NF, and the response message includes the shared key.
  12. 一种密钥生成方法,其特征在于,包括:A method for generating a key, characterized in that it comprises:
    第一网络功能NF接收密钥请求,所述密钥请求是第二终端发送的,或者,所述密钥请求是所述第二终端通过第二NF发送的,所述密钥请求包括所述第一终端的标识;The first network function NF receives the key request, the key request is sent by the second terminal, or the key request is sent by the second terminal through the second NF, and the key request includes the The identity of the first terminal;
    所述第一NF根据所述第一终端的标识,确定共享密钥;The first NF determines the shared key according to the identity of the first terminal;
    所述第一NF向所述第二终端发送所述共享密钥,或者,所述第一NF通过所述第二NF向所述第二终端发送所述共享密钥。The first NF sends the shared key to the second terminal, or the first NF sends the shared key to the second terminal through the second NF.
  13. 如权利要求12所述的方法,其特征在于,所述密钥请求还包括消息验证码MAC;The method according to claim 12, wherein the key request further comprises a message verification code (MAC);
    所述方法还包括:所述第一NF校验所述MAC,确定所述MAC校验通过。The method further includes: the first NF checks the MAC, and determines that the MAC check passes.
  14. 如权利要求12或13所述的方法,其特征在于,所述密钥请求还包括以下一种或多种信息:所述共享密钥的标识、业务的标识、业务的类型、所述第一终端的层2标识、所述第二终端的层2标识、数据无线承载DRB的标识、数据流flow的标识、所述第一终端的PC5单播链接的标识或终端到终端通信群组的标识。The method according to claim 12 or 13, wherein the key request further includes one or more of the following information: the identification of the shared key, the identification of the service, the type of the service, the first The layer 2 identification of the terminal, the layer 2 identification of the second terminal, the identification of the data radio bearer DRB, the identification of the data flow, the identification of the PC5 unicast link of the first terminal or the identification of the terminal-to-terminal communication group .
  15. 如权利要求14所述的方法,其特征在于,所述第一NF根据所述第一终端的标识,确定共享密钥,包括:The method of claim 14, wherein the first NF determines the shared key according to the identity of the first terminal, comprising:
    所述第一NF根据所述第一终端的标识以及所述密钥请求中的所述一种或多种信息,确定所述共享密钥。The first NF determines the shared key according to the identification of the first terminal and the one or more types of information in the key request.
  16. 一种密钥生成装置,应用于第一终端,其特征在于,包括:A key generation device applied to a first terminal, characterized in that it comprises:
    通信模块,用于向第二终端发送通信请求,所述通信请求用于请求与所述第二终端建立通信,所述通信请求包括所述第一终端的标识和业务的标识;A communication module, configured to send a communication request to a second terminal, where the communication request is used to request to establish communication with the second terminal, and the communication request includes an identifier of the first terminal and an identifier of a service;
    所述通信模块,还用于从所述第二终端接收通信响应;所述通信响应用于响应所述通信请求;The communication module is further configured to receive a communication response from the second terminal; the communication response is used to respond to the communication request;
    处理模块,用于根据共享密钥和所述业务的标识,确定第一安全密钥;其中,所述第一安全密钥为所述第一终端与所述第二终端之间通信保护的安全密钥。The processing module is configured to determine a first security key according to the shared key and the service identifier; wherein, the first security key is the security of communication protection between the first terminal and the second terminal Key.
  17. 如权利要求16所述的装置,其特征在于,所述通信请求还包括以下一种或多种信息:所述共享密钥的标识、业务的类型、所述第一终端的层2标识、所述第二终端的层2标识数据无线承载DRB的标识、数据流flow的标识、所述第一终端的PC5单播链接的标识或终端到终端通信群组的标识。The device according to claim 16, wherein the communication request further includes one or more of the following information: the identity of the shared key, the type of service, the layer 2 identity of the first terminal, the The layer 2 identifier of the second terminal identifies the data radio bearer DRB identifier, the identifier of the data flow flow, the identifier of the PC5 unicast link of the first terminal, or the terminal-to-terminal communication group identifier.
  18. 如权利要求17所述的装置,其特征在于,所述处理单元用于:The device according to claim 17, wherein the processing unit is configured to:
    根据共享密钥、所述业务的标识和所述通信请求中包括的所述一种或多种信息,确定第一安全密钥。Determine the first security key according to the shared key, the identifier of the service, and the one or more types of information included in the communication request.
  19. 如权利要求16~18任一项所述的装置,其特征在于,所述通信请求中还包括第一消息验证码MAC和/或第一指示,所述第一MAC用于校验所述通信请求是否为合法请求,所述第一指示用于指示所述第二终端通过应用层获取所述共享密钥或者通过运营商网络获取所述共享密钥。The apparatus according to any one of claims 16 to 18, wherein the communication request further includes a first message verification code MAC and/or a first indication, and the first MAC is used to verify the communication Whether the request is a legal request, the first indication is used to instruct the second terminal to obtain the shared key through an application layer or obtain the shared key through an operator network.
  20. 如权利要求16~19任一项所述的装置,其特征在于,所述通信响应中携带第二指示,所述第二指示用于指示所述第一终端通过应用层获取所述共享密钥或者通过运营商网络获取所述共享密钥。The apparatus according to any one of claims 16 to 19, wherein the communication response carries a second indication, and the second indication is used to instruct the first terminal to obtain the shared key through an application layer Or obtain the shared key through the operator's network.
  21. 如权利要求16~20任一项所述的装置,其特征在于,所述通信模块还用于:The device according to any one of claims 16 to 20, wherein the communication module is further configured to:
    向网络设备发送注册请求,所述注册请求用于请求注册所述第一终端的标识,所述注册请求中包括第三指示,所述第三指示用于指示所述第一终端请求使用终端与终端之间通信的业务;以及用于从所述网络设备接收所述第一终端的标识。Send a registration request to the network device, the registration request is used to request to register the identity of the first terminal, the registration request includes a third indication, the third indication is used to instruct the first terminal to request to use the terminal and A service for communication between terminals; and for receiving an identification of the first terminal from the network device.
  22. 一种密钥生成装置,应用于第二终端,其特征在于,包括:A key generation device applied to a second terminal, characterized in that it comprises:
    通信模块,用于从第一终端接收通信请求,所述通信请求包括所述第一终端的标识ID和业务的标识;A communication module, configured to receive a communication request from a first terminal, the communication request including the identification ID of the first terminal and the identification of the service;
    处理模块,用于根据共享密钥和所述业务的标识,确定第一安全密钥;其中,所述第一安全密钥为所述第一终端与所述第二终端之间通信保护的安全密钥;The processing module is configured to determine a first security key according to the shared key and the service identifier; wherein, the first security key is the security of communication protection between the first terminal and the second terminal Key
    所述通信模块,还用于根据所述通信请求,向所述第一终端返回通信响应。The communication module is further configured to return a communication response to the first terminal according to the communication request.
  23. 如权利要求22所述的装置,其特征在于,所述通信请求还包括以下一种或多种信息:所述共享密钥的标识、业务的类型、所述第一终端的层2标识、所述第二终端的层2标识、数据无线承载DRB的标识、数据流flow的标识、所述第一终端的PC5单播链接的标识或终端到终端通信群组的标识。The apparatus according to claim 22, wherein the communication request further includes one or more of the following information: the identity of the shared key, the type of service, the layer 2 identity of the first terminal, the The layer 2 identification of the second terminal, the identification of the data radio bearer DRB, the identification of the data flow, the identification of the PC5 unicast link of the first terminal, or the identification of the terminal-to-terminal communication group.
  24. 如权利要求23所述的装置,其特征在于,所述处理模块用于:The device of claim 23, wherein the processing module is configured to:
    根据共享密钥、所述业务的标识和所述通信请求中包括的所述一种或多种信息,确定第一安全密钥。Determine the first security key according to the shared key, the identifier of the service, and the one or more types of information included in the communication request.
  25. 如权利要求22~24任一项所述的装置,其特征在于,所述处理模块还用于:The device according to any one of claims 22 to 24, wherein the processing module is further configured to:
    根据所述第一终端的标识,判断所述第一终端和所述第二终端是否属于同一网络;确定所述第一终端和所述第二终端属于同一网络;所述通信模块还用于向第一网络功能NF发送非接入层NAS请求,所述NAS请求用于请求所述共享密钥。According to the identifier of the first terminal, determine whether the first terminal and the second terminal belong to the same network; determine whether the first terminal and the second terminal belong to the same network; the communication module is also used to The first network function NF sends a non-access stratum NAS request, and the NAS request is used to request the shared key.
  26. 如权利要求25所述的装置,其特征在于,所述NAS请求中包括以下至少一种信息:所述第一终端的标识、消息验证码MAC或第一指示;所述第一指示用于指示所述NAS请求用于车联网通信;The apparatus according to claim 25, wherein the NAS request includes at least one of the following information: an identifier of the first terminal, a message verification code (MAC), or a first indication; the first indication is used to indicate The NAS request is used for IoV communication;
    所述通信模块还用于,从所述第一NF接收NAS响应,所述NAS响应中包括所述共享密钥。The communication module is further configured to receive a NAS response from the first NF, where the NAS response includes the shared key.
  27. 一种密钥生成装置,应用于第一网络功能NF,其特征在于,包括:A key generation device applied to a first network function NF, characterized in that it includes:
    通信模块,用于接收密钥请求,所述密钥请求是第二终端发送的,或者,所述密钥请求是所述第二终端通过第二NF发送的,所述密钥请求包括所述第一终端的标识;The communication module is configured to receive a key request, the key request is sent by a second terminal, or the key request is sent by the second terminal through a second NF, and the key request includes the The identity of the first terminal;
    处理模块,用于根据所述第一终端的标识,确定共享密钥;A processing module, configured to determine a shared key according to the identifier of the first terminal;
    所述通信模块还用于向所述第二终端发送所述共享密钥,或者,还用于通过所述第二 NF向所述第二终端发送所述共享密钥。The communication module is further configured to send the shared key to the second terminal, or is further configured to send the shared key to the second terminal through the second NF.
  28. 如权利要求27所述的装置,其特征在于,所述密钥请求还包括消息验证码MAC;The device according to claim 27, wherein the key request further comprises a message verification code (MAC);
    所述处理模块还用于:校验所述MAC,确定所述MAC校验通过。The processing module is further configured to verify the MAC and determine that the MAC verification passes.
  29. 如权利要求27或28所述的装置,其特征在于,所述密钥请求还包括以下一种或多种信息:所述共享密钥的标识、业务的标识、业务的类型、所述第一终端的层2标识、所述第二终端的层2标识、数据无线承载DRB的标识、数据流flow的标识、所述第一终端的PC5单播链接的标识或终端到终端通信群组的标识。The device according to claim 27 or 28, wherein the key request further includes one or more of the following information: the identification of the shared key, the identification of the service, the type of the service, the first The layer 2 identification of the terminal, the layer 2 identification of the second terminal, the identification of the data radio bearer DRB, the identification of the data flow, the identification of the PC5 unicast link of the first terminal or the identification of the terminal-to-terminal communication group .
  30. 如权利要求29所述的装置,其特征在于,所述处理模块用于:The device of claim 29, wherein the processing module is configured to:
    根据所述第一终端的标识以及所述密钥请求中的所述一种或多种信息,确定所述共享密钥。The shared key is determined according to the identification of the first terminal and the one or more types of information in the key request.
  31. 一种通信系统,其特征在于,包括第一终端、第二终端和第一网络功能NF中的至少一项;A communication system, characterized by comprising at least one of a first terminal, a second terminal, and a first network function NF;
    其中,所述第一终端用于执行如权利要求1~6任一项所述的方法;或者,Wherein, the first terminal is used to execute the method according to any one of claims 1 to 6; or,
    所述第二终端用于执行如权利要求7~11任一项所述的方法;或者,The second terminal is used to execute the method according to any one of claims 7 to 11; or,
    所述第一NF用于执行如权利要求12~15任一项所述的方法。The first NF is used to execute the method according to any one of claims 12-15.
  32. 一种计算机可读存储介质,其特征在于,所述计算机存储介质中存储有计算机可读指令,当所述计算机可读指令在计算机上运行时,使得计算机执行如权利要求1~15任一项所述的方法。A computer-readable storage medium, wherein computer-readable instructions are stored in the computer storage medium, and when the computer-readable instructions are run on a computer, the computer can execute any one of claims 1-15. The method described.
PCT/CN2020/101713 2019-09-12 2020-07-13 Key generation method and device WO2021047276A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910864831.6 2019-09-12
CN201910864831.6A CN112491533B (en) 2019-09-12 2019-09-12 Key generation method and device

Publications (1)

Publication Number Publication Date
WO2021047276A1 true WO2021047276A1 (en) 2021-03-18

Family

ID=74866065

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/101713 WO2021047276A1 (en) 2019-09-12 2020-07-13 Key generation method and device

Country Status (2)

Country Link
CN (2) CN112491533B (en)
WO (1) WO2021047276A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023230983A1 (en) * 2022-06-02 2023-12-07 Oppo广东移动通信有限公司 Method and apparatus for establishing interoperation channel, chip, and storage medium

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115835199A (en) * 2021-09-16 2023-03-21 华为技术有限公司 Method for determining key acquisition mode, communication method and communication device
WO2023050373A1 (en) * 2021-09-30 2023-04-06 华为技术有限公司 Communication method, apparatus and system
WO2024020868A1 (en) * 2022-07-27 2024-02-01 北京小米移动软件有限公司 Key generation method and apparatus, communication device, and storage medium
WO2024065469A1 (en) * 2022-09-29 2024-04-04 北京小米移动软件有限公司 Direct-link establishment method, device and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101005359A (en) * 2006-01-18 2007-07-25 华为技术有限公司 Method and device for realizing safety communication between terminal devices
CN104917605A (en) * 2014-03-14 2015-09-16 华为技术有限公司 Key negotiation method and device during terminal device switching
CN105706474A (en) * 2013-10-30 2016-06-22 日本电气株式会社 Apparatus, system and method for secure direct communication in proximity based services
US20170366343A1 (en) * 2015-01-19 2017-12-21 Telefonaktiebolaget Lm Ericsson (Publ) Methods and apparatus for direct communication key establishment
CN107623668A (en) * 2016-07-16 2018-01-23 华为技术有限公司 A kind of method for network authorization, relevant device and system

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9119072B2 (en) * 2013-03-15 2015-08-25 Intel Corporation Method and apparatus to authenticate a personal device to access an enterprise network
US9948519B2 (en) * 2015-08-14 2018-04-17 Telefonaktiebolaget Lm Ericsson (Publ) Systems and methods for establishing a packet data network connection for a wireless communication device
CN106534050A (en) * 2015-09-11 2017-03-22 中移(杭州)信息技术有限公司 Method and device for realizing key agreement of virtual private network (VPN)
CN106535184A (en) * 2016-10-18 2017-03-22 深圳市金立通信设备有限公司 Key management method and system
CN108616354B (en) * 2018-04-27 2021-10-26 北京信息科技大学 Key negotiation method and device in mobile communication
CN109698744B (en) * 2018-12-24 2022-03-29 武汉船舶通信研究所(中国船舶重工集团公司第七二二研究所) Satellite networking session key negotiation method and device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101005359A (en) * 2006-01-18 2007-07-25 华为技术有限公司 Method and device for realizing safety communication between terminal devices
CN105706474A (en) * 2013-10-30 2016-06-22 日本电气株式会社 Apparatus, system and method for secure direct communication in proximity based services
CN104917605A (en) * 2014-03-14 2015-09-16 华为技术有限公司 Key negotiation method and device during terminal device switching
US20170366343A1 (en) * 2015-01-19 2017-12-21 Telefonaktiebolaget Lm Ericsson (Publ) Methods and apparatus for direct communication key establishment
CN107623668A (en) * 2016-07-16 2018-01-23 华为技术有限公司 A kind of method for network authorization, relevant device and system

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023230983A1 (en) * 2022-06-02 2023-12-07 Oppo广东移动通信有限公司 Method and apparatus for establishing interoperation channel, chip, and storage medium

Also Published As

Publication number Publication date
CN112491533A (en) 2021-03-12
CN112491533B (en) 2022-09-02
CN115567931A (en) 2023-01-03

Similar Documents

Publication Publication Date Title
WO2021047276A1 (en) Key generation method and device
WO2020177768A1 (en) Network verification method, apparatus, and system
EP3836577B1 (en) Session management method and device for user groups
CN110474875B (en) Discovery method and device based on service architecture
CN110830989B (en) Communication method and device
KR102398221B1 (en) Method and apparatus to identity verification using asymmetric keys in wireless direct communication network
WO2019184728A1 (en) Position determining method and device for terminal device
EP3668042A1 (en) Registration method and apparatus based on service-oriented architecture
JP6800994B2 (en) Systems and methods for relaying data over communication networks
US20200228987A1 (en) Methods providing nas connection identifications and related wireless terminals and network nodes
KR20230054421A (en) Privacy of Repeater Selection in Cellular Sliced Networks
CN111818516B (en) Authentication method, device and equipment
WO2021022406A1 (en) Identity authentication method and device
WO2019122495A1 (en) Authentication for wireless communications system
WO2021031055A1 (en) Communication method and device
CN116405193A (en) Certificate application method and equipment
CN116723507B (en) Terminal security method and device for edge network
WO2022237561A1 (en) Communication method and apparatus
WO2021237753A1 (en) Communication method and apparatus
CN110226319A (en) Method and apparatus for the parameter exchange during promptly accessing
WO2021134364A1 (en) Online subscription method and apparatus
CN116368751A (en) Message transmission method and device
WO2023050373A1 (en) Communication method, apparatus and system
CN113228722B (en) Pairing method and device
WO2022068336A1 (en) Routing information updating method, communication apparatus and storage medium

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20864062

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20864062

Country of ref document: EP

Kind code of ref document: A1