WO2023212903A1 - Relay communication method, and device - Google Patents

Relay communication method, and device Download PDF

Info

Publication number
WO2023212903A1
WO2023212903A1 PCT/CN2022/091125 CN2022091125W WO2023212903A1 WO 2023212903 A1 WO2023212903 A1 WO 2023212903A1 CN 2022091125 W CN2022091125 W CN 2022091125W WO 2023212903 A1 WO2023212903 A1 WO 2023212903A1
Authority
WO
WIPO (PCT)
Prior art keywords
terminal device
key
message
information
relay
Prior art date
Application number
PCT/CN2022/091125
Other languages
French (fr)
Chinese (zh)
Inventor
熊丽晖
甘露
曹进
任雄鹏
马如慧
李晖
Original Assignee
Oppo广东移动通信有限公司
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 Oppo广东移动通信有限公司 filed Critical Oppo广东移动通信有限公司
Priority to PCT/CN2022/091125 priority Critical patent/WO2023212903A1/en
Publication of WO2023212903A1 publication Critical patent/WO2023212903A1/en

Links

Images

Classifications

    • 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/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials

Definitions

  • Embodiments of the present application relate to the field of communications, and more specifically, to a method and device for relaying communications.
  • Embodiments of the present application provide a method and device for relay communication, which can ensure the security of terminal identities and the confidentiality and integrity of communication data, thereby ensuring the confidentiality and integrity of data transmitted by both parties and preventing other devices and even relay devices from of eavesdropping.
  • a method for relaying communication which method includes:
  • the first terminal device receives the authentication request message sent by the second terminal device through the relay device;
  • the authentication request message includes at least one of the following: information about the user to which the second terminal device belongs, information about the user to which the relay device belongs, the first temporary public key generated by the second terminal device, Signature, the signature of the relay device, and relevant information of the relay device;
  • the information of the user to which the second terminal device belongs includes the identification of the second terminal device and the PVT and KPAK of the second terminal device; the information of the user to which the relay device belongs includes the identification of the relay device and the relay device. PVT and KPAK; the input parameters of the signature of the second terminal device include at least one of the following: the information of the user to which the second terminal device belongs and the first temporary public key; the input parameters of the signature of the relay device include at least one of the following: One: the signature of the second terminal device and the information of the user to which the relay device belongs; the first temporary public key and the relevant information of the relay device are used for the first terminal device to derive the first key; the relay The relevant information of the device includes one of the following: the identity information of the relay device, the random number generated by the relay device, and the counter generated by the relay device.
  • a method for relaying communication which method includes:
  • the second terminal device sends an authentication request message to the first terminal device through the relay device;
  • the authentication request message includes at least one of the following: information about the user to which the second terminal device belongs, the first temporary public key generated by the second terminal device, the signature of the second terminal device, and relevant information about the relay device. ;
  • the information of the user to which the second terminal device belongs includes the identification of the second terminal device and the PVT and KPAK of the second terminal device;
  • the input parameters of the signature of the second terminal device include at least one of the following: the second terminal The information of the user to which the device belongs and the first temporary public key; the first temporary public key and the relevant information of the relay device are used for the first terminal device to derive the first key;
  • the relevant information of the relay device includes the following: 1: The identity information of the relay device, the random number generated by the relay device, and the counter generated by the relay device.
  • a method for relaying communication which method includes:
  • the relay device receives an authentication request message sent by the second terminal device; wherein the authentication request message includes at least one of the following: information about the user to which the second terminal device belongs, the first temporary public key generated by the second terminal device, the The signature of the second terminal device; wherein the information of the user to which the second terminal device belongs includes the identification of the second terminal device and the PVT and KPAK of the second terminal device; the input parameters of the signature of the second terminal device include at least the following: One: the information of the user to which the second terminal device belongs and the first temporary public key; the first temporary public key and the relevant information of the relay device are used by the first terminal device to derive the first key;
  • the relay device sends a message to the first terminal device.
  • the device sends an authentication request message after verification; wherein the authentication request message after verification includes at least one of the following: information about the user to which the second terminal device belongs, information about the user to which the relay device belongs, the first temporary public key, The signature of the second terminal device, the signature of the relay device, and the relevant information of the relay device; wherein the information of the user to which the relay device belongs includes the identification of the relay device and the PVT and KPAK of the relay device;
  • the input parameters of the relay device's signature include at least one of the following: the signature of the second terminal device and the information of the user to which the relay device belongs; wherein the relevant information of the relay device includes one of the following: the relay device The identity information, the random number generated by the relay device, and the counter generated by the relay device.
  • the fourth aspect provides a method for relaying communication, which method includes:
  • the first terminal device sends the first message to the second terminal device through the relay device;
  • the first message includes at least one of the following: security capability information of the first terminal device, security policy information of the first terminal device, information of the user to which the first terminal device belongs, a third message generated by the first terminal device.
  • security capability information of the first terminal device security policy information of the first terminal device
  • information of the user to which the first terminal device belongs a third message generated by the first terminal device.
  • the information of the user to which the first terminal device belongs includes the identification of the first terminal device and the PVT and KPAK of the first terminal device;
  • the input parameters of the signature of the first terminal device include at least one of the following: the first terminal Information about the user to whom the device belongs, the second temporary public key, the M bits, and the signature of the second terminal device;
  • the first message is integrity protected by the first message verification code generated based on the first key
  • the input parameters of the first message verification code include at least one of the following: the security capability of the first terminal device Information, the security policy information of the first terminal device, the information of the user to which the first terminal device belongs, the first random number, the second temporary public key, the M bits, and the signature of the first terminal device;
  • the second temporary public key and the relevant information of the relay device are used by the second terminal device to derive the first key, the first random number, the first key and the third key generated by the second terminal device.
  • Two random numbers are used to derive a second key.
  • the second key is used to derive an integrity protection key and/or a confidentiality protection key.
  • the identity of the first key is composed of the M bits and the first The other N bits of the key's identification are combined, and M and N are both positive integers;
  • the relevant information of the relay device includes one of the following: identity information of the relay device, a random number generated by the relay device, and a counter generated by the relay device.
  • the fifth aspect provides a method for relaying communication, which method includes:
  • the second terminal device receives the first message sent by the first terminal device through the relay device;
  • the first message includes at least one of the following: security capability information of the first terminal device, security policy information of the first terminal device, information of the user to which the first terminal device belongs, and information of the user to which the relay device belongs. , the first random number generated by the first terminal device, the second temporary public key generated by the first terminal device, the M bits of the identification of the first key generated by the first terminal device, the first terminal device signature, the signature of the relay device, and the first message verification code;
  • the information of the user to which the first terminal device belongs includes the identification of the first terminal device and the PVT and KPAK of the first terminal device;
  • the information of the user to which the relay device belongs includes the identification of the relay device and the relay device.
  • the input parameters of the first terminal device's signature include at least one of the following: the information of the user to which the first terminal device belongs, the second temporary public key, the M bits, the second terminal device's Signature;
  • the input parameters of the relay device's signature include at least one of the following: information about the user to which the relay device belongs, the signature of the first terminal device, the signature of the second terminal device, and the first message;
  • the first message is integrity protected by the first message verification code generated based on the first key
  • the input parameters of the first message verification code include at least one of the following: the security capability of the first terminal device Information, the security policy information of the first terminal device, the information of the user to which the first terminal device belongs, the first random number, the second temporary public key, the M bits, and the signature of the first terminal device;
  • the second temporary public key and the relevant information of the relay device are used by the second terminal device to derive the first key, the first random number, the first key and the third key generated by the second terminal device.
  • Two random numbers are used to derive a second key.
  • the second key is used to derive an integrity protection key and/or a confidentiality protection key.
  • the identity of the first key is composed of the M bits and the first The other N bits of the key's identification are combined, and M and N are both positive integers;
  • the relevant information of the relay device includes one of the following: identity information of the relay device, a random number generated by the relay device, and a counter generated by the relay device.
  • a sixth aspect provides a method for relaying communications, which method includes:
  • the relay device receives the first message sent by the first terminal device; wherein the first message includes at least one of the following: security capability information of the first terminal device, security policy information of the first terminal device, Information about the user to whom the device belongs, the first random number generated by the first terminal device, the second temporary public key generated by the first terminal device, M bits of the identification of the first key generated by the first terminal device, The signature of the first terminal device, the first message verification code; wherein the information of the user to which the first terminal device belongs includes the identification of the first terminal device and the PVT and KPAK of the first terminal device;
  • the input parameters of the signature include at least one of the following: information about the user to which the first terminal device belongs, the second temporary public key, the M bits, and the signature of the second terminal device; wherein the first message is passed based on the The first message verification code generated by the first key is integrity protected, and the input parameters of the first message verification code include at least one of the following: the security capability information of the first terminal device, the security capability of the first terminal device Policy
  • the relay device sends a request to the second terminal device.
  • the device sends the first message after verification; wherein the first message after verification includes at least one of the following: security capability information of the first terminal device, security policy information of the first terminal device, the The user's information, the information of the user to which the relay device belongs, the first random number generated by the first terminal device, the second temporary public key generated by the first terminal device and paired with the second temporary private key, the first M bits of the identification of the first key generated by the terminal device, the signature of the first terminal device, the signature of the relay device, the relevant information of the relay device, and the first message verification code; wherein, the The information of the user to which the relay device belongs includes the identification of the relay device and the PVT and KPAK of the relay device; the input parameters of the signature of the relay device include at least one of the following: the information of the
  • the second temporary public key and the relevant information of the relay device are used by the second terminal device to derive the first key, the first random number, the first key and the third key generated by the second terminal device.
  • Two random numbers are used to derive a second key.
  • the second key is used to derive an integrity protection key and/or a confidentiality protection key.
  • the identity of the first key is composed of the M bits and the first
  • the other N bits of the key's identification are combined, and M and N are both positive integers; among them, the relevant information of the relay device includes one of the following: the identity information of the relay device, the random number generated by the relay device. Count, the counter generated by this relay device.
  • a seventh aspect provides a method for relaying communications, which method includes:
  • the first terminal device sends a direct communication request to the second terminal device through the relay device;
  • the direct communication request includes at least one of the following: security capability information of the first terminal device, security policy information of the first terminal device, a first temporary public key generated by the first terminal device, The first random number generated;
  • the direct communication request is encrypted through a first encryption key, and the direct communication request is integrity protected through a first integrity protection key.
  • the first encryption key is based on the registered and authorized use of the UE-to - an encryption key derived from the symmetric key of the terminal for UE relay communication
  • the first integrity protection key is an integrity protection key derived based on the symmetric key of the terminal that has been registered and authorized to use UE-to-UE relay communication key;
  • the first temporary public key and the relevant information of the relay device are used by the second terminal device to derive the first key; the first random number, the first key and the second key generated by the second terminal device.
  • the random number is used to derive a second key
  • the second key is used to derive a second encryption key and/or a second integrity protection key, or the first random number, the first key and the
  • the second random number generated by the second terminal device is used to derive the second encryption key and/or the second integrity protection key;
  • the relevant information of the relay device includes one of the following: identity information of the relay device, a random number generated by the relay device, and a counter generated by the relay device.
  • An eighth aspect provides a method for relaying communications, which method includes:
  • the second terminal device receives the direct communication request sent by the first terminal device through the relay device;
  • the direct communication request includes at least one of the following: security capability information of the first terminal device, security policy information of the first terminal device, a first temporary public key generated by the first terminal device, The first random number generated, the identification of the relay device, and the relevant information of the relay device;
  • the direct communication request is encrypted through a first encryption key, and the direct communication request is integrity protected through a first integrity protection key.
  • the first encryption key is based on the registered and authorized use of the UE-to - an encryption key derived from the symmetric key of the terminal for UE relay communication
  • the first integrity protection key is an integrity protection key derived based on the symmetric key of the terminal that has been registered and authorized to use UE-to-UE relay communication key;
  • the relevant information of the relay device includes one of the following: the identity information of the relay device, the random number generated by the relay device, the counter generated by the relay device; the first temporary public key and the relay device.
  • the relevant information is used by the second terminal device to derive the first key; the first random number, the first key and the second random number generated by the second terminal device are used to derive the second key, and the first random number is used to derive the second key.
  • the second key is used to derive the second encryption key and/or the second integrity protection key, or the first random number, the first key and the second random number generated by the second terminal device are used to derive A second encryption key and/or a second integrity protection key.
  • a ninth aspect provides a method for relaying communications, which method includes:
  • the relay device receives a direct communication request sent by the first terminal device; wherein the direct communication request includes at least one of the following: security capability information of the first terminal device, security policy information of the first terminal device, The first temporary public key generated by the device, the first random number generated by the first terminal device; wherein the direct communication request is encrypted through the first encryption key, and the direct communication request is performed through the first integrity protection key Integrity protection, the first encryption key is an encryption key derived based on the symmetric key of the terminal that has been registered and authorized to use UE-to-UE relay communication, and the first integrity protection key is based on the registered and Integrity protection key derived from the symmetric key of the terminal authorized to use UE-to-UE relay communication;
  • the relay device verifies whether it is configured to forward the direct communication request, and after the verification is passed, the relay device uses the first encryption key to decrypt the direct communication request to obtain QoS and charging information, and the relay device uses the third An integrity protection key verifies the integrity of the direct communication request. After the verification is passed, the relay device adds the relevant information of the relay device and the identification of the relay device in the direct communication request, and the relay device Use the first encryption key to encrypt the direct communication request, and use the first integrity protection key to protect the integrity of the direct communication request;
  • the relevant information of the relay device includes one of the following: the identity information of the relay device, the random number generated by the relay device, the counter generated by the relay device; the first temporary public key and the relay device
  • the relevant information is used by the second terminal device to derive the first key; the first random number, the first key and the second random number generated by the second terminal device are used to derive the second key, and the second
  • the key is used to derive the second encryption key and/or the second integrity protection key, or the first random number, the first key and the second random number generated by the second terminal device are used to derive the second random number.
  • a tenth aspect provides a terminal device for executing the method in the first aspect.
  • the terminal device includes a functional module for executing the method in the first aspect.
  • An eleventh aspect provides a terminal device for executing the method in the above second aspect.
  • the terminal device includes a functional module for executing the method in the above second aspect.
  • a twelfth aspect provides a relay device for performing the method in the above third aspect.
  • the relay device includes a functional module for executing the method in the above third aspect.
  • a thirteenth aspect provides a terminal device for performing the method in the fourth aspect.
  • the terminal device includes a functional module for executing the method in the fourth aspect.
  • a fourteenth aspect provides a terminal device for performing the method in the fifth aspect.
  • the terminal device includes a functional module for executing the method in the fifth aspect.
  • a fifteenth aspect provides a relay device for performing the method in the above-mentioned sixth aspect.
  • the relay device includes a functional module for executing the method in the sixth aspect.
  • a sixteenth aspect provides a terminal device for performing the method in the seventh aspect.
  • the terminal device includes a functional module for executing the method in the seventh aspect.
  • a seventeenth aspect provides a terminal device for performing the method in the eighth aspect.
  • the terminal device includes a functional module for executing the method in the eighth aspect.
  • An eighteenth aspect provides a relay device for performing the method in the ninth aspect.
  • the relay device includes a functional module for executing the method in the ninth aspect.
  • a nineteenth aspect provides a terminal device, including a processor and a memory; the memory is used to store a computer program, and the processor is used to call and run the computer program stored in the memory, so that the terminal device executes the above first aspect or the method in the second aspect, or causing the terminal device to perform the method in the fourth or fifth aspect, or causing the terminal device to perform the method in the seventh or eighth aspect.
  • a relay device including a processor and a memory; the memory is used to store a computer program, and the processor is used to call and run the computer program stored in the memory, so that the relay device executes the above-mentioned
  • the method in the third aspect either causes the relay device to perform the method in the sixth aspect, or causes the relay device to perform the method in the ninth aspect.
  • a twenty-first aspect provides a device for implementing the method in any one of the above-mentioned first to ninth aspects.
  • the device includes: a processor, configured to call and run a computer program from a memory, so that a device installed with the device executes the method in any one of the above-mentioned first to ninth aspects.
  • a twenty-second aspect provides a computer-readable storage medium for storing a computer program that causes a computer to execute the method in any one of the above-mentioned first to ninth aspects.
  • a computer program product including computer program instructions that cause a computer to execute the method in any one of the above-mentioned first to ninth aspects.
  • a twenty-fourth aspect provides a computer program that, when run on a computer, causes the computer to execute the method in any one of the above-mentioned first to ninth aspects.
  • the first terminal device can generate the first key based on the authentication request message sent by the second terminal device through the relay device, and the authentication request message is protected through signature verification. . and a first random number generated by the first terminal device, a first key and a second random number generated by the second terminal device for deriving a second key, the second key being used for deriving an integrity protection key and/or
  • the confidentiality protection key can ensure the identity security of the first terminal device and the second terminal device and the confidentiality and integrity of the communication data, thereby ensuring the confidentiality and integrity of the data transmitted by both parties and preventing other devices and even relay devices from being intercepted. tapping.
  • the first random number and the first key generated by the first terminal device and the second random number generated by the second terminal device are used to derive the second key.
  • the key is used to derive the integrity protection key and/or the confidentiality protection key, which can ensure the identity security of the first terminal device and the second terminal device and the confidentiality and integrity of the communication data, thereby ensuring the confidentiality of the data transmitted by both parties. and integrity to prevent eavesdropping by other devices or even relay devices.
  • the first terminal device can generate the first key based on the direct communication request sent by the second terminal device through the relay device, and the direct communication request is performed through the first encryption key. Encryption, and direct communication requests are integrity protected via a first integrity protection key.
  • the second integrity protection key, or the first random number generated by the first terminal device, the first key and the second terminal device are used to derive the second random number to generate the second encryption key and/or the second integrity Protecting the key can ensure the identity security of the first terminal device and the second terminal device and the confidentiality and integrity of the communication data, thereby ensuring the confidentiality and integrity of the data transmitted by both parties and preventing eavesdropping by other devices and even relay devices.
  • Figure 1 is a schematic diagram of a communication system architecture applied in an embodiment of the present application.
  • Figures 2 to 4 are respectively schematic flow charts for establishing secure communication in the UE-to-UE relay scenario provided by this application.
  • Figure 5 is a schematic flow chart of UE-to-UE relay communication provided by this application.
  • Figure 6 is a schematic flow chart of another UE-to-UE relay communication provided by this application.
  • Figure 7 is a schematic flowchart of a method for relaying communications provided according to an embodiment of the present application.
  • Figure 8 is a schematic diagram of the key hierarchical structure involved in the embodiment of the present application.
  • Figure 9 is a schematic flowchart of another method of relaying communications provided according to an embodiment of the present application.
  • Figure 10 is a schematic flowchart of yet another method of relaying communication provided according to an embodiment of the present application.
  • Figure 11 is a schematic flowchart of yet another method of relaying communication provided according to an embodiment of the present application.
  • Figure 12 is a schematic flowchart of yet another method of relaying communication provided according to an embodiment of the present application.
  • Figure 13 is a schematic flowchart of yet another method of relaying communication provided according to an embodiment of the present application.
  • Figures 14 to 15 are respectively schematic flow charts for establishing secure communication in a UE-to-UE relay scenario provided by embodiments of the present application.
  • Figure 16 is a schematic flowchart of yet another method of relaying communication provided according to an embodiment of the present application.
  • Figure 17 is a schematic flowchart of yet another method of relaying communication provided according to an embodiment of the present application.
  • Figure 18 is a schematic flowchart of yet another method of relaying communication provided according to an embodiment of the present application.
  • Figures 19 to 22 are respectively schematic flow charts for establishing secure communication in a UE-to-UE relay scenario provided by embodiments of the present application.
  • FIGS 23 to 31 are respectively schematic block diagrams of terminal equipment provided according to embodiments of the present application.
  • Figure 32 is a schematic block diagram of a communication device provided according to an embodiment of the present application.
  • Figure 33 is a schematic block diagram of a device provided according to an embodiment of the present application.
  • Figure 34 is a schematic block diagram of a communication system provided according to an embodiment of the present application.
  • GSM Global System of Mobile communication
  • CDMA Code Division Multiple Access
  • WCDMA Wideband Code Division Multiple Access
  • GPRS General Packet Radio Service
  • LTE Long Term Evolution
  • LTE-A Advanced long term evolution
  • NR New Radio
  • NTN Non-Terrestrial Networks
  • UMTS Universal Mobile Telecommunication System
  • WLAN Wireless Local Area Networks
  • IoT Internet of Things
  • WiT wireless fidelity
  • 5G fifth-generation communication
  • the communication system in the embodiments of the present application can be applied to a carrier aggregation (Carrier Aggregation, CA) scenario, a dual connectivity (Dual Connectivity, DC) scenario, or a standalone (Standalone, SA) scenario. ) network deployment scenario, or applied to Non-Standalone (NSA) network deployment scenario.
  • Carrier Aggregation, CA Carrier Aggregation
  • DC Dual Connectivity
  • SA standalone
  • NSA Non-Standalone
  • the communication system in the embodiments of the present application can be applied to unlicensed spectrum, where the unlicensed spectrum can also be considered as shared spectrum; or, the communication system in the embodiments of the present application can also be applied to licensed spectrum, Among them, licensed spectrum can also be considered as unshared spectrum.
  • the communication system in the embodiment of the present application can be applied to the FR1 frequency band (corresponding to the frequency band range 410MHz to 7.125GHz), can also be applied to the FR2 frequency band (corresponding to the frequency band range 24.25GHz to 52.6GHz), and can also be applied to The new frequency band, for example, corresponds to the frequency band range of 52.6 GHz to 71 GHz or the high frequency band corresponding to the frequency band range of 71 GHz to 114.25 GHz.
  • the embodiments of this application describe various embodiments in combination with network equipment and terminal equipment.
  • the terminal equipment may also be called user equipment (User Equipment, UE), access terminal, user unit, user station, mobile station, mobile station, remote station, remote terminal, mobile device, user terminal, terminal, wireless communication equipment, user agent or user device, etc.
  • User Equipment User Equipment
  • the terminal device can be a station (STATION, ST) in the WLAN, a cellular phone, a cordless phone, a Session Initiation Protocol (Session Initiation Protocol, SIP) phone, a wireless local loop (Wireless Local Loop, WLL) station, or a personal digital assistant.
  • PDA Personal Digital Assistant
  • handheld devices with wireless communication capabilities computing devices or other processing devices connected to wireless modems, vehicle-mounted devices, wearable devices, next-generation communication systems such as terminal devices in NR networks, or in the future Terminal equipment in the evolved Public Land Mobile Network (PLMN) network, etc.
  • PLMN Public Land Mobile Network
  • the terminal device can be deployed on land, including indoor or outdoor, handheld, wearable or vehicle-mounted; it can also be deployed on water (such as ships, etc.); it can also be deployed in the air (such as aircraft, balloons and satellites). superior).
  • the terminal device may be a mobile phone (Mobile Phone), a tablet computer (Pad), a computer with a wireless transceiver function, a virtual reality (Virtual Reality, VR) terminal device, or an augmented reality (Augmented Reality, AR) terminal.
  • Equipment wireless terminal equipment in industrial control, wireless terminal equipment in self-driving, wireless terminal equipment in remote medical, wireless terminal equipment in smart grid , wireless terminal equipment in transportation safety, wireless terminal equipment in smart city (smart city) or wireless terminal equipment in smart home (smart home), vehicle-mounted communication equipment, wireless communication chip/application specific integrated circuit (ASIC)/system on chip (System on Chip, SoC), etc.
  • ASIC application specific integrated circuit
  • the terminal device may also be a wearable device.
  • Wearable devices can also be called wearable smart devices. It is a general term for applying wearable technology to intelligently design daily wear and develop wearable devices, such as glasses, gloves, watches, clothing and shoes, etc.
  • a wearable device is a portable device that is worn directly on the body or integrated into the user's clothing or accessories. Wearable devices are not just hardware devices, but also achieve powerful functions through software support, data interaction, and cloud interaction.
  • wearable smart devices include full-featured, large-sized devices that can achieve complete or partial functions without relying on smartphones, such as smart watches or smart glasses, and those that only focus on a certain type of application function and need to cooperate with other devices such as smartphones.
  • the network device may be a device used to communicate with mobile devices.
  • the network device may be an access point (Access Point, AP) in WLAN, or a base station (Base Transceiver Station, BTS) in GSM or CDMA.
  • BTS Base Transceiver Station
  • it can be a base station (NodeB, NB) in WCDMA, or an evolutionary base station (Evolutional Node B, eNB or eNodeB) in LTE, or a relay station or access point, or a vehicle-mounted device, a wearable device, and an NR network network equipment or base station (gNB) or network equipment in the future evolved PLMN network or network equipment in the NTN network, etc.
  • NodeB base station
  • gNB NR network network equipment or base station
  • the network device may have mobile characteristics, for example, the network device may be a mobile device.
  • network devices may be satellites or balloon stations.
  • the satellite can be a low earth orbit (LEO) satellite, a medium earth orbit (MEO) satellite, a geosynchronous orbit (geostationary earth orbit, GEO) satellite, a high elliptical orbit (High Elliptical Orbit, HEO) satellite ) satellite, etc.
  • the network device may also be a base station installed on land, water, or other locations.
  • network equipment can provide services for a cell, and terminal equipment communicates with the network equipment through transmission resources (for example, frequency domain resources, or spectrum resources) used by the cell.
  • the cell can be a network equipment (
  • the cell corresponding to the base station) can belong to the macro base station or the base station corresponding to the small cell (Small cell).
  • the small cell here can include: urban cell (Metro cell), micro cell (Micro cell), pico cell ( Pico cell), femto cell (Femto cell), etc. These small cells have the characteristics of small coverage and low transmission power, and are suitable for providing high-rate data transmission services.
  • the communication system 100 may include a network device 110, which may be a device that communicates with a terminal device 120 (also referred to as a communication terminal or terminal).
  • the network device 110 can provide communication coverage for a specific geographical area and can communicate with terminal devices located within the coverage area.
  • Figure 1 exemplarily shows one network device and two terminal devices.
  • the communication system 100 may include multiple network devices and other numbers of terminal devices may be included within the coverage of each network device. The embodiments of the present application do not limit this.
  • the communication system 100 may also include other network entities such as a network controller and a mobility management entity, which are not limited in the embodiments of the present application.
  • the communication device may include a network device 110 and a terminal device 120 with communication functions.
  • the network device 110 and the terminal device 120 may be the specific devices described above, which will not be described again here.
  • the communication device may also include other devices in the communication system 100, such as network controllers, mobility management entities and other network entities, which are not limited in the embodiments of this application.
  • the first communication device may be a terminal device, such as a mobile phone, a machine facility, a Customer Premise Equipment (CPE), industrial equipment, a vehicle, etc.; the second communication device The device may be a peer communication device of the first communication device, such as a network device, a mobile phone, an industrial device, a vehicle, etc.
  • CPE Customer Premise Equipment
  • This article takes the first communication device as a terminal device and the second communication device as a network device as a specific example for description.
  • the "instruction” mentioned in the embodiments of this application may be a direct instruction, an indirect instruction, or an association relationship.
  • a indicates B which can mean that A directly indicates B, for example, B can be obtained through A; it can also mean that A indirectly indicates B, for example, A indicates C, and B can be obtained through C; it can also mean that there is an association between A and B. relation.
  • correlate can mean that there is a direct correspondence or indirect correspondence between the two, it can also mean that there is an associated relationship between the two, or it can mean indicating and being instructed, configuration and being. Configuration and other relationships.
  • predefinition or “preconfiguration” can be achieved by pre-saving corresponding codes, tables or other methods that can be used to indicate relevant information in devices (for example, including terminal devices and network devices).
  • devices for example, including terminal devices and network devices.
  • predefined can refer to what is defined in the protocol.
  • the "protocol” may refer to a standard protocol in the communication field, for example, it may be an evolution of the existing LTE protocol, NR protocol, Wi-Fi protocol or protocols related to other communication systems.
  • the application does not limit the type of agreement.
  • the current stage mainly includes the following three solutions.
  • Solution 1 uses asymmetric encryption technology to protect communication between the source UE and the target UE. Based on the mutual authentication of the source UE and the target UE, and assuming that the relay is trustworthy, a connection is established between the source UE and the target UE, and the public keys of both parties are used to protect end-to-end security.
  • Option 2 the security establishment process between UE1 and UE2 in the UE-to-UE relay scenario.
  • UE1 and UE2 establish PC5 connections with relay device 1 (relay 1) respectively, and then assume that UE1 and UE2 The shared key and key ID are configured.
  • UE1 sends a message verification code (Message Authentication Code, MAC) to UE2 through relay device 1.
  • MAC message Authentication Code
  • remote UE1 and remote UE2 establish secure PC5 links with the relay device.
  • Remote UE1, relay device, and remote UE2 are directly discovered by the 5G Name Management Network Element (Direct Discovering Name Management).
  • Function, DDNMF DDNMF
  • proximity communication service's key management network element Prose Key Management Function, PKMF
  • the remote UE1 and the remote UE2 obtain the shared key (Identity, ID) and key from PKMF in advance.
  • the UE (remote UE1 and remote UE2) and the relay device will also obtain the corresponding keys from PKMF and establish PC5 secure connections respectively.
  • the shared key is used to establish a secure channel between the remote UE1 and the remote UE2.
  • terminal-to-UE relay (UE-to-UE relay) communication architecture and related processes involved in this application will be described.
  • connection establishment is integrated in the discovery and selection of UE-to-UE relay
  • connection establishment is after the discovery and selection of UE-to-UE relay.
  • the following takes the connection establishment integrated in the discovery and selection of UE-to-UE relay as an example to introduce the relevant process.
  • the flow chart is shown in Figure 5. The specific steps may include the following:
  • UE-to-UE Relay registers with the network and provides the UE-to-UE Relay function.
  • UE-to-UE Relay is configured with relay policy parameters.
  • the target terminal determines the destination L2 ID for signaling reception when the PC5 unicast link is established.
  • the application layer provides PC5 unicast communication information (such as broadcast L2 ID, ProSe application layer ID, terminal application layer ID, target terminal) to the Proximity-based Services (ProSe) layer Application layer ID, relay applicable indication), the ProSe layer triggers the terminal's discovery mechanism by sending an end-to-end broadcast direct communication request message. Messages are sent using the source L2 ID and broadcast L2 ID as destination, and contain other application-related parameters.
  • PC5 unicast communication information such as broadcast L2 ID, ProSe application layer ID, terminal application layer ID, target terminal
  • Proximity-based Services (ProSe) layer Application layer ID, relay applicable indication the ProSe layer triggers the terminal's discovery mechanism by sending an end-to-end broadcast direct communication request message. Messages are sent using the source L2 ID and broadcast L2 ID as destination, and contain other application-related parameters.
  • the UE-to-UE Relay receives the broadcast direct communication request message and verifies whether it is configured to forward this application. For example, it compares the announced ProSe application ID with the relay policy/parameters it provides. Compare.
  • UE-to-UE Relay forwards an end-to-end broadcast direct communication request message, it uses its own L2 ID as the source (Source) L2 ID, adds the relay (Relay) UE ID to the message, and specifies the identity at the adaptation layer.
  • UE1 information UE-to-UE Relay processes this end-to-end broadcast message at the ProSe layer and forwards any subsequent end-to-end PC5-S messages based on the adaptation layer information.
  • the target UE3 is interested in the announced application. If there is no per-hop link between UE3 and UE-to-UE Relay, it will trigger the UE-to-UE Relay to establish a per-hop link. UE3 sends a link establishment process message for each hop.
  • the source address is the UE3 L2 ID and the destination address is the relay's L2 ID.
  • UE-to-UE relay If there is no per-hop link between UE-to-UE relay and UE1, perform the per-hop link establishment process between UE-to-UE relay and UE1.
  • UE1 uses its own L2 ID as the source address and the relay's L2 ID as the destination address.
  • step 4a end-to-end authentication and security establishment messages are exchanged between UE1 and UE3 through UE-to-UE Relay. Includes an adaptation layer that identifies source terminals and/or target terminals. On receipt of the first message from UE3 via the relay, if there is no existing per-hop link between the relay and UE1, a per-hop link is performed between the UE-to-UE relay and UE1 Establish process.
  • UE3 completes the end-to-end link establishment between UE3 and UE1 by sending an end-to-end unicast direct communication accept message, which contains the identification number of UE1 Adaptation layer information.
  • UE-to-UE Relay forwards the end-to-end unicast direct communication acceptance message, including the adaptation layer information identifying UE3. During this process, the relay device sends messages to each terminal by modifying the source field and destination field.
  • the key management function in ProSe one-to-many communication and the key management function (PKMF) of the adjacent service (Prose Key Management Function, PKMF) network element generates symmetric keys for multiple UEs.
  • the flow of the one-to-many ProSe secure communication process is shown in Figure 6 As shown, the specific steps may include the following:
  • PKMF is an independent logical entity that allows network operators to provide radio level parameters, while third parties (such as public safety services) can control the issuance of keys.
  • 0c and 0d Subscribers belonging to each group need to configure the ProSe function and ProSe key management function.
  • PKMF requires pre-selecting encryption algorithms for each group based on local policies.
  • the terminal obtains one-to-many communication parameters from the ProSe function. As part of this process, the endpoint obtains its group identity and is informed whether bearer layer security is required for the group. In addition, the UE may also be provided with the address of the PKMF used to obtain the set of keys.
  • PKMF checks whether the UE supports the group encryption algorithm based on the UE's Evolved Packet System (EPS) security capabilities, that is, whether the group encryption algorithm is included in the EPS encryption algorithm set supported by the UE.
  • EPS Evolved Packet System
  • PKMF responds with a key response message. If the check for a specific group in step 2a.ii or 2b.ii is successful, the message contains the group membership and the EPS encryption algorithm identifier that the UE should use when sending or receiving protected data for this group. Otherwise, the message contains an indicator that algorithm support failed because the UE does not support the required algorithm. If PKMF decides to use a new pairwise master key (PMK), the message may also contain the PMK and associated PMK ID.
  • PMK pairwise master key
  • PKMF uses Multimedia Internet KEYing (MIKEY) to send the relevant ProSe Group Key (PGK), PGK ID and expiration time to the UE.
  • MIKEY Multimedia Internet KEYing
  • the UE calculates the ProSe Transport Key (PTK) and the ProSe Encrypt Key (PEK) to protect the traffic it sends to the group. It does this by selecting a PGK and using the identity and counter combination of the next unused PTK. It then protects the data using the algorithm given in step 2x.ii.
  • PTK ProSe Transport Key
  • PEK ProSe Encrypt Key
  • the receiving UE obtains the Logical Channel Identity (LC ID), group identity and group membership from the Layer 2 header. It then uses the received PGK identity bits to identify which PGK was used by the sender. The UE first checks whether the PGK is valid, and if valid, calculates the PTK and PEK to process the received message.
  • LC ID Logical Channel Identity
  • group identity group identity
  • group membership group membership from the Layer 2 header. It then uses the received PGK identity bits to identify which PGK was used by the sender. The UE first checks whether the PGK is valid, and if valid, calculates the PTK and PEK to process the received message.
  • UE-to-UE relay scenario security communication solutions all have some flaws.
  • the default relay is trustworthy, so there are restrictions on strong assumptions, and when the UE negotiates security capabilities, they are all clear text messages, which may suffer Tampering, in addition, the source and authenticity of the public key and the source of the communication key in Scheme 1 are not clear (for example, it is not determined whether to determine the source of the communication key through negotiation or one-way encryption), and it does not involve the use of public key technology.
  • Key management solution. Solution 2 does not mention the process of preconfiguring the shared key, and the solution process is controversial. The process of option three is more complicated, has too many interactions, and is not light enough. Therefore, it is necessary to explore a simpler way to establish a secure connection without losing security, and explore a more efficient key management structure to ensure the confidentiality and integrity of UE identity security and communication data.
  • this application proposes a relay communication solution that can ensure the security of the terminal identity and the confidentiality and integrity of the communication data, thereby ensuring the confidentiality and integrity of the data transmitted by both parties and preventing other devices and even relay devices from of eavesdropping.
  • FIG. 7 is a schematic flowchart of a communication relay method 200 according to an embodiment of the present application. As shown in Figure 7, the communication relay method 200 may include at least part of the following content:
  • the first terminal device receives the authentication request message sent by the second terminal device through the relay device; wherein the authentication request message includes at least one of the following: information about the user to which the second terminal device belongs, information about the user to whom the relay device belongs. information, the first temporary public key generated by the second terminal device, the signature of the second terminal device, the signature of the relay device, and relevant information of the relay device; wherein, the information of the user to which the second terminal device belongs includes The identifier of the second terminal device and the PVT and KPAK of the second terminal device; the information of the user to which the relay device belongs includes the identifier of the relay device and the PVT and KPAK of the relay device; the signature of the second terminal device
  • the input parameters of the relay device include at least one of the following: the information of the user to which the second terminal device belongs and the first temporary public key; the input parameters of the signature of the relay device include at least one of the following: the signature of the second terminal device and the first temporary public key.
  • the information of the user to which the relay device belongs; the first temporary public key and the relevant information of the relay device are used by the first terminal device to derive the first key; the relevant information of the relay device includes one of the following: the relay The identity information of the device, the random number generated by the relay device, and the counter generated by the relay device.
  • This embodiment is based on the ECCSI signature scheme to establish a secure connection in the UE-to-UE relay scenario under the L2 architecture.
  • the embodiments of this application are applied to the UE-to-UE relay scenario under the L2 architecture, that is, the first terminal device and the second terminal device communicate through the relay device.
  • the relay connection between the first terminal device and the second terminal device may be a PC5 link.
  • the first terminal device may be a source device or a source terminal
  • the second terminal device may be a target device or a target terminal
  • the relay device may be a relay terminal
  • the input parameters of the signature of the second terminal device include at least one of the following: information of the user to which the second terminal device belongs and the first temporary public key. That is, the second terminal device may generate a signature of the second terminal device based on at least one of the information of the user to which the second terminal device belongs and the first temporary public key.
  • the input parameters of the relay device's signature include at least one of the following: the signature of the second terminal device and the information of the user to which the relay device belongs. That is, the relay device may generate the signature of the relay device based on at least one of the signature of the second terminal device and the information of the user to which the relay device belongs.
  • the signature of the second terminal device is generated by a secret signing key (Secret Signing Key, SSK) of the second terminal device.
  • the public verification token (Public Validation Token, PVT) of the second terminal device, the public authentication key (Key Management Service Public Authentication Key, KPAK) of the key management server, and the secret signing key (SSK) The second terminal device may be pre-configured by a trusted central key management server (Key Management Service, KMS) through a secure channel.
  • KMS trusted central key management server
  • the secure channel can establish a secure connection between the second terminal device and the KMS based on the Authentication and Key Management for Applications (AKMA) mechanism or the Generic Bootstrapping Architecture (GBA) mechanism.
  • AKMA Authentication and Key Management for Applications
  • GBA Generic Bootstrapping Architecture
  • the KMS can be managed directly by the operator or be a third-party service provider that has a commercial relationship with the operator.
  • the relay device's signature is generated by the relay device's secret signing key (SSK).
  • the PVT, KPAK, and secret signature key (SSK) of the relay device may be pre-configured for the relay device by the trusted center KMS through a secure channel.
  • the secure channel can be based on the AKMA mechanism or the GBA mechanism to establish a secure connection between the relay device and the KMS.
  • the KMS can be directly managed by the operator or a third-party service provider that has a commercial relationship with the operator.
  • the KPAK of the second terminal device and the KPAK of the relay device are valid, and the signature verification of the second terminal device based on the identity of the second terminal device and the PVT of the second terminal device is successful.
  • the first terminal device generates a second temporary private key, and the first terminal device generates a second temporary private key according to the first terminal device.
  • the first key is derived from a temporary public key, relevant information of the relay device and the second temporary private key.
  • the first terminal device may verify the validity of the KPAK of the second terminal device and the KPAK of the relay device based on one or more KPAKs stored locally. For example, if there is a KPAK consistent with the KPAK of the second terminal device in the KPAK stored locally on the first terminal device, the KPAK of the second terminal device is valid; and there is a KPAK consistent with the KPAK stored locally on the first terminal device. In the case where the KPAK of the relay device is consistent with the KPAK, the KPAK of the relay device is valid.
  • one or more KPAKs stored locally on the first terminal device may be preconfigured by the KMS.
  • the first terminal device may derive the first secret key based on the first temporary public key generated by the second terminal device, the relevant information of the relay device, and the second temporary private key generated by the first terminal device. key.
  • the first terminal device may derive the first key based on the first temporary public key generated by the second terminal device, relevant information of the relay device, and the second temporary private key generated by the first terminal device; wherein, the The relevant information of the relay device includes one of the following: the identity information of the relay device, the random number generated by the relay device, and the counter generated by the relay device.
  • the second terminal device may derive the first key based on the second temporary public key generated by the first terminal device, the relevant information of the relay device, and the first temporary private key generated by the second terminal device.
  • the second terminal device may derive the first key based on the second temporary public key generated by the first terminal device, relevant information of the relay device, and the first temporary private key generated by the second terminal device; wherein, the The relevant information of the relay device includes one of the following: the identity information of the relay device, the random number generated by the relay device, and the counter generated by the relay device.
  • the first temporary public key generated by the second terminal device is paired with the first temporary private key generated by the second terminal device
  • the second temporary public key generated by the first terminal device is paired with the second temporary private key generated by the first terminal device. pair.
  • the first terminal device can calculate the first key based on the first temporary public key and the second temporary private key and use the ECIES algorithm; the second terminal device can calculate the first key based on the second temporary public key and the first temporary private key. And use the ECIES algorithm to calculate the first key.
  • the first terminal device sends the first message to the second terminal device through the relay device;
  • the first message includes at least one of the following: security capability information of the first terminal device, security policy information of the first terminal device, information of the user to which the first terminal device belongs, a third message generated by the first terminal device.
  • security capability information of the first terminal device security policy information of the first terminal device
  • information of the user to which the first terminal device belongs a third message generated by the first terminal device.
  • a random number a second temporary public key generated by the first terminal device paired with the second temporary private key, M bits of the identification of the first key generated by the first terminal device, the first terminal Device signature, first message verification code;
  • the information of the user to which the first terminal device belongs includes the identification of the first terminal device and the PVT and KPAK of the first terminal device;
  • the input parameters of the signature of the first terminal device include at least one of the following: the first terminal Information about the user to whom the device belongs, the second temporary public key, M bits of the identification of the first key, and the signature of the second terminal device;
  • the first message is integrity protected by the first message verification code generated based on the first key
  • the input parameters of the first message verification code include at least one of the following: the security capability of the first terminal device Information, the security policy information of the first terminal device, the information of the user to which the first terminal device belongs, the first random number, the second temporary public key, the M bits, and the signature of the first terminal device.
  • the second temporary public key and the relevant information of the relay device are used by the second terminal device to derive the first key, the first random number, the first key and the key generated by the second terminal device.
  • the second random number is used to derive a second key.
  • the second key is used to derive an integrity protection key and/or a confidentiality protection key.
  • the identity of the first key is composed of the M bits and the first key.
  • the other N bits of the identifier of a key are combined, and M and N are both positive integers.
  • the first random number and the first key generated by the first terminal device and the second random number generated by the second terminal device are used to derive the second key. That is, the first terminal device derives the second key based on at least the first random number, the first key and the second random number, and the first terminal device can derive the integrity protection key and/or the secret based on the second key.
  • the first terminal device can securely protect the sent message based on the integrity protection key and/or the confidentiality protection key.
  • the second terminal device may derive the second key based on at least the first random number, the first key and the second random number, and the second terminal device may derive the integrity protection key and/or the secret based on the second key.
  • the second terminal device can securely protect the sent message based on the integrity protection key and/or the confidentiality protection key.
  • the input parameters of the first message verification code include at least one of the following: security capability information of the first terminal device, security policy information of the first terminal device, the first random number, the third 2.
  • Temporary public key, the M bits that is, the first terminal device can be based on the security capability information of the first terminal device, the security policy information of the first terminal device, the first random number, the information of the user to which the first terminal device belongs, and the second temporary At least one of the public key, the M bits, and the signature of the first terminal device is used to generate the first message verification code.
  • the input parameters of the first message verification code include: the security capability information of the first terminal device, the security policy information of the first terminal device, the first random number, and the information of the user to which the first terminal device belongs. , the second temporary public key, the M bits, and the signature of the first terminal device.
  • the second terminal device may generate a first message verification based on the security capability information of the first terminal device, the security policy information of the first terminal device, the first random number, the second temporary public key, and the M bits. code and compare it with the first message verification code contained in the first message. If they are consistent, the first message verification code is valid.
  • the first message is an authentication response message, or the first message is a safe mode command message.
  • the security capability information of the first terminal device may be a list of cryptographic algorithms supported by the first terminal device.
  • the security policy information of the first terminal device may be whether the first terminal device supports confidentiality protection or integrity protection.
  • the security policy information of the first terminal device includes: the security policy information of the first terminal device on the control plane, and/or the security policy information of the first terminal device on the user plane.
  • the M bits may be the highest M bits of the identity of the first key, and the N bits may be the lowest N bits of the identity of the first key; or, The M bits may be the first M bits of the identifier of the first key, and the N bits may be the last N bits of the identifier of the first key; or, the M bits may be are the even-numbered bits of the identifier of the first key, and the N bits may be the odd-numbered bits of the identifier of the first key.
  • the values of M and N may be the same or different, which is not limited by this application.
  • the first terminal device receives the second message sent by the second terminal device through the relay device;
  • the second message includes at least one of the following: the second random number generated by the second terminal device, N bits of the identification of the first key generated by the second terminal device, x bits of the identifier of the generated second key, the security algorithm selected by the second terminal device, the security policy selected by the second terminal device, and the second message verification code;
  • the second message is integrity protected through the second message verification code generated based on the second key, or the second message is integrity protected through the third integrity protection key generated based on the second key.
  • the second message verification code performs integrity protection, and the input parameters of the second message verification code include at least one of the following: the second random number, the N bits, the x bits, and the second terminal device selected Security algorithm, the security policy selected by the second terminal device;
  • the identifier of the second key is obtained by combining the x bits and the other y bits of the identifier of the second key, and both x and y are positive integers.
  • the x bits may be the highest x bits of the identity of the second key, and the y bits may be the lowest y bits of the identity of the second key; or, The x bits may be the first x bits of the identifier of the second key, and the y bits may be the last y bits of the identifier of the second key; or, the x bits may be are the even-numbered bits of the identifier of the second key, and the y bits may be the odd-numbered bits of the identifier of the second key.
  • the values of x and y may be the same or different, which is not limited by this application.
  • the first terminal device if the information carried in the second message has not been tampered with, the first terminal device generates the second random number based on at least the first random number, the first key and the second random number. key, the first terminal device generates an integrity protection key and/or a confidentiality protection key based on the second key, and the first terminal device combines the M bits and the N bits to obtain the The identification of the first key, the first terminal device generates y bits of the identification of the second key, and combines the x bits and the y bits to obtain the identification of the second key;
  • the first terminal device When the second message verification code is valid, the first terminal device generates an integrity protection key and/or a secret based on the security algorithm selected by the second terminal device, the second key, and the second key.
  • the security protection key and the security policy selected by the second terminal device are used to communicate with the second terminal device.
  • the input parameters of the second message verification code include: the second random number, the N bits, the x bits, the security algorithm selected by the second terminal device, the security strategy.
  • the first terminal device may generate a second message verification code based on the second random number, the N bits, the x bits, the security algorithm selected by the second terminal device, and the security policy selected by the second terminal device. , and compared with the second message verification code contained in the second message. If they are consistent, the second message verification code is valid.
  • the second message is encrypted with the first key.
  • the second message may not be encrypted using the first key, or the second message may not be encrypted.
  • the first terminal device decrypts the second message according to the first key; if the information carried in the second message is not tampered with, the first terminal device at least decrypts the second message according to the first random key. number, the first key and the second random number to generate the second key, the first terminal device generates an integrity protection key and/or a confidentiality protection key based on the second key, and the first The terminal device combines the M bits and the N bits to obtain the identity of the first key, the first terminal device generates y bits of the identity of the second key, and combines the x bits Combine with the y bits to obtain the identity of the second key;
  • the first terminal device When the second message verification code is valid, the first terminal device generates an integrity protection key and/or a secret based on the security algorithm selected by the second terminal device, the second key, and the second key.
  • the security protection key and the security policy selected by the second terminal device are used to communicate with the second terminal device.
  • the second terminal device may select a security algorithm based on the security capability information of the first terminal device, and/or the second terminal device may select a security policy based on the security policy information of the first terminal device.
  • the first terminal device may use the first random number, the first key, the second random number, the source identifier, the target identifier, the length of the first random number, the second random number. At least one of the length of the number, the length of the source identifier, and the length of the target identifier is used to generate the second key.
  • the source identifier is used to identify the source end of the relay connection between the first terminal device and the second terminal device
  • the target identifier is used to identify the intermediate connection between the first terminal device and the second terminal device.
  • the destination of the connection may also include other system setting parameters, such as one or more fixed parameters specified by 3GPP.
  • the first message is an authentication response message
  • the second message is a Secure Mode Command (Secure Mode Command, SMC) message.
  • SMC Secure Mode Command
  • the first message is a safe mode command (SMC) message and the second message is a safe mode response message.
  • SMC safe mode command
  • the first terminal device sends the third message to the second terminal device through the relay device;
  • the third message is used to indicate that the security mode establishment is completed, the third message is encrypted by the target key, and the third message includes at least one of the following: the y bits of the identification of the second key, Third message verification code;
  • the target key includes one of the following: the first key, the second key, and a confidentiality protected key derived from the second key;
  • the third message is integrity protected through the third message verification code generated based on the second key, or the third message is integrity protected through the third message verification code generated based on the integrity protection key derived based on the second key.
  • the three-message verification code performs integrity protection, and the input parameters of the third message verification code include the y bits.
  • the third message is integrity protected by the third message verification code, which is generated based on the second key, or the third message verification code is based on the integrity derived from the second key.
  • the third message verification code is integrity protected by the third message verification code, which is generated based on the second key, or the third message verification code is based on the integrity derived from the second key.
  • the second terminal device decrypts the third message using the target key; provided that the information carried in the third message has not been tampered with, and the third message
  • the second terminal device combines the x bits and the y bits to obtain the identity of the second key.
  • the second terminal device can generate a third message verification code based on the y bits, and compare it with the third message verification code contained in the third message. If the comparison is consistent, the third message verification code The message verification code is valid.
  • the third message is a security mode complete message (security mode complete).
  • the first terminal device receives an error message sent by the second terminal device through the relay device; wherein the error message includes at least one of the following: cause information, a fourth message verification code; wherein the error message
  • the reason information is used to indicate that the security policy of the second terminal device conflicts with the first terminal device, or the reason information is used to indicate that the first message verification code verification fails, or the reason information is used to indicate that the second terminal device
  • the security algorithm negotiation between the device and the first terminal device fails, and the input parameters of the fourth message verification code include at least one of the following: the reason information;
  • the first terminal device determines that the security mode establishment fails, and/or the first terminal device re-initiates the security mode establishment process.
  • the error message may also be integrity protected.
  • the cause information is used to indicate that the security policy of the second terminal device conflicts with the first terminal device.
  • the second terminal device does not support the security policy information of the first terminal device carried in the first message. .
  • the cause information is used to indicate that the security algorithm negotiation between the second terminal device and the first terminal device failed.
  • the second terminal device does not support the security capabilities of the first terminal device carried in the first message. information.
  • the first key may be K D
  • the identifier of the first key may be K D ID
  • the second key may be K D -SESS
  • the identifier of the second key may be K D-SESS ID.
  • the input parameters when generating the first key include: a second temporary private key (Ephemeral private key2) generated by the first terminal device, a first temporary private key generated by the second terminal device.
  • Temporary public key (Ephemeral public key1), and related information of the relay device such as the identity information of the relay device, or the random number generated by the relay device, or the counter (COUNT) generated by the relay device).
  • the input parameters when generating the first key include: the second temporary public key (Ephemeral public key2) generated by the first terminal device, the first temporary private key (Ephemeral private key2) generated by the second terminal device.
  • the first temporary public key is paired with the first temporary private key
  • the second temporary public key is paired with the second temporary private key
  • the integrity protection key includes an integrity protection key for the control plane (KD -CPint ) and an integrity protection key for the user plane ( KD-UPint ); and/or the confidentiality
  • the protection keys include a confidentiality protection key for the control plane (K D-CPenc ) and a confidentiality protection key for the user plane (K D-UPenc ).
  • the input parameters of the integrity protection key include at least one of the following: the second key, the selected algorithm type identifier, the length of the selected algorithm type identifier, and the integrity protection algorithm identifier. , the length of the integrity protection algorithm identifier. That is, the second key may be generated based on at least one of the second key, the selected algorithm type identifier, the length of the selected algorithm type identifier, the integrity protection algorithm identifier, and the length of the integrity protection algorithm identifier. Integrity protected key.
  • the input parameters of the integrity protection key may also include some system setting parameters.
  • the integrity protection key is automatically updated.
  • the input parameters of the confidentiality protection key include at least one of the following: the second key, the selected algorithm type identifier, the length of the selected algorithm type identifier, the confidentiality protection algorithm identification , the length of the confidentiality protection algorithm identifier. That is, the second key may be generated based on at least one of the second key, the selected algorithm type identifier, the length of the selected algorithm type identifier, the confidentiality protection algorithm identifier, and the length of the confidentiality protection algorithm identifier. Confidentiality protects keys.
  • the input parameters of the confidentiality protection key may also include some system setting parameters.
  • the confidentiality protection key is automatically updated.
  • the selected algorithm type identifier may be represented by "Control Plane Integrity Protection Algorithm" or by setting a specific value.
  • the selected algorithm type identifier may be represented by "Control Plane Confidentiality Protection Algorithm" or by setting a specific value.
  • the selected algorithm type identifier may be represented by "User Plane Integrity Protection Algorithm" or by setting a specific value.
  • the selected algorithm type identifier may be represented by "user plane confidentiality protected algorithm” or by setting a specific value.
  • Root key Signature private key/secret signing key (Secret Signing Key, SSK) is the root of trust for UE-to-UE relay unicast link security.
  • SSK secret Signing Key
  • UE ID user identification
  • PVT public key parameter
  • K D Elliptic Curve-Based Certificateless Signatures for Identity-Based Encryption
  • Users each generate a temporary public and private key pair, and use the Elliptic Curve Integrated Encryption Scheme (ECIES) algorithm to generate K D.
  • ECIES Elliptic Curve Integrated Encryption Scheme
  • the signature generated by the source device user ensures the authenticity of the identity and the authenticity of the temporary public key. Integrity and non-repudiation.
  • the signature generated by the target device user ensures the authenticity of the identity and the integrity and non-repudiation of the temporary public key. This ensures that only the source device and the target device can obtain the key K D . Therefore, the signature private key or SSK is the root of trust that ensures secure communication between the source device and the target device.
  • K D The key length is at least 256 bits (bits) and is generated by both the source device and the target device through temporary public and private key negotiation. Based on the root key, K D is updated by rerunning the authentication process. K D is used to generate the next layer key K D-sess . The key can be saved even if there is no active communication session between the source and target devices. K D ID can be used to identify K D .
  • the input parameters during generation include: UE-1’s temporary private key Ephemeral private key2, UE-2’s temporary public key Ephemeral public key1, and the identity information of UE-relay, or UE-relay
  • the input parameters during generation include: UE-1's temporary public key Ephemeral public key2, UE-2's temporary private key Ephemeral private key1, And the identity of UE-relay, or the random number generated by UE-relay, or the counter COUNT generated by UE-relay.
  • K D-sess The key length is at least 256 bits. K D-sess is used to derive the next level of integrity protection or confidentiality protection key. K D -sess can be refreshed based on K D by rerunning the secure connection establishment process or the related key update process. K D-sess ID is used to identify K D-sess . KD-sess is derived from KD using key derivation algorithms such as HMAC-SHA-256 or HMAC-SM3. The input parameters of K D-sess must at least include the key K D , the random number Nonce_1 (that is, the first random number generated by the first terminal device), and the random number Nonce_2 (that is, the second random number generated by the second terminal device).
  • the input parameters of K D-sess may also include but are not limited to at least one of the following: source ID (Source ID), destination ID (Destination ID), the length of the random number Nonce_1, the length of the random number Nonce_2, the source ID (Source ID) length, destination ID (Destination ID) length.
  • the input parameters of K D-sess can also include other system setting parameters, such as one or more fixed parameters specified by 3GPP.
  • K D-CPint The key length is at least 128 bits. This key can be used for control plane data integrity protection.
  • the key is derived by K D-sess using key derivation algorithms such as HMAC-SHA-256 or HMAC-SM3. Come.
  • the input parameters of K D-CPint must contain at least the key K D-sess , the selected algorithm type identifier (such as "control plane integrity protection algorithm” or setting a specific value to represent it) and the selected algorithm type identifier.
  • the length of the symbol, the integrity protection algorithm identifier and the length of the integrity protection algorithm identifier, and other system setting parameters can be used as optional input parameters.
  • K D -CPint is automatically updated when K D -sess is automatically refreshed.
  • K D-CPenc The key length is at least 128 bits. This key can be used for control plane data confidentiality protection.
  • the key is derived by K D-sess using key derivation algorithms such as HMAC-SHA-256 or HMAC-SM3. Come.
  • the input parameters of K D-CPenc must contain at least the key K D-sess , the selected algorithm type identifier (such as "Control Plane Confidentiality Protection Algorithm" or set a specific value to represent it) and the selected algorithm type identifier
  • the length, the confidentiality protection algorithm identifier and the length of the confidentiality protection algorithm identifier, and other system setting parameters can be used as optional input parameters.
  • K D -CPenc is automatically updated when K D- sess is automatically refreshed.
  • K D-UPint The key length is at least 128 bits. This key can be used for user plane data integrity protection.
  • the key is derived by K D-sess using key derivation algorithms such as HMAC-SHA-256 or HMAC-SM3. Come.
  • the input parameters of K D-UPint must contain at least the key K D-sess , the selected algorithm type identifier (such as "user plane integrity protection algorithm” or setting a specific value to represent it) and the selected algorithm type identifier.
  • the length of the symbol, the integrity protection algorithm identifier and the length of the integrity protection algorithm identifier, and other system setting parameters can be used as optional input parameters.
  • K D -UPint is automatically updated when K D-sess is automatically refreshed.
  • K D-UPenc The key length is at least 128 bits. This key can be used for user plane data confidentiality protection.
  • the key is derived by K D-sess using key derivation algorithms such as HMAC-SHA-256 or HMAC-SM3. Come.
  • the input parameters of K D-UPenc must contain at least the key K D-sess , the selected algorithm type identifier (such as "user plane confidentiality protection algorithm” or setting a specific value to represent it) and the selected algorithm type identifier.
  • the length of the character, the confidentiality protection algorithm identifier and the length of the confidentiality protection algorithm identifier, and other system setting parameters can be used as optional input parameters.
  • K D -UPenc is automatically updated when K D -sess is automatically refreshed.
  • ECCSI in this application is only an example and is not limited to this algorithm. It can also be replaced by other identity-based public key signature and public key encryption algorithms. While replacing the public key algorithm, all requests Parameters related to the public key algorithm in the message need to be replaced accordingly.
  • the key derivation function used by the first terminal device and the second terminal device in this application is not limited to HMAC-SHA-256 or HMAC-SM3, and includes any key derivation function that meets computational security.
  • the input parameters of the key derivation function in this application are not limited to the necessary parameters mentioned above, and may include other optional parameters, such as fixed parameters set by the application system.
  • the key management center in this application is not limited to KMS, PKMF, and 5GPKMF.
  • Legal key management centers managed by operators or managed by third-party service providers are all applicable to the technical solution of this application.
  • the symmetric key issued by PKMF to the terminal device that has been registered and authorized to use the UE-to-UE relay function is not limited to the above solution.
  • the specific configuration can be changed according to the operator or service provider's design of PKMF. .
  • the information elements in all interactive messages in the secure communication establishment process in this application are not limited to the content mentioned in the above solution, and optional information elements due to application system requirements can also be added.
  • the first random number, the first key and the second random number generated by the second terminal device are used to derive the second key
  • the second key is used to derive the integrity protection key and /or confidentiality protection key, which can ensure the identity security of the first terminal device and the second terminal device and the confidentiality and integrity of the communication data, thereby ensuring the confidentiality and integrity of the data transmitted by both parties and preventing other devices from even relaying Device eavesdropping.
  • the embodiment of this application is suitable for the secure communication establishment process between the first terminal device (source device) and the second terminal device (target device) under the 5G L2 UE-to-UE relay architecture.
  • public key signature technology it can ensure the identity authenticity of the terminal device and the non-repudiation of the message, and can resist replay attacks, man-in-the-middle attacks, disguise and other active attacks, while ensuring the integrity of the authentication process messages, and using the 3GPP standard
  • the ECIES algorithm is used to establish end-to-end security between the source UE and the target UE, ensuring the confidentiality and integrity of the data transmitted by both parties, and preventing eavesdropping by external adversaries and even relays; the embodiment of this application ensures The scalability of the secure communication establishment mechanism.
  • the embodiments of this application can realize the security negotiation of the user plane and control plane security policies between the source UE and the target UE, as well as the encryption and integrity protection algorithms supported by both parties, and can achieve integrity. Protect against tampering and downgrade attacks.
  • the first terminal device side embodiment of the present application is described in detail above with reference to FIGS. 7 to 8 .
  • the second terminal device side embodiment of the present application is described in detail below with reference to FIG. 9 . It should be understood that the second terminal device side implementation The example corresponds to the first terminal device side embodiment, and similar descriptions may refer to the first terminal device side embodiment.
  • FIG. 9 is a schematic flowchart of a communication relay method 300 according to an embodiment of the present application.
  • the communication relay method 300 may include at least part of the following content:
  • the second terminal device sends an authentication request message to the first terminal device through the relay device; wherein the authentication request message includes at least one of the following: information about the user to which the second terminal device belongs, the first user generated by the second terminal device. A temporary public key, the signature of the second terminal device, and relevant information of the relay device; wherein the information of the user to which the second terminal device belongs includes the identification of the second terminal device and the PVT and KPAK of the second terminal device.
  • the input parameters of the signature of the second terminal device include at least one of the following: information about the user to which the second terminal device belongs and the first temporary public key; related information about the first temporary public key and the relay device for The first terminal device derives a first key; the relevant information of the relay device includes one of the following: identity information of the relay device, a random number generated by the relay device, and a counter generated by the relay device.
  • This embodiment is based on the ECCSI signature scheme to establish a secure connection in the UE-to-UE relay scenario under the L2 architecture.
  • the embodiments of this application are applied to the UE-to-UE relay scenario under the L2 architecture, that is, the first terminal device and the second terminal device communicate through the relay device.
  • the relay connection between the first terminal device and the second terminal device may be a PC5 link.
  • the first terminal device may be a source device or a source terminal
  • the second terminal device may be a target device or a target terminal
  • the relay device may be a relay terminal
  • the input parameters of the signature of the second terminal device include at least one of the following: information of the user to which the second terminal device belongs and the first temporary public key. That is, the second terminal device may generate a signature of the second terminal device based on at least one of the information of the user to which the second terminal device belongs and the first temporary public key.
  • the input parameters of the relay device's signature include at least one of the following: the signature of the second terminal device and the information of the user to which the relay device belongs. That is, the relay device may generate the signature of the relay device based on at least one of the signature of the second terminal device and the information of the user to which the relay device belongs.
  • the signature of the second terminal device is generated by the secret signing key (SSK) of the second terminal device.
  • the PVT, KPAK, and secret signature key (SSK) of the second terminal device may be pre-configured by the trusted center KMS for the second terminal device through a secure channel.
  • the secure channel may be based on the AKMA mechanism or the GBA mechanism to establish a secure connection between the second terminal device and the KMS.
  • the KMS may be directly managed by the operator or be a third-party service provider that has a commercial relationship with the operator.
  • the second terminal device receives the first message sent by the first terminal device through the relay device;
  • the first message includes at least one of the following: security capability information of the first terminal device, security policy information of the first terminal device, information of the user to which the first terminal device belongs, and information of the user to which the relay device belongs. , the first random number generated by the first terminal device, the second temporary public key paired with the second temporary private key generated by the first terminal device, the identification of the first key generated by the first terminal device M bits, the signature of the first terminal device, the signature of the relay device, and the first message verification code;
  • the information of the user to which the first terminal device belongs includes the identification of the first terminal device and the PVT and KPAK of the first terminal device;
  • the information of the user to which the relay device belongs includes the identification of the relay device and the relay device.
  • the input parameters of the signature of the first terminal device include at least one of the following: information of the user to which the first terminal device belongs, the second temporary public key, and M bits of the identification of the first key , the signature of the second terminal device;
  • the input parameters of the signature of the relay device include at least one of the following: information of the user to which the relay device belongs, the signature of the first terminal device, the signature of the second terminal device;
  • the first message is integrity protected by the first message verification code generated based on the first key
  • the input parameters of the first message verification code include at least one of the following: the security capability of the first terminal device Information, the security policy information of the first terminal device, the information of the user to which the first terminal device belongs, the information of the user to which the relay device belongs, the first random number, the second temporary public key, the M bits, The signature of the first terminal device and the signature of the relay device;
  • the second temporary public key and the relevant information of the relay device are used by the second terminal device to derive the first key, the first random number, the first key and the third key generated by the second terminal device.
  • Two random numbers are used to derive a second key.
  • the second key is used to derive an integrity protection key and/or a confidentiality protection key.
  • the identity of the first key is composed of the M bits and the first The other N bits of the key's identifier are combined, and M and N are both positive integers.
  • the input parameters of the first message verification code include at least one of the following: security capability information of the first terminal device, security policy information of the first terminal device, user information of the user to which the first terminal device belongs. information, the information of the user to which the relay device belongs, the first random number, the second temporary public key, and the M bits. That is, the first terminal device can be based on the security capability information of the first terminal device, the security policy information of the first terminal device, the first random number, the second temporary public key, the M bits, and the At least one of the signature of the first terminal device and the signature of the relay device generates the first message verification code.
  • the first random number and the first key generated by the first terminal device and the second random number generated by the second terminal device are used to derive the second key. That is, the first terminal device derives the second key based on at least the first random number, the first key and the second random number, and the first terminal device can derive the integrity protection key and/or the secret based on the second key.
  • the first terminal device can securely protect the sent message based on the integrity protection key and/or the confidentiality protection key.
  • the second terminal device may derive the second key based on at least the first random number, the first key and the second random number, and the second terminal device may derive the integrity protection key and/or the secret based on the second key.
  • the second terminal device can securely protect the sent message based on the integrity protection key and/or the confidentiality protection key.
  • the signature of the first terminal device is generated by the secret signature key of the first terminal device.
  • the relay device's signature is generated by the relay device's secret signing key.
  • the first message is an authentication response message, or the first message is a safe mode command message.
  • the security capability information of the first terminal device may be a list of cryptographic algorithms supported by the first terminal device.
  • the security policy information of the first terminal device may be whether the first terminal device supports confidentiality protection or integrity protection.
  • the security policy information of the first terminal device includes: the security policy information of the first terminal device on the control plane, and/or the security policy information of the first terminal device on the user plane.
  • the M bits may be the highest M bits of the identity of the first key, and the N bits may be the lowest N bits of the identity of the first key; or, The M bits may be the first M bits of the identifier of the first key, and the N bits may be the last N bits of the identifier of the first key; or, the M bits may be are the even-numbered bits of the identifier of the first key, and the N bits may be the odd-numbered bits of the identifier of the first key.
  • the values of M and N may be the same or different, which is not limited by this application.
  • the second terminal device checks the KPAK of the first terminal device and the KPAK of the relay device respectively. If the KPAK of the first terminal device and the KPAK of the relay device are valid, and based on The identity of the first terminal device and the PVT of the first terminal device are used to verify the signature of the first terminal device, and the signature of the relay device is verified based on the identity of the relay device and the PVT of the relay device. ;
  • the second terminal device When the signature of the first terminal device and the signature of the relay device are verified successfully, and the information carried in the first message has not been tampered with, the second terminal device generates a second random number, and the second terminal device generates a second random number.
  • the second key is generated based on at least the first random number, the first key and the second random number, and the second terminal device generates an integrity protection key and/or a confidentiality protection key based on the second key.
  • key, and the second terminal device generates N bits of the identifier of the first key, and combines the M bits and the N bits to obtain the identifier of the first key.
  • the second terminal device may use the first random number, the first key, the second random number, the source identifier, the target identifier, the length of the first random number, the second random number. At least one of the length of the number, the length of the source identifier, and the length of the target identifier is used to generate the second key.
  • the source identifier is used to identify the source end of the relay connection between the first terminal device and the second terminal device
  • the target identifier is used to identify the intermediate connection between the first terminal device and the second terminal device.
  • the destination of the connection may also include other system setting parameters, such as one or more fixed parameters specified by 3GPP.
  • the input parameters of the first message verification code include: the security capability information of the first terminal device, the security policy information of the first terminal device, the first random number, the second temporary public key, the M bits.
  • the second terminal device may generate a first message verification based on the security capability information of the first terminal device, the security policy information of the first terminal device, the first random number, the second temporary public key, and the M bits. code and compare it with the first message verification code contained in the first message. If they are consistent, the first message verification code is valid.
  • the second terminal device when the first message verification code is valid, sends a second message to the first terminal device through the relay device; wherein the second message includes at least one of the following : the second random number, the N bits, the x bits of the identifier of the second key generated by the second terminal device, the security algorithm selected by the second terminal device, the Security policy, second message verification code;
  • the second message is integrity protected through the second message verification code generated based on the second key, or the second message is integrity protected through the third integrity protection key generated based on the second key.
  • the second message verification code performs integrity protection, and the input parameters of the second message verification code include at least one of the following: the second random number, the N bits, the x bits, and the second terminal device selected Security algorithm, the security policy selected by the second terminal device;
  • the identifier of the second key is obtained by combining the x bits and the other y bits of the identifier of the second key, and both x and y are positive integers.
  • the input parameters of the second message verification code include: the second random number, the N bits, the x bits, the security algorithm selected by the second terminal device, the security strategy.
  • the first terminal device may generate a second message verification code based on the second random number, the N bits, the x bits, the security algorithm selected by the second terminal device, and the security policy selected by the second terminal device. , and compared with the second message verification code contained in the second message. If they are consistent, the second message verification code is valid.
  • the x bits may be the highest x bits of the identity of the second key, and the y bits may be the lowest y bits of the identity of the second key; or, The x bits may be the first x bits of the identifier of the second key, and the y bits may be the last y bits of the identifier of the second key; or, the x bits may be are the even-numbered bits of the identifier of the second key, and the y bits may be the odd-numbered bits of the identifier of the second key.
  • the values of x and y may be the same or different, which is not limited by this application.
  • the second message is encrypted with the first key.
  • the second message may not be encrypted using the first key, or the second message may not be encrypted.
  • the second terminal device may select a security algorithm based on the security capability information of the first terminal device, and/or the second terminal device may select a security policy based on the security policy information of the first terminal device.
  • the first message is an authentication response message and the second message is a secure mode command (SMC) message.
  • SMC secure mode command
  • the first message is a safe mode command (SMC) message and the second message is a safe mode response message.
  • SMC safe mode command
  • the first terminal device may derive the first secret key based on the first temporary public key generated by the second terminal device, the relevant information of the relay device, and the second temporary private key generated by the first terminal device. key.
  • the second terminal device may derive the first key based on the second temporary public key generated by the first terminal device, the relevant information of the relay device, and the first temporary private key generated by the second terminal device.
  • the first temporary public key generated by the second terminal device is paired with the first temporary private key generated by the second terminal device
  • the second temporary public key generated by the first terminal device is paired with the second temporary private key generated by the first terminal device. pair.
  • the first terminal device can calculate the first key based on the first temporary public key, relevant information of the relay device, and the second temporary private key using the ECIES algorithm; the second terminal device can calculate the first key based on the second temporary public key. , the relevant information of the relay device and the first temporary private key, and use the ECIES algorithm to calculate the first key.
  • the second terminal device receives the third message sent by the first terminal device through the relay device;
  • the third message is used to indicate that the security mode establishment is completed, the third message is encrypted by the target key, and the third message includes at least one of the following: the identification of the second key generated by the first terminal device y bits, the third message verification code;
  • the target key includes one of the following: the first key, the second key, and a confidentiality protected key derived from the second key;
  • the third message is integrity protected through the third message verification code generated based on the second key, or the third message is integrity protected through the third message verification code generated based on the integrity protection key derived based on the second key.
  • the three-message verification code performs integrity protection, and the input parameters of the third message verification code include the y bits.
  • the second terminal device decrypts the third message using the target key; provided that the information carried in the third message has not been tampered with and the third message verification code is valid. Next, the second terminal device combines the x bits and the y bits to obtain the identity of the second key.
  • the second terminal device can generate a third message verification code based on the y bits, and compare it with the third message verification code contained in the third message. If the comparison is consistent, the third message verification code The message verification code is valid.
  • the third message is a security mode complete message (security mode complete).
  • the second terminal device sends an error message to the first terminal device through the relay device; wherein the error message includes at least one of the following: cause information, a fourth message verification code; wherein the cause The information is used to indicate that the security policy of the second terminal device conflicts with the first terminal device, or the reason information is used to indicate that the first message verification code verification fails, or the reason information is used to indicate that the second terminal device
  • the security algorithm negotiation with the first terminal device fails, and the input parameters of the fourth message verification code include at least one of the following: the reason information.
  • the first terminal device determines that the security mode establishment fails, and/or the first terminal device re-initiates the security mode establishment process.
  • the error message may also be integrity protected.
  • the cause information is used to indicate that the security policy of the second terminal device conflicts with the first terminal device.
  • the second terminal device does not support the security policy information of the first terminal device carried in the first message. .
  • the cause information is used to indicate that the security algorithm negotiation between the second terminal device and the first terminal device failed.
  • the second terminal device does not support the security capabilities of the first terminal device carried in the first message. information.
  • the first key may be K D
  • the identifier of the first key may be K D ID
  • the second key may be K D -SESS
  • the identifier of the second key may be K D-SESS ID.
  • the integrity protection key includes an integrity protection key for the control plane (KD -CPint ) and an integrity protection key for the user plane ( KD-UPint ); and/or the confidentiality
  • the protection keys include a confidentiality protection key for the control plane (K D-CPenc ) and a confidentiality protection key for the user plane (K D-UPenc ).
  • the first random number, the first key and the second random number generated by the second terminal device are used to derive the second key
  • the second key is used to derive the integrity protection key and /or confidentiality protection key, which can ensure the identity security of the first terminal device and the second terminal device and the confidentiality and integrity of the communication data, thereby ensuring the confidentiality and integrity of the data transmitted by both parties and preventing other devices from even relaying Device eavesdropping.
  • the embodiment of this application is suitable for the secure communication establishment process between the first terminal device (source device) and the second terminal device (target device) under the 5G L2 UE-to-UE relay architecture.
  • public key signature technology it can ensure the identity authenticity of the terminal device and the non-repudiation of the message, and can resist replay attacks, man-in-the-middle attacks, disguise and other active attacks, while ensuring the integrity of the authentication process messages, and using the 3GPP standard
  • the ECIES algorithm is used to establish end-to-end security between the source UE and the target UE, ensuring the confidentiality and integrity of the data transmitted by both parties, and preventing eavesdropping by external adversaries and even relays; the embodiment of this application ensures The scalability of the secure communication establishment mechanism.
  • the embodiments of this application can realize the security negotiation of the user plane and control plane security policies between the source UE and the target UE, as well as the encryption and integrity protection algorithms supported by both parties, and can achieve integrity. Protect against tampering and downgrade attacks.
  • the first terminal device side embodiment and the second terminal device side embodiment of the present application are described in detail above with reference to Figures 7 to 9.
  • the relay device side embodiment of the present application is described in detail with reference to Figure 10. It should be understood that , the relay device side embodiment corresponds to the first terminal device side embodiment and the second terminal device side embodiment. Similar descriptions can be made with reference to the first terminal device side embodiment and the second terminal device side embodiment.
  • Figure 10 is a schematic flowchart of a method 400 for relaying communication according to an embodiment of the present application. As shown in Figure 10, the method 400 for relaying communication may include at least part of the following content:
  • the relay device receives the authentication request message sent by the second terminal device; wherein the authentication request message includes at least one of the following: information about the user to which the second terminal device belongs, and the first temporary public key generated by the second terminal device. , the signature of the second terminal device; wherein the information of the user to which the second terminal device belongs includes the identification of the second terminal device and the PVT and KPAK of the second terminal device; the input parameters of the signature of the second terminal device include At least one of the following: information about the user to which the second terminal device belongs and the first temporary public key;
  • the relay device sends a request to the first terminal device.
  • the terminal device sends an authentication request message after verification; wherein the authentication request message after verification includes at least one of the following: information about the user to which the second terminal device belongs, information about the user to which the relay device belongs, and the first temporary public key.
  • the signature of the second terminal device, the signature of the relay device, and the relevant information of the relay device wherein the information of the user to which the relay device belongs includes the identification of the relay device and the PVT and KPAK of the relay device.
  • the input parameters of the relay device's signature include at least one of the following: the signature of the second terminal device and the information of the user to which the relay device belongs; wherein, the first temporary public key and the relevant information of the relay device are used
  • the first key is derived from the first terminal device;
  • the relevant information of the relay device includes one of the following: the identity information of the relay device, the random number generated by the relay device, and the counter generated by the relay device.
  • This embodiment is based on the ECCSI signature scheme to establish a secure connection in the UE-to-UE relay scenario under the L2 architecture.
  • the embodiments of this application are applied to the UE-to-UE relay scenario under the L2 architecture, that is, the first terminal device and the second terminal device communicate through the relay device.
  • the relay connection between the first terminal device and the second terminal device may be a PC5 link.
  • the first terminal device may be a source device or a source terminal
  • the second terminal device may be a target device or a target terminal
  • the relay device may be a relay terminal
  • the input parameters of the signature of the second terminal device include at least one of the following: information of the user to which the second terminal device belongs and the first temporary public key. That is, the second terminal device may generate a signature of the second terminal device based on at least one of the information of the user to which the second terminal device belongs and the first temporary public key.
  • the input parameters of the relay device's signature include at least one of the following: the signature of the second terminal device and the information of the user to which the relay device belongs. That is, the relay device may generate the signature of the relay device based on at least one of the signature of the second terminal device and the information of the user to which the relay device belongs.
  • the relay device may verify the validity of the KPAK of the second terminal device based on one or more KPAKs stored locally. For example, if there is a KPAK consistent with the KPAK of the second terminal device among the KPAKs stored locally on the relay device, the KPAK of the second terminal device is valid.
  • one or more KPAKs stored locally on the first terminal device may be preconfigured by the KMS.
  • the first terminal device may derive the first key based on the first temporary public key generated by the second terminal device, relevant information of the relay device, and the second temporary private key generated by the first terminal device.
  • the second terminal device may derive the first key based on the second temporary public key generated by the first terminal device, the relevant information of the relay device, and the first temporary private key generated by the second terminal device.
  • the first temporary public key generated by the second terminal device is paired with the first temporary private key generated by the second terminal device
  • the second temporary public key generated by the first terminal device is paired with the second temporary private key generated by the first terminal device. pair.
  • the first terminal device can calculate the first key based on the first temporary public key and the second temporary private key and use the ECIES algorithm; the second terminal device can calculate the first key based on the second temporary public key and the first temporary private key. And use the ECIES algorithm to calculate the first key.
  • the signature of the second terminal device is determined by the second terminal device.
  • the device's Secret Signing Key (SSK) is generated.
  • the PVT, KPAK, and secret signature key (SSK) of the second terminal device may be pre-configured by the trusted center KMS for the second terminal device through a secure channel.
  • the secure channel may be based on the AKMA mechanism or the GBA mechanism to establish a secure connection between the second terminal device and the KMS.
  • the KMS may be directly managed by the operator or be a third-party service provider that has a commercial relationship with the operator.
  • the signature of the relay device is encrypted by the secret signature of the relay device.
  • Key SSK
  • the PVT, KPAK, and secret signature key (SSK) of the relay device may be pre-configured for the relay device by the trusted center KMS through a secure channel.
  • the secure channel can be based on the AKMA mechanism or the GBA mechanism to establish a secure connection between the relay device and the KMS.
  • the KMS can be directly managed by the operator or a third-party service provider that has a commercial relationship with the operator.
  • the relay device receives the first message sent by the first terminal device
  • the first message includes at least one of the following: security capability information of the first terminal device, security policy information of the first terminal device, information of the user to which the first terminal device belongs, a third message generated by the first terminal device.
  • security capability information of the first terminal device security policy information of the first terminal device
  • information of the user to which the first terminal device belongs a third message generated by the first terminal device.
  • the information of the user to which the first terminal device belongs includes the identification of the first terminal device and the PVT and KPAK of the first terminal device;
  • the input parameters of the signature of the first terminal device include at least one of the following: the first terminal Information about the user to whom the device belongs, the second temporary public key, M bits of the identification of the first key, and the signature of the second terminal device;
  • the first message is integrity protected by the first message verification code generated based on the first key
  • the input parameters of the first message verification code include at least one of the following: the security capability of the first terminal device Information, the security policy information of the first terminal device, the information of the user to which the first terminal device belongs, the first random number, the second temporary public key, the M bits, and the signature of the first terminal device;
  • the second temporary public key and the relevant information of the relay device are used by the second terminal device to derive the first key, the first random number, the first key and the third key generated by the second terminal device.
  • Two random numbers are used to derive a second key.
  • the second key is used to derive an integrity protection key and/or a confidentiality protection key.
  • the identity of the first key is composed of the M bits and the first The other N bits of the key's identifier are combined, and M and N are both positive integers.
  • the relay device sends a message to the first terminal device.
  • the second terminal device sends the first message after verification; wherein the first message after verification includes at least one of the following: security capability information of the first terminal device, security policy information of the first terminal device, Information about the user to whom the terminal device belongs, information about the user to whom the relay device belongs, the first random number generated by the first terminal device, the second temporary public key generated by the first terminal device and paired with the second temporary private key, M bits of the identification of the first key generated by the first terminal device, the signature of the first terminal device, the signature of the relay device, and the first message verification code; wherein, the user to whom the relay device belongs
  • the information includes the identification of the relay device and the PVT and KPAK of the relay device; the input parameters of the signature of the relay device include at least one of the following: information of the user to which the
  • the first random number and the first key generated by the first terminal device and the second random number generated by the second terminal device are used to derive the second key. That is, the first terminal device derives the second key based on at least the first random number, the first key and the second random number, and the first terminal device can derive the integrity protection key and/or the secret based on the second key.
  • the first terminal device can securely protect the sent message based on the integrity protection key and/or the confidentiality protection key.
  • the second terminal device may derive the second key based on at least the first random number, the first key and the second random number, and the second terminal device may derive the integrity protection key and/or the secret based on the second key.
  • the second terminal device can securely protect the sent message based on the integrity protection key and/or the confidentiality protection key.
  • the input parameters of the first message verification code include at least one of the following: security capability information of the first terminal device, security policy information of the first terminal device, the first random number, the third 2.
  • Temporary public key, the M bits that is, the first terminal device can be based on the security capability information of the first terminal device, the security policy information of the first terminal device, the first random number, the second temporary public key, and the M bits. At least one of them generates the first message verification code.
  • the input parameters of the first message verification code include: the security capability information of the first terminal device, the security policy information of the first terminal device, the first random number, the second temporary public key, the M bits.
  • the second terminal device may generate a first message verification based on the security capability information of the first terminal device, the security policy information of the first terminal device, the first random number, the second temporary public key, and the M bits. code and compare it with the first message verification code contained in the first message. If they are consistent, the first message verification code is valid.
  • the first message is an authentication response message, or the first message is a safe mode command message.
  • the security capability information of the first terminal device may be a list of cryptographic algorithms supported by the first terminal device.
  • the security policy information of the first terminal device may be whether the first terminal device supports confidentiality protection or integrity protection.
  • the security policy information of the first terminal device includes: the security policy information of the first terminal device on the control plane, and/or the security policy information of the first terminal device on the user plane.
  • the M bits may be the highest M bits of the identity of the first key, and the N bits may be the lowest N bits of the identity of the first key; or, The M bits may be the first M bits of the identifier of the first key, and the N bits may be the last N bits of the identifier of the first key; or, the M bits may be are the even-numbered bits of the identifier of the first key, and the N bits may be the odd-numbered bits of the identifier of the first key.
  • the values of M and N may be the same or different, which is not limited by this application.
  • the relay device forwards the second message sent by the second terminal device to the first terminal device
  • the second message includes at least one of the following: the second random number generated by the second terminal device, N bits of the identification of the first key generated by the second terminal device, x bits of the identifier of the generated second key, the security algorithm selected by the second terminal device, the security policy selected by the second terminal device, and the second message verification code;
  • the second message is integrity protected through the second message verification code generated based on the second key, or the second message is integrity protected through the third integrity protection key generated based on the second key.
  • the second message verification code performs integrity protection, and the input parameters of the second message verification code include at least one of the following: the second random number, the N bits, the x bits, and the second terminal device selected Security algorithm, the security policy selected by the second terminal device;
  • the identifier of the second key is obtained by combining the x bits and the other y bits of the identifier of the second key, and both x and y are positive integers.
  • the x bits may be the highest x bits of the identity of the second key, and the y bits may be the lowest y bits of the identity of the second key; or, The x bits may be the first x bits of the identifier of the second key, and the y bits may be the last y bits of the identifier of the second key; or, the x bits may be are the even-numbered bits of the identifier of the second key, and the y bits may be the odd-numbered bits of the identifier of the second key.
  • the values of x and y may be the same or different, which is not limited by this application.
  • the input parameters of the second message verification code include: the second random number, the N bits, the x bits, the security algorithm selected by the second terminal device, the security strategy.
  • the first terminal device may generate a second message verification code based on the second random number, the N bits, the x bits, the security algorithm selected by the second terminal device, and the security policy selected by the second terminal device. , and compared with the second message verification code contained in the second message. If they are consistent, the second message verification code is valid.
  • the second message is encrypted with the first key.
  • the second message may not be encrypted using the first key, or the second message may not be encrypted.
  • the second terminal device may select a security algorithm based on the security capability information of the first terminal device, and/or the second terminal device may select a security policy based on the security policy information of the first terminal device.
  • the first terminal device may use the first random number, the first key, the second random number, the source identifier, the target identifier, the length of the first random number, the second random number. At least one of the length of the number, the length of the source identifier, and the length of the target identifier is used to generate the second key.
  • the second terminal device can use the first random number, the first key, the second random number, the source identifier, the target identifier, the length of the first random number, the length of the second random number, the The second key is generated using at least one of the length of the source identifier and the length of the target identifier.
  • the source identifier is used to identify the source end of the relay connection between the first terminal device and the second terminal device
  • the target identifier is used to identify the intermediate connection between the first terminal device and the second terminal device.
  • the destination of the connection may also include other system setting parameters, such as one or more fixed parameters specified by 3GPP.
  • the first message is an authentication response message and the second message is a secure mode command (SMC) message.
  • SMC secure mode command
  • the first message is a safe mode command (SMC) message and the second message is a safe mode response message.
  • SMC safe mode command
  • the relay device forwards the third message sent by the first terminal device to the second terminal device;
  • the third message is used to indicate that the security mode establishment is completed, the third message is encrypted by the target key, and the third message includes at least one of the following: the identification of the second key generated by the first terminal device y bits, the third message verification code;
  • the target key includes one of the following: the first key, the second key, and a confidentiality protected key derived from the second key;
  • the third message is integrity protected through the third message verification code generated based on the second key, or the third message is integrity protected through the third message verification code generated based on the integrity protection key derived based on the second key.
  • the three-message verification code performs integrity protection, and the input parameters of the third message verification code include the y bits.
  • the second terminal device decrypts the third message using the target key; provided that the information carried in the third message has not been tampered with, and the third message
  • the second terminal device combines the x bits and the y bits to obtain the identity of the second key.
  • the second terminal device can generate a third message verification code based on the y bits, and compare it with the third message verification code contained in the third message. If the comparison is consistent, the third message verification code The message verification code is valid.
  • the third message is a security mode complete message (security mode complete).
  • the relay device forwards the error message sent by the second terminal device to the first terminal device; wherein the error message includes at least one of the following: cause information, fourth message verification code; wherein, The reason information is used to indicate that the security policy of the second terminal device conflicts with the first terminal device, or the reason information is used to indicate that the first message verification code verification fails, or the reason information is used to indicate that the second terminal device
  • the security algorithm negotiation between the terminal device and the first terminal device fails, and the input parameters of the fourth message verification code include at least one of the following: the reason information.
  • the first terminal device determines that the security mode establishment fails, and/or the first terminal device re-initiates the security mode establishment process.
  • the error message may also be integrity protected.
  • the cause information is used to indicate that the security policy of the second terminal device conflicts with the first terminal device.
  • the second terminal device does not support the security policy information of the first terminal device carried in the first message. .
  • the cause information is used to indicate that the security algorithm negotiation between the second terminal device and the first terminal device failed.
  • the second terminal device does not support the security capabilities of the first terminal device carried in the first message. information.
  • the first key may be K D
  • the identifier of the first key may be K D ID
  • the second key may be K D -SESS
  • the identifier of the second key may be K D-SESS ID.
  • the integrity protection key includes an integrity protection key for the control plane (KD -CPint ) and an integrity protection key for the user plane ( KD-UPint ); and/or the confidentiality
  • the protection keys include a confidentiality protection key for the control plane (K D-CPenc ) and a confidentiality protection key for the user plane (K D-UPenc ).
  • the first random number, the first key and the second random number generated by the second terminal device are used to derive the second key
  • the second key is used to derive the integrity protection key and /or confidentiality protection key, which can ensure the identity security of the first terminal device and the second terminal device and the confidentiality and integrity of the communication data, thereby ensuring the confidentiality and integrity of the data transmitted by both parties and preventing other devices from even relaying Device eavesdropping.
  • the embodiment of this application is suitable for the secure communication establishment process between the source device (first terminal device) and the target device (second terminal device) under the 5G L2 UE-to-UE relay architecture.
  • public key signature technology it can ensure the identity authenticity of the terminal device and the non-repudiation of the message, and can resist replay attacks, man-in-the-middle attacks, disguise and other active attacks, while ensuring the integrity of the authentication process messages, and using the 3GPP standard
  • the ECIES algorithm is used to establish end-to-end security between the source UE and the target UE, ensuring the confidentiality and integrity of the data transmitted by both parties, and preventing eavesdropping by external adversaries and even relays; the embodiment of this application ensures The scalability of the secure communication establishment mechanism.
  • the embodiments of this application can realize the security negotiation of the user plane and control plane security policies between the source UE and the target UE, as well as the encryption and integrity protection algorithms supported by both parties, and can achieve integrity. Protect against tampering and downgrade attacks.
  • the first terminal device side embodiment of the present application is described in detail above with reference to FIGS. 7 to 8 .
  • another embodiment of the first terminal device side of the present application is described in detail with reference to FIG. 11 .
  • FIG 11 is a schematic flowchart of a communication relay method 500 according to an embodiment of the present application.
  • the communication relay method 500 may include at least part of the following content:
  • the first terminal device sends a first message to the second terminal device through the relay device; wherein the first message includes at least one of the following: security capability information of the first terminal device, security policy of the first terminal device Information, information about the user to which the first terminal device belongs, the first random number generated by the first terminal device, the second temporary public key generated by the first terminal device, and the identification of the first key generated by the first terminal device M bits, the signature of the first terminal device, and the first message verification code; wherein the information of the user to which the first terminal device belongs includes the identification of the first terminal device and the PVT and KPAK of the first terminal device;
  • the input parameters of the signature of the first terminal device include at least one of the following: information of the user to which the first terminal device belongs, the second temporary public key, M bits of the identification of the first key, the second terminal Signature of the device; wherein the first message is integrity protected by the first message verification code generated based on the first key, and the input parameters of the first message verification code include at least one of the following: the first terminal The
  • the identity of the first key is composed of the M bits and The other N bits of the identification of the first key are combined, and M and N are both positive integers; where the relevant information of the relay device includes one of the following: the identity information of the relay device, the relay device The random number generated by this relay device.
  • This embodiment is based on the ECCSI signature scheme to establish a secure connection in the UE-to-UE relay scenario under the L2 architecture.
  • the embodiments of this application are applied to the UE-to-UE relay scenario under the L2 architecture, that is, the first terminal device and the second terminal device communicate through the relay device.
  • the relay connection between the first terminal device and the second terminal device may be a PC5 link.
  • the first random number and the first key generated by the first terminal device and the second random number generated by the second terminal device are used to derive the second key. That is, the first terminal device derives the second key based on at least the first random number, the first key and the second random number, and the first terminal device can derive the integrity protection key and/or the secret based on the second key.
  • the first terminal device can securely protect the sent message based on the integrity protection key and/or the confidentiality protection key.
  • the second terminal device may derive the second key based on at least the first random number, the first key and the second random number, and the second terminal device may derive the integrity protection key and/or the secret based on the second key.
  • the second terminal device can securely protect the sent message based on the integrity protection key and/or the confidentiality protection key.
  • the input parameters of the first message verification code include at least one of the following: security capability information of the first terminal device, security policy information of the first terminal device, the first random number, the third 2.
  • Temporary public key, the M bits that is, the first terminal device can be based on the security capability information of the first terminal device, the security policy information of the first terminal device, the first random number, the second temporary public key, and the M bits. At least one of them generates the first message verification code.
  • the input parameters of the first message verification code include: the security capability information of the first terminal device, the security policy information of the first terminal device, the first random number, the second temporary public key, the M bits.
  • the second terminal device may generate a first message verification based on the security capability information of the first terminal device, the security policy information of the first terminal device, the first random number, the second temporary public key, and the M bits. code and compare it with the first message verification code contained in the first message. If they are consistent, the first message verification code is valid.
  • the first message is an authentication response message, or the first message is a safe mode command message.
  • the security capability information of the first terminal device may be a list of cryptographic algorithms supported by the first terminal device.
  • the security policy information of the first terminal device may be whether the first terminal device supports confidentiality protection or integrity protection.
  • the security policy information of the first terminal device includes: the security policy information of the first terminal device on the control plane, and/or the security policy information of the first terminal device on the user plane.
  • the M bits may be the highest M bits of the identity of the first key, and the N bits may be the lowest N bits of the identity of the first key; or, The M bits may be the first M bits of the identifier of the first key, and the N bits may be the last N bits of the identifier of the first key; or, the M bits may be are the even-numbered bits of the identifier of the first key, and the N bits may be the odd-numbered bits of the identifier of the first key.
  • the values of M and N may be the same or different, which is not limited by this application.
  • the first terminal device receives the second message sent by the second terminal device through the relay device;
  • the second message includes at least one of the following: the second random number generated by the second terminal device, N bits of the identification of the first key generated by the second terminal device, x bits of the identifier of the generated second key, the security algorithm selected by the second terminal device, the security policy selected by the second terminal device, and the second message verification code;
  • the second message is integrity protected through the second message verification code generated based on the second key, or the second message is integrity protected through the third integrity protection key generated based on the second key.
  • the second message verification code performs integrity protection, and the input parameters of the second message verification code include at least one of the following: the second random number, the N bits, the x bits, and the second terminal device selected Security algorithm, the security policy selected by the second terminal device;
  • the identifier of the second key is obtained by combining the x bits and the other y bits of the identifier of the second key, and x and y are both positive integers.
  • the first terminal device if the information carried in the second message has not been tampered with, the first terminal device generates the second random number based on at least the first random number, the first key and the second random number. key, the first terminal device generates an integrity protection key and/or a confidentiality protection key based on the second key, and the first terminal device combines the M bits and the N bits to obtain the The identification of the first key, the first terminal device generates y bits of the identification of the second key, and combines the x bits and the y bits to obtain the identification of the second key;
  • the first terminal device When the second message verification code is valid, the first terminal device generates an integrity protection key and/or a secret based on the security algorithm selected by the second terminal device, the second key, and the second key.
  • the security protection key and the security policy selected by the second terminal device are used to communicate with the second terminal device.
  • the second message is encrypted with the first key.
  • the second message may not be encrypted using the first key, or the second message may not be encrypted.
  • the first terminal device decrypts the second message according to the first key; if the information carried in the second message is not tampered with, the first terminal device at least decrypts the second message according to the first random key. number, the first key and the second random number to generate the second key, the first terminal device generates an integrity protection key and/or a confidentiality protection key based on the second key, and the first The terminal device combines the M bits and the N bits to obtain the identity of the first key, the first terminal device generates y bits of the identity of the second key, and combines the x bits Combine with the y bits to obtain the identity of the second key;
  • the first terminal device When the second message verification code is valid and the third message verification code is valid, the first terminal device generates a complete message based on the security algorithm selected by the second terminal device, the second key, and the second key.
  • the security protection key and/or the confidentiality protection key and the security policy selected by the second terminal device are used to communicate with the second terminal device.
  • the x bits may be the highest x bits of the identity of the second key, and the y bits may be the lowest y bits of the identity of the second key; or, The x bits may be the first x bits of the identifier of the second key, and the y bits may be the last y bits of the identifier of the second key; or, the x bits may be are the even-numbered bits of the identifier of the second key, and the y bits may be the odd-numbered bits of the identifier of the second key.
  • the values of x and y may be the same or different, which is not limited by this application.
  • the input parameters of the second message verification code include: the second random number, the N bits, the x bits, the security algorithm selected by the second terminal device, the security strategy.
  • the first terminal device may generate a second message verification code based on the second random number, the N bits, the x bits, the security algorithm selected by the second terminal device, and the security policy selected by the second terminal device. , and compared with the second message verification code contained in the second message. If they are consistent, the second message verification code is valid.
  • the second terminal device may select a security algorithm based on the security capability information of the first terminal device, and/or the second terminal device may select a security policy based on the security policy information of the first terminal device.
  • the first terminal device may use the first random number, the first key, the second random number, the source identifier, the target identifier, the length of the first random number, the second random number. At least one of the length of the number, the length of the source identifier, and the length of the target identifier is used to generate the second key.
  • the source identifier is used to identify the source end of the relay connection between the first terminal device and the second terminal device
  • the target identifier is used to identify the intermediate connection between the first terminal device and the second terminal device.
  • the destination of the connection may also include other system setting parameters, such as one or more fixed parameters specified by 3GPP.
  • the first message is an authentication response message
  • the second message is an SMC message
  • the first message is an SMC message
  • the second message is a safe mode response message
  • the first terminal device sends the third message to the second terminal device through the relay device;
  • the third message is used to indicate that the security mode establishment is completed, the third message is encrypted by the target key, and the third message includes at least one of the following: the y bits of the identification of the second key, Third message verification code;
  • the target key includes one of the following: the first key, the second key, and a confidentiality protected key derived from the second key;
  • the third message is integrity protected through the third message verification code generated based on the second key, or the third message is integrity protected through the third message verification code generated based on the integrity protection key derived based on the second key.
  • the three-message verification code performs integrity protection, and the input parameters of the third message verification code include the y bits.
  • the second terminal device decrypts the third message using the target key; provided that the information carried in the third message has not been tampered with, and the third message
  • the second terminal device combines the x bits and the y bits to obtain the identity of the second key.
  • the second terminal device can generate a third message verification code based on the y bits, and compare it with the third message verification code contained in the third message. If the comparison is consistent, the third message verification code The message verification code is valid.
  • the third message is a security mode complete message (security mode complete).
  • the first terminal device receives an error message sent by the second terminal device through the relay device; wherein, the error message includes at least one of the following: cause information, a fourth message verification code; wherein, the error message
  • the reason information is used to indicate that the security policy of the second terminal device conflicts with the first terminal device, or the reason information is used to indicate that the first message verification code verification fails, or the reason information is used to indicate that the second terminal device
  • the security algorithm negotiation between the device and the first terminal device fails, and the input parameters of the fourth message verification code include at least one of the following: the reason information;
  • the first terminal device determines that the security mode establishment fails, and/or the first terminal device re-initiates the security mode establishment process.
  • the error message may also be integrity protected.
  • the cause information is used to indicate that the security policy of the second terminal device conflicts with the first terminal device.
  • the second terminal device does not support the security policy information of the first terminal device carried in the first message. .
  • the cause information is used to indicate that the security algorithm negotiation between the second terminal device and the first terminal device failed.
  • the second terminal device does not support the security capabilities of the first terminal device carried in the first message. information.
  • the first terminal device receives the authentication request message sent by the second terminal device through the relay device;
  • the authentication request message includes at least one of the following: information about the user to which the second terminal device belongs, information about the user to which the relay device belongs, the first temporary public key generated by the second terminal device, Signature, the signature of the relay device, and relevant information of the relay device;
  • the information of the user to which the second terminal device belongs includes the identification of the second terminal device and the PVT and KPAK of the second terminal device; the information of the user to which the relay device belongs includes the identification of the relay device and the relay device. PVT and KPAK; the input parameters of the signature of the second terminal device include at least one of the following: the information of the user to which the second terminal device belongs and the first temporary public key; the input parameters of the signature of the relay device include at least one of the following: One: the signature of the second terminal device and the information of the user to which the relay device belongs; the first temporary public key and the relevant information of the relay device are used by the first terminal device to derive the first key.
  • the input parameters of the signature of the second terminal device include at least one of the following: information of the user to which the second terminal device belongs and the first temporary public key. That is, the second terminal device may generate a signature of the second terminal device based on at least one of the information of the user to which the second terminal device belongs and the first temporary public key.
  • the input parameters of the relay device's signature include at least one of the following: the signature of the second terminal device and the information of the user to which the relay device belongs. That is, the relay device may generate the signature of the relay device based on at least one of the signature of the second terminal device and the information of the user to which the relay device belongs.
  • the signature of the second terminal device is determined by the second terminal device.
  • the device's Secret Signing Key (SSK) is generated.
  • the PVT, KPAK, and secret signature key (SSK) of the second terminal device may be pre-configured by the trusted center KMS for the second terminal device through a secure channel.
  • the secure channel may be based on the AKMA mechanism or the GBA mechanism to establish a secure connection between the second terminal device and the KMS.
  • the KMS may be directly managed by the operator or be a third-party service provider that has a commercial relationship with the operator.
  • the signature of the relay device is encrypted by the secret signature of the relay device.
  • Key SSK
  • the PVT, KPAK, and secret signature key (SSK) of the relay device may be pre-configured for the relay device by the trusted center KMS through a secure channel.
  • the secure channel can be based on the AKMA mechanism or the GBA mechanism to establish a secure connection between the relay device and the KMS.
  • the KMS can be directly managed by the operator or a third-party service provider that has a commercial relationship with the operator.
  • the KPAK of the second terminal device and the KPAK of the relay device are valid, and the signature verification of the second terminal device based on the identity of the second terminal device and the PVT of the second terminal device is successful.
  • the first terminal device generates a second temporary private key, and the first terminal device generates a second temporary private key according to the first terminal device.
  • the first key is derived from a temporary public key, relevant information of the relay device and the second temporary private key.
  • the first terminal device may verify the validity of the KPAK of the second terminal device and the KPAK of the relay device based on one or more KPAKs stored locally. For example, if there is a KPAK consistent with the KPAK of the second terminal device in the KPAK stored locally on the first terminal device, the KPAK of the second terminal device is valid; and there is a KPAK consistent with the KPAK stored locally on the first terminal device. In the case where the KPAK of the relay device is consistent with the KPAK, the KPAK of the relay device is valid.
  • one or more KPAKs stored locally on the first terminal device may be preconfigured by the KMS.
  • the first terminal device may derive the first secret key based on the first temporary public key generated by the second terminal device, the relevant information of the relay device, and the second temporary private key generated by the first terminal device. key.
  • the second terminal device may derive the first key based on the second temporary public key generated by the first terminal device, the relevant information of the relay device, and the first temporary private key generated by the second terminal device.
  • the first temporary public key generated by the second terminal device is paired with the first temporary private key generated by the second terminal device
  • the second temporary public key generated by the first terminal device is paired with the second temporary private key generated by the first terminal device. pair.
  • the first terminal device can calculate the first key based on the first temporary public key and the second temporary private key and use the ECIES algorithm; the second terminal device can calculate the first key based on the second temporary public key and the first temporary private key. And use the ECIES algorithm to calculate the first key.
  • the first key may be K D
  • the identifier of the first key may be K D ID
  • the second key may be K D -SESS
  • the identifier of the second key may be K D-SESS ID.
  • the integrity protection key includes an integrity protection key for the control plane (KD -CPint ) and an integrity protection key for the user plane ( KD-UPint ); and/or the confidentiality
  • the protection keys include a confidentiality protection key for the control plane (K D-CPenc ) and a confidentiality protection key for the user plane (K D-UPenc ).
  • the first random number, the first key and the second random number generated by the second terminal device are used to derive the second key
  • the second key is used to derive the integrity protection key and /or confidentiality protection key, which can ensure the identity security of the first terminal device and the second terminal device and the confidentiality and integrity of the communication data, thereby ensuring the confidentiality and integrity of the data transmitted by both parties and preventing other devices from even relaying Device eavesdropping.
  • the embodiment of this application is suitable for the secure communication establishment process between the first terminal device (source device) and the second terminal device (target device) under the 5G L2 UE-to-UE relay architecture.
  • public key signature technology it can ensure the identity authenticity of the terminal device and the non-repudiation of the message, and can resist replay attacks, man-in-the-middle attacks, disguise and other active attacks, while ensuring the integrity of the authentication process messages, and using the 3GPP standard
  • the ECIES algorithm is used to establish end-to-end security between the source UE and the target UE, ensuring the confidentiality and integrity of the data transmitted by both parties, and preventing eavesdropping by external adversaries and even relays; the embodiment of this application ensures The scalability of the secure communication establishment mechanism.
  • the embodiments of this application can realize the security negotiation of the user plane and control plane security policies between the source UE and the target UE, as well as the encryption and integrity protection algorithms supported by both parties, and can achieve integrity. Protect against tampering and downgrade attacks.
  • the first terminal device side embodiment of the present application is described in detail above with reference to FIGS. 7 to 8 .
  • the second terminal device side embodiment of the present application is described in detail below with reference to FIG. 12 . It should be understood that the second terminal device side implementation The example corresponds to the first terminal device side embodiment, and similar descriptions may refer to the first terminal device side embodiment.
  • FIG 12 is a schematic flowchart of a communication relay method 600 according to an embodiment of the present application. As shown in Figure 12, the communication relay method 600 may include at least part of the following content:
  • the second terminal device receives the first message sent by the first terminal device through the relay device; wherein the first message includes at least one of the following: the security capability information of the first terminal device, the security capability information of the first terminal device.
  • Policy information information about the user to which the first terminal device belongs, information about the user to which the relay device belongs, the first random number generated by the first terminal device, the second temporary public key generated by the first terminal device, the first M bits of the identification of the first key generated by the terminal device, the signature of the first terminal device, the signature of the relay device, and the first message verification code; wherein, the information of the user to which the first terminal device belongs includes the The identity of the first terminal device and the PVT and KPAK of the first terminal device; the information of the user to which the relay device belongs includes the identity of the relay device and the PVT and KPAK of the relay device; the signature of the first terminal device
  • the input parameters include at least one of the following: information about the user to which the first terminal device belongs, the second temporary public key, M bits of the identification
  • the first random number, the first key and the second random number generated by the second terminal device are used to derive the second key.
  • the key is used to derive the integrity protection key and/or the confidentiality protection key.
  • the identity of the first key is obtained by combining the M bits with the other N bits of the identity of the first key.
  • M and N is a positive integer; wherein, the relevant information of the relay device includes one of the following: the identity information of the relay device, the random number generated by the relay device, and the counter generated by the relay device.
  • This embodiment is based on the ECCSI signature scheme to establish a secure connection in the UE-to-UE relay scenario under the L2 architecture.
  • the embodiments of this application are applied to the UE-to-UE relay scenario under the L2 architecture, that is, the first terminal device and the second terminal device communicate through the relay device.
  • the relay connection between the first terminal device and the second terminal device may be a PC5 link.
  • the first random number and the first key generated by the first terminal device and the second random number generated by the second terminal device are used to derive the second key. That is, the first terminal device derives the second key based on at least the first random number, the first key and the second random number, and the first terminal device can derive the integrity protection key and/or the secret based on the second key.
  • the first terminal device can securely protect the sent message based on the integrity protection key and/or the confidentiality protection key.
  • the second terminal device may derive the second key based on at least the first random number, the first key and the second random number, and the second terminal device may derive the integrity protection key and/or the secret based on the second key.
  • the second terminal device can securely protect the sent message based on the integrity protection key and/or the confidentiality protection key.
  • the input parameters of the first message verification code include at least one of the following: security capability information of the first terminal device, security policy information of the first terminal device, the first random number, the third 2.
  • Temporary public key, the M bits that is, the first terminal device may be based on the security capability information of the first terminal device, the security policy information of the first terminal device, the first random number, the second temporary public key, and the M bits. At least one of them generates the first message verification code.
  • the signature of the first terminal device is generated by the secret signature key of the first terminal device; and/or the signature of the relay device is generated by the secret signature key of the relay device.
  • the first message is an authentication response message, or the first message is a safe mode command message.
  • the security capability information of the first terminal device may be a list of cryptographic algorithms supported by the first terminal device.
  • the security policy information of the first terminal device may be whether the first terminal device supports confidentiality protection or integrity protection.
  • the security policy information of the first terminal device includes: the security policy information of the first terminal device on the control plane, and/or the security policy information of the first terminal device on the user plane.
  • the M bits may be the highest M bits of the identity of the first key, and the N bits may be the lowest N bits of the identity of the first key; or, The M bits may be the first M bits of the identifier of the first key, and the N bits may be the last N bits of the identifier of the first key; or, the M bits may be are the even-numbered bits of the identifier of the first key, and the N bits may be the odd-numbered bits of the identifier of the first key.
  • the values of M and N may be the same or different, which is not limited by this application.
  • the second terminal device checks the KPAK of the first terminal device and the KPAK of the relay device respectively. If the KPAK of the first terminal device and the KPAK of the relay device are valid, and based on The identity of the first terminal device and the PVT of the first terminal device are used to verify the signature of the first terminal device, and the signature of the relay device is verified based on the identity of the relay device and the PVT of the relay device.
  • the second terminal device When the signature of the first terminal device and the signature of the relay device are successfully verified, and the information carried in the first message has not been tampered with, the second terminal device generates a second random number, and the second terminal The device generates the second key based on at least the first random number, the first key and the second random number, and the second terminal device generates an integrity protection key and/or confidentiality protection based on the second key. key, and the second terminal device generates N bits of the identifier of the first key, and combines the M bits and the N bits to obtain the identifier of the first key.
  • the second terminal device may use the first random number, the first key, the second random number, the source identifier, the target identifier, the length of the first random number, the second random number. At least one of the length of the number, the length of the source identifier, and the length of the target identifier is used to generate the second key.
  • the source identifier is used to identify the source end of the relay connection between the first terminal device and the second terminal device
  • the target identifier is used to identify the intermediate connection between the first terminal device and the second terminal device.
  • the destination of the connection may also include other system setting parameters, such as one or more fixed parameters specified by 3GPP.
  • the input parameters of the first message verification code include: the security capability information of the first terminal device, the security policy information of the first terminal device, the first random number, the second temporary public key, the M bits.
  • the second terminal device may generate a first message verification based on the security capability information of the first terminal device, the security policy information of the first terminal device, the first random number, the second temporary public key, and the M bits. code and compare it with the first message verification code contained in the first message. If they are consistent, the first message verification code is valid.
  • the second terminal device when the first message verification code is valid, sends a second message to the first terminal device through the relay device; wherein the second message includes at least one of the following : the second random number, the N bits, the x bits of the identifier of the second key generated by the second terminal device, the security algorithm selected by the second terminal device, the Security policy, second message verification code;
  • the second message is integrity protected through the second message verification code generated based on the second key, or the second message is integrity protected through the third integrity protection key generated based on the second key.
  • the second message verification code performs integrity protection, and the input parameters of the second message verification code include at least one of the following: the second random number, the N bits, the x bits, and the second terminal device selected Security algorithm, the security policy selected by the second terminal device;
  • the identifier of the second key is obtained by combining the x bits and the other y bits of the identifier of the second key, and both x and y are positive integers.
  • the input parameters of the second message verification code include: the second random number, the N bits, the x bits, the security algorithm selected by the second terminal device, the security strategy.
  • the first terminal device may generate a second message verification code based on the second random number, the N bits, the x bits, the security algorithm selected by the second terminal device, and the security policy selected by the second terminal device. , and compared with the second message verification code contained in the second message. If they are consistent, the second message verification code is valid.
  • the x bits may be the highest x bits of the identity of the second key, and the y bits may be the lowest y bits of the identity of the second key; or, The x bits may be the first x bits of the identifier of the second key, and the y bits may be the last y bits of the identifier of the second key; or, the x bits may be are the even-numbered bits of the identifier of the second key, and the y bits may be the odd-numbered bits of the identifier of the second key.
  • the values of x and y may be the same or different, which is not limited by this application.
  • the second message is encrypted with the first key.
  • the second message may not be encrypted using the first key, or the second message may not be encrypted.
  • the second terminal device may select a security algorithm based on the security capability information of the first terminal device, and/or the second terminal device may select a security policy based on the security policy information of the first terminal device.
  • the first message is an authentication response message and the second message is a secure mode command (SMC) message.
  • SMC secure mode command
  • the first message is a safe mode command (SMC) message and the second message is a safe mode response message.
  • SMC safe mode command
  • the first terminal device may derive the first secret key based on the first temporary public key generated by the second terminal device, the relevant information of the relay device, and the second temporary private key generated by the first terminal device. key.
  • the second terminal device may derive the first key based on the second temporary public key generated by the first terminal device, the relevant information of the relay device, and the first temporary private key generated by the second terminal device.
  • the first temporary public key generated by the second terminal device is paired with the first temporary private key generated by the second terminal device
  • the second temporary public key generated by the first terminal device is paired with the second temporary private key generated by the first terminal device. pair.
  • the first terminal device can calculate the first key based on the first temporary public key and the second temporary private key and use the ECIES algorithm; the second terminal device can calculate the first key based on the second temporary public key and the first temporary private key. And use the ECIES algorithm to calculate the first key.
  • the second terminal device receives the third message sent by the first terminal device through the relay device;
  • the third message is used to indicate that the security mode establishment is completed, the third message is encrypted by the target key, and the third message includes at least one of the following: the identification of the second key generated by the first terminal device y bits, the third message verification code;
  • the target key includes one of the following: the first key, the second key, and a confidentiality protected key derived from the second key;
  • the third message is integrity protected through the third message verification code generated based on the second key, or the third message is integrity protected through the third message verification code generated based on the integrity protection key derived based on the second key.
  • the three-message verification code performs integrity protection, and the input parameters of the third message verification code include the y bits.
  • the second terminal device decrypts the third message using the target key
  • the second terminal device When the information carried in the third message has not been tampered with and the third message verification code is valid, the second terminal device combines the x bits and the y bits to obtain the second The identity of the key.
  • the second terminal device can generate a third message verification code based on the y bits, and compare it with the third message verification code contained in the third message. If the comparison is consistent, the third message verification code The message verification code is valid.
  • the third message is a security mode complete message (security mode complete).
  • the second terminal device sends an error message to the first terminal device through the relay device; wherein the error message includes at least one of the following: cause information, a fourth message verification code; wherein the cause The information is used to indicate that the security policy of the second terminal device conflicts with the first terminal device, or the reason information is used to indicate that the first message verification code verification fails, or the reason information is used to indicate that the second terminal device
  • the security algorithm negotiation with the first terminal device fails, and the input parameters of the fourth message verification code include at least one of the following: the reason information.
  • the first terminal device determines that the security mode establishment fails, and/or the first terminal device re-initiates the security mode establishment process.
  • the error message may also be integrity protected.
  • the cause information is used to indicate that the security policy of the second terminal device conflicts with the first terminal device.
  • the second terminal device does not support the security policy information of the first terminal device carried in the first message. .
  • the cause information is used to indicate that the security algorithm negotiation between the second terminal device and the first terminal device failed.
  • the second terminal device does not support the security capabilities of the first terminal device carried in the first message. information.
  • the second terminal device sends an authentication request message to the first terminal device through the relay device;
  • the authentication request message includes at least one of the following: information about the user to which the second terminal device belongs, the first temporary public key generated by the second terminal device, the signature of the second terminal device, and relevant information about the relay device. ;
  • the information of the user to which the second terminal device belongs includes the identification of the second terminal device and the PVT and KPAK of the second terminal device;
  • the input parameters of the signature of the second terminal device include at least one of the following: the second terminal The information of the user to which the device belongs and the first temporary public key; the first temporary public key and the relevant information of the relay device are used for the first terminal device to derive the first key.
  • the input parameters of the signature of the second terminal device include at least one of the following: information of the user to which the second terminal device belongs and the first temporary public key. That is, the second terminal device may generate a signature of the second terminal device based on at least one of the information of the user to which the second terminal device belongs and the first temporary public key.
  • the input parameters of the relay device's signature include at least one of the following: the signature of the second terminal device and the information of the user to which the relay device belongs. That is, the relay device may generate the signature of the relay device based on at least one of the signature of the second terminal device and the information of the user to which the relay device belongs.
  • the signature of the second terminal device is determined by the second terminal device.
  • the device's Secret Signing Key (SSK) is generated.
  • the PVT, KPAK, and secret signature key (SSK) of the second terminal device may be pre-configured by the trusted center KMS for the second terminal device through a secure channel.
  • the secure channel may be based on the AKMA mechanism or the GBA mechanism to establish a secure connection between the second terminal device and the KMS.
  • the KMS may be directly managed by the operator or be a third-party service provider that has a commercial relationship with the operator.
  • the first key may be K D
  • the identifier of the first key may be K D ID
  • the second key may be K D -SESS
  • the identifier of the second key may be K D-SESS ID.
  • the integrity protection key includes an integrity protection key for the control plane (KD -CPint ) and an integrity protection key for the user plane ( KD-UPint ); and/or the confidentiality
  • the protection keys include a confidentiality protection key for the control plane (K D-CPenc ) and a confidentiality protection key for the user plane (K D-UPenc ).
  • the first random number, the first key and the second random number generated by the second terminal device are used to derive the second key
  • the second key is used to derive the integrity protection key and /or confidentiality protection key, which can ensure the identity security of the first terminal device and the second terminal device and the confidentiality and integrity of the communication data, thereby ensuring the confidentiality and integrity of the data transmitted by both parties and preventing other devices from even relaying Device eavesdropping.
  • the embodiment of this application is suitable for the secure communication establishment process between the first terminal device (source device) and the second terminal device (target device) under the 5G L2 UE-to-UE relay architecture.
  • public key signature technology it can ensure the identity authenticity of the terminal device and the non-repudiation of the message, and can resist replay attacks, man-in-the-middle attacks, disguise and other active attacks, while ensuring the integrity of the authentication process messages, and using the 3GPP standard
  • the ECIES algorithm is used to establish end-to-end security between the source UE and the target UE, ensuring the confidentiality and integrity of the data transmitted by both parties, and preventing eavesdropping by external adversaries and even relays; the embodiment of this application ensures The scalability of the secure communication establishment mechanism.
  • the embodiments of this application can realize the security negotiation of the user plane and control plane security policies between the source UE and the target UE, as well as the encryption and integrity protection algorithms supported by both parties, and can achieve integrity. Protect against tampering and downgrade attacks.
  • the first terminal device side embodiment of the present application is described in detail above with reference to FIGS. 7 to 8 .
  • the relay device side embodiment of the present application is described in detail with reference to FIG. 13 . It should be understood that the relay device side embodiment is the same as the relay device side embodiment.
  • the first terminal device side embodiments correspond to each other, and similar descriptions may refer to the first terminal device side embodiment.
  • FIG 13 is a schematic flowchart of a communication relay method 700 according to an embodiment of the present application.
  • the communication relay method 700 may include at least part of the following content:
  • the relay device receives the first message sent by the first terminal device; wherein the first message includes at least one of the following: security capability information of the first terminal device, security policy information of the first terminal device, Information about the user to which a terminal device belongs, the first random number generated by the first terminal device, the second temporary public key generated by the first terminal device, and the M bits of the identification of the first key generated by the first terminal device.
  • the information of the user to which the first terminal device belongs includes the identification of the first terminal device and the PVT and KPAK of the first terminal device;
  • the first terminal The input parameters of the device's signature include at least one of the following: information about the user to which the first terminal device belongs, the second temporary public key, M bits of the identification of the first key, and the signature of the second terminal device;
  • the first message is integrity protected by the first message verification code generated based on the first key
  • the input parameters of the first message verification code include at least one of the following: the security capability of the first terminal device Information, the security policy information of the first terminal device, the information of the user to which the first terminal device belongs, the first random number, the second temporary public key, the M bits, and the signature of the first terminal device;
  • the relay device sends a message to the first terminal device.
  • the two terminal devices send the first message after verification; wherein the first message after verification includes at least one of the following: security capability information of the first terminal device, security policy information of the first terminal device, Information about the user to whom the device belongs, information about the user to whom the relay device belongs, the first random number generated by the first terminal device, the second temporary public key generated by the first terminal device and paired with the second temporary private key, the M bits of the identification of the first key generated by the first terminal device, the signature of the first terminal device, the signature of the relay device, the relevant information of the relay device, and the first message verification code; wherein , the information of the user to which the relay device belongs includes the identification of the relay device and the PVT and KPAK of the relay device; the input parameters of the signature of the relay device include at least one of the
  • This embodiment is based on the ECCSI signature scheme to establish a secure connection in the UE-to-UE relay scenario under the L2 architecture.
  • the embodiments of this application are applied to the UE-to-UE relay scenario under the L2 architecture, that is, the first terminal device and the second terminal device communicate through the relay device.
  • the relay connection between the first terminal device and the second terminal device may be a PC5 link.
  • the first random number and the first key generated by the first terminal device and the second random number generated by the second terminal device are used to derive the second key. That is, the first terminal device derives the second key based on at least the first random number, the first key and the second random number, and the first terminal device can derive the integrity protection key and/or the secret based on the second key.
  • the first terminal device can securely protect the sent message based on the integrity protection key and/or the confidentiality protection key.
  • the second terminal device may derive the second key based on at least the first random number, the first key and the second random number, and the second terminal device may derive the integrity protection key and/or the secret based on the second key.
  • the second terminal device can securely protect the sent message based on the integrity protection key and/or the confidentiality protection key.
  • the input parameters of the first message verification code include at least one of the following: security capability information of the first terminal device, security policy information of the first terminal device, the first random number, the third 2.
  • Temporary public key, the M bits that is, the first terminal device can be based on the security capability information of the first terminal device, the security policy information of the first terminal device, the first random number, the second temporary public key, and the M bits. At least one of them generates the first message verification code.
  • the input parameters of the first message verification code include: the security capability information of the first terminal device, the security policy information of the first terminal device, the first random number, the second temporary public key, the M bits.
  • the second terminal device may generate a first message verification based on the security capability information of the first terminal device, the security policy information of the first terminal device, the first random number, the second temporary public key, and the M bits. code and compare it with the first message verification code contained in the first message. If they are consistent, the first message verification code is valid.
  • the first message is an authentication response message, or the first message is a safe mode command message.
  • the security capability information of the first terminal device may be a list of cryptographic algorithms supported by the first terminal device.
  • the security policy information of the first terminal device may be whether the first terminal device supports confidentiality protection or integrity protection.
  • the security policy information of the first terminal device includes: the security policy information of the first terminal device on the control plane, and/or the security policy information of the first terminal device on the user plane.
  • the M bits may be the highest M bits of the identity of the first key, and the N bits may be the lowest N bits of the identity of the first key; or, The M bits may be the first M bits of the identifier of the first key, and the N bits may be the last N bits of the identifier of the first key; or, the M bits may be are the even-numbered bits of the identifier of the first key, and the N bits may be the odd-numbered bits of the identifier of the first key.
  • the values of M and N may be the same or different, which is not limited by this application.
  • the relay device forwards the second message sent by the second terminal device to the first terminal device
  • the second message includes at least one of the following: the second random number generated by the second terminal device, N bits of the identification of the first key generated by the second terminal device, x bits of the identifier of the generated second key, the security algorithm selected by the second terminal device, the security policy selected by the second terminal device, and the second message verification code;
  • the second message is integrity protected through the second message verification code generated based on the second key, or the second message is integrity protected through the third integrity protection key generated based on the second key.
  • the second message verification code performs integrity protection, and the input parameters of the second message verification code include at least one of the following: the second random number, the N bits, the x bits, and the second terminal device selected Security algorithm, the security policy selected by the second terminal device;
  • the identifier of the second key is obtained by combining the x bits and the other y bits of the identifier of the second key, and both x and y are positive integers.
  • the x bits may be the highest x bits of the identity of the second key, and the y bits may be the lowest y bits of the identity of the second key; or, The x bits may be the first x bits of the identifier of the second key, and the y bits may be the last y bits of the identifier of the second key; or, the x bits may be are the even-numbered bits of the identifier of the second key, and the y bits may be the odd-numbered bits of the identifier of the second key.
  • the values of x and y may be the same or different, which is not limited by this application.
  • the input parameters of the second message verification code include: the second random number, the N bits, the x bits, the security algorithm selected by the second terminal device, the security strategy.
  • the first terminal device may generate a second message verification code based on the second random number, the N bits, the x bits, the security algorithm selected by the second terminal device, and the security policy selected by the second terminal device. , and compared with the second message verification code contained in the second message. If they are consistent, the second message verification code is valid.
  • the second message is encrypted with the first key.
  • the second message may not be encrypted using the first key, or the second message may not be encrypted.
  • the second terminal device may select a security algorithm based on the security capability information of the first terminal device, and/or the second terminal device may select a security policy based on the security policy information of the first terminal device.
  • the first terminal device may use the first random number, the first key, the second random number, the source identifier, the target identifier, the length of the first random number, the second random number. At least one of the length of the number, the length of the source identifier, and the length of the target identifier is used to generate the second key.
  • the second terminal device can use the first random number, the first key, the second random number, the source identifier, the target identifier, the length of the first random number, the length of the second random number, the The second key is generated using at least one of the length of the source identifier and the length of the target identifier.
  • the source identifier is used to identify the source end of the relay connection between the first terminal device and the second terminal device
  • the target identifier is used to identify the intermediate connection between the first terminal device and the second terminal device.
  • the destination of the connection may also include other system setting parameters, such as one or more fixed parameters specified by 3GPP.
  • the first message is an authentication response message and the second message is a secure mode command (SMC) message.
  • SMC secure mode command
  • the first message is a safe mode command (SMC) message and the second message is a safe mode response message.
  • SMC safe mode command
  • the relay device forwards the third message sent by the first terminal device to the second terminal device;
  • the third message is used to indicate that the security mode establishment is completed, the third message is encrypted by the target key, and the third message includes at least one of the following: the identification of the second key generated by the first terminal device y bits, the third message verification code;
  • the target key includes one of the following: the first key, the second key, and a confidentiality protected key derived from the second key;
  • the third message is integrity protected through the third message verification code generated based on the second key, or the third message is integrity protected through the third message verification code generated based on the integrity protection key derived based on the second key.
  • the three-message verification code performs integrity protection, and the input parameters of the third message verification code include the y bits.
  • the second terminal device decrypts the third message using the target key; provided that the information carried in the third message has not been tampered with, and the third message
  • the second terminal device combines the x bits and the y bits to obtain the identity of the second key.
  • the second terminal device can generate a third message verification code based on the y bits, and compare it with the third message verification code contained in the third message. If the comparison is consistent, the third message verification code The message verification code is valid.
  • the third message is a security mode complete message (security mode complete).
  • the relay device forwards the error message sent by the second terminal device to the first terminal device; wherein the error message includes at least one of the following: cause information, fourth message verification code; wherein, The reason information is used to indicate that the security policy of the second terminal device conflicts with the first terminal device, or the reason information is used to indicate that the first message verification code verification fails, or the reason information is used to indicate that the second terminal device
  • the security algorithm negotiation between the terminal device and the first terminal device fails, and the input parameters of the fourth message verification code include at least one of the following: the reason information.
  • the first terminal device determines that the security mode establishment fails, and/or the first terminal device re-initiates the security mode establishment process.
  • the error message may also be integrity protected.
  • the cause information is used to indicate that the security policy of the second terminal device conflicts with the first terminal device.
  • the second terminal device does not support the security policy information of the first terminal device carried in the first message. .
  • the cause information is used to indicate that the security algorithm negotiation between the second terminal device and the first terminal device failed.
  • the second terminal device does not support the security capabilities of the first terminal device carried in the first message. information.
  • the relay device receives an authentication request message sent by the second terminal device; wherein the authentication request message includes at least one of the following: information about the user to which the second terminal device belongs, and generated by the second terminal device.
  • the input parameters of the signature include at least one of the following: the information of the user to which the second terminal device belongs and the first temporary public key; the first temporary public key and the relevant information of the relay device are used to derive the first terminal device the first key;
  • the relay device sends a message to the first terminal device.
  • the device sends an authentication request message after verification; wherein the authentication request message after verification includes at least one of the following: information about the user to which the second terminal device belongs, information about the user to which the relay device belongs, the first temporary public key, The signature of the second terminal device, the signature of the relay device, and the relevant information of the relay device; wherein the information of the user to which the relay device belongs includes the identification of the relay device and the PVT and KPAK of the relay device;
  • the input parameters of the relay device's signature include at least one of the following: the signature of the second terminal device and the information of the user to which the relay device belongs.
  • the input parameters of the signature of the second terminal device include at least one of the following: information of the user to which the second terminal device belongs and the first temporary public key. That is, the second terminal device may generate a signature of the second terminal device based on at least one of the information of the user to which the second terminal device belongs and the first temporary public key.
  • the input parameters of the relay device's signature include at least one of the following: the signature of the second terminal device and the information of the user to which the relay device belongs. That is, the relay device may generate the signature of the relay device based on at least one of the signature of the second terminal device and the information of the user to which the relay device belongs.
  • the relay device may verify the validity of the KPAK of the second terminal device based on one or more KPAKs stored locally. For example, if there is a KPAK consistent with the KPAK of the second terminal device among the KPAKs stored locally on the relay device, the KPAK of the second terminal device is valid.
  • one or more KPAKs stored locally on the first terminal device may be pre-configured by the KMS.
  • the first terminal device may derive the first key based on the first temporary public key generated by the second terminal device, relevant information of the relay device, and the second temporary private key generated by the first terminal device.
  • the second terminal device may derive the first key based on the second temporary public key generated by the first terminal device, the relevant information of the relay device, and the first temporary private key generated by the second terminal device.
  • the first temporary public key generated by the second terminal device is paired with the first temporary private key generated by the second terminal device
  • the second temporary public key generated by the first terminal device is paired with the second temporary private key generated by the first terminal device. pair.
  • the first terminal device can calculate the first key based on the first temporary public key and the second temporary private key and use the ECIES algorithm; the second terminal device can calculate the first key based on the second temporary public key and the first temporary private key. And use the ECIES algorithm to calculate the first key.
  • the signature of the second terminal device is determined by the second terminal device.
  • the device's Secret Signing Key (SSK) is generated.
  • the PVT, KPAK, and secret signature key (SSK) of the second terminal device may be pre-configured by the trusted center KMS for the second terminal device through a secure channel.
  • the secure channel may be based on the AKMA mechanism or the GBA mechanism to establish a secure connection between the second terminal device and the KMS.
  • the KMS may be directly managed by the operator or be a third-party service provider that has a commercial relationship with the operator.
  • the signature of the relay device is encrypted by the secret signature of the relay device.
  • Key SSK
  • the PVT, KPAK, and secret signature key (SSK) of the relay device may be pre-configured for the relay device by the trusted center KMS through a secure channel.
  • the secure channel can be based on the AKMA mechanism or the GBA mechanism to establish a secure connection between the relay device and the KMS.
  • the KMS can be directly managed by the operator or a third-party service provider that has a commercial relationship with the operator.
  • the first key may be K D
  • the identifier of the first key may be K D ID
  • the second key may be K D -SESS
  • the identifier of the second key may be K D-SESS ID.
  • the integrity protection key includes an integrity protection key for the control plane (KD -CPint ) and an integrity protection key for the user plane ( KD-UPint ); and/or the confidentiality
  • the protection keys include a confidentiality protection key for the control plane (K D-CPenc ) and a confidentiality protection key for the user plane (K D-UPenc ).
  • the first random number, the first key and the second random number generated by the second terminal device are used to derive the second key
  • the second key is used to derive the integrity protection key and /or confidentiality protection key, which can ensure the identity security of the first terminal device and the second terminal device and the confidentiality and integrity of the communication data, thereby ensuring the confidentiality and integrity of the data transmitted by both parties and preventing other devices from even relaying Device eavesdropping.
  • the embodiment of this application is suitable for the secure communication establishment process between the source device (first terminal device) and the target device (second terminal device) under the 5G L2 UE-to-UE relay architecture.
  • public key signature technology it can ensure the identity authenticity of the terminal device and the non-repudiation of the message, and can resist replay attacks, man-in-the-middle attacks, disguise and other active attacks, while ensuring the integrity of the authentication process messages, and using the 3GPP standard
  • the ECIES algorithm is used to establish end-to-end security between the source UE and the target UE, ensuring the confidentiality and integrity of the data transmitted by both parties, and preventing eavesdropping by external adversaries and even relays; the embodiment of this application ensures The scalability of the secure communication establishment mechanism.
  • the embodiments of this application can realize the security negotiation of the user plane and control plane security policies between the source UE and the target UE, as well as the encryption and integrity protection algorithms supported by both parties, and can achieve integrity. Protect against tampering and downgrade attacks.
  • Embodiment 1 as shown in Figure 14, assuming that no secure connection has been established between all devices before, UE-to-UE under the L2 architecture can be established through some or all of the steps from S1-0 to S1-8. Signature-based secure communication connection in subsequent scenarios.
  • UE1 may be the first terminal device
  • UE2 may be the second terminal device
  • UE-to-UE relay may be the relay device
  • K D may be the first key
  • K D-SESS may be the second key .
  • S1-0.UE1, UE2, and terminal-to-UE relay equipment obtained the signature public key (KPAK) issued by the key management server (KMS) and a set of credentials related to the UE identity. , namely the Secret Signing Key (SSK) and Public Verification Parameters (PVT), can use the UE-to-UE relay service.
  • UE-to-UE relay registers with the network to provide the UE-to-UE Relay function, and the UE-to-UE Relay is configured with relay policy parameters.
  • S1-1.UE2 determines the destination L2 ID for signaling reception when the PC5 unicast link is established.
  • S1-2.UE1 sends an end-to-end direct communication request message through broadcast.
  • the application layer provides PC5 unicast communication information (such as broadcast L2 ID, ProSe application layer) to the ProSe layer. ID, terminal application layer ID, target terminal application layer ID, relay applicable indication), the ProSe layer triggers the terminal's discovery mechanism by sending an end-to-end broadcast direct communication request message. Messages are sent using the source L2 ID and broadcast L2 ID as destination, and contain other application-related parameters.
  • UE-to-UE Relay receives the broadcast direct communication request message and verifies whether the UE-to-UE Relay is configured to forward this application. For example, the UE-to-UE Relay will announce the same ProSe application ID as it The provided relay policies/parameters are compared.
  • UE-to-UE Relay forwards the direct communication request message broadcast end-to-end, it uses its own L2 ID as the source (Source) L2 ID, and adds the UE ID of UE-to-UE Relay in the message.
  • the adaptation layer Specify information identifying UE1.
  • UE-to-UE Relay processes this end-to-end broadcast message at the ProSe layer and forwards any subsequent end-to-end PC5-S messages based on the adaptation layer information.
  • S1-4a.UE2 is interested in the announced application. If there is no per-hop link between UE2 and UE-to-UE Relay, UE2 will trigger the UE-to-UE Relay to establish a per-hop link. UE2 sends a link establishment process message for each hop.
  • the source address is the UE2 L2 ID and the destination address is the relay's L2 ID.
  • UE2 When performing the authentication process, UE2 first generates a pair of temporary public and private keys, namely the first temporary public key (Ephemeral public key1) and the first temporary private key (Ephemeral private key1), and then communicates with UE1 through the UE-to-UE relay. .
  • UE2 sends an authentication request message, including the following parameters:
  • Information about the user to which UE2 belongs includes the identity of UE2 and the PVT and KPAK of UE2;
  • the first temporary public key (Ephemeral public key1);
  • the signature of UE2 wherein the input parameters of the signature of UE2 include at least one of the following: "information of the user to which UE2 belongs” and "first temporary public key”.
  • the UE-to-UE relay After receiving the authentication request message, the UE-to-UE relay verifies the validity of the KPAK of UE2 in the information of the user to which UE2 belongs (specifically, the UE-to-UE relay verifies that the KPAK of UE2 is valid based on the locally stored information. For example, in the KPAK stored locally in the UE-to-UE relay, there is a KPAK consistent with the KPAK of UE2, and the KPAK of UE2 is valid). The UE-to-UE relay performs the signature of UE2 based on the identity of UE2 and the PVT of UE2. verify.
  • the UE-to-UE relay sends a verified authentication request message to UE1.
  • the verified authentication request message also includes the following parameters:
  • the information of the user to which the UE-to-UE relay belongs includes the identification of the UE-to-UE relay and the PVT and KPAK of the UE-to-UE relay;
  • the signature of the UE-to-UE relay where the input parameters in the signature of the UE-to-UE relay include at least one of the following: "UE2's signature” and "information of the user to which the UE-to-UE relay belongs";
  • the relevant information of the UE-to-UE relay includes one of the following: the identity information of the UE-to-UE relay, the random number generated by the UE-to-UE relay, Counter generated by this UE-to-UE relay.
  • UE1 After receiving the authentication request message, UE1 checks the KPAK of UE2 and the KPAK of the UE-to-UE relay respectively. If the KPAK of UE2 and the KPAK of the UE-to-UE relay are valid, and based on the KPAK of UE2 The signature of UE2 is verified based on the identity and the PVT of UE2, and the signature of the UE-to-UE relay is verified based on the identity of the UE-to-UE relay and the PVT of the UE-to-UE relay.
  • UE1 If the signature of UE2 and the signature of UE-to-UE relay are verified successfully, then UE1 generates a temporary public and private key pair, that is, the second temporary public key (Ephemeral public key2) and the second temporary private key (Ephemeral private key2). Then, UE1 According to the first temporary public key, UE-to-UE relay related information and the second temporary private key, use the ECIES algorithm to calculate the shared key K D and generate M bits of K D ID. K D ID is At the mark K D .
  • UE1 sends an authentication response message through UE-to-UE relay, including the following parameters:
  • UE1 security capability information (optional);
  • Information about the user to which UE1 belongs includes the identity of UE1 and the PVT and KPAK of UE1;
  • the first random number (Nonce_1);
  • the second temporary public key (Ephemeral public key2);
  • the signature of UE1 where the signature input parameters of UE1 include but are not limited to at least one of the following: "information of the user to which UE1 belongs", “second temporary public key”, “first random number (Nonce_1)”, “K D ID “M bits” and “UE2's signature”;
  • the authentication response message is integrity protected through the first message verification code generated based on K D
  • the input parameters of the first message verification code include at least one of the following: UE1's security capability information, UE1's security policy Information, the information of the user to which UE1 belongs, the first random number (Nonce_1), the second temporary public key, the M bits of K D ID, and the signature of UE1.
  • the security capability information of UE1 and the security policy information of UE1 may not be sent in the authentication response message.
  • the UE-to-UE relay After receiving the authentication response message, the UE-to-UE relay verifies the validity of the KPAK of UE1 in the information of the user to which UE1 belongs (specifically, the UE-to-UE relay verifies that the KPAK of UE1 is valid based on the locally stored information. For example, in the KPAK stored locally in the UE-to-UE relay, there is a KPAK consistent with the KPAK of UE1, and the KPAK of UE1 is valid). The UE-to-UE relay performs the signature of UE1 based on the identity of UE1 and the PVT of UE1. verify. Finally, if the signature verification of UE1 is successful, the UE-to-UE relay sends the verification response message to UE2.
  • the verification response message contains the following parameters:
  • UE1 security capability information (optional);
  • the first random number (Nonce_1);
  • Information about the user to which UE1 belongs includes the identity of UE1 and the PVT and KPAK of UE1;
  • Signature 2 of the UE-to-UE relay where the input parameters of the signature 2 of the UE-to-UE relay include at least one of the following: "Information of the user to which the UE-to-UE relay belongs”, “Signature of UE1", “ UE2's signature” and "authentication response message after verification”;
  • UE2 After receiving the authentication response message after verification, UE2 checks the KPAK of UE1 and the KPAK of UE-to-UE relay respectively. If the KPAK of UE1 and the KPAK of UE-to-UE relay are valid, and based on The signature of UE1 is verified based on the identity of UE1 and the PVT of UE1, and the signature of the UE-to-UE relay is verified based on the identity of the UE-to-UE relay and the PVT of the UE-to-UE relay.
  • UE2 verifies the integrity of the information contained in the authentication response message based on the first temporary private key, UE-to-UE relay related information and the second temporary Public key, use the ECIES algorithm to calculate the shared key K D .
  • the first message verification code is qualified, UE2 generates N bits of K D ID, combines the N bits of K D ID with the M bits of the received K D ID, generates and stores the complete K D ID, which is subsequently used to identify K D .
  • both UE1 and UE2 have performed authentication and root key negotiation, and then UE2 starts processing the authentication response message.
  • UE2 negotiates the security policy and security algorithm, then generates a second random number (Nonce_2), and uses the first random number and the second random number to and KD to calculate KD -SESS and other keys (i.e. KD -CPint , KD -CPenc , KD -UPint , KD -UPenc ). In addition, UE2 generates x bits of K D-SESS .
  • UE2 sends an integrity-protected security mode command message to UE1 through UE-to-UE relay.
  • the security mode command message contains the following parameters:
  • the second random number (Nonce_2);
  • the security policy selected by UE2 is the security policy selected by UE2;
  • the second message verification code wherein the security mode command message is integrity protected by the second message verification code generated based on K D-SESS , or the security mode command message is integrity protected by the integrity derived based on K D-SESS
  • the second message verification code generated by the key is integrity protected, and the input parameters of the second message verification code include at least one of the following: a second random number (Nonce_2), N bits of K D ID, K D - x bits of the SESS ID, the security algorithm selected by UE2, and the security policy selected by UE2.
  • the security policies of UE2 and UE1 conflict with each other, or the first message verification code fails to be verified, or the security algorithm negotiation between UE2 and UE1 fails, UE2 will reply with an error message, where the error message includes cause information. and the fourth message verification code; wherein the reason information is used to indicate that the security policies of UE2 and UE1 conflict, or the reason information is used to indicate that the first message verification code verification fails, or the reason information is used to indicate that UE2 and UE1
  • the security algorithm negotiation of UE1 failed; the input parameters of the fourth message verification code at least include: the reason information.
  • UE1 After receiving the security mode command message, UE1 determines whether the information carried in the security mode command message has been tampered with. If it has not been tampered with, then UE1 changes the M bits of the K D ID and the N bits of the K D ID. The K D ID is obtained by merging, and UE1 calculates K D-SESS and other keys (i.e.
  • UE1 when the second message verification code is valid, UE1 generates the integrity protection key and/or confidentiality protection key based on the security algorithm selected by UE2, K D-SESS , and the K D-SESS selected by UE2. Security policy to communicate with UE2.
  • UE1 sends a security mode end message to UE2.
  • the security mode end message is encrypted by the target key, and the security mode end message includes at least one of the following: y bits of K D-SESS ID, the third message Verification code; wherein, the target key includes one of the following: K D , K D-SESS , K D-CPenc , K D-UPenc ; wherein, the security mode end message passes the third party generated based on K D-SESS
  • the message verification code performs integrity protection, or the security mode end message performs integrity protection through the third message verification code generated based on the integrity protection key derived from KD-SESS , and the input parameters of the third message verification code Includes y bits of K D-SESS ID.
  • UE2 verifies whether the third message check code is valid. If valid, UE2 combines x bits of K D-SESS ID and y bits of K D-SESS ID to obtain K D-SESS ID, and saves it. K D-SESS ID. UE2 communicates with UE1 according to the security algorithm and K D-SESS selected by UE2, generates an integrity protection key and/or a confidentiality protection key based on K D-SESS , and a security policy selected by UE2.
  • Embodiment 2 as shown in Figure 15, assuming that no secure connection has been established between all devices before, a UE-to-UE relay under the L2 architecture can be established through some or all of the steps from S2-0 to S2-8.
  • Signature-based secure communication connection in scenarios.
  • UE1 may be the first terminal device
  • UE2 may be the second terminal device
  • UE-to-UE relay may be the relay device
  • K D may be the first key
  • K D-SESS may be the second key .
  • S2-0.UE1, UE2, and terminal-to-UE relay equipment obtained the signature public key (KPAK) issued by the key management server (KMS) and a set of credentials related to the UE identity. , namely the Secret Signing Key (SSK) and Public Verification Parameters (PVT), can use the UE-to-UE relay service.
  • UE-to-UE relay registers with the network to provide the UE-to-UE Relay function, and the UE-to-UE Relay is configured with relay policy parameters.
  • S2-1.UE2 determines the destination L2 ID for signaling reception when the PC5 unicast link is established.
  • S2-2.UE1 sends an end-to-end direct communication request message through broadcast.
  • the application layer provides PC5 unicast communication information (such as broadcast L2 ID, ProSe application layer) to the ProSe layer. ID, terminal application layer ID, target terminal application layer ID, relay applicable indication), the ProSe layer triggers the terminal's discovery mechanism by sending an end-to-end broadcast direct communication request message. Messages are sent using the source L2 ID and broadcast L2 ID as destination, and contain other application-related parameters.
  • UE-to-UE Relay receives the broadcasted direct communication request message and verifies whether the UE-to-UE Relay is configured to forward this application. For example, the UE-to-UE Relay will announce the same ProSe application ID as it The provided relay policies/parameters are compared.
  • UE-to-UE Relay forwards the direct communication request message broadcast end-to-end, it uses its own L2 ID as the source (Source) L2 ID, and adds the UE ID of UE-to-UE Relay in the message.
  • the adaptation layer Specify information identifying UE1.
  • UE-to-UE Relay processes this end-to-end broadcast message at the ProSe layer and forwards any subsequent end-to-end PC5-S messages based on the adaptation layer information.
  • S2-4a.UE2 is interested in the announced application. If there is no per-hop link between UE2 and UE-to-UE Relay, UE2 will trigger UE-to-UE Relay to establish a per-hop link. UE2 sends a link establishment process message for each hop.
  • the source address is the UE2 L2 ID and the destination address is the relay's L2 ID.
  • UE2 When performing the authentication process, UE2 first generates a pair of temporary public and private keys, namely the first temporary public key (Ephemeral public key1) and the first temporary private key (Ephemeral private key1), and then communicates with UE1 through the UE-to-UE relay. .
  • UE2 sends an authentication request message, including the following parameters:
  • Information about the user to which UE2 belongs includes the identity of UE2 and the PVT and KPAK of UE2;
  • the first temporary public key (Ephemeral public key1);
  • the signature of UE2 wherein the input parameters of the signature of UE2 include at least one of the following: "information of the user to which UE2 belongs” and "first temporary public key”.
  • UE-to-UE relay After receiving the authentication request message, UE-to-UE relay verifies the validity of UE2's KPAK in the information of the user to which UE2 belongs (specifically, UE-to-UE relay verifies that UE2's KPAK is valid based on locally stored information For example, in the KPAK stored locally in the UE-to-UE relay, there is a KPAK consistent with the KPAK of UE2, and the KPAK of UE2 is valid). The UE-to-UE relay performs the signature of UE2 based on the identity of UE2 and the PVT of UE2. verify.
  • the UE-to-UE relay forwards the authentication request message, which in addition to all the contents in the above authentication request message, also includes the following parameters:
  • the information of the user to which the UE-to-UE relay belongs includes the identification of the UE-to-UE relay and the PVT and KPAK of the UE-to-UE relay;
  • the signature of the UE-to-UE relay where the input parameters in the signature of the UE-to-UE relay include at least one of the following: "UE2's signature” and "information of the user to which the UE-to-UE relay belongs";
  • the relevant information of the UE-to-UE relay includes one of the following: the identity information of the UE-to-UE relay, the random number generated by the UE-to-UE relay, Counter generated by this UE-to-UE relay.
  • UE1 After receiving the authentication request message, UE1 checks the KPAK of UE2 and the KPAK of the UE-to-UE relay respectively. If the KPAK of UE2 and the KPAK of the UE-to-UE relay are valid, and based on the KPAK of UE2 The signature of UE2 is verified based on the identity and the PVT of UE2, and the signature of the UE-to-UE relay is verified based on the identity of the UE-to-UE relay and the PVT of the UE-to-UE relay.
  • UE1 If the signature of UE2 and the signature of UE-to-UE relay are verified successfully, then UE1 generates a temporary public and private key pair, that is, the second temporary public key (Ephemeral public key2) and the second temporary private key (Ephemeral private key2). Then, UE1 According to the first temporary public key, UE-to-UE relay related information and the second temporary private key, use the ECIES algorithm to calculate the shared key K D and generate M bits of K D ID. K D ID is At the mark K D .
  • UE1 sends the safe mode command through the UE-to-UE relay, including the following parameters:
  • UE1 security capability information (optional);
  • Information about the user to which UE1 belongs includes the identity of UE1 and the PVT and KPAK of UE1;
  • the first random number (Nonce_1);
  • the second temporary public key (Ephemeral public key2);
  • the signature of UE1 where the signature input parameters of UE1 include but are not limited to at least one of the following: "information of the user to which UE1 belongs", “second temporary public key”, “first random number (Nonce_1)”, “K D ID “M bits” and “UE2's signature”;
  • the security mode command performs integrity protection through the first message verification code generated based on KD
  • the input parameters of the first message verification code include at least one of the following: UE1's security capability information, UE1's security policy Information, the information of the user to which UE1 belongs, the first random number (Nonce_1), the second temporary public key, the M bits of K D ID, and the signature of UE1.
  • the security capability information of UE1 and the security policy information of UE1 do not need to be sent in the security mode command.
  • UE-to-UE relay After receiving the security mode command, UE-to-UE relay verifies the validity of UE1's KPAK in the information of the user to which UE1 belongs (specifically, UE-to-UE relay verifies that UE1's KPAK is valid based on local storage information For example, in the KPAK stored locally in the UE-to-UE relay, there is a KPAK consistent with the KPAK of UE1, and the KPAK of UE1 is valid). The UE-to-UE relay performs the signature of UE1 based on the identity of UE1 and the PVT of UE1. verify. Finally, if the signature verification of UE1 is successful, the UE-to-UE relay sends the security mode command after verification to UE2.
  • the security mode command after verification contains the following parameters:
  • UE1 security capability information (optional);
  • the first random number (Nonce_1);
  • Information about the user to which UE1 belongs includes the identity of UE1 and the PVT and KPAK of UE1;
  • Signature 2 of the UE-to-UE relay where the input parameters of the signature 2 of the UE-to-UE relay include at least one of the following: "Information of the user to which the UE-to-UE relay belongs”, “Signature of UE1", “ Signature of UE2” and "Safe mode command after verification”.
  • UE2 After receiving the security mode command after verification, UE2 checks the KPAK of UE1 and the KPAK of UE-to-UE relay respectively. If the KPAK of UE1 and the KPAK of UE-to-UE relay are valid, and based on The signature of UE1 is verified based on the identity of UE1 and the PVT of UE1, and the signature of the UE-to-UE relay is verified based on the identity of the UE-to-UE relay and the PVT of the UE-to-UE relay.
  • UE2 verifies the integrity of the information contained in the authentication response message based on the first temporary private key, UE-to-UE relay related information and the second temporary Public key, use the ECIES algorithm to calculate the shared key K D .
  • the first message verification code is qualified, UE2 generates N bits of K D ID, combines the N bits of K D ID with the M bits of the received K D ID, generates and stores the complete K D ID, which is subsequently used to identify K D .
  • both UE1 and UE2 have performed authentication and root key negotiation, and then UE2 starts processing the security mode command.
  • the security mode command contains the security capability information of UE1 and the security policy information of UE1, UE2 negotiates the security policy and security algorithm, and then generates a second random number (Nonce_2), and uses the first random number and the second random number according to the and KD to calculate KD -SESS and other keys (i.e. KD -CPint , KD -CPenc , KD -UPint , KD -UPenc ). In addition, UE2 generates x bits of K D-SESS .
  • UE2 sends an integrity-protected security mode response to UE1 through the UE-to-UE relay.
  • the security mode response is encrypted by KD , and the security mode response contains the following parameters:
  • the second random number (Nonce_2);
  • the security policy selected by UE2 is the security policy selected by UE2;
  • the second message verification code wherein the security mode response is integrity protected through the second message verification code generated based on K D-SESS , or the security mode response is integrity protected through the integrity key derived based on K D-SESS
  • the generated second message verification code is integrity protected, and the input parameters of the second message verification code include at least one of the following: second random number (Nonce_2), N bits of K D ID, K D-SESS x bits of the ID, the security algorithm selected by UE2, and the security policy selected by UE2.
  • the security policies of UE2 and UE1 conflict with each other, or the first message verification code fails to be verified, or the security algorithm negotiation between UE2 and UE1 fails, UE2 will reply with an error message, where the error message includes cause information. and the fourth message verification code; wherein the reason information is used to indicate that the security policies of UE2 and UE1 conflict, or the reason information is used to indicate that the first message verification code verification fails, or the reason information is used to indicate that UE2 and UE1
  • the security algorithm negotiation of UE1 failed; the input parameters of the fourth message verification code at least include: the reason information.
  • UE1 After receiving the security mode response, UE1 decrypts the security mode response based on K D. After decryption, UE1 determines whether the information carried in the security mode response has been tampered with. If it has not been tampered with, then UE1 will K D ID M bits and N bits of K D ID are combined to obtain K D ID, and UE1 calculates K D-SESS and other keys (i.e., K D-CPint , K D-CPenc , K D -UPint , K D-UPenc ), UE1 generates y bits of K D-SESS ID, and UE1 combines x bits of K D-SESS ID and y bits of K D-SESS ID to obtain K D -SESS ID, and save K D-SESS ID. Then, UE1 verifies whether the second message check code is valid. If valid, UE1 prepares to use the new security environment to protect subsequent communications.
  • K D-SESS and other keys i.e.
  • UE1 when the second message verification code is valid, UE1 generates the integrity protection key and/or confidentiality protection key based on the security algorithm selected by UE2, K D-SESS , and the K D-SESS selected by UE2. Security policy to communicate with UE2.
  • UE1 sends a security mode end message to UE2.
  • the security mode end message is encrypted by the target key, and the security mode end message includes at least one of the following: y bits of K D-SESS ID, the third message Verification code; wherein, the target key includes one of the following: K D , K D-SESS , K D-CPenc , K D-UPenc ; wherein, the security mode end message passes the third party generated based on K D-SESS
  • the message verification code performs integrity protection, or the security mode end message performs integrity protection through the third message verification code generated based on the integrity protection key derived from KD-SESS , and the input parameters of the third message verification code Includes y bits of K D-SESS ID.
  • UE2 verifies whether the third message check code is valid. If valid, UE2 combines x bits of K D-SESS ID and y bits of K D-SESS ID to obtain K D-SESS ID, and saves it. K D-SESS ID. UE2 communicates with UE1 according to the security algorithm and K D-SESS selected by UE2, generates an integrity protection key and/or a confidentiality protection key based on K D-SESS , and a security policy selected by UE2.
  • FIG 16 is a schematic flow chart of a communication relay method 800 according to an embodiment of the present application.
  • the communication relay method 800 may include at least part of the following content:
  • the first terminal device sends a direct communication request to the second terminal device through the relay device; wherein the direct communication request includes at least one of the following: security capability information of the first terminal device, security policy of the first terminal device information, the first temporary public key generated by the first terminal device, and the first random number generated by the first terminal device; wherein the direct communication request is encrypted by the first encryption key, and the direct communication request is encrypted by the first encryption key.
  • the integrity protection key performs integrity protection
  • the first encryption key is an encryption key derived based on the symmetric key of the terminal that has been registered and authorized to use terminal-to-UE relay (UE-to-UE relay) communication
  • the first integrity protection key is an integrity protection key derived based on the symmetric key of a terminal that has been registered and authorized to use UE-to-UE relay communication; wherein, the first temporary public key and the relay device
  • the relevant information is used by the second terminal device to derive the first key; the first random number, the first key and the second random number generated by the second terminal device are used to derive the second key, and the first random number is used to derive the second key.
  • the second key is used to derive the second encryption key and/or the second integrity protection key, or the first random number, the first key and the second random number generated by the second terminal device are used to derive The second encryption key and/or the second integrity protection key; wherein the relevant information of the relay device includes one of the following: the identity information of the relay device, the random number generated by the relay device, the relay device Counter generated by the device.
  • This embodiment establishes a secure communication solution based on the symmetric key distributed by 5G PKMT, and establishes a secure connection in the UE-to-UE relay scenario under the L2 architecture.
  • the embodiments of this application are applied to the UE-to-UE relay scenario under the L2 architecture, that is, the first terminal device and the second terminal device communicate through the relay device.
  • the relay connection between the first terminal device and the second terminal device may be a PC5 link.
  • the first terminal device may be a source device or a source terminal
  • the second terminal device may be a target device or a target terminal
  • the relay device may be a relay terminal
  • the first encryption key may be a Proximity Service Encryption Key (PEK), and the first integrity protection key may be a Proximity Service Integrity Protection Key (PIK).
  • PEK Proximity Service Encryption Key
  • PIK Proximity Service Integrity Protection Key
  • the first encryption key can also be other encryption keys
  • the first integrity protection key can also be other integrity protection keys, which is not limited by this application.
  • the symmetric key of a terminal that is registered and authorized to use UE-to-UE relay communication may be assigned by ProSe Key Management Function (PKMF) or 5G PKMF.
  • PKMF ProSe Key Management Function
  • 5G PKMF the name and number of symmetric keys allocated and managed by 5G PKMF to the UE may not be specifically defined.
  • PKMF uses the MIKEY mechanism to issue a shared key to the UE, that is, the ProSe Group Key (PGK).
  • PGK ProSe Group Key
  • the group key (PGK) is securely issued between the 5G PKMF and the UE based on the MIKEY mechanism
  • the ProSe transmission key (Prose Traffic Key, PTK) is derived between the first terminal device and the second terminal device based on the PGK.
  • the further derived ProSe integrity key (Prose Integrity Key, PIK) and ProSe encryption key (Prose Encrypt Key, PEK) to protect the information transmitted by the first terminal device and/or the second terminal device so that the first terminal device can
  • An end-to-end security context is generated between the terminal device and the second terminal device.
  • the key types involved in this embodiment may be as shown in Table 1.
  • PGK group key The UE makes a request to PKMF, which sends it securely using the MIKEY mechanism.
  • the PTK derived input parameters may be as shown in Table 2.
  • the PEK/PIK derived input parameters may be as shown in Table 3.
  • the second encryption key is used to encrypt end-to-end messages exchanged between the first terminal device and the second terminal device
  • the second integrity protection key is used to encrypt the first terminal device. End-to-end messages exchanged between the terminal device and the second terminal device are integrity protected.
  • the second encryption key may be a confidentiality protection key (K D-enc )
  • the second integrity protection key may be an integrity protection key (K D-int ).
  • the second integrity protection key includes an integrity protection key for the control plane (K D-CPint ) and an integrity protection key for the user plane (K D-UPint ); and/or, the The second encryption key includes a confidentiality protection key for the control plane (K D-CPenc ) and a confidentiality protection key for the user plane (K D-UPenc ).
  • the input parameters of the second integrity protection key include at least one of the following: the second key, the selected algorithm type identifier, the length of the selected algorithm type identifier, the integrity protection Algorithm identifier, the length of the integrity protection algorithm identifier. That is, the second key may be generated based on at least one of the second key, the selected algorithm type identifier, the length of the selected algorithm type identifier, the integrity protection algorithm identifier, and the length of the integrity protection algorithm identifier. Second integrity protection key.
  • the input parameters of the second integrity protection key include at least one of the following: the first random number, the first key, the second random number, the selected algorithm type identifier, the selected algorithm type The length of the identifier, the integrity protection algorithm identifier, and the length of the integrity protection algorithm identifier.
  • the input parameters of the second integrity protection key may also include some system setting parameters.
  • the second integrity protection key is automatically updated.
  • the input parameters of the second encryption key include at least one of the following: the second key, the selected algorithm type identifier, the length of the selected algorithm type identifier, and the confidentiality protection algorithm identifier. , the length of the confidentiality protection algorithm identifier. That is, the second key may be generated based on at least one of the second key, the selected algorithm type identifier, the length of the selected algorithm type identifier, the confidentiality protection algorithm identifier, and the length of the confidentiality protection algorithm identifier. Second encryption key.
  • the input parameters of the second encryption key include at least one of the following: the first random number, the first key, the second random number, the selected algorithm type identifier, the selected algorithm type identifier The length of Confidentiality Protection Algorithm Identifier, the length of Confidentiality Protection Algorithm Identifier.
  • the input parameters of the second encryption key may also include some system setting parameters.
  • the second encryption key is automatically refreshed.
  • the selected algorithm type identifier may be represented by "Control Plane Integrity Protection Algorithm" or by setting a specific value.
  • the selected algorithm type identifier may be represented by "Control Plane Confidentiality Protection Algorithm" or by setting a specific value.
  • the selected algorithm type identifier may be represented by "User Plane Integrity Protection Algorithm" or by setting a specific value.
  • the selected algorithm type identifier may be represented by "user plane confidentiality protected algorithm” or by setting a specific value.
  • the first terminal device receives the safe mode command sent by the second terminal device through the relay device;
  • the security mode command includes at least one of the following: a security algorithm selected by the second terminal device, a security policy selected by the second terminal device, a second temporary public key generated by the second terminal device, The generated second random number, the M bits of the identification of the first key generated by the second terminal device, the relevant information of the relay device, and the first message verification code;
  • the security mode command is encrypted by the first encryption key
  • the security mode command is integrity protected by the first integrity protection key
  • the first message verification code is generated based on the second integrity protection key.
  • the input parameters of the first message verification code include at least one of the following: the security algorithm selected by the second terminal device, the security policy selected by the second terminal device, the second temporary public key, and the second random number, The M bits, the relevant information of the relay device;
  • the second temporary public key and the relevant information of the relay device are used by the first terminal device to derive the first key, and the identification of the first key consists of the M bits and the first key.
  • the other N bits of the identifier are combined, and M and N are both positive integers.
  • the second terminal device may select a security algorithm based on the security capability information of the first terminal device, and/or the second terminal device may select a security policy based on the security policy information of the first terminal device.
  • the security capability information of the first terminal device may be a list of cryptographic algorithms supported by the first terminal device.
  • the security policy information of the first terminal device may be whether the first terminal device supports confidentiality protection or integrity protection.
  • the security policy information of the first terminal device includes: the security policy information of the first terminal device on the control plane, and/or the security policy information of the first terminal device on the user plane.
  • the M bits may be the highest M bits of the identity of the first key, and the N bits may be the lowest N bits of the identity of the first key; or, The M bits may be the first M bits of the identifier of the first key, and the N bits may be the last N bits of the identifier of the first key; or, the M bits may be are the even-numbered bits of the identifier of the first key, and the N bits may be the odd-numbered bits of the identifier of the first key.
  • the values of M and N may be the same or different, which is not limited by this application.
  • the security mode command further includes the generated by the second terminal device.
  • x bits of the identifier of the second key, and the input parameter of the first message verification code includes the x bits; wherein, the identifier of the second key consists of the x bits and the second key The other y bits of the identifier are combined, and x and y are both positive integers.
  • the x bits may be the highest x bits of the identity of the second key, and the y bits may be the lowest y bits of the identity of the second key; or, The x bits may be the first x bits of the identifier of the second key, and the y bits may be the last y bits of the identifier of the second key; or, the x bits may be are the even-numbered bits of the identifier of the second key, and the y bits may be the odd-numbered bits of the identifier of the second key.
  • the values of x and y may be the same or different, which is not limited by this application.
  • the first terminal device uses the first encryption key to decrypt the a security mode command, and using the first integrity protection key to determine the integrity of the security mode command;
  • the first terminal device uses the first temporary private key paired with the first temporary public key, the second temporary public key, and the relay device to The information derives the first key, and the first terminal device generates the N bits of the identification of the first key, and combines the M bits and the N bits to obtain the first key logo;
  • the first terminal device generates the second key based on at least the first random number, the first key and the second random number, and the first terminal device generates the second integrity protection key based on the second key.
  • key and/or the second encryption key, and the y bits of the identification of the second key generated by the first terminal device, and the x bits and the y bits are combined to obtain the second The identification of the key;
  • the first terminal device uses the security algorithm selected by the second terminal device, the second integrity protection key and/or the second encryption key, the second terminal device The security policy selected by the device communicates with the second terminal device.
  • the first terminal device transmits data to the second key through the relay device.
  • the terminal device sends a security mode establishment completion message; wherein the security mode establishment completion message is encrypted by the second key or the second encryption key, and the security mode establishment completion message is encrypted by the second key or the second complete encryption key.
  • the security mode establishment completion message includes at least the y bits of the identification of the second key.
  • the input parameters of the second integrity protection key include at least the following: One: the second key, the selected algorithm type identifier, the length of the selected algorithm type identifier, the integrity protection algorithm identifier, the length of the integrity protection algorithm identifier; and/or the second encryption key
  • the input parameters of the key include at least one of the following: the second key, the selected algorithm type identifier, the length of the selected algorithm type identifier, the confidentiality protection algorithm identifier, and the length of the confidentiality protection algorithm identifier.
  • the second random number A terminal device uses the first encryption key to decrypt the security mode command, and uses the first integrity protection key to determine the integrity of the security mode command;
  • the first terminal device uses the first temporary private key paired with the first temporary public key, the second temporary public key, and the relay device to The information derives the first key, and the first terminal device generates the N bits of the first key, and combines the M bits and the N bits to obtain the identity of the first key;
  • the first terminal device generates the second integrity protection key and/or the second encryption key based on at least the first random number, the first key and the second random number;
  • the first terminal device uses the security algorithm selected by the second terminal device, the second integrity protection key and/or the second encryption key, the second terminal device The security policy selected by the device communicates with the second terminal device.
  • the second random number A terminal device sends a security mode establishment completion message to the second terminal device through the relay device; wherein the security mode establishment completion message is encrypted by the second encryption key, and the security mode establishment completion message is encrypted by the second complete encryption key. Integrity protection using a sex-protected key.
  • the second random number include at least one of the following: the first random number, the first key, the second random number, the selected algorithm type identifier, and the length of the selected algorithm type identifier.
  • the integrity protection algorithm identifier the length of the integrity protection algorithm identifier; and/or, the input parameters of the second encryption key include at least one of the following: the first random number, the first key, the second random number Number, selected algorithm type identifier, length of selected algorithm type identifier, confidentiality protected algorithm identifier, length of confidentiality protected algorithm identifier.
  • the input parameters when generating the first key include: a second temporary private key (Ephemeral private key2) generated by the first terminal device, a first temporary private key generated by the second terminal device.
  • Temporary public key (Ephemeral public key1), and related information of the relay device such as the identity information of the relay device, or the random number generated by the relay device, or the counter (COUNT) generated by the relay device).
  • the input parameters when generating the first key include: the second temporary public key (Ephemeral public key2) generated by the first terminal device, the first temporary private key (Ephemeral private key2) generated by the second terminal device.
  • the first temporary public key is paired with the first temporary private key
  • the second temporary public key is paired with the second temporary private key
  • the first key may be K D
  • the identifier of the first key may be K D ID
  • the second key may be K D -SESS
  • the identifier of the second key may be K D-SESS ID.
  • K D The key length is at least 256 bits (bits) and is generated by both the source device and the target device through temporary public and private key negotiation. Based on the root key, K D is updated by rerunning the authentication process. K D is used to generate the next layer key K D-sess . The key can be saved even if there is no active communication session between the source and target devices. K D ID can be used to identify K D .
  • the input parameters during generation include: UE-1’s temporary private key Ephemeral private key2, UE-2’s temporary public key Ephemeral public key1, and the identity information of UE-relay, or UE-relay
  • the input parameters during generation include: UE-1's temporary public key Ephemeral public key2, UE-2's temporary private key Ephemeral private key1, And the identity of UE-relay, or the random number generated by UE-relay, or the counter COUNT generated by UE-relay.
  • K D-sess The key length is at least 256 bits. K D-sess is used to derive the next level of integrity protection or confidentiality protection key. K D -sess can be refreshed based on K D by rerunning the secure connection establishment process or the related key update process. K D-sess ID is used to identify K D-sess . KD-sess is derived from KD using key derivation algorithms such as HMAC-SHA-256 or HMAC-SM3. The input parameters of K D-sess must at least include the key K D , the random number Nonce_1 (that is, the first random number generated by the first terminal device), and the random number Nonce_2 (that is, the second random number generated by the second terminal device).
  • the input parameters of K D-sess may also include but are not limited to at least one of the following: source ID (Source ID), destination ID (Destination ID), the length of the random number Nonce_1, the length of the random number Nonce_2, the source ID (Source ID) length, destination ID (Destination ID) length.
  • the input parameters of K D-sess can also include other system setting parameters, such as one or more fixed parameters specified by 3GPP.
  • K D-CPint The key length is at least 128 bits. This key can be used for control plane data integrity protection.
  • the key is derived by K D-sess using key derivation algorithms such as HMAC-SHA-256 or HMAC-SM3. Come.
  • the input parameters of K D-CPint must contain at least the key K D-sess , the selected algorithm type identifier (such as "control plane integrity protection algorithm” or setting a specific value to represent it) and the selected algorithm type identifier.
  • the length of the symbol, the integrity protection algorithm identifier and the length of the integrity protection algorithm identifier, and other system setting parameters can be used as optional input parameters.
  • K D -CPint is automatically updated when K D- sess is automatically refreshed.
  • K D-CPenc The key length is at least 128 bits. This key can be used for control plane data confidentiality protection.
  • the key is derived by K D-sess using key derivation algorithms such as HMAC-SHA-256 or HMAC-SM3. Come.
  • the input parameters of K D-CPenc must contain at least the key K D-sess , the selected algorithm type identifier (such as "Control Plane Confidentiality Protection Algorithm" or set a specific value to represent it) and the selected algorithm type identifier
  • the length, the confidentiality protection algorithm identifier and the length of the confidentiality protection algorithm identifier, and other system setting parameters can be used as optional input parameters.
  • K D -CPenc is automatically updated when K D- sess is automatically refreshed.
  • K D-UPint The key length is at least 128 bits. This key can be used for user plane data integrity protection.
  • the key is derived by K D-sess using key derivation algorithms such as HMAC-SHA-256 or HMAC-SM3. Come.
  • the input parameters of K D-UPint must contain at least the key K D-sess , the selected algorithm type identifier (such as "user plane integrity protection algorithm” or setting a specific value to represent it) and the selected algorithm type identifier.
  • the length of the symbol, the integrity protection algorithm identifier and the length of the integrity protection algorithm identifier, and other system setting parameters can be used as optional input parameters.
  • K D -UPint is automatically updated when K D-sess is automatically refreshed.
  • K D-UPenc The key length is at least 128 bits. This key can be used for user plane data confidentiality protection.
  • the key is derived by K D-sess using key derivation algorithms such as HMAC-SHA-256 or HMAC-SM3. Come.
  • the input parameters of K D-UPenc must contain at least the key K D-sess , the selected algorithm type identifier (such as "user plane confidentiality protection algorithm” or setting a specific value to represent it) and the selected algorithm type identifier.
  • the length of the character, the confidentiality protection algorithm identifier and the length of the confidentiality protection algorithm identifier, and other system setting parameters can be used as optional input parameters.
  • K D -UPenc is automatically updated when K D -sess is automatically refreshed.
  • ECCSI in this application is only an example and is not limited to this algorithm. It can also be replaced by other identity-based public key signature and public key encryption algorithms. While replacing the public key algorithm, all requests Parameters related to the public key algorithm in the message need to be replaced accordingly.
  • the key derivation function used by the first terminal device and the second terminal device in this application is not limited to HMAC-SHA-256 or HMAC-SM3, and includes any key derivation function that meets computational security.
  • the input parameters of the key derivation function in this application are not limited to the necessary parameters mentioned above, and may include other optional parameters, such as fixed parameters set by the application system.
  • the key management center in this application is not limited to KMS, PKMF, and 5GPKMF.
  • Legal key management centers managed by operators or managed by third-party service providers are all applicable to the technical solution of this application.
  • the symmetric key issued by PKMF to the terminal device that has been registered and authorized to use the UE-to-UE relay function is not limited to the above solution.
  • the specific configuration can be changed according to the operator or service provider's design of PKMF. .
  • the information elements in all interactive messages in the secure communication establishment process in this application are not limited to the content mentioned in the above solution, and optional information elements due to application system requirements can also be added.
  • the first terminal device can generate the first key based on the direct communication request sent by the second terminal device through the relay device, and the direct communication request is encrypted by the first encryption key, and directly The communication request is integrity protected via the first integrity protection key.
  • the second integrity protection key, or the first random number generated by the first terminal device, the first key and the second terminal device are used to derive the second random number to generate the second encryption key and/or the second integrity Protecting the key can ensure the identity security of the first terminal device and the second terminal device and the confidentiality and integrity of the communication data, thereby ensuring the confidentiality and integrity of the data transmitted by both parties and preventing eavesdropping by other devices and even relay devices.
  • the embodiment of this application is suitable for the secure communication establishment process between the first terminal device (source device) and the second terminal device (target device) under the 5G L2 UE-to-UE relay architecture.
  • PKMF delivers symmetric keys, protection algorithms and key negotiation to terminal devices that have registered and are authorized to use the UE-to-UE relay function, thereby efficiently establishing source End-to-end secure channel between UE and target UE.
  • the embodiments of this application have very high efficiency in calculation and communication, and can also achieve authentication, encryption protection, integrity protection, and resistance to tampering and downgrade attacks.
  • the first terminal device side embodiment of the present application is described in detail above with reference to FIG. 16
  • the second terminal device side embodiment of the present application is described in detail below with reference to FIG. 17 . It should be understood that the second terminal device side embodiment is different from the second terminal device side embodiment.
  • the terminal device side embodiments correspond to each other, and similar descriptions may refer to the first terminal device side embodiment.
  • FIG 17 is a schematic flow chart of a communication relay method 900 according to an embodiment of the present application.
  • the communication relay method 900 may include at least part of the following content:
  • the second terminal device receives the direct communication request sent by the first terminal device through the relay device; wherein the direct communication request includes at least one of the following: the security capability information of the first terminal device, the security capability information of the first terminal device. Policy information, the first temporary public key generated by the first terminal device, the first random number generated by the first terminal device, the identification of the relay device, and the relevant information of the relay device; wherein the direct communication request passes
  • the first encryption key is encrypted, and the direct communication request is integrity protected by a first integrity protection key based on the first encryption key that is registered and authorized to use the UE-to-UE relay.
  • the first integrity protection key is an encryption key derived from the symmetric key of the terminal for UE-to-UE relay communication.
  • the first integrity protection key is an integrity protection key derived from the symmetric key of the terminal that has been registered and authorized to use UE-to-UE relay communication. Key; wherein, the relevant information of the relay device includes one of the following: the identity information of the relay device, the random number generated by the relay device, the counter generated by the relay device; the first temporary public key and the The relevant information of the relay device is used by the second terminal device to derive the first key; the first random number, the first key and the second random number generated by the second terminal device are used to derive the second key, And the second key is used to derive a second encryption key and/or a second integrity protection key, or the first random number, the first key and the second random number generated by the second terminal device For deriving a second encryption key and/or a second integrity protection key.
  • This embodiment establishes a secure communication solution based on the symmetric key distributed by 5G PKMT, and establishes a secure connection in the UE-to-UE relay scenario under the L2 architecture.
  • the embodiments of this application are applied to the UE-to-UE relay scenario under the L2 architecture, that is, the first terminal device and the second terminal device communicate through the relay device.
  • the relay connection between the first terminal device and the second terminal device may be a PC5 link.
  • the first terminal device may be a source device or a source terminal
  • the second terminal device may be a target device or a target terminal
  • the relay device may be a relay terminal
  • the first encryption key may be a Proximity Service Encryption Key (PEK), and the first integrity protection key may be a Proximity Service Integrity Protection Key (PIK).
  • PEK Proximity Service Encryption Key
  • PIK Proximity Service Integrity Protection Key
  • the first encryption key can also be other encryption keys
  • the first integrity protection key can also be other integrity protection keys, which is not limited by this application.
  • the second terminal device uses the first encryption key to decrypt the Direct communication request, and using the first integrity protection key to determine the integrity of the direct communication request;
  • the second terminal device In the case that the information carried in the direct communication request has not been tampered with, the second terminal device generates a second temporary private key, and the second terminal device generates a second temporary private key based on the first temporary public key, the second temporary private key and the The first key is derived from the relevant information of the relay device, and the second terminal device generates M bits of the identification of the first key;
  • the second terminal device generates the second random number, and the second terminal device generates the second key according to at least the first random number, the first key and the second random number.
  • the second terminal device generates the second key according to at least the first random number, the first key and the second random number.
  • the second key generates the second integrity protection key and/or the second encryption key, and the second terminal device generates x bits of the identification of the second key;
  • the identification of the first key is obtained by combining the M bits and the other N bits of the identification of the first key, M and N are both positive integers, and the identification of the second key is obtained by the x bits are combined with other y bits of the identifier of the second key, and x and y are both positive integers.
  • the second terminal device may select a security algorithm based on the security capability information of the first terminal device, and/or the second terminal device may select a security policy based on the security policy information of the first terminal device.
  • the security capability information of the first terminal device may be a list of cryptographic algorithms supported by the first terminal device.
  • the security policy information of the first terminal device may be whether the first terminal device supports confidentiality protection or integrity protection.
  • the security policy information of the first terminal device includes: the security policy information of the first terminal device on the control plane, and/or the security policy information of the first terminal device on the user plane.
  • the M bits may be the highest M bits of the identity of the first key, and the N bits may be the lowest N bits of the identity of the first key; or, The M bits may be the first M bits of the identifier of the first key, and the N bits may be the last N bits of the identifier of the first key; or, the M bits may be are the even-numbered bits of the identifier of the first key, and the N bits may be the odd-numbered bits of the identifier of the first key.
  • the values of M and N may be the same or different, which is not limited by this application.
  • the x bits may be the highest x bits of the identity of the second key, and the y bits may be the lowest y bits of the identity of the second key; or, The x bits may be the first x bits of the identifier of the second key, and the y bits may be the last y bits of the identifier of the second key; or, the x bits may be are the even-numbered bits of the identifier of the second key, and the y bits may be the odd-numbered bits of the identifier of the second key.
  • the values of x and y may be the same or different, which is not limited by this application.
  • the second terminal device transmits data to the first through the relay device.
  • the terminal device sends a safe mode command
  • the security mode command includes at least one of the following: the security algorithm selected by the second terminal device, the security policy selected by the second terminal device, and the second temporary private key generated by the second terminal device and paired with the second temporary private key.
  • the security mode command is encrypted by the first encryption key
  • the security mode command is integrity protected by the first integrity protection key
  • the first message verification code is generated based on the second integrity protection key.
  • the input parameters of the first message verification code include at least one of the following: the security algorithm selected by the second terminal device, the security policy selected by the second terminal device, the second temporary public key, and the second random number,
  • the M bits, the x bits, the relevant information of the relay device; the second temporary public key and the relevant information of the relay device are used by the first terminal device to derive the first key.
  • the second terminal device receives the first terminal device through the Following the safe mode establishment completion message sent by the device;
  • the security mode establishment completion message is encrypted by the second key or the second encryption key, and the security mode establishment completion message is integrity protected by the second key or the second integrity protection key;
  • the security mode establishment completion message includes at least the y bits of the identification of the second key.
  • the input parameters of the second integrity protection key include at least the following: One: the second key, the selected algorithm type identifier, the length of the selected algorithm type identifier, the integrity protection algorithm identifier, the length of the integrity protection algorithm identifier; and/or,
  • the input parameters of the second encryption key include at least one of the following: the second key, the selected algorithm type identifier, the length of the selected algorithm type identifier, the confidentiality protection algorithm identifier, the confidentiality protection algorithm identifier length.
  • the second random number uses the first encryption key to decrypt the direct communication request, and uses the first integrity protection key to determine the integrity of the direct communication request;
  • the second terminal device In the case that the information carried in the direct communication request has not been tampered with, the second terminal device generates a second temporary private key, and the second terminal device generates a second temporary private key based on the first temporary public key, the second temporary private key and the The first key is derived from the relevant information of the relay device, and the second terminal device generates M bits of the identification of the first key;
  • the second terminal device generates the second random number, and the second terminal device generates the second integrity protection key and/or the second random number based on at least the first random number, the first key and the second random number.
  • second encryption key
  • the identifier of the first key is obtained by combining the M bits and the other N bits of the identifier of the first key, and M and N are both positive integers.
  • the second random number The second terminal device sends a safe mode command to the first terminal device through the relay device;
  • the security mode command includes at least one of the following: the security algorithm selected by the second terminal device, the security policy selected by the second terminal device, and the second temporary private key generated by the second terminal device and paired with the second temporary private key.
  • the security mode command is encrypted by the first encryption key
  • the security mode command is integrity protected by the first integrity protection key
  • the first message verification code is generated based on the second integrity protection key.
  • the input parameters of the first message verification code include at least one of the following: the security algorithm selected by the second terminal device, the security policy selected by the second terminal device, the second temporary public key, and the second random number, The M bits; the second temporary public key and the related information of the relay device are used by the first terminal device to derive the first key.
  • the second terminal device receives the security mode establishment completion message sent by the first terminal device through the relay device;
  • the security mode establishment completion message is encrypted by the second encryption key, and the security mode establishment completion message is integrity protected by the second integrity protection key.
  • the second random number include at least one of the following: the first random number, the first key, the second random number, the selected algorithm type identifier, and the length of the selected algorithm type identifier. , the integrity protection algorithm identifier, the length of the integrity protection algorithm identifier; and/or,
  • the input parameters of the second encryption key include at least one of the following: the first random number, the first key, the second random number, the selected algorithm type identifier, and the length of the selected algorithm type identifier. , confidentiality protection algorithm identifier, the length of the confidentiality protection algorithm identifier.
  • the safe mode command also includes information related to the relay device
  • the input parameter of the first message verification code also includes information related to the relay device
  • the second terminal device selects the security algorithm according to the second terminal device, the second integrity protection key and/or the second encryption key, and the security policy selected by the second terminal device. Communicate with the first terminal device.
  • the first terminal device can generate the first key based on the direct communication request sent by the second terminal device through the relay device, and the direct communication request is encrypted by the first encryption key, and directly The communication request is integrity protected via the first integrity protection key.
  • the second integrity protection key, or the first random number generated by the first terminal device, the first key and the second terminal device are used to derive the second random number to generate the second encryption key and/or the second integrity Protecting the key can ensure the identity security of the first terminal device and the second terminal device and the confidentiality and integrity of the communication data, thereby ensuring the confidentiality and integrity of the data transmitted by both parties and preventing eavesdropping by other devices and even relay devices.
  • the embodiment of this application is suitable for the secure communication establishment process between the first terminal device (source device) and the second terminal device (target device) under the 5G L2 UE-to-UE relay architecture.
  • PKMF delivers symmetric keys, protection algorithms and key negotiation to terminal devices that have registered and are authorized to use the UE-to-UE relay function, thereby efficiently establishing source End-to-end secure channel between UE and target UE.
  • the embodiments of this application have very high efficiency in calculation and communication, and can also achieve authentication, encryption protection, integrity protection, and resistance to tampering and downgrade attacks.
  • the first terminal device side embodiment of the present application is described in detail above with reference to Figure 16.
  • the relay device side embodiment of the present application is described in detail below with reference to Figure 18. It should be understood that the relay device side embodiment is different from the first terminal device side embodiment.
  • the device side embodiments correspond to each other, and similar descriptions may refer to the first terminal device side embodiment.
  • FIG 18 is a schematic flowchart of a communication relay method 1000 according to an embodiment of the present application.
  • the communication relay method 1000 may include at least part of the following content:
  • the relay device receives a direct communication request sent by the first terminal device; wherein the direct communication request includes at least one of the following: security capability information of the first terminal device, security policy information of the first terminal device, A first temporary public key generated by a terminal device, a first random number generated by the first terminal device; wherein the direct communication request is encrypted by a first encryption key, and the direct communication request is encrypted by a first integrity protection key
  • the first encryption key is an encryption key derived based on the symmetric key of a terminal that has been registered and authorized to use UE-to-UE relay communication.
  • the first complete encryption key is
  • the integrity protection key is an integrity protection key derived based on the symmetric key of the terminal that is registered and authorized to use UE-to-UE relay communication;
  • the relay device verifies whether it is configured to forward the direct communication request. After the verification is passed, the relay device uses the first encryption key to decrypt the direct communication request to obtain QoS and charging information, and the relay device uses The first integrity protection key verifies the integrity of the direct communication request.
  • the relay device adds the relevant information of the relay device and the identification of the relay device in the direct communication request, and the The relay device uses the first encryption key to encrypt the direct communication request, uses the first integrity protection key to protect the integrity of the direct communication request, and forwards the direct communication request to the second terminal device; wherein, the The relevant information of the relay device includes one of the following: the identity information of the relay device, the random number generated by the relay device, the counter generated by the relay device; the first temporary public key and the relevant information of the relay device.
  • the second terminal device is used to derive a first key; the first random number, the first key and the second random number generated by the second terminal device are used to derive a second key, and the second key used to derive the second encryption key and/or the second integrity protection key, or the first random number, the first key and the second random number generated by the second terminal device are used to derive the second encryption key key and/or a second integrity protection key.
  • This embodiment establishes a secure communication solution based on the symmetric key distributed by 5G PKMT, and establishes a secure connection in the UE-to-UE relay scenario under the L2 architecture.
  • the embodiments of this application are applied to the UE-to-UE relay scenario under the L2 architecture, that is, the first terminal device and the second terminal device communicate through the relay device.
  • the relay connection between the first terminal device and the second terminal device may be a PC5 link.
  • the first terminal device may be a source device or a source terminal
  • the second terminal device may be a target device or a target terminal
  • the relay device may be a relay terminal
  • the first encryption key may be a Proximity Service Encryption Key (PEK), and the first integrity protection key may be a Proximity Service Integrity Protection Key (PIK).
  • PEK Proximity Service Encryption Key
  • PIK Proximity Service Integrity Protection Key
  • the first encryption key can also be other encryption keys
  • the first integrity protection key can also be other integrity protection keys, which is not limited by this application.
  • the second encryption key is used to encrypt end-to-end messages exchanged between the first terminal device and the second terminal device
  • the second integrity protection key is used to encrypt the first terminal device. End-to-end messages exchanged between the terminal device and the second terminal device are integrity protected.
  • the second encryption key may be a confidentiality protection key.
  • the relay device receives the security mode sent by the second terminal device command; wherein, the security mode command includes at least one of the following: the security algorithm selected by the second terminal device, the security policy selected by the second terminal device, the second temporary public key generated by the second terminal device, the second The second random number generated by the terminal device, M bits of the identifier of the first key generated by the second terminal device, x bits of the identifier of the second key generated by the second terminal device, A first message verification code; wherein, the security mode command is encrypted by the first encryption key, the security mode command is integrity protected by the first integrity protection key, and the first message verification code is based on the second The integrity protection key is generated, and the input parameters of the first message verification code include at least one of the following: the security algorithm selected by the second terminal device, the security policy selected by the second terminal device, the second temporary public key, The second random number, the M bits, the x bits,
  • the relay device uses the first encryption key to decrypt the security mode command to obtain Quality of Service (QoS) and billing information, and forwards the security mode command to the first terminal device; wherein, the The second temporary public key and the relevant information of the relay device are used by the first terminal device to derive the first key.
  • the identification of the first key is composed of the M bits and the identification of the first key. N bits are combined, and M and N are both positive integers.
  • the identity of the second key is obtained by combining the x bits and the other y bits of the identity of the second key. Both x and y are Positive integer.
  • the second terminal device may select a security algorithm based on the security capability information of the first terminal device, and/or the second terminal device may select a security policy based on the security policy information of the first terminal device.
  • the security capability information of the first terminal device may be a list of cryptographic algorithms supported by the first terminal device.
  • the security policy information of the first terminal device may be whether the first terminal device supports confidentiality protection or integrity protection.
  • the security policy information of the first terminal device includes: the security policy information of the first terminal device on the control plane, and/or the security policy information of the first terminal device on the user plane.
  • the M bits may be the highest M bits of the identity of the first key, and the N bits may be the lowest N bits of the identity of the first key; or, The M bits may be the first M bits of the identifier of the first key, and the N bits may be the last N bits of the identifier of the first key; or, the M bits may be are the even-numbered bits of the identifier of the first key, and the N bits may be the odd-numbered bits of the identifier of the first key.
  • the values of M and N may be the same or different, which is not limited by this application.
  • the x bits may be the highest x bits of the identity of the second key, and the y bits may be the lowest y bits of the identity of the second key; or, The x bits may be the first x bits of the identifier of the second key, and the y bits may be the last y bits of the identifier of the second key; or, the x bits may be are the even-numbered bits of the identifier of the second key, and the y bits may be the odd-numbered bits of the identifier of the second key.
  • the values of x and y may be the same or different, which is not limited by this application.
  • the relay device forwards the first random number to the second terminal device.
  • the security mode establishment completion message sent by the terminal device;
  • the security mode establishment completion message is encrypted by the second key or the second encryption key, and the security mode establishment completion message is integrity protected by the second key or the second integrity protection key;
  • the security mode establishment completion message includes at least the y bits of the identification of the second key.
  • the The relay device receives the security mode command sent by the second terminal device; wherein the security mode command includes at least one of the following: a security algorithm selected by the second terminal device, a security policy selected by the second terminal device, The second temporary public key generated by the device, the second random number generated by the second terminal device, the M bits of the identification of the first key generated by the second terminal device, and the first message verification code; wherein, The security mode command is encrypted by the first encryption key, the security mode command is integrity protected by the first integrity protection key, the first message verification code is generated based on the second integrity protection key, and The input parameters of the first message verification code include at least one of the following: the security algorithm selected by the second terminal device, the security policy selected by the second terminal device, the second temporary public key, the second random number, the M bits, the relevant information of the relay device; the second temporary public key and the relevant information of the relay device are
  • the relay device uses the first encryption key to decrypt the security mode command to obtain QoS and accounting information, and forwards the security mode command to the first terminal device; wherein the second temporary public key and the intermediate
  • the relevant information of the relay device is used by the first terminal device to derive the first key.
  • the identification of the first key is obtained by combining the M bits and the other N bits of the identification of the first key. M and N are both positive integers.
  • the The relay device forwards the security mode establishment completion message sent by the first terminal device to the second terminal device; wherein the security mode establishment completion message is encrypted by the second encryption key, and the security mode establishment completion message is encrypted by the second encryption key.
  • Integrity protection keys perform integrity protection.
  • the safe mode command includes information related to the relay device, and the input parameters of the first message verification code also include information related to the relay device; or, the relay device sends a message to the first message verification code.
  • the relevant information of the relay device is added to the safe mode command forwarded by the terminal device.
  • the first terminal device can generate the first key based on the direct communication request sent by the second terminal device through the relay device, and the direct communication request is encrypted by the first encryption key, and directly The communication request is integrity protected via the first integrity protection key.
  • the second integrity protection key, or the first random number generated by the first terminal device, the first key and the second terminal device are used to derive the second random number to generate the second encryption key and/or the second integrity Protecting the key can ensure the identity security of the first terminal device and the second terminal device and the confidentiality and integrity of the communication data, thereby ensuring the confidentiality and integrity of the data transmitted by both parties and preventing eavesdropping by other devices and even relay devices.
  • the embodiment of this application is suitable for the secure communication establishment process between the first terminal device (source device) and the second terminal device (target device) under the 5G L2 UE-to-UE relay architecture.
  • PKMF delivers symmetric keys, protection algorithms and key negotiation to terminal devices that have registered and are authorized to use the UE-to-UE relay function, thereby efficiently establishing source End-to-end secure channel between UE and target UE.
  • the embodiments of this application have very high efficiency in calculation and communication, and can also achieve authentication, encryption protection, integrity protection, and resistance to tampering and downgrade attacks.
  • Embodiment 3 as shown in Figure 19, assuming that no secure connection has been established between all devices before, UE-to-UE under the L2 architecture can be established through some or all of the steps in S3-0 to S3-6. Signature-based secure communication connection in subsequent scenarios.
  • UE1 may be the first terminal device
  • UE2 may be the second terminal device
  • UE-to-UE relay may be the relay device
  • K D may be the first key
  • K D-SESS may be the second key
  • the first encryption key is PEK
  • the first integrity protection key is PIK.
  • S3-0.UE registers with the network and is authorized for UE-to-UE relay service.
  • UE-to-UE relay registers with the network to provide the UE-to-UE Relay function, and the UE-to-UE relay is configured with relay policy parameters.
  • PKMF uses the MIKEY mechanism to send the relevant PGK, PGK ID and expiration time to the above-mentioned registered and authorized UE.
  • S3-1.UE2 determines the destination L2 ID for signaling reception when the PC5 unicast link is established.
  • S3-2.UE1 sends an end-to-end direct communication request message through broadcast. Specifically, before broadcasting the direct communication request to surrounding terminal devices, UE1 first needs to derive the transmission key PTK based on PGK, and further generate the PTK Lower level keys, namely PEK and PIK. UE1 uses PEK to encrypt the broadcast message, and uses PIK to calculate the MAC of the direct communication request message to protect the integrity of the direct communication request message. That is, the direct communication request is encrypted by PEK, and the direct communication request is integrity protected by PIK. Among them, the direct communication request contains at least one of the following:
  • UE1 security capabilities information (UE1 security capabilities);
  • UE1 security policy information (UE1 security policy);
  • the first temporary public key (Ephemeral public key1) generated by UE1;
  • UE-to-UE Relay receives the broadcast direct communication request message and verifies whether the UE-to-UE Relay is configured to forward the direct communication request message. For example, the UE-to-UE Relay will announce the ProSe application ID and Compare the relay policies/parameters it provides.
  • UE-to-UE Relay forwards the direct communication request message broadcast end-to-end, it uses its own L2 ID as the source (Source) L2 ID, and adds the UE ID of UE-to-UE Relay in the message.
  • the adaptation layer Specify information identifying UE1.
  • UE-to-UE Relay processes this end-to-end broadcast message at the ProSe layer and forwards any subsequent end-to-end PC5-S messages based on the adaptation layer information.
  • the UE-to-UE Relay uses PEK to decrypt the direct communication request to obtain QoS and charging information, and the UE-to-UE Relay uses PIK to verify the integrity of the direct communication request.
  • the UE- to-UE Relay adds the relevant information of UE-to-UE Relay and the identification of UE-to-UE Relay in the direct communication request, and the UE-to-UE Relay uses PEK to encrypt the direct communication request and uses PIK to protect the direct communication request.
  • the relevant information of UE-to-UE Relay includes one of the following: the identity information of UE-to-UE Relay, the random number generated by UE-to-UE Relay, and the counter generated by UE-to-UE Relay.
  • S3-4a.UE2 is interested in the announced application. If there is no per-hop link between UE2 and UE-to-UE Relay, UE2 will trigger the UE-to-UE Relay to establish a per-hop link. UE2 sends a link establishment process message for each hop.
  • the source address is the UE2 L2 ID and the destination address is the relay's L2 ID.
  • UE-2 and UE-to-UE relay successfully establish a per hop link, the establishment of end-to-end security between UE2 and UE1 will be further triggered.
  • UE2 first uses PGK to generate the transmission key PTK, and further generates PEK and PIK, decrypts the received direct communication request, and verifies the integrity of the direct communication request.
  • UE2 After successful verification, UE2 generates a pair of temporary public and private keys, namely the second temporary public key (Ephemeral public key2) and the second temporary private key (Ephemeral private key2), and uses the second temporary private key, the first temporary public key and the UE -To-UE relay related information, calculate the shared key K D and MSB of K D ID with UE-1.
  • UE2 negotiates the security policy and security algorithm, then generates the second random number (Nonce_2), and calculates the lower level derived from K D -sess and K D -sess based on K D keys (ie, the second encryption key (K D-enc ) and the second integrity protection key (K D -int )), and in addition UE2 generates the MSB of K D -sess ID.
  • UE2 sends a security mode command to UE1 through UE-to-UE relay.
  • the security mode command is encrypted through PEK, and the security mode command is integrity protected through PIK.
  • the security mode command contains the following parameters:
  • the security algorithm selected by UE2 (chosen_algs);
  • the security policy chosen by UE2 (chosen_security policy);
  • the second temporary public key (Ephemeral private key2) generated by UE2;
  • a first message verification code wherein the first message verification code is generated based on a lower integrity protection key derived from K D -sess (ie, the second integrity protection key (K D-int )), and the first message verification code
  • the input parameters of the verification code include at least one of the following: the security algorithm selected by UE2, the security policy selected by UE2, the second temporary public key, the second random number, MSB of K D ID, and MSB of K D -sess ID.
  • the UE-to-UE relay can use PEK to decrypt the security mode command to obtain information related to QoS and charging. Further, the UE-to-UE relay sends the security mode command to UE1. Optionally, if the security mode command does not include UE-to-UE relay related information, UE-to-UE relay can add UE-to-UE relay related information to the security mode command forwarded to UE1.
  • S3-6.UE1 first uses PEK to decrypt the security mode command, and uses PIK to determine the integrity of the security mode command. After successful verification, it further determines whether UE1's security capability information and UE1's security policy information have been tampered with. If not, then use Calculate K D -sess and the subordinate keys derived from K D -sess (i.e., the second encryption key (K D -enc ) and the second integrity protection key (K D - int )) in the same manner as UE2, and then UE1 verifies whether the first message verification code is valid. If valid, UE1 prepares to use the new security environment to protect subsequent communications.
  • K D -sess i.e., the second encryption key (K D -enc ) and the second integrity protection key (K D - int )
  • UE1 generates LSB of K D ID, LSB of K D -sess ID, combines the LSB of K D ID with the received MSB of K D ID to obtain the K D ID, and combines the LSB of K D -sess ID with the received MSB of K D ID.
  • the MSB of K D -sess ID is merged to obtain the K D -sess ID, and the K D ID and K D -sess ID are saved, which are subsequently used to identify K D and K D -sess.
  • UE1 sends a security-protected security mode completion message to UE2 through the UE-to-UE relay according to the negotiation policy and negotiation algorithm.
  • the security mode completion message can be protected by K D -sess for integrity and encryption, or the security mode completion message can be protected by KD-sess.
  • the security mode completion message can be integrity protected using the lower-level integrity protection key (i.e., the second integrity protection key (K D-int )) generated by K D -sess, and the lower-level encryption key (K D -int ) generated by K D -sess. That is, the second encryption key (K D-enc )) is used for encryption protection.
  • the security mode completion message may include LSB of K D -sess ID.
  • UE2 can combine the received LSB of K D -sess ID with the MSB of K D -sess ID generated by UE2 to obtain the K D -sess ID, and save the K D -sess ID, which is subsequently used to identify the K D -sess.
  • UE1 communicates with UE2 according to the security algorithm and K D-SESS selected by UE2, generates an integrity protection key and/or confidentiality protection key based on K D-SESS , and a security policy selected by UE2.
  • UE2 communicates with UE1 according to the security algorithm and K D-SESS selected by UE2, generates an integrity protection key and/or a confidentiality protection key based on K D-SESS , and a security policy selected by UE2.
  • Embodiment 4 as shown in Figure 20, assuming that no secure connection has been established between all devices before, UE-to-UE under the L2 architecture can be established through some or all of the steps in S4-0 to S4-6. Signature-based secure communication connection in subsequent scenarios.
  • UE1 may be the first terminal device
  • UE2 may be the second terminal device
  • UE-to-UE relay may be the relay device
  • K D may be the first key
  • K D-SESS may be the second key
  • the first encryption key is PEK
  • the first integrity protection key is PIK.
  • the UE registers with the network and is authorized for the UE-to-UE relay service.
  • UE-to-UE relay registers with the network to provide the UE-to-UE Relay function, and the UE-to-UE relay is configured with relay policy parameters.
  • PKMF uses the MIKEY mechanism to send the relevant PGK, PGK ID and expiration time to the above-mentioned registered and authorized UE.
  • S4-1.UE2 determines the destination L2 ID for signaling reception when the PC5 unicast link is established.
  • UE1 sends an end-to-end direct communication request message through broadcast. Specifically, before broadcasting the direct communication request to surrounding terminal devices, UE1 first needs to derive the transmission key PTK based on PGK, and further generate the PTK Lower level keys, namely PEK and PIK. UE1 uses PEK to encrypt the broadcast message, and uses PIK to calculate the MAC of the direct communication request message to protect the integrity of the direct communication request message. That is, the direct communication request is encrypted by PEK, and the direct communication request is integrity protected by PIK. Among them, the direct communication request contains at least one of the following:
  • UE1 security capabilities information (UE1 security capabilities);
  • UE1 security policy information (UE1 security policy);
  • the first temporary public key (Ephemeral public key1) generated by UE1;
  • UE-to-UE Relay receives the broadcast direct communication request message and verifies whether the UE-to-UE Relay is configured to forward the direct communication request message. For example, the UE-to-UE Relay will announce the ProSe application ID and Compare the relay policies/parameters it provides.
  • UE-to-UE Relay forwards the direct communication request message broadcast end-to-end, it uses its own L2 ID as the source (Source) L2 ID, and adds the UE ID of UE-to-UE Relay in the message.
  • the adaptation layer Specify information identifying UE1.
  • UE-to-UE Relay processes this end-to-end broadcast message at the ProSe layer and forwards any subsequent end-to-end PC5-S messages based on the adaptation layer information.
  • the UE-to-UE Relay uses PEK to decrypt the direct communication request to obtain QoS and charging information, and the UE-to-UE Relay uses PIK to verify the integrity of the direct communication request.
  • the UE- to-UE Relay adds the relevant information of UE-to-UE Relay and the identification of UE-to-UE Relay in the direct communication request, and the UE-to-UE Relay uses PEK to encrypt the direct communication request and uses PIK to protect the direct communication request.
  • the relevant information of UE-to-UE Relay includes one of the following: the identity information of UE-to-UE Relay, the random number generated by UE-to-UE Relay, and the counter generated by UE-to-UE Relay.
  • S4-4a.UE2 is interested in the announced application. If there is no per-hop link between UE2 and UE-to-UE Relay, UE2 will trigger UE-to-UE Relay to establish a per-hop link. UE2 sends a link establishment process message for each hop.
  • the source address is the UE2 L2 ID and the destination address is the relay's L2 ID.
  • UE-2 and UE-to-UE relay successfully establish a per hop link, the establishment of end-to-end security between UE2 and UE1 will be further triggered.
  • UE2 first uses PGK to generate the transmission key PTK, and further generates PEK and PIK, decrypts the received direct communication request, and verifies the integrity of the direct communication request.
  • UE2 After successful verification, UE2 generates a pair of temporary public and private keys, namely the second temporary public key (Ephemeral public key2) and the second temporary private key (Ephemeral private key2), and uses the second temporary private key, the first temporary public key and the UE -To-UE relay related information, calculate the shared key K D and MSB of K D ID with UE1.
  • UE2 negotiates the security policy and security algorithm, and then generates the second random number (Nonce_2), and uses the subordinate key derived from K D (i.e. the second encryption key ( K D-enc ) and the second integrity protection key (K D-int )).
  • UE2 sends a security mode command to UE1 through UE-to-UE relay.
  • the security mode command is encrypted through PEK, and the security mode command is integrity protected through PIK.
  • the security mode command contains the following parameters:
  • the security algorithm selected by UE2 (chosen_algs);
  • the security policy chosen by UE2 (chosen_security policy);
  • the second temporary public key (Ephemeral private key2) generated by UE2;
  • a first message verification code wherein the first message verification code is generated based on the second integrity protection key (K D-int ), and the input parameters of the first message verification code include at least one of the following: the security selected by UE2 Algorithm, security policy selected by UE2, second temporary public key, second random number, MSB of K D ID.
  • the UE-to-UE relay can use PEK to decrypt the security mode command to obtain information related to QoS and charging. Further, the UE-to-UE relay sends the security mode command to UE1. Optionally, if the security mode command does not include UE-to-UE relay related information, UE-to-UE relay can add UE-to-UE relay related information to the security mode command forwarded to UE1.
  • S4-6.UE1 first uses PEK to decrypt the security mode command, and uses PIK to determine the integrity of the security mode command. After successful verification, it further determines whether UE1's security capability information and UE1's security policy information have been tampered with. If not, then use The second encryption key (K D-enc ) and the second integrity protection key (K D-int ) are calculated in the same way as UE2, and then UE1 verifies whether the first message verification code is valid. If valid, UE1 is ready to use the new A secure environment to protect subsequent communications.
  • K D-enc The second encryption key
  • K D-int the second integrity protection key
  • UE1 generates the LSB of K D ID, combines the LSB of K D ID with the received MSB of K D ID to obtain the K D ID, and saves the K D ID, which is subsequently used to identify K D .
  • UE1 sends a security-protected security mode completion message to UE2 through the UE-to-UE relay.
  • the security mode completion message can use the derived lower-level integrity protection key (i.e., the second integrity The protection key (K D-int )) performs integrity protection, and the derived lower-level encryption key (i.e., the second encryption key (K D-enc )) performs encryption protection.
  • UE1 communicates with UE2 according to the security algorithm selected by UE2, the second integrity protection key (K D-int ) and/or the second encryption key (K D-enc ), and the security policy selected by UE2.
  • UE2 communicates with UE1 according to the security algorithm selected by UE2, the second integrity protection key (K D-int ) and/or the second encryption key (K D-enc ), and the security policy selected by UE2.
  • Embodiment 5 as shown in Figure 21, assuming that no secure connection has been established between all devices before, UE-to-UE under the L2 architecture can be established through some or all of the steps in S5-0 to S5-6. Signature-based secure communication connection in subsequent scenarios.
  • UE1 may be the first terminal device
  • UE2 may be the second terminal device
  • UE-to-UE relay may be the relay device
  • K D may be the first key
  • K D-SESS may be the second key .
  • S5-0.UE registers with the network and is authorized for UE-to-UE relay service.
  • UE-to-UE relay registers with the network to provide the UE-to-UE Relay function, and the UE-to-UE relay is configured with relay policy parameters.
  • PKMF uses the MIKEY mechanism to send relevant symmetric keys to the above-mentioned registered and authorized UEs.
  • the first encryption key and the third encryption key can be derived based on the symmetric keys of the terminals that have been registered and authorized to use UE-to-UE relay communication.
  • An integrity protection key is used to send relevant symmetric keys to the above-mentioned registered and authorized UEs.
  • UE2 determines the destination L2 ID for signaling reception when the PC5 unicast link is established.
  • S5-2.UE1 sends an end-to-end direct communication request message through broadcast. Specifically, UE1 broadcasts the direct communication request to surrounding terminal devices based on terminals that have registered and are authorized to use UE-to-UE relay communication.
  • the first encryption key and the first integrity protection key are derived from the symmetric keys of UE1 and UE2.
  • UE1 uses the first encryption key to encrypt the broadcast message, and uses the first integrity protection key to calculate the MAC of the direct communication request message to protect the integrity of the direct communication request message. That is, the direct communication request is processed through the first encryption key. Encryption, and the direct communication request is integrity protected by a first integrity protection key.
  • the direct communication request contains at least one of the following:
  • UE1 security capabilities information (UE1 security capabilities);
  • UE1 security policy information (UE1 security policy);
  • the first temporary public key (Ephemeral public key1) generated by UE1;
  • UE-to-UE Relay receives the broadcast direct communication request message and verifies whether the UE-to-UE Relay is configured to forward the direct communication request message. For example, the UE-to-UE Relay will announce the ProSe application ID and Compare the relay policies/parameters it provides.
  • UE-to-UE Relay forwards the direct communication request message broadcast end-to-end, it uses its own L2 ID as the source (Source) L2 ID, and adds the UE ID of UE-to-UE Relay in the message.
  • the adaptation layer Specify information identifying UE1.
  • UE-to-UE Relay processes this end-to-end broadcast message at the ProSe layer and forwards any subsequent end-to-end PC5-S messages based on the adaptation layer information.
  • the UE-to-UE Relay uses the first encryption key to decrypt the direct communication request to obtain QoS and charging information, and the UE-to-UE Relay uses the first integrity protection key to verify the direct communication request. Integrity, after passing the verification, the UE-to-UE Relay adds the relevant information of the UE-to-UE Relay and the identification of the UE-to-UE Relay in the direct communication request, and the UE-to-UE Relay uses the first encryption The key encrypts the direct communication request and uses the first integrity protection key to protect the integrity of the direct communication request; among which, the relevant information of the UE-to-UE Relay includes one of the following: the identity information of the UE-to-UE Relay, the UE Random number generated by -to-UE Relay, counter generated by UE-to-UE Relay.
  • S5-4a.UE2 is interested in the announced application. If there is no per-hop link between UE2 and UE-to-UE Relay, UE2 will trigger the UE-to-UE Relay to establish a per-hop link. UE2 sends a link establishment process message for each hop.
  • the source address is the UE2 L2 ID and the destination address is the relay's L2 ID.
  • UE-2 and UE-to-UE relay successfully establish a per hop link, the establishment of end-to-end security between UE2 and UE1 will be further triggered.
  • UE2 may derive the first encryption key and the first integrity protection key based on the symmetric key of the terminal that is registered and authorized to use UE-to-UE relay communication, decrypt the received direct communication request, and verify the direct communication request of integrity.
  • UE2 After successful verification, UE2 generates a pair of temporary public and private keys, namely the second temporary public key (Ephemeral public key2) and the second temporary private key (Ephemeral private key2), and uses the second temporary private key, the first temporary public key and the UE -To-UE relay related information, calculate the shared key K D and MSB of K D ID with UE-1.
  • UE2 negotiates the security policy and security algorithm, then generates the second random number (Nonce_2), and calculates the lower level derived from K D -sess and K D -sess based on K D keys (ie, the second encryption key (K D-enc ) and the second integrity protection key (K D -int )), and in addition UE2 generates the MSB of K D -sess ID.
  • UE2 sends a security mode command to UE1 through UE-to-UE relay.
  • the security mode command is encrypted by the first encryption key.
  • the security mode command is integrity protected by the first integrity protection key.
  • the security mode command is encrypted by the first encryption key. The following parameters are included in the mode command:
  • the security algorithm selected by UE2 (chosen_algs);
  • the security policy chosen by UE2 (chosen_security policy);
  • the second temporary public key (Ephemeral private key2) generated by UE2;
  • a first message verification code wherein the first message verification code is generated based on a lower integrity protection key derived from K D -sess (ie, the second integrity protection key (K D-int )), and the first message verification code
  • the input parameters of the verification code include at least one of the following: the security algorithm selected by UE2, the security policy selected by UE2, the second temporary public key, the second random number, MSB of K D ID, and MSB of K D -sess ID.
  • the UE-to-UE relay can use the first encryption key to decrypt the security mode command to obtain information related to QoS and charging. Further, the UE-to-UE relay sends the security mode command to UE1. Optionally, if the security mode command does not include UE-to-UE relay related information, UE-to-UE relay can add UE-to-UE relay related information to the security mode command forwarded to UE1.
  • UE1 first uses the first encryption key to decrypt the security mode command, uses the first integrity protection key to determine the integrity of the security mode command, and after successful verification, further determines the security capability information of UE1 and the security policy information of UE1. Whether it has been tampered with. If it has not been tampered with, use the same method as UE2 to calculate K D -sess and the subordinate key derived from K D -sess (i.e., the second encryption key (K D-enc ) and the second integrity protection key). key (K D-int )), and then UE1 verifies whether the first message verification code is valid. If valid, UE1 is prepared to use the new security environment to protect subsequent communications.
  • UE1 generates LSB of K D ID, LSB of K D -sess ID, combines the LSB of K D ID with the received MSB of K D ID to obtain the K D ID, and combines the LSB of K D -sess ID with the received MSB of K D ID.
  • the MSB of K D -sess ID is merged to obtain the K D -sess ID, and the K D ID and K D -sess ID are saved, which are subsequently used to identify K D and K D -sess.
  • UE1 sends a security-protected security mode completion message to UE2 through the UE-to-UE relay according to the negotiation policy and negotiation algorithm.
  • the security mode completion message can be protected by K D -sess for integrity and encryption, or the security mode completion message can be protected by KD-sess.
  • the security mode completion message can be integrity protected using the lower-level integrity protection key (i.e., the second integrity protection key (K D-int )) generated by K D -sess, and the lower-level encryption key (K D -int ) generated by K D -sess. That is, the second encryption key (K D-enc )) is used for encryption protection.
  • the security mode completion message may include LSB of K D -sess ID.
  • UE2 can combine the received LSB of K D -sess ID with the MSB of K D -sess ID generated by UE2 to obtain the K D -sess ID, and save the K D -sess ID, which is subsequently used to identify the K D -sess.
  • UE1 communicates with UE2 according to the security algorithm and K D-SESS selected by UE2, generates an integrity protection key and/or confidentiality protection key based on K D-SESS , and a security policy selected by UE2.
  • UE2 communicates with UE1 according to the security algorithm and K D-SESS selected by UE2, generates an integrity protection key and/or a confidentiality protection key based on K D-SESS , and a security policy selected by UE2.
  • Embodiment 6 as shown in Figure 22, assuming that no secure connection has been established between all devices before, UE-to-UE under the L2 architecture can be established through some or all of the steps in S6-0 to S6-6. Signature-based secure communication connection in subsequent scenarios.
  • UE1 may be the first terminal device
  • UE2 may be the second terminal device
  • UE-to-UE relay may be the relay device
  • K D may be the first key
  • K D-SESS may be the second key .
  • the UE registers with the network and is authorized for the UE-to-UE relay service.
  • UE-to-UE relay registers with the network to provide the UE-to-UE Relay function, and the UE-to-UE relay is configured with relay policy parameters.
  • PKMF uses the MIKEY mechanism to send relevant symmetric keys to the above-mentioned registered and authorized UEs.
  • the first encryption key and the third encryption key can be derived based on the symmetric keys of the terminals that have been registered and authorized to use UE-to-UE relay communication.
  • An integrity protection key is used to send relevant symmetric keys to the above-mentioned registered and authorized UEs.
  • UE2 determines the destination L2 ID for signaling reception when the PC5 unicast link is established.
  • S6-2.UE1 sends an end-to-end direct communication request message through broadcast. Specifically, UE1 broadcasts the direct communication request to surrounding terminal devices based on terminals that have registered and are authorized to use UE-to-UE relay communication.
  • the first encryption key and the first integrity protection key are derived from the symmetric keys of UE1 and UE2.
  • UE1 uses the first encryption key to encrypt the broadcast message, and uses the first integrity protection key to calculate the MAC of the direct communication request message to protect the integrity of the direct communication request message. That is, the direct communication request is processed through the first encryption key. Encryption, and the direct communication request is integrity protected by a first integrity protection key.
  • the direct communication request contains at least one of the following:
  • UE1 security capabilities information (UE1 security capabilities);
  • UE1 security policy information (UE1 security policy);
  • the first temporary public key (Ephemeral public key1) generated by UE1;
  • UE-to-UE Relay receives the broadcast direct communication request message and verifies whether the UE-to-UE Relay is configured to forward the direct communication request message. For example, the UE-to-UE Relay will announce the ProSe application ID and Compare the relay policies/parameters it provides.
  • UE-to-UE Relay forwards the direct communication request message broadcast end-to-end, it uses its own L2 ID as the source (Source) L2 ID, and adds the UE ID of UE-to-UE Relay in the message.
  • the adaptation layer Specify information identifying UE1.
  • UE-to-UE Relay processes this end-to-end broadcast message at the ProSe layer and forwards any subsequent end-to-end PC5-S messages based on the adaptation layer information.
  • the UE-to-UE Relay uses the first encryption key to decrypt the direct communication request to obtain QoS and charging information, and the UE-to-UE Relay uses the first integrity protection key to verify the direct communication request. Integrity, after passing the verification, the UE-to-UE Relay adds the relevant information of the UE-to-UE Relay and the identification of the UE-to-UE Relay in the direct communication request, and the UE-to-UE Relay uses the first encryption The key encrypts the direct communication request and uses the first integrity protection key to protect the integrity of the direct communication request; among which, the relevant information of the UE-to-UE Relay includes one of the following: the identity information of the UE-to-UE Relay, the UE Random number generated by -to-UE Relay, counter generated by UE-to-UE Relay.
  • S6-4a.UE2 is interested in the announced application. If there is no per-hop link between UE2 and UE-to-UE Relay, UE2 will trigger the UE-to-UE Relay to establish a per-hop link. UE2 sends a link establishment process message for each hop.
  • the source address is the UE2 L2 ID and the destination address is the relay's L2 ID.
  • UE-2 and UE-to-UE relay successfully establish a per hop link, the establishment of end-to-end security between UE2 and UE1 will be further triggered.
  • UE2 may derive the first encryption key and the first integrity protection key based on the symmetric key of the terminal that is registered and authorized to use UE-to-UE relay communication, decrypt the received direct communication request, and verify the direct communication request of integrity.
  • UE2 After successful verification, UE2 generates a pair of temporary public and private keys, namely the second temporary public key (Ephemeral public key2) and the second temporary private key (Ephemeral private key2), and uses the second temporary private key, the first temporary public key and the UE -To-UE relay related information, calculate the shared key K D and MSB of K D ID with UE1. If the direct communication request contains the security policy and security algorithm, then UE2 negotiates the security policy and security algorithm, and then generates the second random number (Nonce_2), and uses the subordinate key derived from K D (i.e. the second encryption key ( K D-enc ) and the second integrity protection key (K D-int )).
  • K D the second encryption key
  • K D-int the second integrity protection key
  • UE2 sends a security mode command to UE1 through UE-to-UE relay.
  • the security mode command is encrypted by the first encryption key.
  • the security mode command is integrity protected by the first integrity protection key.
  • the security mode command is encrypted by the first encryption key. The following parameters are included in the mode command:
  • the security algorithm selected by UE2 (chosen_algs);
  • the security policy chosen by UE2 (chosen_security policy);
  • the second temporary public key (Ephemeral private key2) generated by UE2;
  • a first message verification code wherein the first message verification code is generated based on the second integrity protection key (K D-int ), and the input parameters of the first message verification code include at least one of the following: the security selected by UE2 Algorithm, security policy selected by UE2, second temporary public key, second random number, MSB of K D ID.
  • the UE-to-UE relay can use the first encryption key to decrypt the security mode command to obtain information related to QoS and charging. Further, the UE-to-UE relay sends the security mode command to UE1. Optionally, if the security mode command does not include UE-to-UE relay related information, UE-to-UE relay can add UE-to-UE relay related information to the security mode command forwarded to UE1.
  • UE1 first uses the first encryption key to decrypt the security mode command, uses the first integrity protection key to determine the integrity of the security mode command, and after successful verification, further determines the security capability information of UE1 and the security policy information of UE1. Whether it has been tampered with. If not, then the second encryption key (K D-enc ) and the second integrity protection key (K D-int ) are calculated in the same way as UE2, and then UE1 verifies the first message verification code. Is it valid? If valid, UE1 is prepared to use the new security environment to protect subsequent communications.
  • UE1 generates the LSB of K D ID, combines the LSB of K D ID with the received MSB of K D ID to obtain the K D ID, and saves the K D ID, which is subsequently used to identify K D .
  • UE1 sends a security-protected security mode completion message to UE2 through the UE-to-UE relay.
  • the security mode completion message can use the derived lower-level integrity protection key (i.e., the second integrity The protection key (K D-int )) performs integrity protection, and the derived lower-level encryption key (i.e., the second encryption key (K D-enc )) performs encryption protection.
  • UE1 communicates with UE2 according to the security algorithm selected by UE2, the second integrity protection key (K D-int ) and/or the second encryption key (K D-enc ), and the security policy selected by UE2.
  • UE2 communicates with UE1 according to the security algorithm selected by UE2, the second integrity protection key (K D-int ) and/or the second encryption key (K D-enc ), and the security policy selected by UE2.
  • Figure 23 shows a schematic block diagram of a terminal device 1100 according to an embodiment of the present application.
  • the terminal device 1100 is a first terminal device.
  • the terminal device 1100 includes:
  • Communication unit 1110 configured to receive an authentication request message sent by the second terminal device through the relay device;
  • the authentication request message includes at least one of the following: information about the user to which the second terminal device belongs, information about the user to which the relay device belongs, the first temporary public key generated by the second terminal device, Signature, the signature of the relay device, and relevant information of the relay device;
  • the information of the user to which the second terminal device belongs includes the identification of the second terminal device, the public verification token PVT of the second terminal device and the public authentication key KPAK of the key management server;
  • the information includes the identification of the relay device and the PVT and KPAK of the relay device;
  • the input parameters of the signature of the second terminal device include at least one of the following: information of the user to which the second terminal device belongs and the first temporary public key.
  • the input parameters of the relay device's signature include at least one of the following: the signature of the second terminal device and the information of the user to which the relay device belongs; the first temporary public key and the relevant information of the relay device are used for the The first terminal device derives the first key; the relevant information of the relay device includes one of the following: the identity information of the relay device, the random number generated by the relay device, and the counter generated by the relay device.
  • the signature of the second terminal device is generated by the secret signature key of the second terminal device, and/or the signature of the relay device is generated by the secret signature key of the relay device.
  • the terminal device 1100 further includes: a processing unit 1120;
  • the KPAK of the second terminal device and the KPAK of the relay device are valid, and the signature verification of the second terminal device based on the identity of the second terminal device and the PVT of the second terminal device is successful, and based on the relay If the identification of the device and the PVT of the relay device successfully verify the signature of the relay device, the processing unit 1120 is configured to generate a second temporary private key, and the processing unit 1120 is configured to generate a second temporary public key based on the first temporary public key. , the relevant information of the relay device and the second temporary private key to derive the first key.
  • the communication unit 1110 is also used to send the first message to the second terminal device through the relay device;
  • the first message includes at least one of the following: security capability information of the first terminal device, security policy information of the first terminal device, information of the user to which the first terminal device belongs, a third message generated by the first terminal device.
  • security capability information of the first terminal device security policy information of the first terminal device
  • information of the user to which the first terminal device belongs a third message generated by the first terminal device.
  • a random number a second temporary public key generated by the first terminal device paired with the second temporary private key, M bits of the identification of the first key generated by the first terminal device, the first terminal Device signature, first message verification code;
  • the information of the user to which the first terminal device belongs includes the identification of the first terminal device and the PVT and KPAK of the first terminal device;
  • the input parameters of the signature of the first terminal device include at least one of the following: the first terminal Information about the user to whom the device belongs, the second temporary public key, the M bits, and the signature of the second terminal device;
  • the first message is integrity protected by the first message verification code generated based on the first key
  • the input parameters of the first message verification code include at least one of the following: the security capability of the first terminal device Information, the security policy information of the first terminal device, the information of the user to which the first terminal device belongs, the first random number, the second temporary public key, the M bits, and the signature of the first terminal device;
  • the second temporary public key and the relevant information of the relay device are used by the second terminal device to derive the first key, the first random number, the first key and the third key generated by the second terminal device.
  • Two random numbers are used to derive a second key.
  • the second key is used to derive an integrity protection key and/or a confidentiality protection key.
  • the identity of the first key is composed of the M bits and the first The other N bits of the key's identifier are combined, and M and N are both positive integers.
  • the communication unit 1110 is also used to receive the second message sent by the second terminal device through the relay device;
  • the second message includes at least one of the following: the second random number generated by the second terminal device, N bits of the identification of the first key generated by the second terminal device, x bits of the identifier of the generated second key, the security algorithm selected by the second terminal device, the security policy selected by the second terminal device, and the second message verification code;
  • the second message is integrity protected through the second message verification code generated based on the second key, or the second message is integrity protected through the third integrity protection key generated based on the second key.
  • the second message verification code performs integrity protection, and the input parameters of the second message verification code include at least one of the following: the second random number, the N bits, the x bits, and the second terminal device selected Security algorithm, the security policy selected by the second terminal device; wherein, the identity of the second key is obtained by combining the x bits and the other y bits of the identity of the second key, x and y are both Positive integer.
  • the second message is encrypted with the first key.
  • the processing unit 1120 is further configured to generate the first random number based on at least the first random number, the first key and the second random number. a second key, the processing unit 1120 is further configured to generate an integrity protection key and/or a confidentiality protection key according to the second key, and the processing unit 1120 is further configured to combine the M bits and the N
  • the processing unit 1120 is also used to generate y bits of the identifier of the second key, and combine the x bits and the y bits to obtain the identifier of the first key.
  • the identification of the second key is also used to generate y bits of the identifier of the second key, and combine the x bits and the y bits to obtain the identifier of the first key.
  • the processing unit 1120 is also configured to generate an integrity protection key based on the second key and/or the security algorithm selected by the second terminal device and the second key. Or the confidentiality protection key and the security policy selected by the second terminal device are used to communicate with the second terminal device.
  • the processing unit 1120 is also configured to decrypt the second message according to the first key
  • the processing unit 1120 is also configured to generate the second key based on at least the first random number, the first key and the second random number.
  • the processing unit 1120 is further configured to generate an integrity protection key and/or a confidentiality protection key according to the second key, and the processing unit 1120 is further configured to combine the M bits and the N bits to obtain the
  • the processing unit 1120 is also used to generate y bits of the identifier of the second key, and combine the x bits and the y bits to obtain the identifier of the second key. ;
  • the processing unit 1120 is also configured to generate an integrity protection key based on the second key and/or the security algorithm selected by the second terminal device and the second key. Or the confidentiality protection key and the security policy selected by the second terminal device are used to communicate with the second terminal device.
  • the input parameters of the integrity protection key include at least one of the following: the second key, the selected algorithm type identifier, the length of the selected algorithm type identifier, and the integrity protection algorithm identifier.
  • the length of the integrity protection algorithm identifier; and/or, the input parameters of the confidentiality protection key include at least one of the following: the second key, the selected algorithm type identifier, the selected algorithm type identifier Length, confidentiality protection algorithm identifier, length of the confidentiality protection algorithm identifier.
  • the first message is an authentication response message
  • the second message is a safe mode command message
  • the first message is a safe mode command message
  • the second message is a safe mode response message
  • the communication unit 1110 is also used to send a third message to the second terminal device through the relay device;
  • the third message is used to indicate that the security mode establishment is completed, the third message is encrypted by the target key, and the third message includes at least one of the following: the y bits of the identification of the second key, Third message verification code;
  • the target key includes one of the following: the first key, the second key, and a confidentiality protected key derived from the second key;
  • the third message is integrity protected through the third message verification code generated based on the second key, or the third message is integrity protected through the third message verification code generated based on the integrity protection key derived based on the second key.
  • the three-message verification code performs integrity protection, and the input parameters of the third message verification code include the y bits.
  • the communication unit 1110 is also configured to receive an error message sent by the second terminal device through the relay device; wherein the error message includes at least one of the following: cause information, a fourth message verification code; wherein , the reason information is used to indicate that the security policy of the second terminal device conflicts with the first terminal device, or the reason information is used to indicate that the first message verification code verification fails, or the reason information is used to indicate that the third The security algorithm negotiation between the second terminal device and the first terminal device fails; the input parameters of the fourth message verification code include at least one of the following: the reason information;
  • the processing unit 1120 is also configured to determine that the security mode establishment fails, and/or, the processing unit 1120 is also configured to reinitiate the security mode establishment process.
  • the integrity protection key includes an integrity protection key for the control plane and an integrity protection key for the user plane; and/or the confidentiality protection key includes a confidentiality protection key for the control plane. and user plane confidentiality protecting keys.
  • the above-mentioned communication unit may be a communication interface or transceiver, or an input/output interface of a communication chip or a system on a chip.
  • the above-mentioned processing unit may be one or more processors.
  • terminal device 1100 may correspond to the first terminal device in the method embodiment of the present application, and the above and other operations and/or functions of each unit in the terminal device 1100 are respectively to implement the functions shown in Figure 7
  • the corresponding process of the first terminal device in the method 200 is shown, and for the sake of simplicity, it will not be described again here.
  • Figure 24 shows a schematic block diagram of a terminal device 1200 according to an embodiment of the present application.
  • the terminal device 1200 is a second terminal device.
  • the terminal device 1200 includes:
  • Communication unit 1210 configured to send an authentication request message to the first terminal device through the relay device;
  • the authentication request message includes at least one of the following: information about the user to which the second terminal device belongs, the first temporary public key generated by the second terminal device, the signature of the second terminal device, and relevant information about the relay device. ;
  • the information of the user to which the second terminal device belongs includes the identification of the second terminal device, the public verification token PVT of the second terminal device and the public authentication key KPAK of the key management server; the signature of the second terminal device
  • the input parameters include at least one of the following: the information of the user to which the second terminal device belongs and the first temporary public key; the first temporary public key and the relevant information of the relay device are used for the first terminal device to derive the first Key; the relevant information of the relay device includes one of the following: the identity information of the relay device, the random number generated by the relay device, and the counter generated by the relay device.
  • the signature of the second terminal device is generated by the secret signature key of the second terminal device.
  • the communication unit 1210 is also configured to receive the first message sent by the first terminal device through the relay device;
  • the first message includes at least one of the following: security capability information of the first terminal device, security policy information of the first terminal device, information of the user to which the first terminal device belongs, and information of the user to which the relay device belongs. , the first random number generated by the first terminal device, the second temporary public key paired with the second temporary private key generated by the first terminal device, the identification of the first key generated by the first terminal device M bits, the signature of the first terminal device, the signature of the relay device, and the first message verification code;
  • the information of the user to which the first terminal device belongs includes the identification of the first terminal device and the PVT and KPAK of the first terminal device;
  • the information of the user to which the relay device belongs includes the identification of the relay device and the relay device.
  • the input parameters of the first terminal device's signature include at least one of the following: the information of the user to which the first terminal device belongs, the second temporary public key, the M bits, the second terminal device's Signature;
  • the input parameters of the relay device's signature include at least one of the following: information about the user to which the relay device belongs, the signature of the first terminal device, the signature of the second terminal device, and the first message;
  • the first message is integrity protected by the first message verification code generated based on the first key
  • the input parameters of the first message verification code include at least one of the following: the security capability of the first terminal device Information, the security policy information of the first terminal device, the information of the user to which the first terminal device belongs, the first random number, the second temporary public key, the M bits, and the signature of the first terminal device;
  • the second temporary public key and the relevant information of the relay device are used by the second terminal device to derive the first key, the first random number, the first key and the third key generated by the second terminal device.
  • Two random numbers are used to derive a second key.
  • the second key is used to derive an integrity protection key and/or a confidentiality protection key.
  • the identity of the first key is composed of the M bits and the first The other N bits of the key's identifier are combined, and M and N are both positive integers.
  • the signature of the first terminal device is generated by the secret signature key of the first terminal device, and/or the signature of the relay device is generated by the secret signature key of the relay device.
  • the terminal device 1200 further includes: a processing unit 1220;
  • the processing unit 1220 is configured to check the KPAK of the first terminal device and the KPAK of the relay device respectively. If the KPAK of the first terminal device and the KPAK of the relay device are valid, and the processing unit 1220 is configured to Verify the signature of the first terminal device based on the identity of the first terminal device and the PVT of the first terminal device, and the processing unit 1220 is configured to verify the signature of the first terminal device based on the identity of the relay device and the PVT of the relay device. The signature of the relay device is verified;
  • the processing unit 1220 is configured to generate a second random number.
  • the processing unit 1220 is configured to generate an integrity protection key and/or a secret based on at least the first random number, the first key and the second random number.
  • sexually protected key and the processing unit 1220 is used to generate N bits of the identification of the first key, and combine the M bits and the N bits to obtain the identification of the first key;
  • the communication unit 1210 is also configured to send a second message to the first terminal device through the relay device; wherein the second message includes at least one of the following: the second The random number, the N bits, the x bits of the identifier of the second key generated by the second terminal device, the security algorithm selected by the second terminal device, the security policy selected by the second terminal device, the Two message verification code;
  • the second message is integrity protected through the second message verification code generated based on the second key, or the second message is integrity protected through the third integrity protection key generated based on the second key.
  • the second message verification code performs integrity protection, and the input parameters of the second message verification code include at least one of the following: the second random number, the N bits, the x bits, and the second terminal device selected Security algorithm, the security policy selected by the second terminal device; wherein, the identity of the second key is obtained by combining the x bits and the other y bits of the identity of the second key, x and y are both Positive integer.
  • the second message is encrypted with the first key.
  • the first message is an authentication response message
  • the second message is a safe mode command message
  • the first message is a safe mode command message
  • the second message is a safe mode response message
  • the input parameters of the integrity protection key include at least one of the following: the second key, the selected algorithm type identifier, the length of the selected algorithm type identifier, and the integrity protection algorithm identifier.
  • the length of the integrity protection algorithm identifier; and/or, the input parameters of the confidentiality protection key include at least one of the following: the second key, the selected algorithm type identifier, the selected algorithm type identifier Length, confidentiality protection algorithm identifier, length of the confidentiality protection algorithm identifier.
  • the communication unit 1210 is also configured to receive a third message sent by the first terminal device through the relay device;
  • the third message is used to indicate that the security mode establishment is completed, the third message is encrypted by the target key, and the third message includes at least one of the following: the identification of the second key generated by the first terminal device y bits, the third message verification code;
  • the target key includes one of the following: the first key, the second key, and a confidentiality protected key derived from the second key;
  • the third message is integrity protected through the third message verification code generated based on the second key, or the third message is integrity protected through the third message verification code generated based on the integrity protection key derived based on the second key.
  • the three-message verification code performs integrity protection, and the input parameters of the third message verification code include the y bits.
  • the processing unit 1220 is configured to decrypt the third message through the target key
  • the second terminal device When the information carried in the third message has not been tampered with and the third message verification code is valid, the second terminal device combines the x bits and the y bits to obtain the second The identity of the key.
  • the communication unit 1210 is also configured to send an error message to the first terminal device through the relay device; wherein the error message includes at least one of the following: cause information, a fourth message verification code; wherein, The reason information is used to indicate that the security policy of the second terminal device conflicts with the first terminal device, or the reason information is used to indicate that the first message verification code verification fails, or the reason information is used to indicate that the second terminal device
  • the integrity protection key includes an integrity protection key for the control plane and an integrity protection key for the user plane; and/or the confidentiality protection key includes a confidentiality protection key for the control plane. and user plane confidentiality protecting keys.
  • the above-mentioned communication unit may be a communication interface or transceiver, or an input/output interface of a communication chip or a system on a chip.
  • the above-mentioned processing unit may be one or more processors.
  • terminal device 1200 may correspond to the second terminal device in the method embodiment of the present application, and the above and other operations and/or functions of each unit in the terminal device 1200 are respectively to implement the functions shown in Figure 9
  • the corresponding process of the second terminal device in method 300 is shown, and for the sake of simplicity, it will not be described again here.
  • Figure 25 shows a schematic block diagram of a terminal device 1300 according to an embodiment of the present application.
  • the terminal device 1300 is a relay device. As shown in Figure 25, the terminal device 1300 includes:
  • the communication unit 1310 is configured to receive an authentication request message sent by the second terminal device; wherein the authentication request message includes at least one of the following: information about the user to which the second terminal device belongs, the first temporary public address generated by the second terminal device. key, the signature of the second terminal device; wherein the information of the user to which the second terminal device belongs includes the identification of the second terminal device, the public verification token PVT of the second terminal device and the public authentication password of the key management server. Key KPAK; the input parameters of the signature of the second terminal device include at least one of the following: information of the user to which the second terminal device belongs and the first temporary public key;
  • the communication unit 1310 is also used to send a message to the second terminal device.
  • the first terminal device sends an authentication request message after verification; wherein the authentication request message after verification includes at least one of the following: information about the user to whom the second terminal device belongs, information about the user to whom the relay device belongs, the first temporary The public key, the signature of the second terminal device, the signature of the relay device, and the relevant information of the relay device; wherein the information of the user to which the relay device belongs includes the identification of the relay device and the PVT of the relay device.
  • the input parameters of the relay device's signature include at least one of the following: the signature of the second terminal device and the information of the user to which the relay device belongs; wherein the first temporary public key and the information related to the relay device The information is used by the first terminal device to derive the first key; the relevant information of the relay device includes one of the following: the identity information of the relay device, the random number generated by the relay device, and the counter generated by the relay device.
  • the signature of the second terminal device is generated by the secret signature key of the second terminal device, and/or the signature of the relay device is generated by the secret signature key of the relay device.
  • the communication unit 1310 is also configured to receive a first message sent by the first terminal device; wherein the first message includes at least one of the following: security capability information of the first terminal device, the first The security policy information of the terminal device, the information of the user to which the first terminal device belongs, the first random number generated by the first terminal device, the second temporary public key generated by the first terminal device, the M bits of the identification of the first key, the signature of the first terminal device, and the first message verification code; wherein the information of the user to which the first terminal device belongs includes the identification of the first terminal device and the first terminal The PVT and KPAK of the device; the input parameters of the signature of the first terminal device include at least one of the following: the information of the user to which the first terminal device belongs, the second temporary public key, the M bits, the second terminal device signature; wherein the first message is integrity protected by the first message verification code generated based on the first key, and the input parameters of the first message verification code include at least one of the following: the first terminal device The security capability information,
  • the communication unit 1310 is also used to send a message to the first terminal device.
  • the second terminal device sends the first message after verification; wherein the first message after verification includes at least one of the following: security capability information of the first terminal device, security policy information of the first terminal device, Information about the user to whom the terminal device belongs, information about the user to whom the relay device belongs, the first random number generated by the first terminal device, the second temporary public key generated by the first terminal device and paired with the second temporary private key, M bits of the identification of the first key generated by the first terminal device, the signature of the first terminal device, the signature of the relay device, and the first message verification code; wherein, the user to whom the relay device belongs
  • the information includes the identification of the relay device and the PVT and KPAK of the relay device; the input parameters of the signature of the relay device include at least one of the following: the information of the user
  • the second temporary public key and the relevant information of the relay device are used by the second terminal device to derive the first key, the first random number, the first key and the third key generated by the second terminal device.
  • Two random numbers are used to derive a second key.
  • the second key is used to derive an integrity protection key and/or a confidentiality protection key.
  • the identity of the first key is composed of the M bits and the first The other N bits of the key's identifier are combined, and M and N are both positive integers.
  • the communication unit 1310 is also used to forward the second message sent by the second terminal device to the first terminal device;
  • the second message includes at least one of the following: the second random number generated by the second terminal device, N bits of the identification of the first key generated by the second terminal device, x bits of the identifier of the generated second key, the security algorithm selected by the second terminal device, the security policy selected by the second terminal device, and the second message verification code;
  • the second message is integrity protected through the second message verification code generated based on the second key, or the second message is integrity protected through the third integrity protection key generated based on the second key.
  • the second message verification code performs integrity protection, and the input parameters of the second message verification code include at least one of the following: the second random number, the N bits, the x bits, and the second terminal device selected Security algorithm, the security policy selected by the second terminal device; wherein, the identity of the second key is obtained by combining the x bits and the other y bits of the identity of the second key, x and y are both Positive integer.
  • the second message is encrypted with the first key, or the second message is not encrypted with the first key.
  • the first message is an authentication response message
  • the second message is a safe mode command message
  • the first message is a safe mode command message
  • the second message is a safe mode response message
  • the communication unit 1310 is also used to forward the third message sent by the first terminal device to the second terminal device;
  • the third message is used to indicate that the security mode establishment is completed, the third message is encrypted by the target key, and the third message includes at least one of the following: the identification of the second key generated by the first terminal device y bits, the third message verification code;
  • the target key includes one of the following: the first key, the second key, and a confidentiality protected key derived from the second key;
  • the third message is integrity protected through the third message verification code generated based on the second key, or the third message is integrity protected through the third message verification code generated based on the integrity protection key derived based on the second key.
  • the three-message verification code performs integrity protection, and the input parameters of the third message verification code include the y bits.
  • the communication unit 1310 is also used to forward the error message sent by the second terminal device to the first terminal device; wherein the error message includes at least one of the following: cause information, fourth message verification code ; Wherein, the reason information is used to indicate that the security policy of the second terminal device conflicts with the first terminal device, or the reason information is used to indicate that the first message verification code verification fails, or the reason information is used to indicate The security algorithm negotiation between the second terminal device and the first terminal device fails; the input parameters of the fourth message verification code include at least one of the following: the reason information.
  • the integrity protection key includes an integrity protection key for the control plane and an integrity protection key for the user plane; and/or the confidentiality protection key includes a confidentiality protection key for the control plane. and user plane confidentiality protecting keys.
  • the above-mentioned communication unit may be a communication interface or transceiver, or an input/output interface of a communication chip or a system on a chip.
  • terminal device 1300 may correspond to the relay device in the method embodiment of the present application, and the above and other operations and/or functions of each unit in the terminal device 1300 are respectively intended to implement what is shown in Figure 10
  • the corresponding process of the relay device in method 400 will not be described again for the sake of simplicity.
  • Figure 26 shows a schematic block diagram of a terminal device 1400 according to an embodiment of the present application.
  • the terminal device 1400 is a first terminal device.
  • the terminal device 1400 includes:
  • Communication unit 1410 configured to send the first message to the second terminal device through the relay device
  • the first message includes at least one of the following: security capability information of the first terminal device, security policy information of the first terminal device, information of the user to which the first terminal device belongs, a third message generated by the first terminal device.
  • security capability information of the first terminal device security policy information of the first terminal device
  • information of the user to which the first terminal device belongs a third message generated by the first terminal device.
  • the information of the user to which the first terminal device belongs includes the identification of the first terminal device, the public verification token PVT of the first terminal device and the public authentication key KPAK of the key management server; the signature of the first terminal device
  • the input parameters include at least one of the following: information about the user to which the first terminal device belongs, the second temporary public key, the M bits, and the signature of the second terminal device;
  • the first message is integrity protected by the first message verification code generated based on the first key
  • the input parameters of the first message verification code include at least one of the following: the security capability of the first terminal device Information, the security policy information of the first terminal device, the information of the user to which the first terminal device belongs, the first random number, the second temporary public key, the M bits, and the signature of the first terminal device;
  • the second temporary public key and the relevant information of the relay device are used by the second terminal device to derive the first key, the first random number, the first key and the third key generated by the second terminal device.
  • Two random numbers are used to derive a second key.
  • the second key is used to derive an integrity protection key and/or a confidentiality protection key.
  • the identity of the first key is composed of the M bits and the first The other N bits of the key's identification are combined, and M and N are both positive integers;
  • the relevant information of the relay device includes one of the following: identity information of the relay device, a random number generated by the relay device, and a counter generated by the relay device.
  • the communication unit 1410 is also used to receive the second message sent by the second terminal device through the relay device;
  • the second message includes at least one of the following: the second random number generated by the second terminal device, N bits of the identification of the first key generated by the second terminal device, x bits of the identifier of the generated second key, the security algorithm selected by the second terminal device, the security policy selected by the second terminal device, and the second message verification code;
  • the second message is integrity protected through the second message verification code generated based on the second key, or the second message is integrity protected through the third integrity protection key generated based on the second key.
  • the second message verification code performs integrity protection, and the input parameters of the second message verification code include at least one of the following: the second random number, the N bits, the x bits, and the second terminal device selected Security algorithm, the security policy selected by the second terminal device; wherein, the identity of the second key is obtained by combining the x bits and the other y bits of the identity of the second key, x and y are both Positive integer.
  • the second message is encrypted with the first key, or the second message is not encrypted with the first key.
  • the terminal device 1400 further includes: a processing unit 1420;
  • the processing unit 1420 is configured to generate the second key based on at least the first random number, the first key and the second random number.
  • the unit 1420 is further configured to generate an integrity protection key and/or a confidentiality protection key according to the second key, and the processing unit 1420 is further configured to combine the M bits and the N bits to obtain the first An identifier of a key, the processing unit 1420 is also used to generate y bits of the identifier of the second key, and combine the x bits and the y bits to obtain the identifier of the second key;
  • the processing unit 1420 is also configured to generate an integrity protection key based on the second key and/or the security algorithm selected by the second terminal device and the second key. Or the confidentiality protection key and the security policy selected by the second terminal device are used to communicate with the second terminal device.
  • the processing unit 1420 is also configured to decrypt the second message according to the first key
  • the processing unit 1420 is also configured to generate the second key based on at least the first random number, the first key and the second random number.
  • the processing unit 1420 is further configured to generate an integrity protection key and/or a confidentiality protection key according to the second key, and the processing unit 1420 is further configured to combine the M bits and the N bits to obtain the
  • the processing unit 1420 is also used to generate y bits of the identity of the second key, and combine the x bits and the y bits to obtain the identity of the second key. ;
  • the processing unit 1420 is also configured to generate an integrity protection key based on the second key and/or the security algorithm selected by the second terminal device and the second key. Or the confidentiality protection key and the security policy selected by the second terminal device are used to communicate with the second terminal device.
  • the input parameters of the integrity protection key include at least one of the following: the second key, the selected algorithm type identifier, the length of the selected algorithm type identifier, and the integrity protection algorithm identifier.
  • the length of the integrity protection algorithm identifier; and/or, the input parameters of the confidentiality protection key include at least one of the following: the second key, the selected algorithm type identifier, the selected algorithm type identifier Length, confidentiality protection algorithm identifier, length of the confidentiality protection algorithm identifier.
  • the first message is an authentication response message
  • the second message is a safe mode command message
  • the first message is a safe mode command message
  • the second message is a safe mode response message
  • the communication unit 1410 is also used to send a third message to the second terminal device through the relay device;
  • the third message is used to indicate that the security mode establishment is completed, the third message is encrypted by the target key, and the third message includes at least one of the following: the y bits of the identification of the second key, Third message verification code;
  • the target key includes one of the following: the first key, the second key, and a confidentiality protected key derived from the second key;
  • the third message is integrity protected through the third message verification code generated based on the second key, or the third message is integrity protected through the third message verification code generated based on the integrity protection key derived based on the second key.
  • the three-message verification code performs integrity protection, and the input parameters of the third message verification code include the y bits.
  • the communication unit 1410 is also used to receive an error message sent by the second terminal device through the relay device; wherein the error message includes at least one of the following: cause information, a fourth message verification code; wherein , the reason information is used to indicate that the security policy of the second terminal device conflicts with the first terminal device, or the reason information is used to indicate that the first message verification code verification fails, or the reason information is used to indicate that the third
  • the security algorithm negotiation between the second terminal device and the first terminal device fails, and the input parameters of the fourth message verification code include at least one of the following: the reason information;
  • the processing unit 1420 is also configured to determine that the security mode establishment fails, and/or, the processing unit 1420 is also configured to reinitiate the security mode establishment process.
  • the integrity protection key includes an integrity protection key for the control plane and an integrity protection key for the user plane; and/or the confidentiality protection key includes a confidentiality protection key for the control plane. and user plane confidentiality protecting keys.
  • the communication unit 1410 is also configured to receive an authentication request message sent by the second terminal device through the relay device;
  • the authentication request message includes at least one of the following: information about the user to which the second terminal device belongs, information about the user to which the relay device belongs, the first temporary public key generated by the second terminal device, Signature, the signature of the relay device, and relevant information of the relay device;
  • the information of the user to which the second terminal device belongs includes the identification of the second terminal device, the public verification token PVT of the second terminal device and the public authentication key KPAK of the key management server;
  • the information includes the identification of the relay device and the PVT and KPAK of the relay device;
  • the input parameters of the signature of the second terminal device include at least one of the following: information of the user to which the second terminal device belongs and the first temporary public key.
  • the input parameters of the relay device's signature include at least one of the following: the signature of the second terminal device and the information of the user to which the relay device belongs; the first temporary public key and the relevant information of the relay device are used for the The first terminal device derives the first key.
  • the signature of the second terminal device is generated by the secret signature key of the second terminal device, and/or the signature of the relay device is generated by the secret signature key of the relay device.
  • the KPAK of the second terminal device and the KPAK of the relay device are valid, and the signature verification of the second terminal device based on the identity of the second terminal device and the PVT of the second terminal device is successful.
  • the processing unit 1420 is also configured to generate a second temporary private key paired with the second temporary public key. key, and the processing unit 1420 is also configured to derive the first key according to the first temporary public key, the relevant information of the relay device, and the second temporary private key.
  • the above-mentioned communication unit may be a communication interface or transceiver, or an input/output interface of a communication chip or a system on a chip.
  • the above-mentioned processing unit may be one or more processors.
  • terminal device 1400 may correspond to the first terminal device in the method embodiment of the present application, and the above and other operations and/or functions of each unit in the terminal device 1400 are respectively to implement the functions shown in Figure 11
  • the corresponding process of the first terminal device in method 500 is shown, and for the sake of simplicity, it will not be described again here.
  • Figure 27 shows a schematic block diagram of a terminal device 1500 according to an embodiment of the present application.
  • the terminal device 1500 is a second terminal device.
  • the terminal device 1500 includes:
  • Communication unit 1510 configured to receive the first message sent by the first terminal device through the relay device
  • the first message includes at least one of the following: security capability information of the first terminal device, security policy information of the first terminal device, information of the user to which the first terminal device belongs, and information of the user to which the relay device belongs. , the first random number generated by the first terminal device, the second temporary public key generated by the first terminal device, the M bits of the identification of the first key generated by the first terminal device, the first terminal device signature, the signature of the relay device, and the first message verification code;
  • the information of the user to which the first terminal device belongs includes the identification of the first terminal device, the public verification token PVT of the first terminal device and the public authentication key KPAK of the key management server;
  • the information includes the identification of the relay device and the PVT and KPAK of the relay device;
  • the input parameters of the signature of the first terminal device include at least one of the following: information of the user to which the first terminal device belongs, the second temporary public key , the M bits, the signature of the second terminal device;
  • the input parameters of the relay device's signature include at least one of the following: information about the user to which the relay device belongs, the signature of the first terminal device, the second The signature of the terminal device, the first message;
  • the first message is integrity protected by the first message verification code generated based on the first key
  • the input parameters of the first message verification code include at least one of the following: the security capability of the first terminal device Information, the security policy information of the first terminal device, the information of the user to which the first terminal device belongs, the first random number, the second temporary public key, the M bits, and the signature of the first terminal device;
  • the second temporary public key and the relevant information of the relay device are used by the second terminal device to derive the first key, the first random number, the first key and the third key generated by the second terminal device.
  • Two random numbers are used to derive a second key.
  • the second key is used to derive an integrity protection key and/or a confidentiality protection key.
  • the identity of the first key is composed of the M bits and the first The other N bits of the key's identification are combined, and M and N are both positive integers;
  • the relevant information of the relay device includes one of the following: identity information of the relay device, a random number generated by the relay device, and a counter generated by the relay device.
  • the signature of the first terminal device is generated by the secret signature key of the first terminal device, and/or the signature of the relay device is generated by the secret signature key of the relay device.
  • the terminal device 1500 further includes: a processing unit 1520;
  • the processing unit 1520 is configured to check the KPAK of the first terminal device and the KPAK of the relay device respectively. When the KPAK of the first terminal device and the KPAK of the relay device are valid, the processing unit 1520 also uses Verifying the signature of the first terminal device based on the identity of the first terminal device and the PVT of the first terminal device, and the processing unit 1520 is also configured to verify the signature of the first terminal device based on the identity of the relay device and the PVT of the relay device. Verify the signature of the relay device;
  • the processing unit 1520 is also configured to generate a second random number. 1520 is also configured to generate the second key based on at least the first random number, the first key and the second random number. The processing unit 1520 is also configured to generate an integrity protection key based on the second key. /or confidentiality protection key, and the processing unit 1520 is also used to generate N bits of the identification of the first key, and combine the M bits and the N bits to obtain the first key logo;
  • the communication unit 1510 is also configured to send a second message to the first terminal device through the relay device; wherein the second message includes at least one of the following: the second The random number, the N bits, the x bits of the identifier of the second key generated by the second terminal device, the security algorithm selected by the second terminal device, the security policy selected by the second terminal device, the Two message verification code;

Abstract

Provided in the embodiments of the present application are a relay communication method, and a device. The identity security of a user equipment and the confidentiality and integrity of communication data can be guaranteed, such that the confidentiality and integrity of data transmission between two parties are ensured, and the eavesdropping of other devices and even a relay device is prevented.

Description

中继通信的方法及设备Methods and equipment for relay communications 技术领域Technical field
本申请实施例涉及通信领域,并且更具体地,涉及一种中继通信的方法及设备。Embodiments of the present application relate to the field of communications, and more specifically, to a method and device for relaying communications.
背景技术Background technique
在通过中继设备(relay)实现源终端和目标终端通信的架构(终端至终端中继(UE-to-UE relay))中,如何保证终端身份安全与通信数据的机密性与完整性,是一个需要解决的问题。In the architecture that implements communication between the source terminal and the target terminal through a relay device (UE-to-UE relay), how to ensure the security of the terminal identity and the confidentiality and integrity of the communication data is A problem that needs to be solved.
发明内容Contents of the invention
本申请实施例提供了一种中继通信的方法及设备,能够保证终端身份安全与通信数据的机密性与完整性,从而确保双方传输数据的机密性和完整性,防止其他设备甚至中继设备的窃听。Embodiments of the present application provide a method and device for relay communication, which can ensure the security of terminal identities and the confidentiality and integrity of communication data, thereby ensuring the confidentiality and integrity of data transmitted by both parties and preventing other devices and even relay devices from of eavesdropping.
第一方面,提供了一种中继通信的方法,该方法包括:In the first aspect, a method for relaying communication is provided, which method includes:
第一终端设备接收第二终端设备通过中继设备发送的认证请求消息;The first terminal device receives the authentication request message sent by the second terminal device through the relay device;
其中,该认证请求消息包括以下至少之一:该第二终端设备所属用户的信息,该中继设备所属用户的信息,该第二终端设备生成的第一临时公钥,该第二终端设备的签名,该中继设备的签名,该中继设备的相关信息;The authentication request message includes at least one of the following: information about the user to which the second terminal device belongs, information about the user to which the relay device belongs, the first temporary public key generated by the second terminal device, Signature, the signature of the relay device, and relevant information of the relay device;
其中,该第二终端设备所属用户的信息包括该第二终端设备的标识和该第二终端设备的PVT和KPAK;该中继设备所属用户的信息包括该中继设备的标识和该中继设备的PVT和KPAK;该第二终端设备的签名的输入参数包括以下至少之一:该第二终端设备所属用户的信息和该第一临时公钥;该中继设备的签名的输入参数包括以下至少之一:该第二终端设备的签名和该中继设备所属用户的信息;该第一临时公钥和该中继设备的相关信息用于该第一终端设备派生第一密钥;该中继设备的相关信息包括以下之一:该中继设备的身份信息,该中继设备生成的随机数,该中继设备生成的计数器。Wherein, the information of the user to which the second terminal device belongs includes the identification of the second terminal device and the PVT and KPAK of the second terminal device; the information of the user to which the relay device belongs includes the identification of the relay device and the relay device. PVT and KPAK; the input parameters of the signature of the second terminal device include at least one of the following: the information of the user to which the second terminal device belongs and the first temporary public key; the input parameters of the signature of the relay device include at least one of the following: One: the signature of the second terminal device and the information of the user to which the relay device belongs; the first temporary public key and the relevant information of the relay device are used for the first terminal device to derive the first key; the relay The relevant information of the device includes one of the following: the identity information of the relay device, the random number generated by the relay device, and the counter generated by the relay device.
第二方面,提供了一种中继通信的方法,该方法包括:In the second aspect, a method for relaying communication is provided, which method includes:
第二终端设备通过中继设备向第一终端设备发送认证请求消息;The second terminal device sends an authentication request message to the first terminal device through the relay device;
其中,该认证请求消息包括以下至少之一:该第二终端设备所属用户的信息,该第二终端设备生成的第一临时公钥,该第二终端设备的签名,该中继设备的相关信息;The authentication request message includes at least one of the following: information about the user to which the second terminal device belongs, the first temporary public key generated by the second terminal device, the signature of the second terminal device, and relevant information about the relay device. ;
其中,该第二终端设备所属用户的信息包括该第二终端设备的标识和该第二终端设备的PVT和KPAK;该第二终端设备的签名的输入参数包括以下至少之一:该第二终端设备所属用户的信息和该第一临时公钥;该第一临时公钥和该中继设备的相关信息用于该第一终端设备派生第一密钥;该中继设备的相关信息包括以下之一:该中继设备的身份信息,该中继设备生成的随机数,该中继设备生成的计数器。Wherein, the information of the user to which the second terminal device belongs includes the identification of the second terminal device and the PVT and KPAK of the second terminal device; the input parameters of the signature of the second terminal device include at least one of the following: the second terminal The information of the user to which the device belongs and the first temporary public key; the first temporary public key and the relevant information of the relay device are used for the first terminal device to derive the first key; the relevant information of the relay device includes the following: 1: The identity information of the relay device, the random number generated by the relay device, and the counter generated by the relay device.
第三方面,提供了一种中继通信的方法,该方法包括:In a third aspect, a method for relaying communication is provided, which method includes:
中继设备接收第二终端设备发送的认证请求消息;其中,该认证请求消息包括以下至少之一:该第二终端设备所属用户的信息,该第二终端设备生成的第一临时公钥,该第二终端设备的签名;其中,该第二终端设备所属用户的信息包括该第二终端设备的标识和该第二终端设备的PVT和KPAK;该第二终端设备的签名的输入参数包括以下至少之一:该第二终端设备所属用户的信息和该第一临时公钥;该第一临时公钥和该中继设备的相关信息用于第一终端设备派生第一密钥;The relay device receives an authentication request message sent by the second terminal device; wherein the authentication request message includes at least one of the following: information about the user to which the second terminal device belongs, the first temporary public key generated by the second terminal device, the The signature of the second terminal device; wherein the information of the user to which the second terminal device belongs includes the identification of the second terminal device and the PVT and KPAK of the second terminal device; the input parameters of the signature of the second terminal device include at least the following: One: the information of the user to which the second terminal device belongs and the first temporary public key; the first temporary public key and the relevant information of the relay device are used by the first terminal device to derive the first key;
在该第二终端设备的KPAK有效,且基于该第二终端设备的标识和该第二终端设备的PVT对该第二终端设备的签名验证成功的情况下,该中继设备向该第一终端设备发送验证之后的认证请求消息;其中,该验证之后的认证请求消息包括以下至少之一:该第二终端设备所属用户的信息,该中继设备所属用户的信息,该第一临时公钥,该第二终端设备的签名,该中继设备的签名,该中继设备的相关信息;其中,该中继设备所属用户的信息包括该中继设备的标识和该中继设备的PVT和KPAK;该中继设备的签名的输入参数包括以下至少之一:该第二终端设备的签名和该中继设备所属用户的信息;其中,该中继设备的相关信息包括以下之一:该中继设备的身份信息,该中继设备生成的随机数,该中继设备生成的计数器。When the KPAK of the second terminal device is valid and the signature verification of the second terminal device based on the identity of the second terminal device and the PVT of the second terminal device is successful, the relay device sends a message to the first terminal device. The device sends an authentication request message after verification; wherein the authentication request message after verification includes at least one of the following: information about the user to which the second terminal device belongs, information about the user to which the relay device belongs, the first temporary public key, The signature of the second terminal device, the signature of the relay device, and the relevant information of the relay device; wherein the information of the user to which the relay device belongs includes the identification of the relay device and the PVT and KPAK of the relay device; The input parameters of the relay device's signature include at least one of the following: the signature of the second terminal device and the information of the user to which the relay device belongs; wherein the relevant information of the relay device includes one of the following: the relay device The identity information, the random number generated by the relay device, and the counter generated by the relay device.
第四方面,提供了一种中继通信的方法,该方法包括:The fourth aspect provides a method for relaying communication, which method includes:
第一终端设备通过中继设备向第二终端设备发送第一消息;The first terminal device sends the first message to the second terminal device through the relay device;
其中,该第一消息包括以下至少之一:该第一终端设备的安全能力信息,该第一终端设备的安全策略信息,该第一终端设备所属用户的信息,该第一终端设备生成的第一随机数,该第一终端设备生成的第二临时公钥,该第一终端设备生成的第一密钥的标识的M个比特位,该第一终端设备的签名,第一消息验证码;Wherein, the first message includes at least one of the following: security capability information of the first terminal device, security policy information of the first terminal device, information of the user to which the first terminal device belongs, a third message generated by the first terminal device. A random number, the second temporary public key generated by the first terminal device, M bits of the identification of the first key generated by the first terminal device, the signature of the first terminal device, and the first message verification code;
其中,该第一终端设备所属用户的信息包括该第一终端设备的标识和该第一终端设备的PVT和 KPAK;该第一终端设备的签名的输入参数包括以下至少之一:该第一终端设备所属用户的信息,该第二临时公钥,该M个比特位,该第二终端设备的签名;Wherein, the information of the user to which the first terminal device belongs includes the identification of the first terminal device and the PVT and KPAK of the first terminal device; the input parameters of the signature of the first terminal device include at least one of the following: the first terminal Information about the user to whom the device belongs, the second temporary public key, the M bits, and the signature of the second terminal device;
其中,该第一消息通过基于该第一密钥生成的该第一消息验证码进行完整性保护,且该第一消息验证码的输入参数包括以下至少之一:该第一终端设备的安全能力信息,该第一终端设备的安全策略信息,该第一终端设备所属用户的信息,该第一随机数,该第二临时公钥,该M个比特位,该第一终端设备的签名;Wherein, the first message is integrity protected by the first message verification code generated based on the first key, and the input parameters of the first message verification code include at least one of the following: the security capability of the first terminal device Information, the security policy information of the first terminal device, the information of the user to which the first terminal device belongs, the first random number, the second temporary public key, the M bits, and the signature of the first terminal device;
其中,该第二临时公钥和该中继设备的相关信息用于该第二终端设备派生该第一密钥,该第一随机数、该第一密钥和该第二终端设备生成的第二随机数用于派生第二密钥,该第二密钥用于派生完整性保护密钥和/或机密性保护密钥,该第一密钥的标识由该M个比特位与该第一密钥的标识的另外N个比特位合并得到,M和N均为正整数;Wherein, the second temporary public key and the relevant information of the relay device are used by the second terminal device to derive the first key, the first random number, the first key and the third key generated by the second terminal device. Two random numbers are used to derive a second key. The second key is used to derive an integrity protection key and/or a confidentiality protection key. The identity of the first key is composed of the M bits and the first The other N bits of the key's identification are combined, and M and N are both positive integers;
其中,该中继设备的相关信息包括以下之一:该中继设备的身份信息,该中继设备生成的随机数,该中继设备生成的计数器。The relevant information of the relay device includes one of the following: identity information of the relay device, a random number generated by the relay device, and a counter generated by the relay device.
第五方面,提供了一种中继通信的方法,该方法包括:The fifth aspect provides a method for relaying communication, which method includes:
第二终端设备接收第一终端设备通过中继设备发送的第一消息;The second terminal device receives the first message sent by the first terminal device through the relay device;
其中,该第一消息包括以下至少之一:该第一终端设备的安全能力信息,该第一终端设备的安全策略信息,该第一终端设备所属用户的信息,该中继设备所属用户的信息,该第一终端设备生成的第一随机数,该第一终端设备生成的第二临时公钥,该第一终端设备生成的第一密钥的标识的M个比特位,该第一终端设备的签名,该中继设备的签名,第一消息验证码;Wherein, the first message includes at least one of the following: security capability information of the first terminal device, security policy information of the first terminal device, information of the user to which the first terminal device belongs, and information of the user to which the relay device belongs. , the first random number generated by the first terminal device, the second temporary public key generated by the first terminal device, the M bits of the identification of the first key generated by the first terminal device, the first terminal device signature, the signature of the relay device, and the first message verification code;
其中,该第一终端设备所属用户的信息包括该第一终端设备的标识和该第一终端设备的PVT和KPAK;该中继设备所属用户的信息包括该中继设备的标识和该中继设备的PVT和KPAK;该第一终端设备的签名的输入参数包括以下至少之一:该第一终端设备所属用户的信息,该第二临时公钥,该M个比特位,该第二终端设备的签名;该中继设备的签名的输入参数包括以下至少之一:该中继设备所属用户的信息,该第一终端设备的签名,该第二终端设备的签名,该第一消息;Wherein, the information of the user to which the first terminal device belongs includes the identification of the first terminal device and the PVT and KPAK of the first terminal device; the information of the user to which the relay device belongs includes the identification of the relay device and the relay device. PVT and KPAK; the input parameters of the first terminal device's signature include at least one of the following: the information of the user to which the first terminal device belongs, the second temporary public key, the M bits, the second terminal device's Signature; the input parameters of the relay device's signature include at least one of the following: information about the user to which the relay device belongs, the signature of the first terminal device, the signature of the second terminal device, and the first message;
其中,该第一消息通过基于该第一密钥生成的该第一消息验证码进行完整性保护,且该第一消息验证码的输入参数包括以下至少之一:该第一终端设备的安全能力信息,该第一终端设备的安全策略信息,该第一终端设备所属用户的信息,该第一随机数,该第二临时公钥,该M个比特位,该第一终端设备的签名;Wherein, the first message is integrity protected by the first message verification code generated based on the first key, and the input parameters of the first message verification code include at least one of the following: the security capability of the first terminal device Information, the security policy information of the first terminal device, the information of the user to which the first terminal device belongs, the first random number, the second temporary public key, the M bits, and the signature of the first terminal device;
其中,该第二临时公钥和该中继设备的相关信息用于该第二终端设备派生该第一密钥,该第一随机数、该第一密钥和该第二终端设备生成的第二随机数用于派生第二密钥,该第二密钥用于派生完整性保护密钥和/或机密性保护密钥,该第一密钥的标识由该M个比特位与该第一密钥的标识的另外N个比特位合并得到,M和N均为正整数;Wherein, the second temporary public key and the relevant information of the relay device are used by the second terminal device to derive the first key, the first random number, the first key and the third key generated by the second terminal device. Two random numbers are used to derive a second key. The second key is used to derive an integrity protection key and/or a confidentiality protection key. The identity of the first key is composed of the M bits and the first The other N bits of the key's identification are combined, and M and N are both positive integers;
其中,该中继设备的相关信息包括以下之一:该中继设备的身份信息,该中继设备生成的随机数,该中继设备生成的计数器。The relevant information of the relay device includes one of the following: identity information of the relay device, a random number generated by the relay device, and a counter generated by the relay device.
第六方面,提供了一种中继通信的方法,该方法包括:A sixth aspect provides a method for relaying communications, which method includes:
中继设备接收第一终端设备发送的第一消息;其中,该第一消息包括以下至少之一:该第一终端设备的安全能力信息,该第一终端设备的安全策略信息,该第一终端设备所属用户的信息,该第一终端设备生成的第一随机数,该第一终端设备生成的第二临时公钥,该第一终端设备生成的第一密钥的标识的M个比特位,该第一终端设备的签名,第一消息验证码;其中,该第一终端设备所属用户的信息包括该第一终端设备的标识和该第一终端设备的PVT和KPAK;该第一终端设备的签名的输入参数包括以下至少之一:该第一终端设备所属用户的信息,该第二临时公钥,该M个比特位,该第二终端设备的签名;其中,该第一消息通过基于该第一密钥生成的该第一消息验证码进行完整性保护,且该第一消息验证码的输入参数包括以下至少之一:该第一终端设备的安全能力信息,该第一终端设备的安全策略信息,该第一终端设备所属用户的信息,该第一随机数,该第二临时公钥,该M个比特位,该第一终端设备的签名;The relay device receives the first message sent by the first terminal device; wherein the first message includes at least one of the following: security capability information of the first terminal device, security policy information of the first terminal device, Information about the user to whom the device belongs, the first random number generated by the first terminal device, the second temporary public key generated by the first terminal device, M bits of the identification of the first key generated by the first terminal device, The signature of the first terminal device, the first message verification code; wherein the information of the user to which the first terminal device belongs includes the identification of the first terminal device and the PVT and KPAK of the first terminal device; The input parameters of the signature include at least one of the following: information about the user to which the first terminal device belongs, the second temporary public key, the M bits, and the signature of the second terminal device; wherein the first message is passed based on the The first message verification code generated by the first key is integrity protected, and the input parameters of the first message verification code include at least one of the following: the security capability information of the first terminal device, the security capability of the first terminal device Policy information, information about the user to which the first terminal device belongs, the first random number, the second temporary public key, the M bits, and the signature of the first terminal device;
在该第一终端设备的KPAK有效,且基于该第一终端设备的标识和该第一终端设备的PVT对该第一终端设备的签名验证成功的情况下,该中继设备向该第二终端设备发送验证之后的第一消息;其中,该验证之后的第一消息包括以下至少之一:该第一终端设备的安全能力信息,该第一终端设备的安全策略信息,该第一终端设备所属用户的信息,该中继设备所属用户的信息,该第一终端设备生成的第一随机数,该第一终端设备生成的与该第二临时私钥配对的第二临时公钥,该第一终端设备生成的该第一密钥的标识的M个比特位,该第一终端设备的签名,该中继设备的签名,该中继设备的相关信息,该第一消息验证码;其中,该中继设备所属用户的信息包括该中继设备的标识和该中继设备的PVT和KPAK;该中继设备的签名的输入参数包括以下至少之一:该中继设备所属用户的信息, 该第一终端设备的签名,该第二终端设备的签名,该验证之后的第一消息;When the KPAK of the first terminal device is valid and the signature verification of the first terminal device based on the identity of the first terminal device and the PVT of the first terminal device is successful, the relay device sends a request to the second terminal device. The device sends the first message after verification; wherein the first message after verification includes at least one of the following: security capability information of the first terminal device, security policy information of the first terminal device, the The user's information, the information of the user to which the relay device belongs, the first random number generated by the first terminal device, the second temporary public key generated by the first terminal device and paired with the second temporary private key, the first M bits of the identification of the first key generated by the terminal device, the signature of the first terminal device, the signature of the relay device, the relevant information of the relay device, and the first message verification code; wherein, the The information of the user to which the relay device belongs includes the identification of the relay device and the PVT and KPAK of the relay device; the input parameters of the signature of the relay device include at least one of the following: the information of the user to which the relay device belongs, the third The signature of a terminal device, the signature of the second terminal device, and the first message after verification;
其中,该第二临时公钥和该中继设备的相关信息用于该第二终端设备派生该第一密钥,该第一随机数、该第一密钥和该第二终端设备生成的第二随机数用于派生第二密钥,该第二密钥用于派生完整性保护密钥和/或机密性保护密钥,该第一密钥的标识由该M个比特位与该第一密钥的标识的另外N个比特位合并得到,M和N均为正整数;其中,该中继设备的相关信息包括以下之一:该中继设备的身份信息,该中继设备生成的随机数,该中继设备生成的计数器。Wherein, the second temporary public key and the relevant information of the relay device are used by the second terminal device to derive the first key, the first random number, the first key and the third key generated by the second terminal device. Two random numbers are used to derive a second key. The second key is used to derive an integrity protection key and/or a confidentiality protection key. The identity of the first key is composed of the M bits and the first The other N bits of the key's identification are combined, and M and N are both positive integers; among them, the relevant information of the relay device includes one of the following: the identity information of the relay device, the random number generated by the relay device. Count, the counter generated by this relay device.
第七方面,提供了一种中继通信的方法,该方法包括:A seventh aspect provides a method for relaying communications, which method includes:
第一终端设备通过中继设备向第二终端设备发送直接通信请求;The first terminal device sends a direct communication request to the second terminal device through the relay device;
其中,该直接通信请求包括以下至少之一:该第一终端设备的安全能力信息,该第一终端设备的安全策略信息,该第一终端设备生成的第一临时公钥,该第一终端设备生成的第一随机数;Wherein, the direct communication request includes at least one of the following: security capability information of the first terminal device, security policy information of the first terminal device, a first temporary public key generated by the first terminal device, The first random number generated;
其中,该直接通信请求通过第一加密密钥进行加密,以及该直接通信请求通过第一完整性保护密钥进行完整性保护,该第一加密密钥为基于已注册并被授权使用UE-to-UE relay通信的终端的对称密钥衍生的加密密钥,该第一完整性保护密钥为基于已注册并被授权使用UE-to-UE relay通信的终端的对称密钥衍生的完整性保护密钥;Wherein, the direct communication request is encrypted through a first encryption key, and the direct communication request is integrity protected through a first integrity protection key. The first encryption key is based on the registered and authorized use of the UE-to - an encryption key derived from the symmetric key of the terminal for UE relay communication, the first integrity protection key is an integrity protection key derived based on the symmetric key of the terminal that has been registered and authorized to use UE-to-UE relay communication key;
其中,该第一临时公钥和该中继设备的相关信息用于该第二终端设备派生第一密钥;该第一随机数、该第一密钥和该第二终端设备生成的第二随机数用于派生第二密钥,且该第二密钥用于派生第二加密密钥和/或第二完整性保护密钥,或者,该第一随机数、该第一密钥和该第二终端设备生成的第二随机数用于派生第二加密密钥和/或第二完整性保护密钥;Among them, the first temporary public key and the relevant information of the relay device are used by the second terminal device to derive the first key; the first random number, the first key and the second key generated by the second terminal device. The random number is used to derive a second key, and the second key is used to derive a second encryption key and/or a second integrity protection key, or the first random number, the first key and the The second random number generated by the second terminal device is used to derive the second encryption key and/or the second integrity protection key;
其中,该中继设备的相关信息包括以下之一:该中继设备的身份信息,该中继设备生成的随机数,该中继设备生成的计数器。The relevant information of the relay device includes one of the following: identity information of the relay device, a random number generated by the relay device, and a counter generated by the relay device.
第八方面,提供了一种中继通信的方法,该方法包括:An eighth aspect provides a method for relaying communications, which method includes:
第二终端设备接收第一终端设备通过中继设备发送的直接通信请求;The second terminal device receives the direct communication request sent by the first terminal device through the relay device;
其中,该直接通信请求包括以下至少之一:该第一终端设备的安全能力信息,该第一终端设备的安全策略信息,该第一终端设备生成的第一临时公钥,该第一终端设备生成的第一随机数,该中继设备的标识,该中继设备的相关信息;Wherein, the direct communication request includes at least one of the following: security capability information of the first terminal device, security policy information of the first terminal device, a first temporary public key generated by the first terminal device, The first random number generated, the identification of the relay device, and the relevant information of the relay device;
其中,该直接通信请求通过第一加密密钥进行加密,以及该直接通信请求通过第一完整性保护密钥进行完整性保护,该第一加密密钥为基于已注册并被授权使用UE-to-UE relay通信的终端的对称密钥衍生的加密密钥,该第一完整性保护密钥为基于已注册并被授权使用UE-to-UE relay通信的终端的对称密钥衍生的完整性保护密钥;Wherein, the direct communication request is encrypted through a first encryption key, and the direct communication request is integrity protected through a first integrity protection key. The first encryption key is based on the registered and authorized use of the UE-to - an encryption key derived from the symmetric key of the terminal for UE relay communication, the first integrity protection key is an integrity protection key derived based on the symmetric key of the terminal that has been registered and authorized to use UE-to-UE relay communication key;
其中,该中继设备的相关信息包括以下之一:该中继设备的身份信息,该中继设备生成的随机数,该中继设备生成的计数器;该第一临时公钥和该中继设备的相关信息用于该第二终端设备派生第一密钥;该第一随机数、该第一密钥和该第二终端设备生成的第二随机数用于派生第二密钥,且该第二密钥用于派生第二加密密钥和/或第二完整性保护密钥,或者,该第一随机数、该第一密钥和该第二终端设备生成的第二随机数用于派生第二加密密钥和/或第二完整性保护密钥。Among them, the relevant information of the relay device includes one of the following: the identity information of the relay device, the random number generated by the relay device, the counter generated by the relay device; the first temporary public key and the relay device The relevant information is used by the second terminal device to derive the first key; the first random number, the first key and the second random number generated by the second terminal device are used to derive the second key, and the first random number is used to derive the second key. The second key is used to derive the second encryption key and/or the second integrity protection key, or the first random number, the first key and the second random number generated by the second terminal device are used to derive A second encryption key and/or a second integrity protection key.
第九方面,提供了一种中继通信的方法,该方法包括:A ninth aspect provides a method for relaying communications, which method includes:
中继设备接收第一终端设备发送的直接通信请求;其中,该直接通信请求包括以下至少之一:该第一终端设备的安全能力信息,该第一终端设备的安全策略信息,该第一终端设备生成的第一临时公钥,该第一终端设备生成的第一随机数;其中,该直接通信请求通过第一加密密钥进行加密,以及该直接通信请求通过第一完整性保护密钥进行完整性保护,该第一加密密钥为基于已注册并被授权使用UE-to-UE relay通信的终端的对称密钥衍生的加密密钥,该第一完整性保护密钥为基于已注册并被授权使用UE-to-UE relay通信的终端的对称密钥衍生的完整性保护密钥;The relay device receives a direct communication request sent by the first terminal device; wherein the direct communication request includes at least one of the following: security capability information of the first terminal device, security policy information of the first terminal device, The first temporary public key generated by the device, the first random number generated by the first terminal device; wherein the direct communication request is encrypted through the first encryption key, and the direct communication request is performed through the first integrity protection key Integrity protection, the first encryption key is an encryption key derived based on the symmetric key of the terminal that has been registered and authorized to use UE-to-UE relay communication, and the first integrity protection key is based on the registered and Integrity protection key derived from the symmetric key of the terminal authorized to use UE-to-UE relay communication;
该中继设备验证是否被配置为转发直接通信请求,在验证通过之后该中继设备使用该第一加密密钥解密该直接通信请求以获取QoS和计费信息,以及该中继设备使用该第一完整性保护密钥验证该直接通信请求的完整性,在验证通过之后该中继设备在该直接通信请求中添加该中继设备的相关信息和该中继设备的标识,并且该中继设备使用该第一加密密钥加密该直接通信请求,使用该第一完整性保护密钥保护该直接通信请求的完整性;The relay device verifies whether it is configured to forward the direct communication request, and after the verification is passed, the relay device uses the first encryption key to decrypt the direct communication request to obtain QoS and charging information, and the relay device uses the third An integrity protection key verifies the integrity of the direct communication request. After the verification is passed, the relay device adds the relevant information of the relay device and the identification of the relay device in the direct communication request, and the relay device Use the first encryption key to encrypt the direct communication request, and use the first integrity protection key to protect the integrity of the direct communication request;
其中,该中继设备的相关信息包括以下之一:该中继设备的身份信息,该中继设备生成的随机数,该中继设备生成的计数器;该第一临时公钥和该中继设备的相关信息用于第二终端设备派生第一密钥;该第一随机数、该第一密钥和该第二终端设备生成的第二随机数用于派生第二密钥,且该第二密钥用于派生第二加密密钥和/或第二完整性保护密钥,或者,该第一随机数、该第一密钥和该第二终端设备生成的第二随机数用于派生第二加密密钥和/或第二完整性保护密钥。Among them, the relevant information of the relay device includes one of the following: the identity information of the relay device, the random number generated by the relay device, the counter generated by the relay device; the first temporary public key and the relay device The relevant information is used by the second terminal device to derive the first key; the first random number, the first key and the second random number generated by the second terminal device are used to derive the second key, and the second The key is used to derive the second encryption key and/or the second integrity protection key, or the first random number, the first key and the second random number generated by the second terminal device are used to derive the second random number. A second encryption key and/or a second integrity protection key.
第十方面,提供了一种终端设备,用于执行上述第一方面中的方法。A tenth aspect provides a terminal device for executing the method in the first aspect.
具体地,该终端设备包括用于执行上述第一方面中的方法的功能模块。Specifically, the terminal device includes a functional module for executing the method in the first aspect.
第十一方面,提供了一种终端设备,用于执行上述第二方面中的方法。An eleventh aspect provides a terminal device for executing the method in the above second aspect.
具体地,该终端设备包括用于执行上述第二方面中的方法的功能模块。Specifically, the terminal device includes a functional module for executing the method in the above second aspect.
第十二方面,提供了一种中继设备,用于执行上述第三方面中的方法。A twelfth aspect provides a relay device for performing the method in the above third aspect.
具体地,该中继设备包括用于执行上述第三方面中的方法的功能模块。Specifically, the relay device includes a functional module for executing the method in the above third aspect.
第十三方面,提供了一种终端设备,用于执行上述第四方面中的方法。A thirteenth aspect provides a terminal device for performing the method in the fourth aspect.
具体地,该终端设备包括用于执行上述第四方面中的方法的功能模块。Specifically, the terminal device includes a functional module for executing the method in the fourth aspect.
第十四方面,提供了一种终端设备,用于执行上述第五方面中的方法。A fourteenth aspect provides a terminal device for performing the method in the fifth aspect.
具体地,该终端设备包括用于执行上述第五方面中的方法的功能模块。Specifically, the terminal device includes a functional module for executing the method in the fifth aspect.
第十五方面,提供了一种中继设备,用于执行上述第六方面中的方法。A fifteenth aspect provides a relay device for performing the method in the above-mentioned sixth aspect.
具体地,该中继设备包括用于执行上述第六方面中的方法的功能模块。Specifically, the relay device includes a functional module for executing the method in the sixth aspect.
第十六方面,提供了一种终端设备,用于执行上述第七方面中的方法。A sixteenth aspect provides a terminal device for performing the method in the seventh aspect.
具体地,该终端设备包括用于执行上述第七方面中的方法的功能模块。Specifically, the terminal device includes a functional module for executing the method in the seventh aspect.
第十七方面,提供了一种终端设备,用于执行上述第八方面中的方法。A seventeenth aspect provides a terminal device for performing the method in the eighth aspect.
具体地,该终端设备包括用于执行上述第八方面中的方法的功能模块。Specifically, the terminal device includes a functional module for executing the method in the eighth aspect.
第十八方面,提供了一种中继设备,用于执行上述第九方面中的方法。An eighteenth aspect provides a relay device for performing the method in the ninth aspect.
具体地,该中继设备包括用于执行上述第九方面中的方法的功能模块。Specifically, the relay device includes a functional module for executing the method in the ninth aspect.
第十九方面,提供了一种终端设备,包括处理器和存储器;该存储器用于存储计算机程序,该处理器用于调用并运行该存储器中存储的计算机程序,使得该终端设备执行上述第一方面或第二方面中的方法,或者,使得该终端设备执行上述第四方面或第五方面中的方法,或者,使得该终端设备执行上述第七方面或第八方面中的方法。A nineteenth aspect provides a terminal device, including a processor and a memory; the memory is used to store a computer program, and the processor is used to call and run the computer program stored in the memory, so that the terminal device executes the above first aspect or the method in the second aspect, or causing the terminal device to perform the method in the fourth or fifth aspect, or causing the terminal device to perform the method in the seventh or eighth aspect.
第二十方面,提供了一种中继设备,包括处理器和存储器;该存储器用于存储计算机程序,该处理器用于调用并运行该存储器中存储的计算机程序,使得该中继设备执行上述第三方面中的方法,或者,使得该中继设备执行上述第六方面中的方法,或者,使得该中继设备执行上述第九方面中的方法。In a twentieth aspect, a relay device is provided, including a processor and a memory; the memory is used to store a computer program, and the processor is used to call and run the computer program stored in the memory, so that the relay device executes the above-mentioned The method in the third aspect either causes the relay device to perform the method in the sixth aspect, or causes the relay device to perform the method in the ninth aspect.
第二十一方面,提供了一种装置,用于实现上述第一方面至第九方面中的任一方面中的方法。A twenty-first aspect provides a device for implementing the method in any one of the above-mentioned first to ninth aspects.
具体地,该装置包括:处理器,用于从存储器中调用并运行计算机程序,使得安装有该装置的设备执行如上述第一方面至第九方面中的任一方面中的方法。Specifically, the device includes: a processor, configured to call and run a computer program from a memory, so that a device installed with the device executes the method in any one of the above-mentioned first to ninth aspects.
第二十二方面,提供了一种计算机可读存储介质,用于存储计算机程序,该计算机程序使得计算机执行上述第一方面至第九方面中的任一方面中的方法。A twenty-second aspect provides a computer-readable storage medium for storing a computer program that causes a computer to execute the method in any one of the above-mentioned first to ninth aspects.
第二十三方面,提供了一种计算机程序产品,包括计算机程序指令,所述计算机程序指令使得计算机执行上述第一方面至第九方面中的任一方面中的方法。In a twenty-third aspect, a computer program product is provided, including computer program instructions that cause a computer to execute the method in any one of the above-mentioned first to ninth aspects.
第二十四方面,提供了一种计算机程序,当其在计算机上运行时,使得计算机执行上述第一方面至第九方面中的任一方面中的方法。A twenty-fourth aspect provides a computer program that, when run on a computer, causes the computer to execute the method in any one of the above-mentioned first to ninth aspects.
通过上述第一方面至第三方面的技术方案,第一终端设备可以基于第二终端设备通过中继设备发送的认证请求消息生成第一密钥,且该认证请求消息通过签名验证的方式进行保护。以及第一终端设备生成的第一随机数、第一密钥和第二终端设备生成的第二随机数用于派生第二密钥,第二密钥用于派生完整性保护密钥和/或机密性保护密钥,能够保证第一终端设备和第二终端设备的身份安全与通信数据的机密性与完整性,从而确保双方传输数据的机密性和完整性,防止其他设备甚至中继设备的窃听。Through the technical solutions of the first to third aspects, the first terminal device can generate the first key based on the authentication request message sent by the second terminal device through the relay device, and the authentication request message is protected through signature verification. . and a first random number generated by the first terminal device, a first key and a second random number generated by the second terminal device for deriving a second key, the second key being used for deriving an integrity protection key and/or The confidentiality protection key can ensure the identity security of the first terminal device and the second terminal device and the confidentiality and integrity of the communication data, thereby ensuring the confidentiality and integrity of the data transmitted by both parties and preventing other devices and even relay devices from being intercepted. tapping.
通过上述第四方面至第六方面的技术方案,第一终端设备生成的第一随机数、第一密钥和第二终端设备生成的第二随机数用于派生第二密钥,第二密钥用于派生完整性保护密钥和/或机密性保护密钥,能够保证第一终端设备和第二终端设备的身份安全与通信数据的机密性与完整性,从而确保双方传输数据的机密性和完整性,防止其他设备甚至中继设备的窃听。Through the technical solutions of the fourth aspect to the sixth aspect, the first random number and the first key generated by the first terminal device and the second random number generated by the second terminal device are used to derive the second key. The key is used to derive the integrity protection key and/or the confidentiality protection key, which can ensure the identity security of the first terminal device and the second terminal device and the confidentiality and integrity of the communication data, thereby ensuring the confidentiality of the data transmitted by both parties. and integrity to prevent eavesdropping by other devices or even relay devices.
通过上述第七方面至第九方面的技术方案,第一终端设备可以基于第二终端设备通过中继设备发送的直接通信请求生成第一密钥,且该直接通信请求通过第一加密密钥进行加密,以及直接通信请求通过第一完整性保护密钥进行完整性保护。以及第一终端设备生成的第一随机数、第一密钥和第二终端设备生成的第二随机数用于派生第二密钥,第二密钥用于派生第二加密密钥和/或第二完整性保护密钥,或者,第一终端设备生成的第一随机数、第一密钥和第二终端设备用于派生第二随机数生成第二加密密钥和/或第二完整性保护密钥,能够保证第一终端设备和第二终端设备的身份安全与通信数据的机密性与完整性,从而确保双方传输数据的机密性和完整性,防止其他设备甚至中继设备的窃听。Through the technical solutions of the seventh to ninth aspects, the first terminal device can generate the first key based on the direct communication request sent by the second terminal device through the relay device, and the direct communication request is performed through the first encryption key. Encryption, and direct communication requests are integrity protected via a first integrity protection key. and a first random number generated by the first terminal device, a first key and a second random number generated by the second terminal device for deriving the second key, the second key being used for deriving the second encryption key and/or The second integrity protection key, or the first random number generated by the first terminal device, the first key and the second terminal device are used to derive the second random number to generate the second encryption key and/or the second integrity Protecting the key can ensure the identity security of the first terminal device and the second terminal device and the confidentiality and integrity of the communication data, thereby ensuring the confidentiality and integrity of the data transmitted by both parties and preventing eavesdropping by other devices and even relay devices.
附图说明Description of the drawings
图1是本申请实施例应用的一种通信系统架构的示意性图。Figure 1 is a schematic diagram of a communication system architecture applied in an embodiment of the present application.
图2至图4分别是本申请提供的UE-to-UE中继场景中的建立安全通信的示意性流程图。Figures 2 to 4 are respectively schematic flow charts for establishing secure communication in the UE-to-UE relay scenario provided by this application.
图5是本申请提供的一种UE-to-UE中继通信的示意性流程图。Figure 5 is a schematic flow chart of UE-to-UE relay communication provided by this application.
图6是本申请提供的另一种UE-to-UE中继通信的示意性流程图。Figure 6 is a schematic flow chart of another UE-to-UE relay communication provided by this application.
图7是根据本申请实施例提供的一种中继通信的方法的示意性流程图。Figure 7 is a schematic flowchart of a method for relaying communications provided according to an embodiment of the present application.
图8是本申请实施例所涉及的密钥分层结构的示意性图。Figure 8 is a schematic diagram of the key hierarchical structure involved in the embodiment of the present application.
图9是根据本申请实施例提供的另一种中继通信的方法的示意性流程图。Figure 9 is a schematic flowchart of another method of relaying communications provided according to an embodiment of the present application.
图10是根据本申请实施例提供的再一种中继通信的方法的示意性流程图。Figure 10 is a schematic flowchart of yet another method of relaying communication provided according to an embodiment of the present application.
图11是根据本申请实施例提供的再一种中继通信的方法的示意性流程图。Figure 11 is a schematic flowchart of yet another method of relaying communication provided according to an embodiment of the present application.
图12是根据本申请实施例提供的再一种中继通信的方法的示意性流程图。Figure 12 is a schematic flowchart of yet another method of relaying communication provided according to an embodiment of the present application.
图13是根据本申请实施例提供的再一种中继通信的方法的示意性流程图。Figure 13 is a schematic flowchart of yet another method of relaying communication provided according to an embodiment of the present application.
图14至图15分别是本申请实施例提供的UE-to-UE中继场景中的建立安全通信的示意性流程图。Figures 14 to 15 are respectively schematic flow charts for establishing secure communication in a UE-to-UE relay scenario provided by embodiments of the present application.
图16是根据本申请实施例提供的再一种中继通信的方法的示意性流程图。Figure 16 is a schematic flowchart of yet another method of relaying communication provided according to an embodiment of the present application.
图17是根据本申请实施例提供的再一种中继通信的方法的示意性流程图。Figure 17 is a schematic flowchart of yet another method of relaying communication provided according to an embodiment of the present application.
图18是根据本申请实施例提供的再一种中继通信的方法的示意性流程图。Figure 18 is a schematic flowchart of yet another method of relaying communication provided according to an embodiment of the present application.
图19至图22分别是本申请实施例提供的UE-to-UE中继场景中的建立安全通信的示意性流程图。Figures 19 to 22 are respectively schematic flow charts for establishing secure communication in a UE-to-UE relay scenario provided by embodiments of the present application.
图23至图31分别是根据本申请实施例提供的终端设备的示意性框图。Figures 23 to 31 are respectively schematic block diagrams of terminal equipment provided according to embodiments of the present application.
图32是根据本申请实施例提供的一种通信设备的示意性框图。Figure 32 is a schematic block diagram of a communication device provided according to an embodiment of the present application.
图33是根据本申请实施例提供的一种装置的示意性框图。Figure 33 is a schematic block diagram of a device provided according to an embodiment of the present application.
图34是根据本申请实施例提供的一种通信系统的示意性框图。Figure 34 is a schematic block diagram of a communication system provided according to an embodiment of the present application.
具体实施方式Detailed ways
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。针对本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。The technical solutions in the embodiments of the present application will be described below with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, but not all of the embodiments. Regarding the embodiments in this application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the scope of protection of this application.
本申请实施例的技术方案可以应用于各种通信系统,例如:全球移动通讯(Global System of Mobile communication,GSM)系统、码分多址(Code Division Multiple Access,CDMA)系统、宽带码分多址(Wideband Code Division Multiple Access,WCDMA)系统、通用分组无线业务(General Packet Radio Service,GPRS)、长期演进(Long Term Evolution,LTE)系统、先进的长期演进(Advanced long term evolution,LTE-A)系统、新无线(New Radio,NR)系统、NR系统的演进系统、非授权频谱上的LTE(LTE-based access to unlicensed spectrum,LTE-U)系统、非授权频谱上的NR(NR-based access to unlicensed spectrum,NR-U)系统、非地面通信网络(Non-Terrestrial Networks,NTN)系统、通用移动通信系统(Universal Mobile Telecommunication System,UMTS)、无线局域网(Wireless Local Area Networks,WLAN)、物联网(internet of things,IoT)、无线保真(Wireless Fidelity,WiFi)、第五代通信(5th-Generation,5G)系统或其他通信系统等。The technical solutions of the embodiments of the present application can be applied to various communication systems, such as: Global System of Mobile communication (GSM) system, Code Division Multiple Access (Code Division Multiple Access, CDMA) system, broadband code division multiple access (Wideband Code Division Multiple Access, WCDMA) system, General Packet Radio Service (GPRS), Long Term Evolution (LTE) system, Advanced long term evolution (LTE-A) system , New Radio (NR) system, evolution system of NR system, LTE (LTE-based access to unlicensed spectrum, LTE-U) system on unlicensed spectrum, NR (NR-based access to unlicensed spectrum) unlicensed spectrum (NR-U) system, Non-Terrestrial Networks (NTN) system, Universal Mobile Telecommunication System (UMTS), Wireless Local Area Networks (WLAN), Internet of Things ( internet of things (IoT), wireless fidelity (Wireless Fidelity, WiFi), fifth-generation communication (5th-Generation, 5G) system or other communication systems, etc.
通常来说,传统的通信系统支持的连接数有限,也易于实现,然而,随着通信技术的发展,移动通信系统将不仅支持传统的通信,还将支持例如,设备到设备(Device to Device,D2D)通信,机器到机器(Machine to Machine,M2M)通信,机器类型通信(Machine Type Communication,MTC),车辆间(Vehicle to Vehicle,V2V)通信,或车联网(Vehicle to everything,V2X)通信等,本申请实施例也可以应用于这些通信系统。Generally speaking, traditional communication systems support a limited number of connections and are easy to implement. However, with the development of communication technology, mobile communication systems will not only support traditional communication, but also support, for example, Device to Device, D2D) communication, Machine to Machine (M2M) communication, Machine Type Communication (MTC), Vehicle to Vehicle (V2V) communication, or Vehicle to everything (V2X) communication, etc. , the embodiments of the present application can also be applied to these communication systems.
在一些实施例中,本申请实施例中的通信系统可以应用于载波聚合(Carrier Aggregation,CA)场景,也可以应用于双连接(Dual Connectivity,DC)场景,还可以应用于独立(Standalone,SA)布网场景,或者应用于非独立(Non-Standalone,NSA)布网场景。In some embodiments, the communication system in the embodiments of the present application can be applied to a carrier aggregation (Carrier Aggregation, CA) scenario, a dual connectivity (Dual Connectivity, DC) scenario, or a standalone (Standalone, SA) scenario. ) network deployment scenario, or applied to Non-Standalone (NSA) network deployment scenario.
在一些实施例中,本申请实施例中的通信系统可以应用于非授权频谱,其中,非授权频谱也可以认为是共享频谱;或者,本申请实施例中的通信系统也可以应用于授权频谱,其中,授权频谱也可以认为是非共享频谱。In some embodiments, the communication system in the embodiments of the present application can be applied to unlicensed spectrum, where the unlicensed spectrum can also be considered as shared spectrum; or, the communication system in the embodiments of the present application can also be applied to licensed spectrum, Among them, licensed spectrum can also be considered as unshared spectrum.
在一些实施例中,本申请实施例中的通信系统可以应用于FR1频段(对应频段范围410MHz到7.125GHz),也可以应用于FR2频段(对应频段范围24.25GHz到52.6GHz),还可以应用于新的频段例如对应52.6GHz到71GHz频段范围或对应71GHz到114.25GHz频段范围的高频频段。In some embodiments, the communication system in the embodiment of the present application can be applied to the FR1 frequency band (corresponding to the frequency band range 410MHz to 7.125GHz), can also be applied to the FR2 frequency band (corresponding to the frequency band range 24.25GHz to 52.6GHz), and can also be applied to The new frequency band, for example, corresponds to the frequency band range of 52.6 GHz to 71 GHz or the high frequency band corresponding to the frequency band range of 71 GHz to 114.25 GHz.
本申请实施例结合网络设备和终端设备描述了各个实施例,其中,终端设备也可以称为用户设备(User Equipment,UE)、接入终端、用户单元、用户站、移动站、移动台、远方站、远程终端、移动设备、用户终端、终端、无线通信设备、用户代理或用户装置等。The embodiments of this application describe various embodiments in combination with network equipment and terminal equipment. The terminal equipment may also be called user equipment (User Equipment, UE), access terminal, user unit, user station, mobile station, mobile station, remote station, remote terminal, mobile device, user terminal, terminal, wireless communication equipment, user agent or user device, etc.
终端设备可以是WLAN中的站点(STATION,ST),可以是蜂窝电话、无绳电话、会话启动协议(Session Initiation Protocol,SIP)电话、无线本地环路(Wireless Local Loop,WLL)站、个人数 字助理(Personal Digital Assistant,PDA)设备、具有无线通信功能的手持设备、计算设备或连接到无线调制解调器的其它处理设备、车载设备、可穿戴设备、下一代通信系统例如NR网络中的终端设备,或者未来演进的公共陆地移动网络(Public Land Mobile Network,PLMN)网络中的终端设备等。The terminal device can be a station (STATION, ST) in the WLAN, a cellular phone, a cordless phone, a Session Initiation Protocol (Session Initiation Protocol, SIP) phone, a wireless local loop (Wireless Local Loop, WLL) station, or a personal digital assistant. (Personal Digital Assistant, PDA) devices, handheld devices with wireless communication capabilities, computing devices or other processing devices connected to wireless modems, vehicle-mounted devices, wearable devices, next-generation communication systems such as terminal devices in NR networks, or in the future Terminal equipment in the evolved Public Land Mobile Network (PLMN) network, etc.
在本申请实施例中,终端设备可以部署在陆地上,包括室内或室外、手持、穿戴或车载;也可以部署在水面上(如轮船等);还可以部署在空中(例如飞机、气球和卫星上等)。In the embodiment of this application, the terminal device can be deployed on land, including indoor or outdoor, handheld, wearable or vehicle-mounted; it can also be deployed on water (such as ships, etc.); it can also be deployed in the air (such as aircraft, balloons and satellites). superior).
在本申请实施例中,终端设备可以是手机(Mobile Phone)、平板电脑(Pad)、带无线收发功能的电脑、虚拟现实(Virtual Reality,VR)终端设备、增强现实(Augmented Reality,AR)终端设备、工业控制(industrial control)中的无线终端设备、无人驾驶(self driving)中的无线终端设备、远程医疗(remote medical)中的无线终端设备、智能电网(smart grid)中的无线终端设备、运输安全(transportation safety)中的无线终端设备、智慧城市(smart city)中的无线终端设备或智慧家庭(smart home)中的无线终端设备、车载通信设备、无线通信芯片/专用集成电路(application specific integrated circuit,ASIC)/系统级芯片(System on Chip,SoC)等。In the embodiment of this application, the terminal device may be a mobile phone (Mobile Phone), a tablet computer (Pad), a computer with a wireless transceiver function, a virtual reality (Virtual Reality, VR) terminal device, or an augmented reality (Augmented Reality, AR) terminal. Equipment, wireless terminal equipment in industrial control, wireless terminal equipment in self-driving, wireless terminal equipment in remote medical, wireless terminal equipment in smart grid , wireless terminal equipment in transportation safety, wireless terminal equipment in smart city (smart city) or wireless terminal equipment in smart home (smart home), vehicle-mounted communication equipment, wireless communication chip/application specific integrated circuit (ASIC)/system on chip (System on Chip, SoC), etc.
作为示例而非限定,在本申请实施例中,该终端设备还可以是可穿戴设备。可穿戴设备也可以称为穿戴式智能设备,是应用穿戴式技术对日常穿戴进行智能化设计、开发出可以穿戴的设备的总称,如眼镜、手套、手表、服饰及鞋等。可穿戴设备即直接穿在身上,或是整合到用户的衣服或配件的一种便携式设备。可穿戴设备不仅仅是一种硬件设备,更是通过软件支持以及数据交互、云端交互来实现强大的功能。广义穿戴式智能设备包括功能全、尺寸大、可不依赖智能手机实现完整或者部分的功能,例如:智能手表或智能眼镜等,以及只专注于某一类应用功能,需要和其它设备如智能手机配合使用,如各类进行体征监测的智能手环、智能首饰等。As an example and not a limitation, in this embodiment of the present application, the terminal device may also be a wearable device. Wearable devices can also be called wearable smart devices. It is a general term for applying wearable technology to intelligently design daily wear and develop wearable devices, such as glasses, gloves, watches, clothing and shoes, etc. A wearable device is a portable device that is worn directly on the body or integrated into the user's clothing or accessories. Wearable devices are not just hardware devices, but also achieve powerful functions through software support, data interaction, and cloud interaction. Broadly defined wearable smart devices include full-featured, large-sized devices that can achieve complete or partial functions without relying on smartphones, such as smart watches or smart glasses, and those that only focus on a certain type of application function and need to cooperate with other devices such as smartphones. Use, such as various types of smart bracelets, smart jewelry, etc. for physical sign monitoring.
在本申请实施例中,网络设备可以是用于与移动设备通信的设备,网络设备可以是WLAN中的接入点(Access Point,AP),GSM或CDMA中的基站(Base Transceiver Station,BTS),也可以是WCDMA中的基站(NodeB,NB),还可以是LTE中的演进型基站(Evolutional Node B,eNB或eNodeB),或者中继站或接入点,或者车载设备、可穿戴设备以及NR网络中的网络设备或者基站(gNB)或者未来演进的PLMN网络中的网络设备或者NTN网络中的网络设备等。In the embodiment of this application, the network device may be a device used to communicate with mobile devices. The network device may be an access point (Access Point, AP) in WLAN, or a base station (Base Transceiver Station, BTS) in GSM or CDMA. , or it can be a base station (NodeB, NB) in WCDMA, or an evolutionary base station (Evolutional Node B, eNB or eNodeB) in LTE, or a relay station or access point, or a vehicle-mounted device, a wearable device, and an NR network network equipment or base station (gNB) or network equipment in the future evolved PLMN network or network equipment in the NTN network, etc.
作为示例而非限定,在本申请实施例中,网络设备可以具有移动特性,例如网络设备可以为移动的设备。在一些实施例中,网络设备可以为卫星、气球站。例如,卫星可以为低地球轨道(low earth orbit,LEO)卫星、中地球轨道(medium earth orbit,MEO)卫星、地球同步轨道(geostationary earth orbit,GEO)卫星、高椭圆轨道(High Elliptical Orbit,HEO)卫星等。在一些实施例中,网络设备还可以为设置在陆地、水域等位置的基站。As an example and not a limitation, in the embodiment of the present application, the network device may have mobile characteristics, for example, the network device may be a mobile device. In some embodiments, network devices may be satellites or balloon stations. For example, the satellite can be a low earth orbit (LEO) satellite, a medium earth orbit (MEO) satellite, a geosynchronous orbit (geostationary earth orbit, GEO) satellite, a high elliptical orbit (High Elliptical Orbit, HEO) satellite ) satellite, etc. In some embodiments, the network device may also be a base station installed on land, water, or other locations.
在本申请实施例中,网络设备可以为小区提供服务,终端设备通过该小区使用的传输资源(例如,频域资源,或者说,频谱资源)与网络设备进行通信,该小区可以是网络设备(例如基站)对应的小区,小区可以属于宏基站,也可以属于小小区(Small cell)对应的基站,这里的小小区可以包括:城市小区(Metro cell)、微小区(Micro cell)、微微小区(Pico cell)、毫微微小区(Femto cell)等,这些小小区具有覆盖范围小、发射功率低的特点,适用于提供高速率的数据传输服务。In this embodiment of the present application, network equipment can provide services for a cell, and terminal equipment communicates with the network equipment through transmission resources (for example, frequency domain resources, or spectrum resources) used by the cell. The cell can be a network equipment ( For example, the cell corresponding to the base station) can belong to the macro base station or the base station corresponding to the small cell (Small cell). The small cell here can include: urban cell (Metro cell), micro cell (Micro cell), pico cell ( Pico cell), femto cell (Femto cell), etc. These small cells have the characteristics of small coverage and low transmission power, and are suitable for providing high-rate data transmission services.
示例性的,本申请实施例应用的通信系统100如图1所示。该通信系统100可以包括网络设备110,网络设备110可以是与终端设备120(或称为通信终端、终端)通信的设备。网络设备110可以为特定的地理区域提供通信覆盖,并且可以与位于该覆盖区域内的终端设备进行通信。Exemplarily, the communication system 100 applied in the embodiment of the present application is shown in Figure 1 . The communication system 100 may include a network device 110, which may be a device that communicates with a terminal device 120 (also referred to as a communication terminal or terminal). The network device 110 can provide communication coverage for a specific geographical area and can communicate with terminal devices located within the coverage area.
图1示例性地示出了一个网络设备和两个终端设备,在一些实施例中,该通信系统100可以包括多个网络设备并且每个网络设备的覆盖范围内可以包括其它数量的终端设备,本申请实施例对此不做限定。Figure 1 exemplarily shows one network device and two terminal devices. In some embodiments, the communication system 100 may include multiple network devices and other numbers of terminal devices may be included within the coverage of each network device. The embodiments of the present application do not limit this.
在一些实施例中,该通信系统100还可以包括网络控制器、移动管理实体等其他网络实体,本申请实施例对此不作限定。In some embodiments, the communication system 100 may also include other network entities such as a network controller and a mobility management entity, which are not limited in the embodiments of the present application.
应理解,本申请实施例中网络/系统中具有通信功能的设备可称为通信设备。以图1示出的通信系统100为例,通信设备可包括具有通信功能的网络设备110和终端设备120,网络设备110和终端设备120可以为上文所述的具体设备,此处不再赘述;通信设备还可包括通信系统100中的其他设备,例如网络控制器、移动管理实体等其他网络实体,本申请实施例中对此不做限定。It should be understood that in the embodiments of this application, devices with communication functions in the network/system may be called communication devices. Taking the communication system 100 shown in Figure 1 as an example, the communication device may include a network device 110 and a terminal device 120 with communication functions. The network device 110 and the terminal device 120 may be the specific devices described above, which will not be described again here. ; The communication device may also include other devices in the communication system 100, such as network controllers, mobility management entities and other network entities, which are not limited in the embodiments of this application.
应理解,本文中术语“系统”和“网络”在本文中常被可互换使用。本文中术语“和/或”,仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。另外,本文中字符“/”,一般表示前后关联对象是一种“或”的关系。It should be understood that the terms "system" and "network" are often used interchangeably herein. The term "and/or" in this article is just an association relationship that describes related objects, indicating that three relationships can exist. For example, A and/or B can mean: A exists alone, A and B exist simultaneously, and they exist alone. B these three situations. In addition, the character "/" in this article generally indicates that the related objects are an "or" relationship.
应理解,本文涉及第一通信设备和第二通信设备,第一通信设备可以是终端设备,例如手机,机器设施,用户前端设备(Customer Premise Equipment,CPE),工业设备,车辆等;第二通信设备可 以是第一通信设备的对端通信设备,例如网络设备,手机,工业设备,车辆等。本文中以第一通信设备是终端设备和第二通信设备是网络设备为具体实例进行描述。It should be understood that this article involves a first communication device and a second communication device. The first communication device may be a terminal device, such as a mobile phone, a machine facility, a Customer Premise Equipment (CPE), industrial equipment, a vehicle, etc.; the second communication device The device may be a peer communication device of the first communication device, such as a network device, a mobile phone, an industrial device, a vehicle, etc. This article takes the first communication device as a terminal device and the second communication device as a network device as a specific example for description.
本申请的实施方式部分使用的术语仅用于对本申请的具体实施例进行解释,而非旨在限定本申请。本申请的说明书和权利要求书及所述附图中的术语“第一”、“第二”、“第三”和“第四”等是用于区别不同对象,而不是用于描述特定顺序。此外,术语“包括”和“具有”以及它们任何变形,意图在于覆盖不排他的包含。The terms used in the embodiments of the present application are only used to explain specific embodiments of the present application and are not intended to limit the present application. The terms “first”, “second”, “third” and “fourth” in the description, claims and drawings of this application are used to distinguish different objects, rather than to describe a specific sequence. . Furthermore, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusion.
应理解,在本申请的实施例中提到的“指示”可以是直接指示,也可以是间接指示,还可以是表示具有关联关系。举例说明,A指示B,可以表示A直接指示B,例如B可以通过A获取;也可以表示A间接指示B,例如A指示C,B可以通过C获取;还可以表示A和B之间具有关联关系。It should be understood that the "instruction" mentioned in the embodiments of this application may be a direct instruction, an indirect instruction, or an association relationship. For example, A indicates B, which can mean that A directly indicates B, for example, B can be obtained through A; it can also mean that A indirectly indicates B, for example, A indicates C, and B can be obtained through C; it can also mean that there is an association between A and B. relation.
在本申请实施例的描述中,术语“对应”可表示两者之间具有直接对应或间接对应的关系,也可以表示两者之间具有关联关系,也可以是指示与被指示、配置与被配置等关系。In the description of the embodiments of this application, the term "correspondence" can mean that there is a direct correspondence or indirect correspondence between the two, it can also mean that there is an associated relationship between the two, or it can mean indicating and being instructed, configuration and being. Configuration and other relationships.
本申请实施例中,“预定义”或“预配置”可以通过在设备(例如,包括终端设备和网络设备)中预先保存相应的代码、表格或其他可用于指示相关信息的方式来实现,本申请对于其具体的实现方式不做限定。比如预定义可以是指协议中定义的。In the embodiment of this application, "predefinition" or "preconfiguration" can be achieved by pre-saving corresponding codes, tables or other methods that can be used to indicate relevant information in devices (for example, including terminal devices and network devices). The application does not limit its specific implementation method. For example, predefined can refer to what is defined in the protocol.
本申请实施例中,所述“协议”可以指通信领域的标准协议,例如可以是对现有LTE协议、NR协议、Wi-Fi协议或者与之相关的其它通信系统相关的协议的演进,本申请不对协议类型进行限定。In the embodiments of this application, the "protocol" may refer to a standard protocol in the communication field, for example, it may be an evolution of the existing LTE protocol, NR protocol, Wi-Fi protocol or protocols related to other communication systems. The application does not limit the type of agreement.
为便于理解本申请实施例的技术方案,以下通过具体实施例详述本申请的技术方案。以下相关技术作为可选方案与本申请实施例的技术方案可以进行任意结合,其均属于本申请实施例的保护范围。本申请实施例包括以下内容中的至少部分内容。In order to facilitate understanding of the technical solutions of the embodiments of the present application, the technical solutions of the present application are described in detail below through specific embodiments. The following related technologies can be arbitrarily combined with the technical solutions of the embodiments of the present application as optional solutions, and they all fall within the protection scope of the embodiments of the present application. The embodiments of this application include at least part of the following contents.
为实现UE-to-UE中继场景中的安全通信,现阶段主要包含如下三种方案。In order to achieve secure communication in UE-to-UE relay scenarios, the current stage mainly includes the following three solutions.
方案一,如图2所示,使用非对称加密技术来保护源UE和目标UE之间的通信的方法。在源UE和目标UE互相认证的基础上,并假设中继是可信的,在源UE和目标UE之间建立连接,利用双方公钥来保护端到端安全。 Solution 1, as shown in Figure 2, uses asymmetric encryption technology to protect communication between the source UE and the target UE. Based on the mutual authentication of the source UE and the target UE, and assuming that the relay is trustworthy, a connection is established between the source UE and the target UE, and the public keys of both parties are used to protect end-to-end security.
方案二,如图3所示,UE-to-UE中继场景中UE1和UE2之间的安全建立过程,UE1和UE2分别与中继设备1(relay 1)建立PC5连接,然后假定UE1和UE2之间与配置了共享密钥和密钥ID,最后UE1通过中继设备1给UE2发送消息验证码(Message Authentication Code,MAC),UE2验证消息MAC后再回复消息给UE1。 Option 2, as shown in Figure 3, the security establishment process between UE1 and UE2 in the UE-to-UE relay scenario. UE1 and UE2 establish PC5 connections with relay device 1 (relay 1) respectively, and then assume that UE1 and UE2 The shared key and key ID are configured. Finally, UE1 sends a message verification code (Message Authentication Code, MAC) to UE2 through relay device 1. UE2 verifies the message MAC and then replies to UE1.
方案三,如图4所示,远端UE1和远端UE2与中继设备建立安全PC5链路,远端UE1、中继设备、远端UE2被5G直接发现名称管理网元(Direct Discovering Name Management Function,DDNMF)和邻近通信服务的密钥管理网元(Prose Key Management Function,PKMF)提供发现和中继安全秘密材料。远端UE1和远端UE2预先从PKMF获得共享密钥(key)标识(Identity,ID)以及key。然后,UE(远端UE1和远端UE2)和中继设备也会从PKMF获得相应密钥,分别建立PC5安全连接,最后远端UE1和远端UE2之间利用共享密钥建立安全通道。Option 3, as shown in Figure 4, remote UE1 and remote UE2 establish secure PC5 links with the relay device. Remote UE1, relay device, and remote UE2 are directly discovered by the 5G Name Management Network Element (Direct Discovering Name Management). Function, DDNMF) and proximity communication service's key management network element (Prose Key Management Function, PKMF) provide discovery and relay of secure secret materials. The remote UE1 and the remote UE2 obtain the shared key (Identity, ID) and key from PKMF in advance. Then, the UE (remote UE1 and remote UE2) and the relay device will also obtain the corresponding keys from PKMF and establish PC5 secure connections respectively. Finally, the shared key is used to establish a secure channel between the remote UE1 and the remote UE2.
为便于更好的理解本申请实施例,对本申请所涉及的终端至终端中继(UE-to-UE relay)通信架构及相关流程进行说明。In order to facilitate a better understanding of the embodiments of this application, the terminal-to-UE relay (UE-to-UE relay) communication architecture and related processes involved in this application will be described.
在UE-to-UE relay通信中,通信架构和对应的流程,分为两类,分别是针对层2(layer2,L2)的连接和针对层3(layer3,L3)的基于互联网协议(Internet Protocol,IP)的连接。建立L2的UE-to-UE relay的连接包括两种情况:连接建立整合在UE-to-UE relay的发现和选择中、连接建立在UE-to-UE relay的发现和选择之后。下面以连接建立整合在UE-to-UE relay的发现和选择中为例介绍相关流程,流程图如图5所示,具体可以包括如下步骤:In UE-to-UE relay communication, the communication architecture and corresponding processes are divided into two categories, namely connections for layer 2 (layer2, L2) and Internet Protocol-based connections for layer 3 (layer3, L3). , IP) connection. There are two situations in establishing L2 UE-to-UE relay connection: connection establishment is integrated in the discovery and selection of UE-to-UE relay, and connection establishment is after the discovery and selection of UE-to-UE relay. The following takes the connection establishment integrated in the discovery and selection of UE-to-UE relay as an example to introduce the relevant process. The flow chart is shown in Figure 5. The specific steps may include the following:
0.UE-to-UE Relay向网络注册并提供UE-to-UE Relay功能,UE-to-UE Relay配置了中继策略参数。0.UE-to-UE Relay registers with the network and provides the UE-to-UE Relay function. UE-to-UE Relay is configured with relay policy parameters.
1.目标终端(即UE2、UE3和UE4)确定PC5单播链路建立时信令接收的目的L2 ID。1. The target terminal (i.e. UE2, UE3 and UE4) determines the destination L2 ID for signaling reception when the PC5 unicast link is established.
2.在源终端(即UE1)上,应用层向邻近业务(Proximity-based Services,ProSe)层提供PC5单播通信的信息(如广播L2 ID、ProSe应用层ID、终端应用层ID、目标终端应用层ID、中继适用指示),ProSe层通过发送端到端广播直接通信请求消息触发终端的发现机制。消息使用源L2 ID和广播L2 ID作为目的发送,并包含其他与应用程序相关的参数。2. On the source terminal (i.e. UE1), the application layer provides PC5 unicast communication information (such as broadcast L2 ID, ProSe application layer ID, terminal application layer ID, target terminal) to the Proximity-based Services (ProSe) layer Application layer ID, relay applicable indication), the ProSe layer triggers the terminal's discovery mechanism by sending an end-to-end broadcast direct communication request message. Messages are sent using the source L2 ID and broadcast L2 ID as destination, and contain other application-related parameters.
3.UE-to-UE Relay接收广播的直接通信请求消息,并验证它是否配置为转发这个应用程序,例如,它将宣布的ProSe应用(application)ID与它所提供的中继策略/参数进行比较。UE-to-UE Relay转发端到端广播的直接通信请求消息时,使用自己的L2 ID作为源(Source)L2 ID,并在消息中添加中继(Relay)UE ID,在适配层指定标识UE1的信息。UE-to-UE Relay在ProSe层处理此端到端广播消息,并根据适配层信息转发任何后续的端到端PC5-S消息。3. The UE-to-UE Relay receives the broadcast direct communication request message and verifies whether it is configured to forward this application. For example, it compares the announced ProSe application ID with the relay policy/parameters it provides. Compare. When UE-to-UE Relay forwards an end-to-end broadcast direct communication request message, it uses its own L2 ID as the source (Source) L2 ID, adds the relay (Relay) UE ID to the message, and specifies the identity at the adaptation layer. UE1 information. UE-to-UE Relay processes this end-to-end broadcast message at the ProSe layer and forwards any subsequent end-to-end PC5-S messages based on the adaptation layer information.
4a.目标UE3对宣布的应用程序感兴趣,如果UE3和UE-to-UE Relay之间不存在每跳链路,它 会触发UE-to-UE Relay建立每跳链路。UE3发送每跳链路建立过程消息,源地址是UE3 L2 ID,目的地址是中继的L2 ID。4a. The target UE3 is interested in the announced application. If there is no per-hop link between UE3 and UE-to-UE Relay, it will trigger the UE-to-UE Relay to establish a per-hop link. UE3 sends a link establishment process message for each hop. The source address is the UE3 L2 ID and the destination address is the relay's L2 ID.
4b.如果UE-to-UE relay和UE1之间不存在每跳链路,则执行UE-to-UE relay和UE1之间的每跳链路建立过程。UE1将自己的L2 ID作为源地址,中继的L2 ID作为目的地址。4b. If there is no per-hop link between UE-to-UE relay and UE1, perform the per-hop link establishment process between UE-to-UE relay and UE1. UE1 uses its own L2 ID as the source address and the relay's L2 ID as the destination address.
5.如果步骤4a成功,UE1和UE3之间通过UE-to-UE Relay交换端到端认证和安全建立消息。包括识别源终端和/或目标终端的适配层。在通过中继接收到来自UE3的第一个消息时,如果在中继和UE1之间没有现有的每跳链路,则在UE-to-UE中继和UE1之间执行每跳链路建立过程。5. If step 4a is successful, end-to-end authentication and security establishment messages are exchanged between UE1 and UE3 through UE-to-UE Relay. Includes an adaptation layer that identifies source terminals and/or target terminals. On receipt of the first message from UE3 via the relay, if there is no existing per-hop link between the relay and UE1, a per-hop link is performed between the UE-to-UE relay and UE1 Establish process.
6.一旦UE3和UE1之间建立了端到端的安全连接,UE3通过发送端到端单播直接通信接受消息来完成UE3和UE1之间的端到端链路建立,该消息中包含了识别UE1的适配层信息。6. Once an end-to-end secure connection is established between UE3 and UE1, UE3 completes the end-to-end link establishment between UE3 and UE1 by sending an end-to-end unicast direct communication accept message, which contains the identification number of UE1 Adaptation layer information.
7.UE-to-UE Relay转发端到端单播直接通信接受消息,包括标识UE3的适配层信息。在此过程中,中继设备通过修改源字段和目标字段,发送消息到各个终端。7. UE-to-UE Relay forwards the end-to-end unicast direct communication acceptance message, including the adaptation layer information identifying UE3. During this process, the relay device sends messages to each terminal by modifying the source field and destination field.
为便于更好的理解本申请实施例,对本申请所涉及的ProSe中一对多通信的安全连接建立过程进行说明。In order to facilitate a better understanding of the embodiments of this application, the secure connection establishment process of one-to-many communication in ProSe involved in this application will be described.
ProSe一对多通信中的密钥管理功能邻近业务的密钥管理功能(Prose Key Management Function,PKMF)网元为多个UE生成对称密钥,一对多的ProSe安全通信过程的流程如图6所示,具体可以包括如下步骤:The key management function in ProSe one-to-many communication and the key management function (PKMF) of the adjacent service (Prose Key Management Function, PKMF) network element generates symmetric keys for multiple UEs. The flow of the one-to-many ProSe secure communication process is shown in Figure 6 As shown, the specific steps may include the following:
0a或0b:如果需要,终端为了与PKMF连接,可以配置任何私钥,相关证书或根证书,保证密钥可以对运营商保密。如果没有提供,则使用全球用户身份模块(Universal Subscriber Identity Module,USIM)凭据来保护该接口。终端也可以预先配置PKMF的地址。注1:PKMF是一个独立的逻辑实体,允许网络运营商提供无线电级别参数,而第三方(如公共安全服务)可以控制密钥的发放。0a or 0b: If necessary, in order to connect to PKMF, the terminal can configure any private key, related certificate or root certificate to ensure that the key can be kept confidential from the operator. If not provided, Universal Subscriber Identity Module (USIM) credentials are used to secure the interface. The terminal can also pre-configure the PKMF address. Note 1: PKMF is an independent logical entity that allows network operators to provide radio level parameters, while third parties (such as public safety services) can control the issuance of keys.
0c和0d:属于各个组的订阅者需要配置ProSe功能和ProSe密钥管理功能。PKMF需要根据本地策略,为每个组预先选择加密算法。0c and 0d: Subscribers belonging to each group need to configure the ProSe function and ProSe key management function. PKMF requires pre-selecting encryption algorithms for each group based on local policies.
1a或1b:终端从ProSe功能中获取一对多的通信参数。作为这个过程的一部分,终端获得它的组身份,并被告知是否需要该组的承载层安全。此外,还可以为UE提供用于获取该组密钥的PKMF的地址。1a or 1b: The terminal obtains one-to-many communication parameters from the ProSe function. As part of this process, the endpoint obtains its group identity and is informed whether bearer layer security is required for the group. In addition, the UE may also be provided with the address of the PKMF used to obtain the set of keys.
2a.ii或2b.ii:PKMF根据UE演进型分组系统(Evolved Packet System,EPS)安全能力检查UE是否支持组加密算法,即组加密算法是否包含在UE支持的EPS加密算法集中。2a.ii or 2b.ii: PKMF checks whether the UE supports the group encryption algorithm based on the UE's Evolved Packet System (EPS) security capabilities, that is, whether the group encryption algorithm is included in the EPS encryption algorithm set supported by the UE.
2a.iii或2b.iii:PKMF以密钥响应消息进行响应。如果步骤2a.ii或2b.ii对特定组的检查成功,则该消息包含组成员身份和UE在发送或接收该组的受保护数据时应使用的EPS加密算法标识符。否则,该消息包含算法支持失败的指示符,因为UE不支持所需的算法。如果PKMF决定使用新的成对的主密钥(Pairwise Master Key,PMK),则该消息还可能包含PMK和相关联的PMK ID。2a.iii or 2b.iii: PKMF responds with a key response message. If the check for a specific group in step 2a.ii or 2b.ii is successful, the message contains the group membership and the EPS encryption algorithm identifier that the UE should use when sending or receiving protected data for this group. Otherwise, the message contains an indicator that algorithm support failed because the UE does not support the required algorithm. If PKMF decides to use a new pairwise master key (PMK), the message may also contain the PMK and associated PMK ID.
2a.iv或2b.iv:PKMF使用多媒体网络密钥(Multimedia Internet KEYing,MIKEY)向UE发送相关的ProSe组密钥(Prose Group Key,PGK)、PGK ID和到期时间。2a.iv or 2b.iv: PKMF uses Multimedia Internet KEYing (MIKEY) to send the relevant ProSe Group Key (PGK), PGK ID and expiration time to the UE.
3a或3b:UE计算ProSe传输密钥(Prose Traffic Key,PTK)和ProSe加密密钥(Prose Encrypt Key,PEK)以保护它发送到组的流量。它通过选择PGK并使用下一个未使用的PTK的身份和计数器组合来实现这一点。然后它使用步骤2x.ii中给出的算法保护数据。3a or 3b: The UE calculates the ProSe Transport Key (PTK) and the ProSe Encrypt Key (PEK) to protect the traffic it sends to the group. It does this by selecting a PGK and using the identity and counter combination of the next unused PTK. It then protects the data using the algorithm given in step 2x.ii.
4a或4b:接收UE从第2层报头中获取逻辑信道标识(Logical Channel Identity,LC ID)、组身份和组成员身份。然后,它使用收到的PGK身份位来识别发送方使用了哪个PGK。UE首先检查PGK是否有效,如果有效,则计算PTK和PEK以处理接收到的消息。4a or 4b: The receiving UE obtains the Logical Channel Identity (LC ID), group identity and group membership from the Layer 2 header. It then uses the received PGK identity bits to identify which PGK was used by the sender. The UE first checks whether the PGK is valid, and if valid, calculates the PTK and PEK to process the received message.
为便于更好的理解本申请实施例,对本申请所解决的问题进行说明。In order to facilitate a better understanding of the embodiments of the present application, the problems solved by the present application will be described.
UE-to-UE中继场景安全通信方案均存在部分缺陷,比如上述方案一中默认relay是可信的,因此存在强假设条件的限制,并且在UE协商安全能力时均为明文消息,可能遭受篡改,另外方案一中公钥的来源和真实性、以及通信密钥来源不明确,(比如没有确定通过协商方式还是单向加密来确定通信密钥来源),同时未涉及采用公钥技术下的密钥管理方案。方案二未提及预配置共享密钥的过程,同时方案流程存在争议。方案三的流程较为复杂,交互次数过多,不够轻便。因此需探究更为简便且不失安全性的安全连接建立方式,并探究更为高效的密钥管理结构,从而保证UE身份安全与通信数据的机密性与完整性。UE-to-UE relay scenario security communication solutions all have some flaws. For example, in the above solution 1, the default relay is trustworthy, so there are restrictions on strong assumptions, and when the UE negotiates security capabilities, they are all clear text messages, which may suffer Tampering, in addition, the source and authenticity of the public key and the source of the communication key in Scheme 1 are not clear (for example, it is not determined whether to determine the source of the communication key through negotiation or one-way encryption), and it does not involve the use of public key technology. Key management solution. Solution 2 does not mention the process of preconfiguring the shared key, and the solution process is controversial. The process of option three is more complicated, has too many interactions, and is not light enough. Therefore, it is necessary to explore a simpler way to establish a secure connection without losing security, and explore a more efficient key management structure to ensure the confidentiality and integrity of UE identity security and communication data.
基于上述问题,本申请提出了一种中继通信的方案,能够保证终端身份安全与通信数据的机密性与完整性,从而确保双方传输数据的机密性和完整性,防止其他设备甚至中继设备的窃听。Based on the above problems, this application proposes a relay communication solution that can ensure the security of the terminal identity and the confidentiality and integrity of the communication data, thereby ensuring the confidentiality and integrity of the data transmitted by both parties and preventing other devices and even relay devices from of eavesdropping.
以下通过具体实施例详述本申请的技术方案。The technical solutions of the present application are described in detail below through specific examples.
图7是根据本申请实施例的中继通信的方法200的示意性流程图,如图7所示,该中继通信的方法200可以包括如下内容中的至少部分内容:Figure 7 is a schematic flowchart of a communication relay method 200 according to an embodiment of the present application. As shown in Figure 7, the communication relay method 200 may include at least part of the following content:
S210,第一终端设备接收第二终端设备通过中继设备发送的认证请求消息;其中,该认证请求消息包括以下至少之一:该第二终端设备所属用户的信息,该中继设备所属用户的信息,该第二终端设备生成的第一临时公钥,该第二终端设备的签名,该中继设备的签名,该中继设备的相关信息;其中,该第二终端设备所属用户的信息包括该第二终端设备的标识和该第二终端设备的PVT和KPAK;该中继设备所属用户的信息包括该中继设备的标识和该中继设备的PVT和KPAK;该第二终端设备的签名的输入参数包括以下至少之一:该第二终端设备所属用户的信息和该第一临时公钥;该中继设备的签名的输入参数包括以下至少之一:该第二终端设备的签名和该中继设备所属用户的信息;该第一临时公钥和该中继设备的相关信息用于该第一终端设备派生第一密钥;该中继设备的相关信息包括以下之一:该中继设备的身份信息,该中继设备生成的随机数,该中继设备生成的计数器。S210. The first terminal device receives the authentication request message sent by the second terminal device through the relay device; wherein the authentication request message includes at least one of the following: information about the user to which the second terminal device belongs, information about the user to whom the relay device belongs. information, the first temporary public key generated by the second terminal device, the signature of the second terminal device, the signature of the relay device, and relevant information of the relay device; wherein, the information of the user to which the second terminal device belongs includes The identifier of the second terminal device and the PVT and KPAK of the second terminal device; the information of the user to which the relay device belongs includes the identifier of the relay device and the PVT and KPAK of the relay device; the signature of the second terminal device The input parameters of the relay device include at least one of the following: the information of the user to which the second terminal device belongs and the first temporary public key; the input parameters of the signature of the relay device include at least one of the following: the signature of the second terminal device and the first temporary public key. The information of the user to which the relay device belongs; the first temporary public key and the relevant information of the relay device are used by the first terminal device to derive the first key; the relevant information of the relay device includes one of the following: the relay The identity information of the device, the random number generated by the relay device, and the counter generated by the relay device.
本实施例基于ECCSI签名方案,建立L2架构下的UE-to-UE中继场景下的安全连接。具体的,本申请实施例应用于L2架构下的UE-to-UE中继场景,也即,第一终端设备与第二终端设备之间通过中继设备进行通信。例如,第一终端设备与第二终端设备之间的中继连接可以是PC5链路。This embodiment is based on the ECCSI signature scheme to establish a secure connection in the UE-to-UE relay scenario under the L2 architecture. Specifically, the embodiments of this application are applied to the UE-to-UE relay scenario under the L2 architecture, that is, the first terminal device and the second terminal device communicate through the relay device. For example, the relay connection between the first terminal device and the second terminal device may be a PC5 link.
在本申请实施例中,该第一终端设备可以是源设备或源终端,该第二终端设备可以是目标设备或目标终端。该中继设备可以是中继终端。In this embodiment of the present application, the first terminal device may be a source device or a source terminal, and the second terminal device may be a target device or a target terminal. The relay device may be a relay terminal.
在本申请实施例中,该第二终端设备的签名的输入参数包括以下至少之一:该第二终端设备所属用户的信息和该第一临时公钥。也即,该第二终端设备可以基于该第二终端设备所属用户的信息和该第一临时公钥中的至少之一,生成该第二终端设备的签名。In this embodiment of the present application, the input parameters of the signature of the second terminal device include at least one of the following: information of the user to which the second terminal device belongs and the first temporary public key. That is, the second terminal device may generate a signature of the second terminal device based on at least one of the information of the user to which the second terminal device belongs and the first temporary public key.
在本申请实施例中,该中继设备的签名的输入参数包括以下至少之一:该第二终端设备的签名和该中继设备所属用户的信息。也即,该中继设备可以基于该第二终端设备的签名和该中继设备所属用户的信息中的至少之一,生成该中继设备的签名。In this embodiment of the present application, the input parameters of the relay device's signature include at least one of the following: the signature of the second terminal device and the information of the user to which the relay device belongs. That is, the relay device may generate the signature of the relay device based on at least one of the signature of the second terminal device and the information of the user to which the relay device belongs.
在一些实施例中,该第二终端设备的签名由该第二终端设备的秘密签名密钥(Secret Signing Key,SSK)生成。可选地,该第二终端设备的公共验证令牌(Public Validation Token,PVT)和密钥管理服务器的公共认证密钥(Key Management Service Public Authentication Key,KPAK)、以及秘密签名密钥(SSK)可以是可信中心密钥管理服务器(Key Management Service,KMS)通过安全通道为该第二终端设备预先配置的。该安全通道可以基于应用程序的身份验证和密钥管理(Authentication and Key Management for Applications,AKMA)机制或者通用引导架构(Generic Bootstrapping Architecture,GBA)机制来建立该第二终端设备与KMS的安全连接,该KMS可以直接由运营商来负责管理或者是与运营商有商业关系的第三方服务提供商。In some embodiments, the signature of the second terminal device is generated by a secret signing key (Secret Signing Key, SSK) of the second terminal device. Optionally, the public verification token (Public Validation Token, PVT) of the second terminal device, the public authentication key (Key Management Service Public Authentication Key, KPAK) of the key management server, and the secret signing key (SSK) The second terminal device may be pre-configured by a trusted central key management server (Key Management Service, KMS) through a secure channel. The secure channel can establish a secure connection between the second terminal device and the KMS based on the Authentication and Key Management for Applications (AKMA) mechanism or the Generic Bootstrapping Architecture (GBA) mechanism. The KMS can be managed directly by the operator or be a third-party service provider that has a commercial relationship with the operator.
在一些实施例中,该中继设备的签名由该中继设备的秘密签名密钥(SSK)生成。可选地,该中继设备的PVT和KPAK、以及秘密签名密钥(SSK)可以是可信中心KMS通过安全通道为该中继设备预先配置的。该安全通道可以基于AKMA机制或者GBA机制来建立该中继设备与KMS的安全连接,该KMS可以直接由运营商来负责管理或者是与运营商有商业关系的第三方服务提供商。In some embodiments, the relay device's signature is generated by the relay device's secret signing key (SSK). Optionally, the PVT, KPAK, and secret signature key (SSK) of the relay device may be pre-configured for the relay device by the trusted center KMS through a secure channel. The secure channel can be based on the AKMA mechanism or the GBA mechanism to establish a secure connection between the relay device and the KMS. The KMS can be directly managed by the operator or a third-party service provider that has a commercial relationship with the operator.
在一些实施例中,在该第二终端设备的KPAK和该中继设备的KPAK有效,且基于该第二终端设备的标识和该第二终端设备的PVT对该第二终端设备的签名验证成功,以及基于该中继设备的标识和该中继设备的PVT对该中继设备的签名验证成功的情况下,该第一终端设备生成第二临时私钥,以及该第一终端设备根据该第一临时公钥、该中继设备的相关信息和该第二临时私钥派生该第一密钥。In some embodiments, the KPAK of the second terminal device and the KPAK of the relay device are valid, and the signature verification of the second terminal device based on the identity of the second terminal device and the PVT of the second terminal device is successful. , and if the signature verification of the relay device based on the identity of the relay device and the PVT of the relay device is successful, the first terminal device generates a second temporary private key, and the first terminal device generates a second temporary private key according to the first terminal device. The first key is derived from a temporary public key, relevant information of the relay device and the second temporary private key.
具体的,该第一终端设备可以基于其本地存储的一个或多个KPAK,验证该第二终端设备的KPAK和该中继设备的KPAK的有效性。例如,在第一终端设备本地存储的KPAK中存在与第二终端设备的KPAK一致的KPAK的情况下,该第二终端设备的KPAK有效;以及在第一终端设备本地存储的KPAK中存在与中继设备的KPAK一致的KPAK的情况下,该中继设备的KPAK有效。可选地,该第一终端设备本地存储的一个或多个KPAK可以由KMS预配置。Specifically, the first terminal device may verify the validity of the KPAK of the second terminal device and the KPAK of the relay device based on one or more KPAKs stored locally. For example, if there is a KPAK consistent with the KPAK of the second terminal device in the KPAK stored locally on the first terminal device, the KPAK of the second terminal device is valid; and there is a KPAK consistent with the KPAK stored locally on the first terminal device. In the case where the KPAK of the relay device is consistent with the KPAK, the KPAK of the relay device is valid. Optionally, one or more KPAKs stored locally on the first terminal device may be preconfigured by the KMS.
具体的,在本申请实施例中,第一终端设备可以根据第二终端设备生成的第一临时公钥、中继设备的相关信息和第一终端设备生成的第二临时私钥派生第一密钥。可选地,第一终端设备可以根据第二终端设备生成的第一临时公钥、中继设备的相关信息和第一终端设备生成的第二临时私钥派生第一密钥;其中,该中继设备的相关信息包括以下之一:该中继设备的身份信息,该中继设备生成的随机数,该中继设备生成的计数器。Specifically, in this embodiment of the present application, the first terminal device may derive the first secret key based on the first temporary public key generated by the second terminal device, the relevant information of the relay device, and the second temporary private key generated by the first terminal device. key. Optionally, the first terminal device may derive the first key based on the first temporary public key generated by the second terminal device, relevant information of the relay device, and the second temporary private key generated by the first terminal device; wherein, the The relevant information of the relay device includes one of the following: the identity information of the relay device, the random number generated by the relay device, and the counter generated by the relay device.
相应的,第二终端设备可以根据第一终端设备生成的第二临时公钥、中继设备的相关信息和第二终端设备生成的第一临时私钥派生第一密钥。可选地,第二终端设备可以根据第一终端设备生成的第二临时公钥、中继设备的相关信息和第二终端设备生成的第一临时私钥派生第一密钥;其中,该中继设备的相关信息包括以下之一:该中继设备的身份信息,该中继设备生成的随机数,该中继设备生成的计数器。Correspondingly, the second terminal device may derive the first key based on the second temporary public key generated by the first terminal device, the relevant information of the relay device, and the first temporary private key generated by the second terminal device. Optionally, the second terminal device may derive the first key based on the second temporary public key generated by the first terminal device, relevant information of the relay device, and the first temporary private key generated by the second terminal device; wherein, the The relevant information of the relay device includes one of the following: the identity information of the relay device, the random number generated by the relay device, and the counter generated by the relay device.
其中,第二终端设备生成的第一临时公钥与第二终端设备生成的第一临时私钥配对,第一终端设备生成的第二临时公钥与第一终端设备生成的第二临时私钥配对。Wherein, the first temporary public key generated by the second terminal device is paired with the first temporary private key generated by the second terminal device, and the second temporary public key generated by the first terminal device is paired with the second temporary private key generated by the first terminal device. pair.
具体例如,第一终端设备可以根据第一临时公钥和第二临时私钥,并使用ECIES算法计算出第一密钥;第二终端设备可以根据第二临时公钥和第一临时私钥,并使用ECIES算法计算出第一密钥。For example, the first terminal device can calculate the first key based on the first temporary public key and the second temporary private key and use the ECIES algorithm; the second terminal device can calculate the first key based on the second temporary public key and the first temporary private key. And use the ECIES algorithm to calculate the first key.
在一些实施例中,该第一终端设备通过该中继设备向该第二终端设备发送第一消息;In some embodiments, the first terminal device sends the first message to the second terminal device through the relay device;
其中,该第一消息包括以下至少之一:该第一终端设备的安全能力信息,该第一终端设备的安全策略信息,该第一终端设备所属用户的信息,该第一终端设备生成的第一随机数,该第一终端设备生成的与该第二临时私钥配对的第二临时公钥,该第一终端设备生成的该第一密钥的标识的M个比特位,该第一终端设备的签名,第一消息验证码;Wherein, the first message includes at least one of the following: security capability information of the first terminal device, security policy information of the first terminal device, information of the user to which the first terminal device belongs, a third message generated by the first terminal device. A random number, a second temporary public key generated by the first terminal device paired with the second temporary private key, M bits of the identification of the first key generated by the first terminal device, the first terminal Device signature, first message verification code;
其中,该第一终端设备所属用户的信息包括该第一终端设备的标识和该第一终端设备的PVT和KPAK;该第一终端设备的签名的输入参数包括以下至少之一:该第一终端设备所属用户的信息,该第二临时公钥,该第一密钥的标识的M个比特位,该第二终端设备的签名;Wherein, the information of the user to which the first terminal device belongs includes the identification of the first terminal device and the PVT and KPAK of the first terminal device; the input parameters of the signature of the first terminal device include at least one of the following: the first terminal Information about the user to whom the device belongs, the second temporary public key, M bits of the identification of the first key, and the signature of the second terminal device;
其中,该第一消息通过基于该第一密钥生成的该第一消息验证码进行完整性保护,且该第一消息验证码的输入参数包括以下至少之一:该第一终端设备的安全能力信息,该第一终端设备的安全策略信息,该第一终端设备所属用户的信息,该第一随机数,该第二临时公钥,该M个比特位,该第一终端设备的签名。Wherein, the first message is integrity protected by the first message verification code generated based on the first key, and the input parameters of the first message verification code include at least one of the following: the security capability of the first terminal device Information, the security policy information of the first terminal device, the information of the user to which the first terminal device belongs, the first random number, the second temporary public key, the M bits, and the signature of the first terminal device.
具体的,该第二临时公钥和该中继设备的相关信息用于该第二终端设备派生该第一密钥,该第一随机数、该第一密钥和该第二终端设备生成的第二随机数用于派生第二密钥,该第二密钥用于派生完整性保护密钥和/或机密性保护密钥,该第一密钥的标识由该M个比特位与该第一密钥的标识的另外N个比特位合并得到,M和N均为正整数。Specifically, the second temporary public key and the relevant information of the relay device are used by the second terminal device to derive the first key, the first random number, the first key and the key generated by the second terminal device. The second random number is used to derive a second key. The second key is used to derive an integrity protection key and/or a confidentiality protection key. The identity of the first key is composed of the M bits and the first key. The other N bits of the identifier of a key are combined, and M and N are both positive integers.
在本申请实施例中,第一终端设备生成的第一随机数、第一密钥和第二终端设备生成的第二随机数用于派生第二密钥。也即,第一终端设备至少根据第一随机数、第一密钥和第二随机数派生第二密钥,以及第一终端设备可以基于第二密钥派生完整性保护密钥和/或机密性保护密钥,从而第一终端设备可以基于完整性保护密钥和/或机密性保护密钥对发送的消息进行安全保护。同理,第二终端设备至少根据第一随机数、第一密钥和第二随机数派生第二密钥,以及第二终端设备可以基于第二密钥派生完整性保护密钥和/或机密性保护密钥,从而第二终端设备可以基于完整性保护密钥和/或机密性保护密钥对发送的消息进行安全保护。In this embodiment of the present application, the first random number and the first key generated by the first terminal device and the second random number generated by the second terminal device are used to derive the second key. That is, the first terminal device derives the second key based on at least the first random number, the first key and the second random number, and the first terminal device can derive the integrity protection key and/or the secret based on the second key. The first terminal device can securely protect the sent message based on the integrity protection key and/or the confidentiality protection key. Similarly, the second terminal device may derive the second key based on at least the first random number, the first key and the second random number, and the second terminal device may derive the integrity protection key and/or the secret based on the second key. The second terminal device can securely protect the sent message based on the integrity protection key and/or the confidentiality protection key.
在本申请实施例中,该第一消息验证码的输入参数包括以下至少之一:该第一终端设备的安全能力信息,该第一终端设备的安全策略信息,该第一随机数,该第二临时公钥,该M个比特位。也即,该第一终端设备可以基于该第一终端设备的安全能力信息、该第一终端设备的安全策略信息、该第一随机数、该第一终端设备所属用户的信息、该第二临时公钥、该M个比特位、该第一终端设备的签名中的至少之一,生成该第一消息验证码。In this embodiment of the present application, the input parameters of the first message verification code include at least one of the following: security capability information of the first terminal device, security policy information of the first terminal device, the first random number, the third 2. Temporary public key, the M bits. That is, the first terminal device can be based on the security capability information of the first terminal device, the security policy information of the first terminal device, the first random number, the information of the user to which the first terminal device belongs, and the second temporary At least one of the public key, the M bits, and the signature of the first terminal device is used to generate the first message verification code.
具体例如,假设该第一消息验证码的输入参数包括:该第一终端设备的安全能力信息、该第一终端设备的安全策略信息、该第一随机数、该第一终端设备所属用户的信息、该第二临时公钥、该M个比特位、该第一终端设备的签名。该第二终端设备可以基于该第一终端设备的安全能力信息、该第一终端设备的安全策略信息、该第一随机数、该第二临时公钥、该M个比特位生成第一消息验证码,并与该第一消息中包含的该第一消息验证码进行比较,若比较一致的情况下,该第一消息验证码有效。For example, assume that the input parameters of the first message verification code include: the security capability information of the first terminal device, the security policy information of the first terminal device, the first random number, and the information of the user to which the first terminal device belongs. , the second temporary public key, the M bits, and the signature of the first terminal device. The second terminal device may generate a first message verification based on the security capability information of the first terminal device, the security policy information of the first terminal device, the first random number, the second temporary public key, and the M bits. code and compare it with the first message verification code contained in the first message. If they are consistent, the first message verification code is valid.
在一些实施例中,该第一消息为认证响应消息,或者,该第一消息为安全模式命令消息。In some embodiments, the first message is an authentication response message, or the first message is a safe mode command message.
在一些实施例中,该第一终端设备的安全能力信息可以是该第一终端设备支持的密码算法列表。In some embodiments, the security capability information of the first terminal device may be a list of cryptographic algorithms supported by the first terminal device.
在一些实施例中,该第一终端设备的安全策略信息可以是该第一终端设备是否支持机密性保护或完整性保护。其中,该第一终端设备的安全策略信息包括:该第一终端设备在控制面的安全策略信息,和/或,该第一终端设备在用户面的安全策略信息。In some embodiments, the security policy information of the first terminal device may be whether the first terminal device supports confidentiality protection or integrity protection. The security policy information of the first terminal device includes: the security policy information of the first terminal device on the control plane, and/or the security policy information of the first terminal device on the user plane.
在一些实施例中,该M个比特位可以是该第一密钥的标识的最高M个比特位,该N个比特位可以是该第一密钥的标识的最低N个比特位;或者,该M个比特位可以是该第一密钥的标识的前M个比特位,该N个比特位可以是该第一密钥的标识的后N个比特位;或者,该M个比特位可以是该第一密钥的标识的偶数位的比特位,该N个比特位可以是该第一密钥的标识的奇数位的比特位。In some embodiments, the M bits may be the highest M bits of the identity of the first key, and the N bits may be the lowest N bits of the identity of the first key; or, The M bits may be the first M bits of the identifier of the first key, and the N bits may be the last N bits of the identifier of the first key; or, the M bits may be are the even-numbered bits of the identifier of the first key, and the N bits may be the odd-numbered bits of the identifier of the first key.
在一些实施例中,M与N的取值可以相同,也可以不同,本申请对此并不限定。In some embodiments, the values of M and N may be the same or different, which is not limited by this application.
在一些实施例中,该第一终端设备接收该第二终端设备通过该中继设备发送的第二消息;In some embodiments, the first terminal device receives the second message sent by the second terminal device through the relay device;
其中,该第二消息包括以下至少之一:该第二终端设备生成的该第二随机数,该第二终端设备生成的该第一密钥的标识的N个比特位,该第二终端设备生成的该第二密钥的标识的x个比特位,该第二终端设备选取的安全算法,该第二终端设备选取的安全策略,第二消息验证码;Wherein, the second message includes at least one of the following: the second random number generated by the second terminal device, N bits of the identification of the first key generated by the second terminal device, x bits of the identifier of the generated second key, the security algorithm selected by the second terminal device, the security policy selected by the second terminal device, and the second message verification code;
其中,该第二消息通过基于该第二密钥生成的该第二消息验证码进行完整性保护,或者,该第二 消息通过基于该第二密钥派生的完整性保护密钥生成的该第二消息验证码进行完整性保护,且该第二消息验证码的输入参数包括以下至少之一:该第二随机数,该N个比特位,该x个比特位,该第二终端设备选取的安全算法,该第二终端设备选取的安全策略;Wherein, the second message is integrity protected through the second message verification code generated based on the second key, or the second message is integrity protected through the third integrity protection key generated based on the second key. The second message verification code performs integrity protection, and the input parameters of the second message verification code include at least one of the following: the second random number, the N bits, the x bits, and the second terminal device selected Security algorithm, the security policy selected by the second terminal device;
其中,该第二密钥的标识由该x个比特位与该第二密钥的标识的另外y个比特位合并得到,x和y均为正整数。Wherein, the identifier of the second key is obtained by combining the x bits and the other y bits of the identifier of the second key, and both x and y are positive integers.
在一些实施例中,该x个比特位可以是该第二密钥的标识的最高x个比特位,该y个比特位可以是该第二密钥的标识的最低y个比特位;或者,该x个比特位可以是该第二密钥的标识的前x个比特位,该y个比特位可以是该第二密钥的标识的后y个比特位;或者,该x个比特位可以是该第二密钥的标识的偶数位的比特位,该y个比特位可以是该第二密钥的标识的奇数位的比特位。In some embodiments, the x bits may be the highest x bits of the identity of the second key, and the y bits may be the lowest y bits of the identity of the second key; or, The x bits may be the first x bits of the identifier of the second key, and the y bits may be the last y bits of the identifier of the second key; or, the x bits may be are the even-numbered bits of the identifier of the second key, and the y bits may be the odd-numbered bits of the identifier of the second key.
在一些实施例中,x与y的取值可以相同,也可以不同,本申请对此并不限定。In some embodiments, the values of x and y may be the same or different, which is not limited by this application.
在一些实施例中,在该第二消息中携带的信息未遭受篡改的情况下,该第一终端设备至少根据该第一随机数、该第一密钥和该第二随机数生成该第二密钥,该第一终端设备根据该第二密钥生成完整性保护密钥和/或机密性保护密钥,以及该第一终端设备将该M个比特位和该N个比特位合并得到该第一密钥的标识,该第一终端设备生成该第二密钥的标识的y个比特位,并将该x个比特位和该y个比特位合并得到该第二密钥的标识;In some embodiments, if the information carried in the second message has not been tampered with, the first terminal device generates the second random number based on at least the first random number, the first key and the second random number. key, the first terminal device generates an integrity protection key and/or a confidentiality protection key based on the second key, and the first terminal device combines the M bits and the N bits to obtain the The identification of the first key, the first terminal device generates y bits of the identification of the second key, and combines the x bits and the y bits to obtain the identification of the second key;
在该第二消息验证码有效的情况下,该第一终端设备根据该第二终端设备选取的安全算法、该第二密钥、基于该第二密钥生成完整性保护密钥和/或机密性保护密钥、该第二终端设备选取的安全策略,与该第二终端设备进行通信。When the second message verification code is valid, the first terminal device generates an integrity protection key and/or a secret based on the security algorithm selected by the second terminal device, the second key, and the second key. The security protection key and the security policy selected by the second terminal device are used to communicate with the second terminal device.
具体例如,假设该第二消息验证码的输入参数包括:该第二随机数、该N个比特位、该x个比特位、该第二终端设备选取的安全算法、该第二终端设备选取的安全策略。该第一终端设备可以基于该第二随机数、该N个比特位、该x个比特位、该第二终端设备选取的安全算法、该第二终端设备选取的安全策略生成第二消息验证码,并与该第二消息中包含的该第二消息验证码进行比较,若比较一致的情况下,该第二消息验证码有效。For example, assume that the input parameters of the second message verification code include: the second random number, the N bits, the x bits, the security algorithm selected by the second terminal device, the security strategy. The first terminal device may generate a second message verification code based on the second random number, the N bits, the x bits, the security algorithm selected by the second terminal device, and the security policy selected by the second terminal device. , and compared with the second message verification code contained in the second message. If they are consistent, the second message verification code is valid.
在一些实施例中,该第二消息通过该第一密钥进行加密。当然,该第二消息也可以不通过该第一密钥进行加密,或者,该第二消息也可以不加密。In some embodiments, the second message is encrypted with the first key. Of course, the second message may not be encrypted using the first key, or the second message may not be encrypted.
在一些实施例中,该第一终端设备根据该第一密钥解密该第二消息;在该第二消息中携带的信息未遭受篡改的情况下,该第一终端设备至少根据该第一随机数、该第一密钥和该第二随机数生成该第二密钥,该第一终端设备根据该第二密钥生成完整性保护密钥和/或机密性保护密钥,以及该第一终端设备将该M个比特位和该N个比特位合并得到该第一密钥的标识,该第一终端设备生成该第二密钥的标识的y个比特位,并将该x个比特位和该y个比特位合并得到该第二密钥的标识;In some embodiments, the first terminal device decrypts the second message according to the first key; if the information carried in the second message is not tampered with, the first terminal device at least decrypts the second message according to the first random key. number, the first key and the second random number to generate the second key, the first terminal device generates an integrity protection key and/or a confidentiality protection key based on the second key, and the first The terminal device combines the M bits and the N bits to obtain the identity of the first key, the first terminal device generates y bits of the identity of the second key, and combines the x bits Combine with the y bits to obtain the identity of the second key;
在该第二消息验证码有效的情况下,该第一终端设备根据该第二终端设备选取的安全算法、该第二密钥、基于该第二密钥生成完整性保护密钥和/或机密性保护密钥、该第二终端设备选取的安全策略,与该第二终端设备进行通信。When the second message verification code is valid, the first terminal device generates an integrity protection key and/or a secret based on the security algorithm selected by the second terminal device, the second key, and the second key. The security protection key and the security policy selected by the second terminal device are used to communicate with the second terminal device.
具体的,该第二终端设备可以基于该第一终端设备的安全能力信息选取安全算法,和/或,该第二终端设备可以基于该第一终端设备的安全策略信息选取安全策略。Specifically, the second terminal device may select a security algorithm based on the security capability information of the first terminal device, and/or the second terminal device may select a security policy based on the security policy information of the first terminal device.
在一些实施例中,该第一终端设备可以根据该第一随机数、该第一密钥、该第二随机数,以及源标识、目标标识、该第一随机数的长度、该第二随机数的长度、该源标识的长度、该目标标识的长度中的至少之一,生成该第二密钥。其中,该源标识用于标识该第一终端设备与该第二终端设备之间的中继连接的源端,该目标标识用于标识该第一终端设备与该第二终端设备之间的中继连接的目标端。另外,该第二密钥的输入参数还可以包括其他系统设定参数,如3GPP指定的一个或多个固定参数。In some embodiments, the first terminal device may use the first random number, the first key, the second random number, the source identifier, the target identifier, the length of the first random number, the second random number. At least one of the length of the number, the length of the source identifier, and the length of the target identifier is used to generate the second key. Wherein, the source identifier is used to identify the source end of the relay connection between the first terminal device and the second terminal device, and the target identifier is used to identify the intermediate connection between the first terminal device and the second terminal device. The destination of the connection. In addition, the input parameters of the second key may also include other system setting parameters, such as one or more fixed parameters specified by 3GPP.
在一些实施例中,该第一消息为认证响应消息,该第二消息为安全模式命令(Secure Mode Command,SMC)消息。In some embodiments, the first message is an authentication response message, and the second message is a Secure Mode Command (Secure Mode Command, SMC) message.
在一些实施例中,该第一消息为安全模式命令(SMC)消息,该第二消息为安全模式响应消息。In some embodiments, the first message is a safe mode command (SMC) message and the second message is a safe mode response message.
在一些实施例中,该第一终端设备通过该中继设备向该第二终端设备发送第三消息;In some embodiments, the first terminal device sends the third message to the second terminal device through the relay device;
其中,该第三消息用于指示安全模式建立完成,该第三消息通过目标密钥进行加密,且该第三消息包括以下至少之一:该第二密钥的标识的该y个比特位,第三消息验证码;Wherein, the third message is used to indicate that the security mode establishment is completed, the third message is encrypted by the target key, and the third message includes at least one of the following: the y bits of the identification of the second key, Third message verification code;
其中,该目标密钥包括以下之一:该第一密钥,该第二密钥,该第二密钥派生的机密性保护密钥;Wherein, the target key includes one of the following: the first key, the second key, and a confidentiality protected key derived from the second key;
其中,该第三消息通过基于该第二密钥生成的该第三消息验证码进行完整性保护,或者,该第三消息通过基于该第二密钥派生的完整性保护密钥生成的该第三消息验证码进行完整性保护,该第三消息验证码的输入参数包括该y个比特位。Wherein, the third message is integrity protected through the third message verification code generated based on the second key, or the third message is integrity protected through the third message verification code generated based on the integrity protection key derived based on the second key. The three-message verification code performs integrity protection, and the input parameters of the third message verification code include the y bits.
也即,该第三消息通过该第三消息验证码进行完整性保护,该第三消息验证码基于该第二密钥生成,或者,该第三消息验证码基于该第二密钥派生的完整性保护密钥生成。That is to say, the third message is integrity protected by the third message verification code, which is generated based on the second key, or the third message verification code is based on the integrity derived from the second key. Sexually protected key generation.
在一些实施例中,对于该第二终端设备,该第二终端设备通过该目标密钥对该第三消息进行解密;在该第三消息中携带的信息未遭受篡改的情况下,且该第三消息验证码有效的情况下,该第二终端设备将该x个比特位与该y个比特位合并得到该第二密钥的标识。具体的,该第二终端设备可以基于该y个比特位生成第三消息验证码,并与该第三消息中包含的该第三消息验证码进行比较,若比较一致的情况下,该第三消息验证码有效。In some embodiments, for the second terminal device, the second terminal device decrypts the third message using the target key; provided that the information carried in the third message has not been tampered with, and the third message When the three-message verification code is valid, the second terminal device combines the x bits and the y bits to obtain the identity of the second key. Specifically, the second terminal device can generate a third message verification code based on the y bits, and compare it with the third message verification code contained in the third message. If the comparison is consistent, the third message verification code The message verification code is valid.
具体例如,该第三消息为安全模式结束消息(security mode complete)。For example, the third message is a security mode complete message (security mode complete).
在一些实施例中,该第一终端设备接收该第二终端设备通过该中继设备发送的错误消息;其中,该错误消息包括以下至少之一:原因信息,第四消息验证码;其中,该原因信息用于指示该第二终端设备与该第一终端设备的安全策略冲突,或者,该原因信息用于指示该第一消息验证码验证失败,或者,该原因信息用于指示该第二终端设备与该第一终端设备的安全算法协商失败,该第四消息验证码的输入参数包括以下至少之一:该原因信息;In some embodiments, the first terminal device receives an error message sent by the second terminal device through the relay device; wherein the error message includes at least one of the following: cause information, a fourth message verification code; wherein the error message The reason information is used to indicate that the security policy of the second terminal device conflicts with the first terminal device, or the reason information is used to indicate that the first message verification code verification fails, or the reason information is used to indicate that the second terminal device The security algorithm negotiation between the device and the first terminal device fails, and the input parameters of the fourth message verification code include at least one of the following: the reason information;
在该第四消息验证码有效的情况下,该第一终端设备确定安全模式建立失败,和/或,该第一终端设备重新发起安全模式建立流程。If the fourth message verification code is valid, the first terminal device determines that the security mode establishment fails, and/or the first terminal device re-initiates the security mode establishment process.
在一些实施例中,该错误消息也可以受完整性保护。In some embodiments, the error message may also be integrity protected.
具体例如,该原因信息用于指示该第二终端设备与该第一终端设备的安全策略冲突,例如,该第二终端设备不支持该第一消息中携带的该第一终端设备的安全策略信息。Specifically, for example, the cause information is used to indicate that the security policy of the second terminal device conflicts with the first terminal device. For example, the second terminal device does not support the security policy information of the first terminal device carried in the first message. .
具体例如,该原因信息用于指示该第二终端设备与该第一终端设备的安全算法协商失败,例如,该第二终端设备不支持该第一消息中携带的该第一终端设备的安全能力信息。Specifically, for example, the cause information is used to indicate that the security algorithm negotiation between the second terminal device and the first terminal device failed. For example, the second terminal device does not support the security capabilities of the first terminal device carried in the first message. information.
在一些实施例中,该第一密钥可以是K D,该第一密钥的标识可以是K D ID;该第二密钥可以是K D-SESS,该第二密钥的标识可以是K D-SESS ID。 In some embodiments, the first key may be K D , and the identifier of the first key may be K D ID ; the second key may be K D -SESS , and the identifier of the second key may be K D-SESS ID.
在一些实施例中,对于第一终端设备而言,生成第一密钥时的输入参数包括:第一终端设备生成的第二临时私钥(Ephemeral private key2)、第二终端设备生成的第一临时公钥(Ephemeral public key1),以及中继设备的相关信息(如中继设备的身份信息,或者中继设备生成的随机数,或者中继设备生成的计数器(COUNT))。对于第二终端设备而言,生成第一密钥时的输入参数包括:第一终端设备生成的第二临时公钥(Ephemeral public key2)、第二终端设备生成的第一临时私钥(Ephemeral private key1),以及中继设备的相关信息(如中继设备的身份信息,或者中继设备生成的随机数,或者中继设备生成的计数器(COUNT))。其中,第一临时公钥与第一临时私钥配对,第二临时公钥与第二临时私钥配对。In some embodiments, for the first terminal device, the input parameters when generating the first key include: a second temporary private key (Ephemeral private key2) generated by the first terminal device, a first temporary private key generated by the second terminal device. Temporary public key (Ephemeral public key1), and related information of the relay device (such as the identity information of the relay device, or the random number generated by the relay device, or the counter (COUNT) generated by the relay device). For the second terminal device, the input parameters when generating the first key include: the second temporary public key (Ephemeral public key2) generated by the first terminal device, the first temporary private key (Ephemeral private key2) generated by the second terminal device. key1), and related information of the relay device (such as the identity information of the relay device, or the random number generated by the relay device, or the counter (COUNT) generated by the relay device). The first temporary public key is paired with the first temporary private key, and the second temporary public key is paired with the second temporary private key.
在一些实施例中,该完整性保护密钥包括控制面的完整性保护密钥(K D-CPint)和用户面的完整性保护密钥(K D-UPint);和/或,该机密性保护密钥包括控制面的机密性保护密钥(K D-CPenc)和用户面的机密性保护密钥(K D-UPenc)。 In some embodiments, the integrity protection key includes an integrity protection key for the control plane (KD -CPint ) and an integrity protection key for the user plane ( KD-UPint ); and/or the confidentiality The protection keys include a confidentiality protection key for the control plane (K D-CPenc ) and a confidentiality protection key for the user plane (K D-UPenc ).
在一些实施例中,该完整性保护密钥的输入参数包括以下至少之一:该第二密钥,选定的算法类型标识符,选定的算法类型标识符的长度,完整性保护算法标识,完整性保护算法标识的长度。也即,可以基于该第二密钥、选定的算法类型标识符、选定的算法类型标识符的长度、完整性保护算法标识、完整性保护算法标识的长度中的至少之一,生成该完整性保护密钥。In some embodiments, the input parameters of the integrity protection key include at least one of the following: the second key, the selected algorithm type identifier, the length of the selected algorithm type identifier, and the integrity protection algorithm identifier. , the length of the integrity protection algorithm identifier. That is, the second key may be generated based on at least one of the second key, the selected algorithm type identifier, the length of the selected algorithm type identifier, the integrity protection algorithm identifier, and the length of the integrity protection algorithm identifier. Integrity protected key.
可选地,该完整性保护密钥的输入参数还可以包括一些系统设定参数。在该第二密钥自动刷新时,该完整性保护密钥自动更新。Optionally, the input parameters of the integrity protection key may also include some system setting parameters. When the second key is automatically refreshed, the integrity protection key is automatically updated.
在一些实施例中,该机密性保护密钥的输入参数包括以下至少之一:该第二密钥,选定的算法类型标识符,选定的算法类型标识符的长度,机密性保护算法标识,机密性保护算法标识的长度。也即,可以基于该第二密钥、选定的算法类型标识符、选定的算法类型标识符的长度、机密性保护算法标识、机密性保护算法标识的长度中的至少之一,生成该机密性保护密钥。In some embodiments, the input parameters of the confidentiality protection key include at least one of the following: the second key, the selected algorithm type identifier, the length of the selected algorithm type identifier, the confidentiality protection algorithm identification , the length of the confidentiality protection algorithm identifier. That is, the second key may be generated based on at least one of the second key, the selected algorithm type identifier, the length of the selected algorithm type identifier, the confidentiality protection algorithm identifier, and the length of the confidentiality protection algorithm identifier. Confidentiality protects keys.
可选地,该机密性保护密钥的输入参数还可以包括一些系统设定参数。在该第二密钥自动刷新时,该机密性保护密钥自动更新。Optionally, the input parameters of the confidentiality protection key may also include some system setting parameters. When the second key is automatically refreshed, the confidentiality protection key is automatically updated.
在一些实施例中,对于控制面的完整性保护密钥(K D-CPint),选定的算法类型标识符可以通过“控制面完整性保护算法”或设置特定值来表示。 In some embodiments, for the control plane integrity protection key (K D-CPint ), the selected algorithm type identifier may be represented by "Control Plane Integrity Protection Algorithm" or by setting a specific value.
在一些实施例中,对于控制面的机密性保护密钥(K D-CPenc),选定的算法类型标识符可以通过“控制面机密性保护算法”或设置特定值来表示。 In some embodiments, for the control plane confidentiality protected key (K D-CPenc ), the selected algorithm type identifier may be represented by "Control Plane Confidentiality Protection Algorithm" or by setting a specific value.
在一些实施例中,对于用户面的完整性保护密钥(K D-CPint),选定的算法类型标识符可以通过“用户面完整性保护算法”或设置特定值来表示。 In some embodiments, for the user plane integrity protection key (K D-CPint ), the selected algorithm type identifier may be represented by "User Plane Integrity Protection Algorithm" or by setting a specific value.
在一些实施例中,对于用户面的机密性保护密钥(K D-CPenc),选定的算法类型标识符可以通过“用户面机密性保护算法”或设置特定值来表示。 In some embodiments, for user plane confidentiality protected keys (K D-CPenc ), the selected algorithm type identifier may be represented by "user plane confidentiality protected algorithm" or by setting a specific value.
具体例如,本申请所涉及的密钥分层结构可以如图8所示。For example, the key hierarchical structure involved in this application can be shown in Figure 8.
根密钥:签名私钥/秘密签名密钥(Secret Signing Key,SSK)是UE-to-UE relay单播链路安全的信任根。SSK与用户标识(UE ID),公钥参数PVT组成基于身份的公钥签名算法(Elliptic Curve-Based Certificateless Signatures for Identity-Based Encryption,ECCSI)算法中用户的签名公私钥对。用户各自生成临时公私钥对,通过使用基于椭圆曲线的加密方案(Elliptic Curve Integrated Encryption Scheme,ECIES)算法来生成K D,另外,源设备用户生成的签名,从而保证身份真实性与临时公钥的完整性、不可否认性。目标设备用户生成的签名,从而保证身份真实性与临时公钥的完整性、不可否认性。从而保证仅有源设备和目标设备双方才可以获得密钥K D,故签名私钥或SSK是保障源设备与目标设备之间安全通信的信任根。 Root key: Signature private key/secret signing key (Secret Signing Key, SSK) is the root of trust for UE-to-UE relay unicast link security. SSK, user identification (UE ID), and public key parameter PVT form the user's signature public and private key pair in the Elliptic Curve-Based Certificateless Signatures for Identity-Based Encryption (ECCSI) algorithm. Users each generate a temporary public and private key pair, and use the Elliptic Curve Integrated Encryption Scheme (ECIES) algorithm to generate K D. In addition, the signature generated by the source device user ensures the authenticity of the identity and the authenticity of the temporary public key. Integrity and non-repudiation. The signature generated by the target device user ensures the authenticity of the identity and the integrity and non-repudiation of the temporary public key. This ensures that only the source device and the target device can obtain the key K D . Therefore, the signature private key or SSK is the root of trust that ensures secure communication between the source device and the target device.
K D:密钥长度至少为256比特(bits),由源设备和目标设备双方通过临时公私钥协商生成。基于根密钥,通过重新运行认证流程来更新K D。K D用于生成下一层密钥K D-sess。即使源设备与目标设备之间没有活动的通信会话,那么也可以保存该密钥。K D ID可以用来标识K DK D : The key length is at least 256 bits (bits) and is generated by both the source device and the target device through temporary public and private key negotiation. Based on the root key, K D is updated by rerunning the authentication process. K D is used to generate the next layer key K D-sess . The key can be saved even if there is no active communication session between the source and target devices. K D ID can be used to identify K D .
KD:对于UE-1而言,生成时的输入参数包括:UE-1的临时私钥Ephemeral private key2、UE-2的临时公钥Ephemeral public key1、以及UE-relay的身份信息,或者UE-relay生成的随机数,或者UE-relay生成的计数器COUNT;对于UE-2而言,生成时的输入参数包括:UE-1的临时公钥Ephemeral public key2、UE-2的临时私钥Ephemeral private key1、以及UE-relay的身份,或者UE-relay生成的随机数,或者UE-relay生成的计数器COUNT。KD: For UE-1, the input parameters during generation include: UE-1’s temporary private key Ephemeral private key2, UE-2’s temporary public key Ephemeral public key1, and the identity information of UE-relay, or UE-relay The generated random number, or the counter COUNT generated by UE-relay; for UE-2, the input parameters during generation include: UE-1's temporary public key Ephemeral public key2, UE-2's temporary private key Ephemeral private key1, And the identity of UE-relay, or the random number generated by UE-relay, or the counter COUNT generated by UE-relay.
K D-sess:密钥长度至少为256bits,K D-sess用于派生下一层完整性保护或机密性保护密钥。可以基于K D,通过重新运行安全连接建立流程或者相关的密钥更新流程来刷新K D-sess。K D-sess ID用于标识K D-sess。K D-sess由K D使用HMAC-SHA-256或HMAC-SM3等密钥派生算法衍生而成。K D-sess的输入参数至少必须含有密钥K D、随机数Nonce_1(即第一终端设备生成的第一随机数)、随机数Nonce_2(即第二终端设备生成的第二随机数)。可选地,K D-sess的输入参数还可以包括但不限于以下至少之一:源标识(Source ID)、目标标识(Destination ID)、随机数Nonce_1的长度、随机数Nonce_2的长度、源标识(Source ID)的长度、目标标识(Destination ID)的长度。另外,K D-sess的输入参数还可以包括其他系统设定参数,如3GPP指定的一个或多个固定参数。 K D-sess : The key length is at least 256 bits. K D-sess is used to derive the next level of integrity protection or confidentiality protection key. K D -sess can be refreshed based on K D by rerunning the secure connection establishment process or the related key update process. K D-sess ID is used to identify K D-sess . KD-sess is derived from KD using key derivation algorithms such as HMAC-SHA-256 or HMAC-SM3. The input parameters of K D-sess must at least include the key K D , the random number Nonce_1 (that is, the first random number generated by the first terminal device), and the random number Nonce_2 (that is, the second random number generated by the second terminal device). Optionally, the input parameters of K D-sess may also include but are not limited to at least one of the following: source ID (Source ID), destination ID (Destination ID), the length of the random number Nonce_1, the length of the random number Nonce_2, the source ID (Source ID) length, destination ID (Destination ID) length. In addition, the input parameters of K D-sess can also include other system setting parameters, such as one or more fixed parameters specified by 3GPP.
K D-CPint:密钥长度至少为128bits,该密钥可以用于控制面数据完整性保护,该密钥由K D-sess使用HMAC-SHA-256或HMAC-SM3等密钥派生算法衍生而来。K D-CPint的输入参数至少必须含有密钥K D-sess、所选定的算法类型标识符(比如“控制面完整性保护算法”或设置特定值来表示)及该选定的算法类型标识符的长度,完整性保护算法标识以及该完整性保护算法标识的长度,其他系统设定参数可以作为可选输入参数。在K D-sess自动刷新时,K D-CPint自动更新。 K D-CPint : The key length is at least 128 bits. This key can be used for control plane data integrity protection. The key is derived by K D-sess using key derivation algorithms such as HMAC-SHA-256 or HMAC-SM3. Come. The input parameters of K D-CPint must contain at least the key K D-sess , the selected algorithm type identifier (such as "control plane integrity protection algorithm" or setting a specific value to represent it) and the selected algorithm type identifier. The length of the symbol, the integrity protection algorithm identifier and the length of the integrity protection algorithm identifier, and other system setting parameters can be used as optional input parameters. K D -CPint is automatically updated when K D -sess is automatically refreshed.
K D-CPenc:密钥长度至少为128bits,该密钥可以用于控制面数据机密性保护,该密钥由K D-sess使用HMAC-SHA-256或HMAC-SM3等密钥派生算法衍生而来。K D-CPenc的输入参数至少必须含有密钥K D-sess,所选定的算法类型标识符(比如“控制面机密性保护算法”或设置特定值来表示)及选定的算法类型标识符的长度,机密性保护算法标识以及该机密性保护算法标识的长度,其他系统设定参数可以作为可选输入参数。在K D-sess自动刷新时,K D-CPenc自动更新。 K D-CPenc : The key length is at least 128 bits. This key can be used for control plane data confidentiality protection. The key is derived by K D-sess using key derivation algorithms such as HMAC-SHA-256 or HMAC-SM3. Come. The input parameters of K D-CPenc must contain at least the key K D-sess , the selected algorithm type identifier (such as "Control Plane Confidentiality Protection Algorithm" or set a specific value to represent it) and the selected algorithm type identifier The length, the confidentiality protection algorithm identifier and the length of the confidentiality protection algorithm identifier, and other system setting parameters can be used as optional input parameters. K D -CPenc is automatically updated when K D- sess is automatically refreshed.
K D-UPint:密钥长度至少为128bits,该密钥可以用于用户面数据完整性保护,该密钥由K D-sess使用HMAC-SHA-256或HMAC-SM3等密钥派生算法衍生而来。K D-UPint的输入参数至少必须含有密钥K D-sess,所选定的算法类型标识符(比如“用户面完整性保护算法”或设置特定值来表示)及该选定的算法类型标识符的长度,完整性保护算法标识以及该完整性保护算法标识的长度,其他系统设定参数可以作为可选输入参数。在K D-sess自动刷新时,K D-UPint自动更新。 K D-UPint : The key length is at least 128 bits. This key can be used for user plane data integrity protection. The key is derived by K D-sess using key derivation algorithms such as HMAC-SHA-256 or HMAC-SM3. Come. The input parameters of K D-UPint must contain at least the key K D-sess , the selected algorithm type identifier (such as "user plane integrity protection algorithm" or setting a specific value to represent it) and the selected algorithm type identifier. The length of the symbol, the integrity protection algorithm identifier and the length of the integrity protection algorithm identifier, and other system setting parameters can be used as optional input parameters. K D -UPint is automatically updated when K D-sess is automatically refreshed.
K D-UPenc:密钥长度至少为128bits,该密钥可以用于用户面数据机密性保护,该密钥由K D-sess使用HMAC-SHA-256或HMAC-SM3等密钥派生算法衍生而来。K D-UPenc的输入参数至少必须含有密钥K D-sess,所选定的算法类型标识符(比如“用户面机密性保护算法”或设置特定值来表示)及该选定的算法类型标识符的长度,机密性保护算法标识以及该机密性保护算法标识的长度,其他系统设定参数可以作为可选输入参数。在K D-sess自动刷新时,K D-UPenc自动更新。 K D-UPenc : The key length is at least 128 bits. This key can be used for user plane data confidentiality protection. The key is derived by K D-sess using key derivation algorithms such as HMAC-SHA-256 or HMAC-SM3. Come. The input parameters of K D-UPenc must contain at least the key K D-sess , the selected algorithm type identifier (such as "user plane confidentiality protection algorithm" or setting a specific value to represent it) and the selected algorithm type identifier. The length of the character, the confidentiality protection algorithm identifier and the length of the confidentiality protection algorithm identifier, and other system setting parameters can be used as optional input parameters. K D -UPenc is automatically updated when K D -sess is automatically refreshed.
在一些实施例中,本申请中的ECCSI仅为示例,并不局限于该算法,也可以使用其他基于身份的公钥签名和公钥加密算法来替换,在替换公钥算法的同时,所有请求消息中与公钥算法相关的参数需要作相应替换。In some embodiments, ECCSI in this application is only an example and is not limited to this algorithm. It can also be replaced by other identity-based public key signature and public key encryption algorithms. While replacing the public key algorithm, all requests Parameters related to the public key algorithm in the message need to be replaced accordingly.
在一些实施例中,本申请中第一终端设备和第二终端设备使用的密钥派生函数不局限于HMAC-SHA-256或HMAC-SM3,包括任何一种满足计算安全的密钥派生函数。In some embodiments, the key derivation function used by the first terminal device and the second terminal device in this application is not limited to HMAC-SHA-256 or HMAC-SM3, and includes any key derivation function that meets computational security.
在一些实施例中,本申请中密钥派生函数的输入参数不局限于上述提到的必要参数,可以含有其他可选参数,比如应用系统设置固定参数。In some embodiments, the input parameters of the key derivation function in this application are not limited to the necessary parameters mentioned above, and may include other optional parameters, such as fixed parameters set by the application system.
在一些实施例中,本申请中的密钥管理中心不限于KMS、PKMF、5GPKMF,运营商管理或被第 三方业务提供商管理的合法密钥管理中心均适用于本申请的技术方案。In some embodiments, the key management center in this application is not limited to KMS, PKMF, and 5GPKMF. Legal key management centers managed by operators or managed by third-party service providers are all applicable to the technical solution of this application.
本方案中,PKMF为已注册并被授权使用UE-to-UE relay功能的终端设备下发的对称密钥不局限于上述方案,具体配置可根据运营商或业务提供商对PKMF的设计而更改。In this solution, the symmetric key issued by PKMF to the terminal device that has been registered and authorized to use the UE-to-UE relay function is not limited to the above solution. The specific configuration can be changed according to the operator or service provider's design of PKMF. .
在一些实施例中,本申请中安全通信建立流程中所有交互消息中的信息元素并不局限于上述方案中提到的内容,也可以增加由于应用系统要求的可选信息元素。In some embodiments, the information elements in all interactive messages in the secure communication establishment process in this application are not limited to the content mentioned in the above solution, and optional information elements due to application system requirements can also be added.
因此,在本申请实施例中,第一随机数、第一密钥和第二终端设备生成的第二随机数用于派生第二密钥,第二密钥用于派生完整性保护密钥和/或机密性保护密钥,能够保证第一终端设备和第二终端设备的身份安全与通信数据的机密性与完整性,从而确保双方传输数据的机密性和完整性,防止其他设备甚至中继设备的窃听。Therefore, in this embodiment of the present application, the first random number, the first key and the second random number generated by the second terminal device are used to derive the second key, and the second key is used to derive the integrity protection key and /or confidentiality protection key, which can ensure the identity security of the first terminal device and the second terminal device and the confidentiality and integrity of the communication data, thereby ensuring the confidentiality and integrity of the data transmitted by both parties and preventing other devices from even relaying Device eavesdropping.
本申请实施例适用于5G L2 UE-to-UE relay架构下第一终端设备(源设备)和第二终端设备(目标设备)之间的安全通信建立流程。借助公钥签名技术,能够确保终端设备的身份真实性和消息不可否认性,能够抗重放攻击、中间人攻击、伪装等多种主动攻击,同时保证认证流程消息的完整性,并且利用3GPP标准中使用的ECIES算法,从而建立了源UE和目标UE之间的端到端安全,确保双方传输数据的机密性和完整性,防止外部敌手甚至中继(relay)的窃听;本申请实施例保证了安全通信建立机制的可扩展性,另外,本申请实施例能够实现源UE和目标UE之间用户面和控制面安全策略、以及双方所支持加密和完整性保护算法的安全协商,能够实现完整性保护,抵抗篡改和降级攻击。The embodiment of this application is suitable for the secure communication establishment process between the first terminal device (source device) and the second terminal device (target device) under the 5G L2 UE-to-UE relay architecture. With the help of public key signature technology, it can ensure the identity authenticity of the terminal device and the non-repudiation of the message, and can resist replay attacks, man-in-the-middle attacks, disguise and other active attacks, while ensuring the integrity of the authentication process messages, and using the 3GPP standard The ECIES algorithm is used to establish end-to-end security between the source UE and the target UE, ensuring the confidentiality and integrity of the data transmitted by both parties, and preventing eavesdropping by external adversaries and even relays; the embodiment of this application ensures The scalability of the secure communication establishment mechanism. In addition, the embodiments of this application can realize the security negotiation of the user plane and control plane security policies between the source UE and the target UE, as well as the encryption and integrity protection algorithms supported by both parties, and can achieve integrity. Protect against tampering and downgrade attacks.
上文结合图7至图8,详细描述了本申请的第一终端设备侧实施例,下文结合图9,详细描述本申请的第二终端设备侧实施例,应理解,第二终端设备侧实施例与第一终端设备侧实施例相互对应,类似的描述可以参照第一终端设备侧实施例。The first terminal device side embodiment of the present application is described in detail above with reference to FIGS. 7 to 8 . The second terminal device side embodiment of the present application is described in detail below with reference to FIG. 9 . It should be understood that the second terminal device side implementation The example corresponds to the first terminal device side embodiment, and similar descriptions may refer to the first terminal device side embodiment.
图9是根据本申请实施例的中继通信的方法300的示意性流程图,如图9所示,该中继通信的方法300可以包括如下内容中的至少部分内容:Figure 9 is a schematic flowchart of a communication relay method 300 according to an embodiment of the present application. As shown in Figure 9, the communication relay method 300 may include at least part of the following content:
S310,第二终端设备通过中继设备向第一终端设备发送认证请求消息;其中,该认证请求消息包括以下至少之一:该第二终端设备所属用户的信息,该第二终端设备生成的第一临时公钥,该第二终端设备的签名,该中继设备的相关信息;其中,该第二终端设备所属用户的信息包括该第二终端设备的标识和该第二终端设备的PVT和KPAK;该第二终端设备的签名的输入参数包括以下至少之一:该第二终端设备所属用户的信息和该第一临时公钥;该第一临时公钥和该中继设备的相关信息用于该第一终端设备派生第一密钥;该中继设备的相关信息包括以下之一:该中继设备的身份信息,该中继设备生成的随机数,该中继设备生成的计数器。S310. The second terminal device sends an authentication request message to the first terminal device through the relay device; wherein the authentication request message includes at least one of the following: information about the user to which the second terminal device belongs, the first user generated by the second terminal device. A temporary public key, the signature of the second terminal device, and relevant information of the relay device; wherein the information of the user to which the second terminal device belongs includes the identification of the second terminal device and the PVT and KPAK of the second terminal device. ; The input parameters of the signature of the second terminal device include at least one of the following: information about the user to which the second terminal device belongs and the first temporary public key; related information about the first temporary public key and the relay device for The first terminal device derives a first key; the relevant information of the relay device includes one of the following: identity information of the relay device, a random number generated by the relay device, and a counter generated by the relay device.
本实施例基于ECCSI签名方案,建立L2架构下的UE-to-UE中继场景下的安全连接。具体的,本申请实施例应用于L2架构下的UE-to-UE中继场景,也即,第一终端设备与第二终端设备之间通过中继设备进行通信。例如,第一终端设备与第二终端设备之间的中继连接可以是PC5链路。This embodiment is based on the ECCSI signature scheme to establish a secure connection in the UE-to-UE relay scenario under the L2 architecture. Specifically, the embodiments of this application are applied to the UE-to-UE relay scenario under the L2 architecture, that is, the first terminal device and the second terminal device communicate through the relay device. For example, the relay connection between the first terminal device and the second terminal device may be a PC5 link.
在本申请实施例中,该第一终端设备可以是源设备或源终端,该第二终端设备可以是目标设备或目标终端。该中继设备可以是中继终端。In this embodiment of the present application, the first terminal device may be a source device or a source terminal, and the second terminal device may be a target device or a target terminal. The relay device may be a relay terminal.
在本申请实施例中,该第二终端设备的签名的输入参数包括以下至少之一:该第二终端设备所属用户的信息和该第一临时公钥。也即,该第二终端设备可以基于该第二终端设备所属用户的信息和该第一临时公钥中的至少之一,生成该第二终端设备的签名。In this embodiment of the present application, the input parameters of the signature of the second terminal device include at least one of the following: information of the user to which the second terminal device belongs and the first temporary public key. That is, the second terminal device may generate a signature of the second terminal device based on at least one of the information of the user to which the second terminal device belongs and the first temporary public key.
在本申请实施例中,该中继设备的签名的输入参数包括以下至少之一:该第二终端设备的签名和该中继设备所属用户的信息。也即,该中继设备可以基于该第二终端设备的签名和该中继设备所属用户的信息中的至少之一,生成该中继设备的签名。In this embodiment of the present application, the input parameters of the relay device's signature include at least one of the following: the signature of the second terminal device and the information of the user to which the relay device belongs. That is, the relay device may generate the signature of the relay device based on at least one of the signature of the second terminal device and the information of the user to which the relay device belongs.
在一些实施例中,该第二终端设备的签名由该第二终端设备的秘密签名密钥(SSK)生成。可选地,该第二终端设备的PVT和KPAK、以及秘密签名密钥(SSK)可以是可信中心KMS通过安全通道为该第二终端设备预先配置的。该安全通道可以基于AKMA机制或者GBA机制来建立该第二终端设备与KMS的安全连接,该KMS可以直接由运营商来负责管理或者是与运营商有商业关系的第三方服务提供商。In some embodiments, the signature of the second terminal device is generated by the secret signing key (SSK) of the second terminal device. Optionally, the PVT, KPAK, and secret signature key (SSK) of the second terminal device may be pre-configured by the trusted center KMS for the second terminal device through a secure channel. The secure channel may be based on the AKMA mechanism or the GBA mechanism to establish a secure connection between the second terminal device and the KMS. The KMS may be directly managed by the operator or be a third-party service provider that has a commercial relationship with the operator.
在一些实施例中,该第二终端设备接收该第一终端设备通过该中继设备发送的第一消息;In some embodiments, the second terminal device receives the first message sent by the first terminal device through the relay device;
其中,该第一消息包括以下至少之一:该第一终端设备的安全能力信息,该第一终端设备的安全策略信息,该第一终端设备所属用户的信息,该中继设备所属用户的信息,该第一终端设备生成的第一随机数,该第一终端设备生成的与该第二临时私钥配对的第二临时公钥,该第一终端设备生成的该第一密钥的标识的M个比特位,该第一终端设备的签名,该中继设备的签名,第一消息验证码;Wherein, the first message includes at least one of the following: security capability information of the first terminal device, security policy information of the first terminal device, information of the user to which the first terminal device belongs, and information of the user to which the relay device belongs. , the first random number generated by the first terminal device, the second temporary public key paired with the second temporary private key generated by the first terminal device, the identification of the first key generated by the first terminal device M bits, the signature of the first terminal device, the signature of the relay device, and the first message verification code;
其中,该第一终端设备所属用户的信息包括该第一终端设备的标识和该第一终端设备的PVT和KPAK;该中继设备所属用户的信息包括该中继设备的标识和该中继设备的PVT和KPAK;该第一终端设备的签名的输入参数包括以下至少之一:该第一终端设备所属用户的信息,该第二临时公钥,该 第一密钥的标识的M个比特位,该第二终端设备的签名;该中继设备的签名的输入参数包括以下至少之一:该中继设备所属用户的信息,该第一终端设备的签名,该第二终端设备的签名;Wherein, the information of the user to which the first terminal device belongs includes the identification of the first terminal device and the PVT and KPAK of the first terminal device; the information of the user to which the relay device belongs includes the identification of the relay device and the relay device. PVT and KPAK; the input parameters of the signature of the first terminal device include at least one of the following: information of the user to which the first terminal device belongs, the second temporary public key, and M bits of the identification of the first key , the signature of the second terminal device; the input parameters of the signature of the relay device include at least one of the following: information of the user to which the relay device belongs, the signature of the first terminal device, the signature of the second terminal device;
其中,该第一消息通过基于该第一密钥生成的该第一消息验证码进行完整性保护,且该第一消息验证码的输入参数包括以下至少之一:该第一终端设备的安全能力信息,该第一终端设备的安全策略信息,该第一终端设备所属用户的信息,该中继设备所属用户的信息,该第一随机数,该第二临时公钥,该M个比特位,该第一终端设备的签名,该中继设备的签名;Wherein, the first message is integrity protected by the first message verification code generated based on the first key, and the input parameters of the first message verification code include at least one of the following: the security capability of the first terminal device Information, the security policy information of the first terminal device, the information of the user to which the first terminal device belongs, the information of the user to which the relay device belongs, the first random number, the second temporary public key, the M bits, The signature of the first terminal device and the signature of the relay device;
其中,该第二临时公钥和该中继设备的相关信息用于该第二终端设备派生该第一密钥,该第一随机数、该第一密钥和该第二终端设备生成的第二随机数用于派生第二密钥,该第二密钥用于派生完整性保护密钥和/或机密性保护密钥,该第一密钥的标识由该M个比特位与该第一密钥的标识的另外N个比特位合并得到,M和N均为正整数。Wherein, the second temporary public key and the relevant information of the relay device are used by the second terminal device to derive the first key, the first random number, the first key and the third key generated by the second terminal device. Two random numbers are used to derive a second key. The second key is used to derive an integrity protection key and/or a confidentiality protection key. The identity of the first key is composed of the M bits and the first The other N bits of the key's identifier are combined, and M and N are both positive integers.
在本申请实施例中,该第一消息验证码的输入参数包括以下至少之一:该第一终端设备的安全能力信息,该第一终端设备的安全策略信息,该第一终端设备所属用户的信息、该中继设备所属用户的信息、该第一随机数,该第二临时公钥,该M个比特位。也即,该第一终端设备可以基于该第一终端设备的安全能力信息、该第一终端设备的安全策略信息、该第一随机数、该第二临时公钥、该M个比特位、该第一终端设备的签名、该中继设备的签名中的至少之一,生成该第一消息验证码。In this embodiment of the present application, the input parameters of the first message verification code include at least one of the following: security capability information of the first terminal device, security policy information of the first terminal device, user information of the user to which the first terminal device belongs. information, the information of the user to which the relay device belongs, the first random number, the second temporary public key, and the M bits. That is, the first terminal device can be based on the security capability information of the first terminal device, the security policy information of the first terminal device, the first random number, the second temporary public key, the M bits, and the At least one of the signature of the first terminal device and the signature of the relay device generates the first message verification code.
在本申请实施例中,第一终端设备生成的第一随机数、第一密钥和第二终端设备生成的第二随机数用于派生第二密钥。也即,第一终端设备至少根据第一随机数、第一密钥和第二随机数派生第二密钥,以及第一终端设备可以基于第二密钥派生完整性保护密钥和/或机密性保护密钥,从而第一终端设备可以基于完整性保护密钥和/或机密性保护密钥对发送的消息进行安全保护。同理,第二终端设备至少根据第一随机数、第一密钥和第二随机数派生第二密钥,以及第二终端设备可以基于第二密钥派生完整性保护密钥和/或机密性保护密钥,从而第二终端设备可以基于完整性保护密钥和/或机密性保护密钥对发送的消息进行安全保护。In this embodiment of the present application, the first random number and the first key generated by the first terminal device and the second random number generated by the second terminal device are used to derive the second key. That is, the first terminal device derives the second key based on at least the first random number, the first key and the second random number, and the first terminal device can derive the integrity protection key and/or the secret based on the second key. The first terminal device can securely protect the sent message based on the integrity protection key and/or the confidentiality protection key. Similarly, the second terminal device may derive the second key based on at least the first random number, the first key and the second random number, and the second terminal device may derive the integrity protection key and/or the secret based on the second key. The second terminal device can securely protect the sent message based on the integrity protection key and/or the confidentiality protection key.
在一些实施例中,该第一终端设备的签名由该第一终端设备的秘密签名密钥生成。In some embodiments, the signature of the first terminal device is generated by the secret signature key of the first terminal device.
在一些实施例中,该中继设备的签名由该中继设备的秘密签名密钥生成。In some embodiments, the relay device's signature is generated by the relay device's secret signing key.
在一些实施例中,该第一消息为认证响应消息,或者,该第一消息为安全模式命令消息。In some embodiments, the first message is an authentication response message, or the first message is a safe mode command message.
在一些实施例中,该第一终端设备的安全能力信息可以是该第一终端设备支持的密码算法列表。In some embodiments, the security capability information of the first terminal device may be a list of cryptographic algorithms supported by the first terminal device.
在一些实施例中,该第一终端设备的安全策略信息可以是该第一终端设备是否支持机密性保护或完整性保护。其中,该第一终端设备的安全策略信息包括:该第一终端设备在控制面的安全策略信息,和/或,该第一终端设备在用户面的安全策略信息。In some embodiments, the security policy information of the first terminal device may be whether the first terminal device supports confidentiality protection or integrity protection. The security policy information of the first terminal device includes: the security policy information of the first terminal device on the control plane, and/or the security policy information of the first terminal device on the user plane.
在一些实施例中,该M个比特位可以是该第一密钥的标识的最高M个比特位,该N个比特位可以是该第一密钥的标识的最低N个比特位;或者,该M个比特位可以是该第一密钥的标识的前M个比特位,该N个比特位可以是该第一密钥的标识的后N个比特位;或者,该M个比特位可以是该第一密钥的标识的偶数位的比特位,该N个比特位可以是该第一密钥的标识的奇数位的比特位。In some embodiments, the M bits may be the highest M bits of the identity of the first key, and the N bits may be the lowest N bits of the identity of the first key; or, The M bits may be the first M bits of the identifier of the first key, and the N bits may be the last N bits of the identifier of the first key; or, the M bits may be are the even-numbered bits of the identifier of the first key, and the N bits may be the odd-numbered bits of the identifier of the first key.
在一些实施例中,M与N的取值可以相同,也可以不同,本申请对此并不限定。In some embodiments, the values of M and N may be the same or different, which is not limited by this application.
在一些实施例中,该第二终端设备分别检查该第一终端设备的KPAK和该中继设备的KPAK,在该第一终端设备的KPAK和该中继设备的KPAK有效的情况下,且基于该第一终端设备的标识和该第一终端设备的PVT对该第一终端设备的签名进行验证,以及基于该中继设备的标识和该中继设备的PVT对该中继设备的签名进行验证;In some embodiments, the second terminal device checks the KPAK of the first terminal device and the KPAK of the relay device respectively. If the KPAK of the first terminal device and the KPAK of the relay device are valid, and based on The identity of the first terminal device and the PVT of the first terminal device are used to verify the signature of the first terminal device, and the signature of the relay device is verified based on the identity of the relay device and the PVT of the relay device. ;
在该第一终端设备的签名和该中继设备的签名验证成功,且该第一消息中携带的信息未遭受篡改的情况下,该第二终端设备生成第二随机数,该第二终端设备至少根据该第一随机数、该第一密钥和该第二随机数生成该第二密钥,该第二终端设备根据该第二密钥生成完整性保护密钥和/或机密性保护密钥,以及该第二终端设备生成该第一密钥的标识的N个比特位,并将该M个比特位和该N个比特位合并得到该第一密钥的标识。When the signature of the first terminal device and the signature of the relay device are verified successfully, and the information carried in the first message has not been tampered with, the second terminal device generates a second random number, and the second terminal device generates a second random number. The second key is generated based on at least the first random number, the first key and the second random number, and the second terminal device generates an integrity protection key and/or a confidentiality protection key based on the second key. key, and the second terminal device generates N bits of the identifier of the first key, and combines the M bits and the N bits to obtain the identifier of the first key.
在一些实施例中,该第二终端设备可以根据该第一随机数、该第一密钥、该第二随机数,以及源标识、目标标识、该第一随机数的长度、该第二随机数的长度、该源标识的长度、该目标标识的长度中的至少之一,生成该第二密钥。其中,该源标识用于标识该第一终端设备与该第二终端设备之间的中继连接的源端,该目标标识用于标识该第一终端设备与该第二终端设备之间的中继连接的目标端。另外,该第二密钥的输入参数还可以包括其他系统设定参数,如3GPP指定的一个或多个固定参数。In some embodiments, the second terminal device may use the first random number, the first key, the second random number, the source identifier, the target identifier, the length of the first random number, the second random number. At least one of the length of the number, the length of the source identifier, and the length of the target identifier is used to generate the second key. Wherein, the source identifier is used to identify the source end of the relay connection between the first terminal device and the second terminal device, and the target identifier is used to identify the intermediate connection between the first terminal device and the second terminal device. The destination of the connection. In addition, the input parameters of the second key may also include other system setting parameters, such as one or more fixed parameters specified by 3GPP.
具体例如,假设该第一消息验证码的输入参数包括:该第一终端设备的安全能力信息、该第一终端设备的安全策略信息、该第一随机数、该第二临时公钥、该M个比特位。该第二终端设备可以基于该第一终端设备的安全能力信息、该第一终端设备的安全策略信息、该第一随机数、该第二临时公钥、该M个比特位生成第一消息验证码,并与该第一消息中包含的该第一消息验证码进行比较,若 比较一致的情况下,该第一消息验证码有效。For example, assume that the input parameters of the first message verification code include: the security capability information of the first terminal device, the security policy information of the first terminal device, the first random number, the second temporary public key, the M bits. The second terminal device may generate a first message verification based on the security capability information of the first terminal device, the security policy information of the first terminal device, the first random number, the second temporary public key, and the M bits. code and compare it with the first message verification code contained in the first message. If they are consistent, the first message verification code is valid.
在一些实施例中,在该第一消息验证码有效的情况下,该第二终端设备通过该中继设备向该第一终端设备发送第二消息;其中,该第二消息包括以下至少之一:该第二随机数,该N个比特位,该第二终端设备生成的该第二密钥的标识的x个比特位,该第二终端设备选取的安全算法,该第二终端设备选取的安全策略,第二消息验证码;In some embodiments, when the first message verification code is valid, the second terminal device sends a second message to the first terminal device through the relay device; wherein the second message includes at least one of the following : the second random number, the N bits, the x bits of the identifier of the second key generated by the second terminal device, the security algorithm selected by the second terminal device, the Security policy, second message verification code;
其中,该第二消息通过基于该第二密钥生成的该第二消息验证码进行完整性保护,或者,该第二消息通过基于该第二密钥派生的完整性保护密钥生成的该第二消息验证码进行完整性保护,且该第二消息验证码的输入参数包括以下至少之一:该第二随机数,该N个比特位,该x个比特位,该第二终端设备选取的安全算法,该第二终端设备选取的安全策略;Wherein, the second message is integrity protected through the second message verification code generated based on the second key, or the second message is integrity protected through the third integrity protection key generated based on the second key. The second message verification code performs integrity protection, and the input parameters of the second message verification code include at least one of the following: the second random number, the N bits, the x bits, and the second terminal device selected Security algorithm, the security policy selected by the second terminal device;
其中,该第二密钥的标识由该x个比特位与该第二密钥的标识的另外y个比特位合并得到,x和y均为正整数。Wherein, the identifier of the second key is obtained by combining the x bits and the other y bits of the identifier of the second key, and both x and y are positive integers.
具体例如,假设该第二消息验证码的输入参数包括:该第二随机数、该N个比特位、该x个比特位、该第二终端设备选取的安全算法、该第二终端设备选取的安全策略。该第一终端设备可以基于该第二随机数、该N个比特位、该x个比特位、该第二终端设备选取的安全算法、该第二终端设备选取的安全策略生成第二消息验证码,并与该第二消息中包含的该第二消息验证码进行比较,若比较一致的情况下,该第二消息验证码有效。For example, assume that the input parameters of the second message verification code include: the second random number, the N bits, the x bits, the security algorithm selected by the second terminal device, the security strategy. The first terminal device may generate a second message verification code based on the second random number, the N bits, the x bits, the security algorithm selected by the second terminal device, and the security policy selected by the second terminal device. , and compared with the second message verification code contained in the second message. If they are consistent, the second message verification code is valid.
在一些实施例中,该x个比特位可以是该第二密钥的标识的最高x个比特位,该y个比特位可以是该第二密钥的标识的最低y个比特位;或者,该x个比特位可以是该第二密钥的标识的前x个比特位,该y个比特位可以是该第二密钥的标识的后y个比特位;或者,该x个比特位可以是该第二密钥的标识的偶数位的比特位,该y个比特位可以是该第二密钥的标识的奇数位的比特位。In some embodiments, the x bits may be the highest x bits of the identity of the second key, and the y bits may be the lowest y bits of the identity of the second key; or, The x bits may be the first x bits of the identifier of the second key, and the y bits may be the last y bits of the identifier of the second key; or, the x bits may be are the even-numbered bits of the identifier of the second key, and the y bits may be the odd-numbered bits of the identifier of the second key.
在一些实施例中,x与y的取值可以相同,也可以不同,本申请对此并不限定。In some embodiments, the values of x and y may be the same or different, which is not limited by this application.
在一些实施例中,该第二消息通过该第一密钥进行加密。当然,该第二消息也可以不通过该第一密钥进行加密,或者,该第二消息也可以不加密。In some embodiments, the second message is encrypted with the first key. Of course, the second message may not be encrypted using the first key, or the second message may not be encrypted.
具体的,该第二终端设备可以基于该第一终端设备的安全能力信息选取安全算法,和/或,该第二终端设备可以基于该第一终端设备的安全策略信息选取安全策略。Specifically, the second terminal device may select a security algorithm based on the security capability information of the first terminal device, and/or the second terminal device may select a security policy based on the security policy information of the first terminal device.
在一些实施例中,该第一消息为认证响应消息,该第二消息为安全模式命令(SMC)消息。In some embodiments, the first message is an authentication response message and the second message is a secure mode command (SMC) message.
在一些实施例中,该第一消息为安全模式命令(SMC)消息,该第二消息为安全模式响应消息。In some embodiments, the first message is a safe mode command (SMC) message and the second message is a safe mode response message.
具体的,在本申请实施例中,第一终端设备可以根据第二终端设备生成的第一临时公钥、中继设备的相关信息和第一终端设备生成的第二临时私钥派生第一密钥。相应的,第二终端设备可以根据第一终端设备生成的第二临时公钥、中继设备的相关信息和第二终端设备生成的第一临时私钥派生第一密钥。其中,第二终端设备生成的第一临时公钥与第二终端设备生成的第一临时私钥配对,第一终端设备生成的第二临时公钥与第一终端设备生成的第二临时私钥配对。Specifically, in this embodiment of the present application, the first terminal device may derive the first secret key based on the first temporary public key generated by the second terminal device, the relevant information of the relay device, and the second temporary private key generated by the first terminal device. key. Correspondingly, the second terminal device may derive the first key based on the second temporary public key generated by the first terminal device, the relevant information of the relay device, and the first temporary private key generated by the second terminal device. Wherein, the first temporary public key generated by the second terminal device is paired with the first temporary private key generated by the second terminal device, and the second temporary public key generated by the first terminal device is paired with the second temporary private key generated by the first terminal device. pair.
具体例如,第一终端设备可以根据第一临时公钥、中继设备的相关信息和第二临时私钥,并使用ECIES算法计算出第一密钥;第二终端设备可以根据第二临时公钥、中继设备的相关信息和第一临时私钥,并使用ECIES算法计算出第一密钥。For example, the first terminal device can calculate the first key based on the first temporary public key, relevant information of the relay device, and the second temporary private key using the ECIES algorithm; the second terminal device can calculate the first key based on the second temporary public key. , the relevant information of the relay device and the first temporary private key, and use the ECIES algorithm to calculate the first key.
在一些实施例中,该第二终端设备接收该第一终端设备通过该中继设备发送的第三消息;In some embodiments, the second terminal device receives the third message sent by the first terminal device through the relay device;
其中,该第三消息用于指示安全模式建立完成,该第三消息通过目标密钥进行加密,且该第三消息包括以下至少之一:该第一终端设备生成的该第二密钥的标识的y个比特位,第三消息验证码;Wherein, the third message is used to indicate that the security mode establishment is completed, the third message is encrypted by the target key, and the third message includes at least one of the following: the identification of the second key generated by the first terminal device y bits, the third message verification code;
其中,该目标密钥包括以下之一:该第一密钥,该第二密钥,该第二密钥派生的机密性保护密钥;Wherein, the target key includes one of the following: the first key, the second key, and a confidentiality protected key derived from the second key;
其中,该第三消息通过基于该第二密钥生成的该第三消息验证码进行完整性保护,或者,该第三消息通过基于该第二密钥派生的完整性保护密钥生成的该第三消息验证码进行完整性保护,该第三消息验证码的输入参数包括该y个比特位。Wherein, the third message is integrity protected through the third message verification code generated based on the second key, or the third message is integrity protected through the third message verification code generated based on the integrity protection key derived based on the second key. The three-message verification code performs integrity protection, and the input parameters of the third message verification code include the y bits.
在一些实施例中,该第二终端设备通过该目标密钥对该第三消息进行解密;在该第三消息中携带的信息未遭受篡改的情况下,且该第三消息验证码有效的情况下,该第二终端设备将该x个比特位与该y个比特位合并得到该第二密钥的标识。In some embodiments, the second terminal device decrypts the third message using the target key; provided that the information carried in the third message has not been tampered with and the third message verification code is valid. Next, the second terminal device combines the x bits and the y bits to obtain the identity of the second key.
具体的,该第二终端设备可以基于该y个比特位生成第三消息验证码,并与该第三消息中包含的该第三消息验证码进行比较,若比较一致的情况下,该第三消息验证码有效。Specifically, the second terminal device can generate a third message verification code based on the y bits, and compare it with the third message verification code contained in the third message. If the comparison is consistent, the third message verification code The message verification code is valid.
具体例如,该第三消息为安全模式结束消息(security mode complete)。For example, the third message is a security mode complete message (security mode complete).
在一些实施例中,该第二终端设备通过该中继设备向该第一终端设备发送错误消息;其中,该错误消息包括以下至少之一:原因信息,第四消息验证码;其中,该原因信息用于指示该第二终端设备与该第一终端设备的安全策略冲突,或者,该原因信息用于指示该第一消息验证码验证失败,或者,该原因信息用于指示该第二终端设备与该第一终端设备的安全算法协商失败,该第四消息验证码的输 入参数包括以下至少之一:该原因信息。In some embodiments, the second terminal device sends an error message to the first terminal device through the relay device; wherein the error message includes at least one of the following: cause information, a fourth message verification code; wherein the cause The information is used to indicate that the security policy of the second terminal device conflicts with the first terminal device, or the reason information is used to indicate that the first message verification code verification fails, or the reason information is used to indicate that the second terminal device The security algorithm negotiation with the first terminal device fails, and the input parameters of the fourth message verification code include at least one of the following: the reason information.
具体的,对于该第一终端设备,在该第四消息验证码有效的情况下,该第一终端设备确定安全模式建立失败,和/或,该第一终端设备重新发起安全模式建立流程。Specifically, for the first terminal device, if the fourth message verification code is valid, the first terminal device determines that the security mode establishment fails, and/or the first terminal device re-initiates the security mode establishment process.
在一些实施例中,该错误消息也可以受完整性保护。In some embodiments, the error message may also be integrity protected.
具体例如,该原因信息用于指示该第二终端设备与该第一终端设备的安全策略冲突,例如,该第二终端设备不支持该第一消息中携带的该第一终端设备的安全策略信息。Specifically, for example, the cause information is used to indicate that the security policy of the second terminal device conflicts with the first terminal device. For example, the second terminal device does not support the security policy information of the first terminal device carried in the first message. .
具体例如,该原因信息用于指示该第二终端设备与该第一终端设备的安全算法协商失败,例如,该第二终端设备不支持该第一消息中携带的该第一终端设备的安全能力信息。Specifically, for example, the cause information is used to indicate that the security algorithm negotiation between the second terminal device and the first terminal device failed. For example, the second terminal device does not support the security capabilities of the first terminal device carried in the first message. information.
在一些实施例中,该第一密钥可以是K D,该第一密钥的标识可以是K D ID;该第二密钥可以是K D-SESS,该第二密钥的标识可以是K D-SESS ID。 In some embodiments, the first key may be K D , and the identifier of the first key may be K D ID ; the second key may be K D -SESS , and the identifier of the second key may be K D-SESS ID.
在一些实施例中,该完整性保护密钥包括控制面的完整性保护密钥(K D-CPint)和用户面的完整性保护密钥(K D-UPint);和/或,该机密性保护密钥包括控制面的机密性保护密钥(K D-CPenc)和用户面的机密性保护密钥(K D-UPenc)。 In some embodiments, the integrity protection key includes an integrity protection key for the control plane (KD -CPint ) and an integrity protection key for the user plane ( KD-UPint ); and/or the confidentiality The protection keys include a confidentiality protection key for the control plane (K D-CPenc ) and a confidentiality protection key for the user plane (K D-UPenc ).
因此,在本申请实施例中,第一随机数、第一密钥和第二终端设备生成的第二随机数用于派生第二密钥,第二密钥用于派生完整性保护密钥和/或机密性保护密钥,能够保证第一终端设备和第二终端设备的身份安全与通信数据的机密性与完整性,从而确保双方传输数据的机密性和完整性,防止其他设备甚至中继设备的窃听。Therefore, in this embodiment of the present application, the first random number, the first key and the second random number generated by the second terminal device are used to derive the second key, and the second key is used to derive the integrity protection key and /or confidentiality protection key, which can ensure the identity security of the first terminal device and the second terminal device and the confidentiality and integrity of the communication data, thereby ensuring the confidentiality and integrity of the data transmitted by both parties and preventing other devices from even relaying Device eavesdropping.
本申请实施例适用于5G L2 UE-to-UE relay架构下第一终端设备(源设备)和第二终端设备(目标设备)之间的安全通信建立流程。借助公钥签名技术,能够确保终端设备的身份真实性和消息不可否认性,能够抗重放攻击、中间人攻击、伪装等多种主动攻击,同时保证认证流程消息的完整性,并且利用3GPP标准中使用的ECIES算法,从而建立了源UE和目标UE之间的端到端安全,确保双方传输数据的机密性和完整性,防止外部敌手甚至中继(relay)的窃听;本申请实施例保证了安全通信建立机制的可扩展性,另外,本申请实施例能够实现源UE和目标UE之间用户面和控制面安全策略、以及双方所支持加密和完整性保护算法的安全协商,能够实现完整性保护,抵抗篡改和降级攻击。The embodiment of this application is suitable for the secure communication establishment process between the first terminal device (source device) and the second terminal device (target device) under the 5G L2 UE-to-UE relay architecture. With the help of public key signature technology, it can ensure the identity authenticity of the terminal device and the non-repudiation of the message, and can resist replay attacks, man-in-the-middle attacks, disguise and other active attacks, while ensuring the integrity of the authentication process messages, and using the 3GPP standard The ECIES algorithm is used to establish end-to-end security between the source UE and the target UE, ensuring the confidentiality and integrity of the data transmitted by both parties, and preventing eavesdropping by external adversaries and even relays; the embodiment of this application ensures The scalability of the secure communication establishment mechanism. In addition, the embodiments of this application can realize the security negotiation of the user plane and control plane security policies between the source UE and the target UE, as well as the encryption and integrity protection algorithms supported by both parties, and can achieve integrity. Protect against tampering and downgrade attacks.
上文结合图7至图9,详细描述了本申请的第一终端设备侧实施例和第二终端设备侧实施例,下文结合图10,详细描述本申请的中继设备侧实施例,应理解,中继设备侧实施例与第一终端设备侧实施例和第二终端设备侧实施例相互对应,类似的描述可以参照第一终端设备侧实施例和第二终端设备侧实施例。The first terminal device side embodiment and the second terminal device side embodiment of the present application are described in detail above with reference to Figures 7 to 9. Hereinafter, the relay device side embodiment of the present application is described in detail with reference to Figure 10. It should be understood that , the relay device side embodiment corresponds to the first terminal device side embodiment and the second terminal device side embodiment. Similar descriptions can be made with reference to the first terminal device side embodiment and the second terminal device side embodiment.
图10是根据本申请实施例的中继通信的方法400的示意性流程图,如图10所示,该中继通信的方法400可以包括如下内容中的至少部分内容:Figure 10 is a schematic flowchart of a method 400 for relaying communication according to an embodiment of the present application. As shown in Figure 10, the method 400 for relaying communication may include at least part of the following content:
S410,中继设备接收第二终端设备发送的认证请求消息;其中,该认证请求消息包括以下至少之一:该第二终端设备所属用户的信息,该第二终端设备生成的第一临时公钥,该第二终端设备的签名;其中,该第二终端设备所属用户的信息包括该第二终端设备的标识和该第二终端设备的PVT和KPAK;该第二终端设备的签名的输入参数包括以下至少之一:该第二终端设备所属用户的信息和该第一临时公钥;S410. The relay device receives the authentication request message sent by the second terminal device; wherein the authentication request message includes at least one of the following: information about the user to which the second terminal device belongs, and the first temporary public key generated by the second terminal device. , the signature of the second terminal device; wherein the information of the user to which the second terminal device belongs includes the identification of the second terminal device and the PVT and KPAK of the second terminal device; the input parameters of the signature of the second terminal device include At least one of the following: information about the user to which the second terminal device belongs and the first temporary public key;
S420,在该第二终端设备的KPAK有效,且基于该第二终端设备的标识和该第二终端设备的PVT对该第二终端设备的签名验证成功的情况下,该中继设备向第一终端设备发送验证之后的认证请求消息;其中,该验证之后的认证请求消息包括以下至少之一:该第二终端设备所属用户的信息,该中继设备所属用户的信息,该第一临时公钥,该第二终端设备的签名,该中继设备的签名,该中继设备的相关信息;其中,该中继设备所属用户的信息包括该中继设备的标识和该中继设备的PVT和KPAK;该中继设备的签名的输入参数包括以下至少之一:该第二终端设备的签名和该中继设备所属用户的信息;其中,该第一临时公钥和该中继设备的相关信息用于该第一终端设备派生第一密钥;该中继设备的相关信息包括以下之一:该中继设备的身份信息,该中继设备生成的随机数,该中继设备生成的计数器。S420: When the KPAK of the second terminal device is valid and the signature verification of the second terminal device based on the identifier of the second terminal device and the PVT of the second terminal device is successful, the relay device sends a request to the first terminal device. The terminal device sends an authentication request message after verification; wherein the authentication request message after verification includes at least one of the following: information about the user to which the second terminal device belongs, information about the user to which the relay device belongs, and the first temporary public key. , the signature of the second terminal device, the signature of the relay device, and the relevant information of the relay device; wherein the information of the user to which the relay device belongs includes the identification of the relay device and the PVT and KPAK of the relay device. ; The input parameters of the relay device's signature include at least one of the following: the signature of the second terminal device and the information of the user to which the relay device belongs; wherein, the first temporary public key and the relevant information of the relay device are used The first key is derived from the first terminal device; the relevant information of the relay device includes one of the following: the identity information of the relay device, the random number generated by the relay device, and the counter generated by the relay device.
本实施例基于ECCSI签名方案,建立L2架构下的UE-to-UE中继场景下的安全连接。具体的,本申请实施例应用于L2架构下的UE-to-UE中继场景,也即,第一终端设备与第二终端设备之间通过中继设备进行通信。例如,第一终端设备与第二终端设备之间的中继连接可以是PC5链路。This embodiment is based on the ECCSI signature scheme to establish a secure connection in the UE-to-UE relay scenario under the L2 architecture. Specifically, the embodiments of this application are applied to the UE-to-UE relay scenario under the L2 architecture, that is, the first terminal device and the second terminal device communicate through the relay device. For example, the relay connection between the first terminal device and the second terminal device may be a PC5 link.
在本申请实施例中,该第一终端设备可以是源设备或源终端,该第二终端设备可以是目标设备或目标终端。该中继设备可以是中继终端。In this embodiment of the present application, the first terminal device may be a source device or a source terminal, and the second terminal device may be a target device or a target terminal. The relay device may be a relay terminal.
在本申请实施例中,该第二终端设备的签名的输入参数包括以下至少之一:该第二终端设备所属用户的信息和该第一临时公钥。也即,该第二终端设备可以基于该第二终端设备所属用户的信息和该第一临时公钥中的至少之一,生成该第二终端设备的签名。In this embodiment of the present application, the input parameters of the signature of the second terminal device include at least one of the following: information of the user to which the second terminal device belongs and the first temporary public key. That is, the second terminal device may generate a signature of the second terminal device based on at least one of the information of the user to which the second terminal device belongs and the first temporary public key.
在本申请实施例中,该中继设备的签名的输入参数包括以下至少之一:该第二终端设备的签名和该中继设备所属用户的信息。也即,该中继设备可以基于该第二终端设备的签名和该中继设备所属用户的信息中的至少之一,生成该中继设备的签名。In this embodiment of the present application, the input parameters of the relay device's signature include at least one of the following: the signature of the second terminal device and the information of the user to which the relay device belongs. That is, the relay device may generate the signature of the relay device based on at least one of the signature of the second terminal device and the information of the user to which the relay device belongs.
具体的,该中继设备可以基于其本地存储的一个或多个KPAK,验证该第二终端设备的KPAK的有效性。例如,在中继设备本地存储的KPAK中存在与第二终端设备的KPAK一致的KPAK的情况下,该第二终端设备的KPAK有效。可选地,该第一终端设备本地存储的一个或多个KPAK可以由KMS预配置。Specifically, the relay device may verify the validity of the KPAK of the second terminal device based on one or more KPAKs stored locally. For example, if there is a KPAK consistent with the KPAK of the second terminal device among the KPAKs stored locally on the relay device, the KPAK of the second terminal device is valid. Optionally, one or more KPAKs stored locally on the first terminal device may be preconfigured by the KMS.
在本申请实施例中,第一终端设备可以根据第二终端设备生成的第一临时公钥、中继设备的相关信息和第一终端设备生成的第二临时私钥派生第一密钥。相应的,第二终端设备可以根据第一终端设备生成的第二临时公钥、中继设备的相关信息和第二终端设备生成的第一临时私钥派生第一密钥。其中,第二终端设备生成的第一临时公钥与第二终端设备生成的第一临时私钥配对,第一终端设备生成的第二临时公钥与第一终端设备生成的第二临时私钥配对。In this embodiment of the present application, the first terminal device may derive the first key based on the first temporary public key generated by the second terminal device, relevant information of the relay device, and the second temporary private key generated by the first terminal device. Correspondingly, the second terminal device may derive the first key based on the second temporary public key generated by the first terminal device, the relevant information of the relay device, and the first temporary private key generated by the second terminal device. Wherein, the first temporary public key generated by the second terminal device is paired with the first temporary private key generated by the second terminal device, and the second temporary public key generated by the first terminal device is paired with the second temporary private key generated by the first terminal device. pair.
具体例如,第一终端设备可以根据第一临时公钥和第二临时私钥,并使用ECIES算法计算出第一密钥;第二终端设备可以根据第二临时公钥和第一临时私钥,并使用ECIES算法计算出第一密钥。For example, the first terminal device can calculate the first key based on the first temporary public key and the second temporary private key and use the ECIES algorithm; the second terminal device can calculate the first key based on the second temporary public key and the first temporary private key. And use the ECIES algorithm to calculate the first key.
在一些实施例中,在该第二终端设备所属用户的信息包括该第二终端设备的标识和该第二终端设备的PVT和KPAK的情况下,该第二终端设备的签名由该第二终端设备的秘密签名密钥(SSK)生成。可选地,该第二终端设备的PVT和KPAK、以及秘密签名密钥(SSK)可以是可信中心KMS通过安全通道为该第二终端设备预先配置的。该安全通道可以基于AKMA机制或者GBA机制来建立该第二终端设备与KMS的安全连接,该KMS可以直接由运营商来负责管理或者是与运营商有商业关系的第三方服务提供商。In some embodiments, when the information of the user to which the second terminal device belongs includes the identification of the second terminal device and the PVT and KPAK of the second terminal device, the signature of the second terminal device is determined by the second terminal device. The device's Secret Signing Key (SSK) is generated. Optionally, the PVT, KPAK, and secret signature key (SSK) of the second terminal device may be pre-configured by the trusted center KMS for the second terminal device through a secure channel. The secure channel may be based on the AKMA mechanism or the GBA mechanism to establish a secure connection between the second terminal device and the KMS. The KMS may be directly managed by the operator or be a third-party service provider that has a commercial relationship with the operator.
在一些实施例中,在该中继设备所属用户的信息包括该中继设备的标识、该中继设备的PVT和KPAK的情况下,该中继设备的签名由该中继设备的秘密签名密钥(SSK)生成。可选地,该中继设备的PVT和KPAK、以及秘密签名密钥(SSK)可以是可信中心KMS通过安全通道为该中继设备预先配置的。该安全通道可以基于AKMA机制或者GBA机制来建立该中继设备与KMS的安全连接,该KMS可以直接由运营商来负责管理或者是与运营商有商业关系的第三方服务提供商。In some embodiments, when the information about the user of the relay device includes the identity of the relay device, the PVT and KPAK of the relay device, the signature of the relay device is encrypted by the secret signature of the relay device. Key (SSK) is generated. Optionally, the PVT, KPAK, and secret signature key (SSK) of the relay device may be pre-configured for the relay device by the trusted center KMS through a secure channel. The secure channel can be based on the AKMA mechanism or the GBA mechanism to establish a secure connection between the relay device and the KMS. The KMS can be directly managed by the operator or a third-party service provider that has a commercial relationship with the operator.
在一些实施例中,该中继设备接收该第一终端设备发送的第一消息;In some embodiments, the relay device receives the first message sent by the first terminal device;
其中,该第一消息包括以下至少之一:该第一终端设备的安全能力信息,该第一终端设备的安全策略信息,该第一终端设备所属用户的信息,该第一终端设备生成的第一随机数,该第一终端设备生成的第二临时公钥,该第一终端设备生成的该第一密钥的标识的M个比特位,该第一终端设备的签名,第一消息验证码;Wherein, the first message includes at least one of the following: security capability information of the first terminal device, security policy information of the first terminal device, information of the user to which the first terminal device belongs, a third message generated by the first terminal device. A random number, the second temporary public key generated by the first terminal device, M bits of the identification of the first key generated by the first terminal device, the signature of the first terminal device, and the first message verification code ;
其中,该第一终端设备所属用户的信息包括该第一终端设备的标识和该第一终端设备的PVT和KPAK;该第一终端设备的签名的输入参数包括以下至少之一:该第一终端设备所属用户的信息,该第二临时公钥,该第一密钥的标识的M个比特位,该第二终端设备的签名;Wherein, the information of the user to which the first terminal device belongs includes the identification of the first terminal device and the PVT and KPAK of the first terminal device; the input parameters of the signature of the first terminal device include at least one of the following: the first terminal Information about the user to whom the device belongs, the second temporary public key, M bits of the identification of the first key, and the signature of the second terminal device;
其中,该第一消息通过基于该第一密钥生成的该第一消息验证码进行完整性保护,且该第一消息验证码的输入参数包括以下至少之一:该第一终端设备的安全能力信息,该第一终端设备的安全策略信息,该第一终端设备所属用户的信息,该第一随机数,该第二临时公钥,该M个比特位,该第一终端设备的签名;Wherein, the first message is integrity protected by the first message verification code generated based on the first key, and the input parameters of the first message verification code include at least one of the following: the security capability of the first terminal device Information, the security policy information of the first terminal device, the information of the user to which the first terminal device belongs, the first random number, the second temporary public key, the M bits, and the signature of the first terminal device;
其中,该第二临时公钥和该中继设备的相关信息用于该第二终端设备派生该第一密钥,该第一随机数、该第一密钥和该第二终端设备生成的第二随机数用于派生第二密钥,该第二密钥用于派生完整性保护密钥和/或机密性保护密钥,该第一密钥的标识由该M个比特位与该第一密钥的标识的另外N个比特位合并得到,M和N均为正整数。Wherein, the second temporary public key and the relevant information of the relay device are used by the second terminal device to derive the first key, the first random number, the first key and the third key generated by the second terminal device. Two random numbers are used to derive a second key. The second key is used to derive an integrity protection key and/or a confidentiality protection key. The identity of the first key is composed of the M bits and the first The other N bits of the key's identifier are combined, and M and N are both positive integers.
具体的,在该第一终端设备的KPAK有效,且基于该第一终端设备的标识和该第一终端设备的PVT对该第一终端设备的签名验证成功的情况下,该中继设备向该第二终端设备发送验证之后的第一消息;其中,该验证之后的第一消息包括以下至少之一:该第一终端设备的安全能力信息,该第一终端设备的安全策略信息,该第一终端设备所属用户的信息,该中继设备所属用户的信息,该第一终端设备生成的第一随机数,该第一终端设备生成的与该第二临时私钥配对的第二临时公钥,该第一终端设备生成的该第一密钥的标识的M个比特位,该第一终端设备的签名,该中继设备的签名,第一消息验证码;其中,该中继设备所属用户的信息包括该中继设备的标识和该中继设备的PVT和KPAK;该中继设备的签名的输入参数包括以下至少之一:该中继设备所属用户的信息,该第一终端设备的签名,该第二终端设备的签名,该验证之后的第一消息;Specifically, when the KPAK of the first terminal device is valid and the signature verification of the first terminal device based on the identity of the first terminal device and the PVT of the first terminal device is successful, the relay device sends a message to the first terminal device. The second terminal device sends the first message after verification; wherein the first message after verification includes at least one of the following: security capability information of the first terminal device, security policy information of the first terminal device, Information about the user to whom the terminal device belongs, information about the user to whom the relay device belongs, the first random number generated by the first terminal device, the second temporary public key generated by the first terminal device and paired with the second temporary private key, M bits of the identification of the first key generated by the first terminal device, the signature of the first terminal device, the signature of the relay device, and the first message verification code; wherein, the user to whom the relay device belongs The information includes the identification of the relay device and the PVT and KPAK of the relay device; the input parameters of the signature of the relay device include at least one of the following: information of the user to which the relay device belongs, the signature of the first terminal device, The signature of the second terminal device, the first message after the verification;
在本申请实施例中,第一终端设备生成的第一随机数、第一密钥和第二终端设备生成的第二随机数用于派生第二密钥。也即,第一终端设备至少根据第一随机数、第一密钥和第二随机数派生第二密 钥,以及第一终端设备可以基于第二密钥派生完整性保护密钥和/或机密性保护密钥,从而第一终端设备可以基于完整性保护密钥和/或机密性保护密钥对发送的消息进行安全保护。同理,第二终端设备至少根据第一随机数、第一密钥和第二随机数派生第二密钥,以及第二终端设备可以基于第二密钥派生完整性保护密钥和/或机密性保护密钥,从而第二终端设备可以基于完整性保护密钥和/或机密性保护密钥对发送的消息进行安全保护。In this embodiment of the present application, the first random number and the first key generated by the first terminal device and the second random number generated by the second terminal device are used to derive the second key. That is, the first terminal device derives the second key based on at least the first random number, the first key and the second random number, and the first terminal device can derive the integrity protection key and/or the secret based on the second key. The first terminal device can securely protect the sent message based on the integrity protection key and/or the confidentiality protection key. Similarly, the second terminal device may derive the second key based on at least the first random number, the first key and the second random number, and the second terminal device may derive the integrity protection key and/or the secret based on the second key. The second terminal device can securely protect the sent message based on the integrity protection key and/or the confidentiality protection key.
在本申请实施例中,该第一消息验证码的输入参数包括以下至少之一:该第一终端设备的安全能力信息,该第一终端设备的安全策略信息,该第一随机数,该第二临时公钥,该M个比特位。也即,该第一终端设备可以基于该第一终端设备的安全能力信息、该第一终端设备的安全策略信息、该第一随机数、该第二临时公钥、该M个比特位中的至少之一,生成该第一消息验证码。In this embodiment of the present application, the input parameters of the first message verification code include at least one of the following: security capability information of the first terminal device, security policy information of the first terminal device, the first random number, the third 2. Temporary public key, the M bits. That is, the first terminal device can be based on the security capability information of the first terminal device, the security policy information of the first terminal device, the first random number, the second temporary public key, and the M bits. At least one of them generates the first message verification code.
具体例如,假设该第一消息验证码的输入参数包括:该第一终端设备的安全能力信息、该第一终端设备的安全策略信息、该第一随机数、该第二临时公钥、该M个比特位。该第二终端设备可以基于该第一终端设备的安全能力信息、该第一终端设备的安全策略信息、该第一随机数、该第二临时公钥、该M个比特位生成第一消息验证码,并与该第一消息中包含的该第一消息验证码进行比较,若比较一致的情况下,该第一消息验证码有效。For example, assume that the input parameters of the first message verification code include: the security capability information of the first terminal device, the security policy information of the first terminal device, the first random number, the second temporary public key, the M bits. The second terminal device may generate a first message verification based on the security capability information of the first terminal device, the security policy information of the first terminal device, the first random number, the second temporary public key, and the M bits. code and compare it with the first message verification code contained in the first message. If they are consistent, the first message verification code is valid.
在一些实施例中,该第一消息为认证响应消息,或者,该第一消息为安全模式命令消息。In some embodiments, the first message is an authentication response message, or the first message is a safe mode command message.
在一些实施例中,该第一终端设备的安全能力信息可以是该第一终端设备支持的密码算法列表。In some embodiments, the security capability information of the first terminal device may be a list of cryptographic algorithms supported by the first terminal device.
在一些实施例中,该第一终端设备的安全策略信息可以是该第一终端设备是否支持机密性保护或完整性保护。其中,该第一终端设备的安全策略信息包括:该第一终端设备在控制面的安全策略信息,和/或,该第一终端设备在用户面的安全策略信息。In some embodiments, the security policy information of the first terminal device may be whether the first terminal device supports confidentiality protection or integrity protection. The security policy information of the first terminal device includes: the security policy information of the first terminal device on the control plane, and/or the security policy information of the first terminal device on the user plane.
在一些实施例中,该M个比特位可以是该第一密钥的标识的最高M个比特位,该N个比特位可以是该第一密钥的标识的最低N个比特位;或者,该M个比特位可以是该第一密钥的标识的前M个比特位,该N个比特位可以是该第一密钥的标识的后N个比特位;或者,该M个比特位可以是该第一密钥的标识的偶数位的比特位,该N个比特位可以是该第一密钥的标识的奇数位的比特位。In some embodiments, the M bits may be the highest M bits of the identity of the first key, and the N bits may be the lowest N bits of the identity of the first key; or, The M bits may be the first M bits of the identifier of the first key, and the N bits may be the last N bits of the identifier of the first key; or, the M bits may be are the even-numbered bits of the identifier of the first key, and the N bits may be the odd-numbered bits of the identifier of the first key.
在一些实施例中,M与N的取值可以相同,也可以不同,本申请对此并不限定。In some embodiments, the values of M and N may be the same or different, which is not limited by this application.
在一些实施例中,该中继设备将该第二终端设备发送的第二消息转发至该第一终端设备;In some embodiments, the relay device forwards the second message sent by the second terminal device to the first terminal device;
其中,该第二消息包括以下至少之一:该第二终端设备生成的该第二随机数,该第二终端设备生成的该第一密钥的标识的N个比特位,该第二终端设备生成的该第二密钥的标识的x个比特位,该第二终端设备选取的安全算法,该第二终端设备选取的安全策略,第二消息验证码;Wherein, the second message includes at least one of the following: the second random number generated by the second terminal device, N bits of the identification of the first key generated by the second terminal device, x bits of the identifier of the generated second key, the security algorithm selected by the second terminal device, the security policy selected by the second terminal device, and the second message verification code;
其中,该第二消息通过基于该第二密钥生成的该第二消息验证码进行完整性保护,或者,该第二消息通过基于该第二密钥派生的完整性保护密钥生成的该第二消息验证码进行完整性保护,且该第二消息验证码的输入参数包括以下至少之一:该第二随机数,该N个比特位,该x个比特位,该第二终端设备选取的安全算法,该第二终端设备选取的安全策略;Wherein, the second message is integrity protected through the second message verification code generated based on the second key, or the second message is integrity protected through the third integrity protection key generated based on the second key. The second message verification code performs integrity protection, and the input parameters of the second message verification code include at least one of the following: the second random number, the N bits, the x bits, and the second terminal device selected Security algorithm, the security policy selected by the second terminal device;
其中,该第二密钥的标识由该x个比特位与该第二密钥的标识的另外y个比特位合并得到,x和y均为正整数。Wherein, the identifier of the second key is obtained by combining the x bits and the other y bits of the identifier of the second key, and both x and y are positive integers.
在一些实施例中,该x个比特位可以是该第二密钥的标识的最高x个比特位,该y个比特位可以是该第二密钥的标识的最低y个比特位;或者,该x个比特位可以是该第二密钥的标识的前x个比特位,该y个比特位可以是该第二密钥的标识的后y个比特位;或者,该x个比特位可以是该第二密钥的标识的偶数位的比特位,该y个比特位可以是该第二密钥的标识的奇数位的比特位。In some embodiments, the x bits may be the highest x bits of the identity of the second key, and the y bits may be the lowest y bits of the identity of the second key; or, The x bits may be the first x bits of the identifier of the second key, and the y bits may be the last y bits of the identifier of the second key; or, the x bits may be are the even-numbered bits of the identifier of the second key, and the y bits may be the odd-numbered bits of the identifier of the second key.
在一些实施例中,x与y的取值可以相同,也可以不同,本申请对此并不限定。In some embodiments, the values of x and y may be the same or different, which is not limited by this application.
具体例如,假设该第二消息验证码的输入参数包括:该第二随机数、该N个比特位、该x个比特位、该第二终端设备选取的安全算法、该第二终端设备选取的安全策略。该第一终端设备可以基于该第二随机数、该N个比特位、该x个比特位、该第二终端设备选取的安全算法、该第二终端设备选取的安全策略生成第二消息验证码,并与该第二消息中包含的该第二消息验证码进行比较,若比较一致的情况下,该第二消息验证码有效。For example, assume that the input parameters of the second message verification code include: the second random number, the N bits, the x bits, the security algorithm selected by the second terminal device, the security strategy. The first terminal device may generate a second message verification code based on the second random number, the N bits, the x bits, the security algorithm selected by the second terminal device, and the security policy selected by the second terminal device. , and compared with the second message verification code contained in the second message. If they are consistent, the second message verification code is valid.
在一些实施例中,该第二消息通过该第一密钥进行加密。当然,该第二消息也可以不通过该第一密钥进行加密,或者,该第二消息也可以不加密。In some embodiments, the second message is encrypted with the first key. Of course, the second message may not be encrypted using the first key, or the second message may not be encrypted.
具体的,该第二终端设备可以基于该第一终端设备的安全能力信息选取安全算法,和/或,该第二终端设备可以基于该第一终端设备的安全策略信息选取安全策略。Specifically, the second terminal device may select a security algorithm based on the security capability information of the first terminal device, and/or the second terminal device may select a security policy based on the security policy information of the first terminal device.
在一些实施例中,该第一终端设备可以根据该第一随机数、该第一密钥、该第二随机数,以及源标识、目标标识、该第一随机数的长度、该第二随机数的长度、该源标识的长度、该目标标识的长度中的至少之一,生成该第二密钥。以及该第二终端设备可以根据该第一随机数、该第一密钥、该第二随机数,以及源标识、目标标识、该第一随机数的长度、该第二随机数的长度、该源标识的长度、该 目标标识的长度中的至少之一,生成该第二密钥。In some embodiments, the first terminal device may use the first random number, the first key, the second random number, the source identifier, the target identifier, the length of the first random number, the second random number. At least one of the length of the number, the length of the source identifier, and the length of the target identifier is used to generate the second key. And the second terminal device can use the first random number, the first key, the second random number, the source identifier, the target identifier, the length of the first random number, the length of the second random number, the The second key is generated using at least one of the length of the source identifier and the length of the target identifier.
其中,该源标识用于标识该第一终端设备与该第二终端设备之间的中继连接的源端,该目标标识用于标识该第一终端设备与该第二终端设备之间的中继连接的目标端。另外,该第二密钥的输入参数还可以包括其他系统设定参数,如3GPP指定的一个或多个固定参数。Wherein, the source identifier is used to identify the source end of the relay connection between the first terminal device and the second terminal device, and the target identifier is used to identify the intermediate connection between the first terminal device and the second terminal device. The destination of the connection. In addition, the input parameters of the second key may also include other system setting parameters, such as one or more fixed parameters specified by 3GPP.
在一些实施例中,该第一消息为认证响应消息,该第二消息为安全模式命令(SMC)消息。In some embodiments, the first message is an authentication response message and the second message is a secure mode command (SMC) message.
在一些实施例中,该第一消息为安全模式命令(SMC)消息,该第二消息为安全模式响应消息。In some embodiments, the first message is a safe mode command (SMC) message and the second message is a safe mode response message.
在一些实施例中,该中继设备将该第一终端设备发送的第三消息转发至该第二终端设备;In some embodiments, the relay device forwards the third message sent by the first terminal device to the second terminal device;
其中,该第三消息用于指示安全模式建立完成,该第三消息通过目标密钥进行加密,且该第三消息包括以下至少之一:该第一终端设备生成的该第二密钥的标识的y个比特位,第三消息验证码;Wherein, the third message is used to indicate that the security mode establishment is completed, the third message is encrypted by the target key, and the third message includes at least one of the following: the identification of the second key generated by the first terminal device y bits, the third message verification code;
其中,该目标密钥包括以下之一:该第一密钥,该第二密钥,该第二密钥派生的机密性保护密钥;Wherein, the target key includes one of the following: the first key, the second key, and a confidentiality protected key derived from the second key;
其中,该第三消息通过基于该第二密钥生成的该第三消息验证码进行完整性保护,或者,该第三消息通过基于该第二密钥派生的完整性保护密钥生成的该第三消息验证码进行完整性保护,该第三消息验证码的输入参数包括该y个比特位。Wherein, the third message is integrity protected through the third message verification code generated based on the second key, or the third message is integrity protected through the third message verification code generated based on the integrity protection key derived based on the second key. The three-message verification code performs integrity protection, and the input parameters of the third message verification code include the y bits.
在一些实施例中,对于该第二终端设备,该第二终端设备通过该目标密钥对该第三消息进行解密;在该第三消息中携带的信息未遭受篡改的情况下,且该第三消息验证码有效的情况下,该第二终端设备将该x个比特位与该y个比特位合并得到该第二密钥的标识。In some embodiments, for the second terminal device, the second terminal device decrypts the third message using the target key; provided that the information carried in the third message has not been tampered with, and the third message When the three-message verification code is valid, the second terminal device combines the x bits and the y bits to obtain the identity of the second key.
具体的,该第二终端设备可以基于该y个比特位生成第三消息验证码,并与该第三消息中包含的该第三消息验证码进行比较,若比较一致的情况下,该第三消息验证码有效。Specifically, the second terminal device can generate a third message verification code based on the y bits, and compare it with the third message verification code contained in the third message. If the comparison is consistent, the third message verification code The message verification code is valid.
具体例如,该第三消息为安全模式结束消息(security mode complete)。For example, the third message is a security mode complete message (security mode complete).
在一些实施例中,该中继设备将该第二终端设备发送的错误消息转发至该第一终端设备;其中,该错误消息包括以下至少之一:原因信息,第四消息验证码;其中,该原因信息用于指示该第二终端设备与该第一终端设备的安全策略冲突,或者,该原因信息用于指示该第一消息验证码验证失败,或者,该原因信息用于指示该第二终端设备与该第一终端设备的安全算法协商失败,该第四消息验证码的输入参数包括以下至少之一:该原因信息。In some embodiments, the relay device forwards the error message sent by the second terminal device to the first terminal device; wherein the error message includes at least one of the following: cause information, fourth message verification code; wherein, The reason information is used to indicate that the security policy of the second terminal device conflicts with the first terminal device, or the reason information is used to indicate that the first message verification code verification fails, or the reason information is used to indicate that the second terminal device The security algorithm negotiation between the terminal device and the first terminal device fails, and the input parameters of the fourth message verification code include at least one of the following: the reason information.
具体的,在该第四消息验证码有效的情况下,该第一终端设备确定安全模式建立失败,和/或,该第一终端设备重新发起安全模式建立流程。Specifically, when the fourth message verification code is valid, the first terminal device determines that the security mode establishment fails, and/or the first terminal device re-initiates the security mode establishment process.
在一些实施例中,该错误消息也可以受完整性保护。In some embodiments, the error message may also be integrity protected.
具体例如,该原因信息用于指示该第二终端设备与该第一终端设备的安全策略冲突,例如,该第二终端设备不支持该第一消息中携带的该第一终端设备的安全策略信息。Specifically, for example, the cause information is used to indicate that the security policy of the second terminal device conflicts with the first terminal device. For example, the second terminal device does not support the security policy information of the first terminal device carried in the first message. .
具体例如,该原因信息用于指示该第二终端设备与该第一终端设备的安全算法协商失败,例如,该第二终端设备不支持该第一消息中携带的该第一终端设备的安全能力信息。Specifically, for example, the cause information is used to indicate that the security algorithm negotiation between the second terminal device and the first terminal device failed. For example, the second terminal device does not support the security capabilities of the first terminal device carried in the first message. information.
在一些实施例中,该第一密钥可以是K D,该第一密钥的标识可以是K D ID;该第二密钥可以是K D-SESS,该第二密钥的标识可以是K D-SESS ID。 In some embodiments, the first key may be K D , and the identifier of the first key may be K D ID ; the second key may be K D -SESS , and the identifier of the second key may be K D-SESS ID.
在一些实施例中,该完整性保护密钥包括控制面的完整性保护密钥(K D-CPint)和用户面的完整性保护密钥(K D-UPint);和/或,该机密性保护密钥包括控制面的机密性保护密钥(K D-CPenc)和用户面的机密性保护密钥(K D-UPenc)。 In some embodiments, the integrity protection key includes an integrity protection key for the control plane (KD -CPint ) and an integrity protection key for the user plane ( KD-UPint ); and/or the confidentiality The protection keys include a confidentiality protection key for the control plane (K D-CPenc ) and a confidentiality protection key for the user plane (K D-UPenc ).
因此,在本申请实施例中,第一随机数、第一密钥和第二终端设备生成的第二随机数用于派生第二密钥,第二密钥用于派生完整性保护密钥和/或机密性保护密钥,能够保证第一终端设备和第二终端设备的身份安全与通信数据的机密性与完整性,从而确保双方传输数据的机密性和完整性,防止其他设备甚至中继设备的窃听。Therefore, in this embodiment of the present application, the first random number, the first key and the second random number generated by the second terminal device are used to derive the second key, and the second key is used to derive the integrity protection key and /or confidentiality protection key, which can ensure the identity security of the first terminal device and the second terminal device and the confidentiality and integrity of the communication data, thereby ensuring the confidentiality and integrity of the data transmitted by both parties and preventing other devices from even relaying Device eavesdropping.
本申请实施例适用于5G L2 UE-to-UE relay架构下源设备(第一终端设备)和目标设备(第二终端设备)之间的安全通信建立流程。借助公钥签名技术,能够确保终端设备的身份真实性和消息不可否认性,能够抗重放攻击、中间人攻击、伪装等多种主动攻击,同时保证认证流程消息的完整性,并且利用3GPP标准中使用的ECIES算法,从而建立了源UE和目标UE之间的端到端安全,确保双方传输数据的机密性和完整性,防止外部敌手甚至中继(relay)的窃听;本申请实施例保证了安全通信建立机制的可扩展性,另外,本申请实施例能够实现源UE和目标UE之间用户面和控制面安全策略、以及双方所支持加密和完整性保护算法的安全协商,能够实现完整性保护,抵抗篡改和降级攻击。The embodiment of this application is suitable for the secure communication establishment process between the source device (first terminal device) and the target device (second terminal device) under the 5G L2 UE-to-UE relay architecture. With the help of public key signature technology, it can ensure the identity authenticity of the terminal device and the non-repudiation of the message, and can resist replay attacks, man-in-the-middle attacks, disguise and other active attacks, while ensuring the integrity of the authentication process messages, and using the 3GPP standard The ECIES algorithm is used to establish end-to-end security between the source UE and the target UE, ensuring the confidentiality and integrity of the data transmitted by both parties, and preventing eavesdropping by external adversaries and even relays; the embodiment of this application ensures The scalability of the secure communication establishment mechanism. In addition, the embodiments of this application can realize the security negotiation of the user plane and control plane security policies between the source UE and the target UE, as well as the encryption and integrity protection algorithms supported by both parties, and can achieve integrity. Protect against tampering and downgrade attacks.
上文结合图7至图8,详细描述了本申请的第一终端设备侧实施例,下文结合图11,详细描述本申请的第一终端设备侧的另一实施例,类似的描述可以参照第一终端设备侧实施例。The first terminal device side embodiment of the present application is described in detail above with reference to FIGS. 7 to 8 . Hereinafter, another embodiment of the first terminal device side of the present application is described in detail with reference to FIG. 11 . For similar descriptions, refer to A terminal device side embodiment.
图11是根据本申请实施例的中继通信的方法500的示意性流程图,如图11所示,该中继通信的方法500可以包括如下内容中的至少部分内容:Figure 11 is a schematic flowchart of a communication relay method 500 according to an embodiment of the present application. As shown in Figure 11, the communication relay method 500 may include at least part of the following content:
S510,第一终端设备通过中继设备向第二终端设备发送第一消息;其中,该第一消息包括以下至 少之一:该第一终端设备的安全能力信息,该第一终端设备的安全策略信息,该第一终端设备所属用户的信息,该第一终端设备生成的第一随机数,该第一终端设备生成的第二临时公钥,该第一终端设备生成的第一密钥的标识的M个比特位,该第一终端设备的签名,第一消息验证码;其中,该第一终端设备所属用户的信息包括该第一终端设备的标识和该第一终端设备的PVT和KPAK;该第一终端设备的签名的输入参数包括以下至少之一:该第一终端设备所属用户的信息,该第二临时公钥,该第一密钥的标识的M个比特位,该第二终端设备的签名;其中,该第一消息通过基于该第一密钥生成的该第一消息验证码进行完整性保护,且该第一消息验证码的输入参数包括以下至少之一:该第一终端设备的安全能力信息,该第一终端设备的安全策略信息,该第一终端设备所属用户的信息,该第一随机数,该第二临时公钥,该M个比特位,该第一终端设备的签名;其中,该第二临时公钥和该中继设备的相关信息用于该第二终端设备派生该第一密钥,该第一随机数、该第一密钥和该第二终端设备生成的第二随机数用于派生第二密钥,该第二密钥用于派生完整性保护密钥和/或机密性保护密钥,该第一密钥的标识由该M个比特位与该第一密钥的标识的另外N个比特位合并得到,M和N均为正整数;其中,该中继设备的相关信息包括以下之一:该中继设备的身份信息,该中继设备生成的随机数,该中继设备生成的计数器。S510, the first terminal device sends a first message to the second terminal device through the relay device; wherein the first message includes at least one of the following: security capability information of the first terminal device, security policy of the first terminal device Information, information about the user to which the first terminal device belongs, the first random number generated by the first terminal device, the second temporary public key generated by the first terminal device, and the identification of the first key generated by the first terminal device M bits, the signature of the first terminal device, and the first message verification code; wherein the information of the user to which the first terminal device belongs includes the identification of the first terminal device and the PVT and KPAK of the first terminal device; The input parameters of the signature of the first terminal device include at least one of the following: information of the user to which the first terminal device belongs, the second temporary public key, M bits of the identification of the first key, the second terminal Signature of the device; wherein the first message is integrity protected by the first message verification code generated based on the first key, and the input parameters of the first message verification code include at least one of the following: the first terminal The security capability information of the device, the security policy information of the first terminal device, the information of the user to which the first terminal device belongs, the first random number, the second temporary public key, the M bits, the first terminal device signature; wherein the second temporary public key and the relevant information of the relay device are used by the second terminal device to derive the first key, the first random number, the first key and the second terminal device The generated second random number is used to derive a second key, which is used to derive an integrity protection key and/or a confidentiality protection key. The identity of the first key is composed of the M bits and The other N bits of the identification of the first key are combined, and M and N are both positive integers; where the relevant information of the relay device includes one of the following: the identity information of the relay device, the relay device The random number generated by this relay device.
本实施例基于ECCSI签名方案,建立L2架构下的UE-to-UE中继场景下的安全连接。具体的,本申请实施例应用于L2架构下的UE-to-UE中继场景,也即,第一终端设备与第二终端设备之间通过中继设备进行通信。例如,第一终端设备与第二终端设备之间的中继连接可以是PC5链路。This embodiment is based on the ECCSI signature scheme to establish a secure connection in the UE-to-UE relay scenario under the L2 architecture. Specifically, the embodiments of this application are applied to the UE-to-UE relay scenario under the L2 architecture, that is, the first terminal device and the second terminal device communicate through the relay device. For example, the relay connection between the first terminal device and the second terminal device may be a PC5 link.
在本申请实施例中,第一终端设备生成的第一随机数、第一密钥和第二终端设备生成的第二随机数用于派生第二密钥。也即,第一终端设备至少根据第一随机数、第一密钥和第二随机数派生第二密钥,以及第一终端设备可以基于第二密钥派生完整性保护密钥和/或机密性保护密钥,从而第一终端设备可以基于完整性保护密钥和/或机密性保护密钥对发送的消息进行安全保护。同理,第二终端设备至少根据第一随机数、第一密钥和第二随机数派生第二密钥,以及第二终端设备可以基于第二密钥派生完整性保护密钥和/或机密性保护密钥,从而第二终端设备可以基于完整性保护密钥和/或机密性保护密钥对发送的消息进行安全保护。In this embodiment of the present application, the first random number and the first key generated by the first terminal device and the second random number generated by the second terminal device are used to derive the second key. That is, the first terminal device derives the second key based on at least the first random number, the first key and the second random number, and the first terminal device can derive the integrity protection key and/or the secret based on the second key. The first terminal device can securely protect the sent message based on the integrity protection key and/or the confidentiality protection key. Similarly, the second terminal device may derive the second key based on at least the first random number, the first key and the second random number, and the second terminal device may derive the integrity protection key and/or the secret based on the second key. The second terminal device can securely protect the sent message based on the integrity protection key and/or the confidentiality protection key.
在本申请实施例中,该第一消息验证码的输入参数包括以下至少之一:该第一终端设备的安全能力信息,该第一终端设备的安全策略信息,该第一随机数,该第二临时公钥,该M个比特位。也即,该第一终端设备可以基于该第一终端设备的安全能力信息、该第一终端设备的安全策略信息、该第一随机数、该第二临时公钥、该M个比特位中的至少之一,生成该第一消息验证码。In this embodiment of the present application, the input parameters of the first message verification code include at least one of the following: security capability information of the first terminal device, security policy information of the first terminal device, the first random number, the third 2. Temporary public key, the M bits. That is, the first terminal device can be based on the security capability information of the first terminal device, the security policy information of the first terminal device, the first random number, the second temporary public key, and the M bits. At least one of them generates the first message verification code.
具体例如,假设该第一消息验证码的输入参数包括:该第一终端设备的安全能力信息、该第一终端设备的安全策略信息、该第一随机数、该第二临时公钥、该M个比特位。该第二终端设备可以基于该第一终端设备的安全能力信息、该第一终端设备的安全策略信息、该第一随机数、该第二临时公钥、该M个比特位生成第一消息验证码,并与该第一消息中包含的该第一消息验证码进行比较,若比较一致的情况下,该第一消息验证码有效。For example, assume that the input parameters of the first message verification code include: the security capability information of the first terminal device, the security policy information of the first terminal device, the first random number, the second temporary public key, the M bits. The second terminal device may generate a first message verification based on the security capability information of the first terminal device, the security policy information of the first terminal device, the first random number, the second temporary public key, and the M bits. code and compare it with the first message verification code contained in the first message. If they are consistent, the first message verification code is valid.
在一些实施例中,该第一消息为认证响应消息,或者,该第一消息为安全模式命令消息。In some embodiments, the first message is an authentication response message, or the first message is a safe mode command message.
在一些实施例中,该第一终端设备的安全能力信息可以是该第一终端设备支持的密码算法列表。In some embodiments, the security capability information of the first terminal device may be a list of cryptographic algorithms supported by the first terminal device.
在一些实施例中,该第一终端设备的安全策略信息可以是该第一终端设备是否支持机密性保护或完整性保护。其中,该第一终端设备的安全策略信息包括:该第一终端设备在控制面的安全策略信息,和/或,该第一终端设备在用户面的安全策略信息。In some embodiments, the security policy information of the first terminal device may be whether the first terminal device supports confidentiality protection or integrity protection. The security policy information of the first terminal device includes: the security policy information of the first terminal device on the control plane, and/or the security policy information of the first terminal device on the user plane.
在一些实施例中,该M个比特位可以是该第一密钥的标识的最高M个比特位,该N个比特位可以是该第一密钥的标识的最低N个比特位;或者,该M个比特位可以是该第一密钥的标识的前M个比特位,该N个比特位可以是该第一密钥的标识的后N个比特位;或者,该M个比特位可以是该第一密钥的标识的偶数位的比特位,该N个比特位可以是该第一密钥的标识的奇数位的比特位。In some embodiments, the M bits may be the highest M bits of the identity of the first key, and the N bits may be the lowest N bits of the identity of the first key; or, The M bits may be the first M bits of the identifier of the first key, and the N bits may be the last N bits of the identifier of the first key; or, the M bits may be are the even-numbered bits of the identifier of the first key, and the N bits may be the odd-numbered bits of the identifier of the first key.
在一些实施例中,M与N的取值可以相同,也可以不同,本申请对此并不限定。In some embodiments, the values of M and N may be the same or different, which is not limited by this application.
在一些实施例中,该第一终端设备接收该第二终端设备通过该中继设备发送的第二消息;In some embodiments, the first terminal device receives the second message sent by the second terminal device through the relay device;
其中,该第二消息包括以下至少之一:该第二终端设备生成的该第二随机数,该第二终端设备生成的该第一密钥的标识的N个比特位,该第二终端设备生成的该第二密钥的标识的x个比特位,该第二终端设备选取的安全算法,该第二终端设备选取的安全策略,第二消息验证码;Wherein, the second message includes at least one of the following: the second random number generated by the second terminal device, N bits of the identification of the first key generated by the second terminal device, x bits of the identifier of the generated second key, the security algorithm selected by the second terminal device, the security policy selected by the second terminal device, and the second message verification code;
其中,该第二消息通过基于该第二密钥生成的该第二消息验证码进行完整性保护,或者,该第二消息通过基于该第二密钥派生的完整性保护密钥生成的该第二消息验证码进行完整性保护,且该第二消息验证码的输入参数包括以下至少之一:该第二随机数,该N个比特位,该x个比特位,该第二终端设备选取的安全算法,该第二终端设备选取的安全策略;Wherein, the second message is integrity protected through the second message verification code generated based on the second key, or the second message is integrity protected through the third integrity protection key generated based on the second key. The second message verification code performs integrity protection, and the input parameters of the second message verification code include at least one of the following: the second random number, the N bits, the x bits, and the second terminal device selected Security algorithm, the security policy selected by the second terminal device;
其中,该第二密钥的标识由该x个比特位与该第二密钥的标识的另外y个比特位合并得到,x和 y均为正整数。Wherein, the identifier of the second key is obtained by combining the x bits and the other y bits of the identifier of the second key, and x and y are both positive integers.
在一些实施例中,在该第二消息中携带的信息未遭受篡改的情况下,该第一终端设备至少根据该第一随机数、该第一密钥和该第二随机数生成该第二密钥,该第一终端设备根据该第二密钥生成完整性保护密钥和/或机密性保护密钥,以及该第一终端设备将该M个比特位和该N个比特位合并得到该第一密钥的标识,该第一终端设备生成该第二密钥的标识的y个比特位,并将该x个比特位和该y个比特位合并得到该第二密钥的标识;In some embodiments, if the information carried in the second message has not been tampered with, the first terminal device generates the second random number based on at least the first random number, the first key and the second random number. key, the first terminal device generates an integrity protection key and/or a confidentiality protection key based on the second key, and the first terminal device combines the M bits and the N bits to obtain the The identification of the first key, the first terminal device generates y bits of the identification of the second key, and combines the x bits and the y bits to obtain the identification of the second key;
在该第二消息验证码有效的情况下,该第一终端设备根据该第二终端设备选取的安全算法、该第二密钥、基于该第二密钥生成完整性保护密钥和/或机密性保护密钥、该第二终端设备选取的安全策略,与该第二终端设备进行通信。When the second message verification code is valid, the first terminal device generates an integrity protection key and/or a secret based on the security algorithm selected by the second terminal device, the second key, and the second key. The security protection key and the security policy selected by the second terminal device are used to communicate with the second terminal device.
在一些实施例中,该第二消息通过该第一密钥进行加密。当然,该第二消息也可以不通过该第一密钥进行加密,或者,该第二消息也可以不加密。In some embodiments, the second message is encrypted with the first key. Of course, the second message may not be encrypted using the first key, or the second message may not be encrypted.
在一些实施例中,该第一终端设备根据该第一密钥解密该第二消息;在该第二消息中携带的信息未遭受篡改的情况下,该第一终端设备至少根据该第一随机数、该第一密钥和该第二随机数生成该第二密钥,该第一终端设备根据该第二密钥生成完整性保护密钥和/或机密性保护密钥,以及该第一终端设备将该M个比特位和该N个比特位合并得到该第一密钥的标识,该第一终端设备生成该第二密钥的标识的y个比特位,并将该x个比特位和该y个比特位合并得到该第二密钥的标识;In some embodiments, the first terminal device decrypts the second message according to the first key; if the information carried in the second message is not tampered with, the first terminal device at least decrypts the second message according to the first random key. number, the first key and the second random number to generate the second key, the first terminal device generates an integrity protection key and/or a confidentiality protection key based on the second key, and the first The terminal device combines the M bits and the N bits to obtain the identity of the first key, the first terminal device generates y bits of the identity of the second key, and combines the x bits Combine with the y bits to obtain the identity of the second key;
在该第二消息验证码有效和该第三消息验证码有效的情况下,该第一终端设备根据该第二终端设备选取的安全算法、该第二密钥、基于该第二密钥生成完整性保护密钥和/或机密性保护密钥、该第二终端设备选取的安全策略,与该第二终端设备进行通信。When the second message verification code is valid and the third message verification code is valid, the first terminal device generates a complete message based on the security algorithm selected by the second terminal device, the second key, and the second key. The security protection key and/or the confidentiality protection key and the security policy selected by the second terminal device are used to communicate with the second terminal device.
在一些实施例中,该x个比特位可以是该第二密钥的标识的最高x个比特位,该y个比特位可以是该第二密钥的标识的最低y个比特位;或者,该x个比特位可以是该第二密钥的标识的前x个比特位,该y个比特位可以是该第二密钥的标识的后y个比特位;或者,该x个比特位可以是该第二密钥的标识的偶数位的比特位,该y个比特位可以是该第二密钥的标识的奇数位的比特位。In some embodiments, the x bits may be the highest x bits of the identity of the second key, and the y bits may be the lowest y bits of the identity of the second key; or, The x bits may be the first x bits of the identifier of the second key, and the y bits may be the last y bits of the identifier of the second key; or, the x bits may be are the even-numbered bits of the identifier of the second key, and the y bits may be the odd-numbered bits of the identifier of the second key.
在一些实施例中,x与y的取值可以相同,也可以不同,本申请对此并不限定。In some embodiments, the values of x and y may be the same or different, which is not limited by this application.
具体例如,假设该第二消息验证码的输入参数包括:该第二随机数、该N个比特位、该x个比特位、该第二终端设备选取的安全算法、该第二终端设备选取的安全策略。该第一终端设备可以基于该第二随机数、该N个比特位、该x个比特位、该第二终端设备选取的安全算法、该第二终端设备选取的安全策略生成第二消息验证码,并与该第二消息中包含的该第二消息验证码进行比较,若比较一致的情况下,该第二消息验证码有效。For example, assume that the input parameters of the second message verification code include: the second random number, the N bits, the x bits, the security algorithm selected by the second terminal device, the security strategy. The first terminal device may generate a second message verification code based on the second random number, the N bits, the x bits, the security algorithm selected by the second terminal device, and the security policy selected by the second terminal device. , and compared with the second message verification code contained in the second message. If they are consistent, the second message verification code is valid.
具体的,该第二终端设备可以基于该第一终端设备的安全能力信息选取安全算法,和/或,该第二终端设备可以基于该第一终端设备的安全策略信息选取安全策略。Specifically, the second terminal device may select a security algorithm based on the security capability information of the first terminal device, and/or the second terminal device may select a security policy based on the security policy information of the first terminal device.
在一些实施例中,该第一终端设备可以根据该第一随机数、该第一密钥、该第二随机数,以及源标识、目标标识、该第一随机数的长度、该第二随机数的长度、该源标识的长度、该目标标识的长度中的至少之一,生成该第二密钥。其中,该源标识用于标识该第一终端设备与该第二终端设备之间的中继连接的源端,该目标标识用于标识该第一终端设备与该第二终端设备之间的中继连接的目标端。另外,该第二密钥的输入参数还可以包括其他系统设定参数,如3GPP指定的一个或多个固定参数。In some embodiments, the first terminal device may use the first random number, the first key, the second random number, the source identifier, the target identifier, the length of the first random number, the second random number. At least one of the length of the number, the length of the source identifier, and the length of the target identifier is used to generate the second key. Wherein, the source identifier is used to identify the source end of the relay connection between the first terminal device and the second terminal device, and the target identifier is used to identify the intermediate connection between the first terminal device and the second terminal device. The destination of the connection. In addition, the input parameters of the second key may also include other system setting parameters, such as one or more fixed parameters specified by 3GPP.
在一些实施例中,该第一消息为认证响应消息,该第二消息为SMC消息。In some embodiments, the first message is an authentication response message, and the second message is an SMC message.
在一些实施例中,该第一消息为SMC消息,该第二消息为安全模式响应消息。In some embodiments, the first message is an SMC message, and the second message is a safe mode response message.
在一些实施例中,该第一终端设备通过该中继设备向该第二终端设备发送第三消息;In some embodiments, the first terminal device sends the third message to the second terminal device through the relay device;
其中,该第三消息用于指示安全模式建立完成,该第三消息通过目标密钥进行加密,且该第三消息包括以下至少之一:该第二密钥的标识的该y个比特位,第三消息验证码;Wherein, the third message is used to indicate that the security mode establishment is completed, the third message is encrypted by the target key, and the third message includes at least one of the following: the y bits of the identification of the second key, Third message verification code;
其中,该目标密钥包括以下之一:该第一密钥,该第二密钥,该第二密钥派生的机密性保护密钥;Wherein, the target key includes one of the following: the first key, the second key, and a confidentiality protected key derived from the second key;
其中,该第三消息通过基于该第二密钥生成的该第三消息验证码进行完整性保护,或者,该第三消息通过基于该第二密钥派生的完整性保护密钥生成的该第三消息验证码进行完整性保护,该第三消息验证码的输入参数包括该y个比特位。Wherein, the third message is integrity protected through the third message verification code generated based on the second key, or the third message is integrity protected through the third message verification code generated based on the integrity protection key derived based on the second key. The three-message verification code performs integrity protection, and the input parameters of the third message verification code include the y bits.
在一些实施例中,对于该第二终端设备,该第二终端设备通过该目标密钥对该第三消息进行解密;在该第三消息中携带的信息未遭受篡改的情况下,且该第三消息验证码有效的情况下,该第二终端设备将该x个比特位与该y个比特位合并得到该第二密钥的标识。具体的,该第二终端设备可以基于该y个比特位生成第三消息验证码,并与该第三消息中包含的该第三消息验证码进行比较,若比较一致的情况下,该第三消息验证码有效。In some embodiments, for the second terminal device, the second terminal device decrypts the third message using the target key; provided that the information carried in the third message has not been tampered with, and the third message When the three-message verification code is valid, the second terminal device combines the x bits and the y bits to obtain the identity of the second key. Specifically, the second terminal device can generate a third message verification code based on the y bits, and compare it with the third message verification code contained in the third message. If the comparison is consistent, the third message verification code The message verification code is valid.
具体例如,该第三消息为安全模式结束消息(security mode complete)。For example, the third message is a security mode complete message (security mode complete).
在一些实施例中,该第一终端设备接收该第二终端设备通过该中继设备发送的错误消息;其中, 该错误消息包括以下至少之一:原因信息,第四消息验证码;其中,该原因信息用于指示该第二终端设备与该第一终端设备的安全策略冲突,或者,该原因信息用于指示该第一消息验证码验证失败,或者,该原因信息用于指示该第二终端设备与该第一终端设备的安全算法协商失败,该第四消息验证码的输入参数包括以下至少之一:该原因信息;In some embodiments, the first terminal device receives an error message sent by the second terminal device through the relay device; wherein, the error message includes at least one of the following: cause information, a fourth message verification code; wherein, the error message The reason information is used to indicate that the security policy of the second terminal device conflicts with the first terminal device, or the reason information is used to indicate that the first message verification code verification fails, or the reason information is used to indicate that the second terminal device The security algorithm negotiation between the device and the first terminal device fails, and the input parameters of the fourth message verification code include at least one of the following: the reason information;
在该第四消息验证码有效的情况下,该第一终端设备确定安全模式建立失败,和/或,该第一终端设备重新发起安全模式建立流程。If the fourth message verification code is valid, the first terminal device determines that the security mode establishment fails, and/or the first terminal device re-initiates the security mode establishment process.
在一些实施例中,该错误消息也可以受完整性保护。In some embodiments, the error message may also be integrity protected.
具体例如,该原因信息用于指示该第二终端设备与该第一终端设备的安全策略冲突,例如,该第二终端设备不支持该第一消息中携带的该第一终端设备的安全策略信息。Specifically, for example, the cause information is used to indicate that the security policy of the second terminal device conflicts with the first terminal device. For example, the second terminal device does not support the security policy information of the first terminal device carried in the first message. .
具体例如,该原因信息用于指示该第二终端设备与该第一终端设备的安全算法协商失败,例如,该第二终端设备不支持该第一消息中携带的该第一终端设备的安全能力信息。Specifically, for example, the cause information is used to indicate that the security algorithm negotiation between the second terminal device and the first terminal device failed. For example, the second terminal device does not support the security capabilities of the first terminal device carried in the first message. information.
在一些实施例中,该第一终端设备接收该第二终端设备通过该中继设备发送的认证请求消息;In some embodiments, the first terminal device receives the authentication request message sent by the second terminal device through the relay device;
其中,该认证请求消息包括以下至少之一:该第二终端设备所属用户的信息,该中继设备所属用户的信息,该第二终端设备生成的第一临时公钥,该第二终端设备的签名,该中继设备的签名,该中继设备的相关信息;The authentication request message includes at least one of the following: information about the user to which the second terminal device belongs, information about the user to which the relay device belongs, the first temporary public key generated by the second terminal device, Signature, the signature of the relay device, and relevant information of the relay device;
其中,该第二终端设备所属用户的信息包括该第二终端设备的标识和该第二终端设备的PVT和KPAK;该中继设备所属用户的信息包括该中继设备的标识和该中继设备的PVT和KPAK;该第二终端设备的签名的输入参数包括以下至少之一:该第二终端设备所属用户的信息和该第一临时公钥;该中继设备的签名的输入参数包括以下至少之一:该第二终端设备的签名和该中继设备所属用户的信息;该第一临时公钥和该中继设备的相关信息用于该第一终端设备派生该第一密钥。Wherein, the information of the user to which the second terminal device belongs includes the identification of the second terminal device and the PVT and KPAK of the second terminal device; the information of the user to which the relay device belongs includes the identification of the relay device and the relay device. PVT and KPAK; the input parameters of the signature of the second terminal device include at least one of the following: the information of the user to which the second terminal device belongs and the first temporary public key; the input parameters of the signature of the relay device include at least one of the following: One: the signature of the second terminal device and the information of the user to which the relay device belongs; the first temporary public key and the relevant information of the relay device are used by the first terminal device to derive the first key.
在本申请实施例中,该第二终端设备的签名的输入参数包括以下至少之一:该第二终端设备所属用户的信息和该第一临时公钥。也即,该第二终端设备可以基于该第二终端设备所属用户的信息和该第一临时公钥中的至少之一,生成该第二终端设备的签名。In this embodiment of the present application, the input parameters of the signature of the second terminal device include at least one of the following: information of the user to which the second terminal device belongs and the first temporary public key. That is, the second terminal device may generate a signature of the second terminal device based on at least one of the information of the user to which the second terminal device belongs and the first temporary public key.
在本申请实施例中,该中继设备的签名的输入参数包括以下至少之一:该第二终端设备的签名和该中继设备所属用户的信息。也即,该中继设备可以基于该第二终端设备的签名和该中继设备所属用户的信息中的至少之一,生成该中继设备的签名。In this embodiment of the present application, the input parameters of the relay device's signature include at least one of the following: the signature of the second terminal device and the information of the user to which the relay device belongs. That is, the relay device may generate the signature of the relay device based on at least one of the signature of the second terminal device and the information of the user to which the relay device belongs.
在一些实施例中,在该第二终端设备所属用户的信息包括该第二终端设备的标识和该第二终端设备的PVT和KPAK的情况下,该第二终端设备的签名由该第二终端设备的秘密签名密钥(SSK)生成。可选地,该第二终端设备的PVT和KPAK、以及秘密签名密钥(SSK)可以是可信中心KMS通过安全通道为该第二终端设备预先配置的。该安全通道可以基于AKMA机制或者GBA机制来建立该第二终端设备与KMS的安全连接,该KMS可以直接由运营商来负责管理或者是与运营商有商业关系的第三方服务提供商。In some embodiments, when the information of the user to which the second terminal device belongs includes the identification of the second terminal device and the PVT and KPAK of the second terminal device, the signature of the second terminal device is determined by the second terminal device. The device's Secret Signing Key (SSK) is generated. Optionally, the PVT, KPAK, and secret signature key (SSK) of the second terminal device may be pre-configured by the trusted center KMS for the second terminal device through a secure channel. The secure channel may be based on the AKMA mechanism or the GBA mechanism to establish a secure connection between the second terminal device and the KMS. The KMS may be directly managed by the operator or be a third-party service provider that has a commercial relationship with the operator.
在一些实施例中,在该中继设备所属用户的信息包括该中继设备的标识、该中继设备的PVT和KPAK的情况下,该中继设备的签名由该中继设备的秘密签名密钥(SSK)生成。可选地,该中继设备的PVT和KPAK、以及秘密签名密钥(SSK)可以是可信中心KMS通过安全通道为该中继设备预先配置的。该安全通道可以基于AKMA机制或者GBA机制来建立该中继设备与KMS的安全连接,该KMS可以直接由运营商来负责管理或者是与运营商有商业关系的第三方服务提供商。In some embodiments, when the information about the user of the relay device includes the identity of the relay device, the PVT and KPAK of the relay device, the signature of the relay device is encrypted by the secret signature of the relay device. Key (SSK) is generated. Optionally, the PVT, KPAK, and secret signature key (SSK) of the relay device may be pre-configured for the relay device by the trusted center KMS through a secure channel. The secure channel can be based on the AKMA mechanism or the GBA mechanism to establish a secure connection between the relay device and the KMS. The KMS can be directly managed by the operator or a third-party service provider that has a commercial relationship with the operator.
在一些实施例中,在该第二终端设备的KPAK和该中继设备的KPAK有效,且基于该第二终端设备的标识和该第二终端设备的PVT对该第二终端设备的签名验证成功,以及基于该中继设备的标识和该中继设备的PVT对该中继设备的签名验证成功的情况下,该第一终端设备生成第二临时私钥,以及该第一终端设备根据该第一临时公钥、该中继设备的相关信息和该第二临时私钥派生该第一密钥。In some embodiments, the KPAK of the second terminal device and the KPAK of the relay device are valid, and the signature verification of the second terminal device based on the identity of the second terminal device and the PVT of the second terminal device is successful. , and if the signature verification of the relay device based on the identity of the relay device and the PVT of the relay device is successful, the first terminal device generates a second temporary private key, and the first terminal device generates a second temporary private key according to the first terminal device. The first key is derived from a temporary public key, relevant information of the relay device and the second temporary private key.
具体的,该第一终端设备可以基于其本地存储的一个或多个KPAK,验证该第二终端设备的KPAK和该中继设备的KPAK的有效性。例如,在第一终端设备本地存储的KPAK中存在与第二终端设备的KPAK一致的KPAK的情况下,该第二终端设备的KPAK有效;以及在第一终端设备本地存储的KPAK中存在与中继设备的KPAK一致的KPAK的情况下,该中继设备的KPAK有效。可选地,该第一终端设备本地存储的一个或多个KPAK可以由KMS预配置。Specifically, the first terminal device may verify the validity of the KPAK of the second terminal device and the KPAK of the relay device based on one or more KPAKs stored locally. For example, if there is a KPAK consistent with the KPAK of the second terminal device in the KPAK stored locally on the first terminal device, the KPAK of the second terminal device is valid; and there is a KPAK consistent with the KPAK stored locally on the first terminal device. In the case where the KPAK of the relay device is consistent with the KPAK, the KPAK of the relay device is valid. Optionally, one or more KPAKs stored locally on the first terminal device may be preconfigured by the KMS.
具体的,在本申请实施例中,第一终端设备可以根据第二终端设备生成的第一临时公钥、中继设备的相关信息和第一终端设备生成的第二临时私钥派生第一密钥。相应的,第二终端设备可以根据第一终端设备生成的第二临时公钥、中继设备的相关信息和第二终端设备生成的第一临时私钥派生第一密钥。其中,第二终端设备生成的第一临时公钥与第二终端设备生成的第一临时私钥配对,第一终端设备生成的第二临时公钥与第一终端设备生成的第二临时私钥配对。Specifically, in this embodiment of the present application, the first terminal device may derive the first secret key based on the first temporary public key generated by the second terminal device, the relevant information of the relay device, and the second temporary private key generated by the first terminal device. key. Correspondingly, the second terminal device may derive the first key based on the second temporary public key generated by the first terminal device, the relevant information of the relay device, and the first temporary private key generated by the second terminal device. Wherein, the first temporary public key generated by the second terminal device is paired with the first temporary private key generated by the second terminal device, and the second temporary public key generated by the first terminal device is paired with the second temporary private key generated by the first terminal device. pair.
具体例如,第一终端设备可以根据第一临时公钥和第二临时私钥,并使用ECIES算法计算出第一密钥;第二终端设备可以根据第二临时公钥和第一临时私钥,并使用ECIES算法计算出第一密钥。For example, the first terminal device can calculate the first key based on the first temporary public key and the second temporary private key and use the ECIES algorithm; the second terminal device can calculate the first key based on the second temporary public key and the first temporary private key. And use the ECIES algorithm to calculate the first key.
在一些实施例中,该第一密钥可以是K D,该第一密钥的标识可以是K D ID;该第二密钥可以是K D-SESS,该第二密钥的标识可以是K D-SESS ID。 In some embodiments, the first key may be K D , and the identifier of the first key may be K D ID ; the second key may be K D -SESS , and the identifier of the second key may be K D-SESS ID.
在一些实施例中,该完整性保护密钥包括控制面的完整性保护密钥(K D-CPint)和用户面的完整性保护密钥(K D-UPint);和/或,该机密性保护密钥包括控制面的机密性保护密钥(K D-CPenc)和用户面的机密性保护密钥(K D-UPenc)。 In some embodiments, the integrity protection key includes an integrity protection key for the control plane (KD -CPint ) and an integrity protection key for the user plane ( KD-UPint ); and/or the confidentiality The protection keys include a confidentiality protection key for the control plane (K D-CPenc ) and a confidentiality protection key for the user plane (K D-UPenc ).
因此,在本申请实施例中,第一随机数、第一密钥和第二终端设备生成的第二随机数用于派生第二密钥,第二密钥用于派生完整性保护密钥和/或机密性保护密钥,能够保证第一终端设备和第二终端设备的身份安全与通信数据的机密性与完整性,从而确保双方传输数据的机密性和完整性,防止其他设备甚至中继设备的窃听。Therefore, in this embodiment of the present application, the first random number, the first key and the second random number generated by the second terminal device are used to derive the second key, and the second key is used to derive the integrity protection key and /or confidentiality protection key, which can ensure the identity security of the first terminal device and the second terminal device and the confidentiality and integrity of the communication data, thereby ensuring the confidentiality and integrity of the data transmitted by both parties and preventing other devices from even relaying Device eavesdropping.
本申请实施例适用于5G L2 UE-to-UE relay架构下第一终端设备(源设备)和第二终端设备(目标设备)之间的安全通信建立流程。借助公钥签名技术,能够确保终端设备的身份真实性和消息不可否认性,能够抗重放攻击、中间人攻击、伪装等多种主动攻击,同时保证认证流程消息的完整性,并且利用3GPP标准中使用的ECIES算法,从而建立了源UE和目标UE之间的端到端安全,确保双方传输数据的机密性和完整性,防止外部敌手甚至中继(relay)的窃听;本申请实施例保证了安全通信建立机制的可扩展性,另外,本申请实施例能够实现源UE和目标UE之间用户面和控制面安全策略、以及双方所支持加密和完整性保护算法的安全协商,能够实现完整性保护,抵抗篡改和降级攻击。The embodiment of this application is suitable for the secure communication establishment process between the first terminal device (source device) and the second terminal device (target device) under the 5G L2 UE-to-UE relay architecture. With the help of public key signature technology, it can ensure the identity authenticity of the terminal device and the non-repudiation of the message, and can resist replay attacks, man-in-the-middle attacks, disguise and other active attacks, while ensuring the integrity of the authentication process messages, and using the 3GPP standard The ECIES algorithm is used to establish end-to-end security between the source UE and the target UE, ensuring the confidentiality and integrity of the data transmitted by both parties, and preventing eavesdropping by external adversaries and even relays; the embodiment of this application ensures The scalability of the secure communication establishment mechanism. In addition, the embodiments of this application can realize the security negotiation of the user plane and control plane security policies between the source UE and the target UE, as well as the encryption and integrity protection algorithms supported by both parties, and can achieve integrity. Protect against tampering and downgrade attacks.
上文结合图7至图8,详细描述了本申请的第一终端设备侧实施例,下文结合图12,详细描述本申请的第二终端设备侧实施例,应理解,第二终端设备侧实施例与第一终端设备侧实施例相互对应,类似的描述可以参照第一终端设备侧实施例。The first terminal device side embodiment of the present application is described in detail above with reference to FIGS. 7 to 8 . The second terminal device side embodiment of the present application is described in detail below with reference to FIG. 12 . It should be understood that the second terminal device side implementation The example corresponds to the first terminal device side embodiment, and similar descriptions may refer to the first terminal device side embodiment.
图12是根据本申请实施例的中继通信的方法600的示意性流程图,如图12所示,该中继通信的方法600可以包括如下内容中的至少部分内容:Figure 12 is a schematic flowchart of a communication relay method 600 according to an embodiment of the present application. As shown in Figure 12, the communication relay method 600 may include at least part of the following content:
S610,第二终端设备接收第一终端设备通过中继设备发送的第一消息;其中,该第一消息包括以下至少之一:该第一终端设备的安全能力信息,该第一终端设备的安全策略信息,该第一终端设备所属用户的信息,该中继设备所属用户的信息,该第一终端设备生成的第一随机数,该第一终端设备生成的第二临时公钥,该第一终端设备生成的第一密钥的标识的M个比特位,该第一终端设备的签名,该中继设备的签名,第一消息验证码;其中,该第一终端设备所属用户的信息包括该第一终端设备的标识和该第一终端设备的PVT和KPAK;该中继设备所属用户的信息包括该中继设备的标识和该中继设备的PVT和KPAK;该第一终端设备的签名的输入参数包括以下至少之一:该第一终端设备所属用户的信息,该第二临时公钥,该第一密钥的标识的M个比特位,该第二终端设备的签名;该中继设备的签名的输入参数包括以下至少之一:该中继设备所属用户的信息,该第一终端设备的签名,该第二终端设备的签名;其中,该第一消息通过基于该第一密钥生成的该第一消息验证码进行完整性保护,且该第一消息验证码的输入参数包括以下至少之一:该第一终端设备的安全能力信息,该第一终端设备的安全策略信息,该第一终端设备所属用户的信息,该第一随机数,该第二临时公钥,该M个比特位,该第一终端设备的签名;其中,该第二临时公钥和该中继设备的相关信息用于该第二终端设备派生该第一密钥,该第一随机数、该第一密钥和该第二终端设备生成的第二随机数用于派生第二密钥,该第二密钥用于派生完整性保护密钥和/或机密性保护密钥,该第一密钥的标识由该M个比特位与该第一密钥的标识的另外N个比特位合并得到,M和N均为正整数;其中,该中继设备的相关信息包括以下之一:该中继设备的身份信息,该中继设备生成的随机数,该中继设备生成的计数器。S610. The second terminal device receives the first message sent by the first terminal device through the relay device; wherein the first message includes at least one of the following: the security capability information of the first terminal device, the security capability information of the first terminal device. Policy information, information about the user to which the first terminal device belongs, information about the user to which the relay device belongs, the first random number generated by the first terminal device, the second temporary public key generated by the first terminal device, the first M bits of the identification of the first key generated by the terminal device, the signature of the first terminal device, the signature of the relay device, and the first message verification code; wherein, the information of the user to which the first terminal device belongs includes the The identity of the first terminal device and the PVT and KPAK of the first terminal device; the information of the user to which the relay device belongs includes the identity of the relay device and the PVT and KPAK of the relay device; the signature of the first terminal device The input parameters include at least one of the following: information about the user to which the first terminal device belongs, the second temporary public key, M bits of the identification of the first key, the signature of the second terminal device; the relay device The input parameters of the signature include at least one of the following: information of the user to which the relay device belongs, the signature of the first terminal device, and the signature of the second terminal device; wherein the first message is generated based on the first key The first message verification code is integrity protected, and the input parameters of the first message verification code include at least one of the following: security capability information of the first terminal device, security policy information of the first terminal device, Information about the user to which a terminal device belongs, the first random number, the second temporary public key, the M bits, and the signature of the first terminal device; where the second temporary public key is related to the relay device The information is used by the second terminal device to derive the first key. The first random number, the first key and the second random number generated by the second terminal device are used to derive the second key. The key is used to derive the integrity protection key and/or the confidentiality protection key. The identity of the first key is obtained by combining the M bits with the other N bits of the identity of the first key. M and N is a positive integer; wherein, the relevant information of the relay device includes one of the following: the identity information of the relay device, the random number generated by the relay device, and the counter generated by the relay device.
本实施例基于ECCSI签名方案,建立L2架构下的UE-to-UE中继场景下的安全连接。具体的,本申请实施例应用于L2架构下的UE-to-UE中继场景,也即,第一终端设备与第二终端设备之间通过中继设备进行通信。例如,第一终端设备与第二终端设备之间的中继连接可以是PC5链路。This embodiment is based on the ECCSI signature scheme to establish a secure connection in the UE-to-UE relay scenario under the L2 architecture. Specifically, the embodiments of this application are applied to the UE-to-UE relay scenario under the L2 architecture, that is, the first terminal device and the second terminal device communicate through the relay device. For example, the relay connection between the first terminal device and the second terminal device may be a PC5 link.
在本申请实施例中,第一终端设备生成的第一随机数、第一密钥和第二终端设备生成的第二随机数用于派生第二密钥。也即,第一终端设备至少根据第一随机数、第一密钥和第二随机数派生第二密钥,以及第一终端设备可以基于第二密钥派生完整性保护密钥和/或机密性保护密钥,从而第一终端设备可以基于完整性保护密钥和/或机密性保护密钥对发送的消息进行安全保护。同理,第二终端设备至少根据第一随机数、第一密钥和第二随机数派生第二密钥,以及第二终端设备可以基于第二密钥派生完整性保护密钥和/或机密性保护密钥,从而第二终端设备可以基于完整性保护密钥和/或机密性保护密钥对发送的消息进行安全保护。In this embodiment of the present application, the first random number and the first key generated by the first terminal device and the second random number generated by the second terminal device are used to derive the second key. That is, the first terminal device derives the second key based on at least the first random number, the first key and the second random number, and the first terminal device can derive the integrity protection key and/or the secret based on the second key. The first terminal device can securely protect the sent message based on the integrity protection key and/or the confidentiality protection key. Similarly, the second terminal device may derive the second key based on at least the first random number, the first key and the second random number, and the second terminal device may derive the integrity protection key and/or the secret based on the second key. The second terminal device can securely protect the sent message based on the integrity protection key and/or the confidentiality protection key.
在本申请实施例中,该第一消息验证码的输入参数包括以下至少之一:该第一终端设备的安全能力信息,该第一终端设备的安全策略信息,该第一随机数,该第二临时公钥,该M个比特位。也即, 该第一终端设备可以基于该第一终端设备的安全能力信息、该第一终端设备的安全策略信息、该第一随机数、该第二临时公钥、该M个比特位中的至少之一,生成该第一消息验证码。In this embodiment of the present application, the input parameters of the first message verification code include at least one of the following: security capability information of the first terminal device, security policy information of the first terminal device, the first random number, the third 2. Temporary public key, the M bits. That is, the first terminal device may be based on the security capability information of the first terminal device, the security policy information of the first terminal device, the first random number, the second temporary public key, and the M bits. At least one of them generates the first message verification code.
在一些实施例中,该第一终端设备的签名由该第一终端设备的秘密签名密钥生成;和/或,该中继设备的签名由该中继设备的秘密签名密钥生成。In some embodiments, the signature of the first terminal device is generated by the secret signature key of the first terminal device; and/or the signature of the relay device is generated by the secret signature key of the relay device.
在一些实施例中,该第一消息为认证响应消息,或者,该第一消息为安全模式命令消息。In some embodiments, the first message is an authentication response message, or the first message is a safe mode command message.
在一些实施例中,该第一终端设备的安全能力信息可以是该第一终端设备支持的密码算法列表。In some embodiments, the security capability information of the first terminal device may be a list of cryptographic algorithms supported by the first terminal device.
在一些实施例中,该第一终端设备的安全策略信息可以是该第一终端设备是否支持机密性保护或完整性保护。其中,该第一终端设备的安全策略信息包括:该第一终端设备在控制面的安全策略信息,和/或,该第一终端设备在用户面的安全策略信息。In some embodiments, the security policy information of the first terminal device may be whether the first terminal device supports confidentiality protection or integrity protection. The security policy information of the first terminal device includes: the security policy information of the first terminal device on the control plane, and/or the security policy information of the first terminal device on the user plane.
在一些实施例中,该M个比特位可以是该第一密钥的标识的最高M个比特位,该N个比特位可以是该第一密钥的标识的最低N个比特位;或者,该M个比特位可以是该第一密钥的标识的前M个比特位,该N个比特位可以是该第一密钥的标识的后N个比特位;或者,该M个比特位可以是该第一密钥的标识的偶数位的比特位,该N个比特位可以是该第一密钥的标识的奇数位的比特位。In some embodiments, the M bits may be the highest M bits of the identity of the first key, and the N bits may be the lowest N bits of the identity of the first key; or, The M bits may be the first M bits of the identifier of the first key, and the N bits may be the last N bits of the identifier of the first key; or, the M bits may be are the even-numbered bits of the identifier of the first key, and the N bits may be the odd-numbered bits of the identifier of the first key.
在一些实施例中,M与N的取值可以相同,也可以不同,本申请对此并不限定。In some embodiments, the values of M and N may be the same or different, which is not limited by this application.
在一些实施例中,该第二终端设备分别检查该第一终端设备的KPAK和该中继设备的KPAK,在该第一终端设备的KPAK和该中继设备的KPAK有效的情况下,且基于该第一终端设备的标识和该第一终端设备的PVT对该第一终端设备的签名进行验证,以及基于该中继设备的标识和该中继设备的PVT对该中继设备的签名进行验证;在该第一终端设备的签名和该中继设备的签名验证成功,且该第一消息中携带的信息未遭受篡改的情况下,该第二终端设备生成第二随机数,该第二终端设备至少根据该第一随机数、该第一密钥和该第二随机数生成该第二密钥,该第二终端设备根据该第二密钥生成完整性保护密钥和/或机密性保护密钥,以及该第二终端设备生成该第一密钥的标识的N个比特位,并将该M个比特位和该N个比特位合并得到该第一密钥的标识。In some embodiments, the second terminal device checks the KPAK of the first terminal device and the KPAK of the relay device respectively. If the KPAK of the first terminal device and the KPAK of the relay device are valid, and based on The identity of the first terminal device and the PVT of the first terminal device are used to verify the signature of the first terminal device, and the signature of the relay device is verified based on the identity of the relay device and the PVT of the relay device. ; When the signature of the first terminal device and the signature of the relay device are successfully verified, and the information carried in the first message has not been tampered with, the second terminal device generates a second random number, and the second terminal The device generates the second key based on at least the first random number, the first key and the second random number, and the second terminal device generates an integrity protection key and/or confidentiality protection based on the second key. key, and the second terminal device generates N bits of the identifier of the first key, and combines the M bits and the N bits to obtain the identifier of the first key.
在一些实施例中,该第二终端设备可以根据该第一随机数、该第一密钥、该第二随机数,以及源标识、目标标识、该第一随机数的长度、该第二随机数的长度、该源标识的长度、该目标标识的长度中的至少之一,生成该第二密钥。其中,该源标识用于标识该第一终端设备与该第二终端设备之间的中继连接的源端,该目标标识用于标识该第一终端设备与该第二终端设备之间的中继连接的目标端。另外,该第二密钥的输入参数还可以包括其他系统设定参数,如3GPP指定的一个或多个固定参数。In some embodiments, the second terminal device may use the first random number, the first key, the second random number, the source identifier, the target identifier, the length of the first random number, the second random number. At least one of the length of the number, the length of the source identifier, and the length of the target identifier is used to generate the second key. Wherein, the source identifier is used to identify the source end of the relay connection between the first terminal device and the second terminal device, and the target identifier is used to identify the intermediate connection between the first terminal device and the second terminal device. The destination of the connection. In addition, the input parameters of the second key may also include other system setting parameters, such as one or more fixed parameters specified by 3GPP.
具体例如,假设该第一消息验证码的输入参数包括:该第一终端设备的安全能力信息、该第一终端设备的安全策略信息、该第一随机数、该第二临时公钥、该M个比特位。该第二终端设备可以基于该第一终端设备的安全能力信息、该第一终端设备的安全策略信息、该第一随机数、该第二临时公钥、该M个比特位生成第一消息验证码,并与该第一消息中包含的该第一消息验证码进行比较,若比较一致的情况下,该第一消息验证码有效。For example, assume that the input parameters of the first message verification code include: the security capability information of the first terminal device, the security policy information of the first terminal device, the first random number, the second temporary public key, the M bits. The second terminal device may generate a first message verification based on the security capability information of the first terminal device, the security policy information of the first terminal device, the first random number, the second temporary public key, and the M bits. code and compare it with the first message verification code contained in the first message. If they are consistent, the first message verification code is valid.
在一些实施例中,在该第一消息验证码有效的情况下,该第二终端设备通过该中继设备向该第一终端设备发送第二消息;其中,该第二消息包括以下至少之一:该第二随机数,该N个比特位,该第二终端设备生成的该第二密钥的标识的x个比特位,该第二终端设备选取的安全算法,该第二终端设备选取的安全策略,第二消息验证码;In some embodiments, when the first message verification code is valid, the second terminal device sends a second message to the first terminal device through the relay device; wherein the second message includes at least one of the following : the second random number, the N bits, the x bits of the identifier of the second key generated by the second terminal device, the security algorithm selected by the second terminal device, the Security policy, second message verification code;
其中,该第二消息通过基于该第二密钥生成的该第二消息验证码进行完整性保护,或者,该第二消息通过基于该第二密钥派生的完整性保护密钥生成的该第二消息验证码进行完整性保护,且该第二消息验证码的输入参数包括以下至少之一:该第二随机数,该N个比特位,该x个比特位,该第二终端设备选取的安全算法,该第二终端设备选取的安全策略;Wherein, the second message is integrity protected through the second message verification code generated based on the second key, or the second message is integrity protected through the third integrity protection key generated based on the second key. The second message verification code performs integrity protection, and the input parameters of the second message verification code include at least one of the following: the second random number, the N bits, the x bits, and the second terminal device selected Security algorithm, the security policy selected by the second terminal device;
其中,该第二密钥的标识由该x个比特位与该第二密钥的标识的另外y个比特位合并得到,x和y均为正整数。Wherein, the identifier of the second key is obtained by combining the x bits and the other y bits of the identifier of the second key, and both x and y are positive integers.
具体例如,假设该第二消息验证码的输入参数包括:该第二随机数、该N个比特位、该x个比特位、该第二终端设备选取的安全算法、该第二终端设备选取的安全策略。该第一终端设备可以基于该第二随机数、该N个比特位、该x个比特位、该第二终端设备选取的安全算法、该第二终端设备选取的安全策略生成第二消息验证码,并与该第二消息中包含的该第二消息验证码进行比较,若比较一致的情况下,该第二消息验证码有效。For example, assume that the input parameters of the second message verification code include: the second random number, the N bits, the x bits, the security algorithm selected by the second terminal device, the security strategy. The first terminal device may generate a second message verification code based on the second random number, the N bits, the x bits, the security algorithm selected by the second terminal device, and the security policy selected by the second terminal device. , and compared with the second message verification code contained in the second message. If they are consistent, the second message verification code is valid.
在一些实施例中,该x个比特位可以是该第二密钥的标识的最高x个比特位,该y个比特位可以是该第二密钥的标识的最低y个比特位;或者,该x个比特位可以是该第二密钥的标识的前x个比特位,该y个比特位可以是该第二密钥的标识的后y个比特位;或者,该x个比特位可以是该第二密钥的标识的偶数位的比特位,该y个比特位可以是该第二密钥的标识的奇数位的比特位。In some embodiments, the x bits may be the highest x bits of the identity of the second key, and the y bits may be the lowest y bits of the identity of the second key; or, The x bits may be the first x bits of the identifier of the second key, and the y bits may be the last y bits of the identifier of the second key; or, the x bits may be are the even-numbered bits of the identifier of the second key, and the y bits may be the odd-numbered bits of the identifier of the second key.
在一些实施例中,x与y的取值可以相同,也可以不同,本申请对此并不限定。In some embodiments, the values of x and y may be the same or different, which is not limited by this application.
在一些实施例中,该第二消息通过该第一密钥进行加密。当然,该第二消息也可以不通过该第一密钥进行加密,或者,该第二消息也可以不加密。In some embodiments, the second message is encrypted with the first key. Of course, the second message may not be encrypted using the first key, or the second message may not be encrypted.
具体的,该第二终端设备可以基于该第一终端设备的安全能力信息选取安全算法,和/或,该第二终端设备可以基于该第一终端设备的安全策略信息选取安全策略。Specifically, the second terminal device may select a security algorithm based on the security capability information of the first terminal device, and/or the second terminal device may select a security policy based on the security policy information of the first terminal device.
在一些实施例中,该第一消息为认证响应消息,该第二消息为安全模式命令(SMC)消息。In some embodiments, the first message is an authentication response message and the second message is a secure mode command (SMC) message.
在一些实施例中,该第一消息为安全模式命令(SMC)消息,该第二消息为安全模式响应消息。In some embodiments, the first message is a safe mode command (SMC) message and the second message is a safe mode response message.
具体的,在本申请实施例中,第一终端设备可以根据第二终端设备生成的第一临时公钥、中继设备的相关信息和第一终端设备生成的第二临时私钥派生第一密钥。相应的,第二终端设备可以根据第一终端设备生成的第二临时公钥、中继设备的相关信息和第二终端设备生成的第一临时私钥派生第一密钥。其中,第二终端设备生成的第一临时公钥与第二终端设备生成的第一临时私钥配对,第一终端设备生成的第二临时公钥与第一终端设备生成的第二临时私钥配对。Specifically, in this embodiment of the present application, the first terminal device may derive the first secret key based on the first temporary public key generated by the second terminal device, the relevant information of the relay device, and the second temporary private key generated by the first terminal device. key. Correspondingly, the second terminal device may derive the first key based on the second temporary public key generated by the first terminal device, the relevant information of the relay device, and the first temporary private key generated by the second terminal device. Wherein, the first temporary public key generated by the second terminal device is paired with the first temporary private key generated by the second terminal device, and the second temporary public key generated by the first terminal device is paired with the second temporary private key generated by the first terminal device. pair.
具体例如,第一终端设备可以根据第一临时公钥和第二临时私钥,并使用ECIES算法计算出第一密钥;第二终端设备可以根据第二临时公钥和第一临时私钥,并使用ECIES算法计算出第一密钥。For example, the first terminal device can calculate the first key based on the first temporary public key and the second temporary private key and use the ECIES algorithm; the second terminal device can calculate the first key based on the second temporary public key and the first temporary private key. And use the ECIES algorithm to calculate the first key.
在一些实施例中,该第二终端设备接收该第一终端设备通过该中继设备发送的第三消息;In some embodiments, the second terminal device receives the third message sent by the first terminal device through the relay device;
其中,该第三消息用于指示安全模式建立完成,该第三消息通过目标密钥进行加密,且该第三消息包括以下至少之一:该第一终端设备生成的该第二密钥的标识的y个比特位,第三消息验证码;Wherein, the third message is used to indicate that the security mode establishment is completed, the third message is encrypted by the target key, and the third message includes at least one of the following: the identification of the second key generated by the first terminal device y bits, the third message verification code;
其中,该目标密钥包括以下之一:该第一密钥,该第二密钥,该第二密钥派生的机密性保护密钥;Wherein, the target key includes one of the following: the first key, the second key, and a confidentiality protected key derived from the second key;
其中,该第三消息通过基于该第二密钥生成的该第三消息验证码进行完整性保护,或者,该第三消息通过基于该第二密钥派生的完整性保护密钥生成的该第三消息验证码进行完整性保护,该第三消息验证码的输入参数包括该y个比特位。Wherein, the third message is integrity protected through the third message verification code generated based on the second key, or the third message is integrity protected through the third message verification code generated based on the integrity protection key derived based on the second key. The three-message verification code performs integrity protection, and the input parameters of the third message verification code include the y bits.
在一些实施例中,该第二终端设备通过该目标密钥对该第三消息进行解密;In some embodiments, the second terminal device decrypts the third message using the target key;
在该第三消息中携带的信息未遭受篡改的情况下,且该第三消息验证码有效的情况下,该第二终端设备将该x个比特位与该y个比特位合并得到该第二密钥的标识。When the information carried in the third message has not been tampered with and the third message verification code is valid, the second terminal device combines the x bits and the y bits to obtain the second The identity of the key.
具体的,该第二终端设备可以基于该y个比特位生成第三消息验证码,并与该第三消息中包含的该第三消息验证码进行比较,若比较一致的情况下,该第三消息验证码有效。Specifically, the second terminal device can generate a third message verification code based on the y bits, and compare it with the third message verification code contained in the third message. If the comparison is consistent, the third message verification code The message verification code is valid.
具体例如,该第三消息为安全模式结束消息(security mode complete)。For example, the third message is a security mode complete message (security mode complete).
在一些实施例中,该第二终端设备通过该中继设备向该第一终端设备发送错误消息;其中,该错误消息包括以下至少之一:原因信息,第四消息验证码;其中,该原因信息用于指示该第二终端设备与该第一终端设备的安全策略冲突,或者,该原因信息用于指示该第一消息验证码验证失败,或者,该原因信息用于指示该第二终端设备与该第一终端设备的安全算法协商失败,该第四消息验证码的输入参数包括以下至少之一:该原因信息。In some embodiments, the second terminal device sends an error message to the first terminal device through the relay device; wherein the error message includes at least one of the following: cause information, a fourth message verification code; wherein the cause The information is used to indicate that the security policy of the second terminal device conflicts with the first terminal device, or the reason information is used to indicate that the first message verification code verification fails, or the reason information is used to indicate that the second terminal device The security algorithm negotiation with the first terminal device fails, and the input parameters of the fourth message verification code include at least one of the following: the reason information.
具体的,对于该第一终端设备,在该第四消息验证码有效的情况下,该第一终端设备确定安全模式建立失败,和/或,该第一终端设备重新发起安全模式建立流程。Specifically, for the first terminal device, if the fourth message verification code is valid, the first terminal device determines that the security mode establishment fails, and/or the first terminal device re-initiates the security mode establishment process.
在一些实施例中,该错误消息也可以受完整性保护。In some embodiments, the error message may also be integrity protected.
具体例如,该原因信息用于指示该第二终端设备与该第一终端设备的安全策略冲突,例如,该第二终端设备不支持该第一消息中携带的该第一终端设备的安全策略信息。Specifically, for example, the cause information is used to indicate that the security policy of the second terminal device conflicts with the first terminal device. For example, the second terminal device does not support the security policy information of the first terminal device carried in the first message. .
具体例如,该原因信息用于指示该第二终端设备与该第一终端设备的安全算法协商失败,例如,该第二终端设备不支持该第一消息中携带的该第一终端设备的安全能力信息。Specifically, for example, the cause information is used to indicate that the security algorithm negotiation between the second terminal device and the first terminal device failed. For example, the second terminal device does not support the security capabilities of the first terminal device carried in the first message. information.
在一些实施例中,该第二终端设备通过该中继设备向该第一终端设备发送认证请求消息;In some embodiments, the second terminal device sends an authentication request message to the first terminal device through the relay device;
其中,该认证请求消息包括以下至少之一:该第二终端设备所属用户的信息,该第二终端设备生成的第一临时公钥,该第二终端设备的签名,该中继设备的相关信息;The authentication request message includes at least one of the following: information about the user to which the second terminal device belongs, the first temporary public key generated by the second terminal device, the signature of the second terminal device, and relevant information about the relay device. ;
其中,该第二终端设备所属用户的信息包括该第二终端设备的标识和该第二终端设备的PVT和KPAK;该第二终端设备的签名的输入参数包括以下至少之一:该第二终端设备所属用户的信息和该第一临时公钥;该第一临时公钥和该中继设备的相关信息用于该第一终端设备派生第一密钥。Wherein, the information of the user to which the second terminal device belongs includes the identification of the second terminal device and the PVT and KPAK of the second terminal device; the input parameters of the signature of the second terminal device include at least one of the following: the second terminal The information of the user to which the device belongs and the first temporary public key; the first temporary public key and the relevant information of the relay device are used for the first terminal device to derive the first key.
在本申请实施例中,该第二终端设备的签名的输入参数包括以下至少之一:该第二终端设备所属用户的信息和该第一临时公钥。也即,该第二终端设备可以基于该第二终端设备所属用户的信息和该第一临时公钥中的至少之一,生成该第二终端设备的签名。In this embodiment of the present application, the input parameters of the signature of the second terminal device include at least one of the following: information of the user to which the second terminal device belongs and the first temporary public key. That is, the second terminal device may generate a signature of the second terminal device based on at least one of the information of the user to which the second terminal device belongs and the first temporary public key.
在本申请实施例中,该中继设备的签名的输入参数包括以下至少之一:该第二终端设备的签名和该中继设备所属用户的信息。也即,该中继设备可以基于该第二终端设备的签名和该中继设备所属用户的信息中的至少之一,生成该中继设备的签名。In this embodiment of the present application, the input parameters of the relay device's signature include at least one of the following: the signature of the second terminal device and the information of the user to which the relay device belongs. That is, the relay device may generate the signature of the relay device based on at least one of the signature of the second terminal device and the information of the user to which the relay device belongs.
在一些实施例中,在该第二终端设备所属用户的信息包括该第二终端设备的标识和该第二终端设备的PVT和KPAK的情况下,该第二终端设备的签名由该第二终端设备的秘密签名密钥(SSK)生 成。可选地,该第二终端设备的PVT和KPAK、以及秘密签名密钥(SSK)可以是可信中心KMS通过安全通道为该第二终端设备预先配置的。该安全通道可以基于AKMA机制或者GBA机制来建立该第二终端设备与KMS的安全连接,该KMS可以直接由运营商来负责管理或者是与运营商有商业关系的第三方服务提供商。In some embodiments, when the information of the user to which the second terminal device belongs includes the identification of the second terminal device and the PVT and KPAK of the second terminal device, the signature of the second terminal device is determined by the second terminal device. The device's Secret Signing Key (SSK) is generated. Optionally, the PVT, KPAK, and secret signature key (SSK) of the second terminal device may be pre-configured by the trusted center KMS for the second terminal device through a secure channel. The secure channel may be based on the AKMA mechanism or the GBA mechanism to establish a secure connection between the second terminal device and the KMS. The KMS may be directly managed by the operator or be a third-party service provider that has a commercial relationship with the operator.
在一些实施例中,该第一密钥可以是K D,该第一密钥的标识可以是K D ID;该第二密钥可以是K D-SESS,该第二密钥的标识可以是K D-SESS ID。 In some embodiments, the first key may be K D , and the identifier of the first key may be K D ID ; the second key may be K D -SESS , and the identifier of the second key may be K D-SESS ID.
在一些实施例中,该完整性保护密钥包括控制面的完整性保护密钥(K D-CPint)和用户面的完整性保护密钥(K D-UPint);和/或,该机密性保护密钥包括控制面的机密性保护密钥(K D-CPenc)和用户面的机密性保护密钥(K D-UPenc)。 In some embodiments, the integrity protection key includes an integrity protection key for the control plane (KD -CPint ) and an integrity protection key for the user plane ( KD-UPint ); and/or the confidentiality The protection keys include a confidentiality protection key for the control plane (K D-CPenc ) and a confidentiality protection key for the user plane (K D-UPenc ).
因此,在本申请实施例中,第一随机数、第一密钥和第二终端设备生成的第二随机数用于派生第二密钥,第二密钥用于派生完整性保护密钥和/或机密性保护密钥,能够保证第一终端设备和第二终端设备的身份安全与通信数据的机密性与完整性,从而确保双方传输数据的机密性和完整性,防止其他设备甚至中继设备的窃听。Therefore, in this embodiment of the present application, the first random number, the first key and the second random number generated by the second terminal device are used to derive the second key, and the second key is used to derive the integrity protection key and /or confidentiality protection key, which can ensure the identity security of the first terminal device and the second terminal device and the confidentiality and integrity of the communication data, thereby ensuring the confidentiality and integrity of the data transmitted by both parties and preventing other devices from even relaying Device eavesdropping.
本申请实施例适用于5G L2 UE-to-UE relay架构下第一终端设备(源设备)和第二终端设备(目标设备)之间的安全通信建立流程。借助公钥签名技术,能够确保终端设备的身份真实性和消息不可否认性,能够抗重放攻击、中间人攻击、伪装等多种主动攻击,同时保证认证流程消息的完整性,并且利用3GPP标准中使用的ECIES算法,从而建立了源UE和目标UE之间的端到端安全,确保双方传输数据的机密性和完整性,防止外部敌手甚至中继(relay)的窃听;本申请实施例保证了安全通信建立机制的可扩展性,另外,本申请实施例能够实现源UE和目标UE之间用户面和控制面安全策略、以及双方所支持加密和完整性保护算法的安全协商,能够实现完整性保护,抵抗篡改和降级攻击。The embodiment of this application is suitable for the secure communication establishment process between the first terminal device (source device) and the second terminal device (target device) under the 5G L2 UE-to-UE relay architecture. With the help of public key signature technology, it can ensure the identity authenticity of the terminal device and the non-repudiation of the message, and can resist replay attacks, man-in-the-middle attacks, disguise and other active attacks, while ensuring the integrity of the authentication process messages, and using the 3GPP standard The ECIES algorithm is used to establish end-to-end security between the source UE and the target UE, ensuring the confidentiality and integrity of the data transmitted by both parties, and preventing eavesdropping by external adversaries and even relays; the embodiment of this application ensures The scalability of the secure communication establishment mechanism. In addition, the embodiments of this application can realize the security negotiation of the user plane and control plane security policies between the source UE and the target UE, as well as the encryption and integrity protection algorithms supported by both parties, and can achieve integrity. Protect against tampering and downgrade attacks.
上文结合图7至图8,详细描述了本申请的第一终端设备侧实施例,下文结合图13,详细描述本申请的中继设备侧实施例,应理解,中继设备侧实施例与第一终端设备侧实施例相互对应,类似的描述可以参照第一终端设备侧实施例。The first terminal device side embodiment of the present application is described in detail above with reference to FIGS. 7 to 8 . Hereinafter, the relay device side embodiment of the present application is described in detail with reference to FIG. 13 . It should be understood that the relay device side embodiment is the same as the relay device side embodiment. The first terminal device side embodiments correspond to each other, and similar descriptions may refer to the first terminal device side embodiment.
图13是根据本申请实施例的中继通信的方法700的示意性流程图,如图13所示,该中继通信的方法700可以包括如下内容中的至少部分内容:Figure 13 is a schematic flowchart of a communication relay method 700 according to an embodiment of the present application. As shown in Figure 13, the communication relay method 700 may include at least part of the following content:
S710,中继设备接收第一终端设备发送的第一消息;其中,该第一消息包括以下至少之一:该第一终端设备的安全能力信息,该第一终端设备的安全策略信息,该第一终端设备所属用户的信息,该第一终端设备生成的第一随机数,该第一终端设备生成的第二临时公钥,该第一终端设备生成的第一密钥的标识的M个比特位,该第一终端设备的签名,第一消息验证码;其中,该第一终端设备所属用户的信息包括该第一终端设备的标识和该第一终端设备的PVT和KPAK;该第一终端设备的签名的输入参数包括以下至少之一:该第一终端设备所属用户的信息,该第二临时公钥,该第一密钥的标识的M个比特位,该第二终端设备的签名;其中,该第一消息通过基于该第一密钥生成的该第一消息验证码进行完整性保护,且该第一消息验证码的输入参数包括以下至少之一:该第一终端设备的安全能力信息,该第一终端设备的安全策略信息,该第一终端设备所属用户的信息,该第一随机数,该第二临时公钥,该M个比特位,该第一终端设备的签名;S710. The relay device receives the first message sent by the first terminal device; wherein the first message includes at least one of the following: security capability information of the first terminal device, security policy information of the first terminal device, Information about the user to which a terminal device belongs, the first random number generated by the first terminal device, the second temporary public key generated by the first terminal device, and the M bits of the identification of the first key generated by the first terminal device. bit, the signature of the first terminal device, and the first message verification code; wherein the information of the user to which the first terminal device belongs includes the identification of the first terminal device and the PVT and KPAK of the first terminal device; the first terminal The input parameters of the device's signature include at least one of the following: information about the user to which the first terminal device belongs, the second temporary public key, M bits of the identification of the first key, and the signature of the second terminal device; Wherein, the first message is integrity protected by the first message verification code generated based on the first key, and the input parameters of the first message verification code include at least one of the following: the security capability of the first terminal device Information, the security policy information of the first terminal device, the information of the user to which the first terminal device belongs, the first random number, the second temporary public key, the M bits, and the signature of the first terminal device;
S720,在该第一终端设备的KPAK有效,且基于该第一终端设备的标识和该第一终端设备的PVT对该第一终端设备的签名验证成功的情况下,该中继设备向该第二终端设备发送验证之后的第一消息;其中,该验证之后的第一消息包括以下至少之一:该第一终端设备的安全能力信息,该第一终端设备的安全策略信息,该第一终端设备所属用户的信息,该中继设备所属用户的信息,该第一终端设备生成的第一随机数,该第一终端设备生成的与该第二临时私钥配对的第二临时公钥,该第一终端设备生成的该第一密钥的标识的M个比特位,该第一终端设备的签名,该中继设备的签名,该中继设备的相关信息,该第一消息验证码;其中,该中继设备所属用户的信息包括该中继设备的标识和该中继设备的PVT和KPAK;该中继设备的签名的输入参数包括以下至少之一:该中继设备所属用户的信息,该第一终端设备的签名,该第二终端设备的签名,该验证之后的第一消息;其中,该第二临时公钥和该中继设备的相关信息用于该第二终端设备派生该第一密钥,该第一随机数、该第一密钥和该第二终端设备生成的第二随机数用于派生第二密钥,该第二密钥用于派生完整性保护密钥和/或机密性保护密钥,该第一密钥的标识由该M个比特位与该第一密钥的标识的另外N个比特位合并得到,M和N均为正整数;其中,该中继设备的相关信息包括以下之一:该中继设备的身份信息,该中继设备生成的随机数,该中继设备生成的计数器。S720: When the KPAK of the first terminal device is valid and the signature verification of the first terminal device based on the identity of the first terminal device and the PVT of the first terminal device is successful, the relay device sends a message to the first terminal device. The two terminal devices send the first message after verification; wherein the first message after verification includes at least one of the following: security capability information of the first terminal device, security policy information of the first terminal device, Information about the user to whom the device belongs, information about the user to whom the relay device belongs, the first random number generated by the first terminal device, the second temporary public key generated by the first terminal device and paired with the second temporary private key, the M bits of the identification of the first key generated by the first terminal device, the signature of the first terminal device, the signature of the relay device, the relevant information of the relay device, and the first message verification code; wherein , the information of the user to which the relay device belongs includes the identification of the relay device and the PVT and KPAK of the relay device; the input parameters of the signature of the relay device include at least one of the following: the information of the user to which the relay device belongs, The signature of the first terminal device, the signature of the second terminal device, and the first message after verification; wherein the second temporary public key and the relevant information of the relay device are used by the second terminal device to derive the third A key, the first random number, the first key and the second random number generated by the second terminal device are used to derive a second key, the second key is used to derive the integrity protection key and/ Or a confidentiality protection key, the identity of the first key is obtained by combining the M bits and the other N bits of the identity of the first key, where M and N are both positive integers; where, the relay The relevant information of the device includes one of the following: the identity information of the relay device, the random number generated by the relay device, and the counter generated by the relay device.
本实施例基于ECCSI签名方案,建立L2架构下的UE-to-UE中继场景下的安全连接。具体的,本申请实施例应用于L2架构下的UE-to-UE中继场景,也即,第一终端设备与第二终端设备之间通过中继设备进行通信。例如,第一终端设备与第二终端设备之间的中继连接可以是PC5链路。This embodiment is based on the ECCSI signature scheme to establish a secure connection in the UE-to-UE relay scenario under the L2 architecture. Specifically, the embodiments of this application are applied to the UE-to-UE relay scenario under the L2 architecture, that is, the first terminal device and the second terminal device communicate through the relay device. For example, the relay connection between the first terminal device and the second terminal device may be a PC5 link.
在本申请实施例中,第一终端设备生成的第一随机数、第一密钥和第二终端设备生成的第二随机数用于派生第二密钥。也即,第一终端设备至少根据第一随机数、第一密钥和第二随机数派生第二密钥,以及第一终端设备可以基于第二密钥派生完整性保护密钥和/或机密性保护密钥,从而第一终端设备可以基于完整性保护密钥和/或机密性保护密钥对发送的消息进行安全保护。同理,第二终端设备至少根据第一随机数、第一密钥和第二随机数派生第二密钥,以及第二终端设备可以基于第二密钥派生完整性保护密钥和/或机密性保护密钥,从而第二终端设备可以基于完整性保护密钥和/或机密性保护密钥对发送的消息进行安全保护。In this embodiment of the present application, the first random number and the first key generated by the first terminal device and the second random number generated by the second terminal device are used to derive the second key. That is, the first terminal device derives the second key based on at least the first random number, the first key and the second random number, and the first terminal device can derive the integrity protection key and/or the secret based on the second key. The first terminal device can securely protect the sent message based on the integrity protection key and/or the confidentiality protection key. Similarly, the second terminal device may derive the second key based on at least the first random number, the first key and the second random number, and the second terminal device may derive the integrity protection key and/or the secret based on the second key. The second terminal device can securely protect the sent message based on the integrity protection key and/or the confidentiality protection key.
在本申请实施例中,该第一消息验证码的输入参数包括以下至少之一:该第一终端设备的安全能力信息,该第一终端设备的安全策略信息,该第一随机数,该第二临时公钥,该M个比特位。也即,该第一终端设备可以基于该第一终端设备的安全能力信息、该第一终端设备的安全策略信息、该第一随机数、该第二临时公钥、该M个比特位中的至少之一,生成该第一消息验证码。In this embodiment of the present application, the input parameters of the first message verification code include at least one of the following: security capability information of the first terminal device, security policy information of the first terminal device, the first random number, the third 2. Temporary public key, the M bits. That is, the first terminal device can be based on the security capability information of the first terminal device, the security policy information of the first terminal device, the first random number, the second temporary public key, and the M bits. At least one of them generates the first message verification code.
具体例如,假设该第一消息验证码的输入参数包括:该第一终端设备的安全能力信息、该第一终端设备的安全策略信息、该第一随机数、该第二临时公钥、该M个比特位。该第二终端设备可以基于该第一终端设备的安全能力信息、该第一终端设备的安全策略信息、该第一随机数、该第二临时公钥、该M个比特位生成第一消息验证码,并与该第一消息中包含的该第一消息验证码进行比较,若比较一致的情况下,该第一消息验证码有效。For example, assume that the input parameters of the first message verification code include: the security capability information of the first terminal device, the security policy information of the first terminal device, the first random number, the second temporary public key, the M bits. The second terminal device may generate a first message verification based on the security capability information of the first terminal device, the security policy information of the first terminal device, the first random number, the second temporary public key, and the M bits. code and compare it with the first message verification code contained in the first message. If they are consistent, the first message verification code is valid.
在一些实施例中,该第一消息为认证响应消息,或者,该第一消息为安全模式命令消息。In some embodiments, the first message is an authentication response message, or the first message is a safe mode command message.
在一些实施例中,该第一终端设备的安全能力信息可以是该第一终端设备支持的密码算法列表。In some embodiments, the security capability information of the first terminal device may be a list of cryptographic algorithms supported by the first terminal device.
在一些实施例中,该第一终端设备的安全策略信息可以是该第一终端设备是否支持机密性保护或完整性保护。其中,该第一终端设备的安全策略信息包括:该第一终端设备在控制面的安全策略信息,和/或,该第一终端设备在用户面的安全策略信息。In some embodiments, the security policy information of the first terminal device may be whether the first terminal device supports confidentiality protection or integrity protection. The security policy information of the first terminal device includes: the security policy information of the first terminal device on the control plane, and/or the security policy information of the first terminal device on the user plane.
在一些实施例中,该M个比特位可以是该第一密钥的标识的最高M个比特位,该N个比特位可以是该第一密钥的标识的最低N个比特位;或者,该M个比特位可以是该第一密钥的标识的前M个比特位,该N个比特位可以是该第一密钥的标识的后N个比特位;或者,该M个比特位可以是该第一密钥的标识的偶数位的比特位,该N个比特位可以是该第一密钥的标识的奇数位的比特位。In some embodiments, the M bits may be the highest M bits of the identity of the first key, and the N bits may be the lowest N bits of the identity of the first key; or, The M bits may be the first M bits of the identifier of the first key, and the N bits may be the last N bits of the identifier of the first key; or, the M bits may be are the even-numbered bits of the identifier of the first key, and the N bits may be the odd-numbered bits of the identifier of the first key.
在一些实施例中,M与N的取值可以相同,也可以不同,本申请对此并不限定。In some embodiments, the values of M and N may be the same or different, which is not limited by this application.
在一些实施例中,该中继设备将该第二终端设备发送的第二消息转发至该第一终端设备;In some embodiments, the relay device forwards the second message sent by the second terminal device to the first terminal device;
其中,该第二消息包括以下至少之一:该第二终端设备生成的该第二随机数,该第二终端设备生成的该第一密钥的标识的N个比特位,该第二终端设备生成的该第二密钥的标识的x个比特位,该第二终端设备选取的安全算法,该第二终端设备选取的安全策略,第二消息验证码;Wherein, the second message includes at least one of the following: the second random number generated by the second terminal device, N bits of the identification of the first key generated by the second terminal device, x bits of the identifier of the generated second key, the security algorithm selected by the second terminal device, the security policy selected by the second terminal device, and the second message verification code;
其中,该第二消息通过基于该第二密钥生成的该第二消息验证码进行完整性保护,或者,该第二消息通过基于该第二密钥派生的完整性保护密钥生成的该第二消息验证码进行完整性保护,且该第二消息验证码的输入参数包括以下至少之一:该第二随机数,该N个比特位,该x个比特位,该第二终端设备选取的安全算法,该第二终端设备选取的安全策略;Wherein, the second message is integrity protected through the second message verification code generated based on the second key, or the second message is integrity protected through the third integrity protection key generated based on the second key. The second message verification code performs integrity protection, and the input parameters of the second message verification code include at least one of the following: the second random number, the N bits, the x bits, and the second terminal device selected Security algorithm, the security policy selected by the second terminal device;
其中,该第二密钥的标识由该x个比特位与该第二密钥的标识的另外y个比特位合并得到,x和y均为正整数。Wherein, the identifier of the second key is obtained by combining the x bits and the other y bits of the identifier of the second key, and both x and y are positive integers.
在一些实施例中,该x个比特位可以是该第二密钥的标识的最高x个比特位,该y个比特位可以是该第二密钥的标识的最低y个比特位;或者,该x个比特位可以是该第二密钥的标识的前x个比特位,该y个比特位可以是该第二密钥的标识的后y个比特位;或者,该x个比特位可以是该第二密钥的标识的偶数位的比特位,该y个比特位可以是该第二密钥的标识的奇数位的比特位。In some embodiments, the x bits may be the highest x bits of the identity of the second key, and the y bits may be the lowest y bits of the identity of the second key; or, The x bits may be the first x bits of the identifier of the second key, and the y bits may be the last y bits of the identifier of the second key; or, the x bits may be are the even-numbered bits of the identifier of the second key, and the y bits may be the odd-numbered bits of the identifier of the second key.
在一些实施例中,x与y的取值可以相同,也可以不同,本申请对此并不限定。In some embodiments, the values of x and y may be the same or different, which is not limited by this application.
具体例如,假设该第二消息验证码的输入参数包括:该第二随机数、该N个比特位、该x个比特位、该第二终端设备选取的安全算法、该第二终端设备选取的安全策略。该第一终端设备可以基于该第二随机数、该N个比特位、该x个比特位、该第二终端设备选取的安全算法、该第二终端设备选取的安全策略生成第二消息验证码,并与该第二消息中包含的该第二消息验证码进行比较,若比较一致的情况下,该第二消息验证码有效。For example, assume that the input parameters of the second message verification code include: the second random number, the N bits, the x bits, the security algorithm selected by the second terminal device, the security strategy. The first terminal device may generate a second message verification code based on the second random number, the N bits, the x bits, the security algorithm selected by the second terminal device, and the security policy selected by the second terminal device. , and compared with the second message verification code contained in the second message. If they are consistent, the second message verification code is valid.
在一些实施例中,该第二消息通过该第一密钥进行加密。当然,该第二消息也可以不通过该第一密钥进行加密,或者,该第二消息也可以不加密。In some embodiments, the second message is encrypted with the first key. Of course, the second message may not be encrypted using the first key, or the second message may not be encrypted.
具体的,该第二终端设备可以基于该第一终端设备的安全能力信息选取安全算法,和/或,该第二终端设备可以基于该第一终端设备的安全策略信息选取安全策略。Specifically, the second terminal device may select a security algorithm based on the security capability information of the first terminal device, and/or the second terminal device may select a security policy based on the security policy information of the first terminal device.
在一些实施例中,该第一终端设备可以根据该第一随机数、该第一密钥、该第二随机数,以及源标识、目标标识、该第一随机数的长度、该第二随机数的长度、该源标识的长度、该目标标识的长度 中的至少之一,生成该第二密钥。以及该第二终端设备可以根据该第一随机数、该第一密钥、该第二随机数,以及源标识、目标标识、该第一随机数的长度、该第二随机数的长度、该源标识的长度、该目标标识的长度中的至少之一,生成该第二密钥。In some embodiments, the first terminal device may use the first random number, the first key, the second random number, the source identifier, the target identifier, the length of the first random number, the second random number. At least one of the length of the number, the length of the source identifier, and the length of the target identifier is used to generate the second key. And the second terminal device can use the first random number, the first key, the second random number, the source identifier, the target identifier, the length of the first random number, the length of the second random number, the The second key is generated using at least one of the length of the source identifier and the length of the target identifier.
其中,该源标识用于标识该第一终端设备与该第二终端设备之间的中继连接的源端,该目标标识用于标识该第一终端设备与该第二终端设备之间的中继连接的目标端。另外,该第二密钥的输入参数还可以包括其他系统设定参数,如3GPP指定的一个或多个固定参数。Wherein, the source identifier is used to identify the source end of the relay connection between the first terminal device and the second terminal device, and the target identifier is used to identify the intermediate connection between the first terminal device and the second terminal device. The destination of the connection. In addition, the input parameters of the second key may also include other system setting parameters, such as one or more fixed parameters specified by 3GPP.
在一些实施例中,该第一消息为认证响应消息,该第二消息为安全模式命令(SMC)消息。In some embodiments, the first message is an authentication response message and the second message is a secure mode command (SMC) message.
在一些实施例中,该第一消息为安全模式命令(SMC)消息,该第二消息为安全模式响应消息。In some embodiments, the first message is a safe mode command (SMC) message and the second message is a safe mode response message.
在一些实施例中,该中继设备将该第一终端设备发送的第三消息转发至该第二终端设备;In some embodiments, the relay device forwards the third message sent by the first terminal device to the second terminal device;
其中,该第三消息用于指示安全模式建立完成,该第三消息通过目标密钥进行加密,且该第三消息包括以下至少之一:该第一终端设备生成的该第二密钥的标识的y个比特位,第三消息验证码;Wherein, the third message is used to indicate that the security mode establishment is completed, the third message is encrypted by the target key, and the third message includes at least one of the following: the identification of the second key generated by the first terminal device y bits, the third message verification code;
其中,该目标密钥包括以下之一:该第一密钥,该第二密钥,该第二密钥派生的机密性保护密钥;Wherein, the target key includes one of the following: the first key, the second key, and a confidentiality protected key derived from the second key;
其中,该第三消息通过基于该第二密钥生成的该第三消息验证码进行完整性保护,或者,该第三消息通过基于该第二密钥派生的完整性保护密钥生成的该第三消息验证码进行完整性保护,该第三消息验证码的输入参数包括该y个比特位。Wherein, the third message is integrity protected through the third message verification code generated based on the second key, or the third message is integrity protected through the third message verification code generated based on the integrity protection key derived based on the second key. The three-message verification code performs integrity protection, and the input parameters of the third message verification code include the y bits.
在一些实施例中,对于该第二终端设备,该第二终端设备通过该目标密钥对该第三消息进行解密;在该第三消息中携带的信息未遭受篡改的情况下,且该第三消息验证码有效的情况下,该第二终端设备将该x个比特位与该y个比特位合并得到该第二密钥的标识。In some embodiments, for the second terminal device, the second terminal device decrypts the third message using the target key; provided that the information carried in the third message has not been tampered with, and the third message When the three-message verification code is valid, the second terminal device combines the x bits and the y bits to obtain the identity of the second key.
具体的,该第二终端设备可以基于该y个比特位生成第三消息验证码,并与该第三消息中包含的该第三消息验证码进行比较,若比较一致的情况下,该第三消息验证码有效。Specifically, the second terminal device can generate a third message verification code based on the y bits, and compare it with the third message verification code contained in the third message. If the comparison is consistent, the third message verification code The message verification code is valid.
具体例如,该第三消息为安全模式结束消息(security mode complete)。For example, the third message is a security mode complete message (security mode complete).
在一些实施例中,该中继设备将该第二终端设备发送的错误消息转发至该第一终端设备;其中,该错误消息包括以下至少之一:原因信息,第四消息验证码;其中,该原因信息用于指示该第二终端设备与该第一终端设备的安全策略冲突,或者,该原因信息用于指示该第一消息验证码验证失败,或者,该原因信息用于指示该第二终端设备与该第一终端设备的安全算法协商失败,该第四消息验证码的输入参数包括以下至少之一:该原因信息。In some embodiments, the relay device forwards the error message sent by the second terminal device to the first terminal device; wherein the error message includes at least one of the following: cause information, fourth message verification code; wherein, The reason information is used to indicate that the security policy of the second terminal device conflicts with the first terminal device, or the reason information is used to indicate that the first message verification code verification fails, or the reason information is used to indicate that the second terminal device The security algorithm negotiation between the terminal device and the first terminal device fails, and the input parameters of the fourth message verification code include at least one of the following: the reason information.
具体的,在该第四消息验证码有效的情况下,该第一终端设备确定安全模式建立失败,和/或,该第一终端设备重新发起安全模式建立流程。Specifically, when the fourth message verification code is valid, the first terminal device determines that the security mode establishment fails, and/or the first terminal device re-initiates the security mode establishment process.
在一些实施例中,该错误消息也可以受完整性保护。In some embodiments, the error message may also be integrity protected.
具体例如,该原因信息用于指示该第二终端设备与该第一终端设备的安全策略冲突,例如,该第二终端设备不支持该第一消息中携带的该第一终端设备的安全策略信息。Specifically, for example, the cause information is used to indicate that the security policy of the second terminal device conflicts with the first terminal device. For example, the second terminal device does not support the security policy information of the first terminal device carried in the first message. .
具体例如,该原因信息用于指示该第二终端设备与该第一终端设备的安全算法协商失败,例如,该第二终端设备不支持该第一消息中携带的该第一终端设备的安全能力信息。Specifically, for example, the cause information is used to indicate that the security algorithm negotiation between the second terminal device and the first terminal device failed. For example, the second terminal device does not support the security capabilities of the first terminal device carried in the first message. information.
在一些实施例中,该中继设备接收该第二终端设备发送的认证请求消息;其中,该认证请求消息包括以下至少之一:该第二终端设备所属用户的信息,该第二终端设备生成的第一临时公钥,该第二终端设备的签名;其中,该第二终端设备所属用户的信息包括该第二终端设备的标识和该第二终端设备的PVT和KPAK;该第二终端设备的签名的输入参数包括以下至少之一:该第二终端设备所属用户的信息和该第一临时公钥;该第一临时公钥和该中继设备的相关信息用于该第一终端设备派生该第一密钥;In some embodiments, the relay device receives an authentication request message sent by the second terminal device; wherein the authentication request message includes at least one of the following: information about the user to which the second terminal device belongs, and generated by the second terminal device. The first temporary public key, the signature of the second terminal device; wherein the information of the user to which the second terminal device belongs includes the identification of the second terminal device and the PVT and KPAK of the second terminal device; the second terminal device The input parameters of the signature include at least one of the following: the information of the user to which the second terminal device belongs and the first temporary public key; the first temporary public key and the relevant information of the relay device are used to derive the first terminal device the first key;
在该第二终端设备的KPAK有效,且基于该第二终端设备的标识和该第二终端设备的PVT对该第二终端设备的签名验证成功的情况下,该中继设备向该第一终端设备发送验证之后的认证请求消息;其中,该验证之后的认证请求消息包括以下至少之一:该第二终端设备所属用户的信息,该中继设备所属用户的信息,该第一临时公钥,该第二终端设备的签名,该中继设备的签名,该中继设备的相关信息;其中,该中继设备所属用户的信息包括该中继设备的标识和该中继设备的PVT和KPAK;该中继设备的签名的输入参数包括以下至少之一:该第二终端设备的签名和该中继设备所属用户的信息。When the KPAK of the second terminal device is valid and the signature verification of the second terminal device based on the identity of the second terminal device and the PVT of the second terminal device is successful, the relay device sends a message to the first terminal device. The device sends an authentication request message after verification; wherein the authentication request message after verification includes at least one of the following: information about the user to which the second terminal device belongs, information about the user to which the relay device belongs, the first temporary public key, The signature of the second terminal device, the signature of the relay device, and the relevant information of the relay device; wherein the information of the user to which the relay device belongs includes the identification of the relay device and the PVT and KPAK of the relay device; The input parameters of the relay device's signature include at least one of the following: the signature of the second terminal device and the information of the user to which the relay device belongs.
在本申请实施例中,该第二终端设备的签名的输入参数包括以下至少之一:该第二终端设备所属用户的信息和该第一临时公钥。也即,该第二终端设备可以基于该第二终端设备所属用户的信息和该第一临时公钥中的至少之一,生成该第二终端设备的签名。In this embodiment of the present application, the input parameters of the signature of the second terminal device include at least one of the following: information of the user to which the second terminal device belongs and the first temporary public key. That is, the second terminal device may generate a signature of the second terminal device based on at least one of the information of the user to which the second terminal device belongs and the first temporary public key.
在本申请实施例中,该中继设备的签名的输入参数包括以下至少之一:该第二终端设备的签名和该中继设备所属用户的信息。也即,该中继设备可以基于该第二终端设备的签名和该中继设备所属用户的信息中的至少之一,生成该中继设备的签名。In this embodiment of the present application, the input parameters of the relay device's signature include at least one of the following: the signature of the second terminal device and the information of the user to which the relay device belongs. That is, the relay device may generate the signature of the relay device based on at least one of the signature of the second terminal device and the information of the user to which the relay device belongs.
具体的,该中继设备可以基于其本地存储的一个或多个KPAK,验证该第二终端设备的KPAK的有效性。例如,在中继设备本地存储的KPAK中存在与第二终端设备的KPAK一致的KPAK的情况下,该第二终端设备的KPAK有效。可选地,该第一终端设备本地存储的一个或多个KPAK可以由KMS预配置。Specifically, the relay device may verify the validity of the KPAK of the second terminal device based on one or more KPAKs stored locally. For example, if there is a KPAK consistent with the KPAK of the second terminal device among the KPAKs stored locally on the relay device, the KPAK of the second terminal device is valid. Optionally, one or more KPAKs stored locally on the first terminal device may be pre-configured by the KMS.
在本申请实施例中,第一终端设备可以根据第二终端设备生成的第一临时公钥、中继设备的相关信息和第一终端设备生成的第二临时私钥派生第一密钥。相应的,第二终端设备可以根据第一终端设备生成的第二临时公钥、中继设备的相关信息和第二终端设备生成的第一临时私钥派生第一密钥。其中,第二终端设备生成的第一临时公钥与第二终端设备生成的第一临时私钥配对,第一终端设备生成的第二临时公钥与第一终端设备生成的第二临时私钥配对。In this embodiment of the present application, the first terminal device may derive the first key based on the first temporary public key generated by the second terminal device, relevant information of the relay device, and the second temporary private key generated by the first terminal device. Correspondingly, the second terminal device may derive the first key based on the second temporary public key generated by the first terminal device, the relevant information of the relay device, and the first temporary private key generated by the second terminal device. Wherein, the first temporary public key generated by the second terminal device is paired with the first temporary private key generated by the second terminal device, and the second temporary public key generated by the first terminal device is paired with the second temporary private key generated by the first terminal device. pair.
具体例如,第一终端设备可以根据第一临时公钥和第二临时私钥,并使用ECIES算法计算出第一密钥;第二终端设备可以根据第二临时公钥和第一临时私钥,并使用ECIES算法计算出第一密钥。For example, the first terminal device can calculate the first key based on the first temporary public key and the second temporary private key and use the ECIES algorithm; the second terminal device can calculate the first key based on the second temporary public key and the first temporary private key. And use the ECIES algorithm to calculate the first key.
在一些实施例中,在该第二终端设备所属用户的信息包括该第二终端设备的标识和该第二终端设备的PVT和KPAK的情况下,该第二终端设备的签名由该第二终端设备的秘密签名密钥(SSK)生成。可选地,该第二终端设备的PVT和KPAK、以及秘密签名密钥(SSK)可以是可信中心KMS通过安全通道为该第二终端设备预先配置的。该安全通道可以基于AKMA机制或者GBA机制来建立该第二终端设备与KMS的安全连接,该KMS可以直接由运营商来负责管理或者是与运营商有商业关系的第三方服务提供商。In some embodiments, when the information of the user to which the second terminal device belongs includes the identification of the second terminal device and the PVT and KPAK of the second terminal device, the signature of the second terminal device is determined by the second terminal device. The device's Secret Signing Key (SSK) is generated. Optionally, the PVT, KPAK, and secret signature key (SSK) of the second terminal device may be pre-configured by the trusted center KMS for the second terminal device through a secure channel. The secure channel may be based on the AKMA mechanism or the GBA mechanism to establish a secure connection between the second terminal device and the KMS. The KMS may be directly managed by the operator or be a third-party service provider that has a commercial relationship with the operator.
在一些实施例中,在该中继设备所属用户的信息包括该中继设备的标识、该中继设备的PVT和KPAK的情况下,该中继设备的签名由该中继设备的秘密签名密钥(SSK)生成。可选地,该中继设备的PVT和KPAK、以及秘密签名密钥(SSK)可以是可信中心KMS通过安全通道为该中继设备预先配置的。该安全通道可以基于AKMA机制或者GBA机制来建立该中继设备与KMS的安全连接,该KMS可以直接由运营商来负责管理或者是与运营商有商业关系的第三方服务提供商。In some embodiments, when the information about the user of the relay device includes the identity of the relay device, the PVT and KPAK of the relay device, the signature of the relay device is encrypted by the secret signature of the relay device. Key (SSK) is generated. Optionally, the PVT, KPAK, and secret signature key (SSK) of the relay device may be pre-configured for the relay device by the trusted center KMS through a secure channel. The secure channel can be based on the AKMA mechanism or the GBA mechanism to establish a secure connection between the relay device and the KMS. The KMS can be directly managed by the operator or a third-party service provider that has a commercial relationship with the operator.
在一些实施例中,该第一密钥可以是K D,该第一密钥的标识可以是K D ID;该第二密钥可以是K D-SESS,该第二密钥的标识可以是K D-SESS ID。 In some embodiments, the first key may be K D , and the identifier of the first key may be K D ID ; the second key may be K D -SESS , and the identifier of the second key may be K D-SESS ID.
在一些实施例中,该完整性保护密钥包括控制面的完整性保护密钥(K D-CPint)和用户面的完整性保护密钥(K D-UPint);和/或,该机密性保护密钥包括控制面的机密性保护密钥(K D-CPenc)和用户面的机密性保护密钥(K D-UPenc)。 In some embodiments, the integrity protection key includes an integrity protection key for the control plane (KD -CPint ) and an integrity protection key for the user plane ( KD-UPint ); and/or the confidentiality The protection keys include a confidentiality protection key for the control plane (K D-CPenc ) and a confidentiality protection key for the user plane (K D-UPenc ).
因此,在本申请实施例中,第一随机数、第一密钥和第二终端设备生成的第二随机数用于派生第二密钥,第二密钥用于派生完整性保护密钥和/或机密性保护密钥,能够保证第一终端设备和第二终端设备的身份安全与通信数据的机密性与完整性,从而确保双方传输数据的机密性和完整性,防止其他设备甚至中继设备的窃听。Therefore, in this embodiment of the present application, the first random number, the first key and the second random number generated by the second terminal device are used to derive the second key, and the second key is used to derive the integrity protection key and /or confidentiality protection key, which can ensure the identity security of the first terminal device and the second terminal device and the confidentiality and integrity of the communication data, thereby ensuring the confidentiality and integrity of the data transmitted by both parties and preventing other devices from even relaying Device eavesdropping.
本申请实施例适用于5G L2 UE-to-UE relay架构下源设备(第一终端设备)和目标设备(第二终端设备)之间的安全通信建立流程。借助公钥签名技术,能够确保终端设备的身份真实性和消息不可否认性,能够抗重放攻击、中间人攻击、伪装等多种主动攻击,同时保证认证流程消息的完整性,并且利用3GPP标准中使用的ECIES算法,从而建立了源UE和目标UE之间的端到端安全,确保双方传输数据的机密性和完整性,防止外部敌手甚至中继(relay)的窃听;本申请实施例保证了安全通信建立机制的可扩展性,另外,本申请实施例能够实现源UE和目标UE之间用户面和控制面安全策略、以及双方所支持加密和完整性保护算法的安全协商,能够实现完整性保护,抵抗篡改和降级攻击。The embodiment of this application is suitable for the secure communication establishment process between the source device (first terminal device) and the target device (second terminal device) under the 5G L2 UE-to-UE relay architecture. With the help of public key signature technology, it can ensure the identity authenticity of the terminal device and the non-repudiation of the message, and can resist replay attacks, man-in-the-middle attacks, disguise and other active attacks, while ensuring the integrity of the authentication process messages, and using the 3GPP standard The ECIES algorithm is used to establish end-to-end security between the source UE and the target UE, ensuring the confidentiality and integrity of the data transmitted by both parties, and preventing eavesdropping by external adversaries and even relays; the embodiment of this application ensures The scalability of the secure communication establishment mechanism. In addition, the embodiments of this application can realize the security negotiation of the user plane and control plane security policies between the source UE and the target UE, as well as the encryption and integrity protection algorithms supported by both parties, and can achieve integrity. Protect against tampering and downgrade attacks.
以下通过实施例1至实施例2详述本申请L2架构下的UE-to-UE中继场景中基于签名的安全通信建立流程。The signature-based secure communication establishment process in the UE-to-UE relay scenario under the L2 architecture of this application is described in detail below through Embodiment 1 to Embodiment 2.
实施例1,如图14所示,假设所有设备之间在此之前没有建立任何安全连接,可以通过S1-0至S1-8中的部分或全部步骤建立L2架构下的UE-to-UE中继场景下基于签名的安全通信连接。具体的,UE1可以是第一终端设备,UE2可以是第二终端设备,UE-to-UE relay可以是中继设备,K D可以是第一密钥,K D-SESS可以是第二密钥。 Embodiment 1, as shown in Figure 14, assuming that no secure connection has been established between all devices before, UE-to-UE under the L2 architecture can be established through some or all of the steps from S1-0 to S1-8. Signature-based secure communication connection in subsequent scenarios. Specifically, UE1 may be the first terminal device, UE2 may be the second terminal device, UE-to-UE relay may be the relay device, K D may be the first key, and K D-SESS may be the second key .
S1-0.UE1、UE2、终端至终端中继设备(UE-to-UE relay)获得了密钥管理服务器(KMS)下发的签名公钥(KPAK),以及一组与UE标识相关的凭证,即秘密签名密钥(SSK)和公共验证参数(PVT),可使用UE-to-UE relay服务。UE-to-UE relay向网络注册可提供UE-to-UE Relay功能,UE-to-UE Relay配置了中继策略参数。S1-0.UE1, UE2, and terminal-to-UE relay equipment (UE-to-UE relay) obtained the signature public key (KPAK) issued by the key management server (KMS) and a set of credentials related to the UE identity. , namely the Secret Signing Key (SSK) and Public Verification Parameters (PVT), can use the UE-to-UE relay service. UE-to-UE relay registers with the network to provide the UE-to-UE Relay function, and the UE-to-UE Relay is configured with relay policy parameters.
S1-1.UE2确定PC5单播链路建立时信令接收的目的L2 ID。S1-1.UE2 determines the destination L2 ID for signaling reception when the PC5 unicast link is established.
S1-2.UE1通过广播方式发送端到端的直接通信请求消息,具体的,在源终端(即UE1)上,应用层向ProSe层提供PC5单播通信的信息(如广播L2 ID、ProSe应用层ID、终端应用层ID、目标终端应用层ID、中继适用指示),ProSe层通过发送端到端广播直接通信请求消息触发终端的发现机制。 消息使用源L2 ID和广播L2 ID作为目的发送,并包含其他与应用程序相关的参数。S1-2.UE1 sends an end-to-end direct communication request message through broadcast. Specifically, on the source terminal (i.e. UE1), the application layer provides PC5 unicast communication information (such as broadcast L2 ID, ProSe application layer) to the ProSe layer. ID, terminal application layer ID, target terminal application layer ID, relay applicable indication), the ProSe layer triggers the terminal's discovery mechanism by sending an end-to-end broadcast direct communication request message. Messages are sent using the source L2 ID and broadcast L2 ID as destination, and contain other application-related parameters.
S1-3.UE-to-UE Relay接收广播的直接通信请求消息,并验证UE-to-UE Relay是否配置为转发这个应用程序,例如,UE-to-UE Relay将宣布的ProSe应用ID与它所提供的中继策略/参数进行比较。UE-to-UE Relay转发端到端广播的直接通信请求消息时,使用自己的L2 ID作为源(Source)L2 ID,并在消息中添加UE-to-UE Relay的UE ID,在适配层指定标识UE1的信息。UE-to-UE Relay在ProSe层处理此端到端广播消息,并根据适配层信息转发任何后续的端到端PC5-S消息。S1-3.UE-to-UE Relay receives the broadcast direct communication request message and verifies whether the UE-to-UE Relay is configured to forward this application. For example, the UE-to-UE Relay will announce the same ProSe application ID as it The provided relay policies/parameters are compared. When UE-to-UE Relay forwards the direct communication request message broadcast end-to-end, it uses its own L2 ID as the source (Source) L2 ID, and adds the UE ID of UE-to-UE Relay in the message. In the adaptation layer Specify information identifying UE1. UE-to-UE Relay processes this end-to-end broadcast message at the ProSe layer and forwards any subsequent end-to-end PC5-S messages based on the adaptation layer information.
S1-4a.UE2对宣布的应用程序感兴趣,如果UE2和UE-to-UE Relay之间不存在每跳链路,UE2会触发UE-to-UE Relay建立每跳链路。UE2发送每跳链路建立过程消息,源地址是UE2 L2 ID,目的地址是中继的L2 ID。S1-4a.UE2 is interested in the announced application. If there is no per-hop link between UE2 and UE-to-UE Relay, UE2 will trigger the UE-to-UE Relay to establish a per-hop link. UE2 sends a link establishment process message for each hop. The source address is the UE2 L2 ID and the destination address is the relay's L2 ID.
S1-4b.如果UE-to-UE relay和UE1之间不存在每跳链路,则执行UE-to-UE relay和UE1之间的每跳链路建立过程。UE1将自己的L2 ID作为源地址,中继的L2 ID作为目的地址。S1-4b. If there is no per-hop link between UE-to-UE relay and UE1, perform a per-hop link establishment process between UE-to-UE relay and UE1. UE1 uses its own L2 ID as the source address and the relay's L2 ID as the destination address.
S1-5a.当UE-2和UE-to-UE relay成功建立了每跳链路(per hop link),将进一步触发UE2和UE1间端到端安全的建立。若UE2已具备K D ID及安全环境,同时UE1和UE2之间建立不同(Source ID、Destination ID)组之间的链接安全上下文时,那么可选的是,UE2可以省略认证流程,直接执行安全模式命令消息,或者考虑更高安全性,重新继续执行认证流程,创建该Source ID与Destination ID组下的崭新安全环境;若UE1和UE2初次建立安全连接,那么UE2必须通过UE-to-UE relay和UE1执行认证流程。当执行认证流程时,UE2首先产生一对临时公私钥,即第一临时公钥(Ephemeral public key1)和第一临时私钥(Ephemeral private key1),然后通过UE-to-UE relay与UE1进行通信。 S1-5a. When UE-2 and UE-to-UE relay successfully establish a per hop link, the establishment of end-to-end security between UE2 and UE1 will be further triggered. If UE2 already has a K D ID and security environment, and a link security context between different (Source ID, Destination ID) groups is established between UE1 and UE2, then optionally, UE2 can omit the authentication process and directly perform security mode command message, or considering higher security, continue the authentication process to create a new security environment under the Source ID and Destination ID group; if UE1 and UE2 establish a secure connection for the first time, then UE2 must pass the UE-to-UE relay Perform the authentication process with UE1. When performing the authentication process, UE2 first generates a pair of temporary public and private keys, namely the first temporary public key (Ephemeral public key1) and the first temporary private key (Ephemeral private key1), and then communicates with UE1 through the UE-to-UE relay. .
具体的,UE2发送认证请求消息,包括以下参数:Specifically, UE2 sends an authentication request message, including the following parameters:
UE2所属用户的信息,其中,UE2所属用户的信息包括UE2的标识和UE2的PVT和KPAK;Information about the user to which UE2 belongs, where the information about the user to which UE2 belongs includes the identity of UE2 and the PVT and KPAK of UE2;
第一临时公钥(Ephemeral public key1);The first temporary public key (Ephemeral public key1);
UE2的签名,其中,UE2的签名的输入参数包括以下至少之一:“UE2所属用户的信息”和“第一临时公钥”。The signature of UE2, wherein the input parameters of the signature of UE2 include at least one of the following: "information of the user to which UE2 belongs" and "first temporary public key".
S1-5b.在收到认证请求消息后,UE-to-UE relay验证UE2所属用户的信息中的UE2的KPAK有效性(具体的,UE-to-UE relay根据本地存储信息验证UE2的KPAK有效性,例如,在UE-to-UE relay本地存储的KPAK中存在与UE2的KPAK一致的KPAK,UE2的KPAK有效),UE-to-UE relay基于UE2的标识和UE2的PVT对UE2的签名进行验证。S1-5b. After receiving the authentication request message, the UE-to-UE relay verifies the validity of the KPAK of UE2 in the information of the user to which UE2 belongs (specifically, the UE-to-UE relay verifies that the KPAK of UE2 is valid based on the locally stored information. For example, in the KPAK stored locally in the UE-to-UE relay, there is a KPAK consistent with the KPAK of UE2, and the KPAK of UE2 is valid). The UE-to-UE relay performs the signature of UE2 based on the identity of UE2 and the PVT of UE2. verify.
最后,如果UE2的签名验证有效,那么UE-to-UE relay向UE1发送验证之后的认证请求消息,验证之后的认证请求消息除了包括上述认证请求消息内的全部内容外,还包括以下参数:Finally, if the signature verification of UE2 is valid, then the UE-to-UE relay sends a verified authentication request message to UE1. In addition to all the contents in the above authentication request message, the verified authentication request message also includes the following parameters:
UE-to-UE relay所属用户的信息,其中,UE-to-UE relay所属用户的信息包括UE-to-UE relay的标识和UE-to-UE relay的PVT和KPAK;The information of the user to which the UE-to-UE relay belongs. The information of the user to which the UE-to-UE relay belongs includes the identification of the UE-to-UE relay and the PVT and KPAK of the UE-to-UE relay;
UE-to-UE relay的签名,其中,UE-to-UE relay的签名中输入参数包括以下至少之一:“UE2的签名”和“UE-to-UE relay所属用户的信息”;The signature of the UE-to-UE relay, where the input parameters in the signature of the UE-to-UE relay include at least one of the following: "UE2's signature" and "information of the user to which the UE-to-UE relay belongs";
UE-to-UE relay的相关信息,其中,该UE-to-UE relay的相关信息包括以下之一:该UE-to-UE relay的身份信息,该UE-to-UE relay生成的随机数,该UE-to-UE relay生成的计数器。The relevant information of the UE-to-UE relay, where the relevant information of the UE-to-UE relay includes one of the following: the identity information of the UE-to-UE relay, the random number generated by the UE-to-UE relay, Counter generated by this UE-to-UE relay.
S1-6a.在收到认证请求消息后,UE1分别检查UE2的KPAK和UE-to-UE relay的KPAK,在UE2的KPAK和UE-to-UE relay的KPAK有效的情况下,且基于UE2的标识和UE2的PVT对UE2的签名进行验证,以及基于UE-to-UE relay的标识和UE-to-UE relay的PVT对UE-to-UE relay的签名进行验证。如果UE2的签名和UE-to-UE relay的签名验证成功,那么UE1产生临时公私钥对,即第二临时公钥(Ephemeral public key2)和第二临时私钥(Ephemeral private key2),然后,UE1根据第一临时公钥、UE-to-UE relay的相关信息和第二临时私钥,使用ECIES算法,计算出共享密钥K D,并且生成K D ID的M个比特位,K D ID用于标识K DS1-6a. After receiving the authentication request message, UE1 checks the KPAK of UE2 and the KPAK of the UE-to-UE relay respectively. If the KPAK of UE2 and the KPAK of the UE-to-UE relay are valid, and based on the KPAK of UE2 The signature of UE2 is verified based on the identity and the PVT of UE2, and the signature of the UE-to-UE relay is verified based on the identity of the UE-to-UE relay and the PVT of the UE-to-UE relay. If the signature of UE2 and the signature of UE-to-UE relay are verified successfully, then UE1 generates a temporary public and private key pair, that is, the second temporary public key (Ephemeral public key2) and the second temporary private key (Ephemeral private key2). Then, UE1 According to the first temporary public key, UE-to-UE relay related information and the second temporary private key, use the ECIES algorithm to calculate the shared key K D and generate M bits of K D ID. K D ID is At the mark K D .
最后,UE1通过UE-to-UE relay发送认证响应消息,包括以下参数:Finally, UE1 sends an authentication response message through UE-to-UE relay, including the following parameters:
UE1的安全能力信息(可选);UE1’s security capability information (optional);
UE1的安全策略信息(可选);Security policy information of UE1 (optional);
UE1所属用户的信息,其中,UE1所属用户的信息包括UE1的标识和UE1的PVT和KPAK;Information about the user to which UE1 belongs, where the information about the user to which UE1 belongs includes the identity of UE1 and the PVT and KPAK of UE1;
第一随机数(Nonce_1);The first random number (Nonce_1);
第二临时公钥(Ephemeral public key2);The second temporary public key (Ephemeral public key2);
K D ID的M个比特位; M bits of K D ID;
UE1的签名,其中,UE1的签名输入参数包括但不限于以下至少之一:“UE1所属用户的信息”、“第二临时公钥”、“第一随机数(Nonce_1)”、“K D ID的M个比特位”和“UE2的签名”; The signature of UE1, where the signature input parameters of UE1 include but are not limited to at least one of the following: "information of the user to which UE1 belongs", "second temporary public key", "first random number (Nonce_1)", "K D ID "M bits" and "UE2's signature";
第一消息验证码。First message verification code.
具体的,该认证响应消息通过基于K D生成的该第一消息验证码进行完整性保护,且该第一消息验证码的输入参数包括以下至少之一:UE1的安全能力信息,UE1在安全策略信息,UE1所属用户的信息,第一随机数(Nonce_1),该第二临时公钥,K D ID的M个比特位,UE1的签名。 Specifically, the authentication response message is integrity protected through the first message verification code generated based on K D , and the input parameters of the first message verification code include at least one of the following: UE1's security capability information, UE1's security policy Information, the information of the user to which UE1 belongs, the first random number (Nonce_1), the second temporary public key, the M bits of K D ID, and the signature of UE1.
若UE1的安全能力和UE1的安全策略没有更新,那么在认证响应消息中可以不发送UE1的安全能力信息和UE1的安全策略信息。If the security capabilities of UE1 and the security policy of UE1 have not been updated, the security capability information of UE1 and the security policy information of UE1 may not be sent in the authentication response message.
S1-6b.收到认证响应消息后,UE-to-UE relay验证UE1所属用户的信息中的UE1的KPAK的有效性(具体的,UE-to-UE relay根据本地存储信息验证UE1的KPAK有效性,例如,在UE-to-UE relay本地存储的KPAK中存在与UE1的KPAK一致的KPAK,UE1的KPAK有效),UE-to-UE relay基于UE1的标识和UE1的PVT对UE1的签名进行验证。最后,如果UE1的签名验证成功,UE-to-UE relay向UE2发送验证之后的认证响应消息,其中,验证之后的认证响应消息包含以下参数:S1-6b. After receiving the authentication response message, the UE-to-UE relay verifies the validity of the KPAK of UE1 in the information of the user to which UE1 belongs (specifically, the UE-to-UE relay verifies that the KPAK of UE1 is valid based on the locally stored information. For example, in the KPAK stored locally in the UE-to-UE relay, there is a KPAK consistent with the KPAK of UE1, and the KPAK of UE1 is valid). The UE-to-UE relay performs the signature of UE1 based on the identity of UE1 and the PVT of UE1. verify. Finally, if the signature verification of UE1 is successful, the UE-to-UE relay sends the verification response message to UE2. The verification response message contains the following parameters:
UE1的安全能力信息(可选);UE1’s security capability information (optional);
UE1的安全策略信息(可选);Security policy information of UE1 (optional);
第一随机数(Nonce_1);The first random number (Nonce_1);
UE1所属用户的信息,其中,UE1所属用户的信息包括UE1的标识和UE1的PVT和KPAK;Information about the user to which UE1 belongs, where the information about the user to which UE1 belongs includes the identity of UE1 and the PVT and KPAK of UE1;
第二临时公钥;second temporary public key;
K D ID的M个比特位; M bits of K D ID;
UE1的签名;UE1’s signature;
UE-to-UE relay所属用户的信息;Information about the user to whom the UE-to-UE relay belongs;
UE-to-UE relay的签名2,其中,该UE-to-UE relay的签名2输入参数包括以下至少之一:“UE-to-UE relay所属用户的信息”、“UE1的签名”、“UE2的签名”和“验证之后的认证响应消息”; Signature 2 of the UE-to-UE relay, where the input parameters of the signature 2 of the UE-to-UE relay include at least one of the following: "Information of the user to which the UE-to-UE relay belongs", "Signature of UE1", " UE2's signature" and "authentication response message after verification";
第一消息验证码。First message verification code.
S1-7.收到验证之后的认证响应消息后,UE2分别检查UE1的KPAK和UE-to-UE relay的KPAK,在UE1的KPAK和UE-to-UE relay的KPAK有效的情况下,且基于UE1的标识和UE1的PVT对UE1的签名进行验证,以及基于UE-to-UE relay的标识和UE-to-UE relay的PVT对UE-to-UE relay的签名进行验证。如果UE1的签名和UE-to-UE relay的签名验证成功,UE2验证认证响应消息中包含的信息的完整性,UE2基于第一临时私钥、UE-to-UE relay的相关信息和第二临时公钥,利用ECIES算法计算出共享密钥K D。在第一消息验证码合格的情况下,UE2生成K D ID的N个比特位,并将K D ID的N个比特位与接收到的K D ID的M个比特位合并,生成并存储完整的K D ID,后续用于标识K D。此时,UE1和UE2双方进行了认证和根密钥协商,之后UE2开始处理认证响应消息。若该认证响应消息中包含UE1的安全能力信息与UE1的安全策略信息,UE2协商出安全策略与安全算法,然后生成第二随机数(Nonce_2),并根据利用第一随机数、第二随机数和K D计算K D-SESS和其他密钥(即K D-CPint、K D-CPenc、K D-UPint、K D-UPenc)。另外UE2生成K D-SESS的x个比特位。 S1-7. After receiving the authentication response message after verification, UE2 checks the KPAK of UE1 and the KPAK of UE-to-UE relay respectively. If the KPAK of UE1 and the KPAK of UE-to-UE relay are valid, and based on The signature of UE1 is verified based on the identity of UE1 and the PVT of UE1, and the signature of the UE-to-UE relay is verified based on the identity of the UE-to-UE relay and the PVT of the UE-to-UE relay. If the verification of UE1's signature and the UE-to-UE relay's signature is successful, UE2 verifies the integrity of the information contained in the authentication response message based on the first temporary private key, UE-to-UE relay related information and the second temporary Public key, use the ECIES algorithm to calculate the shared key K D . When the first message verification code is qualified, UE2 generates N bits of K D ID, combines the N bits of K D ID with the M bits of the received K D ID, generates and stores the complete K D ID, which is subsequently used to identify K D . At this time, both UE1 and UE2 have performed authentication and root key negotiation, and then UE2 starts processing the authentication response message. If the authentication response message contains UE1's security capability information and UE1's security policy information, UE2 negotiates the security policy and security algorithm, then generates a second random number (Nonce_2), and uses the first random number and the second random number to and KD to calculate KD -SESS and other keys (i.e. KD -CPint , KD -CPenc , KD -UPint , KD -UPenc ). In addition, UE2 generates x bits of K D-SESS .
最后,UE2通过UE-to-UE relay发送一个受完整性保护的安全模式命令消息给UE1,其中,安全模式命令消息中包含以下参数:Finally, UE2 sends an integrity-protected security mode command message to UE1 through UE-to-UE relay. The security mode command message contains the following parameters:
第二随机数(Nonce_2);The second random number (Nonce_2);
K D ID的N个比特位; K D N bits of ID;
K D-SESS ID的x个比特位; K D-x bits of SESS ID;
UE2选取的安全算法;The security algorithm selected by UE2;
UE2选取的安全策略;The security policy selected by UE2;
第二消息验证码,其中,该安全模式命令消息通过基于K D-SESS生成的该第二消息验证码进行完整性保护,或者,该安全模式命令消息通过基于K D-SESS派生的完整性保护密钥生成的该第二消息验证码进行完整性保护,且该第二消息验证码的输入参数包括以下至少之一:第二随机数(Nonce_2)、K D ID的N个比特位、K D-SESS ID的x个比特位、UE2选取的安全算法、UE2选取的安全策略。 The second message verification code, wherein the security mode command message is integrity protected by the second message verification code generated based on K D-SESS , or the security mode command message is integrity protected by the integrity derived based on K D-SESS The second message verification code generated by the key is integrity protected, and the input parameters of the second message verification code include at least one of the following: a second random number (Nonce_2), N bits of K D ID, K D - x bits of the SESS ID, the security algorithm selected by UE2, and the security policy selected by UE2.
需要注意的是,如果UE2与UE1的安全策略相互冲突,或者,第一消息验证码验证失败,或者,UE2与UE1的安全算法协商失败,UE2将回复错误消息,其中,该错误消息包括原因信息和第四消息校验码;其中,该原因信息用于指示UE2与UE1的安全策略冲突,或者,该原因信息用于指示第一消息验证码验证失败,或者,该原因信息用于指示UE2与UE1的安全算法协商失败;该第四消息验证码的输入参数至少包括:该原因信息。在第四消息验证码有效的情况下,UE1确定安全模式建立失败,和/或,UE1重新发起安全模式建立流程。It should be noted that if the security policies of UE2 and UE1 conflict with each other, or the first message verification code fails to be verified, or the security algorithm negotiation between UE2 and UE1 fails, UE2 will reply with an error message, where the error message includes cause information. and the fourth message verification code; wherein the reason information is used to indicate that the security policies of UE2 and UE1 conflict, or the reason information is used to indicate that the first message verification code verification fails, or the reason information is used to indicate that UE2 and UE1 The security algorithm negotiation of UE1 failed; the input parameters of the fourth message verification code at least include: the reason information. When the fourth message verification code is valid, UE1 determines that the security mode establishment fails, and/or UE1 re-initiates the security mode establishment process.
S1-8.接收到安全模式命令消息后,UE1判断安全模式命令消息中携带的信息是否遭受篡改,若未篡改,那么UE1将K D ID的M个比特位和K D ID的N个比特位合并得到K D ID,以及UE1采用与UE2相同的方式计算K D-SESS以及其他密钥(即K D-CPint、K D-CPenc、K D-UPint、K D-UPenc),UE1生成K D-SESS  ID的y个比特位,并且UE1将K D-SESS ID的x个比特位和K D-SESS ID的y个比特位合并得到K D-SESS ID,并保存K D-SESS ID。然后,UE1验证第二消息校验码是否有效,若有效,UE1准备以新安全环境来保护后续通信。 S1-8. After receiving the security mode command message, UE1 determines whether the information carried in the security mode command message has been tampered with. If it has not been tampered with, then UE1 changes the M bits of the K D ID and the N bits of the K D ID. The K D ID is obtained by merging, and UE1 calculates K D-SESS and other keys (i.e. K D-CPint , K D-CPenc , K D-UPint , K D-UPenc ) in the same way as UE2, and UE1 generates K D - y bits of the SESS ID, and UE1 combines the x bits of the K D-SESS ID and the y bits of the K D-SESS ID to obtain the K D-SESS ID, and saves the K D-SESS ID. Then, UE1 verifies whether the second message check code is valid. If valid, UE1 prepares to use the new security environment to protect subsequent communications.
具体的,在第二消息验证码有效的情况下,UE1根据UE2选取的安全算法、K D-SESS、基于K D-SESS生成完整性保护密钥和/或机密性保护密钥、UE2选取的安全策略,与UE2进行通信。 Specifically, when the second message verification code is valid, UE1 generates the integrity protection key and/or confidentiality protection key based on the security algorithm selected by UE2, K D-SESS , and the K D-SESS selected by UE2. Security policy to communicate with UE2.
进一步地,UE1向UE2发送安全模式结束消息,该安全模式结束消息通过目标密钥进行加密,且该安全模式结束消息包括以下至少之一:K D-SESS ID的y个比特位,第三消息验证码;其中,该目标密钥包括以下之一:K D、K D-SESS、K D-CPenc、K D-UPenc;其中,该安全模式结束消息通过基于K D-SESS生成的该第三消息验证码进行完整性保护,或者,该安全模式结束消息通过基于K D-SESS派生的完整性保护密钥生成的该第三消息验证码进行完整性保护,该第三消息验证码的输入参数包括K D-SESS ID的y个比特位。 Further, UE1 sends a security mode end message to UE2. The security mode end message is encrypted by the target key, and the security mode end message includes at least one of the following: y bits of K D-SESS ID, the third message Verification code; wherein, the target key includes one of the following: K D , K D-SESS , K D-CPenc , K D-UPenc ; wherein, the security mode end message passes the third party generated based on K D-SESS The message verification code performs integrity protection, or the security mode end message performs integrity protection through the third message verification code generated based on the integrity protection key derived from KD-SESS , and the input parameters of the third message verification code Includes y bits of K D-SESS ID.
具体的,UE2验证第三消息校验码是否有效,若有效,UE2将K D-SESS ID的x个比特位和K D-SESS ID的y个比特位合并得到K D-SESS ID,并保存K D-SESS ID。UE2根据UE2选取的安全算法、K D-SESS、基于K D-SESS生成完整性保护密钥和/或机密性保护密钥、UE2选取的安全策略,与UE1进行通信。 Specifically, UE2 verifies whether the third message check code is valid. If valid, UE2 combines x bits of K D-SESS ID and y bits of K D-SESS ID to obtain K D-SESS ID, and saves it. K D-SESS ID. UE2 communicates with UE1 according to the security algorithm and K D-SESS selected by UE2, generates an integrity protection key and/or a confidentiality protection key based on K D-SESS , and a security policy selected by UE2.
实施例2,如图15所示,假设所有设备之间在此之前没有建立任何安全连接,可以通过S2-0至S2-8中的部分或全部步骤建立L2架构下UE-to-UE中继场景下基于签名的安全通信连接。具体的,UE1可以是第一终端设备,UE2可以是第二终端设备,UE-to-UE relay可以是中继设备,K D可以是第一密钥,K D-SESS可以是第二密钥。 Embodiment 2, as shown in Figure 15, assuming that no secure connection has been established between all devices before, a UE-to-UE relay under the L2 architecture can be established through some or all of the steps from S2-0 to S2-8. Signature-based secure communication connection in scenarios. Specifically, UE1 may be the first terminal device, UE2 may be the second terminal device, UE-to-UE relay may be the relay device, K D may be the first key, and K D-SESS may be the second key .
S2-0.UE1、UE2、终端至终端中继设备(UE-to-UE relay)获得了密钥管理服务器(KMS)下发的签名公钥(KPAK),以及一组与UE标识相关的凭证,即秘密签名密钥(SSK)和公共验证参数(PVT),可使用UE-to-UE relay服务。UE-to-UE relay向网络注册可提供UE-to-UE Relay功能,UE-to-UE Relay配置了中继策略参数。S2-0.UE1, UE2, and terminal-to-UE relay equipment (UE-to-UE relay) obtained the signature public key (KPAK) issued by the key management server (KMS) and a set of credentials related to the UE identity. , namely the Secret Signing Key (SSK) and Public Verification Parameters (PVT), can use the UE-to-UE relay service. UE-to-UE relay registers with the network to provide the UE-to-UE Relay function, and the UE-to-UE Relay is configured with relay policy parameters.
S2-1.UE2确定PC5单播链路建立时信令接收的目的L2 ID。S2-1.UE2 determines the destination L2 ID for signaling reception when the PC5 unicast link is established.
S2-2.UE1通过广播方式发送端到端的直接通信请求消息,具体的,在源终端(即UE1)上,应用层向ProSe层提供PC5单播通信的信息(如广播L2 ID、ProSe应用层ID、终端应用层ID、目标终端应用层ID、中继适用指示),ProSe层通过发送端到端广播直接通信请求消息触发终端的发现机制。消息使用源L2 ID和广播L2 ID作为目的发送,并包含其他与应用程序相关的参数。S2-2.UE1 sends an end-to-end direct communication request message through broadcast. Specifically, on the source terminal (i.e. UE1), the application layer provides PC5 unicast communication information (such as broadcast L2 ID, ProSe application layer) to the ProSe layer. ID, terminal application layer ID, target terminal application layer ID, relay applicable indication), the ProSe layer triggers the terminal's discovery mechanism by sending an end-to-end broadcast direct communication request message. Messages are sent using the source L2 ID and broadcast L2 ID as destination, and contain other application-related parameters.
S2-3.UE-to-UE Relay接收广播的直接通信请求消息,并验证UE-to-UE Relay是否配置为转发这个应用程序,例如,UE-to-UE Relay将宣布的ProSe应用ID与它所提供的中继策略/参数进行比较。UE-to-UE Relay转发端到端广播的直接通信请求消息时,使用自己的L2 ID作为源(Source)L2 ID,并在消息中添加UE-to-UE Relay的UE ID,在适配层指定标识UE1的信息。UE-to-UE Relay在ProSe层处理此端到端广播消息,并根据适配层信息转发任何后续的端到端PC5-S消息。S2-3.UE-to-UE Relay receives the broadcasted direct communication request message and verifies whether the UE-to-UE Relay is configured to forward this application. For example, the UE-to-UE Relay will announce the same ProSe application ID as it The provided relay policies/parameters are compared. When UE-to-UE Relay forwards the direct communication request message broadcast end-to-end, it uses its own L2 ID as the source (Source) L2 ID, and adds the UE ID of UE-to-UE Relay in the message. In the adaptation layer Specify information identifying UE1. UE-to-UE Relay processes this end-to-end broadcast message at the ProSe layer and forwards any subsequent end-to-end PC5-S messages based on the adaptation layer information.
S2-4a.UE2对宣布的应用程序感兴趣,如果UE2和UE-to-UE Relay之间不存在每跳链路,UE2会触发UE-to-UE Relay建立每跳链路。UE2发送每跳链路建立过程消息,源地址是UE2 L2 ID,目的地址是中继的L2 ID。S2-4a.UE2 is interested in the announced application. If there is no per-hop link between UE2 and UE-to-UE Relay, UE2 will trigger UE-to-UE Relay to establish a per-hop link. UE2 sends a link establishment process message for each hop. The source address is the UE2 L2 ID and the destination address is the relay's L2 ID.
S2-4b.如果UE-to-UE relay和UE1之间不存在每跳链路,则执行UE-to-UE relay和UE1之间的每跳链路建立过程。UE1将自己的L2 ID作为源地址,中继的L2 ID作为目的地址。S2-4b. If there is no per-hop link between UE-to-UE relay and UE1, perform the per-hop link establishment process between UE-to-UE relay and UE1. UE1 uses its own L2 ID as the source address and the relay's L2 ID as the destination address.
S2-5a.当UE-2和UE-to-UE relay成功建立了每跳链路(per hop link),将进一步触发UE2和UE1间端到端安全的建立。若UE2已具备K D ID及安全环境,同时UE1和UE2之间建立不同(Source ID、Destination ID)组之间的链接安全上下文时,那么可选的是,UE2可以省略认证流程,直接执行安全模式命令消息,或者考虑更高安全性,重新继续执行认证流程,创建该Source ID与Destination ID组下的崭新安全环境;若UE1和UE2初次建立安全连接,那么UE2必须通过UE-to-UE relay和UE1执行认证流程。当执行认证流程时,UE2首先产生一对临时公私钥,即第一临时公钥(Ephemeral public key1)和第一临时私钥(Ephemeral private key1),然后通过UE-to-UE relay与UE1进行通信。 S2-5a. When UE-2 and UE-to-UE relay successfully establish a per hop link, the establishment of end-to-end security between UE2 and UE1 will be further triggered. If UE2 already has a K D ID and security environment, and a link security context between different (Source ID, Destination ID) groups is established between UE1 and UE2, then optionally, UE2 can omit the authentication process and directly perform security mode command message, or considering higher security, continue the authentication process to create a new security environment under the Source ID and Destination ID group; if UE1 and UE2 establish a secure connection for the first time, then UE2 must pass the UE-to-UE relay Perform the authentication process with UE1. When performing the authentication process, UE2 first generates a pair of temporary public and private keys, namely the first temporary public key (Ephemeral public key1) and the first temporary private key (Ephemeral private key1), and then communicates with UE1 through the UE-to-UE relay. .
具体的,UE2发送认证请求消息,包括以下参数:Specifically, UE2 sends an authentication request message, including the following parameters:
UE2所属用户的信息,其中,UE2所属用户的信息包括UE2的标识和UE2的PVT和KPAK;Information about the user to which UE2 belongs, where the information about the user to which UE2 belongs includes the identity of UE2 and the PVT and KPAK of UE2;
第一临时公钥(Ephemeral public key1);The first temporary public key (Ephemeral public key1);
UE2的签名,其中,UE2的签名的输入参数包括以下至少之一:“UE2所属用户的信息”和“第一临时公钥”。The signature of UE2, wherein the input parameters of the signature of UE2 include at least one of the following: "information of the user to which UE2 belongs" and "first temporary public key".
S2-5b.在收到认证请求消息后,UE-to-UE relay验证UE2所属用户的信息中的UE2的KPAK有效性(具体的,UE-to-UE relay根据本地存储信息验证UE2的KPAK有效性,例如,在UE-to-UE relay本地存储的KPAK中存在与UE2的KPAK一致的KPAK,UE2的KPAK有效),UE-to-UE relay基 于UE2的标识和UE2的PVT对UE2的签名进行验证。S2-5b. After receiving the authentication request message, UE-to-UE relay verifies the validity of UE2's KPAK in the information of the user to which UE2 belongs (specifically, UE-to-UE relay verifies that UE2's KPAK is valid based on locally stored information For example, in the KPAK stored locally in the UE-to-UE relay, there is a KPAK consistent with the KPAK of UE2, and the KPAK of UE2 is valid). The UE-to-UE relay performs the signature of UE2 based on the identity of UE2 and the PVT of UE2. verify.
最后,如果UE2的签名验证有效,那么UE-to-UE relay转发认证请求消息,除了上述认证请求消息内的全部内容外,还包括以下参数:Finally, if the signature verification of UE2 is valid, then the UE-to-UE relay forwards the authentication request message, which in addition to all the contents in the above authentication request message, also includes the following parameters:
UE-to-UE relay所属用户的信息,其中,UE-to-UE relay所属用户的信息包括UE-to-UE relay的标识和UE-to-UE relay的PVT和KPAK;The information of the user to which the UE-to-UE relay belongs. The information of the user to which the UE-to-UE relay belongs includes the identification of the UE-to-UE relay and the PVT and KPAK of the UE-to-UE relay;
UE-to-UE relay的签名,其中,UE-to-UE relay的签名中输入参数包括以下至少之一:“UE2的签名”和“UE-to-UE relay所属用户的信息”;The signature of the UE-to-UE relay, where the input parameters in the signature of the UE-to-UE relay include at least one of the following: "UE2's signature" and "information of the user to which the UE-to-UE relay belongs";
UE-to-UE relay的相关信息,其中,该UE-to-UE relay的相关信息包括以下之一:该UE-to-UE relay的身份信息,该UE-to-UE relay生成的随机数,该UE-to-UE relay生成的计数器。The relevant information of the UE-to-UE relay, where the relevant information of the UE-to-UE relay includes one of the following: the identity information of the UE-to-UE relay, the random number generated by the UE-to-UE relay, Counter generated by this UE-to-UE relay.
S2-6a.在收到认证请求消息后,UE1分别检查UE2的KPAK和UE-to-UE relay的KPAK,在UE2的KPAK和UE-to-UE relay的KPAK有效的情况下,且基于UE2的标识和UE2的PVT对UE2的签名进行验证,以及基于UE-to-UE relay的标识和UE-to-UE relay的PVT对UE-to-UE relay的签名进行验证。如果UE2的签名和UE-to-UE relay的签名验证成功,那么UE1产生临时公私钥对,即第二临时公钥(Ephemeral public key2)和第二临时私钥(Ephemeral private key2),然后,UE1根据第一临时公钥、UE-to-UE relay的相关信息和第二临时私钥,使用ECIES算法,计算出共享密钥K D,并且生成K D ID的M个比特位,K D ID用于标识K DS2-6a. After receiving the authentication request message, UE1 checks the KPAK of UE2 and the KPAK of the UE-to-UE relay respectively. If the KPAK of UE2 and the KPAK of the UE-to-UE relay are valid, and based on the KPAK of UE2 The signature of UE2 is verified based on the identity and the PVT of UE2, and the signature of the UE-to-UE relay is verified based on the identity of the UE-to-UE relay and the PVT of the UE-to-UE relay. If the signature of UE2 and the signature of UE-to-UE relay are verified successfully, then UE1 generates a temporary public and private key pair, that is, the second temporary public key (Ephemeral public key2) and the second temporary private key (Ephemeral private key2). Then, UE1 According to the first temporary public key, UE-to-UE relay related information and the second temporary private key, use the ECIES algorithm to calculate the shared key K D and generate M bits of K D ID. K D ID is At the mark K D .
最后,UE1通过UE-to-UE relay发送安全模式命令,包括以下参数:Finally, UE1 sends the safe mode command through the UE-to-UE relay, including the following parameters:
UE1的安全能力信息(可选);UE1’s security capability information (optional);
UE1的安全策略信息(可选);Security policy information of UE1 (optional);
UE1所属用户的信息,其中,UE1所属用户的信息包括UE1的标识和UE1的PVT和KPAK;Information about the user to which UE1 belongs, where the information about the user to which UE1 belongs includes the identity of UE1 and the PVT and KPAK of UE1;
第一随机数(Nonce_1);The first random number (Nonce_1);
第二临时公钥(Ephemeral public key2);The second temporary public key (Ephemeral public key2);
K D ID的M个比特位; M bits of K D ID;
UE1的签名,其中,UE1的签名输入参数包括但不限于以下至少之一:“UE1所属用户的信息”、“第二临时公钥”、“第一随机数(Nonce_1)”、“K D ID的M个比特位”和“UE2的签名”; The signature of UE1, where the signature input parameters of UE1 include but are not limited to at least one of the following: "information of the user to which UE1 belongs", "second temporary public key", "first random number (Nonce_1)", "K D ID "M bits" and "UE2's signature";
第一消息验证码。First message verification code.
具体的,该安全模式命令通过基于K D生成的该第一消息验证码进行完整性保护,且该第一消息验证码的输入参数包括以下至少之一:UE1的安全能力信息,UE1在安全策略信息,UE1所属用户的信息,第一随机数(Nonce_1),该第二临时公钥,K D ID的M个比特位,UE1的签名。 Specifically, the security mode command performs integrity protection through the first message verification code generated based on KD , and the input parameters of the first message verification code include at least one of the following: UE1's security capability information, UE1's security policy Information, the information of the user to which UE1 belongs, the first random number (Nonce_1), the second temporary public key, the M bits of K D ID, and the signature of UE1.
若UE1的安全能力和UE1的安全策略没有更新,那么在安全模式命令中可以不发送UE1的安全能力信息和UE1的安全策略信息。If the security capability of UE1 and the security policy of UE1 have not been updated, the security capability information of UE1 and the security policy information of UE1 do not need to be sent in the security mode command.
S2-6b.收到安全模式命令后,UE-to-UE relay验证UE1所属用户的信息中的UE1的KPAK的有效性(具体的,UE-to-UE relay根据本地存储信息验证UE1的KPAK有效性,例如,在UE-to-UE relay本地存储的KPAK中存在与UE1的KPAK一致的KPAK,UE1的KPAK有效),UE-to-UE relay基于UE1的标识和UE1的PVT对UE1的签名进行验证。最后,如果UE1的签名验证成功,UE-to-UE relay向UE2发送验证之后的安全模式命令,其中,验证之后的安全模式命令包含以下参数:S2-6b. After receiving the security mode command, UE-to-UE relay verifies the validity of UE1's KPAK in the information of the user to which UE1 belongs (specifically, UE-to-UE relay verifies that UE1's KPAK is valid based on local storage information For example, in the KPAK stored locally in the UE-to-UE relay, there is a KPAK consistent with the KPAK of UE1, and the KPAK of UE1 is valid). The UE-to-UE relay performs the signature of UE1 based on the identity of UE1 and the PVT of UE1. verify. Finally, if the signature verification of UE1 is successful, the UE-to-UE relay sends the security mode command after verification to UE2. The security mode command after verification contains the following parameters:
UE1的安全能力信息(可选);UE1’s security capability information (optional);
UE1的安全策略信息(可选);Security policy information of UE1 (optional);
第一随机数(Nonce_1);The first random number (Nonce_1);
UE1所属用户的信息,其中,UE1所属用户的信息包括UE1的标识和UE1的PVT和KPAK;Information about the user to which UE1 belongs, where the information about the user to which UE1 belongs includes the identity of UE1 and the PVT and KPAK of UE1;
第二临时公钥;second temporary public key;
K D ID的M个比特位; M bits of K D ID;
UE1的签名;UE1’s signature;
UE-to-UE relay所属用户的信息;Information about the user to whom the UE-to-UE relay belongs;
UE-to-UE relay的签名2,其中,该UE-to-UE relay的签名2输入参数包括以下至少之一:“UE-to-UE relay所属用户的信息”、“UE1的签名”、“UE2的签名”和“验证之后的安全模式命令”。 Signature 2 of the UE-to-UE relay, where the input parameters of the signature 2 of the UE-to-UE relay include at least one of the following: "Information of the user to which the UE-to-UE relay belongs", "Signature of UE1", " Signature of UE2" and "Safe mode command after verification".
第一消息验证码。First message verification code.
S2-7.收到验证之后的安全模式命令后,UE2分别检查UE1的KPAK和UE-to-UE relay的KPAK,在UE1的KPAK和UE-to-UE relay的KPAK有效的情况下,且基于UE1的标识和UE1的PVT对UE1的签名进行验证,以及基于UE-to-UE relay的标识和UE-to-UE relay的PVT对UE-to-UE relay的签名进行验证。如果UE1的签名和UE-to-UE relay的签名验证成功,UE2验证认证响应消息中包含的信息的完整性,UE2基于第一临时私钥、UE-to-UE relay的相关信息和第二临时公钥,利用ECIES算法 计算出共享密钥K D。在第一消息验证码合格的情况下,UE2生成K D ID的N个比特位,并将K D ID的N个比特位与接收到的K D ID的M个比特位合并,生成并存储完整的K D ID,后续用于标识K D。此时,UE1和UE2双方进行了认证和根密钥协商,之后UE2开始处理安全模式命令。若该安全模式命令中包含UE1的安全能力信息与UE1的安全策略信息,UE2协商出安全策略与安全算法,然后生成第二随机数(Nonce_2),并根据利用第一随机数、第二随机数和K D计算K D-SESS和其他密钥(即K D-CPint、K D-CPenc、K D-UPint、K D-UPenc)。另外UE2生成K D-SESS的x个比特位。 S2-7. After receiving the security mode command after verification, UE2 checks the KPAK of UE1 and the KPAK of UE-to-UE relay respectively. If the KPAK of UE1 and the KPAK of UE-to-UE relay are valid, and based on The signature of UE1 is verified based on the identity of UE1 and the PVT of UE1, and the signature of the UE-to-UE relay is verified based on the identity of the UE-to-UE relay and the PVT of the UE-to-UE relay. If the verification of UE1's signature and the UE-to-UE relay's signature is successful, UE2 verifies the integrity of the information contained in the authentication response message based on the first temporary private key, UE-to-UE relay related information and the second temporary Public key, use the ECIES algorithm to calculate the shared key K D . When the first message verification code is qualified, UE2 generates N bits of K D ID, combines the N bits of K D ID with the M bits of the received K D ID, generates and stores the complete K D ID, which is subsequently used to identify K D . At this time, both UE1 and UE2 have performed authentication and root key negotiation, and then UE2 starts processing the security mode command. If the security mode command contains the security capability information of UE1 and the security policy information of UE1, UE2 negotiates the security policy and security algorithm, and then generates a second random number (Nonce_2), and uses the first random number and the second random number according to the and KD to calculate KD -SESS and other keys (i.e. KD -CPint , KD -CPenc , KD -UPint , KD -UPenc ). In addition, UE2 generates x bits of K D-SESS .
最后,UE2通过UE-to-UE relay发送一个受完整性保护的安全模式响应给UE1,其中,安全模式响应通过K D进行加密,以及该安全模式响应中包含以下参数: Finally, UE2 sends an integrity-protected security mode response to UE1 through the UE-to-UE relay. The security mode response is encrypted by KD , and the security mode response contains the following parameters:
第二随机数(Nonce_2);The second random number (Nonce_2);
K D ID的N个比特位; K D N bits of ID;
K D-SESS ID的x个比特位; K D-x bits of SESS ID;
UE2选取的安全算法;The security algorithm selected by UE2;
UE2选取的安全策略;The security policy selected by UE2;
第二消息验证码,其中,该安全模式响应通过基于K D-SESS生成的该第二消息验证码进行完整性保护,或者,该安全模式响应通过基于K D-SESS派生的完整性保护密钥生成的该第二消息验证码进行完整性保护,且该第二消息验证码的输入参数包括以下至少之一:第二随机数(Nonce_2)、K D ID的N个比特位、K D-SESS ID的x个比特位、UE2选取的安全算法、UE2选取的安全策略。 The second message verification code, wherein the security mode response is integrity protected through the second message verification code generated based on K D-SESS , or the security mode response is integrity protected through the integrity key derived based on K D-SESS The generated second message verification code is integrity protected, and the input parameters of the second message verification code include at least one of the following: second random number (Nonce_2), N bits of K D ID, K D-SESS x bits of the ID, the security algorithm selected by UE2, and the security policy selected by UE2.
需要注意的是,如果UE2与UE1的安全策略相互冲突,或者,第一消息验证码验证失败,或者,UE2与UE1的安全算法协商失败,UE2将回复错误消息,其中,该错误消息包括原因信息和第四消息校验码;其中,该原因信息用于指示UE2与UE1的安全策略冲突,或者,该原因信息用于指示第一消息验证码验证失败,或者,该原因信息用于指示UE2与UE1的安全算法协商失败;该第四消息验证码的输入参数至少包括:该原因信息。在第四消息验证码有效的情况下,UE1确定安全模式建立失败,和/或,UE1重新发起安全模式建立流程。It should be noted that if the security policies of UE2 and UE1 conflict with each other, or the first message verification code fails to be verified, or the security algorithm negotiation between UE2 and UE1 fails, UE2 will reply with an error message, where the error message includes cause information. and the fourth message verification code; wherein the reason information is used to indicate that the security policies of UE2 and UE1 conflict, or the reason information is used to indicate that the first message verification code verification fails, or the reason information is used to indicate that UE2 and UE1 The security algorithm negotiation of UE1 failed; the input parameters of the fourth message verification code at least include: the reason information. When the fourth message verification code is valid, UE1 determines that the security mode establishment fails, and/or UE1 re-initiates the security mode establishment process.
S2-8.接收到安全模式响应后,UE1基于K D对安全模式响应进行解密,在解密之后,UE1判断安全模式响应中携带的信息是否遭受篡改,若未篡改,那么UE1将K D ID的M个比特位和K D ID的N个比特位合并得到K D ID,以及UE1采用与UE2相同的方式计算K D-SESS以及其他密钥(即K D-CPint、K D-CPenc、K D-UPint、K D-UPenc),UE1生成K D-SESS ID的y个比特位,并且UE1将K D-SESS ID的x个比特位和K D-SESS ID的y个比特位合并得到K D-SESS ID,并保存K D-SESS ID。然后,UE1验证第二消息校验码是否有效,若有效,UE1准备以新安全环境来保护后续通信。 S2-8. After receiving the security mode response, UE1 decrypts the security mode response based on K D. After decryption, UE1 determines whether the information carried in the security mode response has been tampered with. If it has not been tampered with, then UE1 will K D ID M bits and N bits of K D ID are combined to obtain K D ID, and UE1 calculates K D-SESS and other keys (i.e., K D-CPint , K D-CPenc , K D -UPint , K D-UPenc ), UE1 generates y bits of K D-SESS ID, and UE1 combines x bits of K D-SESS ID and y bits of K D-SESS ID to obtain K D -SESS ID, and save K D-SESS ID. Then, UE1 verifies whether the second message check code is valid. If valid, UE1 prepares to use the new security environment to protect subsequent communications.
具体的,在第二消息验证码有效的情况下,UE1根据UE2选取的安全算法、K D-SESS、基于K D-SESS生成完整性保护密钥和/或机密性保护密钥、UE2选取的安全策略,与UE2进行通信。 Specifically, when the second message verification code is valid, UE1 generates the integrity protection key and/or confidentiality protection key based on the security algorithm selected by UE2, K D-SESS , and the K D-SESS selected by UE2. Security policy to communicate with UE2.
进一步地,UE1向UE2发送安全模式结束消息,该安全模式结束消息通过目标密钥进行加密,且该安全模式结束消息包括以下至少之一:K D-SESS ID的y个比特位,第三消息验证码;其中,该目标密钥包括以下之一:K D、K D-SESS、K D-CPenc、K D-UPenc;其中,该安全模式结束消息通过基于K D-SESS生成的该第三消息验证码进行完整性保护,或者,该安全模式结束消息通过基于K D-SESS派生的完整性保护密钥生成的该第三消息验证码进行完整性保护,该第三消息验证码的输入参数包括K D-SESS ID的y个比特位。 Further, UE1 sends a security mode end message to UE2. The security mode end message is encrypted by the target key, and the security mode end message includes at least one of the following: y bits of K D-SESS ID, the third message Verification code; wherein, the target key includes one of the following: K D , K D-SESS , K D-CPenc , K D-UPenc ; wherein, the security mode end message passes the third party generated based on K D-SESS The message verification code performs integrity protection, or the security mode end message performs integrity protection through the third message verification code generated based on the integrity protection key derived from KD-SESS , and the input parameters of the third message verification code Includes y bits of K D-SESS ID.
具体的,UE2验证第三消息校验码是否有效,若有效,UE2将K D-SESS ID的x个比特位和K D-SESS ID的y个比特位合并得到K D-SESS ID,并保存K D-SESS ID。UE2根据UE2选取的安全算法、K D-SESS、基于K D-SESS生成完整性保护密钥和/或机密性保护密钥、UE2选取的安全策略,与UE1进行通信。 Specifically, UE2 verifies whether the third message check code is valid. If valid, UE2 combines x bits of K D-SESS ID and y bits of K D-SESS ID to obtain K D-SESS ID, and saves it. K D-SESS ID. UE2 communicates with UE1 according to the security algorithm and K D-SESS selected by UE2, generates an integrity protection key and/or a confidentiality protection key based on K D-SESS , and a security policy selected by UE2.
图16是根据本申请实施例的中继通信的方法800的示意性流程图,如图16所示,该中继通信的方法800可以包括如下内容中的至少部分内容:Figure 16 is a schematic flow chart of a communication relay method 800 according to an embodiment of the present application. As shown in Figure 16, the communication relay method 800 may include at least part of the following content:
S810,第一终端设备通过中继设备向第二终端设备发送直接通信请求;其中,该直接通信请求包括以下至少之一:该第一终端设备的安全能力信息,该第一终端设备的安全策略信息,该第一终端设备生成的第一临时公钥,该第一终端设备生成的第一随机数;其中,该直接通信请求通过第一加密密钥进行加密,以及该直接通信请求通过第一完整性保护密钥进行完整性保护,该第一加密密钥为基于已注册并被授权使用终端至终端中继(UE-to-UE relay)通信的终端的对称密钥衍生的加密密钥,该第一完整性保护密钥为基于已注册并被授权使用UE-to-UE relay通信的终端的对称密钥衍生的完整性保护密钥;其中,该第一临时公钥和该中继设备的相关信息用于该第二终端设备派生第一密钥;该第一随机数、该第一密钥和该第二终端设备生成的第二随机数用于派生第二密钥,且该第二密钥用于派生第二加密密钥和/或第二完整性保护密钥,或者,该第一随机数、该第一密钥和该第二终端设备生成的第二随机数用于派生第二加密密钥和/或第二完整性保护密钥;其中,该中继设备的相关信息包 括以下之一:该中继设备的身份信息,该中继设备生成的随机数,该中继设备生成的计数器。S810, the first terminal device sends a direct communication request to the second terminal device through the relay device; wherein the direct communication request includes at least one of the following: security capability information of the first terminal device, security policy of the first terminal device information, the first temporary public key generated by the first terminal device, and the first random number generated by the first terminal device; wherein the direct communication request is encrypted by the first encryption key, and the direct communication request is encrypted by the first encryption key. The integrity protection key performs integrity protection, and the first encryption key is an encryption key derived based on the symmetric key of the terminal that has been registered and authorized to use terminal-to-UE relay (UE-to-UE relay) communication, The first integrity protection key is an integrity protection key derived based on the symmetric key of a terminal that has been registered and authorized to use UE-to-UE relay communication; wherein, the first temporary public key and the relay device The relevant information is used by the second terminal device to derive the first key; the first random number, the first key and the second random number generated by the second terminal device are used to derive the second key, and the first random number is used to derive the second key. The second key is used to derive the second encryption key and/or the second integrity protection key, or the first random number, the first key and the second random number generated by the second terminal device are used to derive The second encryption key and/or the second integrity protection key; wherein the relevant information of the relay device includes one of the following: the identity information of the relay device, the random number generated by the relay device, the relay device Counter generated by the device.
本实施例基于5G PKMT分配的对称密钥建立安全通信的方案,建立L2架构下的UE-to-UE中继场景下的安全连接。具体的,本申请实施例应用于L2架构下的UE-to-UE中继场景,也即,第一终端设备与第二终端设备之间通过中继设备进行通信。例如,第一终端设备与第二终端设备之间的中继连接可以是PC5链路。This embodiment establishes a secure communication solution based on the symmetric key distributed by 5G PKMT, and establishes a secure connection in the UE-to-UE relay scenario under the L2 architecture. Specifically, the embodiments of this application are applied to the UE-to-UE relay scenario under the L2 architecture, that is, the first terminal device and the second terminal device communicate through the relay device. For example, the relay connection between the first terminal device and the second terminal device may be a PC5 link.
在本申请实施例中,该第一终端设备可以是源设备或源终端,该第二终端设备可以是目标设备或目标终端。该中继设备可以是中继终端。In this embodiment of the present application, the first terminal device may be a source device or a source terminal, and the second terminal device may be a target device or a target terminal. The relay device may be a relay terminal.
在一些实施例中,该第一加密密钥可以为邻近业务加密密钥(PEK),该第一完整性保护密钥可以为邻近业务完整性保护密钥(PIK)。当然,该第一加密密钥也可以是其他的加密密钥,该第一完整性保护密钥也可以是其他的完整性保护密钥,本申请对此并不限定。In some embodiments, the first encryption key may be a Proximity Service Encryption Key (PEK), and the first integrity protection key may be a Proximity Service Integrity Protection Key (PIK). Of course, the first encryption key can also be other encryption keys, and the first integrity protection key can also be other integrity protection keys, which is not limited by this application.
在一些实施例中,已注册并被授权使用UE-to-UE relay通信的终端的对称密钥可以由ProSe密钥管理功能(ProSe Key Management Function,PKMF)或5G PKMF分配。具体例如,在5G PKMF中,可以不具体定义5G PKMF给UE分配并管理的对称密钥的名称和数量。具体例如,在4G PKMF中,在4G ProSe中,PKMF使用MIKEY机制为UE下发共享密钥,即ProSe组密钥(Prose Group Key,PGK)。In some embodiments, the symmetric key of a terminal that is registered and authorized to use UE-to-UE relay communication may be assigned by ProSe Key Management Function (PKMF) or 5G PKMF. For example, in 5G PKMF, the name and number of symmetric keys allocated and managed by 5G PKMF to the UE may not be specifically defined. For example, in 4G PKMF and 4G ProSe, PKMF uses the MIKEY mechanism to issue a shared key to the UE, that is, the ProSe Group Key (PGK).
具体的,5G PKMF和UE之间基于MIKEY机制安全下发群组密钥(PGK),第一终端设备和第二终端设备之间基于PGK衍生出ProSe传输密钥(Prose Traffic Key,PTK),以及进一步衍生出的ProSe完整性保护密钥(Prose Integrity Key,PIK)和ProSe加密密钥(Prose Encrypt Key,PEK),保护第一终端设备和/或第二终端设备传输的信息,以便第一终端设备和第二终端设备之间生成端到端的安全上下文。Specifically, the group key (PGK) is securely issued between the 5G PKMF and the UE based on the MIKEY mechanism, and the ProSe transmission key (Prose Traffic Key, PTK) is derived between the first terminal device and the second terminal device based on the PGK. and the further derived ProSe integrity key (Prose Integrity Key, PIK) and ProSe encryption key (Prose Encrypt Key, PEK) to protect the information transmitted by the first terminal device and/or the second terminal device so that the first terminal device can An end-to-end security context is generated between the terminal device and the second terminal device.
在一些实施例中,本实施例涉及的密钥类型可以如表1所示。In some embodiments, the key types involved in this embodiment may be as shown in Table 1.
表1Table 1
PGKPGK 群组密钥group key UE向PKMF请求,由PKMF使用MIKEY机制安全下发The UE makes a request to PKMF, which sends it securely using the MIKEY mechanism.
PTKPTK 传输密钥transport key 由PGK衍生Derived from PGK
PEKPEK 加密密钥encryption key 由PTK衍生Derived from PTK
PIKPIK 完整性保护密钥integrity protection key 由PTK衍生Derived from PTK
在一些实施例中,PTK衍生输入参数可以如表2所示。In some embodiments, the PTK derived input parameters may be as shown in Table 2.
表2Table 2
Figure PCTCN2022091125-appb-000001
Figure PCTCN2022091125-appb-000001
在一些实施例中,PEK/PIK衍生输入参数可以如表3所示。In some embodiments, the PEK/PIK derived input parameters may be as shown in Table 3.
表3table 3
Figure PCTCN2022091125-appb-000002
Figure PCTCN2022091125-appb-000002
在本申请实施例中,该第二加密密钥用于对第一终端设备与第二终端设备之间交互的端到端消息进行加密,以及该第二完整性保护密钥用于对第一终端设备与第二终端设备之间交互的端到端消息进行完整性保护。其中,该第二加密密钥可以是机密性保护密钥(K D-enc),该第二完整性保护密钥可以是完整性保护密钥(K D-int)。 In this embodiment of the present application, the second encryption key is used to encrypt end-to-end messages exchanged between the first terminal device and the second terminal device, and the second integrity protection key is used to encrypt the first terminal device. End-to-end messages exchanged between the terminal device and the second terminal device are integrity protected. Wherein, the second encryption key may be a confidentiality protection key (K D-enc ), and the second integrity protection key may be an integrity protection key (K D-int ).
在一些实施例中,该第二完整性保护密钥包括控制面的完整性保护密钥(K D-CPint)和用户面的完整性保护密钥(K D-UPint);和/或,该第二加密密钥包括控制面的机密性保护密钥(K D-CPenc)和用户面的机密性保护密钥(K D-UPenc)。 In some embodiments, the second integrity protection key includes an integrity protection key for the control plane (K D-CPint ) and an integrity protection key for the user plane (K D-UPint ); and/or, the The second encryption key includes a confidentiality protection key for the control plane (K D-CPenc ) and a confidentiality protection key for the user plane (K D-UPenc ).
在一些实施例中,该第二完整性保护密钥的输入参数包括以下至少之一:该第二密钥,选定的算法类型标识符,选定的算法类型标识符的长度,完整性保护算法标识,完整性保护算法标识的长度。也即,可以基于该第二密钥、选定的算法类型标识符、选定的算法类型标识符的长度、完整性保护算法标识、完整性保护算法标识的长度中的至少之一,生成该第二完整性保护密钥。或者,该第二完整性保护密钥的输入参数包括以下至少之一:该第一随机数,该第一密钥,该第二随机数,选定的算法类型标识符,选定的算法类型标识符的长度,完整性保护算法标识,完整性保护算法标识的长度。In some embodiments, the input parameters of the second integrity protection key include at least one of the following: the second key, the selected algorithm type identifier, the length of the selected algorithm type identifier, the integrity protection Algorithm identifier, the length of the integrity protection algorithm identifier. That is, the second key may be generated based on at least one of the second key, the selected algorithm type identifier, the length of the selected algorithm type identifier, the integrity protection algorithm identifier, and the length of the integrity protection algorithm identifier. Second integrity protection key. Alternatively, the input parameters of the second integrity protection key include at least one of the following: the first random number, the first key, the second random number, the selected algorithm type identifier, the selected algorithm type The length of the identifier, the integrity protection algorithm identifier, and the length of the integrity protection algorithm identifier.
可选地,该第二完整性保护密钥的输入参数还可以包括一些系统设定参数。在该第二密钥自动刷新时,该第二完整性保护密钥自动更新。Optionally, the input parameters of the second integrity protection key may also include some system setting parameters. When the second key is automatically refreshed, the second integrity protection key is automatically updated.
在一些实施例中,该第二加密密钥的输入参数包括以下至少之一:该第二密钥,选定的算法类型标识符,选定的算法类型标识符的长度,机密性保护算法标识,机密性保护算法标识的长度。也即,可以基于该第二密钥、选定的算法类型标识符、选定的算法类型标识符的长度、机密性保护算法标识、机密性保护算法标识的长度中的至少之一,生成该第二加密密钥。或者,该第二加密密钥的输入参数包括以下至少之一:该第一随机数,该第一密钥,该第二随机数,选定的算法类型标识符,选定的算法类型标识符的长度,机密性保护算法标识,机密性保护算法标识的长度。In some embodiments, the input parameters of the second encryption key include at least one of the following: the second key, the selected algorithm type identifier, the length of the selected algorithm type identifier, and the confidentiality protection algorithm identifier. , the length of the confidentiality protection algorithm identifier. That is, the second key may be generated based on at least one of the second key, the selected algorithm type identifier, the length of the selected algorithm type identifier, the confidentiality protection algorithm identifier, and the length of the confidentiality protection algorithm identifier. Second encryption key. Alternatively, the input parameters of the second encryption key include at least one of the following: the first random number, the first key, the second random number, the selected algorithm type identifier, the selected algorithm type identifier The length of Confidentiality Protection Algorithm Identifier, the length of Confidentiality Protection Algorithm Identifier.
可选地,该第二加密密钥的输入参数还可以包括一些系统设定参数。在该第二密钥自动刷新时,该第二加密密钥自动更新。Optionally, the input parameters of the second encryption key may also include some system setting parameters. When the second key is automatically refreshed, the second encryption key is automatically updated.
在一些实施例中,对于控制面的完整性保护密钥(K D-CPint),选定的算法类型标识符可以通过“控制面完整性保护算法”或设置特定值来表示。 In some embodiments, for the control plane integrity protection key (K D-CPint ), the selected algorithm type identifier may be represented by "Control Plane Integrity Protection Algorithm" or by setting a specific value.
在一些实施例中,对于控制面的机密性保护密钥(K D-CPenc),选定的算法类型标识符可以通过“控制面机密性保护算法”或设置特定值来表示。 In some embodiments, for the control plane confidentiality protected key (K D-CPenc ), the selected algorithm type identifier may be represented by "Control Plane Confidentiality Protection Algorithm" or by setting a specific value.
在一些实施例中,对于用户面的完整性保护密钥(K D-CPint),选定的算法类型标识符可以通过“用户面完整性保护算法”或设置特定值来表示。 In some embodiments, for the user plane integrity protection key (K D-CPint ), the selected algorithm type identifier may be represented by "User Plane Integrity Protection Algorithm" or by setting a specific value.
在一些实施例中,对于用户面的机密性保护密钥(K D-CPenc),选定的算法类型标识符可以通过“用户面机密性保护算法”或设置特定值来表示。 In some embodiments, for user plane confidentiality protected keys (K D-CPenc ), the selected algorithm type identifier may be represented by "user plane confidentiality protected algorithm" or by setting a specific value.
在一些实施例中,该第一终端设备接收该第二终端设备通过该中继设备发送的安全模式命令;In some embodiments, the first terminal device receives the safe mode command sent by the second terminal device through the relay device;
其中,该安全模式命令包括以下至少之一:该第二终端设备选取的安全算法,该第二终端设备选取的安全策略,该第二终端设备生成的第二临时公钥,该第二终端设备生成的该第二随机数,该第二终端设备生成的该第一密钥的标识的M个比特位,该中继设备的相关信息,第一消息验证码;Wherein, the security mode command includes at least one of the following: a security algorithm selected by the second terminal device, a security policy selected by the second terminal device, a second temporary public key generated by the second terminal device, The generated second random number, the M bits of the identification of the first key generated by the second terminal device, the relevant information of the relay device, and the first message verification code;
其中,该安全模式命令通过该第一加密密钥进行加密,该安全模式命令通过该第一完整性保护密钥进行完整性保护,该第一消息验证码基于该第二完整性保护密钥生成,且该第一消息验证码的输入参数包括以下至少之一:该第二终端设备选取的安全算法,该第二终端设备选取的安全策略,该第二临时公钥,该第二随机数,该M个比特位,该中继设备的相关信息;Wherein, the security mode command is encrypted by the first encryption key, the security mode command is integrity protected by the first integrity protection key, and the first message verification code is generated based on the second integrity protection key. , and the input parameters of the first message verification code include at least one of the following: the security algorithm selected by the second terminal device, the security policy selected by the second terminal device, the second temporary public key, and the second random number, The M bits, the relevant information of the relay device;
其中,该第二临时公钥和该中继设备的相关信息用于该第一终端设备派生该第一密钥,该第一密钥的标识由该M个比特位与该第一密钥的标识的另外N个比特位合并得到,M和N均为正整数。Wherein, the second temporary public key and the relevant information of the relay device are used by the first terminal device to derive the first key, and the identification of the first key consists of the M bits and the first key. The other N bits of the identifier are combined, and M and N are both positive integers.
在一些实施例中,该第二终端设备可以基于该第一终端设备的安全能力信息选取安全算法,和/或,该第二终端设备可以基于该第一终端设备的安全策略信息选取安全策略。In some embodiments, the second terminal device may select a security algorithm based on the security capability information of the first terminal device, and/or the second terminal device may select a security policy based on the security policy information of the first terminal device.
在一些实施例中,该第一终端设备的安全能力信息可以是该第一终端设备支持的密码算法列表。In some embodiments, the security capability information of the first terminal device may be a list of cryptographic algorithms supported by the first terminal device.
在一些实施例中,该第一终端设备的安全策略信息可以是该第一终端设备是否支持机密性保护或完整性保护。其中,该第一终端设备的安全策略信息包括:该第一终端设备在控制面的安全策略信息,和/或,该第一终端设备在用户面的安全策略信息。In some embodiments, the security policy information of the first terminal device may be whether the first terminal device supports confidentiality protection or integrity protection. The security policy information of the first terminal device includes: the security policy information of the first terminal device on the control plane, and/or the security policy information of the first terminal device on the user plane.
在一些实施例中,该M个比特位可以是该第一密钥的标识的最高M个比特位,该N个比特位可以是该第一密钥的标识的最低N个比特位;或者,该M个比特位可以是该第一密钥的标识的前M个比特位,该N个比特位可以是该第一密钥的标识的后N个比特位;或者,该M个比特位可以是该第一密钥的标识的偶数位的比特位,该N个比特位可以是该第一密钥的标识的奇数位的比特位。In some embodiments, the M bits may be the highest M bits of the identity of the first key, and the N bits may be the lowest N bits of the identity of the first key; or, The M bits may be the first M bits of the identifier of the first key, and the N bits may be the last N bits of the identifier of the first key; or, the M bits may be are the even-numbered bits of the identifier of the first key, and the N bits may be the odd-numbered bits of the identifier of the first key.
在一些实施例中,M与N的取值可以相同,也可以不同,本申请对此并不限定。In some embodiments, the values of M and N may be the same or different, which is not limited by this application.
在一些实施例中,在该第一随机数、该第一密钥和该第二随机数用于派生该第二密钥的情况下,该安全模式命令还包括该第二终端设备生成的该第二密钥的标识的x个比特位,以及该第一消息验证码的输入参数包括该x个比特位;其中,该第二密钥的标识由该x个比特位与该第二密钥的标识的另外y个比特位合并得到,x和y均为正整数。In some embodiments, in the case where the first random number, the first key and the second random number are used to derive the second key, the security mode command further includes the generated by the second terminal device. x bits of the identifier of the second key, and the input parameter of the first message verification code includes the x bits; wherein, the identifier of the second key consists of the x bits and the second key The other y bits of the identifier are combined, and x and y are both positive integers.
在一些实施例中,该x个比特位可以是该第二密钥的标识的最高x个比特位,该y个比特位可以是该第二密钥的标识的最低y个比特位;或者,该x个比特位可以是该第二密钥的标识的前x个比特位,该y个比特位可以是该第二密钥的标识的后y个比特位;或者,该x个比特位可以是该第二密钥的标识的偶数位的比特位,该y个比特位可以是该第二密钥的标识的奇数位的比特位。In some embodiments, the x bits may be the highest x bits of the identity of the second key, and the y bits may be the lowest y bits of the identity of the second key; or, The x bits may be the first x bits of the identifier of the second key, and the y bits may be the last y bits of the identifier of the second key; or, the x bits may be are the even-numbered bits of the identifier of the second key, and the y bits may be the odd-numbered bits of the identifier of the second key.
在一些实施例中,x与y的取值可以相同,也可以不同,本申请对此并不限定。In some embodiments, the values of x and y may be the same or different, which is not limited by this application.
在一些实施例中,在该第一随机数、该第一密钥和该第二随机数用于派生该第二密钥的情况下,该第一终端设备使用该第一加密密钥解密该安全模式命令,以及使用该第一完整性保护密钥判断该安全模式命令的完整性;In some embodiments, in the case where the first random number, the first key and the second random number are used to derive the second key, the first terminal device uses the first encryption key to decrypt the a security mode command, and using the first integrity protection key to determine the integrity of the security mode command;
在该安全模式命令中携带的信息未遭受篡改的情况下,该第一终端设备根据与该第一临时公钥配对的第一临时私钥、该第二临时公钥、该中继设备的相关信息派生该第一密钥,且该第一终端设备生成该第一密钥的标识的该N个比特位,以及将该M个比特位和该N个比特位合并得到该第一密钥的标识;When the information carried in the security mode command has not been tampered with, the first terminal device uses the first temporary private key paired with the first temporary public key, the second temporary public key, and the relay device to The information derives the first key, and the first terminal device generates the N bits of the identification of the first key, and combines the M bits and the N bits to obtain the first key logo;
该第一终端设备至少根据该第一随机数、该第一密钥和该第二随机数生成该第二密钥,该第一终端设备根据该第二密钥生成该第二完整性保护密钥和/或该第二加密密钥,以及该第一终端设备生成该第二密钥的标识的该y个比特位,并将该x个比特位和该y个比特位合并得到该第二密钥的标识;The first terminal device generates the second key based on at least the first random number, the first key and the second random number, and the first terminal device generates the second integrity protection key based on the second key. key and/or the second encryption key, and the y bits of the identification of the second key generated by the first terminal device, and the x bits and the y bits are combined to obtain the second The identification of the key;
在该第一消息验证码有效的情况下,该第一终端设备根据该第二终端设备选取的安全算法、该第二完整性保护密钥和/或该第二加密密钥、该第二终端设备选取的安全策略,与该第二终端设备进行通信。When the first message verification code is valid, the first terminal device uses the security algorithm selected by the second terminal device, the second integrity protection key and/or the second encryption key, the second terminal device The security policy selected by the device communicates with the second terminal device.
在一些实施例中,在该第一随机数、该第一密钥和该第二随机数用于派生该第二密钥的情况下,该第一终端设备通过该中继设备向该第二终端设备发送安全模式建立完成消息;其中,该安全模式建立完成消息通过该第二密钥或该第二加密密钥进行加密,该安全模式建立完成消息通过该第二密钥或该第二完整性保护密钥进行完整性保护;其中,该安全模式建立完成消息至少包括该第二密钥的标识的该y个比特位。In some embodiments, in the case where the first random number, the first key and the second random number are used to derive the second key, the first terminal device transmits data to the second key through the relay device. The terminal device sends a security mode establishment completion message; wherein the security mode establishment completion message is encrypted by the second key or the second encryption key, and the security mode establishment completion message is encrypted by the second key or the second complete encryption key. The security mode establishment completion message includes at least the y bits of the identification of the second key.
在一些实施例中,在该第一随机数、该第一密钥和该第二随机数用于派生该第二密钥的情况下,该第二完整性保护密钥的输入参数包括以下至少之一:该第二密钥,选定的算法类型标识符,选定的算法类型标识符的长度,完整性保护算法标识,完整性保护算法标识的长度;和/或,该第二加密密钥的输入参数包括以下至少之一:该第二密钥,选定的算法类型标识符,选定的算法类型标识符的长度,机密性保护算法标识,机密性保护算法标识的长度。In some embodiments, where the first random number, the first key and the second random number are used to derive the second key, the input parameters of the second integrity protection key include at least the following: One: the second key, the selected algorithm type identifier, the length of the selected algorithm type identifier, the integrity protection algorithm identifier, the length of the integrity protection algorithm identifier; and/or the second encryption key The input parameters of the key include at least one of the following: the second key, the selected algorithm type identifier, the length of the selected algorithm type identifier, the confidentiality protection algorithm identifier, and the length of the confidentiality protection algorithm identifier.
在一些实施例中,在该第一随机数、该第一密钥和该第二随机数用于派生该第二加密密钥和/或该第二完整性保护密钥的情况下,该第一终端设备使用该第一加密密钥解密该安全模式命令,以及使用该第一完整性保护密钥判断该安全模式命令的完整性;In some embodiments, where the first random number, the first key and the second random number are used to derive the second encryption key and/or the second integrity protection key, the second random number A terminal device uses the first encryption key to decrypt the security mode command, and uses the first integrity protection key to determine the integrity of the security mode command;
在该安全模式命令中携带的信息未遭受篡改的情况下,该第一终端设备根据与该第一临时公钥配对的第一临时私钥、该第二临时公钥、该中继设备的相关信息派生该第一密钥,且该第一终端设备生成该第一密钥的该N个比特位,以及将该M个比特位和该N个比特位合并得到该第一密钥的标识;When the information carried in the security mode command has not been tampered with, the first terminal device uses the first temporary private key paired with the first temporary public key, the second temporary public key, and the relay device to The information derives the first key, and the first terminal device generates the N bits of the first key, and combines the M bits and the N bits to obtain the identity of the first key;
该第一终端设备至少根据该第一随机数、该第一密钥和该第二随机数生成该第二完整性保护密钥和/或该第二加密密钥;The first terminal device generates the second integrity protection key and/or the second encryption key based on at least the first random number, the first key and the second random number;
在该第一消息验证码有效的情况下,该第一终端设备根据该第二终端设备选取的安全算法、该第二完整性保护密钥和/或该第二加密密钥、该第二终端设备选取的安全策略,与该第二终端设备进行通信。When the first message verification code is valid, the first terminal device uses the security algorithm selected by the second terminal device, the second integrity protection key and/or the second encryption key, the second terminal device The security policy selected by the device communicates with the second terminal device.
在一些实施例中,在该第一随机数、该第一密钥和该第二随机数用于派生该第二加密密钥和/或该第二完整性保护密钥的情况下,该第一终端设备通过该中继设备向该第二终端设备发送安全模式建立完成消息;其中,该安全模式建立完成消息通过该第二加密密钥进行加密,该安全模式建立完成消息通过该第二完整性保护密钥进行完整性保护。In some embodiments, where the first random number, the first key and the second random number are used to derive the second encryption key and/or the second integrity protection key, the second random number A terminal device sends a security mode establishment completion message to the second terminal device through the relay device; wherein the security mode establishment completion message is encrypted by the second encryption key, and the security mode establishment completion message is encrypted by the second complete encryption key. Integrity protection using a sex-protected key.
在一些实施例中,在该第一随机数、该第一密钥和该第二随机数用于派生该第二加密密钥和/或该第二完整性保护密钥的情况下,该第二完整性保护密钥的输入参数包括以下至少之一:该第一随机数,该第一密钥,该第二随机数,选定的算法类型标识符,选定的算法类型标识符的长度,完整性保护算法标识,完整性保护算法标识的长度;和/或,该第二加密密钥的输入参数包括以下至少之一:该第一随机数,该第一密钥,该第二随机数,选定的算法类型标识符,选定的算法类型标识符的长度, 机密性保护算法标识,机密性保护算法标识的长度。In some embodiments, where the first random number, the first key and the second random number are used to derive the second encryption key and/or the second integrity protection key, the second random number The input parameters of the two integrity protection keys include at least one of the following: the first random number, the first key, the second random number, the selected algorithm type identifier, and the length of the selected algorithm type identifier. , the integrity protection algorithm identifier, the length of the integrity protection algorithm identifier; and/or, the input parameters of the second encryption key include at least one of the following: the first random number, the first key, the second random number Number, selected algorithm type identifier, length of selected algorithm type identifier, confidentiality protected algorithm identifier, length of confidentiality protected algorithm identifier.
在一些实施例中,对于第一终端设备而言,生成第一密钥时的输入参数包括:第一终端设备生成的第二临时私钥(Ephemeral private key2)、第二终端设备生成的第一临时公钥(Ephemeral public key1),以及中继设备的相关信息(如中继设备的身份信息,或者中继设备生成的随机数,或者中继设备生成的计数器(COUNT))。对于第二终端设备而言,生成第一密钥时的输入参数包括:第一终端设备生成的第二临时公钥(Ephemeral public key2)、第二终端设备生成的第一临时私钥(Ephemeral private key1),以及中继设备的相关信息(如中继设备的身份信息,或者中继设备生成的随机数,或者中继设备生成的计数器(COUNT))。其中,第一临时公钥与第一临时私钥配对,第二临时公钥与第二临时私钥配对。In some embodiments, for the first terminal device, the input parameters when generating the first key include: a second temporary private key (Ephemeral private key2) generated by the first terminal device, a first temporary private key generated by the second terminal device. Temporary public key (Ephemeral public key1), and related information of the relay device (such as the identity information of the relay device, or the random number generated by the relay device, or the counter (COUNT) generated by the relay device). For the second terminal device, the input parameters when generating the first key include: the second temporary public key (Ephemeral public key2) generated by the first terminal device, the first temporary private key (Ephemeral private key2) generated by the second terminal device. key1), and related information of the relay device (such as the identity information of the relay device, or the random number generated by the relay device, or the counter (COUNT) generated by the relay device). The first temporary public key is paired with the first temporary private key, and the second temporary public key is paired with the second temporary private key.
在一些实施例中,该第一密钥可以是K D,该第一密钥的标识可以是K D ID;该第二密钥可以是K D-SESS,该第二密钥的标识可以是K D-SESS ID。 In some embodiments, the first key may be K D , and the identifier of the first key may be K D ID ; the second key may be K D -SESS , and the identifier of the second key may be K D-SESS ID.
K D:密钥长度至少为256比特(bits),由源设备和目标设备双方通过临时公私钥协商生成。基于根密钥,通过重新运行认证流程来更新K D。K D用于生成下一层密钥K D-sess。即使源设备与目标设备之间没有活动的通信会话,那么也可以保存该密钥。K D ID可以用来标识K DK D : The key length is at least 256 bits (bits) and is generated by both the source device and the target device through temporary public and private key negotiation. Based on the root key, K D is updated by rerunning the authentication process. K D is used to generate the next layer key K D-sess . The key can be saved even if there is no active communication session between the source and target devices. K D ID can be used to identify K D .
KD:对于UE-1而言,生成时的输入参数包括:UE-1的临时私钥Ephemeral private key2、UE-2的临时公钥Ephemeral public key1、以及UE-relay的身份信息,或者UE-relay生成的随机数,或者UE-relay生成的计数器COUNT;对于UE-2而言,生成时的输入参数包括:UE-1的临时公钥Ephemeral public key2、UE-2的临时私钥Ephemeral private key1、以及UE-relay的身份,或者UE-relay生成的随机数,或者UE-relay生成的计数器COUNT。KD: For UE-1, the input parameters during generation include: UE-1’s temporary private key Ephemeral private key2, UE-2’s temporary public key Ephemeral public key1, and the identity information of UE-relay, or UE-relay The generated random number, or the counter COUNT generated by UE-relay; for UE-2, the input parameters during generation include: UE-1's temporary public key Ephemeral public key2, UE-2's temporary private key Ephemeral private key1, And the identity of UE-relay, or the random number generated by UE-relay, or the counter COUNT generated by UE-relay.
K D-sess:密钥长度至少为256bits,K D-sess用于派生下一层完整性保护或机密性保护密钥。可以基于K D,通过重新运行安全连接建立流程或者相关的密钥更新流程来刷新K D-sess。K D-sess ID用于标识K D-sess。K D-sess由K D使用HMAC-SHA-256或HMAC-SM3等密钥派生算法衍生而成。K D-sess的输入参数至少必须含有密钥K D、随机数Nonce_1(即第一终端设备生成的第一随机数)、随机数Nonce_2(即第二终端设备生成的第二随机数)。可选地,K D-sess的输入参数还可以包括但不限于以下至少之一:源标识(Source ID)、目标标识(Destination ID)、随机数Nonce_1的长度、随机数Nonce_2的长度、源标识(Source ID)的长度、目标标识(Destination ID)的长度。另外,K D-sess的输入参数还可以包括其他系统设定参数,如3GPP指定的一个或多个固定参数。 K D-sess : The key length is at least 256 bits. K D-sess is used to derive the next level of integrity protection or confidentiality protection key. K D -sess can be refreshed based on K D by rerunning the secure connection establishment process or the related key update process. K D-sess ID is used to identify K D-sess . KD-sess is derived from KD using key derivation algorithms such as HMAC-SHA-256 or HMAC-SM3. The input parameters of K D-sess must at least include the key K D , the random number Nonce_1 (that is, the first random number generated by the first terminal device), and the random number Nonce_2 (that is, the second random number generated by the second terminal device). Optionally, the input parameters of K D-sess may also include but are not limited to at least one of the following: source ID (Source ID), destination ID (Destination ID), the length of the random number Nonce_1, the length of the random number Nonce_2, the source ID (Source ID) length, destination ID (Destination ID) length. In addition, the input parameters of K D-sess can also include other system setting parameters, such as one or more fixed parameters specified by 3GPP.
K D-CPint:密钥长度至少为128bits,该密钥可以用于控制面数据完整性保护,该密钥由K D-sess使用HMAC-SHA-256或HMAC-SM3等密钥派生算法衍生而来。K D-CPint的输入参数至少必须含有密钥K D-sess、所选定的算法类型标识符(比如“控制面完整性保护算法”或设置特定值来表示)及该选定的算法类型标识符的长度,完整性保护算法标识以及该完整性保护算法标识的长度,其他系统设定参数可以作为可选输入参数。在K D-sess自动刷新时,K D-CPint自动更新。 K D-CPint : The key length is at least 128 bits. This key can be used for control plane data integrity protection. The key is derived by K D-sess using key derivation algorithms such as HMAC-SHA-256 or HMAC-SM3. Come. The input parameters of K D-CPint must contain at least the key K D-sess , the selected algorithm type identifier (such as "control plane integrity protection algorithm" or setting a specific value to represent it) and the selected algorithm type identifier. The length of the symbol, the integrity protection algorithm identifier and the length of the integrity protection algorithm identifier, and other system setting parameters can be used as optional input parameters. K D -CPint is automatically updated when K D- sess is automatically refreshed.
K D-CPenc:密钥长度至少为128bits,该密钥可以用于控制面数据机密性保护,该密钥由K D-sess使用HMAC-SHA-256或HMAC-SM3等密钥派生算法衍生而来。K D-CPenc的输入参数至少必须含有密钥K D-sess,所选定的算法类型标识符(比如“控制面机密性保护算法”或设置特定值来表示)及选定的算法类型标识符的长度,机密性保护算法标识以及该机密性保护算法标识的长度,其他系统设定参数可以作为可选输入参数。在K D-sess自动刷新时,K D-CPenc自动更新。 K D-CPenc : The key length is at least 128 bits. This key can be used for control plane data confidentiality protection. The key is derived by K D-sess using key derivation algorithms such as HMAC-SHA-256 or HMAC-SM3. Come. The input parameters of K D-CPenc must contain at least the key K D-sess , the selected algorithm type identifier (such as "Control Plane Confidentiality Protection Algorithm" or set a specific value to represent it) and the selected algorithm type identifier The length, the confidentiality protection algorithm identifier and the length of the confidentiality protection algorithm identifier, and other system setting parameters can be used as optional input parameters. K D -CPenc is automatically updated when K D- sess is automatically refreshed.
K D-UPint:密钥长度至少为128bits,该密钥可以用于用户面数据完整性保护,该密钥由K D-sess使用HMAC-SHA-256或HMAC-SM3等密钥派生算法衍生而来。K D-UPint的输入参数至少必须含有密钥K D-sess,所选定的算法类型标识符(比如“用户面完整性保护算法”或设置特定值来表示)及该选定的算法类型标识符的长度,完整性保护算法标识以及该完整性保护算法标识的长度,其他系统设定参数可以作为可选输入参数。在K D-sess自动刷新时,K D-UPint自动更新。 K D-UPint : The key length is at least 128 bits. This key can be used for user plane data integrity protection. The key is derived by K D-sess using key derivation algorithms such as HMAC-SHA-256 or HMAC-SM3. Come. The input parameters of K D-UPint must contain at least the key K D-sess , the selected algorithm type identifier (such as "user plane integrity protection algorithm" or setting a specific value to represent it) and the selected algorithm type identifier. The length of the symbol, the integrity protection algorithm identifier and the length of the integrity protection algorithm identifier, and other system setting parameters can be used as optional input parameters. K D -UPint is automatically updated when K D-sess is automatically refreshed.
K D-UPenc:密钥长度至少为128bits,该密钥可以用于用户面数据机密性保护,该密钥由K D-sess使用HMAC-SHA-256或HMAC-SM3等密钥派生算法衍生而来。K D-UPenc的输入参数至少必须含有密钥K D-sess,所选定的算法类型标识符(比如“用户面机密性保护算法”或设置特定值来表示)及该选定的算法类型标识符的长度,机密性保护算法标识以及该机密性保护算法标识的长度,其他系统设定参数可以作为可选输入参数。在K D-sess自动刷新时,K D-UPenc自动更新。 K D-UPenc : The key length is at least 128 bits. This key can be used for user plane data confidentiality protection. The key is derived by K D-sess using key derivation algorithms such as HMAC-SHA-256 or HMAC-SM3. Come. The input parameters of K D-UPenc must contain at least the key K D-sess , the selected algorithm type identifier (such as "user plane confidentiality protection algorithm" or setting a specific value to represent it) and the selected algorithm type identifier. The length of the character, the confidentiality protection algorithm identifier and the length of the confidentiality protection algorithm identifier, and other system setting parameters can be used as optional input parameters. K D -UPenc is automatically updated when K D -sess is automatically refreshed.
在一些实施例中,本申请中的ECCSI仅为示例,并不局限于该算法,也可以使用其他基于身份的公钥签名和公钥加密算法来替换,在替换公钥算法的同时,所有请求消息中与公钥算法相关的参数需要作相应替换。In some embodiments, ECCSI in this application is only an example and is not limited to this algorithm. It can also be replaced by other identity-based public key signature and public key encryption algorithms. While replacing the public key algorithm, all requests Parameters related to the public key algorithm in the message need to be replaced accordingly.
在一些实施例中,本申请中第一终端设备和第二终端设备使用的密钥派生函数不局限于HMAC-SHA-256或HMAC-SM3,包括任何一种满足计算安全的密钥派生函数。In some embodiments, the key derivation function used by the first terminal device and the second terminal device in this application is not limited to HMAC-SHA-256 or HMAC-SM3, and includes any key derivation function that meets computational security.
在一些实施例中,本申请中密钥派生函数的输入参数不局限于上述提到的必要参数,可以含有其他可选参数,比如应用系统设置固定参数。In some embodiments, the input parameters of the key derivation function in this application are not limited to the necessary parameters mentioned above, and may include other optional parameters, such as fixed parameters set by the application system.
在一些实施例中,本申请中的密钥管理中心不限于KMS、PKMF、5GPKMF,运营商管理或被第三方业务提供商管理的合法密钥管理中心均适用于本申请的技术方案。In some embodiments, the key management center in this application is not limited to KMS, PKMF, and 5GPKMF. Legal key management centers managed by operators or managed by third-party service providers are all applicable to the technical solution of this application.
本方案中,PKMF为已注册并被授权使用UE-to-UE relay功能的终端设备下发的对称密钥不局限于上述方案,具体配置可根据运营商或业务提供商对PKMF的设计而更改。In this solution, the symmetric key issued by PKMF to the terminal device that has been registered and authorized to use the UE-to-UE relay function is not limited to the above solution. The specific configuration can be changed according to the operator or service provider's design of PKMF. .
在一些实施例中,本申请中安全通信建立流程中所有交互消息中的信息元素并不局限于上述方案中提到的内容,也可以增加由于应用系统要求的可选信息元素。In some embodiments, the information elements in all interactive messages in the secure communication establishment process in this application are not limited to the content mentioned in the above solution, and optional information elements due to application system requirements can also be added.
因此,在本申请实施例中,第一终端设备可以基于第二终端设备通过中继设备发送的直接通信请求生成第一密钥,且该直接通信请求通过第一加密密钥进行加密,以及直接通信请求通过第一完整性保护密钥进行完整性保护。以及第一终端设备生成的第一随机数、第一密钥和第二终端设备生成的第二随机数用于派生第二密钥,第二密钥用于派生第二加密密钥和/或第二完整性保护密钥,或者,第一终端设备生成的第一随机数、第一密钥和第二终端设备用于派生第二随机数生成第二加密密钥和/或第二完整性保护密钥,能够保证第一终端设备和第二终端设备的身份安全与通信数据的机密性与完整性,从而确保双方传输数据的机密性和完整性,防止其他设备甚至中继设备的窃听。Therefore, in this embodiment of the present application, the first terminal device can generate the first key based on the direct communication request sent by the second terminal device through the relay device, and the direct communication request is encrypted by the first encryption key, and directly The communication request is integrity protected via the first integrity protection key. and a first random number generated by the first terminal device, a first key and a second random number generated by the second terminal device for deriving the second key, the second key being used for deriving the second encryption key and/or The second integrity protection key, or the first random number generated by the first terminal device, the first key and the second terminal device are used to derive the second random number to generate the second encryption key and/or the second integrity Protecting the key can ensure the identity security of the first terminal device and the second terminal device and the confidentiality and integrity of the communication data, thereby ensuring the confidentiality and integrity of the data transmitted by both parties and preventing eavesdropping by other devices and even relay devices.
本申请实施例适用于5G L2 UE-to-UE relay架构下第一终端设备(源设备)和第二终端设备(目标设备)之间的安全通信建立流程。通过使用PKMF的密钥生成和安全下发功能,通过PKMF下发给已注册并被授权使用UE-to-UE relay功能的终端设备对称密钥,保护算法和密钥协商,从而高效的建立源UE和目标UE间端到端的安全通道。本申请实施例在计算和通信上都有非常高的效率,同样的能够实现认证性,加密保护,完整性保护,抵抗篡改和降级攻击。The embodiment of this application is suitable for the secure communication establishment process between the first terminal device (source device) and the second terminal device (target device) under the 5G L2 UE-to-UE relay architecture. By using PKMF's key generation and secure delivery functions, PKMF delivers symmetric keys, protection algorithms and key negotiation to terminal devices that have registered and are authorized to use the UE-to-UE relay function, thereby efficiently establishing source End-to-end secure channel between UE and target UE. The embodiments of this application have very high efficiency in calculation and communication, and can also achieve authentication, encryption protection, integrity protection, and resistance to tampering and downgrade attacks.
上文结合图16,详细描述了本申请的第一终端设备侧实施例,下文结合图17,详细描述本申请的第二终端设备侧实施例,应理解,第二终端设备侧实施例与第一终端设备侧实施例相互对应,类似的描述可以参照第一终端设备侧实施例。The first terminal device side embodiment of the present application is described in detail above with reference to FIG. 16 , and the second terminal device side embodiment of the present application is described in detail below with reference to FIG. 17 . It should be understood that the second terminal device side embodiment is different from the second terminal device side embodiment. The terminal device side embodiments correspond to each other, and similar descriptions may refer to the first terminal device side embodiment.
图17是根据本申请实施例的中继通信的方法900的示意性流程图,如图17所示,该中继通信的方法900可以包括如下内容中的至少部分内容:Figure 17 is a schematic flow chart of a communication relay method 900 according to an embodiment of the present application. As shown in Figure 17, the communication relay method 900 may include at least part of the following content:
S910,第二终端设备接收第一终端设备通过中继设备发送的直接通信请求;其中,该直接通信请求包括以下至少之一:该第一终端设备的安全能力信息,该第一终端设备的安全策略信息,该第一终端设备生成的第一临时公钥,该第一终端设备生成的第一随机数,该中继设备的标识,该中继设备的相关信息;其中,该直接通信请求通过第一加密密钥进行加密,以及该直接通信请求通过第一完整性保护密钥进行完整性保护,该第一加密密钥为基于已注册并被授权使用终端至终端中继(UE-to-UE relay)通信的终端的对称密钥衍生的加密密钥,该第一完整性保护密钥为基于已注册并被授权使用UE-to-UE relay通信的终端的对称密钥衍生的完整性保护密钥;其中,该中继设备的相关信息包括以下之一:该中继设备的身份信息,该中继设备生成的随机数,该中继设备生成的计数器;该第一临时公钥和该中继设备的相关信息用于该第二终端设备派生第一密钥;该第一随机数、该第一密钥和该第二终端设备生成的第二随机数用于派生第二密钥,且该第二密钥用于派生第二加密密钥和/或第二完整性保护密钥,或者,该第一随机数、该第一密钥和该第二终端设备生成的第二随机数用于派生第二加密密钥和/或第二完整性保护密钥。S910. The second terminal device receives the direct communication request sent by the first terminal device through the relay device; wherein the direct communication request includes at least one of the following: the security capability information of the first terminal device, the security capability information of the first terminal device. Policy information, the first temporary public key generated by the first terminal device, the first random number generated by the first terminal device, the identification of the relay device, and the relevant information of the relay device; wherein the direct communication request passes The first encryption key is encrypted, and the direct communication request is integrity protected by a first integrity protection key based on the first encryption key that is registered and authorized to use the UE-to-UE relay. The first integrity protection key is an encryption key derived from the symmetric key of the terminal for UE-to-UE relay communication. The first integrity protection key is an integrity protection key derived from the symmetric key of the terminal that has been registered and authorized to use UE-to-UE relay communication. Key; wherein, the relevant information of the relay device includes one of the following: the identity information of the relay device, the random number generated by the relay device, the counter generated by the relay device; the first temporary public key and the The relevant information of the relay device is used by the second terminal device to derive the first key; the first random number, the first key and the second random number generated by the second terminal device are used to derive the second key, And the second key is used to derive a second encryption key and/or a second integrity protection key, or the first random number, the first key and the second random number generated by the second terminal device For deriving a second encryption key and/or a second integrity protection key.
本实施例基于5G PKMT分配的对称密钥建立安全通信的方案,建立L2架构下的UE-to-UE中继场景下的安全连接。具体的,本申请实施例应用于L2架构下的UE-to-UE中继场景,也即,第一终端设备与第二终端设备之间通过中继设备进行通信。例如,第一终端设备与第二终端设备之间的中继连接可以是PC5链路。This embodiment establishes a secure communication solution based on the symmetric key distributed by 5G PKMT, and establishes a secure connection in the UE-to-UE relay scenario under the L2 architecture. Specifically, the embodiments of this application are applied to the UE-to-UE relay scenario under the L2 architecture, that is, the first terminal device and the second terminal device communicate through the relay device. For example, the relay connection between the first terminal device and the second terminal device may be a PC5 link.
在本申请实施例中,该第一终端设备可以是源设备或源终端,该第二终端设备可以是目标设备或目标终端。该中继设备可以是中继终端。In this embodiment of the present application, the first terminal device may be a source device or a source terminal, and the second terminal device may be a target device or a target terminal. The relay device may be a relay terminal.
在一些实施例中,该第一加密密钥可以为邻近业务加密密钥(PEK),该第一完整性保护密钥可以为邻近业务完整性保护密钥(PIK)。当然,该第一加密密钥也可以是其他的加密密钥,该第一完整性保护密钥也可以是其他的完整性保护密钥,本申请对此并不限定。In some embodiments, the first encryption key may be a Proximity Service Encryption Key (PEK), and the first integrity protection key may be a Proximity Service Integrity Protection Key (PIK). Of course, the first encryption key can also be other encryption keys, and the first integrity protection key can also be other integrity protection keys, which is not limited by this application.
在一些实施例中,在该第一随机数、该第一密钥和该第二随机数用于派生该第二密钥的情况下,该第二终端设备使用该第一加密密钥解密该直接通信请求,以及使用该第一完整性保护密钥判断该直接通信请求的完整性;In some embodiments, in the case where the first random number, the first key and the second random number are used to derive the second key, the second terminal device uses the first encryption key to decrypt the Direct communication request, and using the first integrity protection key to determine the integrity of the direct communication request;
在该直接通信请求中携带的信息未遭受篡改的情况下,该第二终端设备生成第二临时私钥,以及该第二终端设备根据该第一临时公钥、该第二临时私钥和该中继设备的相关信息派生该第一密钥,且该第二终端设备生成该第一密钥的标识的M个比特位;In the case that the information carried in the direct communication request has not been tampered with, the second terminal device generates a second temporary private key, and the second terminal device generates a second temporary private key based on the first temporary public key, the second temporary private key and the The first key is derived from the relevant information of the relay device, and the second terminal device generates M bits of the identification of the first key;
该第二终端设备生成该第二随时数,以及该第二终端设备至少根据该第一随机数、该第一密钥和该第二随机数生成该第二密钥,该第二终端设备根据该第二密钥生成该第二完整性保护密钥和/或该第二加密密钥,且该第二终端设备生成该第二密钥的标识的x个比特位;The second terminal device generates the second random number, and the second terminal device generates the second key according to at least the first random number, the first key and the second random number. The second terminal device generates the second key according to at least the first random number, the first key and the second random number. The second key generates the second integrity protection key and/or the second encryption key, and the second terminal device generates x bits of the identification of the second key;
其中,该第一密钥的标识由该M个比特位与该第一密钥的标识的另外N个比特位合并得到,M和N均为正整数,该第二密钥的标识由该x个比特位与该第二密钥的标识的另外y个比特位合并得到,x和y均为正整数。Wherein, the identification of the first key is obtained by combining the M bits and the other N bits of the identification of the first key, M and N are both positive integers, and the identification of the second key is obtained by the x bits are combined with other y bits of the identifier of the second key, and x and y are both positive integers.
在一些实施例中,该第二终端设备可以基于该第一终端设备的安全能力信息选取安全算法,和/或,该第二终端设备可以基于该第一终端设备的安全策略信息选取安全策略。In some embodiments, the second terminal device may select a security algorithm based on the security capability information of the first terminal device, and/or the second terminal device may select a security policy based on the security policy information of the first terminal device.
在一些实施例中,该第一终端设备的安全能力信息可以是该第一终端设备支持的密码算法列表。In some embodiments, the security capability information of the first terminal device may be a list of cryptographic algorithms supported by the first terminal device.
在一些实施例中,该第一终端设备的安全策略信息可以是该第一终端设备是否支持机密性保护或完整性保护。其中,该第一终端设备的安全策略信息包括:该第一终端设备在控制面的安全策略信息,和/或,该第一终端设备在用户面的安全策略信息。In some embodiments, the security policy information of the first terminal device may be whether the first terminal device supports confidentiality protection or integrity protection. The security policy information of the first terminal device includes: the security policy information of the first terminal device on the control plane, and/or the security policy information of the first terminal device on the user plane.
在一些实施例中,该M个比特位可以是该第一密钥的标识的最高M个比特位,该N个比特位可以是该第一密钥的标识的最低N个比特位;或者,该M个比特位可以是该第一密钥的标识的前M个比特位,该N个比特位可以是该第一密钥的标识的后N个比特位;或者,该M个比特位可以是该第一密钥的标识的偶数位的比特位,该N个比特位可以是该第一密钥的标识的奇数位的比特位。In some embodiments, the M bits may be the highest M bits of the identity of the first key, and the N bits may be the lowest N bits of the identity of the first key; or, The M bits may be the first M bits of the identifier of the first key, and the N bits may be the last N bits of the identifier of the first key; or, the M bits may be are the even-numbered bits of the identifier of the first key, and the N bits may be the odd-numbered bits of the identifier of the first key.
在一些实施例中,M与N的取值可以相同,也可以不同,本申请对此并不限定。In some embodiments, the values of M and N may be the same or different, which is not limited by this application.
在一些实施例中,该x个比特位可以是该第二密钥的标识的最高x个比特位,该y个比特位可以是该第二密钥的标识的最低y个比特位;或者,该x个比特位可以是该第二密钥的标识的前x个比特位,该y个比特位可以是该第二密钥的标识的后y个比特位;或者,该x个比特位可以是该第二密钥的标识的偶数位的比特位,该y个比特位可以是该第二密钥的标识的奇数位的比特位。In some embodiments, the x bits may be the highest x bits of the identity of the second key, and the y bits may be the lowest y bits of the identity of the second key; or, The x bits may be the first x bits of the identifier of the second key, and the y bits may be the last y bits of the identifier of the second key; or, the x bits may be are the even-numbered bits of the identifier of the second key, and the y bits may be the odd-numbered bits of the identifier of the second key.
在一些实施例中,x与y的取值可以相同,也可以不同,本申请对此并不限定。In some embodiments, the values of x and y may be the same or different, which is not limited by this application.
在一些实施例中,在该第一随机数、该第一密钥和该第二随机数用于派生该第二密钥的情况下,该第二终端设备通过该中继设备向该第一终端设备发送安全模式命令;In some embodiments, in the case where the first random number, the first key and the second random number are used to derive the second key, the second terminal device transmits data to the first through the relay device. The terminal device sends a safe mode command;
其中,该安全模式命令包括以下至少之一:该第二终端设备选取的安全算法,该第二终端设备选取的安全策略,该第二终端设备生成的与该第二临时私钥配对的第二临时公钥,该第二随机数,该第一密钥的标识的该M个比特位,该第二密钥的标识的该x个比特位,第一消息验证码;Wherein, the security mode command includes at least one of the following: the security algorithm selected by the second terminal device, the security policy selected by the second terminal device, and the second temporary private key generated by the second terminal device and paired with the second temporary private key. The temporary public key, the second random number, the M bits of the identifier of the first key, the x bits of the identifier of the second key, and the first message verification code;
其中,该安全模式命令通过该第一加密密钥进行加密,该安全模式命令通过该第一完整性保护密钥进行完整性保护,该第一消息验证码基于该第二完整性保护密钥生成,且该第一消息验证码的输入参数包括以下至少之一:该第二终端设备选取的安全算法,该第二终端设备选取的安全策略,该第二临时公钥,该第二随机数,该M个比特位,该x个比特位,该中继设备的相关信息;该第二临时公钥和该中继设备的相关信息用于该第一终端设备派生该第一密钥。Wherein, the security mode command is encrypted by the first encryption key, the security mode command is integrity protected by the first integrity protection key, and the first message verification code is generated based on the second integrity protection key. , and the input parameters of the first message verification code include at least one of the following: the security algorithm selected by the second terminal device, the security policy selected by the second terminal device, the second temporary public key, and the second random number, The M bits, the x bits, the relevant information of the relay device; the second temporary public key and the relevant information of the relay device are used by the first terminal device to derive the first key.
在一些实施例中,在该第一随机数、该第一密钥和该第二随机数用于派生该第二密钥的情况下,该第二终端设备接收该第一终端设备通过该中继设备发送的安全模式建立完成消息;In some embodiments, in the case where the first random number, the first key and the second random number are used to derive the second key, the second terminal device receives the first terminal device through the Following the safe mode establishment completion message sent by the device;
其中,该安全模式建立完成消息通过该第二密钥或该第二加密密钥进行加密,该安全模式建立完成消息通过该第二密钥或该第二完整性保护密钥进行完整性保护;Wherein, the security mode establishment completion message is encrypted by the second key or the second encryption key, and the security mode establishment completion message is integrity protected by the second key or the second integrity protection key;
其中,该安全模式建立完成消息至少包括该第二密钥的标识的该y个比特位。Wherein, the security mode establishment completion message includes at least the y bits of the identification of the second key.
在一些实施例中,在该第一随机数、该第一密钥和该第二随机数用于派生该第二密钥的情况下,该第二完整性保护密钥的输入参数包括以下至少之一:该第二密钥,选定的算法类型标识符,选定的算法类型标识符的长度,完整性保护算法标识,完整性保护算法标识的长度;和/或,In some embodiments, where the first random number, the first key and the second random number are used to derive the second key, the input parameters of the second integrity protection key include at least the following: One: the second key, the selected algorithm type identifier, the length of the selected algorithm type identifier, the integrity protection algorithm identifier, the length of the integrity protection algorithm identifier; and/or,
该第二加密密钥的输入参数包括以下至少之一:该第二密钥,选定的算法类型标识符,选定的算法类型标识符的长度,机密性保护算法标识,机密性保护算法标识的长度。The input parameters of the second encryption key include at least one of the following: the second key, the selected algorithm type identifier, the length of the selected algorithm type identifier, the confidentiality protection algorithm identifier, the confidentiality protection algorithm identifier length.
在一些实施例中,在该第一随机数、该第一密钥和该第二随机数用于派生该第二加密密钥和/或该第二完整性保护密钥的情况下,该第二终端设备使用该第一加密密钥解密该直接通信请求,以及使用该第一完整性保护密钥判断该直接通信请求的完整性;In some embodiments, where the first random number, the first key and the second random number are used to derive the second encryption key and/or the second integrity protection key, the second random number The second terminal device uses the first encryption key to decrypt the direct communication request, and uses the first integrity protection key to determine the integrity of the direct communication request;
在该直接通信请求中携带的信息未遭受篡改的情况下,该第二终端设备生成第二临时私钥,以及该第二终端设备根据该第一临时公钥、该第二临时私钥和该中继设备的相关信息派生该第一密钥,且该第二终端设备生成该第一密钥的标识的M个比特位;In the case that the information carried in the direct communication request has not been tampered with, the second terminal device generates a second temporary private key, and the second terminal device generates a second temporary private key based on the first temporary public key, the second temporary private key and the The first key is derived from the relevant information of the relay device, and the second terminal device generates M bits of the identification of the first key;
该第二终端设备生成该第二随时数,以及该第二终端设备至少根据该第一随机数、该第一密钥和该第二随机数生成该第二完整性保护密钥和/或该第二加密密钥;The second terminal device generates the second random number, and the second terminal device generates the second integrity protection key and/or the second random number based on at least the first random number, the first key and the second random number. second encryption key;
其中,该第一密钥的标识由该M个比特位与该第一密钥的标识的另外N个比特位合并得到,M和N均为正整数。Wherein, the identifier of the first key is obtained by combining the M bits and the other N bits of the identifier of the first key, and M and N are both positive integers.
在一些实施例中,在该第一随机数、该第一密钥和该第二随机数用于派生该第二加密密钥和/或该第二完整性保护密钥的情况下,该第二终端设备通过该中继设备向该第一终端设备发送安全模式命令;In some embodiments, where the first random number, the first key and the second random number are used to derive the second encryption key and/or the second integrity protection key, the second random number The second terminal device sends a safe mode command to the first terminal device through the relay device;
其中,该安全模式命令包括以下至少之一:该第二终端设备选取的安全算法,该第二终端设备选取的安全策略,该第二终端设备生成的与该第二临时私钥配对的第二临时公钥,该第二随机数,该第一密钥的标识的该M个比特位,第一消息验证码;Wherein, the security mode command includes at least one of the following: the security algorithm selected by the second terminal device, the security policy selected by the second terminal device, and the second temporary private key generated by the second terminal device and paired with the second temporary private key. The temporary public key, the second random number, the M bits of the identification of the first key, and the first message verification code;
其中,该安全模式命令通过该第一加密密钥进行加密,该安全模式命令通过该第一完整性保护密钥进行完整性保护,该第一消息验证码基于该第二完整性保护密钥生成,且该第一消息验证码的输入参数包括以下至少之一:该第二终端设备选取的安全算法,该第二终端设备选取的安全策略,该第二临时公钥,该第二随机数,该M个比特位;该第二临时公钥和该中继设备的相关信息用于该第一终端设备派生该第一密钥。Wherein, the security mode command is encrypted by the first encryption key, the security mode command is integrity protected by the first integrity protection key, and the first message verification code is generated based on the second integrity protection key. , and the input parameters of the first message verification code include at least one of the following: the security algorithm selected by the second terminal device, the security policy selected by the second terminal device, the second temporary public key, and the second random number, The M bits; the second temporary public key and the related information of the relay device are used by the first terminal device to derive the first key.
在一些实施例中,在该第一随机数、该第一密钥和该第二随机数用于派生该第二加密密钥和/或该第二完整性保护密钥的情况下,该第二终端设备接收该第一终端设备通过该中继设备发送的安全模式建立完成消息;In some embodiments, where the first random number, the first key and the second random number are used to derive the second encryption key and/or the second integrity protection key, the second random number The second terminal device receives the security mode establishment completion message sent by the first terminal device through the relay device;
其中,该安全模式建立完成消息通过该第二加密密钥进行加密,该安全模式建立完成消息通过该第二完整性保护密钥进行完整性保护。Wherein, the security mode establishment completion message is encrypted by the second encryption key, and the security mode establishment completion message is integrity protected by the second integrity protection key.
在一些实施例中,在该第一随机数、该第一密钥和该第二随机数用于派生该第二加密密钥和/或该第二完整性保护密钥的情况下,该第二完整性保护密钥的输入参数包括以下至少之一:该第一随机数,该第一密钥,该第二随机数,选定的算法类型标识符,选定的算法类型标识符的长度,完整性保护算法标识,完整性保护算法标识的长度;和/或,In some embodiments, where the first random number, the first key and the second random number are used to derive the second encryption key and/or the second integrity protection key, the second random number The input parameters of the two integrity protection keys include at least one of the following: the first random number, the first key, the second random number, the selected algorithm type identifier, and the length of the selected algorithm type identifier. , the integrity protection algorithm identifier, the length of the integrity protection algorithm identifier; and/or,
该第二加密密钥的输入参数包括以下至少之一:该第一随机数,该第一密钥,该第二随机数,选定的算法类型标识符,选定的算法类型标识符的长度,机密性保护算法标识,机密性保护算法标识的长度。The input parameters of the second encryption key include at least one of the following: the first random number, the first key, the second random number, the selected algorithm type identifier, and the length of the selected algorithm type identifier. , confidentiality protection algorithm identifier, the length of the confidentiality protection algorithm identifier.
在一些实施例中,该安全模式命令还包括该中继设备的相关信息,以及该第一消息验证码的输入参数还包括该中继设备的相关信息。In some embodiments, the safe mode command also includes information related to the relay device, and the input parameter of the first message verification code also includes information related to the relay device.
在一些实施例中,该第二终端设备根据该第二终端设备选取的安全算法、该第二完整性保护密钥和/或该第二加密密钥、该第二终端设备选取的安全策略,与该第一终端设备进行通信。In some embodiments, the second terminal device selects the security algorithm according to the second terminal device, the second integrity protection key and/or the second encryption key, and the security policy selected by the second terminal device. Communicate with the first terminal device.
因此,在本申请实施例中,第一终端设备可以基于第二终端设备通过中继设备发送的直接通信请求生成第一密钥,且该直接通信请求通过第一加密密钥进行加密,以及直接通信请求通过第一完整性保护密钥进行完整性保护。以及第一终端设备生成的第一随机数、第一密钥和第二终端设备生成的第二随机数用于派生第二密钥,第二密钥用于派生第二加密密钥和/或第二完整性保护密钥,或者,第一终端设备生成的第一随机数、第一密钥和第二终端设备用于派生第二随机数生成第二加密密钥和/或第二完整性保护密钥,能够保证第一终端设备和第二终端设备的身份安全与通信数据的机密性与完整性,从而确保双方传输数据的机密性和完整性,防止其他设备甚至中继设备的窃听。Therefore, in this embodiment of the present application, the first terminal device can generate the first key based on the direct communication request sent by the second terminal device through the relay device, and the direct communication request is encrypted by the first encryption key, and directly The communication request is integrity protected via the first integrity protection key. and a first random number generated by the first terminal device, a first key and a second random number generated by the second terminal device for deriving the second key, the second key being used for deriving the second encryption key and/or The second integrity protection key, or the first random number generated by the first terminal device, the first key and the second terminal device are used to derive the second random number to generate the second encryption key and/or the second integrity Protecting the key can ensure the identity security of the first terminal device and the second terminal device and the confidentiality and integrity of the communication data, thereby ensuring the confidentiality and integrity of the data transmitted by both parties and preventing eavesdropping by other devices and even relay devices.
本申请实施例适用于5G L2 UE-to-UE relay架构下第一终端设备(源设备)和第二终端设备(目标设备)之间的安全通信建立流程。通过使用PKMF的密钥生成和安全下发功能,通过PKMF下发给已注册并被授权使用UE-to-UE relay功能的终端设备对称密钥,保护算法和密钥协商,从而高效的建立源UE和目标UE间端到端的安全通道。本申请实施例在计算和通信上都有非常高的效率,同样的能够实现认证性,加密保护,完整性保护,抵抗篡改和降级攻击。The embodiment of this application is suitable for the secure communication establishment process between the first terminal device (source device) and the second terminal device (target device) under the 5G L2 UE-to-UE relay architecture. By using PKMF's key generation and secure delivery functions, PKMF delivers symmetric keys, protection algorithms and key negotiation to terminal devices that have registered and are authorized to use the UE-to-UE relay function, thereby efficiently establishing source End-to-end secure channel between UE and target UE. The embodiments of this application have very high efficiency in calculation and communication, and can also achieve authentication, encryption protection, integrity protection, and resistance to tampering and downgrade attacks.
上文结合图16,详细描述了本申请的第一终端设备侧实施例,下文结合图18,详细描述本申请的中继设备侧实施例,应理解,中继设备侧实施例与第一终端设备侧实施例相互对应,类似的描述可以参照第一终端设备侧实施例。The first terminal device side embodiment of the present application is described in detail above with reference to Figure 16. The relay device side embodiment of the present application is described in detail below with reference to Figure 18. It should be understood that the relay device side embodiment is different from the first terminal device side embodiment. The device side embodiments correspond to each other, and similar descriptions may refer to the first terminal device side embodiment.
图18是根据本申请实施例的中继通信的方法1000的示意性流程图,如图18所示,该中继通信的方法1000可以包括如下内容中的至少部分内容:Figure 18 is a schematic flowchart of a communication relay method 1000 according to an embodiment of the present application. As shown in Figure 18, the communication relay method 1000 may include at least part of the following content:
S1010,中继设备接收第一终端设备发送的直接通信请求;其中,该直接通信请求包括以下至少之一:该第一终端设备的安全能力信息,该第一终端设备的安全策略信息,该第一终端设备生成的第一临时公钥,该第一终端设备生成的第一随机数;其中,该直接通信请求通过第一加密密钥进行加密,以及该直接通信请求通过第一完整性保护密钥进行完整性保护,该第一加密密钥为基于已注册并被授权使用终端至终端中继(UE-to-UE relay)通信的终端的对称密钥衍生的加密密钥,该第一完整性保护密钥为基于已注册并被授权使用UE-to-UE relay通信的终端的对称密钥衍生的完整性保护密钥;S1010. The relay device receives a direct communication request sent by the first terminal device; wherein the direct communication request includes at least one of the following: security capability information of the first terminal device, security policy information of the first terminal device, A first temporary public key generated by a terminal device, a first random number generated by the first terminal device; wherein the direct communication request is encrypted by a first encryption key, and the direct communication request is encrypted by a first integrity protection key For integrity protection, the first encryption key is an encryption key derived based on the symmetric key of a terminal that has been registered and authorized to use UE-to-UE relay communication. The first complete encryption key is The integrity protection key is an integrity protection key derived based on the symmetric key of the terminal that is registered and authorized to use UE-to-UE relay communication;
S1010,该中继设备验证是否被配置为转发直接通信请求,在验证通过之后该中继设备使用该第一加密密钥解密该直接通信请求以获取QoS和计费信息,以及该中继设备使用该第一完整性保护密 钥验证该直接通信请求的完整性,在验证通过之后该中继设备在该直接通信请求中添加该中继设备的相关信息和该中继设备的标识,并且该中继设备使用该第一加密密钥加密该直接通信请求,使用该第一完整性保护密钥保护该直接通信请求的完整性,并将所述直接通信请求转发至第二终端设备;其中,该中继设备的相关信息包括以下之一:该中继设备的身份信息,该中继设备生成的随机数,该中继设备生成的计数器;该第一临时公钥和该中继设备的相关信息用于该第二终端设备派生第一密钥;该第一随机数、该第一密钥和该第二终端设备生成的第二随机数用于派生第二密钥,且该第二密钥用于派生第二加密密钥和/或第二完整性保护密钥,或者,该第一随机数、该第一密钥和该第二终端设备生成的第二随机数用于派生第二加密密钥和/或第二完整性保护密钥。S1010, the relay device verifies whether it is configured to forward the direct communication request. After the verification is passed, the relay device uses the first encryption key to decrypt the direct communication request to obtain QoS and charging information, and the relay device uses The first integrity protection key verifies the integrity of the direct communication request. After the verification is passed, the relay device adds the relevant information of the relay device and the identification of the relay device in the direct communication request, and the The relay device uses the first encryption key to encrypt the direct communication request, uses the first integrity protection key to protect the integrity of the direct communication request, and forwards the direct communication request to the second terminal device; wherein, the The relevant information of the relay device includes one of the following: the identity information of the relay device, the random number generated by the relay device, the counter generated by the relay device; the first temporary public key and the relevant information of the relay device The second terminal device is used to derive a first key; the first random number, the first key and the second random number generated by the second terminal device are used to derive a second key, and the second key used to derive the second encryption key and/or the second integrity protection key, or the first random number, the first key and the second random number generated by the second terminal device are used to derive the second encryption key key and/or a second integrity protection key.
本实施例基于5G PKMT分配的对称密钥建立安全通信的方案,建立L2架构下的UE-to-UE中继场景下的安全连接。具体的,本申请实施例应用于L2架构下的UE-to-UE中继场景,也即,第一终端设备与第二终端设备之间通过中继设备进行通信。例如,第一终端设备与第二终端设备之间的中继连接可以是PC5链路。This embodiment establishes a secure communication solution based on the symmetric key distributed by 5G PKMT, and establishes a secure connection in the UE-to-UE relay scenario under the L2 architecture. Specifically, the embodiments of this application are applied to the UE-to-UE relay scenario under the L2 architecture, that is, the first terminal device and the second terminal device communicate through the relay device. For example, the relay connection between the first terminal device and the second terminal device may be a PC5 link.
在本申请实施例中,该第一终端设备可以是源设备或源终端,该第二终端设备可以是目标设备或目标终端。该中继设备可以是中继终端。In this embodiment of the present application, the first terminal device may be a source device or a source terminal, and the second terminal device may be a target device or a target terminal. The relay device may be a relay terminal.
在一些实施例中,该第一加密密钥可以为邻近业务加密密钥(PEK),该第一完整性保护密钥可以为邻近业务完整性保护密钥(PIK)。当然,该第一加密密钥也可以是其他的加密密钥,该第一完整性保护密钥也可以是其他的完整性保护密钥,本申请对此并不限定。In some embodiments, the first encryption key may be a Proximity Service Encryption Key (PEK), and the first integrity protection key may be a Proximity Service Integrity Protection Key (PIK). Of course, the first encryption key can also be other encryption keys, and the first integrity protection key can also be other integrity protection keys, which is not limited by this application.
在本申请实施例中,该第二加密密钥用于对第一终端设备与第二终端设备之间交互的端到端消息进行加密,以及该第二完整性保护密钥用于对第一终端设备与第二终端设备之间交互的端到端消息进行完整性保护。其中,该第二加密密钥可以是机密性保护密钥。In this embodiment of the present application, the second encryption key is used to encrypt end-to-end messages exchanged between the first terminal device and the second terminal device, and the second integrity protection key is used to encrypt the first terminal device. End-to-end messages exchanged between the terminal device and the second terminal device are integrity protected. Wherein, the second encryption key may be a confidentiality protection key.
在一些实施例中,在该第一随机数、该第一密钥和该第二随机数用于派生该第二密钥的情况下,该中继设备接收该第二终端设备发送的安全模式命令;其中,该安全模式命令包括以下至少之一:该第二终端设备选取的安全算法,该第二终端设备选取的安全策略,该第二终端设备生成的第二临时公钥,该第二终端设备生成的该第二随机数,该第二终端设备生成的该第一密钥的标识的M个比特位,该第二终端设备生成的该第二密钥的标识的x个比特位,第一消息验证码;其中,该安全模式命令通过该第一加密密钥进行加密,该安全模式命令通过该第一完整性保护密钥进行完整性保护,该第一消息验证码基于该第二完整性保护密钥生成,且该第一消息验证码的输入参数包括以下至少之一:该第二终端设备选取的安全算法,该第二终端设备选取的安全策略,该第二临时公钥,该第二随机数,该M个比特位,该x个比特位,该中继设备的相关信息;该第二临时公钥和该中继设备的相关信息用于该第一终端设备派生该第一密钥;In some embodiments, in the case where the first random number, the first key and the second random number are used to derive the second key, the relay device receives the security mode sent by the second terminal device command; wherein, the security mode command includes at least one of the following: the security algorithm selected by the second terminal device, the security policy selected by the second terminal device, the second temporary public key generated by the second terminal device, the second The second random number generated by the terminal device, M bits of the identifier of the first key generated by the second terminal device, x bits of the identifier of the second key generated by the second terminal device, A first message verification code; wherein, the security mode command is encrypted by the first encryption key, the security mode command is integrity protected by the first integrity protection key, and the first message verification code is based on the second The integrity protection key is generated, and the input parameters of the first message verification code include at least one of the following: the security algorithm selected by the second terminal device, the security policy selected by the second terminal device, the second temporary public key, The second random number, the M bits, the x bits, and the relevant information of the relay device; the second temporary public key and the relevant information of the relay device are used by the first terminal device to derive the third a key;
该中继设备使用该第一加密密钥解密该安全模式命令,以获取服务质量(Quality of Service,QoS)和计费信息,并在向该第一终端设备转发该安全模式命令;其中,该第二临时公钥和该中继设备的相关信息用于该第一终端设备派生该第一密钥,该第一密钥的标识由该M个比特位与该第一密钥的标识的另外N个比特位合并得到,M和N均为正整数,该第二密钥的标识由该x个比特位与该第二密钥的标识的另外y个比特位合并得到,x和y均为正整数。The relay device uses the first encryption key to decrypt the security mode command to obtain Quality of Service (QoS) and billing information, and forwards the security mode command to the first terminal device; wherein, the The second temporary public key and the relevant information of the relay device are used by the first terminal device to derive the first key. The identification of the first key is composed of the M bits and the identification of the first key. N bits are combined, and M and N are both positive integers. The identity of the second key is obtained by combining the x bits and the other y bits of the identity of the second key. Both x and y are Positive integer.
在一些实施例中,该第二终端设备可以基于该第一终端设备的安全能力信息选取安全算法,和/或,该第二终端设备可以基于该第一终端设备的安全策略信息选取安全策略。In some embodiments, the second terminal device may select a security algorithm based on the security capability information of the first terminal device, and/or the second terminal device may select a security policy based on the security policy information of the first terminal device.
在一些实施例中,该第一终端设备的安全能力信息可以是该第一终端设备支持的密码算法列表。In some embodiments, the security capability information of the first terminal device may be a list of cryptographic algorithms supported by the first terminal device.
在一些实施例中,该第一终端设备的安全策略信息可以是该第一终端设备是否支持机密性保护或完整性保护。其中,该第一终端设备的安全策略信息包括:该第一终端设备在控制面的安全策略信息,和/或,该第一终端设备在用户面的安全策略信息。In some embodiments, the security policy information of the first terminal device may be whether the first terminal device supports confidentiality protection or integrity protection. The security policy information of the first terminal device includes: the security policy information of the first terminal device on the control plane, and/or the security policy information of the first terminal device on the user plane.
在一些实施例中,该M个比特位可以是该第一密钥的标识的最高M个比特位,该N个比特位可以是该第一密钥的标识的最低N个比特位;或者,该M个比特位可以是该第一密钥的标识的前M个比特位,该N个比特位可以是该第一密钥的标识的后N个比特位;或者,该M个比特位可以是该第一密钥的标识的偶数位的比特位,该N个比特位可以是该第一密钥的标识的奇数位的比特位。In some embodiments, the M bits may be the highest M bits of the identity of the first key, and the N bits may be the lowest N bits of the identity of the first key; or, The M bits may be the first M bits of the identifier of the first key, and the N bits may be the last N bits of the identifier of the first key; or, the M bits may be are the even-numbered bits of the identifier of the first key, and the N bits may be the odd-numbered bits of the identifier of the first key.
在一些实施例中,M与N的取值可以相同,也可以不同,本申请对此并不限定。In some embodiments, the values of M and N may be the same or different, which is not limited by this application.
在一些实施例中,该x个比特位可以是该第二密钥的标识的最高x个比特位,该y个比特位可以是该第二密钥的标识的最低y个比特位;或者,该x个比特位可以是该第二密钥的标识的前x个比特位,该y个比特位可以是该第二密钥的标识的后y个比特位;或者,该x个比特位可以是该第二密钥的标识的偶数位的比特位,该y个比特位可以是该第二密钥的标识的奇数位的比特位。In some embodiments, the x bits may be the highest x bits of the identity of the second key, and the y bits may be the lowest y bits of the identity of the second key; or, The x bits may be the first x bits of the identifier of the second key, and the y bits may be the last y bits of the identifier of the second key; or, the x bits may be are the even-numbered bits of the identifier of the second key, and the y bits may be the odd-numbered bits of the identifier of the second key.
在一些实施例中,x与y的取值可以相同,也可以不同,本申请对此并不限定。In some embodiments, the values of x and y may be the same or different, which is not limited by this application.
在一些实施例中,在该第一随机数、该第一密钥和该第二随机数用于派生该第二密钥的情况下, 该中继设备向该第二终端设备转发该第一终端设备发送的安全模式建立完成消息;In some embodiments, in the case where the first random number, the first key and the second random number are used to derive the second key, the relay device forwards the first random number to the second terminal device. The security mode establishment completion message sent by the terminal device;
其中,该安全模式建立完成消息通过该第二密钥或该第二加密密钥进行加密,该安全模式建立完成消息通过该第二密钥或该第二完整性保护密钥进行完整性保护;Wherein, the security mode establishment completion message is encrypted by the second key or the second encryption key, and the security mode establishment completion message is integrity protected by the second key or the second integrity protection key;
其中,该安全模式建立完成消息至少包括该第二密钥的标识的该y个比特位。Wherein, the security mode establishment completion message includes at least the y bits of the identification of the second key.
在一些实施例中,在该第一随机数、该第一密钥和该第二随机数用于派生该第二加密密钥和/或该第二完整性保护密钥的情况下,该中继设备接收该第二终端设备发送的安全模式命令;其中,该安全模式命令包括以下至少之一:该第二终端设备选取的安全算法,该第二终端设备选取的安全策略,该第二终端设备生成的第二临时公钥,该第二终端设备生成的该第二随机数,该第二终端设备生成的该第一密钥的标识的M个比特位,第一消息验证码;其中,该安全模式命令通过该第一加密密钥进行加密,该安全模式命令通过该第一完整性保护密钥进行完整性保护,该第一消息验证码基于该第二完整性保护密钥生成,且该第一消息验证码的输入参数包括以下至少之一:该第二终端设备选取的安全算法,该第二终端设备选取的安全策略,该第二临时公钥,该第二随机数,该M个比特位,该中继设备的相关信息;该第二临时公钥和该中继设备的相关信息用于该第一终端设备派生该第一密钥;In some embodiments, where the first random number, the first key and the second random number are used to derive the second encryption key and/or the second integrity protection key, the The relay device receives the security mode command sent by the second terminal device; wherein the security mode command includes at least one of the following: a security algorithm selected by the second terminal device, a security policy selected by the second terminal device, The second temporary public key generated by the device, the second random number generated by the second terminal device, the M bits of the identification of the first key generated by the second terminal device, and the first message verification code; wherein, The security mode command is encrypted by the first encryption key, the security mode command is integrity protected by the first integrity protection key, the first message verification code is generated based on the second integrity protection key, and The input parameters of the first message verification code include at least one of the following: the security algorithm selected by the second terminal device, the security policy selected by the second terminal device, the second temporary public key, the second random number, the M bits, the relevant information of the relay device; the second temporary public key and the relevant information of the relay device are used by the first terminal device to derive the first key;
该中继设备使用该第一加密密钥解密该安全模式命令,以获取QoS和计费信息,并在向该第一终端设备转发该安全模式命令;其中,该第二临时公钥和该中继设备的相关信息用于该第一终端设备派生该第一密钥,该第一密钥的标识由该M个比特位与该第一密钥的标识的另外N个比特位合并得到,M和N均为正整数。The relay device uses the first encryption key to decrypt the security mode command to obtain QoS and accounting information, and forwards the security mode command to the first terminal device; wherein the second temporary public key and the intermediate The relevant information of the relay device is used by the first terminal device to derive the first key. The identification of the first key is obtained by combining the M bits and the other N bits of the identification of the first key. M and N are both positive integers.
在一些实施例中,在该第一随机数、该第一密钥和该第二随机数用于派生该第二加密密钥和/或该第二完整性保护密钥的情况下,该中继设备向该第二终端设备转发该第一终端设备发送的安全模式建立完成消息;其中,该安全模式建立完成消息通过该第二加密密钥进行加密,该安全模式建立完成消息通过该第二完整性保护密钥进行完整性保护。In some embodiments, where the first random number, the first key and the second random number are used to derive the second encryption key and/or the second integrity protection key, the The relay device forwards the security mode establishment completion message sent by the first terminal device to the second terminal device; wherein the security mode establishment completion message is encrypted by the second encryption key, and the security mode establishment completion message is encrypted by the second encryption key. Integrity protection keys perform integrity protection.
在一些实施例中,该安全模式命令包括该中继设备的相关信息,以及该第一消息验证码的输入参数还包括该中继设备的相关信息;或者,该中继设备在向该第一终端设备转发的该安全模式命令中添加了该中继设备的相关信息。In some embodiments, the safe mode command includes information related to the relay device, and the input parameters of the first message verification code also include information related to the relay device; or, the relay device sends a message to the first message verification code. The relevant information of the relay device is added to the safe mode command forwarded by the terminal device.
因此,在本申请实施例中,第一终端设备可以基于第二终端设备通过中继设备发送的直接通信请求生成第一密钥,且该直接通信请求通过第一加密密钥进行加密,以及直接通信请求通过第一完整性保护密钥进行完整性保护。以及第一终端设备生成的第一随机数、第一密钥和第二终端设备生成的第二随机数用于派生第二密钥,第二密钥用于派生第二加密密钥和/或第二完整性保护密钥,或者,第一终端设备生成的第一随机数、第一密钥和第二终端设备用于派生第二随机数生成第二加密密钥和/或第二完整性保护密钥,能够保证第一终端设备和第二终端设备的身份安全与通信数据的机密性与完整性,从而确保双方传输数据的机密性和完整性,防止其他设备甚至中继设备的窃听。Therefore, in this embodiment of the present application, the first terminal device can generate the first key based on the direct communication request sent by the second terminal device through the relay device, and the direct communication request is encrypted by the first encryption key, and directly The communication request is integrity protected via the first integrity protection key. and a first random number generated by the first terminal device, a first key and a second random number generated by the second terminal device for deriving the second key, the second key being used for deriving the second encryption key and/or The second integrity protection key, or the first random number generated by the first terminal device, the first key and the second terminal device are used to derive the second random number to generate the second encryption key and/or the second integrity Protecting the key can ensure the identity security of the first terminal device and the second terminal device and the confidentiality and integrity of the communication data, thereby ensuring the confidentiality and integrity of the data transmitted by both parties and preventing eavesdropping by other devices and even relay devices.
本申请实施例适用于5G L2 UE-to-UE relay架构下第一终端设备(源设备)和第二终端设备(目标设备)之间的安全通信建立流程。通过使用PKMF的密钥生成和安全下发功能,通过PKMF下发给已注册并被授权使用UE-to-UE relay功能的终端设备对称密钥,保护算法和密钥协商,从而高效的建立源UE和目标UE间端到端的安全通道。本申请实施例在计算和通信上都有非常高的效率,同样的能够实现认证性,加密保护,完整性保护,抵抗篡改和降级攻击。The embodiment of this application is suitable for the secure communication establishment process between the first terminal device (source device) and the second terminal device (target device) under the 5G L2 UE-to-UE relay architecture. By using PKMF's key generation and secure delivery functions, PKMF delivers symmetric keys, protection algorithms and key negotiation to terminal devices that have registered and are authorized to use the UE-to-UE relay function, thereby efficiently establishing source End-to-end secure channel between UE and target UE. The embodiments of this application have very high efficiency in calculation and communication, and can also achieve authentication, encryption protection, integrity protection, and resistance to tampering and downgrade attacks.
以下通过实施例3至实施例6详述本申请L2架构下的UE-to-UE中继场景中基于5G PKMT分配的对称密钥建立安全通信的流程。The following describes in detail the process of establishing secure communication based on the symmetric key distributed by 5G PKMT in the UE-to-UE relay scenario under the L2 architecture of this application through Embodiment 3 to Embodiment 6.
实施例3,如图19所示,假设所有设备之间在此之前没有建立任何安全连接,可以通过S3-0至S3-6中的部分或全部步骤建立L2架构下的UE-to-UE中继场景下基于签名的安全通信连接。具体的,UE1可以是第一终端设备,UE2可以是第二终端设备,UE-to-UE relay可以是中继设备,K D可以是第一密钥,K D-SESS可以是第二密钥,第一加密密钥为PEK,第一完整性保护密钥为PIK。 Embodiment 3, as shown in Figure 19, assuming that no secure connection has been established between all devices before, UE-to-UE under the L2 architecture can be established through some or all of the steps in S3-0 to S3-6. Signature-based secure communication connection in subsequent scenarios. Specifically, UE1 may be the first terminal device, UE2 may be the second terminal device, UE-to-UE relay may be the relay device, K D may be the first key, and K D-SESS may be the second key , the first encryption key is PEK, and the first integrity protection key is PIK.
S3-0.UE向网络注册,并被授权UE-to-UE relay服务。UE-to-UE relay向网络注册可提供UE-to-UE Relay功能,UE-to-UE relay配置了中继策略参数。PKMF使用MIKEY机制,向上述已注册并得到授权的UE发送相关的PGK、PGK ID和到期时间。S3-0.UE registers with the network and is authorized for UE-to-UE relay service. UE-to-UE relay registers with the network to provide the UE-to-UE Relay function, and the UE-to-UE relay is configured with relay policy parameters. PKMF uses the MIKEY mechanism to send the relevant PGK, PGK ID and expiration time to the above-mentioned registered and authorized UE.
S3-1.UE2确定PC5单播链路建立时信令接收的目的L2 ID。S3-1.UE2 determines the destination L2 ID for signaling reception when the PC5 unicast link is established.
S3-2.UE1通过广播方式发送端到端的直接通信请求消息,具体的,UE1在将直接通信请求广播给周围的终端设备之前,先需要根据PGK衍生出传输密钥PTK,并进一步生成PTK的下级密钥,即PEK和PIK。UE1使用PEK加密广播消息,使用PIK计算直接通信请求消息的MAC即保护直接通信请求消息的完整性,也即,该直接通信请求通过PEK进行加密,以及该直接通信请求通过PIK进行完整性保护。其中,直接通信请求中包含以下至少之一:S3-2.UE1 sends an end-to-end direct communication request message through broadcast. Specifically, before broadcasting the direct communication request to surrounding terminal devices, UE1 first needs to derive the transmission key PTK based on PGK, and further generate the PTK Lower level keys, namely PEK and PIK. UE1 uses PEK to encrypt the broadcast message, and uses PIK to calculate the MAC of the direct communication request message to protect the integrity of the direct communication request message. That is, the direct communication request is encrypted by PEK, and the direct communication request is integrity protected by PIK. Among them, the direct communication request contains at least one of the following:
UE1的安全能力信息(UE1 security capabilities);UE1 security capabilities information (UE1 security capabilities);
UE1的安全策略信息(UE1 security policy);UE1 security policy information (UE1 security policy);
UE1生成的第一临时公钥(Ephemeral public key1);The first temporary public key (Ephemeral public key1) generated by UE1;
UE1生成的第一随机数(Nonce-1)。The first random number (Nonce-1) generated by UE1.
S3-3.UE-to-UE Relay接收广播的直接通信请求消息,并验证UE-to-UE Relay是否配置为转发直接通信请求消息,例如,UE-to-UE Relay将宣布的ProSe应用ID与它所提供的中继策略/参数进行比较。UE-to-UE Relay转发端到端广播的直接通信请求消息时,使用自己的L2 ID作为源(Source)L2 ID,并在消息中添加UE-to-UE Relay的UE ID,在适配层指定标识UE1的信息。UE-to-UE Relay在ProSe层处理此端到端广播消息,并根据适配层信息转发任何后续的端到端PC5-S消息。S3-3.UE-to-UE Relay receives the broadcast direct communication request message and verifies whether the UE-to-UE Relay is configured to forward the direct communication request message. For example, the UE-to-UE Relay will announce the ProSe application ID and Compare the relay policies/parameters it provides. When UE-to-UE Relay forwards the direct communication request message broadcast end-to-end, it uses its own L2 ID as the source (Source) L2 ID, and adds the UE ID of UE-to-UE Relay in the message. In the adaptation layer Specify information identifying UE1. UE-to-UE Relay processes this end-to-end broadcast message at the ProSe layer and forwards any subsequent end-to-end PC5-S messages based on the adaptation layer information.
具体的,在验证通过之后UE-to-UE Relay使用PEK解密直接通信请求以获取QoS和计费信息,以及UE-to-UE Relay使用PIK验证直接通信请求的完整性,在验证通过之后UE-to-UE Relay在直接通信请求中添加UE-to-UE Relay的相关信息和UE-to-UE Relay的标识,并且UE-to-UE Relay使用PEK加密直接通信请求,使用PIK保护直接通信请求的完整性;其中,UE-to-UE Relay的相关信息包括以下之一:UE-to-UE Relay的身份信息,UE-to-UE Relay生成的随机数,UE-to-UE Relay生成的计数器。Specifically, after the verification passes, the UE-to-UE Relay uses PEK to decrypt the direct communication request to obtain QoS and charging information, and the UE-to-UE Relay uses PIK to verify the integrity of the direct communication request. After the verification passes, the UE- to-UE Relay adds the relevant information of UE-to-UE Relay and the identification of UE-to-UE Relay in the direct communication request, and the UE-to-UE Relay uses PEK to encrypt the direct communication request and uses PIK to protect the direct communication request. Integrity; among them, the relevant information of UE-to-UE Relay includes one of the following: the identity information of UE-to-UE Relay, the random number generated by UE-to-UE Relay, and the counter generated by UE-to-UE Relay.
S3-4a.UE2对宣布的应用程序感兴趣,如果UE2和UE-to-UE Relay之间不存在每跳链路,UE2会触发UE-to-UE Relay建立每跳链路。UE2发送每跳链路建立过程消息,源地址是UE2 L2 ID,目的地址是中继的L2 ID。S3-4a.UE2 is interested in the announced application. If there is no per-hop link between UE2 and UE-to-UE Relay, UE2 will trigger the UE-to-UE Relay to establish a per-hop link. UE2 sends a link establishment process message for each hop. The source address is the UE2 L2 ID and the destination address is the relay's L2 ID.
S3-4b.如果UE-to-UE relay和UE1之间不存在每跳链路,则执行UE-to-UE relay和UE1之间的每跳链路建立过程。UE1将自己的L2 ID作为源地址,中继的L2 ID作为目的地址。S3-4b. If there is no per-hop link between UE-to-UE relay and UE1, perform a per-hop link establishment process between UE-to-UE relay and UE1. UE1 uses its own L2 ID as the source address and the relay's L2 ID as the destination address.
S3-5a.当UE-2和UE-to-UE relay成功建立了每跳链路(per hop link),将进一步触发UE2和UE1间端到端安全的建立。UE2首先使用PGK生成传输密钥PTK,并进一步生成PEK和PIK,解密收到的直接通信请求,并验证直接通信请求的完整性。验证成功后,UE2产生一对临时公私钥,即第二临时公钥(Ephemeral public key2)和第二临时私钥(Ephemeral private key2),并使用第二临时私钥、第一临时公钥和UE-to-UE relay的相关信息,计算出与UE-1的共享密钥K D和MSB of K D ID。若直接通信请求中包含安全策略与安全算法,那么UE2协商出安全策略与安全算法,然后生成第二随机数(Nonce_2),并根据利用K D计算K D-sess和K D-sess衍生的下级密钥(即第二加密密钥(K D-enc)和第二完整性保护密钥(K D-int)),另外UE2生成MSB of K D-sess ID。 S3-5a. When UE-2 and UE-to-UE relay successfully establish a per hop link, the establishment of end-to-end security between UE2 and UE1 will be further triggered. UE2 first uses PGK to generate the transmission key PTK, and further generates PEK and PIK, decrypts the received direct communication request, and verifies the integrity of the direct communication request. After successful verification, UE2 generates a pair of temporary public and private keys, namely the second temporary public key (Ephemeral public key2) and the second temporary private key (Ephemeral private key2), and uses the second temporary private key, the first temporary public key and the UE -To-UE relay related information, calculate the shared key K D and MSB of K D ID with UE-1. If the direct communication request contains the security policy and security algorithm, then UE2 negotiates the security policy and security algorithm, then generates the second random number (Nonce_2), and calculates the lower level derived from K D -sess and K D -sess based on K D keys (ie, the second encryption key (K D-enc ) and the second integrity protection key (K D -int )), and in addition UE2 generates the MSB of K D -sess ID.
具体的,UE2通过UE-to-UE relay向UE1发送安全模式命令,该安全模式命令通过PEK进行加密,该安全模式命令通过PIK进行完整性保护,该安全模式命令中包含以下参数:Specifically, UE2 sends a security mode command to UE1 through UE-to-UE relay. The security mode command is encrypted through PEK, and the security mode command is integrity protected through PIK. The security mode command contains the following parameters:
UE2选取的安全算法(chosen_algs);The security algorithm selected by UE2 (chosen_algs);
UE2选取的安全策略(chosen_security policy);The security policy chosen by UE2 (chosen_security policy);
UE2生成的第二临时公钥(Ephemeral private key2);The second temporary public key (Ephemeral private key2) generated by UE2;
UE2生成的该第二随机数(Nonce_2);The second random number (Nonce_2) generated by UE2;
UE2生成的MSB of K D ID; MSB of K D ID generated by UE2;
UE2生成的MSB of K D-sess ID; MSB of K D -sess ID generated by UE2;
UE-to-UE relay的相关信息(可选);UE-to-UE relay related information (optional);
第一消息验证码,其中,该第一消息验证码基于K D-sess衍生的下级完整性保护密钥(即第二完整性保护密钥(K D-int))生成,且该第一消息验证码的输入参数包括以下至少之一:UE2选取的安全算法,UE2选取的安全策略,第二临时公钥,第二随机数,MSB of K D ID,MSB of K D-sess ID。 A first message verification code, wherein the first message verification code is generated based on a lower integrity protection key derived from K D -sess (ie, the second integrity protection key (K D-int )), and the first message verification code The input parameters of the verification code include at least one of the following: the security algorithm selected by UE2, the security policy selected by UE2, the second temporary public key, the second random number, MSB of K D ID, and MSB of K D -sess ID.
S3-5b.在收到安全模式命令后,UE-to-UE relay可使用PEK解密安全模式命令获得与QoS和计费相关的信息。进一步地,UE-to-UE relay将安全模式命令发送给UE1。可选地,若安全模式命令中不包括UE-to-UE relay的相关信息,UE-to-UE relay可以在转发给UE1的安全模式命令中加入UE-to-UE relay的相关信息。S3-5b. After receiving the security mode command, the UE-to-UE relay can use PEK to decrypt the security mode command to obtain information related to QoS and charging. Further, the UE-to-UE relay sends the security mode command to UE1. Optionally, if the security mode command does not include UE-to-UE relay related information, UE-to-UE relay can add UE-to-UE relay related information to the security mode command forwarded to UE1.
S3-6.UE1首先使用PEK解密安全模式命令,使用PIK判断安全模式命令的完整性,验证成功后,进一步判断UE1的安全能力信息和UE1的安全策略信息是否遭受篡改,若未篡改,那么采用与UE2相同的方式计算K D-sess以及K D-sess衍生的下级密钥(即第二加密密钥(K D-enc)和第二完整性保护密钥(K D-int)),然后UE1验证第一消息验证码是否有效,若有效,UE1准备以新安全环境来保护后续通信。UE1生成LSB of K D ID、LSB of K D-sess ID,并将LSB of K D ID与收到的MSB of K D ID合并得到K D ID,以及将LSB of K D-sess ID与收到的MSB of K D-sess ID合并得到K D-sess ID,并保存K D ID和K D-sess ID,后续用于标识K D和K D-sess。UE1根据协商策略与协商算法,通过UE-to-UE relay向UE2发送一个受安全性保护的安全模式完成消息,该安全模式完成消息可使用K D-sess进行完整性和加密保护,或者,该安全模式完成消息可使用K D-sess生成的下级完整性保护密钥(即第二完整性保护密钥(K D-int))进行完整性保护,K D-sess生成的下级加密密钥(即第二加密密钥(K D-enc))进 行加密保护。其中,该安全模式完成消息可以包括LSB of K D-sess ID。UE2可以将收到的LSB of K D-sess ID与UE2生成的MSB of K D-sess ID合并得到K D-sess ID,并保存K D-sess ID,后续用于标识K D-sess。 S3-6.UE1 first uses PEK to decrypt the security mode command, and uses PIK to determine the integrity of the security mode command. After successful verification, it further determines whether UE1's security capability information and UE1's security policy information have been tampered with. If not, then use Calculate K D -sess and the subordinate keys derived from K D -sess (i.e., the second encryption key (K D -enc ) and the second integrity protection key (K D - int )) in the same manner as UE2, and then UE1 verifies whether the first message verification code is valid. If valid, UE1 prepares to use the new security environment to protect subsequent communications. UE1 generates LSB of K D ID, LSB of K D -sess ID, combines the LSB of K D ID with the received MSB of K D ID to obtain the K D ID, and combines the LSB of K D -sess ID with the received MSB of K D ID. The MSB of K D -sess ID is merged to obtain the K D -sess ID, and the K D ID and K D -sess ID are saved, which are subsequently used to identify K D and K D -sess. UE1 sends a security-protected security mode completion message to UE2 through the UE-to-UE relay according to the negotiation policy and negotiation algorithm. The security mode completion message can be protected by K D -sess for integrity and encryption, or the security mode completion message can be protected by KD-sess. The security mode completion message can be integrity protected using the lower-level integrity protection key (i.e., the second integrity protection key (K D-int )) generated by K D -sess, and the lower-level encryption key (K D -int ) generated by K D -sess. That is, the second encryption key (K D-enc )) is used for encryption protection. The security mode completion message may include LSB of K D -sess ID. UE2 can combine the received LSB of K D -sess ID with the MSB of K D -sess ID generated by UE2 to obtain the K D -sess ID, and save the K D -sess ID, which is subsequently used to identify the K D -sess.
具体的,UE1根据UE2选取的安全算法、K D-SESS、基于K D-SESS生成完整性保护密钥和/或机密性保护密钥、UE2选取的安全策略,与UE2进行通信。UE2根据UE2选取的安全算法、K D-SESS、基于K D-SESS生成完整性保护密钥和/或机密性保护密钥、UE2选取的安全策略,与UE1进行通信。 Specifically, UE1 communicates with UE2 according to the security algorithm and K D-SESS selected by UE2, generates an integrity protection key and/or confidentiality protection key based on K D-SESS , and a security policy selected by UE2. UE2 communicates with UE1 according to the security algorithm and K D-SESS selected by UE2, generates an integrity protection key and/or a confidentiality protection key based on K D-SESS , and a security policy selected by UE2.
实施例4,如图20所示,假设所有设备之间在此之前没有建立任何安全连接,可以通过S4-0至S4-6中的部分或全部步骤建立L2架构下的UE-to-UE中继场景下基于签名的安全通信连接。具体的,UE1可以是第一终端设备,UE2可以是第二终端设备,UE-to-UE relay可以是中继设备,K D可以是第一密钥,K D-SESS可以是第二密钥,第一加密密钥为PEK,第一完整性保护密钥为PIK。 Embodiment 4, as shown in Figure 20, assuming that no secure connection has been established between all devices before, UE-to-UE under the L2 architecture can be established through some or all of the steps in S4-0 to S4-6. Signature-based secure communication connection in subsequent scenarios. Specifically, UE1 may be the first terminal device, UE2 may be the second terminal device, UE-to-UE relay may be the relay device, K D may be the first key, and K D-SESS may be the second key , the first encryption key is PEK, and the first integrity protection key is PIK.
S4-0.UE向网络注册,并被授权UE-to-UE relay服务。UE-to-UE relay向网络注册可提供UE-to-UE Relay功能,UE-to-UE relay配置了中继策略参数。PKMF使用MIKEY机制,向上述已注册并得到授权的UE发送相关的PGK、PGK ID和到期时间。S4-0. The UE registers with the network and is authorized for the UE-to-UE relay service. UE-to-UE relay registers with the network to provide the UE-to-UE Relay function, and the UE-to-UE relay is configured with relay policy parameters. PKMF uses the MIKEY mechanism to send the relevant PGK, PGK ID and expiration time to the above-mentioned registered and authorized UE.
S4-1.UE2确定PC5单播链路建立时信令接收的目的L2 ID。S4-1.UE2 determines the destination L2 ID for signaling reception when the PC5 unicast link is established.
S4-2.UE1通过广播方式发送端到端的直接通信请求消息,具体的,UE1在将直接通信请求广播给周围的终端设备之前,先需要根据PGK衍生出传输密钥PTK,并进一步生成PTK的下级密钥,即PEK和PIK。UE1使用PEK加密广播消息,使用PIK计算直接通信请求消息的MAC即保护直接通信请求消息的完整性,也即,该直接通信请求通过PEK进行加密,以及该直接通信请求通过PIK进行完整性保护。其中,直接通信请求中包含以下至少之一:S4-2.UE1 sends an end-to-end direct communication request message through broadcast. Specifically, before broadcasting the direct communication request to surrounding terminal devices, UE1 first needs to derive the transmission key PTK based on PGK, and further generate the PTK Lower level keys, namely PEK and PIK. UE1 uses PEK to encrypt the broadcast message, and uses PIK to calculate the MAC of the direct communication request message to protect the integrity of the direct communication request message. That is, the direct communication request is encrypted by PEK, and the direct communication request is integrity protected by PIK. Among them, the direct communication request contains at least one of the following:
UE1的安全能力信息(UE1 security capabilities);UE1 security capabilities information (UE1 security capabilities);
UE1的安全策略信息(UE1 security policy);UE1 security policy information (UE1 security policy);
UE1生成的第一临时公钥(Ephemeral public key1);The first temporary public key (Ephemeral public key1) generated by UE1;
UE1生成的第一随机数(Nonce-1)。The first random number (Nonce-1) generated by UE1.
S4-3.UE-to-UE Relay接收广播的直接通信请求消息,并验证UE-to-UE Relay是否配置为转发直接通信请求消息,例如,UE-to-UE Relay将宣布的ProSe应用ID与它所提供的中继策略/参数进行比较。UE-to-UE Relay转发端到端广播的直接通信请求消息时,使用自己的L2 ID作为源(Source)L2 ID,并在消息中添加UE-to-UE Relay的UE ID,在适配层指定标识UE1的信息。UE-to-UE Relay在ProSe层处理此端到端广播消息,并根据适配层信息转发任何后续的端到端PC5-S消息。S4-3.UE-to-UE Relay receives the broadcast direct communication request message and verifies whether the UE-to-UE Relay is configured to forward the direct communication request message. For example, the UE-to-UE Relay will announce the ProSe application ID and Compare the relay policies/parameters it provides. When UE-to-UE Relay forwards the direct communication request message broadcast end-to-end, it uses its own L2 ID as the source (Source) L2 ID, and adds the UE ID of UE-to-UE Relay in the message. In the adaptation layer Specify information identifying UE1. UE-to-UE Relay processes this end-to-end broadcast message at the ProSe layer and forwards any subsequent end-to-end PC5-S messages based on the adaptation layer information.
具体的,在验证通过之后UE-to-UE Relay使用PEK解密直接通信请求以获取QoS和计费信息,以及UE-to-UE Relay使用PIK验证直接通信请求的完整性,在验证通过之后UE-to-UE Relay在直接通信请求中添加UE-to-UE Relay的相关信息和UE-to-UE Relay的标识,并且UE-to-UE Relay使用PEK加密直接通信请求,使用PIK保护直接通信请求的完整性;其中,UE-to-UE Relay的相关信息包括以下之一:UE-to-UE Relay的身份信息,UE-to-UE Relay生成的随机数,UE-to-UE Relay生成的计数器。Specifically, after the verification passes, the UE-to-UE Relay uses PEK to decrypt the direct communication request to obtain QoS and charging information, and the UE-to-UE Relay uses PIK to verify the integrity of the direct communication request. After the verification passes, the UE- to-UE Relay adds the relevant information of UE-to-UE Relay and the identification of UE-to-UE Relay in the direct communication request, and the UE-to-UE Relay uses PEK to encrypt the direct communication request and uses PIK to protect the direct communication request. Integrity; among them, the relevant information of UE-to-UE Relay includes one of the following: the identity information of UE-to-UE Relay, the random number generated by UE-to-UE Relay, and the counter generated by UE-to-UE Relay.
S4-4a.UE2对宣布的应用程序感兴趣,如果UE2和UE-to-UE Relay之间不存在每跳链路,UE2会触发UE-to-UE Relay建立每跳链路。UE2发送每跳链路建立过程消息,源地址是UE2 L2 ID,目的地址是中继的L2 ID。S4-4a.UE2 is interested in the announced application. If there is no per-hop link between UE2 and UE-to-UE Relay, UE2 will trigger UE-to-UE Relay to establish a per-hop link. UE2 sends a link establishment process message for each hop. The source address is the UE2 L2 ID and the destination address is the relay's L2 ID.
S4-4b.如果UE-to-UE relay和UE1之间不存在每跳链路,则执行UE-to-UE relay和UE1之间的每跳链路建立过程。UE1将自己的L2 ID作为源地址,中继的L2 ID作为目的地址。S4-4b. If there is no per-hop link between UE-to-UE relay and UE1, perform a per-hop link establishment process between UE-to-UE relay and UE1. UE1 uses its own L2 ID as the source address and the relay's L2 ID as the destination address.
S4-5a.当UE-2和UE-to-UE relay成功建立了每跳链路(per hop link),将进一步触发UE2和UE1间端到端安全的建立。UE2首先使用PGK生成传输密钥PTK,并进一步生成PEK和PIK,解密收到的直接通信请求,并验证直接通信请求的完整性。验证成功后,UE2产生一对临时公私钥,即第二临时公钥(Ephemeral public key2)和第二临时私钥(Ephemeral private key2),并使用第二临时私钥、第一临时公钥和UE-to-UE relay的相关信息,计算出与UE1的共享密钥K D和MSB of K D ID。若直接通信请求中包含安全策略与安全算法,那么UE2协商出安全策略与安全算法,然后生成第二随机数(Nonce_2),并根据利用K D衍生的下级密钥(即第二加密密钥(K D-enc)和第二完整性保护密钥(K D-int))。 S4-5a. When UE-2 and UE-to-UE relay successfully establish a per hop link, the establishment of end-to-end security between UE2 and UE1 will be further triggered. UE2 first uses PGK to generate the transmission key PTK, and further generates PEK and PIK, decrypts the received direct communication request, and verifies the integrity of the direct communication request. After successful verification, UE2 generates a pair of temporary public and private keys, namely the second temporary public key (Ephemeral public key2) and the second temporary private key (Ephemeral private key2), and uses the second temporary private key, the first temporary public key and the UE -To-UE relay related information, calculate the shared key K D and MSB of K D ID with UE1. If the direct communication request contains the security policy and security algorithm, then UE2 negotiates the security policy and security algorithm, and then generates the second random number (Nonce_2), and uses the subordinate key derived from K D (i.e. the second encryption key ( K D-enc ) and the second integrity protection key (K D-int )).
具体的,UE2通过UE-to-UE relay向UE1发送安全模式命令,该安全模式命令通过PEK进行加密,该安全模式命令通过PIK进行完整性保护,该安全模式命令中包含以下参数:Specifically, UE2 sends a security mode command to UE1 through UE-to-UE relay. The security mode command is encrypted through PEK, and the security mode command is integrity protected through PIK. The security mode command contains the following parameters:
UE2选取的安全算法(chosen_algs);The security algorithm selected by UE2 (chosen_algs);
UE2选取的安全策略(chosen_security policy);The security policy chosen by UE2 (chosen_security policy);
UE2生成的第二临时公钥(Ephemeral private key2);The second temporary public key (Ephemeral private key2) generated by UE2;
UE2生成的该第二随机数(Nonce_2);The second random number (Nonce_2) generated by UE2;
UE2生成的MSB of K D ID; MSB of K D ID generated by UE2;
UE-to-UE relay的相关信息(可选);UE-to-UE relay related information (optional);
第一消息验证码,其中,该第一消息验证码基于第二完整性保护密钥(K D-int)生成,且该第一消息验证码的输入参数包括以下至少之一:UE2选取的安全算法,UE2选取的安全策略,第二临时公钥,第二随机数,MSB of K D ID。 A first message verification code, wherein the first message verification code is generated based on the second integrity protection key (K D-int ), and the input parameters of the first message verification code include at least one of the following: the security selected by UE2 Algorithm, security policy selected by UE2, second temporary public key, second random number, MSB of K D ID.
S4-5b.在收到安全模式命令后,UE-to-UE relay可使用PEK解密安全模式命令获得与QoS和计费相关的信息。进一步地,UE-to-UE relay将安全模式命令发送给UE1。可选地,若安全模式命令中不包括UE-to-UE relay的相关信息,UE-to-UE relay可以在转发给UE1的安全模式命令中加入UE-to-UE relay的相关信息。S4-5b. After receiving the security mode command, the UE-to-UE relay can use PEK to decrypt the security mode command to obtain information related to QoS and charging. Further, the UE-to-UE relay sends the security mode command to UE1. Optionally, if the security mode command does not include UE-to-UE relay related information, UE-to-UE relay can add UE-to-UE relay related information to the security mode command forwarded to UE1.
S4-6.UE1首先使用PEK解密安全模式命令,使用PIK判断安全模式命令的完整性,验证成功后,进一步判断UE1的安全能力信息和UE1的安全策略信息是否遭受篡改,若未篡改,那么采用与UE2相同的方式计算第二加密密钥(K D-enc)和第二完整性保护密钥(K D-int),然后UE1验证第一消息验证码是否有效,若有效,UE1准备以新安全环境来保护后续通信。UE1生成LSB of K D ID,并将LSB of K D ID与收到的MSB of K D ID合并得到K D ID,并保存K D ID,后续用于标识K D。UE1根据协商策略与协商算法,通过UE-to-UE relay向UE2发送一个受安全性保护的安全模式完成消息,该安全模式完成消息可使用衍生的下级完整性保护密钥(即第二完整性保护密钥(K D-int))进行完整性保护,衍生的下级加密密钥(即第二加密密钥(K D-enc))进行加密保护。 S4-6.UE1 first uses PEK to decrypt the security mode command, and uses PIK to determine the integrity of the security mode command. After successful verification, it further determines whether UE1's security capability information and UE1's security policy information have been tampered with. If not, then use The second encryption key (K D-enc ) and the second integrity protection key (K D-int ) are calculated in the same way as UE2, and then UE1 verifies whether the first message verification code is valid. If valid, UE1 is ready to use the new A secure environment to protect subsequent communications. UE1 generates the LSB of K D ID, combines the LSB of K D ID with the received MSB of K D ID to obtain the K D ID, and saves the K D ID, which is subsequently used to identify K D . According to the negotiation strategy and algorithm, UE1 sends a security-protected security mode completion message to UE2 through the UE-to-UE relay. The security mode completion message can use the derived lower-level integrity protection key (i.e., the second integrity The protection key (K D-int )) performs integrity protection, and the derived lower-level encryption key (i.e., the second encryption key (K D-enc )) performs encryption protection.
具体的,UE1根据UE2选取的安全算法、第二完整性保护密钥(K D-int)和/或第二加密密钥(K D-enc)、UE2选取的安全策略,与UE2进行通信。UE2根据UE2选取的安全算法、第二完整性保护密钥(K D-int)和/或第二加密密钥(K D-enc)、UE2选取的安全策略,与UE1进行通信。 Specifically, UE1 communicates with UE2 according to the security algorithm selected by UE2, the second integrity protection key (K D-int ) and/or the second encryption key (K D-enc ), and the security policy selected by UE2. UE2 communicates with UE1 according to the security algorithm selected by UE2, the second integrity protection key (K D-int ) and/or the second encryption key (K D-enc ), and the security policy selected by UE2.
实施例5,如图21所示,假设所有设备之间在此之前没有建立任何安全连接,可以通过S5-0至S5-6中的部分或全部步骤建立L2架构下的UE-to-UE中继场景下基于签名的安全通信连接。具体的,UE1可以是第一终端设备,UE2可以是第二终端设备,UE-to-UE relay可以是中继设备,K D可以是第一密钥,K D-SESS可以是第二密钥。 Embodiment 5, as shown in Figure 21, assuming that no secure connection has been established between all devices before, UE-to-UE under the L2 architecture can be established through some or all of the steps in S5-0 to S5-6. Signature-based secure communication connection in subsequent scenarios. Specifically, UE1 may be the first terminal device, UE2 may be the second terminal device, UE-to-UE relay may be the relay device, K D may be the first key, and K D-SESS may be the second key .
S5-0.UE向网络注册,并被授权UE-to-UE relay服务。UE-to-UE relay向网络注册可提供UE-to-UE Relay功能,UE-to-UE relay配置了中继策略参数。PKMF使用MIKEY机制,向上述已注册并得到授权的UE发送相关的对称密钥,可以基于已注册并被授权使用UE-to-UE relay通信的终端的对称密钥衍生第一加密密钥和第一完整性保护密钥。S5-0.UE registers with the network and is authorized for UE-to-UE relay service. UE-to-UE relay registers with the network to provide the UE-to-UE Relay function, and the UE-to-UE relay is configured with relay policy parameters. PKMF uses the MIKEY mechanism to send relevant symmetric keys to the above-mentioned registered and authorized UEs. The first encryption key and the third encryption key can be derived based on the symmetric keys of the terminals that have been registered and authorized to use UE-to-UE relay communication. An integrity protection key.
S5-1.UE2确定PC5单播链路建立时信令接收的目的L2 ID。S5-1.UE2 determines the destination L2 ID for signaling reception when the PC5 unicast link is established.
S5-2.UE1通过广播方式发送端到端的直接通信请求消息,具体的,UE1在将直接通信请求广播给周围的终端设备之前,基于已注册并被授权使用UE-to-UE relay通信的终端(即UE1和UE2)的对称密钥衍生第一加密密钥和第一完整性保护密钥。UE1使用第一加密密钥加密广播消息,使用第一完整性保护密钥计算直接通信请求消息的MAC即保护直接通信请求消息的完整性,也即,该直接通信请求通过第一加密密钥进行加密,以及该直接通信请求通过第一完整性保护密钥进行完整性保护。其中,直接通信请求中包含以下至少之一:S5-2.UE1 sends an end-to-end direct communication request message through broadcast. Specifically, UE1 broadcasts the direct communication request to surrounding terminal devices based on terminals that have registered and are authorized to use UE-to-UE relay communication. The first encryption key and the first integrity protection key are derived from the symmetric keys of UE1 and UE2. UE1 uses the first encryption key to encrypt the broadcast message, and uses the first integrity protection key to calculate the MAC of the direct communication request message to protect the integrity of the direct communication request message. That is, the direct communication request is processed through the first encryption key. Encryption, and the direct communication request is integrity protected by a first integrity protection key. Among them, the direct communication request contains at least one of the following:
UE1的安全能力信息(UE1 security capabilities);UE1 security capabilities information (UE1 security capabilities);
UE1的安全策略信息(UE1 security policy);UE1 security policy information (UE1 security policy);
UE1生成的第一临时公钥(Ephemeral public key1);The first temporary public key (Ephemeral public key1) generated by UE1;
UE1生成的第一随机数(Nonce-1)。The first random number (Nonce-1) generated by UE1.
S5-3.UE-to-UE Relay接收广播的直接通信请求消息,并验证UE-to-UE Relay是否配置为转发直接通信请求消息,例如,UE-to-UE Relay将宣布的ProSe应用ID与它所提供的中继策略/参数进行比较。UE-to-UE Relay转发端到端广播的直接通信请求消息时,使用自己的L2 ID作为源(Source)L2 ID,并在消息中添加UE-to-UE Relay的UE ID,在适配层指定标识UE1的信息。UE-to-UE Relay在ProSe层处理此端到端广播消息,并根据适配层信息转发任何后续的端到端PC5-S消息。S5-3.UE-to-UE Relay receives the broadcast direct communication request message and verifies whether the UE-to-UE Relay is configured to forward the direct communication request message. For example, the UE-to-UE Relay will announce the ProSe application ID and Compare the relay policies/parameters it provides. When UE-to-UE Relay forwards the direct communication request message broadcast end-to-end, it uses its own L2 ID as the source (Source) L2 ID, and adds the UE ID of UE-to-UE Relay in the message. In the adaptation layer Specify information identifying UE1. UE-to-UE Relay processes this end-to-end broadcast message at the ProSe layer and forwards any subsequent end-to-end PC5-S messages based on the adaptation layer information.
具体的,在验证通过之后UE-to-UE Relay使用第一加密密钥解密直接通信请求以获取QoS和计费信息,以及UE-to-UE Relay使用第一完整性保护密钥验证直接通信请求的完整性,在验证通过之后UE-to-UE Relay在直接通信请求中添加UE-to-UE Relay的相关信息和UE-to-UE Relay的标识,并且UE-to-UE Relay使用第一加密密钥加密直接通信请求,使用第一完整性保护密钥保护直接通信请求的完整性;其中,UE-to-UE Relay的相关信息包括以下之一:UE-to-UE Relay的身份信息,UE-to-UE Relay生成的随机数,UE-to-UE Relay生成的计数器。Specifically, after the verification is passed, the UE-to-UE Relay uses the first encryption key to decrypt the direct communication request to obtain QoS and charging information, and the UE-to-UE Relay uses the first integrity protection key to verify the direct communication request. Integrity, after passing the verification, the UE-to-UE Relay adds the relevant information of the UE-to-UE Relay and the identification of the UE-to-UE Relay in the direct communication request, and the UE-to-UE Relay uses the first encryption The key encrypts the direct communication request and uses the first integrity protection key to protect the integrity of the direct communication request; among which, the relevant information of the UE-to-UE Relay includes one of the following: the identity information of the UE-to-UE Relay, the UE Random number generated by -to-UE Relay, counter generated by UE-to-UE Relay.
S5-4a.UE2对宣布的应用程序感兴趣,如果UE2和UE-to-UE Relay之间不存在每跳链路,UE2会触发UE-to-UE Relay建立每跳链路。UE2发送每跳链路建立过程消息,源地址是UE2 L2 ID,目的地址是中继的L2 ID。S5-4a.UE2 is interested in the announced application. If there is no per-hop link between UE2 and UE-to-UE Relay, UE2 will trigger the UE-to-UE Relay to establish a per-hop link. UE2 sends a link establishment process message for each hop. The source address is the UE2 L2 ID and the destination address is the relay's L2 ID.
S5-4b.如果UE-to-UE relay和UE1之间不存在每跳链路,则执行UE-to-UE relay和UE1之间的每跳链路建立过程。UE1将自己的L2 ID作为源地址,中继的L2 ID作为目的地址。S5-4b. If there is no per-hop link between UE-to-UE relay and UE1, perform a per-hop link establishment process between UE-to-UE relay and UE1. UE1 uses its own L2 ID as the source address and the relay's L2 ID as the destination address.
S5-5a.当UE-2和UE-to-UE relay成功建立了每跳链路(per hop link),将进一步触发UE2和UE1间端到端安全的建立。UE2可以基于已注册并被授权使用UE-to-UE relay通信的终端的对称密钥衍生第一加密密钥和第一完整性保护密钥,解密收到的直接通信请求,并验证直接通信请求的完整性。验证成功后,UE2产生一对临时公私钥,即第二临时公钥(Ephemeral public key2)和第二临时私钥(Ephemeral private key2),并使用第二临时私钥、第一临时公钥和UE-to-UE relay的相关信息,计算出与UE-1的共享密钥K D和MSB of K D ID。若直接通信请求中包含安全策略与安全算法,那么UE2协商出安全策略与安全算法,然后生成第二随机数(Nonce_2),并根据利用K D计算K D-sess和K D-sess衍生的下级密钥(即第二加密密钥(K D-enc)和第二完整性保护密钥(K D-int)),另外UE2生成MSB of K D-sess ID。 S5-5a. When UE-2 and UE-to-UE relay successfully establish a per hop link, the establishment of end-to-end security between UE2 and UE1 will be further triggered. UE2 may derive the first encryption key and the first integrity protection key based on the symmetric key of the terminal that is registered and authorized to use UE-to-UE relay communication, decrypt the received direct communication request, and verify the direct communication request of integrity. After successful verification, UE2 generates a pair of temporary public and private keys, namely the second temporary public key (Ephemeral public key2) and the second temporary private key (Ephemeral private key2), and uses the second temporary private key, the first temporary public key and the UE -To-UE relay related information, calculate the shared key K D and MSB of K D ID with UE-1. If the direct communication request contains the security policy and security algorithm, then UE2 negotiates the security policy and security algorithm, then generates the second random number (Nonce_2), and calculates the lower level derived from K D -sess and K D -sess based on K D keys (ie, the second encryption key (K D-enc ) and the second integrity protection key (K D -int )), and in addition UE2 generates the MSB of K D -sess ID.
具体的,UE2通过UE-to-UE relay向UE1发送安全模式命令,该安全模式命令通过第一加密密钥进行加密,该安全模式命令通过第一完整性保护密钥进行完整性保护,该安全模式命令中包含以下参数:Specifically, UE2 sends a security mode command to UE1 through UE-to-UE relay. The security mode command is encrypted by the first encryption key. The security mode command is integrity protected by the first integrity protection key. The security mode command is encrypted by the first encryption key. The following parameters are included in the mode command:
UE2选取的安全算法(chosen_algs);The security algorithm selected by UE2 (chosen_algs);
UE2选取的安全策略(chosen_security policy);The security policy chosen by UE2 (chosen_security policy);
UE2生成的第二临时公钥(Ephemeral private key2);The second temporary public key (Ephemeral private key2) generated by UE2;
UE2生成的该第二随机数(Nonce_2);The second random number (Nonce_2) generated by UE2;
UE2生成的MSB of K D ID; MSB of K D ID generated by UE2;
UE2生成的MSB of K D-sess ID; MSB of K D -sess ID generated by UE2;
UE-to-UE relay的相关信息(可选);UE-to-UE relay related information (optional);
第一消息验证码,其中,该第一消息验证码基于K D-sess衍生的下级完整性保护密钥(即第二完整性保护密钥(K D-int))生成,且该第一消息验证码的输入参数包括以下至少之一:UE2选取的安全算法,UE2选取的安全策略,第二临时公钥,第二随机数,MSB of K D ID,MSB of K D-sess ID。 A first message verification code, wherein the first message verification code is generated based on a lower integrity protection key derived from K D -sess (ie, the second integrity protection key (K D-int )), and the first message verification code The input parameters of the verification code include at least one of the following: the security algorithm selected by UE2, the security policy selected by UE2, the second temporary public key, the second random number, MSB of K D ID, and MSB of K D -sess ID.
S5-5b.在收到安全模式命令后,UE-to-UE relay可使用第一加密密钥解密安全模式命令获得与QoS和计费相关的信息。进一步地,UE-to-UE relay将安全模式命令发送给UE1。可选地,若安全模式命令中不包括UE-to-UE relay的相关信息,UE-to-UE relay可以在转发给UE1的安全模式命令中加入UE-to-UE relay的相关信息。S5-5b. After receiving the security mode command, the UE-to-UE relay can use the first encryption key to decrypt the security mode command to obtain information related to QoS and charging. Further, the UE-to-UE relay sends the security mode command to UE1. Optionally, if the security mode command does not include UE-to-UE relay related information, UE-to-UE relay can add UE-to-UE relay related information to the security mode command forwarded to UE1.
S5-6.UE1首先使用第一加密密钥解密安全模式命令,使用第一完整性保护密钥判断安全模式命令的完整性,验证成功后,进一步判断UE1的安全能力信息和UE1的安全策略信息是否遭受篡改,若未篡改,那么采用与UE2相同的方式计算K D-sess以及K D-sess衍生的下级密钥(即第二加密密钥(K D-enc)和第二完整性保护密钥(K D-int)),然后UE1验证第一消息验证码是否有效,若有效,UE1准备以新安全环境来保护后续通信。UE1生成LSB of K D ID、LSB of K D-sess ID,并将LSB of K D ID与收到的MSB of K D ID合并得到K D ID,以及将LSB of K D-sess ID与收到的MSB of K D-sess ID合并得到K D-sess ID,并保存K D ID和K D-sess ID,后续用于标识K D和K D-sess。UE1根据协商策略与协商算法,通过UE-to-UE relay向UE2发送一个受安全性保护的安全模式完成消息,该安全模式完成消息可使用K D-sess进行完整性和加密保护,或者,该安全模式完成消息可使用K D-sess生成的下级完整性保护密钥(即第二完整性保护密钥(K D-int))进行完整性保护,K D-sess生成的下级加密密钥(即第二加密密钥(K D-enc))进行加密保护。其中,该安全模式完成消息可以包括LSB of K D-sess ID。UE2可以将收到的LSB of K D-sess ID与UE2生成的MSB of K D-sess ID合并得到K D-sess ID,并保存K D-sess ID,后续用于标识K D-sess。 S5-6. UE1 first uses the first encryption key to decrypt the security mode command, uses the first integrity protection key to determine the integrity of the security mode command, and after successful verification, further determines the security capability information of UE1 and the security policy information of UE1. Whether it has been tampered with. If it has not been tampered with, use the same method as UE2 to calculate K D -sess and the subordinate key derived from K D -sess (i.e., the second encryption key (K D-enc ) and the second integrity protection key). key (K D-int )), and then UE1 verifies whether the first message verification code is valid. If valid, UE1 is prepared to use the new security environment to protect subsequent communications. UE1 generates LSB of K D ID, LSB of K D -sess ID, combines the LSB of K D ID with the received MSB of K D ID to obtain the K D ID, and combines the LSB of K D -sess ID with the received MSB of K D ID. The MSB of K D -sess ID is merged to obtain the K D -sess ID, and the K D ID and K D -sess ID are saved, which are subsequently used to identify K D and K D -sess. UE1 sends a security-protected security mode completion message to UE2 through the UE-to-UE relay according to the negotiation policy and negotiation algorithm. The security mode completion message can be protected by K D -sess for integrity and encryption, or the security mode completion message can be protected by KD-sess. The security mode completion message can be integrity protected using the lower-level integrity protection key (i.e., the second integrity protection key (K D-int )) generated by K D -sess, and the lower-level encryption key (K D -int ) generated by K D -sess. That is, the second encryption key (K D-enc )) is used for encryption protection. The security mode completion message may include LSB of K D -sess ID. UE2 can combine the received LSB of K D -sess ID with the MSB of K D -sess ID generated by UE2 to obtain the K D -sess ID, and save the K D -sess ID, which is subsequently used to identify the K D -sess.
具体的,UE1根据UE2选取的安全算法、K D-SESS、基于K D-SESS生成完整性保护密钥和/或机密性保护密钥、UE2选取的安全策略,与UE2进行通信。UE2根据UE2选取的安全算法、K D-SESS、基于K D-SESS生成完整性保护密钥和/或机密性保护密钥、UE2选取的安全策略,与UE1进行通信。 Specifically, UE1 communicates with UE2 according to the security algorithm and K D-SESS selected by UE2, generates an integrity protection key and/or confidentiality protection key based on K D-SESS , and a security policy selected by UE2. UE2 communicates with UE1 according to the security algorithm and K D-SESS selected by UE2, generates an integrity protection key and/or a confidentiality protection key based on K D-SESS , and a security policy selected by UE2.
实施例6,如图22所示,假设所有设备之间在此之前没有建立任何安全连接,可以通过S6-0至S6-6中的部分或全部步骤建立L2架构下的UE-to-UE中继场景下基于签名的安全通信连接。具体的,UE1可以是第一终端设备,UE2可以是第二终端设备,UE-to-UE relay可以是中继设备,K D可以是第一密钥,K D-SESS可以是第二密钥。 Embodiment 6, as shown in Figure 22, assuming that no secure connection has been established between all devices before, UE-to-UE under the L2 architecture can be established through some or all of the steps in S6-0 to S6-6. Signature-based secure communication connection in subsequent scenarios. Specifically, UE1 may be the first terminal device, UE2 may be the second terminal device, UE-to-UE relay may be the relay device, K D may be the first key, and K D-SESS may be the second key .
S6-0.UE向网络注册,并被授权UE-to-UE relay服务。UE-to-UE relay向网络注册可提供UE-to-UE Relay功能,UE-to-UE relay配置了中继策略参数。PKMF使用MIKEY机制,向上述已注册并得到授权的UE发送相关的对称密钥,可以基于已注册并被授权使用UE-to-UE relay通信的终端的对称密钥衍生第一加密密钥和第一完整性保护密钥。S6-0. The UE registers with the network and is authorized for the UE-to-UE relay service. UE-to-UE relay registers with the network to provide the UE-to-UE Relay function, and the UE-to-UE relay is configured with relay policy parameters. PKMF uses the MIKEY mechanism to send relevant symmetric keys to the above-mentioned registered and authorized UEs. The first encryption key and the third encryption key can be derived based on the symmetric keys of the terminals that have been registered and authorized to use UE-to-UE relay communication. An integrity protection key.
S6-1.UE2确定PC5单播链路建立时信令接收的目的L2 ID。S6-1.UE2 determines the destination L2 ID for signaling reception when the PC5 unicast link is established.
S6-2.UE1通过广播方式发送端到端的直接通信请求消息,具体的,UE1在将直接通信请求广播给周围的终端设备之前,基于已注册并被授权使用UE-to-UE relay通信的终端(即UE1和UE2)的对称密钥衍生第一加密密钥和第一完整性保护密钥。UE1使用第一加密密钥加密广播消息,使用第一完整性保护密钥计算直接通信请求消息的MAC即保护直接通信请求消息的完整性,也即,该直接通信请求通过第一加密密钥进行加密,以及该直接通信请求通过第一完整性保护密钥进行完整性保护。其中,直接通信请求中包含以下至少之一:S6-2.UE1 sends an end-to-end direct communication request message through broadcast. Specifically, UE1 broadcasts the direct communication request to surrounding terminal devices based on terminals that have registered and are authorized to use UE-to-UE relay communication. The first encryption key and the first integrity protection key are derived from the symmetric keys of UE1 and UE2. UE1 uses the first encryption key to encrypt the broadcast message, and uses the first integrity protection key to calculate the MAC of the direct communication request message to protect the integrity of the direct communication request message. That is, the direct communication request is processed through the first encryption key. Encryption, and the direct communication request is integrity protected by a first integrity protection key. Among them, the direct communication request contains at least one of the following:
UE1的安全能力信息(UE1 security capabilities);UE1 security capabilities information (UE1 security capabilities);
UE1的安全策略信息(UE1 security policy);UE1 security policy information (UE1 security policy);
UE1生成的第一临时公钥(Ephemeral public key1);The first temporary public key (Ephemeral public key1) generated by UE1;
UE1生成的第一随机数(Nonce-1)。The first random number (Nonce-1) generated by UE1.
S6-3.UE-to-UE Relay接收广播的直接通信请求消息,并验证UE-to-UE Relay是否配置为转发直接通信请求消息,例如,UE-to-UE Relay将宣布的ProSe应用ID与它所提供的中继策略/参数进行比较。UE-to-UE Relay转发端到端广播的直接通信请求消息时,使用自己的L2 ID作为源(Source)L2 ID,并在消息中添加UE-to-UE Relay的UE ID,在适配层指定标识UE1的信息。UE-to-UE Relay在ProSe层处理此端到端广播消息,并根据适配层信息转发任何后续的端到端PC5-S消息。S6-3.UE-to-UE Relay receives the broadcast direct communication request message and verifies whether the UE-to-UE Relay is configured to forward the direct communication request message. For example, the UE-to-UE Relay will announce the ProSe application ID and Compare the relay policies/parameters it provides. When UE-to-UE Relay forwards the direct communication request message broadcast end-to-end, it uses its own L2 ID as the source (Source) L2 ID, and adds the UE ID of UE-to-UE Relay in the message. In the adaptation layer Specify information identifying UE1. UE-to-UE Relay processes this end-to-end broadcast message at the ProSe layer and forwards any subsequent end-to-end PC5-S messages based on the adaptation layer information.
具体的,在验证通过之后UE-to-UE Relay使用第一加密密钥解密直接通信请求以获取QoS和计费信息,以及UE-to-UE Relay使用第一完整性保护密钥验证直接通信请求的完整性,在验证通过之后UE-to-UE Relay在直接通信请求中添加UE-to-UE Relay的相关信息和UE-to-UE Relay的标识,并且UE-to-UE Relay使用第一加密密钥加密直接通信请求,使用第一完整性保护密钥保护直接通信请求的完整性;其中,UE-to-UE Relay的相关信息包括以下之一:UE-to-UE Relay的身份信息,UE-to-UE Relay生成的随机数,UE-to-UE Relay生成的计数器。Specifically, after the verification is passed, the UE-to-UE Relay uses the first encryption key to decrypt the direct communication request to obtain QoS and charging information, and the UE-to-UE Relay uses the first integrity protection key to verify the direct communication request. Integrity, after passing the verification, the UE-to-UE Relay adds the relevant information of the UE-to-UE Relay and the identification of the UE-to-UE Relay in the direct communication request, and the UE-to-UE Relay uses the first encryption The key encrypts the direct communication request and uses the first integrity protection key to protect the integrity of the direct communication request; among which, the relevant information of the UE-to-UE Relay includes one of the following: the identity information of the UE-to-UE Relay, the UE Random number generated by -to-UE Relay, counter generated by UE-to-UE Relay.
S6-4a.UE2对宣布的应用程序感兴趣,如果UE2和UE-to-UE Relay之间不存在每跳链路,UE2会触发UE-to-UE Relay建立每跳链路。UE2发送每跳链路建立过程消息,源地址是UE2 L2 ID,目的地址是中继的L2 ID。S6-4a.UE2 is interested in the announced application. If there is no per-hop link between UE2 and UE-to-UE Relay, UE2 will trigger the UE-to-UE Relay to establish a per-hop link. UE2 sends a link establishment process message for each hop. The source address is the UE2 L2 ID and the destination address is the relay's L2 ID.
S6-4b.如果UE-to-UE relay和UE1之间不存在每跳链路,则执行UE-to-UE relay和UE1之间的每跳链路建立过程。UE1将自己的L2 ID作为源地址,中继的L2 ID作为目的地址。S6-4b. If there is no per-hop link between UE-to-UE relay and UE1, perform a per-hop link establishment process between UE-to-UE relay and UE1. UE1 uses its own L2 ID as the source address and the relay's L2 ID as the destination address.
S6-5a.当UE-2和UE-to-UE relay成功建立了每跳链路(per hop link),将进一步触发UE2和UE1间端到端安全的建立。UE2可以基于已注册并被授权使用UE-to-UE relay通信的终端的对称密钥衍生第一加密密钥和第一完整性保护密钥,解密收到的直接通信请求,并验证直接通信请求的完整性。验证成功后,UE2产生一对临时公私钥,即第二临时公钥(Ephemeral public key2)和第二临时私钥(Ephemeral private key2),并使用第二临时私钥、第一临时公钥和UE-to-UE relay的相关信息,计算出与UE1的共享密钥K D和MSB of K D ID。若直接通信请求中包含安全策略与安全算法,那么UE2协商出安全策略与安全算法,然后生成第二随机数(Nonce_2),并根据利用K D衍生的下级密钥(即第二加密密钥(K D-enc)和第二完整性保护密钥(K D-int))。 S6-5a. When UE-2 and UE-to-UE relay successfully establish a per hop link, the establishment of end-to-end security between UE2 and UE1 will be further triggered. UE2 may derive the first encryption key and the first integrity protection key based on the symmetric key of the terminal that is registered and authorized to use UE-to-UE relay communication, decrypt the received direct communication request, and verify the direct communication request of integrity. After successful verification, UE2 generates a pair of temporary public and private keys, namely the second temporary public key (Ephemeral public key2) and the second temporary private key (Ephemeral private key2), and uses the second temporary private key, the first temporary public key and the UE -To-UE relay related information, calculate the shared key K D and MSB of K D ID with UE1. If the direct communication request contains the security policy and security algorithm, then UE2 negotiates the security policy and security algorithm, and then generates the second random number (Nonce_2), and uses the subordinate key derived from K D (i.e. the second encryption key ( K D-enc ) and the second integrity protection key (K D-int )).
具体的,UE2通过UE-to-UE relay向UE1发送安全模式命令,该安全模式命令通过第一加密密钥进行加密,该安全模式命令通过第一完整性保护密钥进行完整性保护,该安全模式命令中包含以下参数:Specifically, UE2 sends a security mode command to UE1 through UE-to-UE relay. The security mode command is encrypted by the first encryption key. The security mode command is integrity protected by the first integrity protection key. The security mode command is encrypted by the first encryption key. The following parameters are included in the mode command:
UE2选取的安全算法(chosen_algs);The security algorithm selected by UE2 (chosen_algs);
UE2选取的安全策略(chosen_security policy);The security policy chosen by UE2 (chosen_security policy);
UE2生成的第二临时公钥(Ephemeral private key2);The second temporary public key (Ephemeral private key2) generated by UE2;
UE2生成的该第二随机数(Nonce_2);The second random number (Nonce_2) generated by UE2;
UE2生成的MSB of K D ID; MSB of K D ID generated by UE2;
UE-to-UE relay的相关信息(可选);UE-to-UE relay related information (optional);
第一消息验证码,其中,该第一消息验证码基于第二完整性保护密钥(K D-int)生成,且该第一消息验证码的输入参数包括以下至少之一:UE2选取的安全算法,UE2选取的安全策略,第二临时公钥,第二随机数,MSB of K D ID。 A first message verification code, wherein the first message verification code is generated based on the second integrity protection key (K D-int ), and the input parameters of the first message verification code include at least one of the following: the security selected by UE2 Algorithm, security policy selected by UE2, second temporary public key, second random number, MSB of K D ID.
S6-5b.在收到安全模式命令后,UE-to-UE relay可使用第一加密密钥解密安全模式命令获得与QoS和计费相关的信息。进一步地,UE-to-UE relay将安全模式命令发送给UE1。可选地,若安全模式命令中不包括UE-to-UE relay的相关信息,UE-to-UE relay可以在转发给UE1的安全模式命令中加入UE-to-UE relay的相关信息。S6-5b. After receiving the security mode command, the UE-to-UE relay can use the first encryption key to decrypt the security mode command to obtain information related to QoS and charging. Further, the UE-to-UE relay sends the security mode command to UE1. Optionally, if the security mode command does not include UE-to-UE relay related information, UE-to-UE relay can add UE-to-UE relay related information to the security mode command forwarded to UE1.
S6-6.UE1首先使用第一加密密钥解密安全模式命令,使用第一完整性保护密钥判断安全模式命 令的完整性,验证成功后,进一步判断UE1的安全能力信息和UE1的安全策略信息是否遭受篡改,若未篡改,那么采用与UE2相同的方式计算第二加密密钥(K D-enc)和第二完整性保护密钥(K D-int),然后UE1验证第一消息验证码是否有效,若有效,UE1准备以新安全环境来保护后续通信。UE1生成LSB of K D ID,并将LSB of K D ID与收到的MSB of K D ID合并得到K D ID,并保存K D ID,后续用于标识K D。UE1根据协商策略与协商算法,通过UE-to-UE relay向UE2发送一个受安全性保护的安全模式完成消息,该安全模式完成消息可使用衍生的下级完整性保护密钥(即第二完整性保护密钥(K D-int))进行完整性保护,衍生的下级加密密钥(即第二加密密钥(K D-enc))进行加密保护。 S6-6. UE1 first uses the first encryption key to decrypt the security mode command, uses the first integrity protection key to determine the integrity of the security mode command, and after successful verification, further determines the security capability information of UE1 and the security policy information of UE1. Whether it has been tampered with. If not, then the second encryption key (K D-enc ) and the second integrity protection key (K D-int ) are calculated in the same way as UE2, and then UE1 verifies the first message verification code. Is it valid? If valid, UE1 is prepared to use the new security environment to protect subsequent communications. UE1 generates the LSB of K D ID, combines the LSB of K D ID with the received MSB of K D ID to obtain the K D ID, and saves the K D ID, which is subsequently used to identify K D . According to the negotiation strategy and algorithm, UE1 sends a security-protected security mode completion message to UE2 through the UE-to-UE relay. The security mode completion message can use the derived lower-level integrity protection key (i.e., the second integrity The protection key (K D-int )) performs integrity protection, and the derived lower-level encryption key (i.e., the second encryption key (K D-enc )) performs encryption protection.
具体的,UE1根据UE2选取的安全算法、第二完整性保护密钥(K D-int)和/或第二加密密钥(K D-enc)、UE2选取的安全策略,与UE2进行通信。UE2根据UE2选取的安全算法、第二完整性保护密钥(K D-int)和/或第二加密密钥(K D-enc)、UE2选取的安全策略,与UE1进行通信。 Specifically, UE1 communicates with UE2 according to the security algorithm selected by UE2, the second integrity protection key (K D-int ) and/or the second encryption key (K D-enc ), and the security policy selected by UE2. UE2 communicates with UE1 according to the security algorithm selected by UE2, the second integrity protection key (K D-int ) and/or the second encryption key (K D-enc ), and the security policy selected by UE2.
上文结合图7至图22,详细描述了本申请的方法实施例,下文结合图23至图31,详细描述本申请的装置实施例,应理解,装置实施例与方法实施例相互对应,类似的描述可以参照方法实施例。The method embodiments of the present application are described in detail above with reference to Figures 7 to 22. The device embodiments of the present application are described in detail below with reference to Figures 23 to 31. It should be understood that the device embodiments and the method embodiments correspond to each other, and are similar to The description may refer to the method embodiments.
图23示出了根据本申请实施例的终端设备1100的示意性框图。该终端设备1100为第一终端设备,如图23所示,该终端设备1100包括:Figure 23 shows a schematic block diagram of a terminal device 1100 according to an embodiment of the present application. The terminal device 1100 is a first terminal device. As shown in Figure 23, the terminal device 1100 includes:
通信单元1110,用于接收第二终端设备通过中继设备发送的认证请求消息;Communication unit 1110, configured to receive an authentication request message sent by the second terminal device through the relay device;
其中,该认证请求消息包括以下至少之一:该第二终端设备所属用户的信息,该中继设备所属用户的信息,该第二终端设备生成的第一临时公钥,该第二终端设备的签名,该中继设备的签名,该中继设备的相关信息;The authentication request message includes at least one of the following: information about the user to which the second terminal device belongs, information about the user to which the relay device belongs, the first temporary public key generated by the second terminal device, Signature, the signature of the relay device, and relevant information of the relay device;
其中,该第二终端设备所属用户的信息包括该第二终端设备的标识和该第二终端设备的公共验证令牌PVT和密钥管理服务器的公共认证密钥KPAK;该中继设备所属用户的信息包括该中继设备的标识和该中继设备的PVT和KPAK;该第二终端设备的签名的输入参数包括以下至少之一:该第二终端设备所属用户的信息和该第一临时公钥;该中继设备的签名的输入参数包括以下至少之一:该第二终端设备的签名和该中继设备所属用户的信息;该第一临时公钥和该中继设备的相关信息用于该第一终端设备派生第一密钥;该中继设备的相关信息包括以下之一:该中继设备的身份信息,该中继设备生成的随机数,该中继设备生成的计数器。Wherein, the information of the user to which the second terminal device belongs includes the identification of the second terminal device, the public verification token PVT of the second terminal device and the public authentication key KPAK of the key management server; The information includes the identification of the relay device and the PVT and KPAK of the relay device; the input parameters of the signature of the second terminal device include at least one of the following: information of the user to which the second terminal device belongs and the first temporary public key. ; The input parameters of the relay device's signature include at least one of the following: the signature of the second terminal device and the information of the user to which the relay device belongs; the first temporary public key and the relevant information of the relay device are used for the The first terminal device derives the first key; the relevant information of the relay device includes one of the following: the identity information of the relay device, the random number generated by the relay device, and the counter generated by the relay device.
在一些实施例中,该第二终端设备的签名由该第二终端设备的秘密签名密钥生成,和/或,该中继设备的签名由该中继设备的秘密签名密钥生成。In some embodiments, the signature of the second terminal device is generated by the secret signature key of the second terminal device, and/or the signature of the relay device is generated by the secret signature key of the relay device.
在一些实施例中,该终端设备1100还包括:处理单元1120;In some embodiments, the terminal device 1100 further includes: a processing unit 1120;
在该第二终端设备的KPAK和该中继设备的KPAK有效,且基于该第二终端设备的标识和该第二终端设备的PVT对该第二终端设备的签名验证成功,以及基于该中继设备的标识和该中继设备的PVT对该中继设备的签名验证成功的情况下,该处理单元1120用于生成第二临时私钥,以及该处理单元1120用于根据该第一临时公钥、该中继设备的相关信息和该第二临时私钥派生该第一密钥。The KPAK of the second terminal device and the KPAK of the relay device are valid, and the signature verification of the second terminal device based on the identity of the second terminal device and the PVT of the second terminal device is successful, and based on the relay If the identification of the device and the PVT of the relay device successfully verify the signature of the relay device, the processing unit 1120 is configured to generate a second temporary private key, and the processing unit 1120 is configured to generate a second temporary public key based on the first temporary public key. , the relevant information of the relay device and the second temporary private key to derive the first key.
在一些实施例中,该通信单元1110还用于通过该中继设备向该第二终端设备发送第一消息;In some embodiments, the communication unit 1110 is also used to send the first message to the second terminal device through the relay device;
其中,该第一消息包括以下至少之一:该第一终端设备的安全能力信息,该第一终端设备的安全策略信息,该第一终端设备所属用户的信息,该第一终端设备生成的第一随机数,该第一终端设备生成的与该第二临时私钥配对的第二临时公钥,该第一终端设备生成的该第一密钥的标识的M个比特位,该第一终端设备的签名,第一消息验证码;Wherein, the first message includes at least one of the following: security capability information of the first terminal device, security policy information of the first terminal device, information of the user to which the first terminal device belongs, a third message generated by the first terminal device. A random number, a second temporary public key generated by the first terminal device paired with the second temporary private key, M bits of the identification of the first key generated by the first terminal device, the first terminal Device signature, first message verification code;
其中,该第一终端设备所属用户的信息包括该第一终端设备的标识和该第一终端设备的PVT和KPAK;该第一终端设备的签名的输入参数包括以下至少之一:该第一终端设备所属用户的信息,该第二临时公钥,该M个比特位,该第二终端设备的签名;Wherein, the information of the user to which the first terminal device belongs includes the identification of the first terminal device and the PVT and KPAK of the first terminal device; the input parameters of the signature of the first terminal device include at least one of the following: the first terminal Information about the user to whom the device belongs, the second temporary public key, the M bits, and the signature of the second terminal device;
其中,该第一消息通过基于该第一密钥生成的该第一消息验证码进行完整性保护,且该第一消息验证码的输入参数包括以下至少之一:该第一终端设备的安全能力信息,该第一终端设备的安全策略信息,该第一终端设备所属用户的信息,该第一随机数,该第二临时公钥,该M个比特位,该第一终端设备的签名;Wherein, the first message is integrity protected by the first message verification code generated based on the first key, and the input parameters of the first message verification code include at least one of the following: the security capability of the first terminal device Information, the security policy information of the first terminal device, the information of the user to which the first terminal device belongs, the first random number, the second temporary public key, the M bits, and the signature of the first terminal device;
其中,该第二临时公钥和该中继设备的相关信息用于该第二终端设备派生该第一密钥,该第一随机数、该第一密钥和该第二终端设备生成的第二随机数用于派生第二密钥,该第二密钥用于派生完整性保护密钥和/或机密性保护密钥,该第一密钥的标识由该M个比特位与该第一密钥的标识的另外N个比特位合并得到,M和N均为正整数。Wherein, the second temporary public key and the relevant information of the relay device are used by the second terminal device to derive the first key, the first random number, the first key and the third key generated by the second terminal device. Two random numbers are used to derive a second key. The second key is used to derive an integrity protection key and/or a confidentiality protection key. The identity of the first key is composed of the M bits and the first The other N bits of the key's identifier are combined, and M and N are both positive integers.
在一些实施例中,该通信单元1110还用于接收该第二终端设备通过该中继设备发送的第二消息;In some embodiments, the communication unit 1110 is also used to receive the second message sent by the second terminal device through the relay device;
其中,该第二消息包括以下至少之一:该第二终端设备生成的该第二随机数,该第二终端设备生成的该第一密钥的标识的N个比特位,该第二终端设备生成的该第二密钥的标识的x个比特位,该第二终端设备选取的安全算法,该第二终端设备选取的安全策略,第二消息验证码;Wherein, the second message includes at least one of the following: the second random number generated by the second terminal device, N bits of the identification of the first key generated by the second terminal device, x bits of the identifier of the generated second key, the security algorithm selected by the second terminal device, the security policy selected by the second terminal device, and the second message verification code;
其中,该第二消息通过基于该第二密钥生成的该第二消息验证码进行完整性保护,或者,该第二消息通过基于该第二密钥派生的完整性保护密钥生成的该第二消息验证码进行完整性保护,且该第二消息验证码的输入参数包括以下至少之一:该第二随机数,该N个比特位,该x个比特位,该第二终端设备选取的安全算法,该第二终端设备选取的安全策略;其中,该第二密钥的标识由该x个比特位与该第二密钥的标识的另外y个比特位合并得到,x和y均为正整数。Wherein, the second message is integrity protected through the second message verification code generated based on the second key, or the second message is integrity protected through the third integrity protection key generated based on the second key. The second message verification code performs integrity protection, and the input parameters of the second message verification code include at least one of the following: the second random number, the N bits, the x bits, and the second terminal device selected Security algorithm, the security policy selected by the second terminal device; wherein, the identity of the second key is obtained by combining the x bits and the other y bits of the identity of the second key, x and y are both Positive integer.
在一些实施例中,该第二消息通过该第一密钥进行加密。In some embodiments, the second message is encrypted with the first key.
在一些实施例中,在该第二消息中携带的信息未遭受篡改的情况下,该处理单元1120还用于至少根据该第一随机数、该第一密钥和该第二随机数生成该第二密钥,该处理单元1120还用于根据该第二密钥生成完整性保护密钥和/或机密性保护密钥,以及该处理单元1120还用于将该M个比特位和该N个比特位合并得到该第一密钥的标识,该处理单元1120还用于生成该第二密钥的标识的y个比特位,并将该x个比特位和该y个比特位合并得到该第二密钥的标识;In some embodiments, if the information carried in the second message has not been tampered with, the processing unit 1120 is further configured to generate the first random number based on at least the first random number, the first key and the second random number. a second key, the processing unit 1120 is further configured to generate an integrity protection key and/or a confidentiality protection key according to the second key, and the processing unit 1120 is further configured to combine the M bits and the N The processing unit 1120 is also used to generate y bits of the identifier of the second key, and combine the x bits and the y bits to obtain the identifier of the first key. The identification of the second key;
在该第二消息验证码有效的情况下,该处理单元1120还用于根据该第二终端设备选取的安全算法、该第二密钥、基于该第二密钥生成完整性保护密钥和/或机密性保护密钥、该第二终端设备选取的安全策略,与该第二终端设备进行通信。If the second message verification code is valid, the processing unit 1120 is also configured to generate an integrity protection key based on the second key and/or the security algorithm selected by the second terminal device and the second key. Or the confidentiality protection key and the security policy selected by the second terminal device are used to communicate with the second terminal device.
在一些实施例中,该处理单元1120还用于根据该第一密钥解密该第二消息;In some embodiments, the processing unit 1120 is also configured to decrypt the second message according to the first key;
在该第二消息中携带的信息未遭受篡改的情况下,该处理单元1120还用于至少根据该第一随机数、该第一密钥和该第二随机数生成该第二密钥,该处理单元1120还用于根据该第二密钥生成完整性保护密钥和/或机密性保护密钥,以及该处理单元1120还用于将该M个比特位和该N个比特位合并得到该第一密钥的标识,该处理单元1120还用于生成该第二密钥的标识的y个比特位,并将该x个比特位和该y个比特位合并得到该第二密钥的标识;In the case that the information carried in the second message has not been tampered with, the processing unit 1120 is also configured to generate the second key based on at least the first random number, the first key and the second random number. The processing unit 1120 is further configured to generate an integrity protection key and/or a confidentiality protection key according to the second key, and the processing unit 1120 is further configured to combine the M bits and the N bits to obtain the The processing unit 1120 is also used to generate y bits of the identifier of the second key, and combine the x bits and the y bits to obtain the identifier of the second key. ;
在该第二消息验证码有效的情况下,该处理单元1120还用于根据该第二终端设备选取的安全算法、该第二密钥、基于该第二密钥生成完整性保护密钥和/或机密性保护密钥、该第二终端设备选取的安全策略,与该第二终端设备进行通信。If the second message verification code is valid, the processing unit 1120 is also configured to generate an integrity protection key based on the second key and/or the security algorithm selected by the second terminal device and the second key. Or the confidentiality protection key and the security policy selected by the second terminal device are used to communicate with the second terminal device.
在一些实施例中,该完整性保护密钥的输入参数包括以下至少之一:该第二密钥,选定的算法类型标识符,选定的算法类型标识符的长度,完整性保护算法标识,完整性保护算法标识的长度;和/或,该机密性保护密钥的输入参数包括以下至少之一:该第二密钥,选定的算法类型标识符,选定的算法类型标识符的长度,机密性保护算法标识,机密性保护算法标识的长度。In some embodiments, the input parameters of the integrity protection key include at least one of the following: the second key, the selected algorithm type identifier, the length of the selected algorithm type identifier, and the integrity protection algorithm identifier. , the length of the integrity protection algorithm identifier; and/or, the input parameters of the confidentiality protection key include at least one of the following: the second key, the selected algorithm type identifier, the selected algorithm type identifier Length, confidentiality protection algorithm identifier, length of the confidentiality protection algorithm identifier.
在一些实施例中,该第一消息为认证响应消息,该第二消息为安全模式命令消息。In some embodiments, the first message is an authentication response message, and the second message is a safe mode command message.
在一些实施例中,该第一消息为安全模式命令消息,该第二消息为安全模式响应消息。In some embodiments, the first message is a safe mode command message, and the second message is a safe mode response message.
在一些实施例中,该通信单元1110还用于通过该中继设备向该第二终端设备发送第三消息;In some embodiments, the communication unit 1110 is also used to send a third message to the second terminal device through the relay device;
其中,该第三消息用于指示安全模式建立完成,该第三消息通过目标密钥进行加密,且该第三消息包括以下至少之一:该第二密钥的标识的该y个比特位,第三消息验证码;Wherein, the third message is used to indicate that the security mode establishment is completed, the third message is encrypted by the target key, and the third message includes at least one of the following: the y bits of the identification of the second key, Third message verification code;
其中,该目标密钥包括以下之一:该第一密钥,该第二密钥,该第二密钥派生的机密性保护密钥;Wherein, the target key includes one of the following: the first key, the second key, and a confidentiality protected key derived from the second key;
其中,该第三消息通过基于该第二密钥生成的该第三消息验证码进行完整性保护,或者,该第三消息通过基于该第二密钥派生的完整性保护密钥生成的该第三消息验证码进行完整性保护,该第三消息验证码的输入参数包括该y个比特位。Wherein, the third message is integrity protected through the third message verification code generated based on the second key, or the third message is integrity protected through the third message verification code generated based on the integrity protection key derived based on the second key. The three-message verification code performs integrity protection, and the input parameters of the third message verification code include the y bits.
在一些实施例中,该通信单元1110还用于接收该第二终端设备通过该中继设备发送的错误消息;其中,该错误消息包括以下至少之一:原因信息,第四消息验证码;其中,该原因信息用于指示该第二终端设备与该第一终端设备的安全策略冲突,或者,该原因信息用于指示该第一消息验证码验证失败,或者,该原因信息用于指示该第二终端设备与该第一终端设备的安全算法协商失败;该第四消息验证码的输入参数包括以下至少之一:该原因信息;In some embodiments, the communication unit 1110 is also configured to receive an error message sent by the second terminal device through the relay device; wherein the error message includes at least one of the following: cause information, a fourth message verification code; wherein , the reason information is used to indicate that the security policy of the second terminal device conflicts with the first terminal device, or the reason information is used to indicate that the first message verification code verification fails, or the reason information is used to indicate that the third The security algorithm negotiation between the second terminal device and the first terminal device fails; the input parameters of the fourth message verification code include at least one of the following: the reason information;
在该第四消息验证码有效的情况下,该处理单元1120还用于确定安全模式建立失败,和/或,该处理单元1120还用于重新发起安全模式建立流程。If the fourth message verification code is valid, the processing unit 1120 is also configured to determine that the security mode establishment fails, and/or, the processing unit 1120 is also configured to reinitiate the security mode establishment process.
在一些实施例中,该完整性保护密钥包括控制面的完整性保护密钥和用户面的完整性保护密钥;和/或,该机密性保护密钥包括控制面的机密性保护密钥和用户面的机密性保护密钥。In some embodiments, the integrity protection key includes an integrity protection key for the control plane and an integrity protection key for the user plane; and/or the confidentiality protection key includes a confidentiality protection key for the control plane. and user plane confidentiality protecting keys.
在一些实施例中,上述通信单元可以是通信接口或收发器,或者是通信芯片或者片上系统的输入输出接口。上述处理单元可以是一个或多个处理器。In some embodiments, the above-mentioned communication unit may be a communication interface or transceiver, or an input/output interface of a communication chip or a system on a chip. The above-mentioned processing unit may be one or more processors.
应理解,根据本申请实施例的终端设备1100可对应于本申请方法实施例中的第一终端设备,并且终端设备1100中的各个单元的上述和其它操作和/或功能分别为了实现图7所示方法200中第一终端设备的相应流程,为了简洁,在此不再赘述。It should be understood that the terminal device 1100 according to the embodiment of the present application may correspond to the first terminal device in the method embodiment of the present application, and the above and other operations and/or functions of each unit in the terminal device 1100 are respectively to implement the functions shown in Figure 7 The corresponding process of the first terminal device in the method 200 is shown, and for the sake of simplicity, it will not be described again here.
图24示出了根据本申请实施例的终端设备1200的示意性框图。该终端设备1200为第二终端设备,如图24所示,该终端设备1200包括:Figure 24 shows a schematic block diagram of a terminal device 1200 according to an embodiment of the present application. The terminal device 1200 is a second terminal device. As shown in Figure 24, the terminal device 1200 includes:
通信单元1210,用于通过中继设备向第一终端设备发送认证请求消息;Communication unit 1210, configured to send an authentication request message to the first terminal device through the relay device;
其中,该认证请求消息包括以下至少之一:该第二终端设备所属用户的信息,该第二终端设备生成的第一临时公钥,该第二终端设备的签名,该中继设备的相关信息;The authentication request message includes at least one of the following: information about the user to which the second terminal device belongs, the first temporary public key generated by the second terminal device, the signature of the second terminal device, and relevant information about the relay device. ;
其中,该第二终端设备所属用户的信息包括该第二终端设备的标识和该第二终端设备的公共验证令牌PVT和密钥管理服务器的公共认证密钥KPAK;该第二终端设备的签名的输入参数包括以下至少之一:该第二终端设备所属用户的信息和该第一临时公钥;该第一临时公钥和该中继设备的相关信息用于该第一终端设备派生第一密钥;该中继设备的相关信息包括以下之一:该中继设备的身份信息,该中继设备生成的随机数,该中继设备生成的计数器。Wherein, the information of the user to which the second terminal device belongs includes the identification of the second terminal device, the public verification token PVT of the second terminal device and the public authentication key KPAK of the key management server; the signature of the second terminal device The input parameters include at least one of the following: the information of the user to which the second terminal device belongs and the first temporary public key; the first temporary public key and the relevant information of the relay device are used for the first terminal device to derive the first Key; the relevant information of the relay device includes one of the following: the identity information of the relay device, the random number generated by the relay device, and the counter generated by the relay device.
在一些实施例中,该第二终端设备的签名由该第二终端设备的秘密签名密钥生成。In some embodiments, the signature of the second terminal device is generated by the secret signature key of the second terminal device.
在一些实施例中,该通信单元1210还用于接收该第一终端设备通过该中继设备发送的第一消息;In some embodiments, the communication unit 1210 is also configured to receive the first message sent by the first terminal device through the relay device;
其中,该第一消息包括以下至少之一:该第一终端设备的安全能力信息,该第一终端设备的安全策略信息,该第一终端设备所属用户的信息,该中继设备所属用户的信息,该第一终端设备生成的第一随机数,该第一终端设备生成的与该第二临时私钥配对的第二临时公钥,该第一终端设备生成的该第一密钥的标识的M个比特位,该第一终端设备的签名,该中继设备的签名,第一消息验证码;Wherein, the first message includes at least one of the following: security capability information of the first terminal device, security policy information of the first terminal device, information of the user to which the first terminal device belongs, and information of the user to which the relay device belongs. , the first random number generated by the first terminal device, the second temporary public key paired with the second temporary private key generated by the first terminal device, the identification of the first key generated by the first terminal device M bits, the signature of the first terminal device, the signature of the relay device, and the first message verification code;
其中,该第一终端设备所属用户的信息包括该第一终端设备的标识和该第一终端设备的PVT和KPAK;该中继设备所属用户的信息包括该中继设备的标识和该中继设备的PVT和KPAK;该第一终端设备的签名的输入参数包括以下至少之一:该第一终端设备所属用户的信息,该第二临时公钥,该M个比特位,该第二终端设备的签名;该中继设备的签名的输入参数包括以下至少之一:该中继设备所属用户的信息,该第一终端设备的签名,该第二终端设备的签名,该第一消息;Wherein, the information of the user to which the first terminal device belongs includes the identification of the first terminal device and the PVT and KPAK of the first terminal device; the information of the user to which the relay device belongs includes the identification of the relay device and the relay device. PVT and KPAK; the input parameters of the first terminal device's signature include at least one of the following: the information of the user to which the first terminal device belongs, the second temporary public key, the M bits, the second terminal device's Signature; the input parameters of the relay device's signature include at least one of the following: information about the user to which the relay device belongs, the signature of the first terminal device, the signature of the second terminal device, and the first message;
其中,该第一消息通过基于该第一密钥生成的该第一消息验证码进行完整性保护,且该第一消息验证码的输入参数包括以下至少之一:该第一终端设备的安全能力信息,该第一终端设备的安全策略信息,该第一终端设备所属用户的信息,该第一随机数,该第二临时公钥,该M个比特位,该第一终端设备的签名;Wherein, the first message is integrity protected by the first message verification code generated based on the first key, and the input parameters of the first message verification code include at least one of the following: the security capability of the first terminal device Information, the security policy information of the first terminal device, the information of the user to which the first terminal device belongs, the first random number, the second temporary public key, the M bits, and the signature of the first terminal device;
其中,该第二临时公钥和该中继设备的相关信息用于该第二终端设备派生该第一密钥,该第一随机数、该第一密钥和该第二终端设备生成的第二随机数用于派生第二密钥,该第二密钥用于派生完整性保护密钥和/或机密性保护密钥,该第一密钥的标识由该M个比特位与该第一密钥的标识的另外N个比特位合并得到,M和N均为正整数。Wherein, the second temporary public key and the relevant information of the relay device are used by the second terminal device to derive the first key, the first random number, the first key and the third key generated by the second terminal device. Two random numbers are used to derive a second key. The second key is used to derive an integrity protection key and/or a confidentiality protection key. The identity of the first key is composed of the M bits and the first The other N bits of the key's identifier are combined, and M and N are both positive integers.
在一些实施例中,该第一终端设备的签名由该第一终端设备的秘密签名密钥生成,和/或,该中继设备的签名由该中继设备的秘密签名密钥生成。In some embodiments, the signature of the first terminal device is generated by the secret signature key of the first terminal device, and/or the signature of the relay device is generated by the secret signature key of the relay device.
在一些实施例中,该终端设备1200还包括:处理单元1220;In some embodiments, the terminal device 1200 further includes: a processing unit 1220;
该处理单元1220用于分别检查该第一终端设备的KPAK和该中继设备的KPAK,在该第一终端设备的KPAK和该中继设备的KPAK有效的情况下,且该处理单元1220用于基于该第一终端设备的标识和该第一终端设备的PVT对该第一终端设备的签名进行验证,以及该处理单元1220用于基于该中继设备的标识和该中继设备的PVT对该中继设备的签名进行验证;The processing unit 1220 is configured to check the KPAK of the first terminal device and the KPAK of the relay device respectively. If the KPAK of the first terminal device and the KPAK of the relay device are valid, and the processing unit 1220 is configured to Verify the signature of the first terminal device based on the identity of the first terminal device and the PVT of the first terminal device, and the processing unit 1220 is configured to verify the signature of the first terminal device based on the identity of the relay device and the PVT of the relay device. The signature of the relay device is verified;
在该第一终端设备的签名和该中继设备的签名验证成功,且该第一消息中携带的信息未遭受篡改的情况下,该处理单元1220用于生成第二随机数,该处理单元1220用于至少根据该第一随机数、该第一密钥和该第二随机数生成该第二密钥,该处理单元1220用于根据该第二密钥生成完整性保护密钥和/或机密性保护密钥,以及该处理单元1220用于生成该第一密钥的标识的N个比特位,并将该M个比特位和该N个比特位合并得到该第一密钥的标识;When the signature of the first terminal device and the signature of the relay device are successfully verified and the information carried in the first message has not been tampered with, the processing unit 1220 is configured to generate a second random number. The processing unit 1220 The processing unit 1220 is configured to generate an integrity protection key and/or a secret based on at least the first random number, the first key and the second random number. Sexually protected key, and the processing unit 1220 is used to generate N bits of the identification of the first key, and combine the M bits and the N bits to obtain the identification of the first key;
在该第一消息验证码有效的情况下,该通信单元1210还用于通过该中继设备向该第一终端设备发送第二消息;其中,该第二消息包括以下至少之一:该第二随机数,该N个比特位,该第二终端设备生成的该第二密钥的标识的x个比特位,该第二终端设备选取的安全算法,该第二终端设备选取的安全策略,第二消息验证码;When the first message verification code is valid, the communication unit 1210 is also configured to send a second message to the first terminal device through the relay device; wherein the second message includes at least one of the following: the second The random number, the N bits, the x bits of the identifier of the second key generated by the second terminal device, the security algorithm selected by the second terminal device, the security policy selected by the second terminal device, the Two message verification code;
其中,该第二消息通过基于该第二密钥生成的该第二消息验证码进行完整性保护,或者,该第二消息通过基于该第二密钥派生的完整性保护密钥生成的该第二消息验证码进行完整性保护,且该第二消息验证码的输入参数包括以下至少之一:该第二随机数,该N个比特位,该x个比特位,该第二终端设备选取的安全算法,该第二终端设备选取的安全策略;其中,该第二密钥的标识由该x个比特位与该第二密钥的标识的另外y个比特位合并得到,x和y均为正整数。Wherein, the second message is integrity protected through the second message verification code generated based on the second key, or the second message is integrity protected through the third integrity protection key generated based on the second key. The second message verification code performs integrity protection, and the input parameters of the second message verification code include at least one of the following: the second random number, the N bits, the x bits, and the second terminal device selected Security algorithm, the security policy selected by the second terminal device; wherein, the identity of the second key is obtained by combining the x bits and the other y bits of the identity of the second key, x and y are both Positive integer.
在一些实施例中,该第二消息通过该第一密钥进行加密。In some embodiments, the second message is encrypted with the first key.
在一些实施例中,该第一消息为认证响应消息,该第二消息为安全模式命令消息。In some embodiments, the first message is an authentication response message, and the second message is a safe mode command message.
在一些实施例中,该第一消息为安全模式命令消息,该第二消息为安全模式响应消息。In some embodiments, the first message is a safe mode command message, and the second message is a safe mode response message.
在一些实施例中,该完整性保护密钥的输入参数包括以下至少之一:该第二密钥,选定的算法类 型标识符,选定的算法类型标识符的长度,完整性保护算法标识,完整性保护算法标识的长度;和/或,该机密性保护密钥的输入参数包括以下至少之一:该第二密钥,选定的算法类型标识符,选定的算法类型标识符的长度,机密性保护算法标识,机密性保护算法标识的长度。In some embodiments, the input parameters of the integrity protection key include at least one of the following: the second key, the selected algorithm type identifier, the length of the selected algorithm type identifier, and the integrity protection algorithm identifier. , the length of the integrity protection algorithm identifier; and/or, the input parameters of the confidentiality protection key include at least one of the following: the second key, the selected algorithm type identifier, the selected algorithm type identifier Length, confidentiality protection algorithm identifier, length of the confidentiality protection algorithm identifier.
在一些实施例中,该通信单元1210还用于接收该第一终端设备通过该中继设备发送的第三消息;In some embodiments, the communication unit 1210 is also configured to receive a third message sent by the first terminal device through the relay device;
其中,该第三消息用于指示安全模式建立完成,该第三消息通过目标密钥进行加密,且该第三消息包括以下至少之一:该第一终端设备生成的该第二密钥的标识的y个比特位,第三消息验证码;Wherein, the third message is used to indicate that the security mode establishment is completed, the third message is encrypted by the target key, and the third message includes at least one of the following: the identification of the second key generated by the first terminal device y bits, the third message verification code;
其中,该目标密钥包括以下之一:该第一密钥,该第二密钥,该第二密钥派生的机密性保护密钥;Wherein, the target key includes one of the following: the first key, the second key, and a confidentiality protected key derived from the second key;
其中,该第三消息通过基于该第二密钥生成的该第三消息验证码进行完整性保护,或者,该第三消息通过基于该第二密钥派生的完整性保护密钥生成的该第三消息验证码进行完整性保护,该第三消息验证码的输入参数包括该y个比特位。Wherein, the third message is integrity protected through the third message verification code generated based on the second key, or the third message is integrity protected through the third message verification code generated based on the integrity protection key derived based on the second key. The three-message verification code performs integrity protection, and the input parameters of the third message verification code include the y bits.
在一些实施例中,该处理单元1220用于通过该目标密钥对该第三消息进行解密;In some embodiments, the processing unit 1220 is configured to decrypt the third message through the target key;
在该第三消息中携带的信息未遭受篡改的情况下,且该第三消息验证码有效的情况下,该第二终端设备将该x个比特位与该y个比特位合并得到该第二密钥的标识。When the information carried in the third message has not been tampered with and the third message verification code is valid, the second terminal device combines the x bits and the y bits to obtain the second The identity of the key.
在一些实施例中,该通信单元1210还用于通过该中继设备向该第一终端设备发送错误消息;其中,该错误消息包括以下至少之一:原因信息,第四消息验证码;其中,该原因信息用于指示该第二终端设备与该第一终端设备的安全策略冲突,或者,该原因信息用于指示该第一消息验证码验证失败,或者,该原因信息用于指示该第二终端设备与该第一终端设备的安全算法协商失败;该第四消息验证码的输入参数包括以下至少之一:该原因信息。In some embodiments, the communication unit 1210 is also configured to send an error message to the first terminal device through the relay device; wherein the error message includes at least one of the following: cause information, a fourth message verification code; wherein, The reason information is used to indicate that the security policy of the second terminal device conflicts with the first terminal device, or the reason information is used to indicate that the first message verification code verification fails, or the reason information is used to indicate that the second terminal device The security algorithm negotiation between the terminal device and the first terminal device fails; the input parameters of the fourth message verification code include at least one of the following: the reason information.
在一些实施例中,该完整性保护密钥包括控制面的完整性保护密钥和用户面的完整性保护密钥;和/或,该机密性保护密钥包括控制面的机密性保护密钥和用户面的机密性保护密钥。In some embodiments, the integrity protection key includes an integrity protection key for the control plane and an integrity protection key for the user plane; and/or the confidentiality protection key includes a confidentiality protection key for the control plane. and user plane confidentiality protecting keys.
在一些实施例中,上述通信单元可以是通信接口或收发器,或者是通信芯片或者片上系统的输入输出接口。上述处理单元可以是一个或多个处理器。In some embodiments, the above-mentioned communication unit may be a communication interface or transceiver, or an input/output interface of a communication chip or a system on a chip. The above-mentioned processing unit may be one or more processors.
应理解,根据本申请实施例的终端设备1200可对应于本申请方法实施例中的第二终端设备,并且终端设备1200中的各个单元的上述和其它操作和/或功能分别为了实现图9所示方法300中第二终端设备的相应流程,为了简洁,在此不再赘述。It should be understood that the terminal device 1200 according to the embodiment of the present application may correspond to the second terminal device in the method embodiment of the present application, and the above and other operations and/or functions of each unit in the terminal device 1200 are respectively to implement the functions shown in Figure 9 The corresponding process of the second terminal device in method 300 is shown, and for the sake of simplicity, it will not be described again here.
图25示出了根据本申请实施例的终端设备1300的示意性框图。该终端设备1300为中继设备,如图25所示,该终端设备1300包括:Figure 25 shows a schematic block diagram of a terminal device 1300 according to an embodiment of the present application. The terminal device 1300 is a relay device. As shown in Figure 25, the terminal device 1300 includes:
通信单元1310,用于接收第二终端设备发送的认证请求消息;其中,该认证请求消息包括以下至少之一:该第二终端设备所属用户的信息,该第二终端设备生成的第一临时公钥,该第二终端设备的签名;其中,该第二终端设备所属用户的信息包括该第二终端设备的标识和该第二终端设备的公共验证令牌PVT和密钥管理服务器的公共认证密钥KPAK;该第二终端设备的签名的输入参数包括以下至少之一:该第二终端设备所属用户的信息和该第一临时公钥;The communication unit 1310 is configured to receive an authentication request message sent by the second terminal device; wherein the authentication request message includes at least one of the following: information about the user to which the second terminal device belongs, the first temporary public address generated by the second terminal device. key, the signature of the second terminal device; wherein the information of the user to which the second terminal device belongs includes the identification of the second terminal device, the public verification token PVT of the second terminal device and the public authentication password of the key management server. Key KPAK; the input parameters of the signature of the second terminal device include at least one of the following: information of the user to which the second terminal device belongs and the first temporary public key;
在该第二终端设备的KPAK有效,且基于该第二终端设备的标识和该第二终端设备的PVT对该第二终端设备的签名验证成功的情况下,该通信单元1310还用于向该第一终端设备发送验证之后的认证请求消息;其中,该验证之后的认证请求消息包括以下至少之一:该第二终端设备所属用户的信息,该中继设备所属用户的信息,该第一临时公钥,该第二终端设备的签名,该中继设备的签名,该中继设备的相关信息;其中,该中继设备所属用户的信息包括该中继设备的标识和该中继设备的PVT和KPAK;该中继设备的签名的输入参数包括以下至少之一:该第二终端设备的签名和该中继设备所属用户的信息;其中,该第一临时公钥和该中继设备的相关信息用于第一终端设备派生第一密钥;该中继设备的相关信息包括以下之一:该中继设备的身份信息,该中继设备生成的随机数,该中继设备生成的计数器。When the KPAK of the second terminal device is valid and the signature verification of the second terminal device based on the identity of the second terminal device and the PVT of the second terminal device is successful, the communication unit 1310 is also used to send a message to the second terminal device. The first terminal device sends an authentication request message after verification; wherein the authentication request message after verification includes at least one of the following: information about the user to whom the second terminal device belongs, information about the user to whom the relay device belongs, the first temporary The public key, the signature of the second terminal device, the signature of the relay device, and the relevant information of the relay device; wherein the information of the user to which the relay device belongs includes the identification of the relay device and the PVT of the relay device. and KPAK; the input parameters of the relay device's signature include at least one of the following: the signature of the second terminal device and the information of the user to which the relay device belongs; wherein the first temporary public key and the information related to the relay device The information is used by the first terminal device to derive the first key; the relevant information of the relay device includes one of the following: the identity information of the relay device, the random number generated by the relay device, and the counter generated by the relay device.
在一些实施例中,该第二终端设备的签名由该第二终端设备的秘密签名密钥生成,和/或,该中继设备的签名由该中继设备的秘密签名密钥生成。In some embodiments, the signature of the second terminal device is generated by the secret signature key of the second terminal device, and/or the signature of the relay device is generated by the secret signature key of the relay device.
在一些实施例中,该通信单元1310还用于接收该第一终端设备发送的第一消息;其中,该第一消息包括以下至少之一:该第一终端设备的安全能力信息,该第一终端设备的安全策略信息,该第一终端设备所属用户的信息,该第一终端设备生成的第一随机数,该第一终端设备生成的第二临时公钥,该第一终端设备生成的该第一密钥的标识的M个比特位,该第一终端设备的签名,第一消息验证码;其中,该第一终端设备所属用户的信息包括该第一终端设备的标识和该第一终端设备的PVT和KPAK;该第一终端设备的签名的输入参数包括以下至少之一:该第一终端设备所属用户的信息,该第二临时公钥,该M个比特位,该第二终端设备的签名;其中,该第一消息通过基于该第一密钥生成的该第一消息验证码进行完整性保护,且该第一消息验证码的输入参数包括以下至少之一:该第一终端设备的安全能力信息,该第一终端设备的安全策略信息,该第一终端设备所属用户的信息,该第 一随机数,该第二临时公钥,该M个比特位,该第一终端设备的签名;In some embodiments, the communication unit 1310 is also configured to receive a first message sent by the first terminal device; wherein the first message includes at least one of the following: security capability information of the first terminal device, the first The security policy information of the terminal device, the information of the user to which the first terminal device belongs, the first random number generated by the first terminal device, the second temporary public key generated by the first terminal device, the M bits of the identification of the first key, the signature of the first terminal device, and the first message verification code; wherein the information of the user to which the first terminal device belongs includes the identification of the first terminal device and the first terminal The PVT and KPAK of the device; the input parameters of the signature of the first terminal device include at least one of the following: the information of the user to which the first terminal device belongs, the second temporary public key, the M bits, the second terminal device signature; wherein the first message is integrity protected by the first message verification code generated based on the first key, and the input parameters of the first message verification code include at least one of the following: the first terminal device The security capability information, the security policy information of the first terminal device, the information of the user to which the first terminal device belongs, the first random number, the second temporary public key, the M bits, the first terminal device's sign;
在该第一终端设备的KPAK有效,且基于该第一终端设备的标识和该第一终端设备的PVT对该第一终端设备的签名验证成功的情况下,该通信单元1310还用于向该第二终端设备发送验证之后的第一消息;其中,该验证之后的第一消息包括以下至少之一:该第一终端设备的安全能力信息,该第一终端设备的安全策略信息,该第一终端设备所属用户的信息,该中继设备所属用户的信息,该第一终端设备生成的第一随机数,该第一终端设备生成的与该第二临时私钥配对的第二临时公钥,该第一终端设备生成的该第一密钥的标识的M个比特位,该第一终端设备的签名,该中继设备的签名,该第一消息验证码;其中,该中继设备所属用户的信息包括该中继设备的标识和该中继设备的PVT和KPAK;该中继设备的签名的输入参数包括以下至少之一:该中继设备所属用户的信息,该第一终端设备的签名,该第二终端设备的签名,该验证之后的第一消息;When the KPAK of the first terminal device is valid and the signature verification of the first terminal device based on the identity of the first terminal device and the PVT of the first terminal device is successful, the communication unit 1310 is also used to send a message to the first terminal device. The second terminal device sends the first message after verification; wherein the first message after verification includes at least one of the following: security capability information of the first terminal device, security policy information of the first terminal device, Information about the user to whom the terminal device belongs, information about the user to whom the relay device belongs, the first random number generated by the first terminal device, the second temporary public key generated by the first terminal device and paired with the second temporary private key, M bits of the identification of the first key generated by the first terminal device, the signature of the first terminal device, the signature of the relay device, and the first message verification code; wherein, the user to whom the relay device belongs The information includes the identification of the relay device and the PVT and KPAK of the relay device; the input parameters of the signature of the relay device include at least one of the following: the information of the user to which the relay device belongs, the signature of the first terminal device , the signature of the second terminal device, the first message after the verification;
其中,该第二临时公钥和该中继设备的相关信息用于该第二终端设备派生该第一密钥,该第一随机数、该第一密钥和该第二终端设备生成的第二随机数用于派生第二密钥,该第二密钥用于派生完整性保护密钥和/或机密性保护密钥,该第一密钥的标识由该M个比特位与该第一密钥的标识的另外N个比特位合并得到,M和N均为正整数。Wherein, the second temporary public key and the relevant information of the relay device are used by the second terminal device to derive the first key, the first random number, the first key and the third key generated by the second terminal device. Two random numbers are used to derive a second key. The second key is used to derive an integrity protection key and/or a confidentiality protection key. The identity of the first key is composed of the M bits and the first The other N bits of the key's identifier are combined, and M and N are both positive integers.
在一些实施例中,该通信单元1310还用于将该第二终端设备发送的第二消息转发至该第一终端设备;In some embodiments, the communication unit 1310 is also used to forward the second message sent by the second terminal device to the first terminal device;
其中,该第二消息包括以下至少之一:该第二终端设备生成的该第二随机数,该第二终端设备生成的该第一密钥的标识的N个比特位,该第二终端设备生成的该第二密钥的标识的x个比特位,该第二终端设备选取的安全算法,该第二终端设备选取的安全策略,第二消息验证码;Wherein, the second message includes at least one of the following: the second random number generated by the second terminal device, N bits of the identification of the first key generated by the second terminal device, x bits of the identifier of the generated second key, the security algorithm selected by the second terminal device, the security policy selected by the second terminal device, and the second message verification code;
其中,该第二消息通过基于该第二密钥生成的该第二消息验证码进行完整性保护,或者,该第二消息通过基于该第二密钥派生的完整性保护密钥生成的该第二消息验证码进行完整性保护,且该第二消息验证码的输入参数包括以下至少之一:该第二随机数,该N个比特位,该x个比特位,该第二终端设备选取的安全算法,该第二终端设备选取的安全策略;其中,该第二密钥的标识由该x个比特位与该第二密钥的标识的另外y个比特位合并得到,x和y均为正整数。Wherein, the second message is integrity protected through the second message verification code generated based on the second key, or the second message is integrity protected through the third integrity protection key generated based on the second key. The second message verification code performs integrity protection, and the input parameters of the second message verification code include at least one of the following: the second random number, the N bits, the x bits, and the second terminal device selected Security algorithm, the security policy selected by the second terminal device; wherein, the identity of the second key is obtained by combining the x bits and the other y bits of the identity of the second key, x and y are both Positive integer.
在一些实施例中,该第二消息通过该第一密钥进行加密,或者,该第二消息不用于该第一密钥进行加密。In some embodiments, the second message is encrypted with the first key, or the second message is not encrypted with the first key.
在一些实施例中,该第一消息为认证响应消息,该第二消息为安全模式命令消息。In some embodiments, the first message is an authentication response message, and the second message is a safe mode command message.
在一些实施例中,该第一消息为安全模式命令消息,该第二消息为安全模式响应消息。In some embodiments, the first message is a safe mode command message, and the second message is a safe mode response message.
在一些实施例中,该通信单元1310还用于将该第一终端设备发送的第三消息转发至该第二终端设备;In some embodiments, the communication unit 1310 is also used to forward the third message sent by the first terminal device to the second terminal device;
其中,该第三消息用于指示安全模式建立完成,该第三消息通过目标密钥进行加密,且该第三消息包括以下至少之一:该第一终端设备生成的该第二密钥的标识的y个比特位,第三消息验证码;Wherein, the third message is used to indicate that the security mode establishment is completed, the third message is encrypted by the target key, and the third message includes at least one of the following: the identification of the second key generated by the first terminal device y bits, the third message verification code;
其中,该目标密钥包括以下之一:该第一密钥,该第二密钥,该第二密钥派生的机密性保护密钥;Wherein, the target key includes one of the following: the first key, the second key, and a confidentiality protected key derived from the second key;
其中,该第三消息通过基于该第二密钥生成的该第三消息验证码进行完整性保护,或者,该第三消息通过基于该第二密钥派生的完整性保护密钥生成的该第三消息验证码进行完整性保护,该第三消息验证码的输入参数包括该y个比特位。Wherein, the third message is integrity protected through the third message verification code generated based on the second key, or the third message is integrity protected through the third message verification code generated based on the integrity protection key derived based on the second key. The three-message verification code performs integrity protection, and the input parameters of the third message verification code include the y bits.
在一些实施例中,该通信单元1310还用于将该第二终端设备发送的错误消息转发至该第一终端设备;其中,该错误消息包括以下至少之一:原因信息,第四消息验证码;其中,该原因信息用于指示该第二终端设备与该第一终端设备的安全策略冲突,或者,该原因信息用于指示该第一消息验证码验证失败,或者,该原因信息用于指示该第二终端设备与该第一终端设备的安全算法协商失败;该第四消息验证码的输入参数包括以下至少之一:该原因信息。In some embodiments, the communication unit 1310 is also used to forward the error message sent by the second terminal device to the first terminal device; wherein the error message includes at least one of the following: cause information, fourth message verification code ; Wherein, the reason information is used to indicate that the security policy of the second terminal device conflicts with the first terminal device, or the reason information is used to indicate that the first message verification code verification fails, or the reason information is used to indicate The security algorithm negotiation between the second terminal device and the first terminal device fails; the input parameters of the fourth message verification code include at least one of the following: the reason information.
在一些实施例中,该完整性保护密钥包括控制面的完整性保护密钥和用户面的完整性保护密钥;和/或,该机密性保护密钥包括控制面的机密性保护密钥和用户面的机密性保护密钥。In some embodiments, the integrity protection key includes an integrity protection key for the control plane and an integrity protection key for the user plane; and/or the confidentiality protection key includes a confidentiality protection key for the control plane. and user plane confidentiality protecting keys.
在一些实施例中,上述通信单元可以是通信接口或收发器,或者是通信芯片或者片上系统的输入输出接口。In some embodiments, the above-mentioned communication unit may be a communication interface or transceiver, or an input/output interface of a communication chip or a system on a chip.
应理解,根据本申请实施例的终端设备1300可对应于本申请方法实施例中的中继设备,并且终端设备1300中的各个单元的上述和其它操作和/或功能分别为了实现图10所示方法400中中继设备的相应流程,为了简洁,在此不再赘述。It should be understood that the terminal device 1300 according to the embodiment of the present application may correspond to the relay device in the method embodiment of the present application, and the above and other operations and/or functions of each unit in the terminal device 1300 are respectively intended to implement what is shown in Figure 10 The corresponding process of the relay device in method 400 will not be described again for the sake of simplicity.
图26示出了根据本申请实施例的终端设备1400的示意性框图。该终端设备1400为第一终端设备,如图26所示,该终端设备1400包括:Figure 26 shows a schematic block diagram of a terminal device 1400 according to an embodiment of the present application. The terminal device 1400 is a first terminal device. As shown in Figure 26, the terminal device 1400 includes:
通信单元1410,用于通过中继设备向第二终端设备发送第一消息;Communication unit 1410, configured to send the first message to the second terminal device through the relay device;
其中,该第一消息包括以下至少之一:该第一终端设备的安全能力信息,该第一终端设备的安全 策略信息,该第一终端设备所属用户的信息,该第一终端设备生成的第一随机数,该第一终端设备生成的第二临时公钥,该第一终端设备生成的第一密钥的标识的M个比特位,该第一终端设备的签名,第一消息验证码;Wherein, the first message includes at least one of the following: security capability information of the first terminal device, security policy information of the first terminal device, information of the user to which the first terminal device belongs, a third message generated by the first terminal device. A random number, the second temporary public key generated by the first terminal device, M bits of the identification of the first key generated by the first terminal device, the signature of the first terminal device, and the first message verification code;
其中,该第一终端设备所属用户的信息包括该第一终端设备的标识和该第一终端设备的公共验证令牌PVT和密钥管理服务器的公共认证密钥KPAK;该第一终端设备的签名的输入参数包括以下至少之一:该第一终端设备所属用户的信息,该第二临时公钥,该M个比特位,该第二终端设备的签名;Wherein, the information of the user to which the first terminal device belongs includes the identification of the first terminal device, the public verification token PVT of the first terminal device and the public authentication key KPAK of the key management server; the signature of the first terminal device The input parameters include at least one of the following: information about the user to which the first terminal device belongs, the second temporary public key, the M bits, and the signature of the second terminal device;
其中,该第一消息通过基于该第一密钥生成的该第一消息验证码进行完整性保护,且该第一消息验证码的输入参数包括以下至少之一:该第一终端设备的安全能力信息,该第一终端设备的安全策略信息,该第一终端设备所属用户的信息,该第一随机数,该第二临时公钥,该M个比特位,该第一终端设备的签名;Wherein, the first message is integrity protected by the first message verification code generated based on the first key, and the input parameters of the first message verification code include at least one of the following: the security capability of the first terminal device Information, the security policy information of the first terminal device, the information of the user to which the first terminal device belongs, the first random number, the second temporary public key, the M bits, and the signature of the first terminal device;
其中,该第二临时公钥和该中继设备的相关信息用于该第二终端设备派生该第一密钥,该第一随机数、该第一密钥和该第二终端设备生成的第二随机数用于派生第二密钥,该第二密钥用于派生完整性保护密钥和/或机密性保护密钥,该第一密钥的标识由该M个比特位与该第一密钥的标识的另外N个比特位合并得到,M和N均为正整数;Wherein, the second temporary public key and the relevant information of the relay device are used by the second terminal device to derive the first key, the first random number, the first key and the third key generated by the second terminal device. Two random numbers are used to derive a second key. The second key is used to derive an integrity protection key and/or a confidentiality protection key. The identity of the first key is composed of the M bits and the first The other N bits of the key's identification are combined, and M and N are both positive integers;
其中,该中继设备的相关信息包括以下之一:该中继设备的身份信息,该中继设备生成的随机数,该中继设备生成的计数器。The relevant information of the relay device includes one of the following: identity information of the relay device, a random number generated by the relay device, and a counter generated by the relay device.
在一些实施例中,该通信单元1410还用于接收该第二终端设备通过该中继设备发送的第二消息;In some embodiments, the communication unit 1410 is also used to receive the second message sent by the second terminal device through the relay device;
其中,该第二消息包括以下至少之一:该第二终端设备生成的该第二随机数,该第二终端设备生成的该第一密钥的标识的N个比特位,该第二终端设备生成的该第二密钥的标识的x个比特位,该第二终端设备选取的安全算法,该第二终端设备选取的安全策略,第二消息验证码;Wherein, the second message includes at least one of the following: the second random number generated by the second terminal device, N bits of the identification of the first key generated by the second terminal device, x bits of the identifier of the generated second key, the security algorithm selected by the second terminal device, the security policy selected by the second terminal device, and the second message verification code;
其中,该第二消息通过基于该第二密钥生成的该第二消息验证码进行完整性保护,或者,该第二消息通过基于该第二密钥派生的完整性保护密钥生成的该第二消息验证码进行完整性保护,且该第二消息验证码的输入参数包括以下至少之一:该第二随机数,该N个比特位,该x个比特位,该第二终端设备选取的安全算法,该第二终端设备选取的安全策略;其中,该第二密钥的标识由该x个比特位与该第二密钥的标识的另外y个比特位合并得到,x和y均为正整数。Wherein, the second message is integrity protected through the second message verification code generated based on the second key, or the second message is integrity protected through the third integrity protection key generated based on the second key. The second message verification code performs integrity protection, and the input parameters of the second message verification code include at least one of the following: the second random number, the N bits, the x bits, and the second terminal device selected Security algorithm, the security policy selected by the second terminal device; wherein, the identity of the second key is obtained by combining the x bits and the other y bits of the identity of the second key, x and y are both Positive integer.
在一些实施例中,该第二消息通过该第一密钥进行加密,或者,该第二消息不用于该第一密钥进行加密。In some embodiments, the second message is encrypted with the first key, or the second message is not encrypted with the first key.
在一些实施例中,该终端设备1400还包括:处理单元1420;In some embodiments, the terminal device 1400 further includes: a processing unit 1420;
在该第二消息中携带的信息未遭受篡改的情况下,该处理单元1420用于至少根据该第一随机数、该第一密钥和该第二随机数生成该第二密钥,该处理单元1420还用于根据该第二密钥生成完整性保护密钥和/或机密性保护密钥,以及该处理单元1420还用于将该M个比特位和该N个比特位合并得到该第一密钥的标识,该处理单元1420还用于生成该第二密钥的标识的y个比特位,并将该x个比特位和该y个比特位合并得到该第二密钥的标识;If the information carried in the second message has not been tampered with, the processing unit 1420 is configured to generate the second key based on at least the first random number, the first key and the second random number. The unit 1420 is further configured to generate an integrity protection key and/or a confidentiality protection key according to the second key, and the processing unit 1420 is further configured to combine the M bits and the N bits to obtain the first An identifier of a key, the processing unit 1420 is also used to generate y bits of the identifier of the second key, and combine the x bits and the y bits to obtain the identifier of the second key;
在该第二消息验证码有效的情况下,该处理单元1420还用于根据该第二终端设备选取的安全算法、该第二密钥、基于该第二密钥生成完整性保护密钥和/或机密性保护密钥、该第二终端设备选取的安全策略,与该第二终端设备进行通信。If the second message verification code is valid, the processing unit 1420 is also configured to generate an integrity protection key based on the second key and/or the security algorithm selected by the second terminal device and the second key. Or the confidentiality protection key and the security policy selected by the second terminal device are used to communicate with the second terminal device.
在一些实施例中,该处理单元1420还用于根据该第一密钥解密该第二消息;In some embodiments, the processing unit 1420 is also configured to decrypt the second message according to the first key;
在该第二消息中携带的信息未遭受篡改的情况下,该处理单元1420还用于至少根据该第一随机数、该第一密钥和该第二随机数生成该第二密钥,该处理单元1420还用于根据该第二密钥生成完整性保护密钥和/或机密性保护密钥,以及该处理单元1420还用于将该M个比特位和该N个比特位合并得到该第一密钥的标识,该处理单元1420还用于生成该第二密钥的标识的y个比特位,并将该x个比特位和该y个比特位合并得到该第二密钥的标识;If the information carried in the second message has not been tampered with, the processing unit 1420 is also configured to generate the second key based on at least the first random number, the first key and the second random number. The processing unit 1420 is further configured to generate an integrity protection key and/or a confidentiality protection key according to the second key, and the processing unit 1420 is further configured to combine the M bits and the N bits to obtain the The processing unit 1420 is also used to generate y bits of the identity of the second key, and combine the x bits and the y bits to obtain the identity of the second key. ;
在该第二消息验证码有效的情况下,该处理单元1420还用于根据该第二终端设备选取的安全算法、该第二密钥、基于该第二密钥生成完整性保护密钥和/或机密性保护密钥、该第二终端设备选取的安全策略,与该第二终端设备进行通信。If the second message verification code is valid, the processing unit 1420 is also configured to generate an integrity protection key based on the second key and/or the security algorithm selected by the second terminal device and the second key. Or the confidentiality protection key and the security policy selected by the second terminal device are used to communicate with the second terminal device.
在一些实施例中,该完整性保护密钥的输入参数包括以下至少之一:该第二密钥,选定的算法类型标识符,选定的算法类型标识符的长度,完整性保护算法标识,完整性保护算法标识的长度;和/或,该机密性保护密钥的输入参数包括以下至少之一:该第二密钥,选定的算法类型标识符,选定的算法类型标识符的长度,机密性保护算法标识,机密性保护算法标识的长度。In some embodiments, the input parameters of the integrity protection key include at least one of the following: the second key, the selected algorithm type identifier, the length of the selected algorithm type identifier, and the integrity protection algorithm identifier. , the length of the integrity protection algorithm identifier; and/or, the input parameters of the confidentiality protection key include at least one of the following: the second key, the selected algorithm type identifier, the selected algorithm type identifier Length, confidentiality protection algorithm identifier, length of the confidentiality protection algorithm identifier.
在一些实施例中,该第一消息为认证响应消息,该第二消息为安全模式命令消息。In some embodiments, the first message is an authentication response message, and the second message is a safe mode command message.
在一些实施例中,该第一消息为安全模式命令消息,该第二消息为安全模式响应消息。In some embodiments, the first message is a safe mode command message, and the second message is a safe mode response message.
在一些实施例中,该通信单元1410还用于通过该中继设备向该第二终端设备发送第三消息;In some embodiments, the communication unit 1410 is also used to send a third message to the second terminal device through the relay device;
其中,该第三消息用于指示安全模式建立完成,该第三消息通过目标密钥进行加密,且该第三消息包括以下至少之一:该第二密钥的标识的该y个比特位,第三消息验证码;Wherein, the third message is used to indicate that the security mode establishment is completed, the third message is encrypted by the target key, and the third message includes at least one of the following: the y bits of the identification of the second key, Third message verification code;
其中,该目标密钥包括以下之一:该第一密钥,该第二密钥,该第二密钥派生的机密性保护密钥;Wherein, the target key includes one of the following: the first key, the second key, and a confidentiality protected key derived from the second key;
其中,该第三消息通过基于该第二密钥生成的该第三消息验证码进行完整性保护,或者,该第三消息通过基于该第二密钥派生的完整性保护密钥生成的该第三消息验证码进行完整性保护,该第三消息验证码的输入参数包括该y个比特位。Wherein, the third message is integrity protected through the third message verification code generated based on the second key, or the third message is integrity protected through the third message verification code generated based on the integrity protection key derived based on the second key. The three-message verification code performs integrity protection, and the input parameters of the third message verification code include the y bits.
在一些实施例中,该通信单元1410还用于接收该第二终端设备通过该中继设备发送的错误消息;其中,该错误消息包括以下至少之一:原因信息,第四消息验证码;其中,该原因信息用于指示该第二终端设备与该第一终端设备的安全策略冲突,或者,该原因信息用于指示该第一消息验证码验证失败,或者,该原因信息用于指示该第二终端设备与该第一终端设备的安全算法协商失败,该第四消息验证码的输入参数包括以下至少之一:该原因信息;In some embodiments, the communication unit 1410 is also used to receive an error message sent by the second terminal device through the relay device; wherein the error message includes at least one of the following: cause information, a fourth message verification code; wherein , the reason information is used to indicate that the security policy of the second terminal device conflicts with the first terminal device, or the reason information is used to indicate that the first message verification code verification fails, or the reason information is used to indicate that the third The security algorithm negotiation between the second terminal device and the first terminal device fails, and the input parameters of the fourth message verification code include at least one of the following: the reason information;
在该第四消息验证码有效的情况下,该处理单元1420还用于确定安全模式建立失败,和/或,该处理单元1420还用于重新发起安全模式建立流程。If the fourth message verification code is valid, the processing unit 1420 is also configured to determine that the security mode establishment fails, and/or, the processing unit 1420 is also configured to reinitiate the security mode establishment process.
在一些实施例中,该完整性保护密钥包括控制面的完整性保护密钥和用户面的完整性保护密钥;和/或,该机密性保护密钥包括控制面的机密性保护密钥和用户面的机密性保护密钥。In some embodiments, the integrity protection key includes an integrity protection key for the control plane and an integrity protection key for the user plane; and/or the confidentiality protection key includes a confidentiality protection key for the control plane. and user plane confidentiality protecting keys.
在一些实施例中,该通信单元1410还用于接收该第二终端设备通过该中继设备发送的认证请求消息;In some embodiments, the communication unit 1410 is also configured to receive an authentication request message sent by the second terminal device through the relay device;
其中,该认证请求消息包括以下至少之一:该第二终端设备所属用户的信息,该中继设备所属用户的信息,该第二终端设备生成的第一临时公钥,该第二终端设备的签名,该中继设备的签名,该中继设备的相关信息;The authentication request message includes at least one of the following: information about the user to which the second terminal device belongs, information about the user to which the relay device belongs, the first temporary public key generated by the second terminal device, Signature, the signature of the relay device, and relevant information of the relay device;
其中,该第二终端设备所属用户的信息包括该第二终端设备的标识和该第二终端设备的公共验证令牌PVT和密钥管理服务器的公共认证密钥KPAK;该中继设备所属用户的信息包括该中继设备的标识和该中继设备的PVT和KPAK;该第二终端设备的签名的输入参数包括以下至少之一:该第二终端设备所属用户的信息和该第一临时公钥;该中继设备的签名的输入参数包括以下至少之一:该第二终端设备的签名和该中继设备所属用户的信息;该第一临时公钥和该中继设备的相关信息用于该第一终端设备派生该第一密钥。Wherein, the information of the user to which the second terminal device belongs includes the identification of the second terminal device, the public verification token PVT of the second terminal device and the public authentication key KPAK of the key management server; The information includes the identification of the relay device and the PVT and KPAK of the relay device; the input parameters of the signature of the second terminal device include at least one of the following: information of the user to which the second terminal device belongs and the first temporary public key. ; The input parameters of the relay device's signature include at least one of the following: the signature of the second terminal device and the information of the user to which the relay device belongs; the first temporary public key and the relevant information of the relay device are used for the The first terminal device derives the first key.
在一些实施例中,该第二终端设备的签名由该第二终端设备的秘密签名密钥生成,和/或,该中继设备的签名由该中继设备的秘密签名密钥生成。In some embodiments, the signature of the second terminal device is generated by the secret signature key of the second terminal device, and/or the signature of the relay device is generated by the secret signature key of the relay device.
在一些实施例中,在该第二终端设备的KPAK和该中继设备的KPAK有效,且基于该第二终端设备的标识和该第二终端设备的PVT对该第二终端设备的签名验证成功,以及基于该中继设备的标识和该中继设备的PVT对该中继设备的签名验证成功的情况下,该处理单元1420还用于生成与该第二临时公钥配对的第二临时私钥,以及该处理单元1420还用于根据该第一临时公钥、该中继设备的相关信息和该第二临时私钥派生该第一密钥。In some embodiments, the KPAK of the second terminal device and the KPAK of the relay device are valid, and the signature verification of the second terminal device based on the identity of the second terminal device and the PVT of the second terminal device is successful. , and if the signature verification of the relay device based on the identity of the relay device and the PVT of the relay device is successful, the processing unit 1420 is also configured to generate a second temporary private key paired with the second temporary public key. key, and the processing unit 1420 is also configured to derive the first key according to the first temporary public key, the relevant information of the relay device, and the second temporary private key.
在一些实施例中,上述通信单元可以是通信接口或收发器,或者是通信芯片或者片上系统的输入输出接口。上述处理单元可以是一个或多个处理器。In some embodiments, the above-mentioned communication unit may be a communication interface or transceiver, or an input/output interface of a communication chip or a system on a chip. The above-mentioned processing unit may be one or more processors.
应理解,根据本申请实施例的终端设备1400可对应于本申请方法实施例中的第一终端设备,并且终端设备1400中的各个单元的上述和其它操作和/或功能分别为了实现图11所示方法500中第一终端设备的相应流程,为了简洁,在此不再赘述。It should be understood that the terminal device 1400 according to the embodiment of the present application may correspond to the first terminal device in the method embodiment of the present application, and the above and other operations and/or functions of each unit in the terminal device 1400 are respectively to implement the functions shown in Figure 11 The corresponding process of the first terminal device in method 500 is shown, and for the sake of simplicity, it will not be described again here.
图27示出了根据本申请实施例的终端设备1500的示意性框图。该终端设备1500为第二终端设备,如图27所示,该终端设备1500包括:Figure 27 shows a schematic block diagram of a terminal device 1500 according to an embodiment of the present application. The terminal device 1500 is a second terminal device. As shown in Figure 27, the terminal device 1500 includes:
通信单元1510,用于接收第一终端设备通过中继设备发送的第一消息;Communication unit 1510, configured to receive the first message sent by the first terminal device through the relay device;
其中,该第一消息包括以下至少之一:该第一终端设备的安全能力信息,该第一终端设备的安全策略信息,该第一终端设备所属用户的信息,该中继设备所属用户的信息,该第一终端设备生成的第一随机数,该第一终端设备生成的第二临时公钥,该第一终端设备生成的第一密钥的标识的M个比特位,该第一终端设备的签名,该中继设备的签名,第一消息验证码;Wherein, the first message includes at least one of the following: security capability information of the first terminal device, security policy information of the first terminal device, information of the user to which the first terminal device belongs, and information of the user to which the relay device belongs. , the first random number generated by the first terminal device, the second temporary public key generated by the first terminal device, the M bits of the identification of the first key generated by the first terminal device, the first terminal device signature, the signature of the relay device, and the first message verification code;
其中,该第一终端设备所属用户的信息包括该第一终端设备的标识和该第一终端设备的公共验证令牌PVT和密钥管理服务器的公共认证密钥KPAK;该中继设备所属用户的信息包括该中继设备的标识和该中继设备的PVT和KPAK;该第一终端设备的签名的输入参数包括以下至少之一:该第一终端设备所属用户的信息,该第二临时公钥,该M个比特位,该第二终端设备的签名;该中继设备的签名的输入参数包括以下至少之一:该中继设备所属用户的信息,该第一终端设备的签名,该第二终端设备的签名,该第一消息;The information of the user to which the first terminal device belongs includes the identification of the first terminal device, the public verification token PVT of the first terminal device and the public authentication key KPAK of the key management server; The information includes the identification of the relay device and the PVT and KPAK of the relay device; the input parameters of the signature of the first terminal device include at least one of the following: information of the user to which the first terminal device belongs, the second temporary public key , the M bits, the signature of the second terminal device; the input parameters of the relay device's signature include at least one of the following: information about the user to which the relay device belongs, the signature of the first terminal device, the second The signature of the terminal device, the first message;
其中,该第一消息通过基于该第一密钥生成的该第一消息验证码进行完整性保护,且该第一消息验证码的输入参数包括以下至少之一:该第一终端设备的安全能力信息,该第一终端设备的安全策略信息,该第一终端设备所属用户的信息,该第一随机数,该第二临时公钥,该M个比特位,该第一终端设备的签名;Wherein, the first message is integrity protected by the first message verification code generated based on the first key, and the input parameters of the first message verification code include at least one of the following: the security capability of the first terminal device Information, the security policy information of the first terminal device, the information of the user to which the first terminal device belongs, the first random number, the second temporary public key, the M bits, and the signature of the first terminal device;
其中,该第二临时公钥和该中继设备的相关信息用于该第二终端设备派生该第一密钥,该第一随机数、该第一密钥和该第二终端设备生成的第二随机数用于派生第二密钥,该第二密钥用于派生完整性保护密钥和/或机密性保护密钥,该第一密钥的标识由该M个比特位与该第一密钥的标识的另外N个比特位合并得到,M和N均为正整数;Wherein, the second temporary public key and the relevant information of the relay device are used by the second terminal device to derive the first key, the first random number, the first key and the third key generated by the second terminal device. Two random numbers are used to derive a second key. The second key is used to derive an integrity protection key and/or a confidentiality protection key. The identity of the first key is composed of the M bits and the first The other N bits of the key's identification are combined, and M and N are both positive integers;
其中,该中继设备的相关信息包括以下之一:该中继设备的身份信息,该中继设备生成的随机数,该中继设备生成的计数器。The relevant information of the relay device includes one of the following: identity information of the relay device, a random number generated by the relay device, and a counter generated by the relay device.
在一些实施例中,该第一终端设备的签名由该第一终端设备的秘密签名密钥生成,和/或,该中继设备的签名由该中继设备的秘密签名密钥生成。In some embodiments, the signature of the first terminal device is generated by the secret signature key of the first terminal device, and/or the signature of the relay device is generated by the secret signature key of the relay device.
在一些实施例中,该终端设备1500还包括:处理单元1520;In some embodiments, the terminal device 1500 further includes: a processing unit 1520;
该处理单元1520用于分别检查该第一终端设备的KPAK和该中继设备的KPAK,在该第一终端设备的KPAK和该中继设备的KPAK有效的情况下,且该处理单元1520还用于基于该第一终端设备的标识和该第一终端设备的PVT对该第一终端设备的签名进行验证,以及该处理单元1520还用于基于该中继设备的标识和该中继设备的PVT对该中继设备的签名进行验证;The processing unit 1520 is configured to check the KPAK of the first terminal device and the KPAK of the relay device respectively. When the KPAK of the first terminal device and the KPAK of the relay device are valid, the processing unit 1520 also uses Verifying the signature of the first terminal device based on the identity of the first terminal device and the PVT of the first terminal device, and the processing unit 1520 is also configured to verify the signature of the first terminal device based on the identity of the relay device and the PVT of the relay device. Verify the signature of the relay device;
在该第一终端设备的签名和该中继设备的签名验证成功,且该第一消息中携带的信息未遭受篡改的情况下,该处理单元1520还用于生成第二随机数,该处理单元1520还用于至少根据该第一随机数、该第一密钥和该第二随机数生成该第二密钥,该处理单元1520还用于根据该第二密钥生成完整性保护密钥和/或机密性保护密钥,以及该处理单元1520还用于生成该第一密钥的标识的N个比特位,并将该M个比特位和该N个比特位合并得到该第一密钥的标识;When the signature of the first terminal device and the signature of the relay device are successfully verified, and the information carried in the first message has not been tampered with, the processing unit 1520 is also configured to generate a second random number. 1520 is also configured to generate the second key based on at least the first random number, the first key and the second random number. The processing unit 1520 is also configured to generate an integrity protection key based on the second key. /or confidentiality protection key, and the processing unit 1520 is also used to generate N bits of the identification of the first key, and combine the M bits and the N bits to obtain the first key logo;
在该第一消息验证码有效的情况下,该通信单元1510还用于通过该中继设备向该第一终端设备发送第二消息;其中,该第二消息包括以下至少之一:该第二随机数,该N个比特位,该第二终端设备生成的该第二密钥的标识的x个比特位,该第二终端设备选取的安全算法,该第二终端设备选取的安全策略,第二消息验证码;When the first message verification code is valid, the communication unit 1510 is also configured to send a second message to the first terminal device through the relay device; wherein the second message includes at least one of the following: the second The random number, the N bits, the x bits of the identifier of the second key generated by the second terminal device, the security algorithm selected by the second terminal device, the security policy selected by the second terminal device, the Two message verification code;
其中,该第二消息通过基于该第二密钥生成的该第二消息验证码进行完整性保护,或者,该第二消息通过基于该第二密钥派生的完整性保护密钥生成的该第二消息验证码进行完整性保护,且该第二消息验证码的输入参数包括以下至少之一:该第二随机数,该N个比特位,该x个比特位,该第二终端设备选取的安全算法,该第二终端设备选取的安全策略;其中,该第二密钥的标识由该x个比特位与该第二密钥的标识的另外y个比特位合并得到,x和y均为正整数。Wherein, the second message is integrity protected through the second message verification code generated based on the second key, or the second message is integrity protected through the third integrity protection key generated based on the second key. The second message verification code performs integrity protection, and the input parameters of the second message verification code include at least one of the following: the second random number, the N bits, the x bits, and the second terminal device selected Security algorithm, the security policy selected by the second terminal device; wherein, the identity of the second key is obtained by combining the x bits and the other y bits of the identity of the second key, x and y are both Positive integer.
在一些实施例中,该第二消息通过该第一密钥进行加密,或者,该第二消息不用于该第一密钥进行加密。In some embodiments, the second message is encrypted with the first key, or the second message is not encrypted with the first key.
在一些实施例中,该第一消息为认证响应消息,该第二消息为安全模式命令消息。In some embodiments, the first message is an authentication response message, and the second message is a safe mode command message.
在一些实施例中,该第一消息为安全模式命令消息,该第二消息为安全模式响应消息。In some embodiments, the first message is a safe mode command message, and the second message is a safe mode response message.
在一些实施例中,该完整性保护密钥的输入参数包括以下至少之一:该第二密钥,选定的算法类型标识符,选定的算法类型标识符的长度,完整性保护算法标识,完整性保护算法标识的长度;和/或,该机密性保护密钥的输入参数包括以下至少之一:该第二密钥,选定的算法类型标识符,选定的算法类型标识符的长度,机密性保护算法标识,机密性保护算法标识的长度。In some embodiments, the input parameters of the integrity protection key include at least one of the following: the second key, the selected algorithm type identifier, the length of the selected algorithm type identifier, and the integrity protection algorithm identifier. , the length of the integrity protection algorithm identifier; and/or, the input parameters of the confidentiality protection key include at least one of the following: the second key, the selected algorithm type identifier, the selected algorithm type identifier Length, confidentiality protection algorithm identifier, length of the confidentiality protection algorithm identifier.
在一些实施例中,该通信单元1510还用于接收该第一终端设备通过该中继设备发送的第三消息;In some embodiments, the communication unit 1510 is also configured to receive a third message sent by the first terminal device through the relay device;
其中,该第三消息用于指示安全模式建立完成,该第三消息通过目标密钥进行加密,且该第三消息包括以下至少之一:该第一终端设备生成的该第二密钥的标识的y个比特位,第三消息验证码;Wherein, the third message is used to indicate that the security mode establishment is completed, the third message is encrypted by the target key, and the third message includes at least one of the following: the identification of the second key generated by the first terminal device y bits, the third message verification code;
其中,该目标密钥包括以下之一:该第一密钥,该第二密钥,该第二密钥派生的机密性保护密钥;Wherein, the target key includes one of the following: the first key, the second key, and a confidentiality protected key derived from the second key;
其中,该第三消息通过基于该第二密钥生成的该第三消息验证码进行完整性保护,或者,该第三消息通过基于该第二密钥派生的完整性保护密钥生成的该第三消息验证码进行完整性保护,该第三消息验证码的输入参数包括该y个比特位。Wherein, the third message is integrity protected through the third message verification code generated based on the second key, or the third message is integrity protected through the third message verification code generated based on the integrity protection key derived based on the second key. The three-message verification code performs integrity protection, and the input parameters of the third message verification code include the y bits.
在一些实施例中,该处理单元1520还用于通过该目标密钥对该第三消息进行解密;In some embodiments, the processing unit 1520 is also configured to decrypt the third message using the target key;
在该第三消息中携带的信息未遭受篡改的情况下,且该第三消息验证码有效的情况下,该处理单元1520还用于将该x个比特位与该y个比特位合并得到该第二密钥的标识。When the information carried in the third message has not been tampered with and the third message verification code is valid, the processing unit 1520 is also configured to combine the x bits and the y bits to obtain the The identifier of the second key.
在一些实施例中,该通信单元1510还用于通过该中继设备向该第一终端设备发送错误消息;其中,该错误消息包括以下至少之一:原因信息,第四消息验证码;其中,该原因信息用于指示该第二终端设备与该第一终端设备的安全策略冲突,或者,该原因信息用于指示该第一消息验证码验证失败, 或者,该原因信息用于指示该第二终端设备与该第一终端设备的安全算法协商失败,该第四消息验证码的输入参数包括以下至少之一:该原因信息。In some embodiments, the communication unit 1510 is also configured to send an error message to the first terminal device through the relay device; wherein the error message includes at least one of the following: cause information, a fourth message verification code; wherein, The reason information is used to indicate that the security policy of the second terminal device conflicts with the first terminal device, or the reason information is used to indicate that the first message verification code verification fails, or the reason information is used to indicate that the second terminal device The security algorithm negotiation between the terminal device and the first terminal device fails, and the input parameters of the fourth message verification code include at least one of the following: the reason information.
在一些实施例中,该完整性保护密钥包括控制面的完整性保护密钥和用户面的完整性保护密钥;和/或,该机密性保护密钥包括控制面的机密性保护密钥和用户面的机密性保护密钥。In some embodiments, the integrity protection key includes an integrity protection key for the control plane and an integrity protection key for the user plane; and/or the confidentiality protection key includes a confidentiality protection key for the control plane. and user plane confidentiality protecting keys.
在一些实施例中,该通信单元1510还用于通过该中继设备向该第一终端设备发送认证请求消息;In some embodiments, the communication unit 1510 is also configured to send an authentication request message to the first terminal device through the relay device;
其中,该认证请求消息包括以下至少之一:该第二终端设备所属用户的信息,该第二终端设备生成的第一临时公钥,该第二终端设备的签名,该中继设备的相关信息;The authentication request message includes at least one of the following: information about the user to which the second terminal device belongs, the first temporary public key generated by the second terminal device, the signature of the second terminal device, and relevant information about the relay device. ;
其中,该第二终端设备所属用户的信息包括该第二终端设备的标识和该第二终端设备的PVT和KPAK;该第二终端设备的签名的输入参数包括以下至少之一:该第二终端设备所属用户的信息和该第一临时公钥;该第一临时公钥和该中继设备的相关信息用于该第一终端设备派生第一密钥。Wherein, the information of the user to which the second terminal device belongs includes the identification of the second terminal device and the PVT and KPAK of the second terminal device; the input parameters of the signature of the second terminal device include at least one of the following: the second terminal The information of the user to which the device belongs and the first temporary public key; the first temporary public key and the relevant information of the relay device are used for the first terminal device to derive the first key.
在一些实施例中,该第二终端设备的签名由该第二终端设备的秘密签名密钥生成。In some embodiments, the signature of the second terminal device is generated by the secret signature key of the second terminal device.
在一些实施例中,上述通信单元可以是通信接口或收发器,或者是通信芯片或者片上系统的输入输出接口。上述处理单元可以是一个或多个处理器。In some embodiments, the above-mentioned communication unit may be a communication interface or transceiver, or an input/output interface of a communication chip or a system on a chip. The above-mentioned processing unit may be one or more processors.
应理解,根据本申请实施例的终端设备1500可对应于本申请方法实施例中的第二终端设备,并且终端设备1500中的各个单元的上述和其它操作和/或功能分别为了实现图12所示方法600中第二终端设备的相应流程,为了简洁,在此不再赘述。It should be understood that the terminal device 1500 according to the embodiment of the present application may correspond to the second terminal device in the method embodiment of the present application, and the above and other operations and/or functions of each unit in the terminal device 1500 are respectively to implement the functions shown in Figure 12 The corresponding process of the second terminal device in method 600 is shown, and for the sake of simplicity, it will not be described again here.
图28示出了根据本申请实施例的终端设备1600的示意性框图。该终端设备1600为中继设备,如图28所示,该终端设备1600包括:Figure 28 shows a schematic block diagram of a terminal device 1600 according to an embodiment of the present application. The terminal device 1600 is a relay device. As shown in Figure 28, the terminal device 1600 includes:
通信单元1610,用于接收第一终端设备发送的第一消息;其中,该第一消息包括以下至少之一:该第一终端设备的安全能力信息,该第一终端设备的安全策略信息,该第一终端设备所属用户的信息,该第一终端设备生成的第一随机数,该第一终端设备生成的第二临时公钥,该第一终端设备生成的第一密钥的标识的M个比特位,该第一终端设备的签名,第一消息验证码;其中,该第一终端设备所属用户的信息包括该第一终端设备的标识和该第一终端设备的公共验证令牌PVT和密钥管理服务器的公共认证密钥KPAK;该第一终端设备的签名的输入参数包括以下至少之一:该第一终端设备所属用户的信息,该第二临时公钥,该M个比特位,该第二终端设备的签名;其中,该第一消息通过基于该第一密钥生成的该第一消息验证码进行完整性保护,且该第一消息验证码的输入参数包括以下至少之一:该第一终端设备的安全能力信息,该第一终端设备的安全策略信息,该第一终端设备所属用户的信息,该第一随机数,该第二临时公钥,该M个比特位,该第一终端设备的签名;The communication unit 1610 is configured to receive a first message sent by a first terminal device; wherein the first message includes at least one of the following: security capability information of the first terminal device, security policy information of the first terminal device, Information about the user to which the first terminal device belongs, the first random number generated by the first terminal device, the second temporary public key generated by the first terminal device, M identification numbers of the first key generated by the first terminal device bits, the signature of the first terminal device, and the first message verification code; wherein the information of the user to which the first terminal device belongs includes the identification of the first terminal device and the public verification token PVT and password of the first terminal device. The public authentication key KPAK of the key management server; the input parameters of the signature of the first terminal device include at least one of the following: the information of the user to which the first terminal device belongs, the second temporary public key, the M bits, the The signature of the second terminal device; wherein the first message is integrity protected by the first message verification code generated based on the first key, and the input parameters of the first message verification code include at least one of the following: the The security capability information of the first terminal device, the security policy information of the first terminal device, the information of the user to which the first terminal device belongs, the first random number, the second temporary public key, the M bits, the A signature of the terminal device;
在该第一终端设备的KPAK有效,且基于该第一终端设备的标识和该第一终端设备的PVT对该第一终端设备的签名验证成功的情况下,该通信单元1610还用于向该第二终端设备发送验证之后的第一消息;其中,该验证之后的第一消息包括以下至少之一:该第一终端设备的安全能力信息,该第一终端设备的安全策略信息,该第一终端设备所属用户的信息,该中继设备所属用户的信息,该第一终端设备生成的第一随机数,该第一终端设备生成的与该第二临时私钥配对的第二临时公钥,该第一终端设备生成的该第一密钥的标识的M个比特位,该第一终端设备的签名,该中继设备的签名,该中继设备的相关信息,该第一消息验证码;其中,该中继设备所属用户的信息包括该中继设备的标识和该中继设备的PVT和KPAK;该中继设备的签名的输入参数包括以下至少之一:该中继设备所属用户的信息,该第一终端设备的签名,该第二终端设备的签名,该验证之后的第一消息;When the KPAK of the first terminal device is valid and the signature verification of the first terminal device based on the identity of the first terminal device and the PVT of the first terminal device is successful, the communication unit 1610 is also used to send a message to the first terminal device. The second terminal device sends the first message after verification; wherein the first message after verification includes at least one of the following: security capability information of the first terminal device, security policy information of the first terminal device, Information about the user to whom the terminal device belongs, information about the user to whom the relay device belongs, the first random number generated by the first terminal device, the second temporary public key generated by the first terminal device and paired with the second temporary private key, M bits of the identification of the first key generated by the first terminal device, the signature of the first terminal device, the signature of the relay device, the relevant information of the relay device, and the first message verification code; Wherein, the information of the user to which the relay device belongs includes the identification of the relay device and the PVT and KPAK of the relay device; the input parameters of the signature of the relay device include at least one of the following: information of the user to which the relay device belongs. , the signature of the first terminal device, the signature of the second terminal device, the first message after verification;
其中,该第二临时公钥和该中继设备的相关信息用于该第二终端设备派生该第一密钥,该第一随机数、该第一密钥和该第二终端设备生成的第二随机数用于派生第二密钥,该第二密钥用于派生完整性保护密钥和/或机密性保护密钥,该第一密钥的标识由该M个比特位与该第一密钥的标识的另外N个比特位合并得到,M和N均为正整数;其中,该中继设备的相关信息包括以下之一:该中继设备的身份信息,该中继设备生成的随机数,该中继设备生成的计数器。Wherein, the second temporary public key and the relevant information of the relay device are used by the second terminal device to derive the first key, the first random number, the first key and the third key generated by the second terminal device. Two random numbers are used to derive a second key. The second key is used to derive an integrity protection key and/or a confidentiality protection key. The identity of the first key is composed of the M bits and the first The other N bits of the key's identification are combined, and M and N are both positive integers; among them, the relevant information of the relay device includes one of the following: the identity information of the relay device, the random number generated by the relay device. Count, the counter generated by this relay device.
在一些实施例中,该通信单元1610还用于将该第二终端设备发送的第二消息转发至该第一终端设备;In some embodiments, the communication unit 1610 is also used to forward the second message sent by the second terminal device to the first terminal device;
其中,该第二消息包括以下至少之一:该第二终端设备生成的该第二随机数,该第二终端设备生成的该第一密钥的标识的N个比特位,该第二终端设备生成的该第二密钥的标识的x个比特位,该第二终端设备选取的安全算法,该第二终端设备选取的安全策略,第二消息验证码;Wherein, the second message includes at least one of the following: the second random number generated by the second terminal device, N bits of the identification of the first key generated by the second terminal device, x bits of the identifier of the generated second key, the security algorithm selected by the second terminal device, the security policy selected by the second terminal device, and the second message verification code;
其中,该第二消息通过基于该第二密钥生成的该第二消息验证码进行完整性保护,或者,该第二消息通过基于该第二密钥派生的完整性保护密钥生成的该第二消息验证码进行完整性保护,且该第二消息验证码的输入参数包括以下至少之一:该第二随机数,该N个比特位,该x个比特位,该第二终端设备选取的安全算法,该第二终端设备选取的安全策略;其中,该第二密钥的标识由该x个比特位与该第二密钥的标识的另外y个比特位合并得到,x和y均为正整数。Wherein, the second message is integrity protected through the second message verification code generated based on the second key, or the second message is integrity protected through the third integrity protection key generated based on the second key. The second message verification code performs integrity protection, and the input parameters of the second message verification code include at least one of the following: the second random number, the N bits, the x bits, and the second terminal device selected Security algorithm, the security policy selected by the second terminal device; wherein, the identity of the second key is obtained by combining the x bits and the other y bits of the identity of the second key, x and y are both Positive integer.
在一些实施例中,该第二消息通过该第一密钥进行加密,或者,该第二消息不用于该第一密钥进行加密。In some embodiments, the second message is encrypted with the first key, or the second message is not encrypted with the first key.
在一些实施例中,该第一消息为认证响应消息,该第二消息为安全模式命令消息。In some embodiments, the first message is an authentication response message, and the second message is a safe mode command message.
在一些实施例中,该第一消息为安全模式命令消息,该第二消息为安全模式响应消息。In some embodiments, the first message is a safe mode command message, and the second message is a safe mode response message.
在一些实施例中,该通信单元1610还用于将该第一终端设备发送的第三消息转发至该第二终端设备;In some embodiments, the communication unit 1610 is also used to forward the third message sent by the first terminal device to the second terminal device;
其中,该第三消息用于指示安全模式建立完成,该第三消息通过目标密钥进行加密,且该第三消息包括以下至少之一:该第一终端设备生成的该第二密钥的标识的y个比特位,第三消息验证码;Wherein, the third message is used to indicate that the security mode establishment is completed, the third message is encrypted by the target key, and the third message includes at least one of the following: the identification of the second key generated by the first terminal device y bits, the third message verification code;
其中,该目标密钥包括以下之一:该第一密钥,该第二密钥,该第二密钥派生的机密性保护密钥;Wherein, the target key includes one of the following: the first key, the second key, and a confidentiality protected key derived from the second key;
其中,该第三消息通过基于该第二密钥生成的该第三消息验证码进行完整性保护,或者,该第三消息通过基于该第二密钥派生的完整性保护密钥生成的该第三消息验证码进行完整性保护,该第三消息验证码的输入参数包括该y个比特位。Wherein, the third message is integrity protected through the third message verification code generated based on the second key, or the third message is integrity protected through the third message verification code generated based on the integrity protection key derived based on the second key. The three-message verification code performs integrity protection, and the input parameters of the third message verification code include the y bits.
在一些实施例中,该通信单元1610还用于将该第二终端设备发送的错误消息转发至该第一终端设备;其中,该错误消息包括以下至少之一:原因信息,第四消息验证码;其中,该原因信息用于指示该第二终端设备与该第一终端设备的安全策略冲突,或者,该原因信息用于指示该第一消息验证码验证失败,或者,该原因信息用于指示该第二终端设备与该第一终端设备的安全算法协商失败,该第四消息验证码的输入参数包括以下至少之一:该原因信息。In some embodiments, the communication unit 1610 is also used to forward the error message sent by the second terminal device to the first terminal device; wherein the error message includes at least one of the following: cause information, fourth message verification code ; Wherein, the reason information is used to indicate that the security policy of the second terminal device conflicts with the first terminal device, or the reason information is used to indicate that the first message verification code verification fails, or the reason information is used to indicate The security algorithm negotiation between the second terminal device and the first terminal device fails, and the input parameters of the fourth message verification code include at least one of the following: the reason information.
在一些实施例中,该完整性保护密钥包括控制面的完整性保护密钥和用户面的完整性保护密钥;和/或,该机密性保护密钥包括控制面的机密性保护密钥和用户面的机密性保护密钥。In some embodiments, the integrity protection key includes an integrity protection key for the control plane and an integrity protection key for the user plane; and/or the confidentiality protection key includes a confidentiality protection key for the control plane. and user plane confidentiality protecting keys.
在一些实施例中,该通信单元1610还用于接收该第二终端设备发送的认证请求消息;其中,该认证请求消息包括以下至少之一:该第二终端设备所属用户的信息,该第二终端设备生成的第一临时公钥,该第二终端设备的签名;其中,该第二终端设备所属用户的信息包括该第二终端设备的标识和该第二终端设备的PVT和KPAK;该第二终端设备的签名的输入参数包括以下至少之一:该第二终端设备所属用户的信息和该第一临时公钥;该第一临时公钥和该中继设备的相关信息用于该第一终端设备派生该第一密钥;In some embodiments, the communication unit 1610 is also configured to receive an authentication request message sent by the second terminal device; wherein the authentication request message includes at least one of the following: information about the user to which the second terminal device belongs, the second terminal device. The first temporary public key generated by the terminal device, the signature of the second terminal device; wherein the information of the user to which the second terminal device belongs includes the identification of the second terminal device and the PVT and KPAK of the second terminal device; the third The input parameters of the signature of the two terminal devices include at least one of the following: the information of the user to which the second terminal device belongs and the first temporary public key; the first temporary public key and the relevant information of the relay device for the first The terminal device derives the first key;
在该第二终端设备的KPAK有效,且基于该第二终端设备的标识和该第二终端设备的PVT对该第二终端设备的签名验证成功的情况下,该通信单元1610还用于向该第一终端设备发送验证之后的认证请求消息;其中,该验证之后的认证请求消息包括以下至少之一:该第二终端设备所属用户的信息,该中继设备所属用户的信息,该第一临时公钥,该第二终端设备的签名,该中继设备的签名,该中继设备的相关信息;其中,该中继设备所属用户的信息包括该中继设备的标识和该中继设备的PVT和KPAK;该中继设备的签名的输入参数包括以下至少之一:该第二终端设备的签名和该中继设备所属用户的信息。When the KPAK of the second terminal device is valid and the signature verification of the second terminal device based on the identity of the second terminal device and the PVT of the second terminal device is successful, the communication unit 1610 is also used to send a message to the second terminal device. The first terminal device sends an authentication request message after verification; wherein the authentication request message after verification includes at least one of the following: information about the user to whom the second terminal device belongs, information about the user to whom the relay device belongs, the first temporary The public key, the signature of the second terminal device, the signature of the relay device, and the relevant information of the relay device; wherein the information of the user to which the relay device belongs includes the identification of the relay device and the PVT of the relay device. and KPAK; the input parameters of the relay device's signature include at least one of the following: the signature of the second terminal device and the information of the user to which the relay device belongs.
在一些实施例中,该第二终端设备的签名由该第二终端设备的秘密签名密钥生成,和/或,该中继设备的签名由该中继设备的秘密签名密钥生成。In some embodiments, the signature of the second terminal device is generated by the secret signature key of the second terminal device, and/or the signature of the relay device is generated by the secret signature key of the relay device.
在一些实施例中,上述通信单元可以是通信接口或收发器,或者是通信芯片或者片上系统的输入输出接口。In some embodiments, the above-mentioned communication unit may be a communication interface or transceiver, or an input/output interface of a communication chip or a system on a chip.
应理解,根据本申请实施例的终端设备1600可对应于本申请方法实施例中的中继设备,并且终端设备1600中的各个单元的上述和其它操作和/或功能分别为了实现图13所示方法700中中继设备的相应流程,为了简洁,在此不再赘述。It should be understood that the terminal device 1600 according to the embodiment of the present application may correspond to the relay device in the method embodiment of the present application, and the above and other operations and/or functions of each unit in the terminal device 1600 are respectively to implement what is shown in Figure 13 The corresponding process of the relay device in method 700 will not be described again for the sake of simplicity.
图29示出了根据本申请实施例的终端设备1700的示意性框图。该终端设备1700为第一终端设备,如图29所示,该终端设备1700包括:Figure 29 shows a schematic block diagram of a terminal device 1700 according to an embodiment of the present application. The terminal device 1700 is a first terminal device. As shown in Figure 29, the terminal device 1700 includes:
通信单元1710,用于通过中继设备向第二终端设备发送直接通信请求;Communication unit 1710, configured to send a direct communication request to the second terminal device through the relay device;
其中,该直接通信请求包括以下至少之一:该第一终端设备的安全能力信息,该第一终端设备的安全策略信息,该第一终端设备生成的第一临时公钥,该第一终端设备生成的第一随机数;Wherein, the direct communication request includes at least one of the following: security capability information of the first terminal device, security policy information of the first terminal device, a first temporary public key generated by the first terminal device, The first random number generated;
其中,该直接通信请求通过第一加密密钥进行加密,以及该直接通信请求通过第一完整性保护密钥进行完整性保护,该第一加密密钥为基于已注册并被授权使用终端至终端中继UE-to-UE relay通信的终端的对称密钥衍生的加密密钥,该第一完整性保护密钥为基于已注册并被授权使用UE-to-UE relay通信的终端的对称密钥衍生的完整性保护密钥;Wherein, the direct communication request is encrypted through a first encryption key, and the direct communication request is integrity protected through a first integrity protection key. The first encryption key is based on a registered and authorized use terminal to terminal. An encryption key derived from the symmetric key of the terminal that relays the UE-to-UE relay communication. The first integrity protection key is based on the symmetric key of the terminal that is registered and authorized to use the UE-to-UE relay communication. Derived integrity protection keys;
其中,该第一临时公钥和该中继设备的相关信息用于该第二终端设备派生第一密钥;该第一随机数、该第一密钥和该第二终端设备生成的第二随机数用于派生第二密钥,且该第二密钥用于派生第二加密密钥和/或第二完整性保护密钥,或者,该第一随机数、该第一密钥和该第二终端设备生成的第二随机数用于派生第二加密密钥和/或第二完整性保护密钥;Among them, the first temporary public key and the relevant information of the relay device are used by the second terminal device to derive the first key; the first random number, the first key and the second key generated by the second terminal device. The random number is used to derive a second key, and the second key is used to derive a second encryption key and/or a second integrity protection key, or the first random number, the first key and the The second random number generated by the second terminal device is used to derive the second encryption key and/or the second integrity protection key;
其中,该中继设备的相关信息包括以下之一:该中继设备的身份信息,该中继设备生成的随机数,该中继设备生成的计数器。The relevant information of the relay device includes one of the following: identity information of the relay device, a random number generated by the relay device, and a counter generated by the relay device.
在一些实施例中,该通信单元1710还用于接收该第二终端设备通过该中继设备发送的安全模式命令;In some embodiments, the communication unit 1710 is also used to receive a safe mode command sent by the second terminal device through the relay device;
其中,该安全模式命令包括以下至少之一:该第二终端设备选取的安全算法,该第二终端设备选取的安全策略,该第二终端设备生成的第二临时公钥,该第二终端设备生成的该第二随机数,该第二终端设备生成的该第一密钥的标识的M个比特位,该中继设备的相关信息,第一消息验证码;Wherein, the security mode command includes at least one of the following: a security algorithm selected by the second terminal device, a security policy selected by the second terminal device, a second temporary public key generated by the second terminal device, The generated second random number, the M bits of the identification of the first key generated by the second terminal device, the relevant information of the relay device, and the first message verification code;
其中,该安全模式命令通过该第一加密密钥进行加密,该安全模式命令通过该第一完整性保护密钥进行完整性保护,该第一消息验证码基于该第二完整性保护密钥生成,且该第一消息验证码的输入参数包括以下至少之一:该第二终端设备选取的安全算法,该第二终端设备选取的安全策略,该第二临时公钥,该第二随机数,该M个比特位,该中继设备的相关信息;Wherein, the security mode command is encrypted by the first encryption key, the security mode command is integrity protected by the first integrity protection key, and the first message verification code is generated based on the second integrity protection key. , and the input parameters of the first message verification code include at least one of the following: the security algorithm selected by the second terminal device, the security policy selected by the second terminal device, the second temporary public key, and the second random number, The M bits, the relevant information of the relay device;
其中,该第二临时公钥和该中继设备的相关信息用于该第一终端设备派生该第一密钥,该第一密钥的标识由该M个比特位与该第一密钥的标识的另外N个比特位合并得到,M和N均为正整数。Wherein, the second temporary public key and the relevant information of the relay device are used by the first terminal device to derive the first key, and the identification of the first key consists of the M bits and the first key. The other N bits of the identifier are combined, and M and N are both positive integers.
在一些实施例中,在该第一随机数、该第一密钥和该第二随机数用于派生该第二密钥的情况下,该安全模式命令还包括该第二终端设备生成的该第二密钥的标识的x个比特位,以及该第一消息验证码的输入参数包括该x个比特位;In some embodiments, in the case where the first random number, the first key and the second random number are used to derive the second key, the security mode command further includes the generated by the second terminal device. x bits of the identifier of the second key, and the input parameter of the first message verification code includes the x bits;
其中,该第二密钥的标识由该x个比特位与该第二密钥的标识的另外y个比特位合并得到,x和y均为正整数。Wherein, the identifier of the second key is obtained by combining the x bits and the other y bits of the identifier of the second key, and both x and y are positive integers.
在一些实施例中,在该第一随机数、该第一密钥和该第二随机数用于派生该第二密钥的情况下,该终端设备1700还包括:处理单元1720;In some embodiments, in the case where the first random number, the first key and the second random number are used to derive the second key, the terminal device 1700 further includes: a processing unit 1720;
该处理单元1720用于使用该第一加密密钥解密该安全模式命令,以及使用该第一完整性保护密钥判断该安全模式命令的完整性;The processing unit 1720 is configured to use the first encryption key to decrypt the security mode command, and to use the first integrity protection key to determine the integrity of the security mode command;
在该安全模式命令中携带的信息未遭受篡改的情况下,该处理单元1720还用于根据与该第一临时公钥配对的第一临时私钥、该第二临时公钥、该中继设备的相关信息派生该第一密钥,且该处理单元1720还用于生成该第一密钥的标识的该N个比特位,以及将该M个比特位和该N个比特位合并得到该第一密钥的标识;When the information carried in the security mode command has not been tampered with, the processing unit 1720 is also configured to use the first temporary private key paired with the first temporary public key, the second temporary public key, the relay device The first key is derived from the relevant information of the first key, and the processing unit 1720 is also used to generate the N bits of the identification of the first key, and combine the M bits and the N bits to obtain the Nth bit. The identification of a key;
该处理单元1720还用于至少根据该第一随机数、该第一密钥和该第二随机数生成该第二密钥,该第一终端设备根据该第二密钥生成该第二完整性保护密钥和/或该第二加密密钥,以及该处理单元1720还用于生成该第二密钥的标识的该y个比特位,并将该x个比特位和该y个比特位合并得到该第二密钥的标识;The processing unit 1720 is also configured to generate the second key based on at least the first random number, the first key and the second random number, and the first terminal device generates the second integrity based on the second key. protect the key and/or the second encryption key, and the processing unit 1720 is also used to generate the y bits of the identification of the second key, and combine the x bits and the y bits Obtain the identity of the second key;
在该第一消息验证码有效的情况下,该处理单元1720还用于根据该第二终端设备选取的安全算法、该第二完整性保护密钥和/或该第二加密密钥、该第二终端设备选取的安全策略,与该第二终端设备进行通信。When the first message verification code is valid, the processing unit 1720 is also configured to use the security algorithm selected by the second terminal device, the second integrity protection key and/or the second encryption key, the third The security policy selected by the second terminal device communicates with the second terminal device.
在一些实施例中,该通信单元1710还用于通过该中继设备向该第二终端设备发送安全模式建立完成消息;In some embodiments, the communication unit 1710 is also configured to send a security mode establishment completion message to the second terminal device through the relay device;
其中,该安全模式建立完成消息通过该第二密钥或该第二加密密钥进行加密,该安全模式建立完成消息通过该第二密钥或该第二完整性保护密钥进行完整性保护;Wherein, the security mode establishment completion message is encrypted by the second key or the second encryption key, and the security mode establishment completion message is integrity protected by the second key or the second integrity protection key;
其中,该安全模式建立完成消息至少包括该第二密钥的标识的该y个比特位。Wherein, the security mode establishment completion message includes at least the y bits of the identification of the second key.
在一些实施例中,该第二完整性保护密钥的输入参数包括以下至少之一:该第二密钥,选定的算法类型标识符,选定的算法类型标识符的长度,完整性保护算法标识,完整性保护算法标识的长度;和/或,该第二加密密钥的输入参数包括以下至少之一:该第二密钥,选定的算法类型标识符,选定的算法类型标识符的长度,机密性保护算法标识,机密性保护算法标识的长度。In some embodiments, the input parameters of the second integrity protection key include at least one of the following: the second key, the selected algorithm type identifier, the length of the selected algorithm type identifier, the integrity protection Algorithm identifier, the length of the integrity protection algorithm identifier; and/or, the input parameters of the second encryption key include at least one of the following: the second key, the selected algorithm type identifier, the selected algorithm type identifier The length of the character, the confidentiality protection algorithm identifier, and the length of the confidentiality protection algorithm identifier.
在一些实施例中,在该第一随机数、该第一密钥和该第二随机数用于派生该第二加密密钥和/或该第二完整性保护密钥的情况下,该处理单元1720还用于使用该第一加密密钥解密该安全模式命令,以及使用该第一完整性保护密钥判断该安全模式命令的完整性;In some embodiments, where the first random number, the first key, and the second random number are used to derive the second encryption key and/or the second integrity protection key, the process Unit 1720 is also configured to use the first encryption key to decrypt the security mode command, and to use the first integrity protection key to determine the integrity of the security mode command;
在该安全模式命令中携带的信息未遭受篡改的情况下,该处理单元1720还用于根据与该第一临时公钥配对的第一临时私钥、该第二临时公钥、该中继设备的相关信息派生该第一密钥,且该处理单元1720还用于生成该第一密钥的该N个比特位,以及将该M个比特位和该N个比特位合并得到该第一密钥的标识;When the information carried in the security mode command has not been tampered with, the processing unit 1720 is also configured to use the first temporary private key paired with the first temporary public key, the second temporary public key, the relay device The first key is derived from the relevant information, and the processing unit 1720 is also used to generate the N bits of the first key, and combine the M bits and the N bits to obtain the first secret key. The identification of the key;
该处理单元1720还用于至少根据该第一随机数、该第一密钥和该第二随机数生成该第二完整性保护密钥和/或该第二加密密钥;The processing unit 1720 is further configured to generate the second integrity protection key and/or the second encryption key based on at least the first random number, the first key and the second random number;
在该第一消息验证码有效的情况下,该处理单元1720还用于根据该第二终端设备选取的安全算 法、该第二完整性保护密钥和/或该第二加密密钥、该第二终端设备选取的安全策略,与该第二终端设备进行通信。When the first message verification code is valid, the processing unit 1720 is also configured to use the security algorithm selected by the second terminal device, the second integrity protection key and/or the second encryption key, the third The security policy selected by the second terminal device communicates with the second terminal device.
在一些实施例中,该通信单元1710还用于通过该中继设备向该第二终端设备发送安全模式建立完成消息;In some embodiments, the communication unit 1710 is also configured to send a security mode establishment completion message to the second terminal device through the relay device;
其中,该安全模式建立完成消息通过该第二加密密钥进行加密,该安全模式建立完成消息通过该第二完整性保护密钥进行完整性保护。Wherein, the security mode establishment completion message is encrypted by the second encryption key, and the security mode establishment completion message is integrity protected by the second integrity protection key.
在一些实施例中,该第二完整性保护密钥的输入参数包括以下至少之一:该第一随机数,该第一密钥,该第二随机数,选定的算法类型标识符,选定的算法类型标识符的长度,完整性保护算法标识,完整性保护算法标识的长度;和/或,In some embodiments, the input parameters of the second integrity protection key include at least one of the following: the first random number, the first key, the second random number, the selected algorithm type identifier, the selected The length of the specified algorithm type identifier, the integrity protection algorithm identifier, the length of the integrity protection algorithm identifier; and/or,
该第二加密密钥的输入参数包括以下至少之一:该第一随机数,该第一密钥,该第二随机数,选定的算法类型标识符,选定的算法类型标识符的长度,机密性保护算法标识,机密性保护算法标识的长度。The input parameters of the second encryption key include at least one of the following: the first random number, the first key, the second random number, the selected algorithm type identifier, and the length of the selected algorithm type identifier. , confidentiality protection algorithm identifier, the length of the confidentiality protection algorithm identifier.
在一些实施例中,该第一加密密钥为邻近业务加密密钥PEK,该第一完整性保护密钥为邻近业务完整性保护密钥PIK。In some embodiments, the first encryption key is a proximity service encryption key PEK, and the first integrity protection key is a proximity service integrity protection key PIK.
在一些实施例中,上述通信单元可以是通信接口或收发器,或者是通信芯片或者片上系统的输入输出接口。上述处理单元可以是一个或多个处理器。In some embodiments, the above-mentioned communication unit may be a communication interface or transceiver, or an input/output interface of a communication chip or a system on a chip. The above-mentioned processing unit may be one or more processors.
应理解,根据本申请实施例的终端设备1700可对应于本申请方法实施例中的第一终端设备,并且终端设备1700中的各个单元的上述和其它操作和/或功能分别为了实现图16所示方法800中第一终端设备的相应流程,为了简洁,在此不再赘述。It should be understood that the terminal device 1700 according to the embodiment of the present application may correspond to the first terminal device in the method embodiment of the present application, and the above and other operations and/or functions of each unit in the terminal device 1700 are respectively to implement the functions shown in Figure 16 The corresponding process of the first terminal device in method 800 is shown, and for the sake of simplicity, it will not be described again here.
图30示出了根据本申请实施例的终端设备1800的示意性框图。该终端设备1800为第二终端设备,如图30所示,该终端设备1800包括:Figure 30 shows a schematic block diagram of a terminal device 1800 according to an embodiment of the present application. The terminal device 1800 is a second terminal device. As shown in Figure 30, the terminal device 1800 includes:
通信单元1810,用于接收第一终端设备通过中继设备发送的直接通信请求;Communication unit 1810, configured to receive a direct communication request sent by the first terminal device through the relay device;
其中,该直接通信请求包括以下至少之一:该第一终端设备的安全能力信息,该第一终端设备的安全策略信息,该第一终端设备生成的第一临时公钥,该第一终端设备生成的第一随机数,该中继设备的标识,该中继设备的相关信息;Wherein, the direct communication request includes at least one of the following: security capability information of the first terminal device, security policy information of the first terminal device, a first temporary public key generated by the first terminal device, The first random number generated, the identification of the relay device, and the relevant information of the relay device;
其中,该直接通信请求通过第一加密密钥进行加密,以及该直接通信请求通过第一完整性保护密钥进行完整性保护,该第一加密密钥为基于已注册并被授权使用终端至终端中继UE-to-UE relay通信的终端的对称密钥衍生的加密密钥,该第一完整性保护密钥为基于已注册并被授权使用UE-to-UE relay通信的终端的对称密钥衍生的完整性保护密钥;Wherein, the direct communication request is encrypted through a first encryption key, and the direct communication request is integrity protected through a first integrity protection key. The first encryption key is based on a registered and authorized use terminal to terminal. An encryption key derived from the symmetric key of the terminal that relays the UE-to-UE relay communication. The first integrity protection key is based on the symmetric key of the terminal that is registered and authorized to use the UE-to-UE relay communication. Derived integrity protection keys;
其中,该中继设备的相关信息包括以下之一:该中继设备的身份信息,该中继设备生成的随机数,该中继设备生成的计数器;该第一临时公钥和该中继设备的相关信息用于该第二终端设备派生第一密钥;该第一随机数、该第一密钥和该第二终端设备生成的第二随机数用于派生第二密钥,且该第二密钥用于派生第二加密密钥和/或第二完整性保护密钥,或者,该第一随机数、该第一密钥和该第二终端设备生成的第二随机数用于派生第二加密密钥和/或第二完整性保护密钥;Among them, the relevant information of the relay device includes one of the following: the identity information of the relay device, the random number generated by the relay device, the counter generated by the relay device; the first temporary public key and the relay device The relevant information is used by the second terminal device to derive the first key; the first random number, the first key and the second random number generated by the second terminal device are used to derive the second key, and the first random number is used to derive the second key. The second key is used to derive the second encryption key and/or the second integrity protection key, or the first random number, the first key and the second random number generated by the second terminal device are used to derive a second encryption key and/or a second integrity protection key;
其中,该中继设备的相关信息包括以下之一:该中继设备的身份信息,该中继设备生成的随机数,该中继设备生成的计数器。The relevant information of the relay device includes one of the following: identity information of the relay device, a random number generated by the relay device, and a counter generated by the relay device.
在一些实施例中,在该第一随机数、该第一密钥和该第二随机数用于派生该第二密钥的情况下,该终端设备1800还包括:处理单元1820;In some embodiments, in the case where the first random number, the first key and the second random number are used to derive the second key, the terminal device 1800 further includes: a processing unit 1820;
该处理单元1820用于使用该第一加密密钥解密该直接通信请求,以及使用该第一完整性保护密钥判断该直接通信请求的完整性;The processing unit 1820 is configured to use the first encryption key to decrypt the direct communication request, and use the first integrity protection key to determine the integrity of the direct communication request;
在该直接通信请求中携带的信息未遭受篡改的情况下,该处理单元1820还用于生成第二临时私钥,以及该处理单元1820还用于根据该第一临时公钥、该第二临时私钥和该中继设备的相关信息派生该第一密钥,且该第二终端设备生成该第一密钥的标识的M个比特位;When the information carried in the direct communication request has not been tampered with, the processing unit 1820 is also configured to generate a second temporary private key, and the processing unit 1820 is also configured to generate a second temporary private key based on the first temporary public key, the second temporary public key, and the second temporary public key. The first key is derived from the private key and the relevant information of the relay device, and the second terminal device generates M bits of the identification of the first key;
该处理单元1820还用于生成该第二随时数,以及该处理单元1820还用于至少根据该第一随机数、该第一密钥和该第二随机数生成该第二密钥,该处理单元1820还用于根据该第二密钥生成该第二完整性保护密钥和/或该第二加密密钥,且该处理单元1820还用于生成该第二密钥的标识的x个比特位;The processing unit 1820 is also used to generate the second random number, and the processing unit 1820 is also used to generate the second key according to at least the first random number, the first key and the second random number. The unit 1820 is further configured to generate the second integrity protection key and/or the second encryption key according to the second key, and the processing unit 1820 is further configured to generate x bits of the identification of the second key. Bit;
其中,该第一密钥的标识由该M个比特位与该第一密钥的标识的另外N个比特位合并得到,M和N均为正整数,该第二密钥的标识由该x个比特位与该第二密钥的标识的另外y个比特位合并得到,x和y均为正整数。Wherein, the identification of the first key is obtained by combining the M bits and the other N bits of the identification of the first key, M and N are both positive integers, and the identification of the second key is obtained by the x bits are combined with other y bits of the identifier of the second key, and x and y are both positive integers.
在一些实施例中,该通信单元1810还用于通过该中继设备向该第一终端设备发送安全模式命令;In some embodiments, the communication unit 1810 is also used to send a safe mode command to the first terminal device through the relay device;
其中,该安全模式命令包括以下至少之一:该第二终端设备选取的安全算法,该第二终端设备选取的安全策略,该第二终端设备生成的与该第二临时私钥配对的第二临时公钥,该第二随机数,该第 一密钥的标识的该M个比特位,该第二密钥的标识的该x个比特位,第一消息验证码;Wherein, the security mode command includes at least one of the following: the security algorithm selected by the second terminal device, the security policy selected by the second terminal device, and the second temporary private key generated by the second terminal device and paired with the second temporary private key. The temporary public key, the second random number, the M bits of the identifier of the first key, the x bits of the identifier of the second key, and the first message verification code;
其中,该安全模式命令通过该第一加密密钥进行加密,该安全模式命令通过该第一完整性保护密钥进行完整性保护,该第一消息验证码基于该第二完整性保护密钥生成,且该第一消息验证码的输入参数包括以下至少之一:该第二终端设备选取的安全算法,该第二终端设备选取的安全策略,该第二临时公钥,该第二随机数,该M个比特位,该x个比特位,该中继设备的相关信息;该第二临时公钥和该中继设备的相关信息用于该第一终端设备派生该第一密钥。Wherein, the security mode command is encrypted by the first encryption key, the security mode command is integrity protected by the first integrity protection key, and the first message verification code is generated based on the second integrity protection key. , and the input parameters of the first message verification code include at least one of the following: the security algorithm selected by the second terminal device, the security policy selected by the second terminal device, the second temporary public key, and the second random number, The M bits, the x bits, the relevant information of the relay device; the second temporary public key and the relevant information of the relay device are used by the first terminal device to derive the first key.
在一些实施例中,该通信单元1810还用于接收该第一终端设备通过该中继设备发送的安全模式建立完成消息;In some embodiments, the communication unit 1810 is also configured to receive a security mode establishment completion message sent by the first terminal device through the relay device;
其中,该安全模式建立完成消息通过该第二密钥或该第二加密密钥进行加密,该安全模式建立完成消息通过该第二密钥或该第二完整性保护密钥进行完整性保护;Wherein, the security mode establishment completion message is encrypted by the second key or the second encryption key, and the security mode establishment completion message is integrity protected by the second key or the second integrity protection key;
其中,该安全模式建立完成消息至少包括该第二密钥的标识的该y个比特位。Wherein, the security mode establishment completion message includes at least the y bits of the identification of the second key.
在一些实施例中,该第二完整性保护密钥的输入参数包括以下至少之一:该第二密钥,选定的算法类型标识符,选定的算法类型标识符的长度,完整性保护算法标识,完整性保护算法标识的长度;和/或,该第二加密密钥的输入参数包括以下至少之一:该第二密钥,选定的算法类型标识符,选定的算法类型标识符的长度,机密性保护算法标识,机密性保护算法标识的长度。In some embodiments, the input parameters of the second integrity protection key include at least one of the following: the second key, the selected algorithm type identifier, the length of the selected algorithm type identifier, the integrity protection Algorithm identifier, the length of the integrity protection algorithm identifier; and/or, the input parameters of the second encryption key include at least one of the following: the second key, the selected algorithm type identifier, the selected algorithm type identifier The length of the character, the confidentiality protection algorithm identifier, and the length of the confidentiality protection algorithm identifier.
在一些实施例中,在该第一随机数、该第一密钥和该第二随机数用于派生该第二加密密钥和/或该第二完整性保护密钥的情况下,该终端设备1800还包括:处理单元1820;In some embodiments, where the first random number, the first key and the second random number are used to derive the second encryption key and/or the second integrity protection key, the terminal Device 1800 also includes: a processing unit 1820;
该处理单元1820用于使用该第一加密密钥解密该直接通信请求,以及使用该第一完整性保护密钥判断该直接通信请求的完整性;The processing unit 1820 is configured to use the first encryption key to decrypt the direct communication request, and use the first integrity protection key to determine the integrity of the direct communication request;
在该直接通信请求中携带的信息未遭受篡改的情况下,该处理单元1820还用于生成第二临时私钥,以及该处理单元1820还用于根据该第一临时公钥、该第二临时私钥和该中继设备的相关信息派生该第一密钥,且该处理单元1820还用于生成该第一密钥的标识的M个比特位;When the information carried in the direct communication request has not been tampered with, the processing unit 1820 is also configured to generate a second temporary private key, and the processing unit 1820 is also configured to generate a second temporary private key based on the first temporary public key, the second temporary public key, and the second temporary public key. The first key is derived from the private key and the relevant information of the relay device, and the processing unit 1820 is also used to generate M bits of the identification of the first key;
该处理单元1820还用于生成该第二随时数,以及该处理单元1820还用于至少根据该第一随机数、该第一密钥和该第二随机数生成该第二完整性保护密钥和/或该第二加密密钥;其中,该第一密钥的标识由该M个比特位与该第一密钥的标识的另外N个比特位合并得到,M和N均为正整数。The processing unit 1820 is further configured to generate the second random number, and the processing unit 1820 is further configured to generate the second integrity protection key according to at least the first random number, the first key and the second random number. And/or the second encryption key; wherein, the identifier of the first key is obtained by combining the M bits and the other N bits of the identifier of the first key, where M and N are both positive integers.
在一些实施例中,该通信单元1810还用于通过该中继设备向该第一终端设备发送安全模式命令;In some embodiments, the communication unit 1810 is also used to send a safe mode command to the first terminal device through the relay device;
其中,该安全模式命令包括以下至少之一:该第二终端设备选取的安全算法,该第二终端设备选取的安全策略,该第二终端设备生成的与该第二临时私钥配对的第二临时公钥,该第二随机数,该第一密钥的标识的该M个比特位,第一消息验证码;Wherein, the security mode command includes at least one of the following: the security algorithm selected by the second terminal device, the security policy selected by the second terminal device, and the second temporary private key generated by the second terminal device and paired with the second temporary private key. The temporary public key, the second random number, the M bits of the identification of the first key, and the first message verification code;
其中,该安全模式命令通过该第一加密密钥进行加密,该安全模式命令通过该第一完整性保护密钥进行完整性保护,该第一消息验证码基于该第二完整性保护密钥生成,且该第一消息验证码的输入参数包括以下至少之一:该第二终端设备选取的安全算法,该第二终端设备选取的安全策略,该第二临时公钥,该第二随机数,该M个比特位;该第二临时公钥和该中继设备的相关信息用于该第一终端设备派生该第一密钥。Wherein, the security mode command is encrypted by the first encryption key, the security mode command is integrity protected by the first integrity protection key, and the first message verification code is generated based on the second integrity protection key. , and the input parameters of the first message verification code include at least one of the following: the security algorithm selected by the second terminal device, the security policy selected by the second terminal device, the second temporary public key, and the second random number, The M bits; the second temporary public key and the related information of the relay device are used by the first terminal device to derive the first key.
在一些实施例中,该通信单元1810还用于接收该第一终端设备通过该中继设备发送的安全模式建立完成消息;In some embodiments, the communication unit 1810 is also configured to receive a security mode establishment completion message sent by the first terminal device through the relay device;
其中,该安全模式建立完成消息通过该第二加密密钥进行加密,该安全模式建立完成消息通过该第二完整性保护密钥进行完整性保护。Wherein, the security mode establishment completion message is encrypted by the second encryption key, and the security mode establishment completion message is integrity protected by the second integrity protection key.
在一些实施例中,该第二完整性保护密钥的输入参数包括以下至少之一:该第一随机数,该第一密钥,该第二随机数,选定的算法类型标识符,选定的算法类型标识符的长度,完整性保护算法标识,完整性保护算法标识的长度;和/或,In some embodiments, the input parameters of the second integrity protection key include at least one of the following: the first random number, the first key, the second random number, the selected algorithm type identifier, the selected The length of the specified algorithm type identifier, the integrity protection algorithm identifier, the length of the integrity protection algorithm identifier; and/or,
该第二加密密钥的输入参数包括以下至少之一:该第一随机数,该第一密钥,该第二随机数,选定的算法类型标识符,选定的算法类型标识符的长度,机密性保护算法标识,机密性保护算法标识的长度。The input parameters of the second encryption key include at least one of the following: the first random number, the first key, the second random number, the selected algorithm type identifier, and the length of the selected algorithm type identifier. , confidentiality protection algorithm identifier, the length of the confidentiality protection algorithm identifier.
在一些实施例中,该安全模式命令还包括该中继设备的相关信息,以及该第一消息验证码的输入参数还包括该中继设备的相关信息。In some embodiments, the safe mode command also includes information related to the relay device, and the input parameter of the first message verification code also includes information related to the relay device.
在一些实施例中,该处理单元1820还用于根据该第二终端设备选取的安全算法、该第二完整性保护密钥和/或该第二加密密钥、该第二终端设备选取的安全策略,与该第一终端设备进行通信。In some embodiments, the processing unit 1820 is also configured to perform the following steps according to the security algorithm selected by the second terminal device, the second integrity protection key and/or the second encryption key, and the security algorithm selected by the second terminal device. strategy to communicate with the first terminal device.
在一些实施例中,该第一加密密钥为邻近业务加密密钥PEK,该第一完整性保护密钥为邻近业务完整性保护密钥PIK。In some embodiments, the first encryption key is a proximity service encryption key PEK, and the first integrity protection key is a proximity service integrity protection key PIK.
在一些实施例中,上述通信单元可以是通信接口或收发器,或者是通信芯片或者片上系统的输入输出接口。上述处理单元可以是一个或多个处理器。In some embodiments, the above-mentioned communication unit may be a communication interface or transceiver, or an input/output interface of a communication chip or a system on a chip. The above-mentioned processing unit may be one or more processors.
应理解,根据本申请实施例的终端设备1800可对应于本申请方法实施例中的第二终端设备,并且终端设备1800中的各个单元的上述和其它操作和/或功能分别为了实现图17所示方法900中第二终端设备的相应流程,为了简洁,在此不再赘述。It should be understood that the terminal device 1800 according to the embodiment of the present application may correspond to the second terminal device in the method embodiment of the present application, and the above and other operations and/or functions of each unit in the terminal device 1800 are respectively to implement the functions shown in Figure 17 The corresponding process of the second terminal device in method 900 is shown, and for the sake of simplicity, it will not be described again here.
图31示出了根据本申请实施例的终端设备1900的示意性框图。该终端设备1900为中继设备,如图31所示,该终端设备1900包括:Figure 31 shows a schematic block diagram of a terminal device 1900 according to an embodiment of the present application. The terminal device 1900 is a relay device. As shown in Figure 31, the terminal device 1900 includes:
通信单元1910,用于接收第一终端设备发送的直接通信请求;其中,该直接通信请求包括以下至少之一:该第一终端设备的安全能力信息,该第一终端设备的安全策略信息,该第一终端设备生成的第一临时公钥,该第一终端设备生成的第一随机数;其中,该直接通信请求通过第一加密密钥进行加密,以及该直接通信请求通过第一完整性保护密钥进行完整性保护,该第一加密密钥为基于已注册并被授权使用终端至终端中继UE-to-UE relay通信的终端的对称密钥衍生的加密密钥,该第一完整性保护密钥为基于已注册并被授权使用UE-to-UE relay通信的终端的对称密钥衍生的完整性保护密钥;The communication unit 1910 is configured to receive a direct communication request sent by the first terminal device; wherein the direct communication request includes at least one of the following: security capability information of the first terminal device, security policy information of the first terminal device, a first temporary public key generated by the first terminal device, a first random number generated by the first terminal device; wherein the direct communication request is encrypted by a first encryption key, and the direct communication request is protected by a first integrity The key performs integrity protection. The first encryption key is an encryption key derived based on the symmetric key of a terminal that is registered and authorized to use terminal-to-terminal relay UE-to-UE relay communications. The first integrity key is The protection key is an integrity protection key derived based on the symmetric key of the terminal that is registered and authorized to use UE-to-UE relay communication;
处理单元1920,用于验证是否被配置为转发直接通信请求,在验证通过之后该处理单元1920用于使用该第一加密密钥解密该直接通信请求以获取服务质量QoS和计费信息,以及该处理单元1920用于使用该第一完整性保护密钥验证该直接通信请求的完整性,在验证通过之后该中继设备在该直接通信请求中添加该中继设备的相关信息和该中继设备的标识,并且该处理单元1920用于使用该第一加密密钥加密该直接通信请求,使用该第一完整性保护密钥保护该直接通信请求的完整性,该通信单元1910还用于并将该直接通信请求转发至第二终端设备;The processing unit 1920 is configured to verify whether it is configured to forward the direct communication request. After the verification is passed, the processing unit 1920 is used to decrypt the direct communication request using the first encryption key to obtain the quality of service QoS and charging information, and the The processing unit 1920 is configured to use the first integrity protection key to verify the integrity of the direct communication request. After the verification is passed, the relay device adds relevant information of the relay device and the relay device in the direct communication request. identification, and the processing unit 1920 is configured to use the first encryption key to encrypt the direct communication request, and use the first integrity protection key to protect the integrity of the direct communication request. The communication unit 1910 is also configured to The direct communication request is forwarded to the second terminal device;
其中,该中继设备的相关信息包括以下之一:该中继设备的身份信息,该中继设备生成的随机数,该中继设备生成的计数器;该第一临时公钥和该中继设备的相关信息用于第二终端设备派生第一密钥;该第一随机数、该第一密钥和该第二终端设备生成的第二随机数用于派生第二密钥,且该第二密钥用于派生第二加密密钥和/或第二完整性保护密钥,或者,该第一随机数、该第一密钥和该第二终端设备生成的第二随机数用于派生第二加密密钥和/或第二完整性保护密钥。Among them, the relevant information of the relay device includes one of the following: the identity information of the relay device, the random number generated by the relay device, the counter generated by the relay device; the first temporary public key and the relay device The relevant information is used by the second terminal device to derive the first key; the first random number, the first key and the second random number generated by the second terminal device are used to derive the second key, and the second The key is used to derive the second encryption key and/or the second integrity protection key, or the first random number, the first key and the second random number generated by the second terminal device are used to derive the second random number. A second encryption key and/or a second integrity protection key.
在一些实施例中,在该第一随机数、该第一密钥和该第二随机数用于派生该第二密钥的情况下,该通信单元1910还用于接收该第二终端设备发送的安全模式命令;其中,该安全模式命令包括以下至少之一:该第二终端设备选取的安全算法,该第二终端设备选取的安全策略,该第二终端设备生成的第二临时公钥,该第二终端设备生成的该第二随机数,该第二终端设备生成的该第一密钥的标识的M个比特位,该第二终端设备生成的该第二密钥的标识的x个比特位,第一消息验证码;其中,该安全模式命令通过该第一加密密钥进行加密,该安全模式命令通过该第一完整性保护密钥进行完整性保护,该第一消息验证码基于该第二完整性保护密钥生成,且该第一消息验证码的输入参数包括以下至少之一:该第二终端设备选取的安全算法,该第二终端设备选取的安全策略,该第二临时公钥,该第二随机数,该M个比特位,该x个比特位,该中继设备的相关信息;该第二临时公钥和该中继设备的相关信息用于该第一终端设备派生该第一密钥;In some embodiments, when the first random number, the first key and the second random number are used to derive the second key, the communication unit 1910 is also used to receive the second terminal device sent The security mode command; wherein, the security mode command includes at least one of the following: the security algorithm selected by the second terminal device, the security policy selected by the second terminal device, the second temporary public key generated by the second terminal device, The second random number generated by the second terminal device, M bits of the identifier of the first key generated by the second terminal device, x bits of the identifier of the second key generated by the second terminal device bit, the first message verification code; wherein, the security mode command is encrypted by the first encryption key, the security mode command is integrity protected by the first integrity protection key, and the first message verification code is based on The second integrity protection key is generated, and the input parameters of the first message verification code include at least one of the following: the security algorithm selected by the second terminal device, the security policy selected by the second terminal device, the second temporary The public key, the second random number, the M bits, the x bits, and the relevant information of the relay device; the second temporary public key and the relevant information of the relay device are used for the first terminal device derive the first key;
该处理单元1920还用于使用该第一加密密钥解密该安全模式命令,以获取QoS和计费信息,该通信单元1910还用于在向该第一终端设备转发该安全模式命令;The processing unit 1920 is also configured to use the first encryption key to decrypt the security mode command to obtain QoS and charging information, and the communication unit 1910 is also configured to forward the security mode command to the first terminal device;
其中,该第二临时公钥和该中继设备的相关信息用于该第一终端设备派生该第一密钥,该第一密钥的标识由该M个比特位与该第一密钥的标识的另外N个比特位合并得到,M和N均为正整数,该第二密钥的标识由该x个比特位与该第二密钥的标识的另外y个比特位合并得到,x和y均为正整数。Wherein, the second temporary public key and the relevant information of the relay device are used by the first terminal device to derive the first key, and the identification of the first key consists of the M bits and the first key. The other N bits of the identifier are combined. M and N are both positive integers. The identifier of the second key is obtained by combining the x bits and the other y bits of the identifier of the second key. x and y are all positive integers.
在一些实施例中,该通信单元1910还用于向该第二终端设备转发该第一终端设备发送的安全模式建立完成消息;In some embodiments, the communication unit 1910 is also configured to forward the security mode establishment completion message sent by the first terminal device to the second terminal device;
其中,该安全模式建立完成消息通过该第二密钥或该第二加密密钥进行加密,该安全模式建立完成消息通过该第二密钥或该第二完整性保护密钥进行完整性保护;Wherein, the security mode establishment completion message is encrypted by the second key or the second encryption key, and the security mode establishment completion message is integrity protected by the second key or the second integrity protection key;
其中,该安全模式建立完成消息至少包括该第二密钥的标识的该y个比特位。Wherein, the security mode establishment completion message includes at least the y bits of the identification of the second key.
在一些实施例中,在该第一随机数、该第一密钥和该第二随机数用于派生该第二加密密钥和/或该第二完整性保护密钥的情况下,该通信单元1910还用于接收该第二终端设备发送的安全模式命令;其中,该安全模式命令包括以下至少之一:该第二终端设备选取的安全算法,该第二终端设备选取的安全策略,该第二终端设备生成的第二临时公钥,该第二终端设备生成的该第二随机数,该第二终端设备生成的该第一密钥的标识的M个比特位,第一消息验证码;其中,该安全模式命令通过该第一加密密钥进行加密,该安全模式命令通过该第一完整性保护密钥进行完整性保护,该第一消息验证码基于该第二完整性保护密钥生成,且该第一消息验证码的输入参数包括以下至少之一:该第二终端设备选取的安全算法,该第二终端设备选取的安全策略,该第二临时公钥,该第二随机数,该M个比特位,该中继设备的相关信息;该第二临时公钥和该中继设备的相关信息用于该第一终端设备派生该第一密钥;In some embodiments, where the first random number, the first key and the second random number are used to derive the second encryption key and/or the second integrity protection key, the communication Unit 1910 is also configured to receive a security mode command sent by the second terminal device; wherein the security mode command includes at least one of the following: a security algorithm selected by the second terminal device, a security policy selected by the second terminal device, the The second temporary public key generated by the second terminal device, the second random number generated by the second terminal device, the M bits of the identification of the first key generated by the second terminal device, the first message verification code ; Wherein, the security mode command is encrypted by the first encryption key, the security mode command is integrity protected by the first integrity protection key, and the first message verification code is based on the second integrity protection key. Generated, and the input parameters of the first message verification code include at least one of the following: the security algorithm selected by the second terminal device, the security policy selected by the second terminal device, the second temporary public key, the second random number , the M bits, the relevant information of the relay device; the second temporary public key and the relevant information of the relay device are used by the first terminal device to derive the first key;
该处理单元1920还用于使用该第一加密密钥解密该安全模式命令,以获取QoS和计费信息,该通信单元1910还用于在向该第一终端设备转发该安全模式命令;The processing unit 1920 is also configured to use the first encryption key to decrypt the security mode command to obtain QoS and charging information, and the communication unit 1910 is also configured to forward the security mode command to the first terminal device;
其中,该第二临时公钥和该中继设备的相关信息用于该第一终端设备派生该第一密钥,该第一密钥的标识由该M个比特位与该第一密钥的标识的另外N个比特位合并得到,M和N均为正整数。Wherein, the second temporary public key and the relevant information of the relay device are used by the first terminal device to derive the first key, and the identification of the first key consists of the M bits and the first key. The other N bits of the identifier are combined, and M and N are both positive integers.
在一些实施例中,该通信单元1910还用于向该第二终端设备转发该第一终端设备发送的安全模式建立完成消息;In some embodiments, the communication unit 1910 is also configured to forward the security mode establishment completion message sent by the first terminal device to the second terminal device;
其中,该安全模式建立完成消息通过该第二加密密钥进行加密,该安全模式建立完成消息通过该第二完整性保护密钥进行完整性保护。Wherein, the security mode establishment completion message is encrypted by the second encryption key, and the security mode establishment completion message is integrity protected by the second integrity protection key.
在一些实施例中,该安全模式命令包括该中继设备的相关信息,以及该第一消息验证码的输入参数还包括该中继设备的相关信息;或者,该中继设备在向该第一终端设备转发的该安全模式命令中添加了该中继设备的相关信息。In some embodiments, the safe mode command includes information related to the relay device, and the input parameters of the first message verification code also include information related to the relay device; or, the relay device sends a message to the first message verification code. The relevant information of the relay device is added to the safe mode command forwarded by the terminal device.
在一些实施例中,该第一加密密钥为邻近业务加密密钥PEK,该第一完整性保护密钥为邻近业务完整性保护密钥PIK。In some embodiments, the first encryption key is a proximity service encryption key PEK, and the first integrity protection key is a proximity service integrity protection key PIK.
在一些实施例中,上述通信单元可以是通信接口或收发器,或者是通信芯片或者片上系统的输入输出接口。上述处理单元可以是一个或多个处理器。In some embodiments, the above-mentioned communication unit may be a communication interface or transceiver, or an input/output interface of a communication chip or a system on a chip. The above-mentioned processing unit may be one or more processors.
应理解,根据本申请实施例的终端设备1900可对应于本申请方法实施例中的中继设备,并且终端设备1900中的各个单元的上述和其它操作和/或功能分别为了实现图18所示方法1000中中继设备的相应流程,为了简洁,在此不再赘述。It should be understood that the terminal device 1900 according to the embodiment of the present application may correspond to the relay device in the method embodiment of the present application, and the above and other operations and/or functions of each unit in the terminal device 1900 are respectively intended to implement what is shown in Figure 18 The corresponding process of the relay device in method 1000 will not be described again for the sake of simplicity.
图32是本申请实施例提供的一种通信设备2000示意性结构图。图32所示的通信设备2000包括处理器2010,处理器2010可以从存储器中调用并运行计算机程序,以实现本申请实施例中的方法。Figure 32 is a schematic structural diagram of a communication device 2000 provided by an embodiment of the present application. The communication device 2000 shown in Figure 32 includes a processor 2010. The processor 2010 can call and run a computer program from the memory to implement the method in the embodiment of the present application.
在一些实施例中,如图32所示,通信设备2000还可以包括存储器2020。其中,处理器2010可以从存储器2020中调用并运行计算机程序,以实现本申请实施例中的方法。In some embodiments, as shown in Figure 32, communication device 2000 may also include memory 2020. The processor 2010 can call and run the computer program from the memory 2020 to implement the method in the embodiment of the present application.
其中,存储器2020可以是独立于处理器2010的一个单独的器件,也可以集成在处理器2010中。The memory 2020 may be a separate device independent of the processor 2010 , or may be integrated into the processor 2010 .
在一些实施例中,如图32所示,通信设备2000还可以包括收发器2030,处理器2010可以控制该收发器2030与其他设备进行通信,具体地,可以向其他设备发送信息或数据,或接收其他设备发送的信息或数据。In some embodiments, as shown in Figure 32, the communication device 2000 may also include a transceiver 2030, and the processor 2010 may control the transceiver 2030 to communicate with other devices, specifically, may send information or data to other devices, or Receive information or data from other devices.
其中,收发器2030可以包括发射机和接收机。收发器2030还可以进一步包括天线,天线的数量可以为一个或多个。Among them, the transceiver 2030 may include a transmitter and a receiver. The transceiver 2030 may further include an antenna, and the number of antennas may be one or more.
在一些实施例中,该通信设备2000具体可为本申请实施例的终端设备,并且该通信设备2000可以实现本申请实施例的各个方法中由第一终端设备和/或第二终端实现的相应流程,为了简洁,在此不再赘述。In some embodiments, the communication device 2000 may be a terminal device according to the embodiment of the present application, and the communication device 2000 may implement the corresponding functions implemented by the first terminal device and/or the second terminal in the various methods of the embodiment of the present application. The process, for the sake of brevity, will not be repeated here.
在一些实施例中,该通信设备2000具体可为本申请实施例的终端设备,并且该通信设备2000可以实现本申请实施例的各个方法中由中继设备实现的相应流程,为了简洁,在此不再赘述。In some embodiments, the communication device 2000 can be a terminal device according to the embodiment of the present application, and the communication device 2000 can implement the corresponding processes implemented by the relay device in the various methods of the embodiment of the present application. For the sake of simplicity, here No longer.
图33是本申请实施例的装置的示意性结构图。图33所示的装置2100包括处理器2110,处理器2110可以从存储器中调用并运行计算机程序,以实现本申请实施例中的方法。Figure 33 is a schematic structural diagram of the device according to the embodiment of the present application. The device 2100 shown in Figure 33 includes a processor 2110. The processor 2110 can call and run a computer program from the memory to implement the method in the embodiment of the present application.
在一些实施例中,如图33所示,装置2100还可以包括存储器2120。其中,处理器2110可以从存储器2120中调用并运行计算机程序,以实现本申请实施例中的方法。In some embodiments, as shown in Figure 33, device 2100 may also include memory 2120. The processor 2110 can call and run the computer program from the memory 2120 to implement the method in the embodiment of the present application.
其中,存储器2120可以是独立于处理器2110的一个单独的器件,也可以集成在处理器2110中。The memory 2120 may be a separate device independent of the processor 2110, or may be integrated into the processor 2110.
在一些实施例中,该装置2100还可以包括输入接口2130。其中,处理器2110可以控制该输入接口2130与其他设备或芯片进行通信,具体地,可以获取其他设备或芯片发送的信息或数据。In some embodiments, the device 2100 may also include an input interface 2130. The processor 2110 can control the input interface 2130 to communicate with other devices or chips. Specifically, it can obtain information or data sent by other devices or chips.
在一些实施例中,该装置2100还可以包括输出接口2140。其中,处理器2110可以控制该输出接口2140与其他设备或芯片进行通信,具体地,可以向其他设备或芯片输出信息或数据。In some embodiments, the device 2100 may also include an output interface 2140. The processor 2110 can control the output interface 2140 to communicate with other devices or chips. Specifically, it can output information or data to other devices or chips.
在一些实施例中,该装置可应用于本申请实施例中的终端设备,并且该装置可以实现本申请实施例的各个方法中由第一终端设备和/或第二终端实现的相应流程,为了简洁,在此不再赘述。In some embodiments, the device can be applied to the terminal device in the embodiment of the present application, and the device can implement the corresponding processes implemented by the first terminal device and/or the second terminal in the various methods of the embodiment of the present application, in order to It’s concise and I won’t go into details here.
在一些实施例中,该装置可应用于本申请实施例中的终端设备,并且该装置可以实现本申请实施例的各个方法中由中继设备实现的相应流程,为了简洁,在此不再赘述。In some embodiments, the device can be applied to the terminal device in the embodiments of the present application, and the device can implement the corresponding processes implemented by the relay device in the various methods of the embodiments of the present application. For the sake of brevity, they will not be described again. .
在一些实施例中,本申请实施例提到的装置也可以是芯片。例如可以是系统级芯片,系统芯片,芯片系统或片上系统芯片等。In some embodiments, the devices mentioned in the embodiments of this application may also be chips. For example, it can be a system-on-a-chip, a system-on-a-chip, a system-on-a-chip or a system-on-a-chip, etc.
图34是本申请实施例提供的一种通信系统2200的示意性框图。如图34所示,该通信系统2200包括第一终端设备2210、第二终端设备2220和中继设备2230。Figure 34 is a schematic block diagram of a communication system 2200 provided by an embodiment of the present application. As shown in Figure 34, the communication system 2200 includes a first terminal device 2210, a second terminal device 2220 and a relay device 2230.
其中,该第一终端设备2210可以用于实现上述方法中由第一终端设备实现的相应的功能,该第二终端设备2220可以用于实现上述方法中由第二终端设备实现的相应的功能,以及该中继设备2230 可以用于实现上述方法中由中继设备实现的相应的功能,为了简洁,在此不再赘述。Wherein, the first terminal device 2210 can be used to implement the corresponding functions implemented by the first terminal device in the above method, and the second terminal device 2220 can be used to implement the corresponding functions implemented by the second terminal device in the above method, And the relay device 2230 can be used to implement the corresponding functions implemented by the relay device in the above method. For the sake of simplicity, they will not be described again here.
应理解,本申请实施例的处理器可能是一种集成电路芯片,具有信号的处理能力。在实现过程中,上述方法实施例的各步骤可以通过处理器中的硬件的集成逻辑电路或者软件形式的指令完成。上述的处理器可以是通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现成可编程门阵列(Field Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。可以实现或者执行本申请实施例中的公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。结合本申请实施例所公开的方法的步骤可以直接体现为硬件译码处理器执行完成,或者用译码处理器中的硬件及软件模块组合执行完成。软件模块可以位于随机存储器,闪存、只读存储器,可编程只读存储器或者电可擦写可编程存储器、寄存器等本领域成熟的存储介质中。该存储介质位于存储器,处理器读取存储器中的信息,结合其硬件完成上述方法的步骤。It should be understood that the processor in the embodiment of the present application may be an integrated circuit chip and has signal processing capabilities. During the implementation process, each step of the above method embodiment can be completed through an integrated logic circuit of hardware in the processor or instructions in the form of software. The above-mentioned processor can be a general-purpose processor, a digital signal processor (Digital Signal Processor, DSP), an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), an off-the-shelf programmable gate array (Field Programmable Gate Array, FPGA) or other available processors. Programmed logic devices, discrete gate or transistor logic devices, discrete hardware components. Each method, step and logical block diagram disclosed in the embodiment of this application can be implemented or executed. A general-purpose processor may be a microprocessor or the processor may be any conventional processor, etc. The steps of the method disclosed in conjunction with the embodiments of the present application can be directly implemented by a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software module can be located in random access memory, flash memory, read-only memory, programmable read-only memory or electrically erasable programmable memory, registers and other mature storage media in this field. The storage medium is located in the memory, and the processor reads the information in the memory and completes the steps of the above method in combination with its hardware.
可以理解,本申请实施例中的存储器可以是易失性存储器或非易失性存储器,或可包括易失性和非易失性存储器两者。其中,非易失性存储器可以是只读存储器(Read-Only Memory,ROM)、可编程只读存储器(Programmable ROM,PROM)、可擦除可编程只读存储器(Erasable PROM,EPROM)、电可擦除可编程只读存储器(Electrically EPROM,EEPROM)或闪存。易失性存储器可以是随机存取存储器(Random Access Memory,RAM),其用作外部高速缓存。通过示例性但不是限制性说明,许多形式的RAM可用,例如静态随机存取存储器(Static RAM,SRAM)、动态随机存取存储器(Dynamic RAM,DRAM)、同步动态随机存取存储器(Synchronous DRAM,SDRAM)、双倍数据速率同步动态随机存取存储器(Double Data Rate SDRAM,DDR SDRAM)、增强型同步动态随机存取存储器(Enhanced SDRAM,ESDRAM)、同步连接动态随机存取存储器(Synchlink DRAM,SLDRAM)和直接内存总线随机存取存储器(Direct Rambus RAM,DR RAM)。应注意,本文描述的系统和方法的存储器旨在包括但不限于这些和任意其它适合类型的存储器。It can be understood that the memory in the embodiment of the present application may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. Among them, non-volatile memory can be read-only memory (Read-Only Memory, ROM), programmable read-only memory (Programmable ROM, PROM), erasable programmable read-only memory (Erasable PROM, EPROM), electrically removable memory. Erase programmable read-only memory (Electrically EPROM, EEPROM) or flash memory. Volatile memory may be Random Access Memory (RAM), which is used as an external cache. By way of illustration, but not limitation, many forms of RAM are available, such as static random access memory (Static RAM, SRAM), dynamic random access memory (Dynamic RAM, DRAM), synchronous dynamic random access memory (Synchronous DRAM, SDRAM), double data rate synchronous dynamic random access memory (Double Data Rate SDRAM, DDR SDRAM), enhanced synchronous dynamic random access memory (Enhanced SDRAM, ESDRAM), synchronous link dynamic random access memory (Synchlink DRAM, SLDRAM) ) and direct memory bus random access memory (Direct Rambus RAM, DR RAM). It should be noted that the memory of the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.
应理解,上述存储器为示例性但不是限制性说明,例如,本申请实施例中的存储器还可以是静态随机存取存储器(static RAM,SRAM)、动态随机存取存储器(dynamic RAM,DRAM)、同步动态随机存取存储器(synchronous DRAM,SDRAM)、双倍数据速率同步动态随机存取存储器(double data rate SDRAM,DDR SDRAM)、增强型同步动态随机存取存储器(enhanced SDRAM,ESDRAM)、同步连接动态随机存取存储器(synch link DRAM,SLDRAM)以及直接内存总线随机存取存储器(Direct Rambus RAM,DR RAM)等等。也就是说,本申请实施例中的存储器旨在包括但不限于这些和任意其它适合类型的存储器。It should be understood that the above-mentioned memory is an exemplary but not restrictive description. For example, the memory in the embodiment of the present application can also be a static random access memory (static RAM, SRAM), a dynamic random access memory (dynamic RAM, DRAM), Synchronous dynamic random access memory (synchronous DRAM, SDRAM), double data rate synchronous dynamic random access memory (double data rate SDRAM, DDR SDRAM), enhanced synchronous dynamic random access memory (enhanced SDRAM, ESDRAM), synchronous connection Dynamic random access memory (synch link DRAM, SLDRAM) and direct memory bus random access memory (Direct Rambus RAM, DR RAM) and so on. That is, memories in embodiments of the present application are intended to include, but are not limited to, these and any other suitable types of memories.
本申请实施例还提供了一种计算机可读存储介质,用于存储计算机程序。Embodiments of the present application also provide a computer-readable storage medium for storing computer programs.
在一些实施例中,该计算机可读存储介质可应用于本申请实施例中的终端设备,并且该计算机程序使得计算机执行本申请实施例的各个方法中由第一终端设备和/或第二终端设备实现的相应流程,为了简洁,在此不再赘述。In some embodiments, the computer-readable storage medium can be applied to the terminal device in the embodiment of the present application, and the computer program causes the computer to perform the various methods of the embodiment of the present application by the first terminal device and/or the second terminal The corresponding process of equipment implementation will not be described here for the sake of simplicity.
在一些实施例中,该计算机可读存储介质可应用于本申请实施例中的终端设备,并且该计算机程序使得计算机执行本申请实施例的各个方法中由中继设备实现的相应流程,为了简洁,在此不再赘述。In some embodiments, the computer-readable storage medium can be applied to the terminal device in the embodiment of the present application, and the computer program causes the computer to execute the corresponding processes implemented by the relay device in the various methods of the embodiment of the present application. For the sake of simplicity , which will not be described in detail here.
本申请实施例还提供了一种计算机程序产品,包括计算机程序指令。An embodiment of the present application also provides a computer program product, including computer program instructions.
在一些实施例中,该计算机程序产品可应用于本申请实施例中的终端设备,并且该计算机程序指令使得计算机执行本申请实施例的各个方法中由第一终端设备和/或第二终端设备实现的相应流程,为了简洁,在此不再赘述。In some embodiments, the computer program product can be applied to the terminal device in the embodiment of the present application, and the computer program instructions cause the computer to perform the various methods of the embodiment of the present application by the first terminal device and/or the second terminal device. The corresponding process of implementation will not be repeated here for the sake of brevity.
在一些实施例中,该计算机程序产品可应用于本申请实施例中的终端设备,并且该计算机程序指令使得计算机执行本申请实施例的各个方法中由中继设备实现的相应流程,为了简洁,在此不再赘述。In some embodiments, the computer program product can be applied to the terminal device in the embodiment of the present application, and the computer program instructions cause the computer to execute the corresponding processes implemented by the relay device in each method of the embodiment of the present application. For the sake of simplicity, I won’t go into details here.
本申请实施例还提供了一种计算机程序。An embodiment of the present application also provides a computer program.
在一些实施例中,该计算机程序可应用于本申请实施例中的终端设备,当该计算机程序在计算机上运行时,使得计算机执行本申请实施例的各个方法中由第一终端设备和/或第二终端设备实现的相应流程,为了简洁,在此不再赘述。In some embodiments, the computer program can be applied to the terminal device in the embodiment of the present application. When the computer program is run on the computer, the computer performs the various methods in the embodiment of the present application by the first terminal device and/or The corresponding process implemented by the second terminal device will not be described again for the sake of simplicity.
在一些实施例中,该计算机程序可应用于本申请实施例中的终端设备,当该计算机程序在计算机上运行时,使得计算机执行本申请实施例的各个方法中由中继设备实现的相应流程,为了简洁,在此不再赘述。In some embodiments, the computer program can be applied to the terminal device in the embodiments of the present application. When the computer program is run on the computer, it causes the computer to execute the corresponding processes implemented by the relay device in each method of the embodiments of the present application. , for the sake of brevity, will not be repeated here.
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented with electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Skilled artisans may implement the described functionality using different methods for each specific application, but such implementations should not be considered beyond the scope of this application.
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统、装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the systems, devices and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be described again here.
在本申请所提供的几个实施例中,应该理解到,所揭露的系统、装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components may be combined or can be integrated into another system, or some features can be ignored, or not implemented. On the other hand, the coupling or direct coupling or communication connection between each other shown or discussed may be through some interfaces, and the indirect coupling or communication connection of the devices or units may be in electrical, mechanical or other forms.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place, or they may be distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。In addition, each functional unit in each embodiment of the present application can be integrated into one processing unit, each unit can exist physically alone, or two or more units can be integrated into one unit.
所述功能如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。针对这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. In view of this understanding, the technical solution of the present application is essentially or the part that contributes to the existing technology or the part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including Several instructions are used to cause a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of this application. The aforementioned storage media include: U disk, mobile hard disk, read-only memory (ROM), random access memory (Random Access Memory, RAM), magnetic disk or optical disk and other media that can store program code. .
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应所述以权利要求的保护范围为准。The above are only specific embodiments of the present application, but the protection scope of the present application is not limited thereto. Any person familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application. should be covered by the protection scope of this application. Therefore, the protection scope of this application should be determined by the protection scope of the claims.

Claims (117)

  1. 一种中继通信的方法,其特征在于,包括:A method for relaying communications, characterized by including:
    第一终端设备接收第二终端设备通过中继设备发送的认证请求消息;The first terminal device receives the authentication request message sent by the second terminal device through the relay device;
    其中,所述认证请求消息包括以下至少之一:所述第二终端设备所属用户的信息,所述中继设备所属用户的信息,所述第二终端设备生成的第一临时公钥,所述第二终端设备的签名,所述中继设备的签名,所述中继设备的相关信息;Wherein, the authentication request message includes at least one of the following: information about the user to which the second terminal device belongs, information about the user to which the relay device belongs, the first temporary public key generated by the second terminal device, the The signature of the second terminal device, the signature of the relay device, and the relevant information of the relay device;
    其中,所述第二终端设备所属用户的信息包括所述第二终端设备的标识和所述第二终端设备的公共验证令牌PVT和密钥管理服务器的公共认证密钥KPAK;所述中继设备所属用户的信息包括所述中继设备的标识和所述中继设备的PVT和KPAK;所述第二终端设备的签名的输入参数包括以下至少之一:所述第二终端设备所属用户的信息和所述第一临时公钥;所述中继设备的签名的输入参数包括以下至少之一:所述第二终端设备的签名和所述中继设备所属用户的信息;所述第一临时公钥和所述中继设备的相关信息用于所述第一终端设备派生第一密钥;所述中继设备的相关信息包括以下之一:所述中继设备的身份信息,所述中继设备生成的随机数,所述中继设备生成的计数器。Wherein, the information of the user to which the second terminal device belongs includes the identification of the second terminal device, the public verification token PVT of the second terminal device and the public authentication key KPAK of the key management server; the relay The information of the user to whom the device belongs includes the identification of the relay device and the PVT and KPAK of the relay device; the input parameters of the signature of the second terminal device include at least one of the following: information and the first temporary public key; the input parameters of the signature of the relay device include at least one of the following: the signature of the second terminal device and the information of the user to which the relay device belongs; the first temporary The public key and the relevant information of the relay device are used by the first terminal device to derive the first key; the relevant information of the relay device includes one of the following: the identity information of the relay device, the The relay device generates a random number, and the relay device generates a counter.
  2. 如权利要求1所述的方法,其特征在于,The method of claim 1, characterized in that:
    所述第二终端设备的签名由所述第二终端设备的秘密签名密钥生成,和/或,所述中继设备的签名由所述中继设备的秘密签名密钥生成。The signature of the second terminal device is generated by the secret signature key of the second terminal device, and/or the signature of the relay device is generated by the secret signature key of the relay device.
  3. 如权利要求1或2所述的方法,其特征在于,所述方法还包括:The method according to claim 1 or 2, characterized in that the method further includes:
    在所述第二终端设备的KPAK和所述中继设备的KPAK有效,且基于所述第二终端设备的标识和所述第二终端设备的PVT对所述第二终端设备的签名验证成功,以及基于所述中继设备的标识和所述中继设备的PVT对所述中继设备的签名验证成功的情况下,所述第一终端设备生成第二临时私钥,以及所述第一终端设备根据所述第一临时公钥、所述中继设备的相关信息和所述第二临时私钥派生所述第一密钥。The KPAK of the second terminal device and the KPAK of the relay device are valid, and the signature verification of the second terminal device based on the identification of the second terminal device and the PVT of the second terminal device is successful, And if the signature verification of the relay device is successful based on the identification of the relay device and the PVT of the relay device, the first terminal device generates a second temporary private key, and the first terminal The device derives the first key based on the first temporary public key, relevant information of the relay device, and the second temporary private key.
  4. 如权利要求3所述的方法,其特征在于,所述方法还包括:The method of claim 3, further comprising:
    所述第一终端设备通过所述中继设备向所述第二终端设备发送第一消息;The first terminal device sends a first message to the second terminal device through the relay device;
    其中,所述第一消息包括以下至少之一:所述第一终端设备的安全能力信息,所述第一终端设备的安全策略信息,所述第一终端设备所属用户的信息,所述第一终端设备生成的第一随机数,所述第一终端设备生成的与所述第二临时私钥配对的第二临时公钥,所述第一终端设备生成的所述第一密钥的标识的M个比特位,所述第一终端设备的签名,第一消息验证码;Wherein, the first message includes at least one of the following: security capability information of the first terminal device, security policy information of the first terminal device, information of the user to which the first terminal device belongs, the first The first random number generated by the terminal device, the second temporary public key paired with the second temporary private key generated by the first terminal device, the identification of the first key generated by the first terminal device M bits, the signature of the first terminal device, and the first message verification code;
    其中,所述第一终端设备所属用户的信息包括所述第一终端设备的标识和所述第一终端设备的PVT和KPAK;所述第一终端设备的签名的输入参数包括以下至少之一:所述第一终端设备所属用户的信息,所述第二临时公钥,所述M个比特位,所述第二终端设备的签名;Wherein, the information of the user to which the first terminal device belongs includes the identification of the first terminal device and the PVT and KPAK of the first terminal device; the input parameters of the signature of the first terminal device include at least one of the following: Information about the user to which the first terminal device belongs, the second temporary public key, the M bits, and the signature of the second terminal device;
    其中,所述第一消息通过基于所述第一密钥生成的所述第一消息验证码进行完整性保护,且所述第一消息验证码的输入参数包括以下至少之一:所述第一终端设备的安全能力信息,所述第一终端设备的安全策略信息,所述第一终端设备所属用户的信息,所述第一随机数,所述第二临时公钥,所述M个比特位,所述第一终端设备的签名;Wherein, the first message is integrity protected by the first message verification code generated based on the first key, and the input parameters of the first message verification code include at least one of the following: the first Security capability information of the terminal device, security policy information of the first terminal device, information of the user to which the first terminal device belongs, the first random number, the second temporary public key, the M bits , the signature of the first terminal device;
    其中,所述第二临时公钥和所述中继设备的相关信息用于所述第二终端设备派生所述第一密钥,所述第一随机数、所述第一密钥和所述第二终端设备生成的第二随机数用于派生第二密钥,所述第二密钥用于派生完整性保护密钥和/或机密性保护密钥,所述第一密钥的标识由所述M个比特位与所述第一密钥的标识的另外N个比特位合并得到,M和N均为正整数。Wherein, the second temporary public key and the relevant information of the relay device are used by the second terminal device to derive the first key, the first random number, the first key and the The second random number generated by the second terminal device is used to derive a second key, the second key is used to derive an integrity protection key and/or a confidentiality protection key, and the identity of the first key is given by The M bits are combined with the other N bits of the identifier of the first key, and M and N are both positive integers.
  5. 如权利要求4所述的方法,其特征在于,所述方法还包括:The method of claim 4, further comprising:
    所述第一终端设备接收所述第二终端设备通过所述中继设备发送的第二消息;The first terminal device receives the second message sent by the second terminal device through the relay device;
    其中,所述第二消息包括以下至少之一:所述第二终端设备生成的所述第二随机数,所述第二终端设备生成的所述第一密钥的标识的N个比特位,所述第二终端设备生成的所述第二密钥的标识的x个比特位,所述第二终端设备选取的安全算法,所述第二终端设备选取的安全策略,第二消息验证码;Wherein, the second message includes at least one of the following: the second random number generated by the second terminal device, N bits of the identification of the first key generated by the second terminal device, x bits of the identification of the second key generated by the second terminal device, the security algorithm selected by the second terminal device, the security policy selected by the second terminal device, and the second message verification code;
    其中,所述第二消息通过基于所述第二密钥生成的所述第二消息验证码进行完整性保护,或者,所述第二消息通过基于所述第二密钥派生的完整性保护密钥生成的所述第二消息验证码进行完整性保护,且所述第二消息验证码的输入参数包括以下至少之一:所述第二随机数,所述N个比特位,所述x个比特位,所述第二终端设备选取的安全算法,所述第二终端设备选取的安全策略;其中,所述第二密钥的标识由所述x个比特位与所述第二密钥的标识的另外y个比特位合并得到,x和y均为正整数。Wherein, the second message is integrity protected through the second message verification code generated based on the second key, or the second message is integrity protected through the integrity protection code derived based on the second key. The second message verification code generated by the key is integrity protected, and the input parameters of the second message verification code include at least one of the following: the second random number, the N bits, the x bits, the security algorithm selected by the second terminal device, the security policy selected by the second terminal device; wherein, the identification of the second key is composed of the x bits and the second key The other y bits of the identifier are combined, and x and y are both positive integers.
  6. 如权利要求5所述的方法,其特征在于,The method of claim 5, characterized in that:
    所述第二消息通过所述第一密钥进行加密。The second message is encrypted with the first key.
  7. 如权利要求5所述的方法,其特征在于,所述方法还包括:The method of claim 5, further comprising:
    在所述第二消息中携带的信息未遭受篡改的情况下,所述第一终端设备至少根据所述第一随机数、所述第一密钥和所述第二随机数生成所述第二密钥,所述第一终端设备根据所述第二密钥生成完整性保护密钥和/或机密性保护密钥,以及所述第一终端设备将所述M个比特位和所述N个比特位合并得到所述第一密钥的标识,所述第一终端设备生成所述第二密钥的标识的y个比特位,并将所述x个比特位和所述y个比特位合并得到所述第二密钥的标识;In the case that the information carried in the second message has not been tampered with, the first terminal device generates the second random number based on at least the first random number, the first key and the second random number. key, the first terminal device generates an integrity protection key and/or a confidentiality protection key based on the second key, and the first terminal device converts the M bits and the N The bits are combined to obtain the identification of the first key, the first terminal device generates y bits of the identification of the second key, and combines the x bits and the y bits Obtain the identification of the second key;
    在所述第二消息验证码有效的情况下,所述第一终端设备根据所述第二终端设备选取的安全算法、所述第二密钥、基于所述第二密钥生成完整性保护密钥和/或机密性保护密钥、所述第二终端设备选取的安全策略,与所述第二终端设备进行通信。When the second message verification code is valid, the first terminal device generates an integrity protection password based on the security algorithm selected by the second terminal device, the second key, and the second key. The key and/or the confidentiality protection key and the security policy selected by the second terminal device are used to communicate with the second terminal device.
  8. 如权利要求6所述的方法,其特征在于,所述方法还包括:The method of claim 6, further comprising:
    所述第一终端设备根据所述第一密钥解密所述第二消息;The first terminal device decrypts the second message according to the first key;
    在所述第二消息中携带的信息未遭受篡改的情况下,所述第一终端设备至少根据所述第一随机数、所述第一密钥和所述第二随机数生成所述第二密钥,所述第一终端设备根据所述第二密钥生成完整性保护密钥和/或机密性保护密钥,以及所述第一终端设备将所述M个比特位和所述N个比特位合并得到所述第一密钥的标识,所述第一终端设备生成所述第二密钥的标识的y个比特位,并将所述x个比特位和所述y个比特位合并得到所述第二密钥的标识;In the case that the information carried in the second message has not been tampered with, the first terminal device generates the second random number based on at least the first random number, the first key and the second random number. key, the first terminal device generates an integrity protection key and/or a confidentiality protection key based on the second key, and the first terminal device converts the M bits and the N The bits are combined to obtain the identification of the first key, the first terminal device generates y bits of the identification of the second key, and combines the x bits and the y bits Obtain the identification of the second key;
    在所述第二消息验证码有效的情况下,所述第一终端设备根据所述第二终端设备选取的安全算法、所述第二密钥、基于所述第二密钥生成完整性保护密钥和/或机密性保护密钥、所述第二终端设备选取的安全策略,与所述第二终端设备进行通信。When the second message verification code is valid, the first terminal device generates an integrity protection password based on the security algorithm selected by the second terminal device, the second key, and the second key. The key and/or the confidentiality protection key and the security policy selected by the second terminal device are used to communicate with the second terminal device.
  9. 如权利要求7或8所述的方法,其特征在于,The method according to claim 7 or 8, characterized in that,
    所述完整性保护密钥的输入参数包括以下至少之一:所述第二密钥,选定的算法类型标识符,选定的算法类型标识符的长度,完整性保护算法标识,完整性保护算法标识的长度;和/或,The input parameters of the integrity protection key include at least one of the following: the second key, the selected algorithm type identifier, the length of the selected algorithm type identifier, the integrity protection algorithm identifier, the integrity protection The length of the algorithm identifier; and/or,
    所述机密性保护密钥的输入参数包括以下至少之一:所述第二密钥,选定的算法类型标识符,选定的算法类型标识符的长度,机密性保护算法标识,机密性保护算法标识的长度。The input parameters of the confidentiality protection key include at least one of the following: the second key, the selected algorithm type identifier, the length of the selected algorithm type identifier, the confidentiality protection algorithm identifier, the confidentiality protection The length of the algorithm identifier.
  10. 如权利要求5或7所述的方法,其特征在于,The method according to claim 5 or 7, characterized in that,
    所述第一消息为认证响应消息,所述第二消息为安全模式命令消息。The first message is an authentication response message, and the second message is a security mode command message.
  11. 如权利要求6或8所述的方法,其特征在于,The method according to claim 6 or 8, characterized in that,
    所述第一消息为安全模式命令消息,所述第二消息为安全模式响应消息。The first message is a safe mode command message, and the second message is a safe mode response message.
  12. 如权利要求7至9中任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 7 to 9, characterized in that the method further includes:
    所述第一终端设备通过所述中继设备向所述第二终端设备发送第三消息;The first terminal device sends a third message to the second terminal device through the relay device;
    其中,所述第三消息用于指示安全模式建立完成,所述第三消息通过目标密钥进行加密,且所述第三消息包括以下至少之一:所述第二密钥的标识的所述y个比特位,第三消息验证码;Wherein, the third message is used to indicate that the security mode establishment is completed, the third message is encrypted by the target key, and the third message includes at least one of the following: the identification of the second key y bits, the third message verification code;
    其中,所述目标密钥包括以下之一:所述第一密钥,所述第二密钥,所述第二密钥派生的机密性保护密钥;Wherein, the target key includes one of the following: the first key, the second key, and a confidentiality protected key derived from the second key;
    其中,所述第三消息通过基于所述第二密钥生成的所述第三消息验证码进行完整性保护,或者,所述第三消息通过基于所述第二密钥派生的完整性保护密钥生成的所述第三消息验证码进行完整性保护,所述第三消息验证码的输入参数包括所述y个比特位。Wherein, the third message is integrity protected through the third message verification code generated based on the second key, or the third message is integrity protected through the integrity protection code derived based on the second key. The third message verification code generated by the key is used for integrity protection, and the input parameters of the third message verification code include the y bits.
  13. 如权利要求4所述的方法,其特征在于,所述方法还包括:The method of claim 4, further comprising:
    所述第一终端设备接收所述第二终端设备通过所述中继设备发送的错误消息;其中,所述错误消息包括以下至少之一:原因信息,第四消息验证码;其中,所述原因信息用于指示所述第二终端设备与所述第一终端设备的安全策略冲突,或者,所述原因信息用于指示所述第一消息验证码验证失败,或者,所述原因信息用于指示所述第二终端设备与所述第一终端设备的安全算法协商失败;所述第四消息验证码的输入参数包括以下至少之一:所述原因信息;The first terminal device receives an error message sent by the second terminal device through the relay device; wherein the error message includes at least one of the following: cause information, a fourth message verification code; wherein the cause The information is used to indicate that the security policy of the second terminal device conflicts with the security policy of the first terminal device, or the reason information is used to indicate that the first message verification code verification failed, or the reason information is used to indicate The security algorithm negotiation between the second terminal device and the first terminal device fails; the input parameters of the fourth message verification code include at least one of the following: the cause information;
    在所述第四消息验证码有效的情况下,所述第一终端设备确定安全模式建立失败,和/或,所述第一终端设备重新发起安全模式建立流程。If the fourth message verification code is valid, the first terminal device determines that the security mode establishment fails, and/or the first terminal device re-initiates the security mode establishment process.
  14. 如权利要求4至13中任一项所述的方法,其特征在于,The method according to any one of claims 4 to 13, characterized in that,
    所述完整性保护密钥包括控制面的完整性保护密钥和用户面的完整性保护密钥;和/或,The integrity protection key includes an integrity protection key for the control plane and an integrity protection key for the user plane; and/or,
    所述机密性保护密钥包括控制面的机密性保护密钥和用户面的机密性保护密钥。The confidentiality protection key includes a confidentiality protection key for the control plane and a confidentiality protection key for the user plane.
  15. 一种中继通信的方法,其特征在于,包括:A method for relaying communications, characterized by including:
    第二终端设备通过中继设备向第一终端设备发送认证请求消息;The second terminal device sends an authentication request message to the first terminal device through the relay device;
    其中,所述认证请求消息包括以下至少之一:所述第二终端设备所属用户的信息,所述第二终端设备生成的第一临时公钥,所述第二终端设备的签名,所述中继设备的相关信息;Wherein, the authentication request message includes at least one of the following: information about the user to which the second terminal device belongs, the first temporary public key generated by the second terminal device, the signature of the second terminal device, the Relevant information about relay equipment;
    其中,所述第二终端设备所属用户的信息包括所述第二终端设备的标识和所述第二终端设备的公共验证令牌PVT和密钥管理服务器的公共认证密钥KPAK;所述第二终端设备的签名的输入参数包括以下至少之一:所述第二终端设备所属用户的信息和所述第一临时公钥;所述第一临时公钥和所述中继设备的相关信息用于所述第一终端设备派生第一密钥;所述中继设备的相关信息包括以下之一:所述中继设备的身份信息,所述中继设备生成的随机数,所述中继设备生成的计数器。Wherein, the information of the user to which the second terminal device belongs includes the identification of the second terminal device, the public verification token PVT of the second terminal device and the public authentication key KPAK of the key management server; the second The input parameters of the terminal device's signature include at least one of the following: information about the user to which the second terminal device belongs and the first temporary public key; and information related to the first temporary public key and the relay device. The first terminal device derives a first key; the relevant information of the relay device includes one of the following: the identity information of the relay device, the random number generated by the relay device, the counter.
  16. 如权利要求15所述的方法,其特征在于,The method of claim 15, characterized in that:
    所述第二终端设备的签名由所述第二终端设备的秘密签名密钥生成。The signature of the second terminal device is generated by the secret signature key of the second terminal device.
  17. 如权利要求15或16所述的方法,其特征在于,所述方法还包括:The method according to claim 15 or 16, characterized in that the method further includes:
    所述第二终端设备接收所述第一终端设备通过所述中继设备发送的第一消息;The second terminal device receives the first message sent by the first terminal device through the relay device;
    其中,所述第一消息包括以下至少之一:所述第一终端设备的安全能力信息,所述第一终端设备的安全策略信息,所述第一终端设备所属用户的信息,所述中继设备所属用户的信息,所述第一终端设备生成的第一随机数,所述第一终端设备生成的第二临时公钥,所述第一终端设备生成的所述第一密钥的标识的M个比特位,所述第一终端设备的签名,所述中继设备的签名,第一消息验证码;Wherein, the first message includes at least one of the following: security capability information of the first terminal device, security policy information of the first terminal device, information of the user to which the first terminal device belongs, the relay Information about the user to whom the device belongs, the first random number generated by the first terminal device, the second temporary public key generated by the first terminal device, and the identification of the first key generated by the first terminal device. M bits, the signature of the first terminal device, the signature of the relay device, and the first message verification code;
    其中,所述第一终端设备所属用户的信息包括所述第一终端设备的标识和所述第一终端设备的PVT和KPAK;所述中继设备所属用户的信息包括所述中继设备的标识和所述中继设备的PVT和KPAK;所述第一终端设备的签名的输入参数包括以下至少之一:所述第一终端设备所属用户的信息,所述第二临时公钥,所述M个比特位,所述第二终端设备的签名;所述中继设备的签名的输入参数包括以下至少之一:所述中继设备所属用户的信息,所述第一终端设备的签名,所述第二终端设备的签名,所述第一消息;Wherein, the information about the user to which the first terminal device belongs includes the identification of the first terminal device and the PVT and KPAK of the first terminal device; the information about the user to which the relay device belongs includes the identification of the relay device. and the PVT and KPAK of the relay device; the input parameters of the signature of the first terminal device include at least one of the following: information of the user to which the first terminal device belongs, the second temporary public key, the M bits, the signature of the second terminal device; the input parameters of the signature of the relay device include at least one of the following: information of the user to which the relay device belongs, the signature of the first terminal device, the The signature of the second terminal device, the first message;
    其中,所述第一消息通过基于所述第一密钥生成的所述第一消息验证码进行完整性保护,且所述第一消息验证码的输入参数包括以下至少之一:所述第一终端设备的安全能力信息,所述第一终端设备的安全策略信息,所述第一终端设备所属用户的信息,所述第一随机数,所述第二临时公钥,所述M个比特位,所述第一终端设备的签名;Wherein, the first message is integrity protected by the first message verification code generated based on the first key, and the input parameters of the first message verification code include at least one of the following: the first Security capability information of the terminal device, security policy information of the first terminal device, information of the user to which the first terminal device belongs, the first random number, the second temporary public key, the M bits , the signature of the first terminal device;
    其中,所述第二临时公钥和所述中继设备的相关信息用于所述第二终端设备派生所述第一密钥,所述第一随机数、所述第一密钥和所述第二终端设备生成的第二随机数用于派生第二密钥,所述第二密钥用于派生完整性保护密钥和/或机密性保护密钥,所述第一密钥的标识由所述M个比特位与所述第一密钥的标识的另外N个比特位合并得到,M和N均为正整数。Wherein, the second temporary public key and the relevant information of the relay device are used by the second terminal device to derive the first key, the first random number, the first key and the The second random number generated by the second terminal device is used to derive a second key, the second key is used to derive an integrity protection key and/or a confidentiality protection key, and the identity of the first key is given by The M bits are combined with the other N bits of the identifier of the first key, and M and N are both positive integers.
  18. 如权利要求17所述的方法,其特征在于,The method of claim 17, characterized in that:
    所述第一终端设备的签名由所述第一终端设备的秘密签名密钥生成,和/或,所述中继设备的签名由所述中继设备的秘密签名密钥生成。The signature of the first terminal device is generated by the secret signature key of the first terminal device, and/or the signature of the relay device is generated by the secret signature key of the relay device.
  19. 如权利要求17或18所述的方法,其特征在于,所述方法还包括:The method according to claim 17 or 18, characterized in that the method further includes:
    所述第二终端设备分别检查所述第一终端设备的KPAK和所述中继设备的KPAK,在所述第一终端设备的KPAK和所述中继设备的KPAK有效的情况下,且基于所述第一终端设备的标识和所述第一终端设备的PVT对所述第一终端设备的签名进行验证,以及基于所述中继设备的标识和所述中继设备的PVT对所述中继设备的签名进行验证;The second terminal device checks the KPAK of the first terminal device and the KPAK of the relay device respectively. If the KPAK of the first terminal device and the KPAK of the relay device are valid, and based on the Verify the signature of the first terminal device based on the identification of the first terminal device and the PVT of the first terminal device, and verify the relay based on the identification of the relay device and the PVT of the relay device. The device’s signature is verified;
    在所述第一终端设备的签名和所述中继设备的签名验证成功,且所述第一消息中携带的信息未遭受篡改的情况下,所述第二终端设备生成第二随机数,所述第二终端设备至少根据所述第一随机数、所述第一密钥和所述第二随机数生成所述第二密钥,所述第二终端设备根据所述第二密钥生成完整性保护密钥和/或机密性保护密钥,以及所述第二终端设备生成所述第一密钥的标识的N个比特位,并将所述M个比特位和所述N个比特位合并得到所述第一密钥的标识;When the signature of the first terminal device and the signature of the relay device are verified successfully, and the information carried in the first message has not been tampered with, the second terminal device generates a second random number, so The second terminal device generates the second key based on at least the first random number, the first key and the second random number, and the second terminal device generates a complete key based on the second key. sexual protection key and/or confidentiality protection key, and the second terminal device generates N bits of the identification of the first key, and combines the M bits and the N bits Merge to obtain the identity of the first key;
    在所述第一消息验证码有效的情况下,所述第二终端设备通过所述中继设备向所述第一终端设备发送第二消息;其中,所述第二消息包括以下至少之一:所述第二随机数,所述N个比特位,所述第二终端设备生成的所述第二密钥的标识的x个比特位,所述第二终端设备选取的安全算法,所述第二终端设备选取的安全策略,第二消息验证码;When the first message verification code is valid, the second terminal device sends a second message to the first terminal device through the relay device; wherein the second message includes at least one of the following: The second random number, the N bits, the x bits of the identifier of the second key generated by the second terminal device, the security algorithm selected by the second terminal device, the third The second security policy selected by the terminal device, the second message verification code;
    其中,所述第二消息通过基于所述第二密钥生成的所述第二消息验证码进行完整性保护,或者,所述第二消息通过基于所述第二密钥派生的完整性保护密钥生成的所述第二消息验证码进行完整性保护,且所述第二消息验证码的输入参数包括以下至少之一:所述第二随机数,所述N个比特位,所述x个比特位,所述第二终端设备选取的安全算法,所述第二终端设备选取的安全策略;其中,所述第二密钥的标识由所述x个比特位与所述第二密钥的标识的另外y个比特位合并得到,x和y均为正整数。Wherein, the second message is integrity protected through the second message verification code generated based on the second key, or the second message is integrity protected through the integrity protection code derived based on the second key. The second message verification code generated by the key is integrity protected, and the input parameters of the second message verification code include at least one of the following: the second random number, the N bits, the x bits, the security algorithm selected by the second terminal device, the security policy selected by the second terminal device; wherein, the identification of the second key is composed of the x bits and the second key The other y bits of the identifier are combined, and x and y are both positive integers.
  20. 如权利要求19所述的方法,其特征在于,The method of claim 19, characterized in that:
    所述第二消息通过所述第一密钥进行加密。The second message is encrypted with the first key.
  21. 如权利要求19所述的方法,其特征在于,The method of claim 19, characterized in that:
    所述第一消息为认证响应消息,所述第二消息为安全模式命令消息。The first message is an authentication response message, and the second message is a security mode command message.
  22. 如权利要求20所述的方法,其特征在于,The method of claim 20, characterized in that:
    所述第一消息为安全模式命令消息,所述第二消息为安全模式响应消息。The first message is a safe mode command message, and the second message is a safe mode response message.
  23. 如权利要求19至22中任一项所述的方法,其特征在于,The method according to any one of claims 19 to 22, characterized in that,
    所述完整性保护密钥的输入参数包括以下至少之一:所述第二密钥,选定的算法类型标识符,选定的算法类型标识符的长度,完整性保护算法标识,完整性保护算法标识的长度;和/或,The input parameters of the integrity protection key include at least one of the following: the second key, the selected algorithm type identifier, the length of the selected algorithm type identifier, the integrity protection algorithm identifier, the integrity protection The length of the algorithm identifier; and/or,
    所述机密性保护密钥的输入参数包括以下至少之一:所述第二密钥,选定的算法类型标识符,选定的算法类型标识符的长度,机密性保护算法标识,机密性保护算法标识的长度。The input parameters of the confidentiality protection key include at least one of the following: the second key, the selected algorithm type identifier, the length of the selected algorithm type identifier, the confidentiality protection algorithm identifier, the confidentiality protection The length of the algorithm identifier.
  24. 如权利要求19至23中任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 19 to 23, characterized in that the method further includes:
    所述第二终端设备接收所述第一终端设备通过所述中继设备发送的第三消息;The second terminal device receives the third message sent by the first terminal device through the relay device;
    其中,所述第三消息用于指示安全模式建立完成,所述第三消息通过目标密钥进行加密,且所述第三消息包括以下至少之一:所述第一终端设备生成的所述第二密钥的标识的y个比特位,第三消息验证码;Wherein, the third message is used to indicate that the security mode establishment is completed, the third message is encrypted by a target key, and the third message includes at least one of the following: the third message generated by the first terminal device. y bits of the identifier of the second key, and the third message verification code;
    其中,所述目标密钥包括以下之一:所述第一密钥,所述第二密钥,所述第二密钥派生的机密性保护密钥;Wherein, the target key includes one of the following: the first key, the second key, and a confidentiality protected key derived from the second key;
    其中,所述第三消息通过基于所述第二密钥生成的所述第三消息验证码进行完整性保护,或者,所述第三消息通过基于所述第二密钥派生的完整性保护密钥生成的所述第三消息验证码进行完整性保护,所述第三消息验证码的输入参数包括所述y个比特位。Wherein, the third message is integrity protected through the third message verification code generated based on the second key, or the third message is integrity protected through the integrity protection code derived based on the second key. The third message verification code generated by the key is used for integrity protection, and the input parameters of the third message verification code include the y bits.
  25. 如权利要求24所述的方法,其特征在于,所述方法还包括:The method of claim 24, further comprising:
    所述第二终端设备通过所述目标密钥对所述第三消息进行解密;The second terminal device decrypts the third message using the target key;
    在所述第三消息中携带的信息未遭受篡改的情况下,且所述第三消息验证码有效的情况下,所述第二终端设备将所述x个比特位与所述y个比特位合并得到所述第二密钥的标识。When the information carried in the third message has not been tampered with and the third message verification code is valid, the second terminal device combines the x bits with the y bits. Combined to obtain the identity of the second key.
  26. 如权利要求17或18所述的方法,其特征在于,所述方法还包括:The method according to claim 17 or 18, characterized in that the method further includes:
    所述第二终端设备通过所述中继设备向所述第一终端设备发送错误消息;其中,所述错误消息包括以下至少之一:原因信息,第四消息验证码;其中,所述原因信息用于指示所述第二终端设备与所述第一终端设备的安全策略冲突,或者,所述原因信息用于指示所述第一消息验证码验证失败,或者,所述原因信息用于指示所述第二终端设备与所述第一终端设备的安全算法协商失败;所述第四消息验证码的输入参数包括以下至少之一:所述原因信息。The second terminal device sends an error message to the first terminal device through the relay device; wherein the error message includes at least one of the following: cause information, a fourth message verification code; wherein the cause information The reason information is used to indicate that the security policy of the second terminal device conflicts with the security policy of the first terminal device, or the reason information is used to indicate that the first message verification code verification fails, or the reason information is used to indicate that the first message verification code verification fails. The security algorithm negotiation between the second terminal device and the first terminal device fails; the input parameter of the fourth message verification code includes at least one of the following: the cause information.
  27. 如权利要求17至26中任一项所述的方法,其特征在于,The method according to any one of claims 17 to 26, characterized in that,
    所述完整性保护密钥包括控制面的完整性保护密钥和用户面的完整性保护密钥;和/或,The integrity protection key includes an integrity protection key for the control plane and an integrity protection key for the user plane; and/or,
    所述机密性保护密钥包括控制面的机密性保护密钥和用户面的机密性保护密钥。The confidentiality protection key includes a confidentiality protection key for the control plane and a confidentiality protection key for the user plane.
  28. 一种中继通信的方法,其特征在于,包括:A method for relaying communications, characterized by including:
    中继设备接收第二终端设备发送的认证请求消息;其中,所述认证请求消息包括以下至少之一:所述第二终端设备所属用户的信息,所述第二终端设备生成的第一临时公钥,所述第二终端设备的签名;其中,所述第二终端设备所属用户的信息包括所述第二终端设备的标识和所述第二终端设备的公共验证令牌PVT和密钥管理服务器的公共认证密钥KPAK;所述第二终端设备的签名的输入参数包括以下至少之一:所述第二终端设备所属用户的信息和所述第一临时公钥;The relay device receives an authentication request message sent by the second terminal device; wherein the authentication request message includes at least one of the following: information about the user to which the second terminal device belongs, a first temporary public address generated by the second terminal device. key, the signature of the second terminal device; wherein the information of the user to which the second terminal device belongs includes the identification of the second terminal device and the public verification token PVT and key management server of the second terminal device. The public authentication key KPAK; the input parameters of the signature of the second terminal device include at least one of the following: information of the user to which the second terminal device belongs and the first temporary public key;
    在所述第二终端设备的KPAK有效,且基于所述第二终端设备的标识和所述第二终端设备的PVT对所述第二终端设备的签名验证成功的情况下,所述中继设备向第一终端设备发送验证之后的认证请求消息;其中,所述验证之后的认证请求消息包括以下至少之一:所述第二终端设备所属用户的信息,所述中继设备所属用户的信息,所述第一临时公钥,所述第二终端设备的签名,所述中继设备的签名,所述中继设备的相关信息;其中,所述中继设备所属用户的信息包括所述中继设备的标识和所述中继设备的PVT和KPAK;所述中继设备的签名的输入参数包括以下至少之一:所述第二终端设备的签名和所述中继设备所属用户的信息;其中,所述第一临时公钥和所述中继设备的相关信息用于所述第一终端设备派生第一密钥;所述中继设备的相关信息包括以下之一:所述中继设备的身份信息,所述中继设备生成的随机数,所述中继设备生成的计数器。When the KPAK of the second terminal device is valid and the signature verification of the second terminal device is successful based on the identification of the second terminal device and the PVT of the second terminal device, the relay device Send an authentication request message after verification to the first terminal device; wherein the authentication request message after verification includes at least one of the following: information about the user to which the second terminal device belongs, information about the user to which the relay device belongs, The first temporary public key, the signature of the second terminal device, the signature of the relay device, and the relevant information of the relay device; wherein the information of the user to which the relay device belongs includes the relay device. The identification of the device and the PVT and KPAK of the relay device; the input parameters of the signature of the relay device include at least one of the following: the signature of the second terminal device and the information of the user to which the relay device belongs; wherein , the first temporary public key and the relevant information of the relay device are used by the first terminal device to derive the first key; the relevant information of the relay device includes one of the following: Identity information, random numbers generated by the relay device, and counters generated by the relay device.
  29. 如权利要求28所述的方法,其特征在于,The method of claim 28, characterized in that:
    所述第二终端设备的签名由所述第二终端设备的秘密签名密钥生成,和/或,所述中继设备的签名由所述中继设备的秘密签名密钥生成。The signature of the second terminal device is generated by the secret signature key of the second terminal device, and/or the signature of the relay device is generated by the secret signature key of the relay device.
  30. 如权利要求28或29所述的方法,其特征在于,所述方法还包括:The method according to claim 28 or 29, characterized in that the method further includes:
    所述中继设备接收所述第一终端设备发送的第一消息;其中,所述第一消息包括以下至少之一: 所述第一终端设备的安全能力信息,所述第一终端设备的安全策略信息,所述第一终端设备所属用户的信息,所述第一终端设备生成的第一随机数,所述第一终端设备生成的第二临时公钥,所述第一终端设备生成的所述第一密钥的标识的M个比特位,所述第一终端设备的签名,第一消息验证码;其中,所述第一终端设备所属用户的信息包括所述第一终端设备的标识和所述第一终端设备的PVT和KPAK;所述第一终端设备的签名的输入参数包括以下至少之一:所述第一终端设备所属用户的信息,所述第二临时公钥,所述M个比特位,所述第二终端设备的签名;其中,所述第一消息通过基于所述第一密钥生成的所述第一消息验证码进行完整性保护,且所述第一消息验证码的输入参数包括以下至少之一:所述第一终端设备的安全能力信息,所述第一终端设备的安全策略信息,所述第一终端设备所属用户的信息,所述第一随机数,所述第二临时公钥,所述M个比特位,所述第一终端设备的签名;The relay device receives the first message sent by the first terminal device; wherein the first message includes at least one of the following: security capability information of the first terminal device, security capability information of the first terminal device, Policy information, information about the user to which the first terminal device belongs, the first random number generated by the first terminal device, the second temporary public key generated by the first terminal device, all the information generated by the first terminal device. M bits of the identification of the first key, the signature of the first terminal device, and the first message verification code; wherein the information of the user to which the first terminal device belongs includes the identification of the first terminal device and The PVT and KPAK of the first terminal device; the input parameters of the signature of the first terminal device include at least one of the following: information of the user to which the first terminal device belongs, the second temporary public key, the M bits, the signature of the second terminal device; wherein the first message is integrity protected by the first message verification code generated based on the first key, and the first message verification code The input parameters include at least one of the following: security capability information of the first terminal device, security policy information of the first terminal device, information of the user to which the first terminal device belongs, the first random number, the The second temporary public key, the M bits, and the signature of the first terminal device;
    在所述第一终端设备的KPAK有效,且基于所述第一终端设备的标识和所述第一终端设备的PVT对所述第一终端设备的签名验证成功的情况下,所述中继设备向所述第二终端设备发送验证之后的第一消息;其中,所述验证之后的第一消息包括以下至少之一:所述第一终端设备的安全能力信息,所述第一终端设备的安全策略信息,所述第一终端设备所属用户的信息,所述中继设备所属用户的信息,所述第一终端设备生成的第一随机数,所述第一终端设备生成的与所述第二临时私钥配对的第二临时公钥,所述第一终端设备生成的所述第一密钥的标识的M个比特位,所述第一终端设备的签名,所述中继设备的签名,所述第一消息验证码;其中,所述中继设备所属用户的信息包括所述中继设备的标识和所述中继设备的PVT和KPAK;所述中继设备的签名的输入参数包括以下至少之一:所述中继设备所属用户的信息,所述第一终端设备的签名,所述第二终端设备的签名,所述验证之后的第一消息;When the KPAK of the first terminal device is valid and the signature verification of the first terminal device is successful based on the identity of the first terminal device and the PVT of the first terminal device, the relay device Send a first message after verification to the second terminal device; wherein the first message after verification includes at least one of the following: security capability information of the first terminal device, security capability information of the first terminal device, Policy information, information about the user to which the first terminal device belongs, information about the user to which the relay device belongs, the first random number generated by the first terminal device, the number generated by the first terminal device and the second random number generated by the first terminal device. The second temporary public key of the temporary private key pairing, M bits of the identification of the first key generated by the first terminal device, the signature of the first terminal device, the signature of the relay device, The first message verification code; wherein the information of the user to which the relay device belongs includes the identification of the relay device and the PVT and KPAK of the relay device; the input parameters of the signature of the relay device include the following At least one of: the information of the user to which the relay device belongs, the signature of the first terminal device, the signature of the second terminal device, and the first message after the verification;
    其中,所述第二临时公钥和所述中继设备的相关信息用于所述第二终端设备派生所述第一密钥,所述第一随机数、所述第一密钥和所述第二终端设备生成的第二随机数用于派生第二密钥,所述第二密钥用于派生完整性保护密钥和/或机密性保护密钥,所述第一密钥的标识由所述M个比特位与所述第一密钥的标识的另外N个比特位合并得到,M和N均为正整数。Wherein, the second temporary public key and the relevant information of the relay device are used by the second terminal device to derive the first key, the first random number, the first key and the The second random number generated by the second terminal device is used to derive a second key, the second key is used to derive an integrity protection key and/or a confidentiality protection key, and the identity of the first key is given by The M bits are combined with the other N bits of the identifier of the first key, and M and N are both positive integers.
  31. 如权利要求30所述的方法,其特征在于,所述方法还包括:The method of claim 30, further comprising:
    所述中继设备将所述第二终端设备发送的第二消息转发至所述第一终端设备;The relay device forwards the second message sent by the second terminal device to the first terminal device;
    其中,所述第二消息包括以下至少之一:所述第二终端设备生成的所述第二随机数,所述第二终端设备生成的所述第一密钥的标识的N个比特位,所述第二终端设备生成的所述第二密钥的标识的x个比特位,所述第二终端设备选取的安全算法,所述第二终端设备选取的安全策略,第二消息验证码;Wherein, the second message includes at least one of the following: the second random number generated by the second terminal device, N bits of the identification of the first key generated by the second terminal device, x bits of the identification of the second key generated by the second terminal device, the security algorithm selected by the second terminal device, the security policy selected by the second terminal device, and the second message verification code;
    其中,所述第二消息通过基于所述第二密钥生成的所述第二消息验证码进行完整性保护,或者,所述第二消息通过基于所述第二密钥派生的完整性保护密钥生成的所述第二消息验证码进行完整性保护,且所述第二消息验证码的输入参数包括以下至少之一:所述第二随机数,所述N个比特位,所述x个比特位,所述第二终端设备选取的安全算法,所述第二终端设备选取的安全策略;其中,所述第二密钥的标识由所述x个比特位与所述第二密钥的标识的另外y个比特位合并得到,x和y均为正整数。Wherein, the second message is integrity protected through the second message verification code generated based on the second key, or the second message is integrity protected through the integrity protection code derived based on the second key. The second message verification code generated by the key is integrity protected, and the input parameters of the second message verification code include at least one of the following: the second random number, the N bits, the x bits, the security algorithm selected by the second terminal device, the security policy selected by the second terminal device; wherein, the identification of the second key is composed of the x bits and the second key The other y bits of the identifier are combined, and x and y are both positive integers.
  32. 如权利要求31所述的方法,其特征在于,The method of claim 31, wherein:
    所述第二消息通过所述第一密钥进行加密,或者,所述第二消息不用于所述第一密钥进行加密。The second message is encrypted using the first key, or the second message is not encrypted using the first key.
  33. 如权利要求31所述的方法,其特征在于,The method of claim 31, wherein:
    所述第一消息为认证响应消息,所述第二消息为安全模式命令消息。The first message is an authentication response message, and the second message is a security mode command message.
  34. 如权利要求32所述的方法,其特征在于,The method of claim 32, wherein:
    所述第一消息为安全模式命令消息,所述第二消息为安全模式响应消息。The first message is a safe mode command message, and the second message is a safe mode response message.
  35. 如权利要求30至34中任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 30 to 34, wherein the method further includes:
    所述中继设备将所述第一终端设备发送的第三消息转发至所述第二终端设备;The relay device forwards the third message sent by the first terminal device to the second terminal device;
    其中,所述第三消息用于指示安全模式建立完成,所述第三消息通过目标密钥进行加密,且所述第三消息包括以下至少之一:所述第一终端设备生成的所述第二密钥的标识的y个比特位,第三消息验证码;Wherein, the third message is used to indicate that the security mode establishment is completed, the third message is encrypted by a target key, and the third message includes at least one of the following: the third message generated by the first terminal device. y bits of the identifier of the second key, and the third message verification code;
    其中,所述目标密钥包括以下之一:所述第一密钥,所述第二密钥,所述第二密钥派生的机密性保护密钥;Wherein, the target key includes one of the following: the first key, the second key, and a confidentiality protected key derived from the second key;
    其中,所述第三消息通过基于所述第二密钥生成的所述第三消息验证码进行完整性保护,或者,所述第三消息通过基于所述第二密钥派生的完整性保护密钥生成的所述第三消息验证码进行完整性保护,所述第三消息验证码的输入参数包括所述y个比特位。Wherein, the third message is integrity protected through the third message verification code generated based on the second key, or the third message is integrity protected through the integrity protection code derived based on the second key. The third message verification code generated by the key is used for integrity protection, and the input parameters of the third message verification code include the y bits.
  36. 如权利要求30所述的方法,其特征在于,所述方法还包括:The method of claim 30, further comprising:
    所述中继设备将所述第二终端设备发送的错误消息转发至所述第一终端设备;其中,所述错误消息包括以下至少之一:原因信息,第四消息验证码;其中,所述原因信息用于指示所述第二终端设备与所述第一终端设备的安全策略冲突,或者,所述原因信息用于指示所述第一消息验证码验证失败,或者,所述原因信息用于指示所述第二终端设备与所述第一终端设备的安全算法协商失败;所述第四消息验证码的输入参数包括以下至少之一:所述原因信息。The relay device forwards the error message sent by the second terminal device to the first terminal device; wherein the error message includes at least one of the following: cause information, a fourth message verification code; wherein, the The reason information is used to indicate that the security policy of the second terminal device conflicts with the first terminal device, or the reason information is used to indicate that the first message verification code verification fails, or the reason information is used to Indicates that the security algorithm negotiation between the second terminal device and the first terminal device failed; the input parameter of the fourth message verification code includes at least one of the following: the cause information.
  37. 如权利要求30至35中任一项所述的方法,其特征在于,The method according to any one of claims 30 to 35, characterized in that,
    所述完整性保护密钥包括控制面的完整性保护密钥和用户面的完整性保护密钥;和/或,The integrity protection key includes an integrity protection key for the control plane and an integrity protection key for the user plane; and/or,
    所述机密性保护密钥包括控制面的机密性保护密钥和用户面的机密性保护密钥。The confidentiality protection key includes a confidentiality protection key for the control plane and a confidentiality protection key for the user plane.
  38. 一种中继通信的方法,其特征在于,包括:A method for relaying communications, characterized by including:
    第一终端设备通过中继设备向第二终端设备发送第一消息;The first terminal device sends the first message to the second terminal device through the relay device;
    其中,所述第一消息包括以下至少之一:所述第一终端设备的安全能力信息,所述第一终端设备的安全策略信息,所述第一终端设备所属用户的信息,所述第一终端设备生成的第一随机数,所述第一终端设备生成的第二临时公钥,所述第一终端设备生成的第一密钥的标识的M个比特位,所述第一终端设备的签名,第一消息验证码;Wherein, the first message includes at least one of the following: security capability information of the first terminal device, security policy information of the first terminal device, information of the user to which the first terminal device belongs, the first The first random number generated by the terminal device, the second temporary public key generated by the first terminal device, the M bits of the identification of the first key generated by the first terminal device, the Signature, first message verification code;
    其中,所述第一终端设备所属用户的信息包括所述第一终端设备的标识和所述第一终端设备的公共验证令牌PVT和密钥管理服务器的公共认证密钥KPAK;所述第一终端设备的签名的输入参数包括以下至少之一:所述第一终端设备所属用户的信息,所述第二临时公钥,所述M个比特位,所述第二终端设备的签名;Wherein, the information of the user to which the first terminal device belongs includes the identification of the first terminal device, the public verification token PVT of the first terminal device and the public authentication key KPAK of the key management server; the first The input parameters of the signature of the terminal device include at least one of the following: information of the user to which the first terminal device belongs, the second temporary public key, the M bits, and the signature of the second terminal device;
    其中,所述第一消息通过基于所述第一密钥生成的所述第一消息验证码进行完整性保护,且所述第一消息验证码的输入参数包括以下至少之一:所述第一终端设备的安全能力信息,所述第一终端设备的安全策略信息,所述第一终端设备所属用户的信息,所述第一随机数,所述第二临时公钥,所述M个比特位,所述第一终端设备的签名;Wherein, the first message is integrity protected by the first message verification code generated based on the first key, and the input parameters of the first message verification code include at least one of the following: the first Security capability information of the terminal device, security policy information of the first terminal device, information of the user to which the first terminal device belongs, the first random number, the second temporary public key, the M bits , the signature of the first terminal device;
    其中,所述第二临时公钥和所述中继设备的相关信息用于所述第二终端设备派生所述第一密钥,所述第一随机数、所述第一密钥和所述第二终端设备生成的第二随机数用于派生第二密钥,所述第二密钥用于派生完整性保护密钥和/或机密性保护密钥,所述第一密钥的标识由所述M个比特位与所述第一密钥的标识的另外N个比特位合并得到,M和N均为正整数;Wherein, the second temporary public key and the relevant information of the relay device are used by the second terminal device to derive the first key, the first random number, the first key and the The second random number generated by the second terminal device is used to derive a second key, the second key is used to derive an integrity protection key and/or a confidentiality protection key, and the identity of the first key is given by The M bits are obtained by combining the other N bits of the identification of the first key, where M and N are both positive integers;
    其中,所述中继设备的相关信息包括以下之一:所述中继设备的身份信息,所述中继设备生成的随机数,所述中继设备生成的计数器。Wherein, the relevant information of the relay device includes one of the following: identity information of the relay device, a random number generated by the relay device, and a counter generated by the relay device.
  39. 如权利要求38所述的方法,其特征在于,所述方法还包括:The method of claim 38, further comprising:
    所述第一终端设备接收所述第二终端设备通过所述中继设备发送的第二消息;The first terminal device receives the second message sent by the second terminal device through the relay device;
    其中,所述第二消息包括以下至少之一:所述第二终端设备生成的所述第二随机数,所述第二终端设备生成的所述第一密钥的标识的N个比特位,所述第二终端设备生成的所述第二密钥的标识的x个比特位,所述第二终端设备选取的安全算法,所述第二终端设备选取的安全策略,第二消息验证码;Wherein, the second message includes at least one of the following: the second random number generated by the second terminal device, N bits of the identification of the first key generated by the second terminal device, x bits of the identification of the second key generated by the second terminal device, the security algorithm selected by the second terminal device, the security policy selected by the second terminal device, and the second message verification code;
    其中,所述第二消息通过基于所述第二密钥生成的所述第二消息验证码进行完整性保护,或者,所述第二消息通过基于所述第二密钥派生的完整性保护密钥生成的所述第二消息验证码进行完整性保护,且所述第二消息验证码的输入参数包括以下至少之一:所述第二随机数,所述N个比特位,所述x个比特位,所述第二终端设备选取的安全算法,所述第二终端设备选取的安全策略;其中,所述第二密钥的标识由所述x个比特位与所述第二密钥的标识的另外y个比特位合并得到,x和y均为正整数。Wherein, the second message is integrity protected through the second message verification code generated based on the second key, or the second message is integrity protected through the integrity protection code derived based on the second key. The second message verification code generated by the key is integrity protected, and the input parameters of the second message verification code include at least one of the following: the second random number, the N bits, the x bits, the security algorithm selected by the second terminal device, the security policy selected by the second terminal device; wherein, the identification of the second key is composed of the x bits and the second key The other y bits of the identifier are combined, and x and y are both positive integers.
  40. 如权利要求39所述的方法,其特征在于,The method of claim 39, wherein:
    所述第二消息通过所述第一密钥进行加密,或者,所述第二消息不用于所述第一密钥进行加密。The second message is encrypted using the first key, or the second message is not encrypted using the first key.
  41. 如权利要求39所述的方法,其特征在于,所述方法还包括:The method of claim 39, further comprising:
    在所述第二消息中携带的信息未遭受篡改的情况下,所述第一终端设备至少根据所述第一随机数、所述第一密钥和所述第二随机数生成所述第二密钥,所述第一终端设备根据所述第二密钥生成完整性保护密钥和/或机密性保护密钥,以及所述第一终端设备将所述M个比特位和所述N个比特位合并得到所述第一密钥的标识,所述第一终端设备生成所述第二密钥的标识的y个比特位,并将所述x个比特位和所述y个比特位合并得到所述第二密钥的标识;In the case that the information carried in the second message has not been tampered with, the first terminal device generates the second random number based on at least the first random number, the first key and the second random number. key, the first terminal device generates an integrity protection key and/or a confidentiality protection key based on the second key, and the first terminal device converts the M bits and the N The bits are combined to obtain the identification of the first key, the first terminal device generates y bits of the identification of the second key, and combines the x bits and the y bits Obtain the identification of the second key;
    在所述第二消息验证码有效的情况下,所述第一终端设备根据所述第二终端设备选取的安全算法、所述第二密钥、基于所述第二密钥生成完整性保护密钥和/或机密性保护密钥、所述第二终端设备选取的安全策略,与所述第二终端设备进行通信。When the second message verification code is valid, the first terminal device generates an integrity protection password based on the security algorithm selected by the second terminal device, the second key, and the second key. The key and/or the confidentiality protection key and the security policy selected by the second terminal device are used to communicate with the second terminal device.
  42. 如权利要求40所述的方法,其特征在于,所述方法还包括:The method of claim 40, further comprising:
    所述第一终端设备根据所述第一密钥解密所述第二消息;The first terminal device decrypts the second message according to the first key;
    在所述第二消息中携带的信息未遭受篡改的情况下,所述第一终端设备至少根据所述第一随机数、所述第一密钥和所述第二随机数生成所述第二密钥,所述第一终端设备根据所述第二密钥生成完整性保护密钥和/或机密性保护密钥,以及所述第一终端设备将所述M个比特位和所述N个比特位合并得到所述第一密钥的标识,所述第一终端设备生成所述第二密钥的标识的y个比特位,并将所述x个比特位和所述y个比特位合并得到所述第二密钥的标识;In the case that the information carried in the second message has not been tampered with, the first terminal device generates the second random number based on at least the first random number, the first key and the second random number. key, the first terminal device generates an integrity protection key and/or a confidentiality protection key based on the second key, and the first terminal device converts the M bits and the N The bits are combined to obtain the identification of the first key, the first terminal device generates y bits of the identification of the second key, and combines the x bits and the y bits Obtain the identification of the second key;
    在所述第二消息验证码有效的情况下,所述第一终端设备根据所述第二终端设备选取的安全算法、所述第二密钥、基于所述第二密钥生成完整性保护密钥和/或机密性保护密钥、所述第二终端设备选取的安全策略,与所述第二终端设备进行通信。When the second message verification code is valid, the first terminal device generates an integrity protection password based on the security algorithm selected by the second terminal device, the second key, and the second key. The key and/or the confidentiality protection key and the security policy selected by the second terminal device are used to communicate with the second terminal device.
  43. 如权利要求41或42所述的方法,其特征在于,The method of claim 41 or 42, characterized in that,
    所述完整性保护密钥的输入参数包括以下至少之一:所述第二密钥,选定的算法类型标识符,选定的算法类型标识符的长度,完整性保护算法标识,完整性保护算法标识的长度;和/或,The input parameters of the integrity protection key include at least one of the following: the second key, the selected algorithm type identifier, the length of the selected algorithm type identifier, the integrity protection algorithm identifier, the integrity protection The length of the algorithm identifier; and/or,
    所述机密性保护密钥的输入参数包括以下至少之一:所述第二密钥,选定的算法类型标识符,选定的算法类型标识符的长度,机密性保护算法标识,机密性保护算法标识的长度。The input parameters of the confidentiality protection key include at least one of the following: the second key, the selected algorithm type identifier, the length of the selected algorithm type identifier, the confidentiality protection algorithm identifier, the confidentiality protection The length of the algorithm identifier.
  44. 如权利要求39或41所述的方法,其特征在于,The method according to claim 39 or 41, characterized in that,
    所述第一消息为认证响应消息,所述第二消息为安全模式命令消息。The first message is an authentication response message, and the second message is a security mode command message.
  45. 如权利要求40或42所述的方法,其特征在于,The method of claim 40 or 42, characterized in that,
    所述第一消息为安全模式命令消息,所述第二消息为安全模式响应消息。The first message is a safe mode command message, and the second message is a safe mode response message.
  46. 如权利要求41至43中任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 41 to 43, characterized in that the method further includes:
    所述第一终端设备通过所述中继设备向所述第二终端设备发送第三消息;The first terminal device sends a third message to the second terminal device through the relay device;
    其中,所述第三消息用于指示安全模式建立完成,所述第三消息通过目标密钥进行加密,且所述第三消息包括以下至少之一:所述第二密钥的标识的所述y个比特位,第三消息验证码;Wherein, the third message is used to indicate that the security mode establishment is completed, the third message is encrypted by the target key, and the third message includes at least one of the following: the identification of the second key y bits, the third message verification code;
    其中,所述目标密钥包括以下之一:所述第一密钥,所述第二密钥,所述第二密钥派生的机密性保护密钥;Wherein, the target key includes one of the following: the first key, the second key, and a confidentiality protected key derived from the second key;
    其中,所述第三消息通过基于所述第二密钥生成的所述第三消息验证码进行完整性保护,或者,所述第三消息通过基于所述第二密钥派生的完整性保护密钥生成的所述第三消息验证码进行完整性保护,所述第三消息验证码的输入参数包括所述y个比特位。Wherein, the third message is integrity protected through the third message verification code generated based on the second key, or the third message is integrity protected through the integrity protection code derived based on the second key. The third message verification code generated by the key is used for integrity protection, and the input parameters of the third message verification code include the y bits.
  47. 如权利要求38所述的方法,其特征在于,所述方法还包括:The method of claim 38, further comprising:
    所述第一终端设备接收所述第二终端设备通过所述中继设备发送的错误消息;其中,所述错误消息包括以下至少之一:原因信息,第四消息验证码;其中,所述原因信息用于指示所述第二终端设备与所述第一终端设备的安全策略冲突,或者,所述原因信息用于指示所述第一消息验证码验证失败,或者,所述原因信息用于指示所述第二终端设备与所述第一终端设备的安全算法协商失败,所述第四消息验证码的输入参数包括以下至少之一:所述原因信息;The first terminal device receives an error message sent by the second terminal device through the relay device; wherein the error message includes at least one of the following: cause information, a fourth message verification code; wherein the cause The information is used to indicate that the security policy of the second terminal device conflicts with the security policy of the first terminal device, or the reason information is used to indicate that the first message verification code verification failed, or the reason information is used to indicate The security algorithm negotiation between the second terminal device and the first terminal device fails, and the input parameters of the fourth message verification code include at least one of the following: the reason information;
    在所述第四消息验证码有效的情况下,所述第一终端设备确定安全模式建立失败,和/或,所述第一终端设备重新发起安全模式建立流程。If the fourth message verification code is valid, the first terminal device determines that the security mode establishment fails, and/or the first terminal device re-initiates the security mode establishment process.
  48. 如权利要求38至47中任一项所述的方法,其特征在于,The method according to any one of claims 38 to 47, characterized in that,
    所述完整性保护密钥包括控制面的完整性保护密钥和用户面的完整性保护密钥;和/或,The integrity protection key includes an integrity protection key for the control plane and an integrity protection key for the user plane; and/or,
    所述机密性保护密钥包括控制面的机密性保护密钥和用户面的机密性保护密钥。The confidentiality protection key includes a confidentiality protection key for the control plane and a confidentiality protection key for the user plane.
  49. 如权利要求38至48中任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 38 to 48, wherein the method further includes:
    所述第一终端设备接收所述第二终端设备通过所述中继设备发送的认证请求消息;The first terminal device receives the authentication request message sent by the second terminal device through the relay device;
    其中,所述认证请求消息包括以下至少之一:所述第二终端设备所属用户的信息,所述中继设备所属用户的信息,所述第二终端设备生成的第一临时公钥,所述第二终端设备的签名,所述中继设备的签名,所述中继设备的相关信息;Wherein, the authentication request message includes at least one of the following: information about the user to which the second terminal device belongs, information about the user to which the relay device belongs, the first temporary public key generated by the second terminal device, the The signature of the second terminal device, the signature of the relay device, and the relevant information of the relay device;
    其中,所述第二终端设备所属用户的信息包括所述第二终端设备的标识和所述第二终端设备的公共验证令牌PVT和密钥管理服务器的公共认证密钥KPAK;所述中继设备所属用户的信息包括所述中继设备的标识和所述中继设备的PVT和KPAK;所述第二终端设备的签名的输入参数包括以下至少之一:所述第二终端设备所属用户的信息和所述第一临时公钥;所述中继设备的签名的输入参数包括以下至少之一:所述第二终端设备的签名和所述中继设备所属用户的信息;所述第一临时公钥和所述中继设备的相关信息用于所述第一终端设备派生所述第一密钥。Wherein, the information of the user to which the second terminal device belongs includes the identification of the second terminal device, the public verification token PVT of the second terminal device and the public authentication key KPAK of the key management server; the relay The information of the user to whom the device belongs includes the identification of the relay device and the PVT and KPAK of the relay device; the input parameters of the signature of the second terminal device include at least one of the following: information and the first temporary public key; the input parameters of the signature of the relay device include at least one of the following: the signature of the second terminal device and the information of the user to which the relay device belongs; the first temporary The public key and related information of the relay device are used by the first terminal device to derive the first key.
  50. 如权利要求49所述的方法,其特征在于,The method of claim 49, wherein:
    所述第二终端设备的签名由所述第二终端设备的秘密签名密钥生成,和/或,所述中继设备的签名由所述中继设备的秘密签名密钥生成。The signature of the second terminal device is generated by the secret signature key of the second terminal device, and/or the signature of the relay device is generated by the secret signature key of the relay device.
  51. 如权利要求49或50所述的方法,其特征在于,所述方法还包括:The method according to claim 49 or 50, characterized in that the method further includes:
    在所述第二终端设备的KPAK和所述中继设备的KPAK有效,且基于所述第二终端设备的标识和所述第二终端设备的PVT对所述第二终端设备的签名验证成功,以及基于所述中继设备的标识和所述中继设备的PVT对所述中继设备的签名验证成功的情况下,所述第一终端设备生成与所述第二临时公钥配对的第二临时私钥,以及所述第一终端设备根据所述第一临时公钥、所述中继设备的相关信息和所述第二临时私钥派生所述第一密钥。The KPAK of the second terminal device and the KPAK of the relay device are valid, and the signature verification of the second terminal device based on the identification of the second terminal device and the PVT of the second terminal device is successful, And if the signature verification of the relay device is successful based on the identification of the relay device and the PVT of the relay device, the first terminal device generates a second temporary public key paired with the second temporary public key. The first terminal device derives the first key based on the first temporary public key, the relevant information of the relay device and the second temporary private key.
  52. 一种中继通信的方法,其特征在于,包括:A method for relaying communications, characterized by including:
    第二终端设备接收第一终端设备通过中继设备发送的第一消息;The second terminal device receives the first message sent by the first terminal device through the relay device;
    其中,所述第一消息包括以下至少之一:所述第一终端设备的安全能力信息,所述第一终端设备的安全策略信息,所述第一终端设备所属用户的信息,所述中继设备所属用户的信息,所述第一终端设备生成的第一随机数,所述第一终端设备生成的第二临时公钥,所述第一终端设备生成的第一密钥的标识的M个比特位,所述第一终端设备的签名,所述中继设备的签名,第一消息验证码;Wherein, the first message includes at least one of the following: security capability information of the first terminal device, security policy information of the first terminal device, information of the user to which the first terminal device belongs, the relay Information about the user to whom the device belongs, the first random number generated by the first terminal device, the second temporary public key generated by the first terminal device, M identification numbers of the first key generated by the first terminal device bits, the signature of the first terminal device, the signature of the relay device, and the first message verification code;
    其中,所述第一终端设备所属用户的信息包括所述第一终端设备的标识和所述第一终端设备的公共验证令牌PVT和密钥管理服务器的公共认证密钥KPAK;所述中继设备所属用户的信息包括所述中继设备的标识和所述中继设备的PVT和KPAK;所述第一终端设备的签名的输入参数包括以下至少之一:所述第一终端设备所属用户的信息,所述第二临时公钥,所述M个比特位,所述第二终端设备的签名;所述中继设备的签名的输入参数包括以下至少之一:所述中继设备所属用户的信息,所述第一终端设备的签名,所述第二终端设备的签名,所述第一消息;Wherein, the information of the user to which the first terminal device belongs includes the identification of the first terminal device, the public verification token PVT of the first terminal device and the public authentication key KPAK of the key management server; the relay The information of the user to whom the device belongs includes the identification of the relay device and the PVT and KPAK of the relay device; the input parameters of the signature of the first terminal device include at least one of the following: information, the second temporary public key, the M bits, and the signature of the second terminal device; the input parameters of the signature of the relay device include at least one of the following: the user to whom the relay device belongs Information, the signature of the first terminal device, the signature of the second terminal device, the first message;
    其中,所述第一消息通过基于所述第一密钥生成的所述第一消息验证码进行完整性保护,且所述第一消息验证码的输入参数包括以下至少之一:所述第一终端设备的安全能力信息,所述第一终端设备的安全策略信息,所述第一终端设备所属用户的信息,所述第一随机数,所述第二临时公钥,所述M个比特位,所述第一终端设备的签名;Wherein, the first message is integrity protected by the first message verification code generated based on the first key, and the input parameters of the first message verification code include at least one of the following: the first Security capability information of the terminal device, security policy information of the first terminal device, information of the user to which the first terminal device belongs, the first random number, the second temporary public key, the M bits , the signature of the first terminal device;
    其中,所述第二临时公钥和所述中继设备的相关信息用于所述第二终端设备派生所述第一密钥,所述第一随机数、所述第一密钥和所述第二终端设备生成的第二随机数用于派生第二密钥,所述第二密钥用于派生完整性保护密钥和/或机密性保护密钥,所述第一密钥的标识由所述M个比特位与所述第一密钥的标识的另外N个比特位合并得到,M和N均为正整数;Wherein, the second temporary public key and the relevant information of the relay device are used by the second terminal device to derive the first key, the first random number, the first key and the The second random number generated by the second terminal device is used to derive a second key, the second key is used to derive an integrity protection key and/or a confidentiality protection key, and the identity of the first key is given by The M bits are obtained by combining the other N bits of the identification of the first key, where M and N are both positive integers;
    其中,所述中继设备的相关信息包括以下之一:所述中继设备的身份信息,所述中继设备生成的随机数,所述中继设备生成的计数器。Wherein, the relevant information of the relay device includes one of the following: identity information of the relay device, a random number generated by the relay device, and a counter generated by the relay device.
  53. 如权利要求52所述的方法,其特征在于,The method of claim 52, wherein:
    所述第一终端设备的签名由所述第一终端设备的秘密签名密钥生成,和/或,所述中继设备的签名由所述中继设备的秘密签名密钥生成。The signature of the first terminal device is generated by the secret signature key of the first terminal device, and/or the signature of the relay device is generated by the secret signature key of the relay device.
  54. 如权利要求52或53所述的方法,其特征在于,所述方法还包括:The method according to claim 52 or 53, characterized in that the method further includes:
    所述第二终端设备分别检查所述第一终端设备的KPAK和所述中继设备的KPAK,在所述第一终端设备的KPAK和所述中继设备的KPAK有效的情况下,且基于所述第一终端设备的标识和所述第一终端设备的PVT对所述第一终端设备的签名进行验证,以及基于所述中继设备的标识和所述中继设备的PVT对所述中继设备的签名进行验证;The second terminal device checks the KPAK of the first terminal device and the KPAK of the relay device respectively. If the KPAK of the first terminal device and the KPAK of the relay device are valid, and based on the Verify the signature of the first terminal device based on the identification of the first terminal device and the PVT of the first terminal device, and verify the relay based on the identification of the relay device and the PVT of the relay device. The device’s signature is verified;
    在所述第一终端设备的签名和所述中继设备的签名验证成功,且所述第一消息中携带的信息未遭受篡改的情况下,所述第二终端设备生成第二随机数,所述第二终端设备至少根据所述第一随机数、所述第一密钥和所述第二随机数生成所述第二密钥,所述第二终端设备根据所述第二密钥生成完整性保护密钥和/或机密性保护密钥,以及所述第二终端设备生成所述第一密钥的标识的N个比特位,并将所述M个比特位和所述N个比特位合并得到所述第一密钥的标识;When the signature of the first terminal device and the signature of the relay device are verified successfully, and the information carried in the first message has not been tampered with, the second terminal device generates a second random number, so The second terminal device generates the second key based on at least the first random number, the first key and the second random number, and the second terminal device generates a complete key based on the second key. sexual protection key and/or confidentiality protection key, and the second terminal device generates N bits of the identification of the first key, and combines the M bits and the N bits Merge to obtain the identity of the first key;
    在所述第一消息验证码有效的情况下,所述第二终端设备通过所述中继设备向所述第一终端设备发送第二消息;其中,所述第二消息包括以下至少之一:所述第二随机数,所述N个比特位,所述第二终端设备生成的所述第二密钥的标识的x个比特位,所述第二终端设备选取的安全算法,所述第二终端设备选取的安全策略,第二消息验证码;When the first message verification code is valid, the second terminal device sends a second message to the first terminal device through the relay device; wherein the second message includes at least one of the following: The second random number, the N bits, the x bits of the identifier of the second key generated by the second terminal device, the security algorithm selected by the second terminal device, the third The second security policy selected by the terminal device, the second message verification code;
    其中,所述第二消息通过基于所述第二密钥生成的所述第二消息验证码进行完整性保护,或者,所述第二消息通过基于所述第二密钥派生的完整性保护密钥生成的所述第二消息验证码进行完整性保护,且所述第二消息验证码的输入参数包括以下至少之一:所述第二随机数,所述N个比特位,所述x个比特位,所述第二终端设备选取的安全算法,所述第二终端设备选取的安全策略;其中,所述第二密钥的标识由所述x个比特位与所述第二密钥的标识的另外y个比特位合并得到,x和y均为正整数。Wherein, the second message is integrity protected through the second message verification code generated based on the second key, or the second message is integrity protected through the integrity protection code derived based on the second key. The second message verification code generated by the key is integrity protected, and the input parameters of the second message verification code include at least one of the following: the second random number, the N bits, the x bits, the security algorithm selected by the second terminal device, the security policy selected by the second terminal device; wherein, the identification of the second key is composed of the x bits and the second key The other y bits of the identifier are combined, and x and y are both positive integers.
  55. 如权利要求54所述的方法,其特征在于,The method of claim 54, wherein:
    所述第二消息通过所述第一密钥进行加密,或者,所述第二消息不用于所述第一密钥进行加密。The second message is encrypted using the first key, or the second message is not encrypted using the first key.
  56. 如权利要求54所述的方法,其特征在于,The method of claim 54, wherein:
    所述第一消息为认证响应消息,所述第二消息为安全模式命令消息。The first message is an authentication response message, and the second message is a security mode command message.
  57. 如权利要求55所述的方法,其特征在于,The method of claim 55, wherein:
    所述第一消息为安全模式命令消息,所述第二消息为安全模式响应消息。The first message is a safe mode command message, and the second message is a safe mode response message.
  58. 如权利要求54至57中任一项所述的方法,其特征在于,The method according to any one of claims 54 to 57, characterized in that,
    所述完整性保护密钥的输入参数包括以下至少之一:所述第二密钥,选定的算法类型标识符,选定的算法类型标识符的长度,完整性保护算法标识,完整性保护算法标识的长度;和/或,The input parameters of the integrity protection key include at least one of the following: the second key, the selected algorithm type identifier, the length of the selected algorithm type identifier, the integrity protection algorithm identifier, the integrity protection The length of the algorithm identifier; and/or,
    所述机密性保护密钥的输入参数包括以下至少之一:所述第二密钥,选定的算法类型标识符,选定的算法类型标识符的长度,机密性保护算法标识,机密性保护算法标识的长度。The input parameters of the confidentiality protection key include at least one of the following: the second key, the selected algorithm type identifier, the length of the selected algorithm type identifier, the confidentiality protection algorithm identifier, the confidentiality protection The length of the algorithm identifier.
  59. 如权利要求54至58中任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 54 to 58, wherein the method further includes:
    所述第二终端设备接收所述第一终端设备通过所述中继设备发送的第三消息;The second terminal device receives the third message sent by the first terminal device through the relay device;
    其中,所述第三消息用于指示安全模式建立完成,所述第三消息通过目标密钥进行加密,且所述第三消息包括以下至少之一:所述第一终端设备生成的所述第二密钥的标识的y个比特位,第三消息验证码;Wherein, the third message is used to indicate that the security mode establishment is completed, the third message is encrypted by a target key, and the third message includes at least one of the following: the third message generated by the first terminal device. y bits of the identifier of the second key, and the third message verification code;
    其中,所述目标密钥包括以下之一:所述第一密钥,所述第二密钥,所述第二密钥派生的机密性保护密钥;Wherein, the target key includes one of the following: the first key, the second key, and a confidentiality protected key derived from the second key;
    其中,所述第三消息通过基于所述第二密钥生成的所述第三消息验证码进行完整性保护,或者,所述第三消息通过基于所述第二密钥派生的完整性保护密钥生成的所述第三消息验证码进行完整性保护,所述第三消息验证码的输入参数包括所述y个比特位。Wherein, the third message is integrity protected through the third message verification code generated based on the second key, or the third message is integrity protected through the integrity protection code derived based on the second key. The third message verification code generated by the key is used for integrity protection, and the input parameters of the third message verification code include the y bits.
  60. 如权利要求59所述的方法,其特征在于,所述方法还包括:The method of claim 59, further comprising:
    所述第二终端设备通过所述目标密钥对所述第三消息进行解密;The second terminal device decrypts the third message using the target key;
    在所述第三消息中携带的信息未遭受篡改的情况下,且所述第三消息验证码有效的情况下,所述第二终端设备将所述x个比特位与所述y个比特位合并得到所述第二密钥的标识。When the information carried in the third message has not been tampered with and the third message verification code is valid, the second terminal device combines the x bits with the y bits. Combined to obtain the identity of the second key.
  61. 如权利要求52或53所述的方法,其特征在于,所述方法还包括:The method according to claim 52 or 53, characterized in that the method further includes:
    所述第二终端设备通过所述中继设备向所述第一终端设备发送错误消息;其中,所述错误消息包括以下至少之一:原因信息,第四消息验证码;其中,所述原因信息用于指示所述第二终端设备与所述第一终端设备的安全策略冲突,或者,所述原因信息用于指示所述第一消息验证码验证失败,或者,所述原因信息用于指示所述第二终端设备与所述第一终端设备的安全算法协商失败,所述第四消息验证码的输入参数包括以下至少之一:所述原因信息。The second terminal device sends an error message to the first terminal device through the relay device; wherein the error message includes at least one of the following: cause information, a fourth message verification code; wherein the cause information The reason information is used to indicate that the security policy of the second terminal device conflicts with the security policy of the first terminal device, or the reason information is used to indicate that the first message verification code verification fails, or the reason information is used to indicate that the first message verification code verification fails. The security algorithm negotiation between the second terminal device and the first terminal device fails, and the input parameter of the fourth message verification code includes at least one of the following: the reason information.
  62. 如权利要求52至61中任一项所述的方法,其特征在于,The method according to any one of claims 52 to 61, characterized in that,
    所述完整性保护密钥包括控制面的完整性保护密钥和用户面的完整性保护密钥;和/或,The integrity protection key includes an integrity protection key for the control plane and an integrity protection key for the user plane; and/or,
    所述机密性保护密钥包括控制面的机密性保护密钥和用户面的机密性保护密钥。The confidentiality protection key includes a confidentiality protection key for the control plane and a confidentiality protection key for the user plane.
  63. 如权利要求52至62中任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 52 to 62, wherein the method further includes:
    所述第二终端设备通过所述中继设备向所述第一终端设备发送认证请求消息;The second terminal device sends an authentication request message to the first terminal device through the relay device;
    其中,所述认证请求消息包括以下至少之一:所述第二终端设备所属用户的信息,所述第二终端设备生成的第一临时公钥,所述第二终端设备的签名,所述中继设备的相关信息;Wherein, the authentication request message includes at least one of the following: information about the user to which the second terminal device belongs, the first temporary public key generated by the second terminal device, the signature of the second terminal device, the Relevant information about relay equipment;
    其中,所述第二终端设备所属用户的信息包括所述第二终端设备的标识和所述第二终端设备的PVT和KPAK;所述第二终端设备的签名的输入参数包括以下至少之一:所述第二终端设备所属用户的信息和所述第一临时公钥;所述第一临时公钥和所述中继设备的相关信息用于所述第一终端设备派生第一密钥。Wherein, the information of the user to which the second terminal device belongs includes the identification of the second terminal device and the PVT and KPAK of the second terminal device; the input parameters of the signature of the second terminal device include at least one of the following: The information of the user to which the second terminal device belongs and the first temporary public key; the first temporary public key and the relevant information of the relay device are used for the first terminal device to derive the first key.
  64. 如权利要求63所述的方法,其特征在于,The method of claim 63, wherein:
    所述第二终端设备的签名由所述第二终端设备的秘密签名密钥生成。The signature of the second terminal device is generated by the secret signature key of the second terminal device.
  65. 一种中继通信的方法,其特征在于,包括:A method for relaying communications, characterized by including:
    中继设备接收第一终端设备发送的第一消息;其中,所述第一消息包括以下至少之一:所述第一终端设备的安全能力信息,所述第一终端设备的安全策略信息,所述第一终端设备所属用户的信息,所述第一终端设备生成的第一随机数,所述第一终端设备生成的第二临时公钥,所述第一终端设备生成的第一密钥的标识的M个比特位,所述第一终端设备的签名,第一消息验证码;其中,所述第一终端设备所属用户的信息包括所述第一终端设备的标识和所述第一终端设备的公共验证令牌PVT和密钥管理服务器的公共认证密钥KPAK;所述第一终端设备的签名的输入参数包括以下至少之一:所述第一终端设备所属用户的信息,所述第二临时公钥,所述M个比特位,第二终端设备的签名;其中,所述第一消息通过基于所述第一密钥生成的所述第一消息验证码进行完整性保护,且所述第一消息验证码的输入参数包括以下至少之一:所述第一终端设备的安全能力信息,所述第一终端设备的安 全策略信息,所述第一终端设备所属用户的信息,所述第一随机数,所述第二临时公钥,所述M个比特位,所述第一终端设备的签名;The relay device receives the first message sent by the first terminal device; wherein the first message includes at least one of the following: security capability information of the first terminal device, security policy information of the first terminal device, The information of the user to which the first terminal device belongs, the first random number generated by the first terminal device, the second temporary public key generated by the first terminal device, and the first key generated by the first terminal device. M bits of identification, the signature of the first terminal device, and the first message verification code; wherein the information about the user to which the first terminal device belongs includes the identification of the first terminal device and the first terminal device The public verification token PVT and the public authentication key KPAK of the key management server; the input parameters of the signature of the first terminal device include at least one of the following: information of the user to which the first terminal device belongs, the second Temporary public key, the M bits, and the signature of the second terminal device; wherein the first message is integrity protected by the first message verification code generated based on the first key, and the The input parameters of the first message verification code include at least one of the following: security capability information of the first terminal device, security policy information of the first terminal device, information of the user to which the first terminal device belongs, information of the user of the first terminal device, A random number, the second temporary public key, the M bits, and the signature of the first terminal device;
    在所述第一终端设备的KPAK有效,且基于所述第一终端设备的标识和所述第一终端设备的PVT对所述第一终端设备的签名验证成功的情况下,所述中继设备向所述第二终端设备发送验证之后的第一消息;其中,所述验证之后的第一消息包括以下至少之一:所述第一终端设备的安全能力信息,所述第一终端设备的安全策略信息,所述第一终端设备所属用户的信息,所述中继设备所属用户的信息,所述第一终端设备生成的第一随机数,所述第一终端设备生成的与所述第二临时私钥配对的第二临时公钥,所述第一终端设备生成的所述第一密钥的标识的M个比特位,所述第一终端设备的签名,所述中继设备的签名,所述中继设备的相关信息,所述第一消息验证码;其中,所述中继设备所属用户的信息包括所述中继设备的标识和所述中继设备的PVT和KPAK;所述中继设备的签名的输入参数包括以下至少之一:所述中继设备所属用户的信息,所述第一终端设备的签名,所述第二终端设备的签名,所述验证之后的第一消息;When the KPAK of the first terminal device is valid and the signature verification of the first terminal device is successful based on the identity of the first terminal device and the PVT of the first terminal device, the relay device Send a first message after verification to the second terminal device; wherein the first message after verification includes at least one of the following: security capability information of the first terminal device, security capability information of the first terminal device, Policy information, information about the user to which the first terminal device belongs, information about the user to which the relay device belongs, the first random number generated by the first terminal device, the number generated by the first terminal device and the second random number generated by the first terminal device. The second temporary public key of the temporary private key pairing, M bits of the identification of the first key generated by the first terminal device, the signature of the first terminal device, the signature of the relay device, Relevant information of the relay device, the first message verification code; wherein the information of the user to which the relay device belongs includes the identification of the relay device and the PVT and KPAK of the relay device; the The input parameters of the signature of the relay device include at least one of the following: information of the user to which the relay device belongs, the signature of the first terminal device, the signature of the second terminal device, and the first message after the verification;
    其中,所述第二临时公钥和所述中继设备的相关信息用于所述第二终端设备派生所述第一密钥,所述第一随机数、所述第一密钥和所述第二终端设备生成的第二随机数用于派生第二密钥,所述第二密钥用于派生完整性保护密钥和/或机密性保护密钥,所述第一密钥的标识由所述M个比特位与所述第一密钥的标识的另外N个比特位合并得到,M和N均为正整数;其中,所述中继设备的相关信息包括以下之一:所述中继设备的身份信息,所述中继设备生成的随机数,所述中继设备生成的计数器。Wherein, the second temporary public key and the relevant information of the relay device are used by the second terminal device to derive the first key, the first random number, the first key and the The second random number generated by the second terminal device is used to derive a second key, the second key is used to derive an integrity protection key and/or a confidentiality protection key, and the identity of the first key is given by The M bits are combined with the other N bits of the identification of the first key, and M and N are both positive integers; wherein the relevant information of the relay device includes one of the following: The identity information of the relay device, the random number generated by the relay device, and the counter generated by the relay device.
  66. 如权利要求65所述的方法,其特征在于,所述方法还包括:The method of claim 65, further comprising:
    所述中继设备将所述第二终端设备发送的第二消息转发至所述第一终端设备;The relay device forwards the second message sent by the second terminal device to the first terminal device;
    其中,所述第二消息包括以下至少之一:所述第二终端设备生成的所述第二随机数,所述第二终端设备生成的所述第一密钥的标识的N个比特位,所述第二终端设备生成的所述第二密钥的标识的x个比特位,所述第二终端设备选取的安全算法,所述第二终端设备选取的安全策略,第二消息验证码;Wherein, the second message includes at least one of the following: the second random number generated by the second terminal device, N bits of the identification of the first key generated by the second terminal device, x bits of the identification of the second key generated by the second terminal device, the security algorithm selected by the second terminal device, the security policy selected by the second terminal device, and the second message verification code;
    其中,所述第二消息通过基于所述第二密钥生成的所述第二消息验证码进行完整性保护,或者,所述第二消息通过基于所述第二密钥派生的完整性保护密钥生成的所述第二消息验证码进行完整性保护,且所述第二消息验证码的输入参数包括以下至少之一:所述第二随机数,所述N个比特位,所述x个比特位,所述第二终端设备选取的安全算法,所述第二终端设备选取的安全策略;其中,所述第二密钥的标识由所述x个比特位与所述第二密钥的标识的另外y个比特位合并得到,x和y均为正整数。Wherein, the second message is integrity protected through the second message verification code generated based on the second key, or the second message is integrity protected through the integrity protection code derived based on the second key. The second message verification code generated by the key is integrity protected, and the input parameters of the second message verification code include at least one of the following: the second random number, the N bits, the x bits, the security algorithm selected by the second terminal device, the security policy selected by the second terminal device; wherein, the identification of the second key is composed of the x bits and the second key The other y bits of the identifier are combined, and x and y are both positive integers.
  67. 如权利要求66所述的方法,其特征在于,The method of claim 66, wherein:
    所述第二消息通过所述第一密钥进行加密,或者,所述第二消息不用于所述第一密钥进行加密。The second message is encrypted using the first key, or the second message is not encrypted using the first key.
  68. 如权利要求66所述的方法,其特征在于,The method of claim 66, wherein:
    所述第一消息为认证响应消息,所述第二消息为安全模式命令消息。The first message is an authentication response message, and the second message is a security mode command message.
  69. 如权利要求67所述的方法,其特征在于,The method of claim 67, wherein:
    所述第一消息为安全模式命令消息,所述第二消息为安全模式响应消息。The first message is a safe mode command message, and the second message is a safe mode response message.
  70. 如权利要求55至69中任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 55 to 69, characterized in that the method further comprises:
    所述中继设备将所述第一终端设备发送的第三消息转发至所述第二终端设备;The relay device forwards the third message sent by the first terminal device to the second terminal device;
    其中,所述第三消息用于指示安全模式建立完成,所述第三消息通过目标密钥进行加密,且所述第三消息包括以下至少之一:所述第一终端设备生成的所述第二密钥的标识的y个比特位,第三消息验证码;Wherein, the third message is used to indicate that the security mode establishment is completed, the third message is encrypted by a target key, and the third message includes at least one of the following: the third message generated by the first terminal device. y bits of the identifier of the second key, and the third message verification code;
    其中,所述目标密钥包括以下之一:所述第一密钥,所述第二密钥,所述第二密钥派生的机密性保护密钥;Wherein, the target key includes one of the following: the first key, the second key, and a confidentiality protected key derived from the second key;
    其中,所述第三消息通过基于所述第二密钥生成的所述第三消息验证码进行完整性保护,或者,所述第三消息通过基于所述第二密钥派生的完整性保护密钥生成的所述第三消息验证码进行完整性保护,所述第三消息验证码的输入参数包括所述y个比特位。Wherein, the third message is integrity protected through the third message verification code generated based on the second key, or the third message is integrity protected through the integrity protection code derived based on the second key. The third message verification code generated by the key is used for integrity protection, and the input parameters of the third message verification code include the y bits.
  71. 如权利要求65所述的方法,其特征在于,所述方法还包括:The method of claim 65, further comprising:
    所述中继设备将所述第二终端设备发送的错误消息转发至所述第一终端设备;其中,所述错误消息包括以下至少之一:原因信息,第四消息验证码;其中,所述原因信息用于指示所述第二终端设备与所述第一终端设备的安全策略冲突,或者,所述原因信息用于指示所述第一消息验证码验证失败,或者,所述原因信息用于指示所述第二终端设备与所述第一终端设备的安全算法协商失败,所述第四消息验证码的输入参数包括以下至少之一:所述原因信息。The relay device forwards the error message sent by the second terminal device to the first terminal device; wherein the error message includes at least one of the following: cause information, a fourth message verification code; wherein, the The reason information is used to indicate that the security policy of the second terminal device conflicts with the first terminal device, or the reason information is used to indicate that the first message verification code verification fails, or the reason information is used to Indicating that the security algorithm negotiation between the second terminal device and the first terminal device failed, the input parameters of the fourth message verification code include at least one of the following: the cause information.
  72. 如权利要求65至71中任一项所述的方法,其特征在于,The method according to any one of claims 65 to 71, characterized in that,
    所述完整性保护密钥包括控制面的完整性保护密钥和用户面的完整性保护密钥;和/或,The integrity protection key includes an integrity protection key for the control plane and an integrity protection key for the user plane; and/or,
    所述机密性保护密钥包括控制面的机密性保护密钥和用户面的机密性保护密钥。The confidentiality protection key includes a confidentiality protection key for the control plane and a confidentiality protection key for the user plane.
  73. 如权利要求65至72中任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 65 to 72, further comprising:
    所述中继设备接收所述第二终端设备发送的认证请求消息;其中,所述认证请求消息包括以下至少之一:所述第二终端设备所属用户的信息,所述第二终端设备生成的第一临时公钥,所述第二终端设备的签名;其中,所述第二终端设备所属用户的信息包括所述第二终端设备的标识和所述第二终端设备的PVT和KPAK;所述第二终端设备的签名的输入参数包括以下至少之一:所述第二终端设备所属用户的信息和所述第一临时公钥;所述第一临时公钥和所述中继设备的相关信息用于所述第一终端设备派生所述第一密钥;The relay device receives an authentication request message sent by the second terminal device; wherein the authentication request message includes at least one of the following: information about the user to which the second terminal device belongs, information generated by the second terminal device. The first temporary public key, the signature of the second terminal device; wherein the information of the user to which the second terminal device belongs includes the identification of the second terminal device and the PVT and KPAK of the second terminal device; The input parameters of the signature of the second terminal device include at least one of the following: information about the user to which the second terminal device belongs and the first temporary public key; information related to the first temporary public key and the relay device Used by the first terminal device to derive the first key;
    在所述第二终端设备的KPAK有效,且基于所述第二终端设备的标识和所述第二终端设备的PVT对所述第二终端设备的签名验证成功的情况下,所述中继设备向所述第一终端设备发送验证之后的认证请求消息;其中,所述验证之后的认证请求消息包括以下至少之一:所述第二终端设备所属用户的信息,所述中继设备所属用户的信息,所述第一临时公钥,所述第二终端设备的签名,所述中继设备的签名,所述中继设备的相关信息;其中,所述中继设备所属用户的信息包括所述中继设备的标识和所述中继设备的PVT和KPAK;所述中继设备的签名的输入参数包括以下至少之一:所述第二终端设备的签名和所述中继设备所属用户的信息。When the KPAK of the second terminal device is valid and the signature verification of the second terminal device is successful based on the identification of the second terminal device and the PVT of the second terminal device, the relay device Send an authentication request message after verification to the first terminal device; wherein the authentication request message after verification includes at least one of the following: information about the user to whom the second terminal device belongs, information about the user to whom the relay device belongs. information, the first temporary public key, the signature of the second terminal device, the signature of the relay device, and relevant information of the relay device; wherein the information of the user to which the relay device belongs includes the The identification of the relay device and the PVT and KPAK of the relay device; the input parameters of the signature of the relay device include at least one of the following: the signature of the second terminal device and the information of the user to which the relay device belongs. .
  74. 如权利要求73所述的方法,其特征在于,The method of claim 73, wherein:
    所述第二终端设备的签名由所述第二终端设备的秘密签名密钥生成,和/或,所述中继设备的签名由所述中继设备的秘密签名密钥生成。The signature of the second terminal device is generated by the secret signature key of the second terminal device, and/or the signature of the relay device is generated by the secret signature key of the relay device.
  75. 一种中继通信的方法,其特征在于,包括:A method for relaying communications, characterized by including:
    第一终端设备通过中继设备向第二终端设备发送直接通信请求;The first terminal device sends a direct communication request to the second terminal device through the relay device;
    其中,所述直接通信请求包括以下至少之一:所述第一终端设备的安全能力信息,所述第一终端设备的安全策略信息,所述第一终端设备生成的第一临时公钥,所述第一终端设备生成的第一随机数;Wherein, the direct communication request includes at least one of the following: security capability information of the first terminal device, security policy information of the first terminal device, the first temporary public key generated by the first terminal device, the The first random number generated by the first terminal device;
    其中,所述直接通信请求通过第一加密密钥进行加密,以及所述直接通信请求通过第一完整性保护密钥进行完整性保护,所述第一加密密钥为基于已注册并被授权使用终端至终端中继UE-to-UE relay通信的终端的对称密钥衍生的加密密钥,所述第一完整性保护密钥为基于已注册并被授权使用UE-to-UE relay通信的终端的对称密钥衍生的完整性保护密钥;Wherein, the direct communication request is encrypted by a first encryption key, and the direct communication request is integrity protected by a first integrity protection key, and the first encryption key is based on being registered and authorized for use. An encryption key derived from the symmetric key of a terminal that relays UE-to-UE relay communications, where the first integrity protection key is based on a terminal that is registered and authorized to use UE-to-UE relay communications. An integrity-protected key derived from a symmetric key;
    其中,所述第一临时公钥和所述中继设备的相关信息用于所述第二终端设备派生第一密钥;所述第一随机数、所述第一密钥和所述第二终端设备生成的第二随机数用于派生第二密钥,且所述第二密钥用于派生第二加密密钥和/或第二完整性保护密钥,或者,所述第一随机数、所述第一密钥和所述第二终端设备生成的第二随机数用于派生第二加密密钥和/或第二完整性保护密钥;Wherein, the first temporary public key and the relevant information of the relay device are used by the second terminal device to derive the first key; the first random number, the first key and the second The second random number generated by the terminal device is used to derive a second key, and the second key is used to derive a second encryption key and/or a second integrity protection key, or the first random number , the first key and the second random number generated by the second terminal device are used to derive a second encryption key and/or a second integrity protection key;
    其中,所述中继设备的相关信息包括以下之一:所述中继设备的身份信息,所述中继设备生成的随机数,所述中继设备生成的计数器。Wherein, the relevant information of the relay device includes one of the following: identity information of the relay device, a random number generated by the relay device, and a counter generated by the relay device.
  76. 如权利要求75所述的方法,其特征在于,所述方法还包括:The method of claim 75, further comprising:
    所述第一终端设备接收所述第二终端设备通过所述中继设备发送的安全模式命令;The first terminal device receives the safe mode command sent by the second terminal device through the relay device;
    其中,所述安全模式命令包括以下至少之一:所述第二终端设备选取的安全算法,所述第二终端设备选取的安全策略,所述第二终端设备生成的第二临时公钥,所述第二终端设备生成的所述第二随机数,所述第二终端设备生成的所述第一密钥的标识的M个比特位,所述中继设备的相关信息,第一消息验证码;Wherein, the security mode command includes at least one of the following: a security algorithm selected by the second terminal device, a security policy selected by the second terminal device, a second temporary public key generated by the second terminal device, the The second random number generated by the second terminal device, the M bits of the identification of the first key generated by the second terminal device, the relevant information of the relay device, and the first message verification code ;
    其中,所述安全模式命令通过所述第一加密密钥进行加密,所述安全模式命令通过所述第一完整性保护密钥进行完整性保护,所述第一消息验证码基于所述第二完整性保护密钥生成,且所述第一消息验证码的输入参数包括以下至少之一:所述第二终端设备选取的安全算法,所述第二终端设备选取的安全策略,所述第二临时公钥,所述第二随机数,所述M个比特位,所述中继设备的相关信息;Wherein, the security mode command is encrypted by the first encryption key, the security mode command is integrity protected by the first integrity protection key, and the first message verification code is based on the second The integrity protection key is generated, and the input parameters of the first message verification code include at least one of the following: the security algorithm selected by the second terminal device, the security policy selected by the second terminal device, the second The temporary public key, the second random number, the M bits, and the relevant information of the relay device;
    其中,所述第二临时公钥和所述中继设备的相关信息用于所述第一终端设备派生所述第一密钥,所述第一密钥的标识由所述M个比特位与所述第一密钥的标识的另外N个比特位合并得到,M和N均为正整数。Wherein, the second temporary public key and the relevant information of the relay device are used by the first terminal device to derive the first key, and the identification of the first key is composed of the M bits and The other N bits of the identifier of the first key are combined and obtained, and M and N are both positive integers.
  77. 如权利要求76所述的方法,其特征在于,The method of claim 76, wherein:
    在所述第一随机数、所述第一密钥和所述第二随机数用于派生所述第二密钥的情况下,所述安全模式命令还包括所述第二终端设备生成的所述第二密钥的标识的x个比特位,以及所述第一消息验证码的输入参数包括所述x个比特位;In the case where the first random number, the first key and the second random number are used to derive the second key, the security mode command further includes all the information generated by the second terminal device. x bits of the identifier of the second key, and the input parameter of the first message verification code includes the x bits;
    其中,所述第二密钥的标识由所述x个比特位与所述第二密钥的标识的另外y个比特位合并得到,x和y均为正整数。Wherein, the identifier of the second key is obtained by combining the x bits and the other y bits of the identifier of the second key, and both x and y are positive integers.
  78. 如权利要求77所述的方法,其特征在于,所述方法还包括:The method of claim 77, further comprising:
    所述第一终端设备使用所述第一加密密钥解密所述安全模式命令,以及使用所述第一完整性保护密钥判断所述安全模式命令的完整性;The first terminal device uses the first encryption key to decrypt the security mode command, and uses the first integrity protection key to determine the integrity of the security mode command;
    在所述安全模式命令中携带的信息未遭受篡改的情况下,所述第一终端设备根据与所述第一临时公钥配对的第一临时私钥、所述第二临时公钥、所述中继设备的相关信息派生所述第一密钥,且所述第一终端设备生成所述第一密钥的标识的所述N个比特位,以及将所述M个比特位和所述N个比特位合并得到所述第一密钥的标识;When the information carried in the security mode command has not been tampered with, the first terminal device uses the first temporary private key paired with the first temporary public key, the second temporary public key, and the The first key is derived from the relevant information of the relay device, and the first terminal device generates the N bits of the identification of the first key, and combines the M bits and the N Combining bits to obtain the identity of the first key;
    所述第一终端设备至少根据所述第一随机数、所述第一密钥和所述第二随机数生成所述第二密钥,所述第一终端设备根据所述第二密钥生成所述第二完整性保护密钥和/或所述第二加密密钥,以及所述第一终端设备生成所述第二密钥的标识的所述y个比特位,并将所述x个比特位和所述y个比特位合并得到所述第二密钥的标识;The first terminal device generates the second key based on at least the first random number, the first key and the second random number, and the first terminal device generates the second key based on the second key. The second integrity protection key and/or the second encryption key, and the first terminal device generates the y bits of the identification of the second key, and converts the x bits and the y bits are combined to obtain the identity of the second key;
    在所述第一消息验证码有效的情况下,所述第一终端设备根据所述第二终端设备选取的安全算法、所述第二完整性保护密钥和/或所述第二加密密钥、所述第二终端设备选取的安全策略,与所述第二终端设备进行通信。When the first message verification code is valid, the first terminal device uses the security algorithm selected by the second terminal device, the second integrity protection key and/or the second encryption key. . The security policy selected by the second terminal device is communicated with the second terminal device.
  79. 如权利要求78所述的方法,其特征在于,所述方法还包括:The method of claim 78, further comprising:
    所述第一终端设备通过所述中继设备向所述第二终端设备发送安全模式建立完成消息;The first terminal device sends a security mode establishment completion message to the second terminal device through the relay device;
    其中,所述安全模式建立完成消息通过所述第二密钥或所述第二加密密钥进行加密,所述安全模式建立完成消息通过所述第二密钥或所述第二完整性保护密钥进行完整性保护;Wherein, the security mode establishment completion message is encrypted by the second key or the second encryption key, and the security mode establishment completion message is encrypted by the second key or the second integrity protection key. Key integrity protection;
    其中,所述安全模式建立完成消息至少包括所述第二密钥的标识的所述y个比特位。Wherein, the security mode establishment completion message includes at least the y bits of the identification of the second key.
  80. 如权利要求78或79所述的方法,其特征在于,The method of claim 78 or 79, characterized in that,
    所述第二完整性保护密钥的输入参数包括以下至少之一:所述第二密钥,选定的算法类型标识符,选定的算法类型标识符的长度,完整性保护算法标识,完整性保护算法标识的长度;和/或,The input parameters of the second integrity protection key include at least one of the following: the second key, the selected algorithm type identifier, the length of the selected algorithm type identifier, the integrity protection algorithm identifier, the complete The length of the sex protection algorithm identifier; and/or,
    所述第二加密密钥的输入参数包括以下至少之一:所述第二密钥,选定的算法类型标识符,选定的算法类型标识符的长度,机密性保护算法标识,机密性保护算法标识的长度。The input parameters of the second encryption key include at least one of the following: the second key, the selected algorithm type identifier, the length of the selected algorithm type identifier, the confidentiality protection algorithm identifier, the confidentiality protection The length of the algorithm identifier.
  81. 如权利要求76所述的方法,其特征在于,在所述第一随机数、所述第一密钥和所述第二随机数用于派生所述第二加密密钥和/或所述第二完整性保护密钥的情况下,所述方法还包括:The method of claim 76, wherein the first random number, the first key and the second random number are used to derive the second encryption key and/or the third In the case of two integrity protection keys, the method further includes:
    所述第一终端设备使用所述第一加密密钥解密所述安全模式命令,以及使用所述第一完整性保护密钥判断所述安全模式命令的完整性;The first terminal device uses the first encryption key to decrypt the security mode command, and uses the first integrity protection key to determine the integrity of the security mode command;
    在所述安全模式命令中携带的信息未遭受篡改的情况下,所述第一终端设备根据与所述第一临时公钥配对的第一临时私钥、所述第二临时公钥、所述中继设备的相关信息派生所述第一密钥,且所述第一终端设备生成所述第一密钥的所述N个比特位,以及将所述M个比特位和所述N个比特位合并得到所述第一密钥的标识;When the information carried in the security mode command has not been tampered with, the first terminal device uses the first temporary private key paired with the first temporary public key, the second temporary public key, and the The first key is derived from the relevant information of the relay device, and the first terminal device generates the N bits of the first key, and combines the M bits and the N bits Bit merging to obtain the identity of the first key;
    所述第一终端设备至少根据所述第一随机数、所述第一密钥和所述第二随机数生成所述第二完整性保护密钥和/或所述第二加密密钥;The first terminal device generates the second integrity protection key and/or the second encryption key based on at least the first random number, the first key and the second random number;
    在所述第一消息验证码有效的情况下,所述第一终端设备根据所述第二终端设备选取的安全算法、所述第二完整性保护密钥和/或所述第二加密密钥、所述第二终端设备选取的安全策略,与所述第二终端设备进行通信。When the first message verification code is valid, the first terminal device uses the security algorithm selected by the second terminal device, the second integrity protection key and/or the second encryption key. . The security policy selected by the second terminal device is communicated with the second terminal device.
  82. 如权利要求81所述的方法,其特征在于,所述方法还包括:The method of claim 81, further comprising:
    所述第一终端设备通过所述中继设备向所述第二终端设备发送安全模式建立完成消息;The first terminal device sends a security mode establishment completion message to the second terminal device through the relay device;
    其中,所述安全模式建立完成消息通过所述第二加密密钥进行加密,所述安全模式建立完成消息通过所述第二完整性保护密钥进行完整性保护。Wherein, the security mode establishment completion message is encrypted by the second encryption key, and the security mode establishment completion message is integrity protected by the second integrity protection key.
  83. 如权利要求81或82所述的方法,其特征在于,The method of claim 81 or 82, characterized in that,
    所述第二完整性保护密钥的输入参数包括以下至少之一:所述第一随机数,所述第一密钥,所述第二随机数,选定的算法类型标识符,选定的算法类型标识符的长度,完整性保护算法标识,完整性保护算法标识的长度;和/或,The input parameters of the second integrity protection key include at least one of the following: the first random number, the first key, the second random number, the selected algorithm type identifier, the selected The length of the algorithm type identifier, the integrity protection algorithm identifier, the length of the integrity protection algorithm identifier; and/or,
    所述第二加密密钥的输入参数包括以下至少之一:所述第一随机数,所述第一密钥,所述第二随机数,选定的算法类型标识符,选定的算法类型标识符的长度,机密性保护算法标识,机密性保护算法标识的长度。The input parameters of the second encryption key include at least one of the following: the first random number, the first key, the second random number, the selected algorithm type identifier, the selected algorithm type The length of the identifier, the confidentiality protection algorithm identifier, the length of the confidentiality protection algorithm identifier.
  84. 如权利要求75至83中任一项所述的方法,其特征在于,所述第一加密密钥为邻近业务加密密钥PEK,所述第一完整性保护密钥为邻近业务完整性保护密钥PIK。The method according to any one of claims 75 to 83, wherein the first encryption key is a proximity service encryption key PEK, and the first integrity protection key is a proximity service integrity protection key. Key PIK.
  85. 一种中继通信的方法,其特征在于,包括:A method for relaying communications, characterized by including:
    第二终端设备接收第一终端设备通过中继设备发送的直接通信请求;The second terminal device receives the direct communication request sent by the first terminal device through the relay device;
    其中,所述直接通信请求包括以下至少之一:所述第一终端设备的安全能力信息,所述第一终端 设备的安全策略信息,所述第一终端设备生成的第一临时公钥,所述第一终端设备生成的第一随机数,所述中继设备的标识,所述中继设备的相关信息;Wherein, the direct communication request includes at least one of the following: security capability information of the first terminal device, security policy information of the first terminal device, the first temporary public key generated by the first terminal device, the The first random number generated by the first terminal device, the identification of the relay device, and the relevant information of the relay device;
    其中,所述直接通信请求通过第一加密密钥进行加密,以及所述直接通信请求通过第一完整性保护密钥进行完整性保护,所述第一加密密钥为基于已注册并被授权使用终端至终端中继UE-to-UE relay通信的终端的对称密钥衍生的加密密钥,所述第一完整性保护密钥为基于已注册并被授权使用UE-to-UE relay通信的终端的对称密钥衍生的完整性保护密钥;Wherein, the direct communication request is encrypted by a first encryption key, and the direct communication request is integrity protected by a first integrity protection key, and the first encryption key is based on being registered and authorized for use. An encryption key derived from the symmetric key of a terminal that relays UE-to-UE relay communications, where the first integrity protection key is based on a terminal that is registered and authorized to use UE-to-UE relay communications. An integrity-protected key derived from a symmetric key;
    其中,所述中继设备的相关信息包括以下之一:所述中继设备的身份信息,所述中继设备生成的随机数,所述中继设备生成的计数器;所述第一临时公钥和所述中继设备的相关信息用于所述第二终端设备派生第一密钥;所述第一随机数、所述第一密钥和所述第二终端设备生成的第二随机数用于派生第二密钥,且所述第二密钥用于派生第二加密密钥和/或第二完整性保护密钥,或者,所述第一随机数、所述第一密钥和所述第二终端设备生成的第二随机数用于派生第二加密密钥和/或第二完整性保护密钥。Wherein, the relevant information of the relay device includes one of the following: the identity information of the relay device, the random number generated by the relay device, the counter generated by the relay device; the first temporary public key The information related to the relay device is used for the second terminal device to derive the first key; the first random number, the first key and the second random number generated by the second terminal device are used for to derive a second key, and the second key is used to derive a second encryption key and/or a second integrity protection key, or the first random number, the first key and the The second random number generated by the second terminal device is used to derive a second encryption key and/or a second integrity protection key.
  86. 如权利要求85所述的方法,其特征在于,在所述第一随机数、所述第一密钥和所述第二随机数用于派生所述第二密钥的情况下,所述方法还包括:The method of claim 85, wherein when the first random number, the first key and the second random number are used to derive the second key, the method Also includes:
    所述第二终端设备使用所述第一加密密钥解密所述直接通信请求,以及使用所述第一完整性保护密钥判断所述直接通信请求的完整性;The second terminal device uses the first encryption key to decrypt the direct communication request, and uses the first integrity protection key to determine the integrity of the direct communication request;
    在所述直接通信请求中携带的信息未遭受篡改的情况下,所述第二终端设备生成第二临时私钥,以及所述第二终端设备根据所述第一临时公钥、所述第二临时私钥和所述中继设备的相关信息派生所述第一密钥,且所述第二终端设备生成所述第一密钥的标识的M个比特位;When the information carried in the direct communication request has not been tampered with, the second terminal device generates a second temporary private key, and the second terminal device generates a second temporary public key based on the first temporary public key, the second temporary public key, and the second temporary public key. The first key is derived from the temporary private key and the relevant information of the relay device, and the second terminal device generates M bits of the identification of the first key;
    所述第二终端设备生成所述第二随时数,以及所述第二终端设备至少根据所述第一随机数、所述第一密钥和所述第二随机数生成所述第二密钥,所述第二终端设备根据所述第二密钥生成所述第二完整性保护密钥和/或所述第二加密密钥,且所述第二终端设备生成所述第二密钥的标识的x个比特位;The second terminal device generates the second random number, and the second terminal device generates the second key based on at least the first random number, the first key and the second random number. , the second terminal device generates the second integrity protection key and/or the second encryption key according to the second key, and the second terminal device generates the second key x bits of identification;
    其中,所述第一密钥的标识由所述M个比特位与所述第一密钥的标识的另外N个比特位合并得到,M和N均为正整数,所述第二密钥的标识由所述x个比特位与所述第二密钥的标识的另外y个比特位合并得到,x和y均为正整数。Wherein, the identification of the first key is obtained by combining the M bits and the other N bits of the identification of the first key, M and N are both positive integers, and the second key The identification is obtained by combining the x bits and the other y bits of the identification of the second key, and x and y are both positive integers.
  87. 如权利要求86所述的方法,其特征在于,所述方法还包括:The method of claim 86, further comprising:
    所述第二终端设备通过所述中继设备向所述第一终端设备发送安全模式命令;The second terminal device sends a safe mode command to the first terminal device through the relay device;
    其中,所述安全模式命令包括以下至少之一:所述第二终端设备选取的安全算法,所述第二终端设备选取的安全策略,所述第二终端设备生成的与所述第二临时私钥配对的第二临时公钥,所述第二随机数,所述第一密钥的标识的所述M个比特位,所述第二密钥的标识的所述x个比特位,第一消息验证码;Wherein, the security mode command includes at least one of the following: a security algorithm selected by the second terminal device, a security policy selected by the second terminal device, and a security algorithm generated by the second terminal device that is consistent with the second temporary privacy policy. The second temporary public key of key pairing, the second random number, the M bits of the identification of the first key, the x bits of the identification of the second key, the first Message verification code;
    其中,所述安全模式命令通过所述第一加密密钥进行加密,所述安全模式命令通过所述第一完整性保护密钥进行完整性保护,所述第一消息验证码基于所述第二完整性保护密钥生成,且所述第一消息验证码的输入参数包括以下至少之一:所述第二终端设备选取的安全算法,所述第二终端设备选取的安全策略,所述第二临时公钥,所述第二随机数,所述M个比特位,所述x个比特位,所述中继设备的相关信息;所述第二临时公钥和所述中继设备的相关信息用于所述第一终端设备派生所述第一密钥。Wherein, the security mode command is encrypted by the first encryption key, the security mode command is integrity protected by the first integrity protection key, and the first message verification code is based on the second The integrity protection key is generated, and the input parameters of the first message verification code include at least one of the following: the security algorithm selected by the second terminal device, the security policy selected by the second terminal device, the second Temporary public key, the second random number, the M bits, the x bits, the relevant information of the relay device; the second temporary public key and the relevant information of the relay device Used by the first terminal device to derive the first key.
  88. 如权利要求87所述的方法,其特征在于,所述方法还包括:The method of claim 87, further comprising:
    所述第二终端设备接收所述第一终端设备通过所述中继设备发送的安全模式建立完成消息;The second terminal device receives the security mode establishment completion message sent by the first terminal device through the relay device;
    其中,所述安全模式建立完成消息通过所述第二密钥或所述第二加密密钥进行加密,所述安全模式建立完成消息通过所述第二密钥或所述第二完整性保护密钥进行完整性保护;Wherein, the security mode establishment completion message is encrypted by the second key or the second encryption key, and the security mode establishment completion message is encrypted by the second key or the second integrity protection key. Key integrity protection;
    其中,所述安全模式建立完成消息至少包括所述第二密钥的标识的所述y个比特位。Wherein, the security mode establishment completion message includes at least the y bits of the identification of the second key.
  89. 如权利要求86至88中任一项所述的方法,其特征在于,The method according to any one of claims 86 to 88, characterized in that,
    所述第二完整性保护密钥的输入参数包括以下至少之一:所述第二密钥,选定的算法类型标识符,选定的算法类型标识符的长度,完整性保护算法标识,完整性保护算法标识的长度;和/或,The input parameters of the second integrity protection key include at least one of the following: the second key, the selected algorithm type identifier, the length of the selected algorithm type identifier, the integrity protection algorithm identifier, the complete The length of the sex protection algorithm identifier; and/or,
    所述第二加密密钥的输入参数包括以下至少之一:所述第二密钥,选定的算法类型标识符,选定的算法类型标识符的长度,机密性保护算法标识,机密性保护算法标识的长度。The input parameters of the second encryption key include at least one of the following: the second key, the selected algorithm type identifier, the length of the selected algorithm type identifier, the confidentiality protection algorithm identifier, the confidentiality protection The length of the algorithm identifier.
  90. 如权利要求85所述的方法,其特征在于,在所述第一随机数、所述第一密钥和所述第二随机数用于派生所述第二加密密钥和/或所述第二完整性保护密钥的情况下,所述方法还包括:The method of claim 85, wherein the first random number, the first key and the second random number are used to derive the second encryption key and/or the third In the case of two integrity protection keys, the method further includes:
    所述第二终端设备使用所述第一加密密钥解密所述直接通信请求,以及使用所述第一完整性保护密钥判断所述直接通信请求的完整性;The second terminal device uses the first encryption key to decrypt the direct communication request, and uses the first integrity protection key to determine the integrity of the direct communication request;
    在所述直接通信请求中携带的信息未遭受篡改的情况下,所述第二终端设备生成第二临时私钥, 以及所述第二终端设备根据所述第一临时公钥、所述第二临时私钥和所述中继设备的相关信息派生所述第一密钥,且所述第二终端设备生成所述第一密钥的标识的M个比特位;When the information carried in the direct communication request has not been tampered with, the second terminal device generates a second temporary private key, and the second terminal device generates a second temporary public key based on the first temporary public key and the second temporary public key. The first key is derived from the temporary private key and the relevant information of the relay device, and the second terminal device generates M bits of the identification of the first key;
    所述第二终端设备生成所述第二随时数,以及所述第二终端设备至少根据所述第一随机数、所述第一密钥和所述第二随机数生成所述第二完整性保护密钥和/或所述第二加密密钥;The second terminal device generates the second random number, and the second terminal device generates the second integrity based on at least the first random number, the first key and the second random number. protecting the key and/or said second encryption key;
    其中,所述第一密钥的标识由所述M个比特位与所述第一密钥的标识的另外N个比特位合并得到,M和N均为正整数。Wherein, the identifier of the first key is obtained by combining the M bits and the other N bits of the identifier of the first key, where M and N are both positive integers.
  91. 如权利要求90所述的方法,其特征在于,所述方法还包括:The method of claim 90, further comprising:
    所述第二终端设备通过所述中继设备向所述第一终端设备发送安全模式命令;The second terminal device sends a safe mode command to the first terminal device through the relay device;
    其中,所述安全模式命令包括以下至少之一:所述第二终端设备选取的安全算法,所述第二终端设备选取的安全策略,所述第二终端设备生成的与所述第二临时私钥配对的第二临时公钥,所述第二随机数,所述第一密钥的标识的所述M个比特位,第一消息验证码;Wherein, the security mode command includes at least one of the following: a security algorithm selected by the second terminal device, a security policy selected by the second terminal device, and a security algorithm generated by the second terminal device that is consistent with the second temporary privacy policy. The second temporary public key of key pairing, the second random number, the M bits of the identification of the first key, and the first message verification code;
    其中,所述安全模式命令通过所述第一加密密钥进行加密,所述安全模式命令通过所述第一完整性保护密钥进行完整性保护,所述第一消息验证码基于所述第二完整性保护密钥生成,且所述第一消息验证码的输入参数包括以下至少之一:所述第二终端设备选取的安全算法,所述第二终端设备选取的安全策略,所述第二临时公钥,所述第二随机数,所述M个比特位;所述第二临时公钥和所述中继设备的相关信息用于所述第一终端设备派生所述第一密钥。Wherein, the security mode command is encrypted by the first encryption key, the security mode command is integrity protected by the first integrity protection key, and the first message verification code is based on the second The integrity protection key is generated, and the input parameters of the first message verification code include at least one of the following: the security algorithm selected by the second terminal device, the security policy selected by the second terminal device, the second The temporary public key, the second random number, the M bits; the second temporary public key and the relevant information of the relay device are used by the first terminal device to derive the first key.
  92. 如权利要求91所述的方法,其特征在于,所述方法还包括:The method of claim 91, further comprising:
    所述第二终端设备接收所述第一终端设备通过所述中继设备发送的安全模式建立完成消息;The second terminal device receives the security mode establishment completion message sent by the first terminal device through the relay device;
    其中,所述安全模式建立完成消息通过所述第二加密密钥进行加密,所述安全模式建立完成消息通过所述第二完整性保护密钥进行完整性保护。Wherein, the security mode establishment completion message is encrypted by the second encryption key, and the security mode establishment completion message is integrity protected by the second integrity protection key.
  93. 如权利要求90至92中任一项所述的方法,其特征在于,The method according to any one of claims 90 to 92, characterized in that,
    所述第二完整性保护密钥的输入参数包括以下至少之一:所述第一随机数,所述第一密钥,所述第二随机数,选定的算法类型标识符,选定的算法类型标识符的长度,完整性保护算法标识,完整性保护算法标识的长度;和/或,The input parameters of the second integrity protection key include at least one of the following: the first random number, the first key, the second random number, the selected algorithm type identifier, the selected The length of the algorithm type identifier, the integrity protection algorithm identifier, the length of the integrity protection algorithm identifier; and/or,
    所述第二加密密钥的输入参数包括以下至少之一:所述第一随机数,所述第一密钥,所述第二随机数,选定的算法类型标识符,选定的算法类型标识符的长度,机密性保护算法标识,机密性保护算法标识的长度。The input parameters of the second encryption key include at least one of the following: the first random number, the first key, the second random number, the selected algorithm type identifier, the selected algorithm type The length of the identifier, the confidentiality protection algorithm identifier, the length of the confidentiality protection algorithm identifier.
  94. 如权利要求87或91所述的方法,其特征在于,所述安全模式命令还包括所述中继设备的相关信息,以及所述第一消息验证码的输入参数还包括所述中继设备的相关信息。The method according to claim 87 or 91, characterized in that the safe mode command also includes relevant information of the relay device, and the input parameters of the first message verification code also include the information of the relay device. Related Information.
  95. 如权利要求88或92所述的方法,其特征在于,所述方法还包括:The method of claim 88 or 92, further comprising:
    所述第二终端设备根据所述第二终端设备选取的安全算法、所述第二完整性保护密钥和/或所述第二加密密钥、所述第二终端设备选取的安全策略,与所述第一终端设备进行通信。The second terminal device, according to the security algorithm selected by the second terminal device, the second integrity protection key and/or the second encryption key, the security policy selected by the second terminal device, and The first terminal device communicates.
  96. 如权利要求85至95中任一项所述的方法,其特征在于,所述第一加密密钥为邻近业务加密密钥PEK,所述第一完整性保护密钥为邻近业务完整性保护密钥PIK。The method according to any one of claims 85 to 95, wherein the first encryption key is a proximity service encryption key PEK, and the first integrity protection key is a proximity service integrity protection key. Key PIK.
  97. 一种中继通信的方法,其特征在于,包括:A method for relaying communications, characterized by including:
    中继设备接收第一终端设备发送的直接通信请求;其中,所述直接通信请求包括以下至少之一:所述第一终端设备的安全能力信息,所述第一终端设备的安全策略信息,所述第一终端设备生成的第一临时公钥,所述第一终端设备生成的第一随机数;其中,所述直接通信请求通过第一加密密钥进行加密,以及所述直接通信请求通过第一完整性保护密钥进行完整性保护,所述第一加密密钥为基于已注册并被授权使用终端至终端中继UE-to-UE relay通信的终端的对称密钥衍生的加密密钥,所述第一完整性保护密钥为基于已注册并被授权使用UE-to-UE relay通信的终端的对称密钥衍生的完整性保护密钥;The relay device receives a direct communication request sent by the first terminal device; wherein the direct communication request includes at least one of the following: security capability information of the first terminal device, security policy information of the first terminal device, The first temporary public key generated by the first terminal device, the first random number generated by the first terminal device; wherein the direct communication request is encrypted by a first encryption key, and the direct communication request is encrypted by a first encryption key. An integrity protection key performs integrity protection, and the first encryption key is an encryption key derived based on a symmetric key of a terminal that is registered and authorized to use terminal-to-terminal relay UE-to-UE relay communications, The first integrity protection key is an integrity protection key derived based on a symmetric key of a terminal that has been registered and authorized to use UE-to-UE relay communication;
    所述中继设备验证是否被配置为转发直接通信请求,在验证通过之后所述中继设备使用所述第一加密密钥解密所述直接通信请求以获取服务质量QoS和计费信息,以及所述中继设备使用所述第一完整性保护密钥验证所述直接通信请求的完整性,在验证通过之后所述中继设备在所述直接通信请求中添加所述中继设备的相关信息和所述中继设备的标识,并且所述中继设备使用所述第一加密密钥加密所述直接通信请求,使用所述第一完整性保护密钥保护所述直接通信请求的完整性,并将所述直接通信请求转发至第二终端设备;The relay device verifies whether it is configured to forward the direct communication request. After the verification is passed, the relay device uses the first encryption key to decrypt the direct communication request to obtain quality of service QoS and charging information, and the The relay device uses the first integrity protection key to verify the integrity of the direct communication request. After the verification is passed, the relay device adds relevant information of the relay device and an identification of the relay device, and the relay device encrypts the direct communication request using the first encryption key, protects the integrity of the direct communication request using the first integrity protection key, and Forward the direct communication request to the second terminal device;
    其中,所述中继设备的相关信息包括以下之一:所述中继设备的身份信息,所述中继设备生成的随机数,所述中继设备生成的计数器;所述第一临时公钥和所述中继设备的相关信息用于第二终端设备派生第一密钥;所述第一随机数、所述第一密钥和所述第二终端设备生成的第二随机数用于派生第二密钥,且所述第二密钥用于派生第二加密密钥和/或第二完整性保护密钥,或者,所述第一随机数、 所述第一密钥和所述第二终端设备生成的第二随机数用于派生第二加密密钥和/或第二完整性保护密钥。Wherein, the relevant information of the relay device includes one of the following: the identity information of the relay device, the random number generated by the relay device, the counter generated by the relay device; the first temporary public key The information related to the relay device is used by the second terminal device to derive the first key; the first random number, the first key and the second random number generated by the second terminal device are used to derive the first key. a second key, and the second key is used to derive a second encryption key and/or a second integrity protection key, or the first random number, the first key and the second The second random number generated by the second terminal device is used to derive the second encryption key and/or the second integrity protection key.
  98. 如权利要求97所述的方法,其特征在于,在所述第一随机数、所述第一密钥和所述第二随机数用于派生所述第二密钥的情况下,所述方法还包括:The method of claim 97, wherein when the first random number, the first key and the second random number are used to derive the second key, the method Also includes:
    所述中继设备接收所述第二终端设备发送的安全模式命令;其中,所述安全模式命令包括以下至少之一:所述第二终端设备选取的安全算法,所述第二终端设备选取的安全策略,所述第二终端设备生成的第二临时公钥,所述第二终端设备生成的所述第二随机数,所述第二终端设备生成的所述第一密钥的标识的M个比特位,所述第二终端设备生成的所述第二密钥的标识的x个比特位,第一消息验证码;其中,所述安全模式命令通过所述第一加密密钥进行加密,所述安全模式命令通过所述第一完整性保护密钥进行完整性保护,所述第一消息验证码基于所述第二完整性保护密钥生成,且所述第一消息验证码的输入参数包括以下至少之一:所述第二终端设备选取的安全算法,所述第二终端设备选取的安全策略,所述第二临时公钥,所述第二随机数,所述M个比特位,所述x个比特位,所述中继设备的相关信息;所述第二临时公钥和所述中继设备的相关信息用于所述第一终端设备派生所述第一密钥;The relay device receives a security mode command sent by the second terminal device; wherein the security mode command includes at least one of the following: a security algorithm selected by the second terminal device, a security algorithm selected by the second terminal device, Security policy, the second temporary public key generated by the second terminal device, the second random number generated by the second terminal device, the M of the identification of the first key generated by the second terminal device bits, x bits of the identification of the second key generated by the second terminal device, and the first message verification code; wherein the security mode command is encrypted by the first encryption key, The security mode command performs integrity protection through the first integrity protection key, the first message verification code is generated based on the second integrity protection key, and the input parameters of the first message verification code Including at least one of the following: the security algorithm selected by the second terminal device, the security policy selected by the second terminal device, the second temporary public key, the second random number, the M bits, The x bits, the relevant information of the relay device; the second temporary public key and the relevant information of the relay device are used by the first terminal device to derive the first key;
    所述中继设备使用所述第一加密密钥解密所述安全模式命令,以获取QoS和计费信息,并在向所述第一终端设备转发所述安全模式命令;The relay device uses the first encryption key to decrypt the security mode command to obtain QoS and charging information, and forwards the security mode command to the first terminal device;
    其中,所述第二临时公钥和所述中继设备的相关信息用于所述第一终端设备派生所述第一密钥,所述第一密钥的标识由所述M个比特位与所述第一密钥的标识的另外N个比特位合并得到,M和N均为正整数,所述第二密钥的标识由所述x个比特位与所述第二密钥的标识的另外y个比特位合并得到,x和y均为正整数。Wherein, the second temporary public key and the relevant information of the relay device are used by the first terminal device to derive the first key, and the identification of the first key is composed of the M bits and The other N bits of the identification of the first key are combined. M and N are both positive integers. The identification of the second key is obtained by combining the x bits and the identification of the second key. In addition, y bits are combined, and x and y are both positive integers.
  99. 如权利要求98所述的方法,其特征在于,所述方法还包括:The method of claim 98, further comprising:
    所述中继设备向所述第二终端设备转发所述第一终端设备发送的安全模式建立完成消息;The relay device forwards the security mode establishment completion message sent by the first terminal device to the second terminal device;
    其中,所述安全模式建立完成消息通过所述第二密钥或所述第二加密密钥进行加密,所述安全模式建立完成消息通过所述第二密钥或所述第二完整性保护密钥进行完整性保护;Wherein, the security mode establishment completion message is encrypted by the second key or the second encryption key, and the security mode establishment completion message is encrypted by the second key or the second integrity protection key. Key integrity protection;
    其中,所述安全模式建立完成消息至少包括所述第二密钥的标识的所述y个比特位。Wherein, the security mode establishment completion message includes at least the y bits of the identification of the second key.
  100. 如权利要求97所述的方法,其特征在于,在所述第一随机数、所述第一密钥和所述第二随机数用于派生所述第二加密密钥和/或所述第二完整性保护密钥的情况下,所述方法还包括:The method of claim 97, wherein the first random number, the first key and the second random number are used to derive the second encryption key and/or the third In the case of two integrity protection keys, the method further includes:
    所述中继设备接收所述第二终端设备发送的安全模式命令;其中,所述安全模式命令包括以下至少之一:所述第二终端设备选取的安全算法,所述第二终端设备选取的安全策略,所述第二终端设备生成的第二临时公钥,所述第二终端设备生成的所述第二随机数,所述第二终端设备生成的所述第一密钥的标识的M个比特位,第一消息验证码;其中,所述安全模式命令通过所述第一加密密钥进行加密,所述安全模式命令通过所述第一完整性保护密钥进行完整性保护,所述第一消息验证码基于所述第二完整性保护密钥生成,且所述第一消息验证码的输入参数包括以下至少之一:所述第二终端设备选取的安全算法,所述第二终端设备选取的安全策略,所述第二临时公钥,所述第二随机数,所述M个比特位,所述中继设备的相关信息;所述第二临时公钥和所述中继设备的相关信息用于所述第一终端设备派生所述第一密钥;The relay device receives a security mode command sent by the second terminal device; wherein the security mode command includes at least one of the following: a security algorithm selected by the second terminal device, a security algorithm selected by the second terminal device, Security policy, the second temporary public key generated by the second terminal device, the second random number generated by the second terminal device, the M of the identification of the first key generated by the second terminal device bits, the first message verification code; wherein the security mode command is encrypted by the first encryption key, the security mode command is integrity protected by the first integrity protection key, and the The first message verification code is generated based on the second integrity protection key, and the input parameters of the first message verification code include at least one of the following: the security algorithm selected by the second terminal device, the second terminal device The security policy selected by the device, the second temporary public key, the second random number, the M bits, the relevant information of the relay device; the second temporary public key and the relay device The relevant information is used by the first terminal device to derive the first key;
    所述中继设备使用所述第一加密密钥解密所述安全模式命令,以获取QoS和计费信息,并在向所述第一终端设备转发所述安全模式命令;The relay device uses the first encryption key to decrypt the security mode command to obtain QoS and charging information, and forwards the security mode command to the first terminal device;
    其中,所述第二临时公钥和所述中继设备的相关信息用于所述第一终端设备派生所述第一密钥,所述第一密钥的标识由所述M个比特位与所述第一密钥的标识的另外N个比特位合并得到,M和N均为正整数。Wherein, the second temporary public key and the relevant information of the relay device are used by the first terminal device to derive the first key, and the identification of the first key is composed of the M bits and The other N bits of the identifier of the first key are combined and obtained, and M and N are both positive integers.
  101. 如权利要求100所述的方法,其特征在于,所述方法还包括:The method of claim 100, further comprising:
    所述中继设备向所述第二终端设备转发所述第一终端设备发送的安全模式建立完成消息;The relay device forwards the security mode establishment completion message sent by the first terminal device to the second terminal device;
    其中,所述安全模式建立完成消息通过所述第二加密密钥进行加密,所述安全模式建立完成消息通过所述第二完整性保护密钥进行完整性保护。Wherein, the security mode establishment completion message is encrypted by the second encryption key, and the security mode establishment completion message is integrity protected by the second integrity protection key.
  102. 如权利要求98至101中任一项所述的方法,其特征在于,The method according to any one of claims 98 to 101, characterized in that,
    所述安全模式命令包括所述中继设备的相关信息,以及所述第一消息验证码的输入参数还包括所述中继设备的相关信息;或者,所述中继设备在向所述第一终端设备转发的所述安全模式命令中添加了所述中继设备的相关信息。The safe mode command includes relevant information of the relay device, and the input parameter of the first message verification code also includes relevant information of the relay device; or, the relay device transmits information to the first message verification code. The relevant information of the relay device is added to the safe mode command forwarded by the terminal device.
  103. 如权利要求97至102中任一项所述的方法,其特征在于,所述第一加密密钥为邻近业务加密密钥PEK,所述第一完整性保护密钥为邻近业务完整性保护密钥PIK。The method according to any one of claims 97 to 102, wherein the first encryption key is a proximity service encryption key PEK, and the first integrity protection key is a proximity service integrity protection key. Key PIK.
  104. 一种终端设备,其特征在于,所述终端设备为第一终端设备,所述终端设备包括:A terminal device, characterized in that the terminal device is a first terminal device, and the terminal device includes:
    通信单元,用于接收第二终端设备通过中继设备发送的认证请求消息;A communication unit, configured to receive an authentication request message sent by the second terminal device through the relay device;
    其中,所述认证请求消息包括以下至少之一:所述第二终端设备所属用户的信息,所述中继设备所属用户的信息,所述第二终端设备生成的第一临时公钥,所述第二终端设备的签名,所述中继设备的签名,所述中继设备的相关信息;Wherein, the authentication request message includes at least one of the following: information about the user to which the second terminal device belongs, information about the user to which the relay device belongs, the first temporary public key generated by the second terminal device, the The signature of the second terminal device, the signature of the relay device, and the relevant information of the relay device;
    其中,所述第二终端设备所属用户的信息包括所述第二终端设备的标识和所述第二终端设备的公共验证令牌PVT和密钥管理服务器的公共认证密钥KPAK;所述中继设备所属用户的信息包括所述中继设备的标识和所述中继设备的PVT和KPAK;所述第二终端设备的签名的输入参数包括以下至少之一:所述第二终端设备所属用户的信息和所述第一临时公钥;所述中继设备的签名的输入参数包括以下至少之一:所述第二终端设备的签名和所述中继设备所属用户的信息;所述第一临时公钥和所述中继设备的相关信息用于所述第一终端设备派生第一密钥;所述中继设备的相关信息包括以下之一:所述中继设备的身份信息,所述中继设备生成的随机数,所述中继设备生成的计数器。Wherein, the information of the user to which the second terminal device belongs includes the identification of the second terminal device, the public verification token PVT of the second terminal device and the public authentication key KPAK of the key management server; the relay The information of the user to whom the device belongs includes the identification of the relay device and the PVT and KPAK of the relay device; the input parameters of the signature of the second terminal device include at least one of the following: information and the first temporary public key; the input parameters of the signature of the relay device include at least one of the following: the signature of the second terminal device and the information of the user to which the relay device belongs; the first temporary The public key and the relevant information of the relay device are used by the first terminal device to derive the first key; the relevant information of the relay device includes one of the following: the identity information of the relay device, the The relay device generates a random number, and the relay device generates a counter.
  105. 一种终端设备,其特征在于,所述终端设备为第二终端设备,所述终端设备包括:A terminal device, characterized in that the terminal device is a second terminal device, and the terminal device includes:
    通信单元,用于通过中继设备向第一终端设备发送认证请求消息;A communication unit, configured to send an authentication request message to the first terminal device through the relay device;
    其中,所述认证请求消息包括以下至少之一:所述第二终端设备所属用户的信息,所述第二终端设备生成的第一临时公钥,所述第二终端设备的签名,所述中继设备的相关信息;Wherein, the authentication request message includes at least one of the following: information about the user to which the second terminal device belongs, the first temporary public key generated by the second terminal device, the signature of the second terminal device, the Relevant information about relay equipment;
    其中,所述第二终端设备所属用户的信息包括所述第二终端设备的标识和所述第二终端设备的公共验证令牌PVT和密钥管理服务器的公共认证密钥KPAK;所述第二终端设备的签名的输入参数包括以下至少之一:所述第二终端设备所属用户的信息和所述第一临时公钥;所述第一临时公钥和所述中继设备的相关信息用于所述第一终端设备派生第一密钥;所述中继设备的相关信息包括以下之一:所述中继设备的身份信息,所述中继设备生成的随机数,所述中继设备生成的计数器。Wherein, the information of the user to which the second terminal device belongs includes the identification of the second terminal device, the public verification token PVT of the second terminal device and the public authentication key KPAK of the key management server; the second The input parameters of the terminal device's signature include at least one of the following: information about the user to which the second terminal device belongs and the first temporary public key; and information related to the first temporary public key and the relay device. The first terminal device derives a first key; the relevant information of the relay device includes one of the following: the identity information of the relay device, the random number generated by the relay device, the counter.
  106. 一种终端设备,其特征在于,所述终端设备为中继设备,所述终端设备包括:A terminal device, characterized in that the terminal device is a relay device, and the terminal device includes:
    通信单元,用于接收第二终端设备发送的认证请求消息;其中,所述认证请求消息包括以下至少之一:所述第二终端设备所属用户的信息,所述第二终端设备生成的第一临时公钥,所述第二终端设备的签名;其中,所述第二终端设备所属用户的信息包括所述第二终端设备的标识和所述第二终端设备的公共验证令牌PVT和密钥管理服务器的公共认证密钥KPAK;所述第二终端设备的签名的输入参数包括以下至少之一:所述第二终端设备所属用户的信息和所述第一临时公钥;A communication unit configured to receive an authentication request message sent by a second terminal device; wherein the authentication request message includes at least one of the following: information about the user to which the second terminal device belongs, the first message generated by the second terminal device. Temporary public key, the signature of the second terminal device; wherein the information of the user to which the second terminal device belongs includes the identification of the second terminal device and the public verification token PVT and key of the second terminal device The public authentication key KPAK of the management server; the input parameters of the signature of the second terminal device include at least one of the following: information of the user to which the second terminal device belongs and the first temporary public key;
    在所述第二终端设备的KPAK有效,且基于所述第二终端设备的标识和所述第二终端设备的PVT对所述第二终端设备的签名验证成功的情况下,所述通信单元还用于向第一终端设备发送验证之后的认证请求消息;其中,所述验证之后的认证请求消息包括以下至少之一:所述第二终端设备所属用户的信息,所述中继设备所属用户的信息,所述第一临时公钥,所述第二终端设备的签名,所述中继设备的签名,所述中继设备的相关信息;其中,所述中继设备所属用户的信息包括所述中继设备的标识和所述中继设备的PVT和KPAK;所述中继设备的签名的输入参数包括以下至少之一:所述第二终端设备的签名和所述中继设备所属用户的信息;其中,所述第一临时公钥和所述中继设备的相关信息用于所述第一终端设备派生第一密钥;所述中继设备的相关信息包括以下之一:所述中继设备的身份信息,所述中继设备生成的随机数,所述中继设备生成的计数器。When the KPAK of the second terminal device is valid and the signature verification of the second terminal device is successful based on the identification of the second terminal device and the PVT of the second terminal device, the communication unit further Used to send an authentication request message after verification to the first terminal device; wherein the authentication request message after verification includes at least one of the following: information about the user to whom the second terminal device belongs, information about the user to whom the relay device belongs. information, the first temporary public key, the signature of the second terminal device, the signature of the relay device, and relevant information of the relay device; wherein the information of the user to which the relay device belongs includes the The identification of the relay device and the PVT and KPAK of the relay device; the input parameters of the signature of the relay device include at least one of the following: the signature of the second terminal device and the information of the user to which the relay device belongs. ; Wherein, the first temporary public key and the relevant information of the relay device are used by the first terminal device to derive the first key; the relevant information of the relay device includes one of the following: the relay The identity information of the device, the random number generated by the relay device, and the counter generated by the relay device.
  107. 一种终端设备,其特征在于,所述终端设备为第一终端设备,所述终端设备包括:A terminal device, characterized in that the terminal device is a first terminal device, and the terminal device includes:
    通信单元,用于通过中继设备向第二终端设备发送第一消息;A communication unit, configured to send the first message to the second terminal device through the relay device;
    其中,所述第一消息包括以下至少之一:所述第一终端设备的安全能力信息,所述第一终端设备的安全策略信息,所述第一终端设备所属用户的信息,所述第一终端设备生成的第一随机数,所述第一终端设备生成的第二临时公钥,所述第一终端设备生成的第一密钥的标识的M个比特位,所述第一终端设备的签名,第一消息验证码;Wherein, the first message includes at least one of the following: security capability information of the first terminal device, security policy information of the first terminal device, information of the user to which the first terminal device belongs, the first The first random number generated by the terminal device, the second temporary public key generated by the first terminal device, the M bits of the identification of the first key generated by the first terminal device, the Signature, first message verification code;
    其中,所述第一终端设备所属用户的信息包括所述第一终端设备的标识和所述第一终端设备的公共验证令牌PVT和密钥管理服务器的公共认证密钥KPAK;所述第一终端设备的签名的输入参数包括以下至少之一:所述第一终端设备所属用户的信息,所述第二临时公钥,所述M个比特位,所述第二终端设备的签名;Wherein, the information of the user to which the first terminal device belongs includes the identification of the first terminal device, the public verification token PVT of the first terminal device and the public authentication key KPAK of the key management server; the first The input parameters of the signature of the terminal device include at least one of the following: information of the user to which the first terminal device belongs, the second temporary public key, the M bits, and the signature of the second terminal device;
    其中,所述第一消息通过基于所述第一密钥生成的所述第一消息验证码进行完整性保护,且所述第一消息验证码的输入参数包括以下至少之一:所述第一终端设备的安全能力信息,所述第一终端设备的安全策略信息,所述第一终端设备所属用户的信息,所述第一随机数,所述第二临时公钥,所述M个比特位,所述第一终端设备的签名;Wherein, the first message is integrity protected by the first message verification code generated based on the first key, and the input parameters of the first message verification code include at least one of the following: the first Security capability information of the terminal device, security policy information of the first terminal device, information of the user to which the first terminal device belongs, the first random number, the second temporary public key, the M bits , the signature of the first terminal device;
    其中,所述第二临时公钥和所述中继设备的相关信息用于所述第二终端设备派生所述第一密钥,所述第一随机数、所述第一密钥和所述第二终端设备生成的第二随机数用于派生第二密钥,所述第二密钥用于派生完整性保护密钥和/或机密性保护密钥,所述第一密钥的标识由所述M个比特位与所述 第一密钥的标识的另外N个比特位合并得到,M和N均为正整数;Wherein, the second temporary public key and the relevant information of the relay device are used by the second terminal device to derive the first key, the first random number, the first key and the The second random number generated by the second terminal device is used to derive a second key, the second key is used to derive an integrity protection key and/or a confidentiality protection key, and the identity of the first key is given by The M bits are obtained by combining the other N bits of the identification of the first key, where M and N are both positive integers;
    其中,所述中继设备的相关信息包括以下之一:所述中继设备的身份信息,所述中继设备生成的随机数,所述中继设备生成的计数器。Wherein, the relevant information of the relay device includes one of the following: identity information of the relay device, a random number generated by the relay device, and a counter generated by the relay device.
  108. 一种终端设备,其特征在于,所述终端设备为第二终端设备,所述终端设备包括:A terminal device, characterized in that the terminal device is a second terminal device, and the terminal device includes:
    通信单元,用于接收第一终端设备通过中继设备发送的第一消息;A communication unit, configured to receive the first message sent by the first terminal device through the relay device;
    其中,所述第一消息包括以下至少之一:所述第一终端设备的安全能力信息,所述第一终端设备的安全策略信息,所述第一终端设备所属用户的信息,所述中继设备所属用户的信息,所述第一终端设备生成的第一随机数,所述第一终端设备生成的第二临时公钥,所述第一终端设备生成的第一密钥的标识的M个比特位,所述第一终端设备的签名,所述中继设备的签名,第一消息验证码;Wherein, the first message includes at least one of the following: security capability information of the first terminal device, security policy information of the first terminal device, information of the user to which the first terminal device belongs, the relay Information about the user to whom the device belongs, the first random number generated by the first terminal device, the second temporary public key generated by the first terminal device, M identification numbers of the first key generated by the first terminal device bits, the signature of the first terminal device, the signature of the relay device, and the first message verification code;
    其中,所述第一终端设备所属用户的信息包括所述第一终端设备的标识和所述第一终端设备的公共验证令牌PVT和密钥管理服务器的公共认证密钥KPAK;所述中继设备所属用户的信息包括所述中继设备的标识和所述中继设备的PVT和KPAK;所述第一终端设备的签名的输入参数包括以下至少之一:所述第一终端设备所属用户的信息,所述第二临时公钥,所述M个比特位,所述第二终端设备的签名;所述中继设备的签名的输入参数包括以下至少之一:所述中继设备所属用户的信息,所述第一终端设备的签名,所述第二终端设备的签名,所述第一消息;Wherein, the information of the user to which the first terminal device belongs includes the identification of the first terminal device, the public verification token PVT of the first terminal device and the public authentication key KPAK of the key management server; the relay The information of the user to whom the device belongs includes the identification of the relay device and the PVT and KPAK of the relay device; the input parameters of the signature of the first terminal device include at least one of the following: information, the second temporary public key, the M bits, and the signature of the second terminal device; the input parameters of the signature of the relay device include at least one of the following: the user to whom the relay device belongs Information, the signature of the first terminal device, the signature of the second terminal device, the first message;
    其中,所述第一消息通过基于所述第一密钥生成的所述第一消息验证码进行完整性保护,且所述第一消息验证码的输入参数包括以下至少之一:所述第一终端设备的安全能力信息,所述第一终端设备的安全策略信息,所述第一终端设备所属用户的信息,所述第一随机数,所述第二临时公钥,所述M个比特位,所述第一终端设备的签名;Wherein, the first message is integrity protected by the first message verification code generated based on the first key, and the input parameters of the first message verification code include at least one of the following: the first Security capability information of the terminal device, security policy information of the first terminal device, information of the user to which the first terminal device belongs, the first random number, the second temporary public key, the M bits , the signature of the first terminal device;
    其中,所述第二临时公钥和所述中继设备的相关信息用于所述第二终端设备派生所述第一密钥,所述第一随机数、所述第一密钥和所述第二终端设备生成的第二随机数用于派生第二密钥,所述第二密钥用于派生完整性保护密钥和/或机密性保护密钥,所述第一密钥的标识由所述M个比特位与所述第一密钥的标识的另外N个比特位合并得到,M和N均为正整数;Wherein, the second temporary public key and the relevant information of the relay device are used by the second terminal device to derive the first key, the first random number, the first key and the The second random number generated by the second terminal device is used to derive a second key, the second key is used to derive an integrity protection key and/or a confidentiality protection key, and the identity of the first key is given by The M bits are obtained by combining the other N bits of the identification of the first key, where M and N are both positive integers;
    其中,所述中继设备的相关信息包括以下之一:所述中继设备的身份信息,所述中继设备生成的随机数,所述中继设备生成的计数器。Wherein, the relevant information of the relay device includes one of the following: identity information of the relay device, a random number generated by the relay device, and a counter generated by the relay device.
  109. 一种终端设备,其特征在于,所述终端设备为中继设备,所述终端设备包括:A terminal device, characterized in that the terminal device is a relay device, and the terminal device includes:
    通信单元,用于接收第一终端设备发送的第一消息;其中,所述第一消息包括以下至少之一:所述第一终端设备的安全能力信息,所述第一终端设备的安全策略信息,所述第一终端设备所属用户的信息,所述第一终端设备生成的第一随机数,所述第一终端设备生成的第二临时公钥,所述第一终端设备生成的第一密钥的标识的M个比特位,所述第一终端设备的签名,第一消息验证码;其中,所述第一终端设备所属用户的信息包括所述第一终端设备的标识和所述第一终端设备的公共验证令牌PVT和密钥管理服务器的公共认证密钥KPAK;所述第一终端设备的签名的输入参数包括以下至少之一:所述第一终端设备所属用户的信息,所述第二临时公钥,所述M个比特位,所述第二终端设备的签名;其中,所述第一消息通过基于所述第一密钥生成的所述第一消息验证码进行完整性保护,且所述第一消息验证码的输入参数包括以下至少之一:所述第一终端设备的安全能力信息,所述第一终端设备的安全策略信息,所述第一终端设备所属用户的信息,所述第一随机数,所述第二临时公钥,所述M个比特位,所述第一终端设备的签名;A communication unit, configured to receive a first message sent by a first terminal device; wherein the first message includes at least one of the following: security capability information of the first terminal device, security policy information of the first terminal device , the information of the user to which the first terminal device belongs, the first random number generated by the first terminal device, the second temporary public key generated by the first terminal device, the first password generated by the first terminal device M bits of the identification key, the signature of the first terminal device, and the first message verification code; wherein the information about the user to which the first terminal device belongs includes the identification of the first terminal device and the first message verification code. The public verification token PVT of the terminal device and the public authentication key KPAK of the key management server; the input parameters of the signature of the first terminal device include at least one of the following: information of the user to which the first terminal device belongs, the The second temporary public key, the M bits, and the signature of the second terminal device; wherein the first message is integrity protected through the first message verification code generated based on the first key. , and the input parameters of the first message verification code include at least one of the following: security capability information of the first terminal device, security policy information of the first terminal device, and information of the user to which the first terminal device belongs. , the first random number, the second temporary public key, the M bits, and the signature of the first terminal device;
    在所述第一终端设备的KPAK有效,且基于所述第一终端设备的标识和所述第一终端设备的PVT对所述第一终端设备的签名验证成功的情况下,所述通信单元还用于向所述第二终端设备发送验证之后的第一消息;其中,所述验证之后的第一消息包括以下至少之一:所述第一终端设备的安全能力信息,所述第一终端设备的安全策略信息,所述第一终端设备所属用户的信息,所述中继设备所属用户的信息,所述第一终端设备生成的第一随机数,所述第一终端设备生成的与所述第二临时私钥配对的第二临时公钥,所述第一终端设备生成的所述第一密钥的标识的M个比特位,所述第一终端设备的签名,所述中继设备的签名,所述中继设备的相关信息,所述第一消息验证码;其中,所述中继设备所属用户的信息包括所述中继设备的标识和所述中继设备的PVT和KPAK;所述中继设备的签名的输入参数包括以下至少之一:所述中继设备所属用户的信息,所述第一终端设备的签名,所述第二终端设备的签名,所述验证之后的第一消息;When the KPAK of the first terminal device is valid and the signature verification of the first terminal device is successful based on the identification of the first terminal device and the PVT of the first terminal device, the communication unit also For sending the first message after verification to the second terminal device; wherein the first message after verification includes at least one of the following: security capability information of the first terminal device, the first terminal device The security policy information, the information of the user to which the first terminal device belongs, the information of the user to which the relay device belongs, the first random number generated by the first terminal device, the number generated by the first terminal device and the The second temporary public key paired with the second temporary private key, the M bits of the identification of the first key generated by the first terminal device, the signature of the first terminal device, the Signature, relevant information of the relay device, and the first message verification code; wherein the information of the user to which the relay device belongs includes the identification of the relay device and the PVT and KPAK of the relay device; The input parameters of the signature of the relay device include at least one of the following: information of the user to which the relay device belongs, the signature of the first terminal device, the signature of the second terminal device, the first signature after the verification information;
    其中,所述第二临时公钥和所述中继设备的相关信息用于所述第二终端设备派生所述第一密钥,所述第一随机数、所述第一密钥和所述第二终端设备生成的第二随机数用于派生第二密钥,所述第二密钥用于派生完整性保护密钥和/或机密性保护密钥,所述第一密钥的标识由所述M个比特位与所述第一密钥的标识的另外N个比特位合并得到,M和N均为正整数;其中,所述中继设备的相关信息包括以下之一:所述中继设备的身份信息,所述中继设备生成的随机数,所述中继设备生成的计数器。Wherein, the second temporary public key and the relevant information of the relay device are used by the second terminal device to derive the first key, the first random number, the first key and the The second random number generated by the second terminal device is used to derive a second key, the second key is used to derive an integrity protection key and/or a confidentiality protection key, and the identity of the first key is given by The M bits are combined with the other N bits of the identification of the first key, and M and N are both positive integers; wherein the relevant information of the relay device includes one of the following: The identity information of the relay device, the random number generated by the relay device, and the counter generated by the relay device.
  110. 一种终端设备,其特征在于,所述终端设备为第一终端设备,所述终端设备包括:A terminal device, characterized in that the terminal device is a first terminal device, and the terminal device includes:
    通信单元,用于通过中继设备向第二终端设备发送直接通信请求;A communication unit, configured to send a direct communication request to the second terminal device through the relay device;
    其中,所述直接通信请求包括以下至少之一:所述第一终端设备的安全能力信息,所述第一终端设备的安全策略信息,所述第一终端设备生成的第一临时公钥,所述第一终端设备生成的第一随机数;Wherein, the direct communication request includes at least one of the following: security capability information of the first terminal device, security policy information of the first terminal device, the first temporary public key generated by the first terminal device, the The first random number generated by the first terminal device;
    其中,所述直接通信请求通过第一加密密钥进行加密,以及所述直接通信请求通过第一完整性保护密钥进行完整性保护,所述第一加密密钥为基于已注册并被授权使用终端至终端中继UE-to-UE relay通信的终端的对称密钥衍生的加密密钥,所述第一完整性保护密钥为基于已注册并被授权使用UE-to-UE relay通信的终端的对称密钥衍生的完整性保护密钥;Wherein, the direct communication request is encrypted by a first encryption key, and the direct communication request is integrity protected by a first integrity protection key, and the first encryption key is based on being registered and authorized for use. An encryption key derived from the symmetric key of a terminal that relays UE-to-UE relay communications, where the first integrity protection key is based on a terminal that is registered and authorized to use UE-to-UE relay communications. An integrity-protected key derived from a symmetric key;
    其中,所述第一临时公钥和所述中继设备的相关信息用于所述第二终端设备派生第一密钥;所述第一随机数、所述第一密钥和所述第二终端设备生成的第二随机数用于派生第二密钥,且所述第二密钥用于派生第二加密密钥和/或第二完整性保护密钥,或者,所述第一随机数、所述第一密钥和所述第二终端设备生成的第二随机数用于派生第二加密密钥和/或第二完整性保护密钥;Wherein, the first temporary public key and the relevant information of the relay device are used by the second terminal device to derive the first key; the first random number, the first key and the second The second random number generated by the terminal device is used to derive a second key, and the second key is used to derive a second encryption key and/or a second integrity protection key, or the first random number , the first key and the second random number generated by the second terminal device are used to derive a second encryption key and/or a second integrity protection key;
    其中,所述中继设备的相关信息包括以下之一:所述中继设备的身份信息,所述中继设备生成的随机数,所述中继设备生成的计数器。Wherein, the relevant information of the relay device includes one of the following: identity information of the relay device, a random number generated by the relay device, and a counter generated by the relay device.
  111. 一种终端设备,其特征在于,所述终端设备为第二终端设备,所述终端设备包括:A terminal device, characterized in that the terminal device is a second terminal device, and the terminal device includes:
    通信单元,用于接收第一终端设备通过中继设备发送的直接通信请求;A communication unit configured to receive a direct communication request sent by the first terminal device through the relay device;
    其中,所述直接通信请求包括以下至少之一:所述第一终端设备的安全能力信息,所述第一终端设备的安全策略信息,所述第一终端设备生成的第一临时公钥,所述第一终端设备生成的第一随机数,所述中继设备的标识,所述中继设备的相关信息;Wherein, the direct communication request includes at least one of the following: security capability information of the first terminal device, security policy information of the first terminal device, the first temporary public key generated by the first terminal device, the The first random number generated by the first terminal device, the identification of the relay device, and the relevant information of the relay device;
    其中,所述直接通信请求通过第一加密密钥进行加密,以及所述直接通信请求通过第一完整性保护密钥进行完整性保护,所述第一加密密钥为基于已注册并被授权使用终端至终端中继UE-to-UE relay通信的终端的对称密钥衍生的加密密钥,所述第一完整性保护密钥为基于已注册并被授权使用UE-to-UE relay通信的终端的对称密钥衍生的完整性保护密钥;Wherein, the direct communication request is encrypted by a first encryption key, and the direct communication request is integrity protected by a first integrity protection key, and the first encryption key is based on being registered and authorized for use. An encryption key derived from the symmetric key of a terminal that relays UE-to-UE relay communications, where the first integrity protection key is based on a terminal that is registered and authorized to use UE-to-UE relay communications. An integrity-protected key derived from a symmetric key;
    其中,所述中继设备的相关信息包括以下之一:所述中继设备的身份信息,所述中继设备生成的随机数,所述中继设备生成的计数器;所述第一临时公钥和所述中继设备的相关信息用于所述第二终端设备派生第一密钥;所述第一随机数、所述第一密钥和所述第二终端设备生成的第二随机数用于派生第二密钥,且所述第二密钥用于派生第二加密密钥和/或第二完整性保护密钥,或者,所述第一随机数、所述第一密钥和所述第二终端设备生成的第二随机数用于派生第二加密密钥和/或第二完整性保护密钥。Wherein, the relevant information of the relay device includes one of the following: the identity information of the relay device, the random number generated by the relay device, the counter generated by the relay device; the first temporary public key The information related to the relay device is used for the second terminal device to derive the first key; the first random number, the first key and the second random number generated by the second terminal device are used for to derive a second key, and the second key is used to derive a second encryption key and/or a second integrity protection key, or the first random number, the first key and the The second random number generated by the second terminal device is used to derive a second encryption key and/or a second integrity protection key.
  112. 一种终端设备,其特征在于,所述终端设备为中继设备,所述终端设备包括:A terminal device, characterized in that the terminal device is a relay device, and the terminal device includes:
    通信单元,用于接收第一终端设备发送的直接通信请求;其中,所述直接通信请求包括以下至少之一:所述第一终端设备的安全能力信息,所述第一终端设备的安全策略信息,所述第一终端设备生成的第一临时公钥,所述第一终端设备生成的第一随机数;其中,所述直接通信请求通过第一加密密钥进行加密,以及所述直接通信请求通过第一完整性保护密钥进行完整性保护,所述第一加密密钥为基于已注册并被授权使用终端至终端中继UE-to-UE relay通信的终端的对称密钥衍生的加密密钥,所述第一完整性保护密钥为基于已注册并被授权使用UE-to-UE relay通信的终端的对称密钥衍生的完整性保护密钥;A communication unit configured to receive a direct communication request sent by a first terminal device; wherein the direct communication request includes at least one of the following: security capability information of the first terminal device, security policy information of the first terminal device , the first temporary public key generated by the first terminal device, the first random number generated by the first terminal device; wherein the direct communication request is encrypted by a first encryption key, and the direct communication request Integrity protection is performed by a first integrity protection key, which is an encryption key derived based on the symmetric key of a terminal that is registered and authorized to use terminal-to-terminal relay UE-to-UE relay communications. key, the first integrity protection key is an integrity protection key derived based on the symmetric key of a terminal that has been registered and authorized to use UE-to-UE relay communication;
    处理单元,用于验证是否被配置为转发直接通信请求,在验证通过之后所述处理单元还用于使用所述第一加密密钥解密所述直接通信请求以获取服务质量QoS和计费信息,以及所述处理单元还用于使用所述第一完整性保护密钥验证所述直接通信请求的完整性,在验证通过之后所述处理单元还用于在所述直接通信请求中添加所述中继设备的相关信息和所述中继设备的标识,并且所述处理单元还用于使用所述第一加密密钥加密所述直接通信请求,使用所述第一完整性保护密钥保护所述直接通信请求的完整性,所述通信单元还用于并将所述直接通信请求转发至第二终端设备;A processing unit configured to verify whether it is configured to forward the direct communication request. After the verification is passed, the processing unit is also configured to use the first encryption key to decrypt the direct communication request to obtain quality of service QoS and charging information, And the processing unit is further configured to use the first integrity protection key to verify the integrity of the direct communication request, and after the verification is passed, the processing unit is further configured to add the middle value to the direct communication request. The relevant information of the relay device and the identification of the relay device, and the processing unit is also configured to use the first encryption key to encrypt the direct communication request, and use the first integrity protection key to protect the Integrity of the direct communication request, the communication unit is also configured to forward the direct communication request to the second terminal device;
    其中,所述中继设备的相关信息包括以下之一:所述中继设备的身份信息,所述中继设备生成的随机数,所述中继设备生成的计数器;所述第一临时公钥和所述中继设备的相关信息用于第二终端设备派生第一密钥;所述第一随机数、所述第一密钥和所述第二终端设备生成的第二随机数用于派生第二密钥,且所述第二密钥用于派生第二加密密钥和/或第二完整性保护密钥,或者,所述第一随机数、所述第一密钥和所述第二终端设备生成的第二随机数用于派生第二加密密钥和/或第二完整性保护密钥。Wherein, the relevant information of the relay device includes one of the following: the identity information of the relay device, the random number generated by the relay device, the counter generated by the relay device; the first temporary public key The information related to the relay device is used by the second terminal device to derive the first key; the first random number, the first key and the second random number generated by the second terminal device are used to derive the first key. a second key, and the second key is used to derive a second encryption key and/or a second integrity protection key, or the first random number, the first key and the second The second random number generated by the second terminal device is used to derive the second encryption key and/or the second integrity protection key.
  113. 一种终端设备,其特征在于,包括:处理器和存储器,所述存储器用于存储计算机程序,所述处理器用于调用并运行所述存储器中存储的计算机程序,使得所述终端设备执行如权利要求1至14中任一项所述的方法,或者,使得所述终端设备执行如权利要求15至27中任一项所述的方法, 或者,使得所述终端设备执行如权利要求28至37中任一项所述的方法,或者,使得所述终端设备执行如权利要求38至51中任一项所述的方法,或者,使得所述终端设备执行如权利要求52至64中任一项所述的方法,或者,使得所述终端设备执行如权利要求65至74中任一项所述的方法,或者,使得所述终端设备执行如权利要求75至84中任一项所述的方法,或者,使得所述终端设备执行如权利要求85至96中任一项所述的方法,或者,使得所述终端设备执行如权利要求97至103中任一项所述的方法。A terminal device, characterized in that it includes: a processor and a memory, the memory is used to store a computer program, the processor is used to call and run the computer program stored in the memory, so that the terminal device executes the steps as claimed in the right The method according to any one of claims 1 to 14, or causing the terminal device to perform the method according to any one of claims 15 to 27, or causing the terminal device to perform the method according to claims 28 to 37 The method according to any one of claims 38 to 51, or causing the terminal device to perform the method according to any one of claims 38 to 51, or causing the terminal device to perform the method according to any one of claims 52 to 64. The method, or causing the terminal device to perform the method as described in any one of claims 65 to 74, or causing the terminal device to perform the method as described in any one of claims 75 to 84 , or causing the terminal device to perform the method as described in any one of claims 85 to 96, or causing the terminal device to perform the method as described in any one of claims 97 to 103.
  114. 一种芯片,其特征在于,包括:处理器,用于从存储器中调用并运行计算机程序,使得安装有所述芯片的设备执行如权利要求1至14中任一项所述的方法,或者,执行如权利要求15至27中任一项所述的方法,或者,执行如权利要求28至37中任一项所述的方法,或者,执行如权利要求38至51中任一项所述的方法,或者,执行如权利要求52至64中任一项所述的方法,或者,执行如权利要求65至74中任一项所述的方法,或者,执行如权利要求75至84中任一项所述的方法,或者,执行如权利要求85至96中任一项所述的方法,或者,执行如权利要求97至103中任一项所述的方法。A chip, characterized in that it includes: a processor for calling and running a computer program from a memory, so that the device equipped with the chip executes the method according to any one of claims 1 to 14, or, Perform the method as described in any one of claims 15 to 27, or perform the method as described in any one of claims 28 to 37, or perform the method as described in any one of claims 38 to 51 Method, or perform the method according to any one of claims 52 to 64, or perform the method according to any one of claims 65 to 74, or perform the method according to any one of claims 75 to 84 The method described in the item, or the method described in any one of claims 85 to 96 is performed, or the method described in any one of claims 97 to 103 is performed.
  115. 一种计算机可读存储介质,其特征在于,用于存储计算机程序,所述计算机程序使得计算机执行如权利要求1至14中任一项所述的方法,或者,执行如权利要求15至27中任一项所述的方法,或者,执行如权利要求28至37中任一项所述的方法,或者,执行如权利要求38至51中任一项所述的方法,或者,执行如权利要求52至64中任一项所述的方法,或者,执行如权利要求65至74中任一项所述的方法,或者,执行如权利要求75至84中任一项所述的方法,或者,执行如权利要求85至96中任一项所述的方法,或者,执行如权利要求97至103中任一项所述的方法。A computer-readable storage medium, characterized in that it is used to store a computer program, the computer program causing the computer to perform the method as described in any one of claims 1 to 14, or to perform the method as described in any one of claims 15 to 27 The method according to any one of claims 28 to 37, or the method according to any one of claims 38 to 51, or the method according to any one of claims 38 to 51. The method of any one of claims 52 to 64, or performing the method of any one of claims 65 to 74, or performing the method of any one of claims 75 to 84, or, Perform a method as claimed in any one of claims 85 to 96, or perform a method as described in any one of claims 97 to 103.
  116. 一种计算机程序产品,其特征在于,包括计算机程序指令,该计算机程序指令使得计算机执行如权利要求1至14中任一项所述的方法,或者,执行如权利要求15至27中任一项所述的方法,或者,执行如权利要求28至37中任一项所述的方法,或者,执行如权利要求38至51中任一项所述的方法,或者,执行如权利要求52至64中任一项所述的方法,或者,执行如权利要求65至74中任一项所述的方法,或者,执行如权利要求75至84中任一项所述的方法,或者,执行如权利要求85至96中任一项所述的方法,或者,执行如权利要求97至103中任一项所述的方法。A computer program product, characterized by comprising computer program instructions, the computer program instructions causing the computer to perform the method according to any one of claims 1 to 14, or to perform the method according to any one of claims 15 to 27 The method, or performs the method as described in any one of claims 28 to 37, or performs the method as described in any one of claims 38 to 51, or performs as claimed in claims 52 to 64 The method according to any one of claims 65 to 74, or the method according to any one of claims 75 to 84, or the method according to any one of claims 75 to 84. The method of any one of claims 85 to 96, or performing the method of any one of claims 97 to 103.
  117. 一种计算机程序,其特征在于,所述计算机程序使得计算机执行如权利要求1至14中任一项所述的方法,或者,执行如权利要求15至27中任一项所述的方法,或者,执行如权利要求28至37中任一项所述的方法,或者,执行如权利要求38至51中任一项所述的方法,或者,执行如权利要求52至64中任一项所述的方法,或者,执行如权利要求65至74中任一项所述的方法,或者,执行如权利要求75至84中任一项所述的方法,或者,执行如权利要求85至96中任一项所述的方法,或者,执行如权利要求97至103中任一项所述的方法。A computer program, characterized in that the computer program causes the computer to perform the method as described in any one of claims 1 to 14, or to perform the method as described in any one of claims 15 to 27, or , perform the method as described in any one of claims 28 to 37, or perform the method as described in any one of claims 38 to 51, or perform the method as described in any one of claims 52 to 64 The method, or perform the method as described in any one of claims 65 to 74, or perform the method as described in any one of claims 75 to 84, or perform the method as described in any one of claims 85 to 96 The method according to one of the claims 97 to 103, or performing the method according to any one of claims 97 to 103.
PCT/CN2022/091125 2022-05-06 2022-05-06 Relay communication method, and device WO2023212903A1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
PCT/CN2022/091125 WO2023212903A1 (en) 2022-05-06 2022-05-06 Relay communication method, and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2022/091125 WO2023212903A1 (en) 2022-05-06 2022-05-06 Relay communication method, and device

Publications (1)

Publication Number Publication Date
WO2023212903A1 true WO2023212903A1 (en) 2023-11-09

Family

ID=88646117

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/091125 WO2023212903A1 (en) 2022-05-06 2022-05-06 Relay communication method, and device

Country Status (1)

Country Link
WO (1) WO2023212903A1 (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160269185A1 (en) * 2015-03-13 2016-09-15 Intel IP Corporation Systems, methods, and devices for secure device-to-device discovery and communication
CN110192381A (en) * 2017-09-15 2019-08-30 华为技术有限公司 The transmission method and equipment of key
US20220109996A1 (en) * 2020-10-01 2022-04-07 Qualcomm Incorporated Secure communication link establishment for a ue-to-ue relay
WO2022079572A1 (en) * 2020-10-12 2022-04-21 Telefonaktiebolaget Lm Ericsson (Publ) Relay ue and remote ue authorization

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160269185A1 (en) * 2015-03-13 2016-09-15 Intel IP Corporation Systems, methods, and devices for secure device-to-device discovery and communication
CN110192381A (en) * 2017-09-15 2019-08-30 华为技术有限公司 The transmission method and equipment of key
US20220109996A1 (en) * 2020-10-01 2022-04-07 Qualcomm Incorporated Secure communication link establishment for a ue-to-ue relay
WO2022079572A1 (en) * 2020-10-12 2022-04-21 Telefonaktiebolaget Lm Ericsson (Publ) Relay ue and remote ue authorization

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
"3rd Generation Partnership Project; Technical Specification Group Services and System Aspects; Study on Security issues to support Proximity Services (ProSe) (Release 13)", 3GPP DRAFT; S3-152079_TR33.833V1_5_0_CL, 3RD GENERATION PARTNERSHIP PROJECT (3GPP), MOBILE COMPETENCE CENTRE ; 650, ROUTE DES LUCIOLES ; F-06921 SOPHIA-ANTIPOLIS CEDEX ; FRANCE, 28 August 2015 (2015-08-28), Mobile Competence Centre ; 650, route des Lucioles ; F-06921 Sophia-Antipolis Cedex ; France , XP051036037 *

Similar Documents

Publication Publication Date Title
US10631162B2 (en) Method and apparatus to perform device to device communication in wireless communication network
US8612752B2 (en) Communicating a packet from a mesh-enabled access point to a mesh portal in a multi-hop mesh network
AU2011201655B2 (en) Security Authentication and Key Management Within an Infrastructure-Based Wireless Multi-Hop Network
US9775028B2 (en) Method and related device for generating group key
US7817986B2 (en) Method and system for providing cellular assisted secure communications of a plurality of ad hoc devices
US8812833B2 (en) Wireless multiband security
EP2903322B1 (en) Security management method and apparatus for group communication in mobile communication system
KR102094216B1 (en) Security supporting method and system for proximity based service device to device discovery and communication in mobile telecommunication system environment
US20150127949A1 (en) System and method for integrated mesh authentication and association
JP2016518075A (en) Securing peer-to-peer and group communications
KR20230054421A (en) Privacy of Repeater Selection in Cellular Sliced Networks
JP2008547257A (en) Method and apparatus for securely transmitting data in an ad hoc network
Fang et al. Security requirement and standards for 4G and 5G wireless systems
US20240129746A1 (en) A method for operating a cellular network
WO2023283789A1 (en) Secure communication method and apparatus, terminal device, and network device
WO2022027476A1 (en) Key management method and communication apparatus
WO2023212903A1 (en) Relay communication method, and device
WO2023212904A1 (en) Relay communication method and device
WO2017009714A1 (en) Establishing a temporary subscription with isolated e-utran network
WO2024060149A1 (en) Key verification methods, key acquisition method, and devices
WO2023141914A1 (en) Information protection method and device
WO2023143022A1 (en) Method and apparatus for data processing in random access process
WO2023205978A1 (en) Key generation method and apparatus for proximity-based service, and device and storage medium
US20240146702A1 (en) Traffic management with asymmetric traffic encryption in 5g networks
EP4231751A1 (en) Wireless communication method, device, and system

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: 22940597

Country of ref document: EP

Kind code of ref document: A1