WO2021237724A1 - 密钥协商方法、装置和系统 - Google Patents

密钥协商方法、装置和系统 Download PDF

Info

Publication number
WO2021237724A1
WO2021237724A1 PCT/CN2020/093490 CN2020093490W WO2021237724A1 WO 2021237724 A1 WO2021237724 A1 WO 2021237724A1 CN 2020093490 W CN2020093490 W CN 2020093490W WO 2021237724 A1 WO2021237724 A1 WO 2021237724A1
Authority
WO
WIPO (PCT)
Prior art keywords
information
key agreement
algorithm
key
algorithms
Prior art date
Application number
PCT/CN2020/093490
Other languages
English (en)
French (fr)
Inventor
王勇
陈璟
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Priority to MX2022015025A priority Critical patent/MX2022015025A/es
Priority to CN202080101497.XA priority patent/CN115668858A/zh
Priority to EP20937745.6A priority patent/EP4149048A4/en
Priority to PCT/CN2020/093490 priority patent/WO2021237724A1/zh
Priority to CA3183089A priority patent/CA3183089A1/en
Priority to KR1020227045418A priority patent/KR20230016662A/ko
Priority to JP2022573316A priority patent/JP7534445B2/ja
Publication of WO2021237724A1 publication Critical patent/WO2021237724A1/zh
Priority to US18/070,241 priority patent/US20230087265A1/en
Priority to JP2024125889A priority patent/JP2024153865A/ja

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/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • H04L9/0861Generation of secret information including derivation or calculation of cryptographic keys or passwords
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W12/00Security arrangements; Authentication; Protecting privacy or anonymity
    • H04W12/04Key management, e.g. using generic bootstrapping architecture [GBA]
    • H04W12/041Key generation or derivation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/14Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols using a plurality of keys or algorithms
    • 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
    • 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/40Network security protocols
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W12/00Security arrangements; Authentication; Protecting privacy or anonymity
    • H04W12/06Authentication

Definitions

  • This application relates to the field of communication technology, and in particular to a key agreement method, device and system. Specifically, it can be applied to short-range communications, such as cockpit domain communications.
  • IKEv2 Internet Key Exchange Version 2, Internet Key Exchange Protocol Version 2
  • IPsec Internet Protocol Security
  • An IKEv2 negotiation process may be: the negotiation message sent by the sender device to the receiver device includes at least one key agreement algorithm supported by the sender device and the key of one of the key agreement algorithms corresponding to the sender device Negotiation parameters. After receiving the negotiation message, the receiver device selects a key agreement algorithm supported by the receiver device from the key agreement algorithms included in the negotiation message. If the negotiation message includes that the key agreement parameters of the sender device do not correspond to the key agreement algorithm selected by the receiver device, the receiver device sends a message including the key agreement algorithm supported by the receiver device to the sender device. Then the sender device resends the negotiation message according to the key agreement algorithm supported by the receiver device, which increases the number of message interactions between the sender device and the receiver device, resulting in low key negotiation efficiency.
  • the embodiments of the present application provide a key agreement method, device, and system to improve the efficiency of key agreement.
  • an embodiment of the present application provides a key agreement method, including:
  • Sending first information where the first information is used to indicate N types of key agreement algorithms, where N is an integer greater than or equal to 1, and the N types of key agreement algorithms are algorithms supported by the sender device;
  • the second information is used to indicate a target key agreement algorithm and includes a first key agreement parameter
  • the target key agreement algorithm is the N types of key agreement
  • the key agreement algorithm in the algorithm and supported by the receiver device.
  • the first key agreement parameter is a key agreement parameter corresponding to the receiver device and obtained based on the target key agreement algorithm, or in other words, the first key agreement parameter is the A key agreement parameter generated by the receiver device based on the target key agreement algorithm;
  • the method further includes:
  • Send third information to the recipient device the third information including a second key agreement parameter
  • the second key agreement parameter is corresponding to the sender device and obtained based on the target key agreement algorithm Key negotiation parameters.
  • the sending the third information to the receiver device includes:
  • the first information is also used to indicate priority information of the N types of key agreement algorithms
  • the first information includes identification information of the N key agreement algorithms, and the identification information is arranged or encapsulated according to the priority information of the N key agreement algorithms.
  • the second information is also used to indicate M types of key agreement algorithms supported by the receiver device, and M is an integer greater than or equal to 1.
  • the generating the target key according to the target key agreement algorithm and the first key agreement parameter includes:
  • the target key agreement algorithm is the highest priority key agreement algorithm supported by the receiver device among the N types of key agreement algorithms
  • the target key agreement algorithm is the key agreement algorithm with the highest priority supported by the receiver device among the N types of key agreement algorithms.
  • the method further includes:
  • the second information is also used to indicate priority information of M types of key agreement algorithms supported by the receiver device;
  • the second information includes identification information of the M types of key agreement algorithms, and the identification information is arranged or encapsulated according to the priority of the M types of key agreement algorithms.
  • the third information further includes first authentication data
  • the first authentication data is authentication data obtained by the sender device performing authentication processing on the second information.
  • the method further includes: sending first authentication data to the recipient device, where the first authentication data is the authentication obtained by the sender device performing authentication processing on the second information data.
  • the first authentication data may be indicated by third information, or may be indicated or carried by other information.
  • the method further includes:
  • the fourth information includes second authentication data
  • the second authentication data is data from the recipient device that is obtained by performing authentication processing on the third information.
  • the method includes:
  • the fourth information includes third authentication data
  • the third authentication data is from the receiver's device and is a reference to the N types of key agreement algorithms indicated in the first information and the third authentication data. Information obtained through authentication processing.
  • the fourth information is fourth information processed by an integrity protection algorithm.
  • the authentication processing further includes performing authentication processing according to a preset shared key.
  • the third information further indicates N types of key agreement algorithms supported by the sender device.
  • the sending the first information to the receiver device includes:
  • the method before sending the first information to the receiver device, the method further includes:
  • the sending the first information to the receiver device includes:
  • an embodiment of the present application provides a key agreement method, and the method includes:
  • Target key agreement algorithm is a key agreement algorithm among the N types of key agreement algorithms and supported by the recipient device
  • the first key agreement parameter is a key agreement corresponding to the receiver device and obtained based on the target key agreement algorithm Parameter, or in other words, the first key agreement parameter is a key agreement parameter generated by the receiver device based on the target key agreement algorithm;
  • the method further includes: receiving third information from the sender device, the third information indicating a second key agreement parameter, and the second key agreement parameter corresponds to the The key agreement parameter of the sender device obtained based on the target key agreement algorithm;
  • a target key is generated.
  • the third information is third information processed by an integrity protection algorithm.
  • the second information also indicates priority information of M types of key agreement algorithms supported by the receiver device
  • the second information includes identification information of the M types of key agreement algorithms, and the identification information is arranged or encapsulated according to the priority information of the M types of key agreement algorithms.
  • the first information is also used to indicate priority information of the N types of key agreement algorithms; wherein, the first information includes identification information of the N types of key agreement algorithms The identification information is arranged or encapsulated according to the priority information of the N types of key agreement algorithms.
  • the determining the target key agreement algorithm includes:
  • the target key agreement algorithm is the key agreement algorithm with the highest priority supported by the receiver device among the N types of key agreement algorithms.
  • the method further includes:
  • the first authentication data is authentication data obtained by the sender device performing authentication processing on the second information.
  • the third information further includes first authentication data, and the first authentication data is authentication data obtained by the sender device performing authentication processing on the second information.
  • the first authentication data may be indicated by third information, or may be indicated or carried by other information.
  • it also includes:
  • it also includes:
  • Send fourth information to the sender device where the fourth information includes third authentication data
  • the third authentication data is the receiving device's response to the N types of key agreement algorithms indicated in the first information and
  • the third information is authentication data obtained by performing authentication processing.
  • sending the fourth information to the sender device includes:
  • the authentication processing further includes performing authentication processing according to a preset key.
  • the third information further indicates N types of key agreement algorithms supported by the sender device.
  • the method before the receiving the first information from the sender device, the method further includes:
  • Send fifth information to the sender device where the fifth information is used to instruct the sender device to send the first information to the receiver device.
  • an embodiment of the present application provides a key agreement device, including:
  • At least one module, component or circuit used to implement the key agreement method of the first aspect or,
  • At least one module, component or circuit used to implement the key agreement method of the second aspect At least one module, component or circuit used to implement the key agreement method of the second aspect.
  • an embodiment of the present application provides a key agreement device, including: at least one processor and a memory; the at least one processor is used to run a computer program in the memory, so that the key agreement device executes the first aspect or In the second aspect, the key agreement method described in the embodiment of the present application.
  • an embodiment of the present application provides a key agreement device, where the key agreement device includes one or more processors and communication units.
  • the one or more processors are configured to support the communication device to execute the key agreement method described in the embodiment of the present application in the first aspect or the second aspect.
  • the communication unit is used to support the key agreement device to communicate with other devices to realize the receiving and/or sending functions.
  • the device may further include one or more memories, where the memory is used for coupling with the processor and stores necessary program instructions and/or data for the device.
  • the one or more memories may be integrated with the processor, or may be provided separately from the processor. This application is not limited.
  • the key agreement device may also be a chip.
  • the communication unit may be an input/output circuit or interface of a communication chip.
  • an embodiment of the present application provides a computer-readable storage medium for storing a computer program.
  • the computer program includes a method for executing the key agreement method described in the above-mentioned first aspect or the second aspect of the embodiment of the present application. instruction.
  • an embodiment of the present application provides a computer program product, the computer program product comprising: computer program code, when the computer program code runs on a computer, the computer executes the first aspect or the second aspect. Apply for the key agreement method described in any one of the embodiments.
  • an embodiment of the present application provides a key agreement system, including: a key agreement device used to execute the key agreement device described in the embodiment of the present application in the first aspect and a key agreement device used to execute the encryption described in the embodiment of the present application in the second aspect. Key agreement device.
  • an embodiment of the present application provides a terminal, which may be a vehicle or a smart device, including a drone, an unmanned vehicle, a car, or a robot, etc.
  • the vehicle or smart device includes the third aspect and/or The key agreement device described in the fourth aspect and/or the fifth aspect.
  • the embodiments of the present application provide a key agreement method, device, and system, wherein when the sender device and the receiver device perform key agreement, the sender device notifies the receiver of all key agreement algorithms supported by it through first information For the recipient device, the recipient device selects a key agreement algorithm supported by itself from the received key agreement algorithms supported by the sender device.
  • the key agreement algorithm selected by the recipient device is a key agreement algorithm supported by both the sender device and the recipient device, avoiding the key agreement algorithm negotiation caused by the key agreement algorithm selected by the recipient device that the sender device does not support Failure to improve the efficiency of key negotiation.
  • the key agreement method provided by the embodiment of the present application supports the national secret algorithm.
  • FIG. 1 is a schematic diagram of an application scenario provided by an embodiment of this application.
  • FIG. 2 is a schematic diagram of the hardware structure of a communication device applicable to an embodiment of the present application
  • Figure 3 is a flow chart of a key agreement method
  • FIG. 4 is a flowchart of a key agreement method provided by an embodiment of this application.
  • FIG. 5 is a flowchart of a key agreement method provided by another embodiment of this application.
  • FIG. 6 is a flowchart of a key agreement method provided by another embodiment of this application.
  • FIG. 7 is a flowchart of a key agreement method provided by another embodiment of this application.
  • FIG. 8 is a schematic structural diagram of a key agreement device provided by an embodiment of this application.
  • FIG. 9 is a schematic structural diagram of a key agreement device provided by another embodiment of this application.
  • FIG. 10 is a schematic structural diagram of a key agreement device provided by another embodiment of this application.
  • FIG. 11 is a schematic structural diagram of a key agreement system provided by an embodiment of this application.
  • FIG. 1 is a schematic diagram of an application scenario provided by an embodiment of this application.
  • the communication system shown in FIG. 1 mainly includes a sender device 11 and a receiver device 12.
  • the sender device 11 is the initiator of the communication
  • the receiver device 12 is the receiver of the communication.
  • the sender device 11 or the receiver device 12 included in the communication system shown in FIG. 1 may be any device with a transceiving function. Including but not limited to: evolution base station (NodeB or eNB or e-NodeB, evolutional NodeB) in the long term evolution (LTE) system of general mobile communication technology, and the new radio (NR) system Base station (gNodeB or gNB) or transceiver point (transmission receiving point/transmission reception point, TRP), the 3rd generation partnership project (the 3rd generation partnership project, 3GPP) subsequent evolution of the base station, wireless communication systems (such as WiFi, Bluetooth, etc.) ) In the access node, wireless relay node, wireless backhaul node, data transfer equipment (such as routers, repeaters, bridges or switches) and so on.
  • the base station can be: a macro base station, a micro base station, a pico base station, a small station, a relay station, or a balloon station, etc.
  • the sender device 11 or the receiver device 12 may also be a wireless controller in a cloud radio access network (CRAN) scenario, a centralized unit (CU), and/or a distributed unit (distributed unit). , DU).
  • CRAN cloud radio access network
  • CU centralized unit
  • DU distributed unit
  • the sender device 11 or the receiver device 12 may also be a server, a wearable device (such as a smart watch, a smart bracelet, a pedometer, etc.), a machine communication device, or a vehicle-mounted device, etc.
  • the sender device 11 or the receiver device 12 can also be a mobile phone, a tablet computer (Pad), a computer with wireless transceiver function, a headset, a stereo, a virtual reality (VR) terminal device, and an augmented reality (augmented) device.
  • Reality (AR) terminal equipment machine type communication (MTC) terminals, industrial control (industrial control) terminals, vehicle-mounted terminal equipment, autonomous driving (self-driving) terminals, and auxiliary driving terminals Terminal equipment, terminals in remote medical, terminals in smart grid, terminals in transportation safety, terminals in smart city, and smart home Terminal and so on.
  • MTC machine type communication
  • industrial control industrial control
  • vehicle-mounted terminal equipment autonomous driving (self-driving) terminals
  • auxiliary driving terminals Terminal equipment, terminals in remote medical, terminals in smart grid, terminals in transportation safety, terminals in smart city, and smart home Terminal and so on.
  • the sender device 11 or the receiver device 12 may also be a car cockpit (cockpit domain) device, or a module in a car cockpit device (cockpit domain controller (CDC), camera, screen, microphone, audio, electronic Modules such as key, keyless entry and start-up system controller).
  • a car cockpit (cockpit domain) device or a module in a car cockpit device (cockpit domain controller (CDC), camera, screen, microphone, audio, electronic Modules such as key, keyless entry and start-up system controller).
  • CDC cockpit domain controller
  • Terminals can sometimes be referred to as terminal equipment, user equipment (UE), access terminal equipment, vehicle-mounted terminal, industrial control terminal, UE unit, UE station, mobile station, mobile station, remote station, remote terminal equipment, mobile Equipment, UE terminal equipment, wireless communication equipment, machine terminal, UE agent or UE device, etc.
  • the terminal can be fixed or mobile.
  • the communication system 10 shown in FIG. 1 is only used as an example, and is not used to limit the technical solution of the present application. Those skilled in the art should understand that, in a specific implementation process, the communication system 10 may also include other devices, and the number of sender devices and receiver devices can also be determined according to specific needs, which is not limited.
  • each device in FIG. 1 of the embodiment of the present application may be a functional module in a device.
  • the functional module can be a component in a hardware device, for example, a chip or communication component in a terminal device or a network device, or a software functional module running on hardware, or a platform (for example, cloud Platform) instantiated virtualization functions.
  • each device in FIG. 1 may be implemented by the communication device 200 in FIG. 2, where the communication device 200 may be the device itself or a chip or integrated circuit inside the device.
  • Fig. 2 shows a schematic diagram of the hardware structure of a communication device applicable to the embodiments of the present application.
  • the communication device 200 may include at least one processor 201 and at least one communication interface 204.
  • the communication device 200 may also include at least one of a communication line 202 and a memory 203
  • the processor 201 can be a general-purpose central processing unit (central processing unit, CPU), a microprocessor, an application-specific integrated circuit (ASIC), or one or more programs for controlling the execution of the program of this application. integrated circuit.
  • CPU central processing unit
  • ASIC application-specific integrated circuit
  • the communication line 202 may include a path for transferring information between the above-mentioned components, such as a bus.
  • the communication interface 204 uses any device such as a transceiver to communicate with other devices or communication networks, such as an Ethernet interface, a radio access network (RAN), and a wireless local area network (wireless local area networks, WLAN) etc.
  • a transceiver to communicate with other devices or communication networks, such as an Ethernet interface, a radio access network (RAN), and a wireless local area network (wireless local area networks, WLAN) etc.
  • RAN radio access network
  • WLAN wireless local area network
  • the memory 203 may be a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, random access memory (RAM), or other types that can store information and instructions
  • the dynamic storage device can also be electrically erasable programmable read-only memory (EEPROM), compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (Including compact discs, laser discs, optical discs, digital versatile discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or can be used to carry or store desired program codes in the form of instructions or data structures and can be used by a computer Any other media accessed, but not limited to this.
  • the memory can exist independently and is connected to the processor through the communication line 202.
  • the memory can also be integrated with the processor.
  • the memory provided by the embodiments of the present application may generally be non-volatile.
  • the memory 203 is used to store and execute the computer-executable instructions involved in the solution of the present application, and the processor 201 controls the execution.
  • the processor 201 is configured to execute computer-executable instructions stored in the memory 203, so as to implement the method provided in the embodiment of the present application.
  • the computer-executable instructions in the embodiments of the present application may also be referred to as application program codes, which are not specifically limited in the embodiments of the present application.
  • the processor 201 may include one or more CPUs, such as CPU0 and CPU1 in FIG. 2.
  • the communication device 200 may include multiple processors, such as the processor 201 and the processor 207 in FIG. 2. Each of these processors can be a single-CPU (single-CPU) processor or a multi-core (multi-CPU) processor.
  • the processor here may refer to one or more devices, circuits, and/or processing cores for processing data (for example, computer program instructions).
  • the communication apparatus 200 may further include an output device 205 and an input device 206.
  • the output device 205 communicates with the processor 201 and can display information in a variety of ways.
  • the output device 205 may be a liquid crystal display (LCD), a light emitting diode (LED) display device, a cathode ray tube (CRT) display device, or a projector (projector) Wait.
  • the input device 206 communicates with the processor 201, and can receive user input in a variety of ways.
  • the input device 206 may be a mouse, a keyboard, a touch screen device, a sensor device, or the like.
  • the communication device 200 may be a desktop computer, a portable computer, a network server, a PDA (personal digital assistant, PDA), a mobile phone, a tablet computer, a wireless terminal device, an embedded device, or a device with a similar structure in Figure 2. equipment.
  • PDA personal digital assistant
  • the embodiment of the present application does not limit the type of the communication device 200.
  • the key agreement method includes:
  • the sender device sends a negotiation message to the receiver device.
  • the receiver device receives the negotiation message.
  • the negotiation message is used to indicate N types of key agreement algorithms, and includes the key agreement parameters of the sender device.
  • the key agreement parameters are key agreement obtained based on one of the key agreement algorithms supported by the sender device. parameter.
  • the sender device uses any key agreement algorithm it supports as the algorithm for generating the target key, and obtains key agreement parameters based on the selected key agreement algorithm, and when the sender device sends a negotiation message , Include the key agreement parameter in the negotiation message and send it to the receiver device. Therefore, the recipient device can not only determine all the key agreement algorithms supported by the sender device through the negotiation message, but also directly obtain the key agreement parameters of the sender device for the recipient device to generate the target key.
  • the receiver device determines the target key agreement algorithm, and generates key negotiation parameters of the receiver device according to the target negotiation algorithm.
  • the key agreement parameter of the receiver device is the key agreement parameter obtained based on the target key agreement algorithm.
  • the recipient device also selects any key agreement algorithm from all the key agreement algorithms supported by the sender device obtained according to the negotiation message as the algorithm for generating the target key, and negotiates based on the selected key
  • the algorithm obtains the key agreement parameters.
  • the receiver device selects the target key agreement algorithm, it does not consider the key agreement algorithm selected by the sender device.
  • the key agreement algorithms are independent of each other. Therefore, it is easy to cause a mismatch between the key agreement algorithm selected by the receiver device and the key agreement algorithm selected by the sender device. Therefore, the key agreement algorithm selected by the receiver device does not match the key agreement parameters of the sender device. .
  • the negotiation response message is used to indicate the target key agreement algorithm, and includes the key agreement parameters of the receiver device.
  • the receiver device generates a target key according to the key agreement parameter of the sender device and the target key agreement algorithm.
  • the sender device generates a target key according to the key agreement parameters of the receiver device and the target key agreement algorithm.
  • the process for the receiver device and the sender device to generate the target key is:
  • two nodes use the same prime number p and the same random number g (that is, the prime number p and the random number g are the public keys between the sender device and the receiver device) ), respectively generated random numbers a and b (that is, the random number a is the private key of the receiver's device, and the random number b is the private key of the sender's device), the above-mentioned prime numbers p, random numbers g, random numbers a and b are all It can be regarded as a parameter of the key agreement algorithm.
  • the receiver device and the sender device each select their own key agreement sending algorithm, it is easy to cause the key agreement algorithm selected by the receiver device to mismatch the key agreement parameters of the initiator device. , Causing the negotiation to fail.
  • the recipient device needs to send a message to the initiator device so that the initiator device resends the negotiation message, and repeats the above Action until the key agreement algorithm selected by the recipient device matches the key agreement parameter of the initiator device. In this way, the number of message interactions between the sender device and the receiver device increases, resulting in low key negotiation efficiency.
  • the embodiments of this application propose: the sender device notifies the receiver device of the key agreement algorithm it supports, and the receiver device selects the key agreement algorithm supported by both the receiver device and the sender device, and The selected key agreement algorithm and the key agreement parameters corresponding to the receiver device generated according to the key agreement algorithm are sent to the sender device, instead of the sender device and the receiver device each selecting the key agreement algorithm they support, This solves the problem that when the sender device and the receiver device each select the key agreement algorithm they support, the key agreement algorithm selected by both parties does not match, and the efficiency of key agreement is improved.
  • Fig. 4 is a flowchart of a key agreement method provided by an embodiment of the application. As shown in FIG. 4, the key agreement method in the embodiment of the present application includes:
  • the sender device sends first information to the receiver device.
  • the receiver device receives the first information.
  • the first information is used to indicate N types of key agreement algorithms, where N is an integer greater than or equal to 1, and the N types of key agreement algorithms are algorithms supported by the sender device.
  • the first information is carried in the negotiation message. Specifically, before the two devices in the communication system perform data transmission, they need to perform key agreement to obtain the target key, so as to encrypt and decrypt the transmitted data according to the target key. Wherein, when the sender device and the receiver device perform key negotiation, the initiator device sends a negotiation message to the receiver device.
  • the first information can indicate N key agreement algorithms in any of the following ways:
  • the first information includes the identifiers of the N key agreement algorithms supported by the initiator device, so that the receiver device can obtain the N key agreement algorithms supported by the initiator device.
  • the first information when the first information includes ID1, ID3, and ID5, the first information is used to indicate algorithm 1, algorithm 3, and algorithm 5; when the first information includes ID2 and When ID4, the first information is used to indicate algorithm 2 and algorithm 4.
  • Table 1 is only an example of the key agreement algorithm identification indicated by the first information.
  • the key agreement algorithm indicated by the first information may also be in other forms and is not limited.
  • the first information includes a bit sequence, one bit in the bit sequence corresponds to an algorithm, and each bit in the bit sequence can indicate whether the first information indicates the algorithm corresponding to the bit through 0 or 1. For example, if the bit is 1, it may indicate that the first information indicates the algorithm corresponding to the bit, and if the bit is 0, it may indicate that the first information does not indicate the algorithm corresponding to the bit, and vice versa.
  • the first information includes 5 bits, the first bit of the 5 bits corresponds to algorithm 1, the second bit corresponds to algorithm 2, the third bit corresponds to algorithm 3, and the fourth bit corresponds to algorithm 4 corresponds to, the fifth bit corresponds to algorithm 5 as an example, if the 5 bit is 01010, it can indicate that the first information is used to indicate algorithm 2 and algorithm 4; if the 5 bit is 11001, it can indicate that the first information is used to indicate Algorithm 1, Algorithm 2, and Algorithm 5.
  • the first information is also used to indicate priority information of the N key agreement algorithms; wherein the identification information of the N key agreement algorithms included in the first information is the priority information according to the N key agreement algorithms Arranged or packaged.
  • the priorities of the N key agreement algorithms indicated by the first information are arranged from high to low, or the priorities of the N key agreement algorithms indicated by the first information are arranged from low to high.
  • the first information is used to indicate algorithm 1, algorithm 2, algorithm 3, algorithm 4, and algorithm 5.
  • the priority of algorithm 4 is higher than that of algorithm 2
  • the priority of algorithm 2 is higher than that of algorithm 5.
  • Algorithm 5 has a higher priority than Algorithm 1
  • Algorithm 1 has a higher priority than Algorithm 3.
  • Algorithm priority algorithm Algorithm ID Priority 1 Algorithm 4 ID4 Priority 2 Algorithm 2 ID2 Priority 3 Algorithm 5 ID5 Priority 4 Algorithm 1 ID1 Priority 5 Algorithm 3 ID3
  • the sender device sends a negotiation message to the receiver device in a broadcast manner, so that no additional message interaction is required, and the key negotiation efficiency is improved.
  • the negotiation message by sending the negotiation message to the receiver device in a broadcast manner, multiple receiver devices can receive the negotiation message, which further reduces message interaction.
  • the third-party device since the first information may be intercepted by a third-party device during the sending process, the third-party device tampered with the first information, and sent the tampered first information to the receiver device. Therefore, there may be a difference between the key agreement algorithm supported by the sender device indicated in the first information received by the receiver device and the key agreement algorithm supported by the sender device indicated in the first information sent by the sender device. Therefore, the key agreement algorithm supported by the sender device indicated by the first information received by the recipient device is K key agreement algorithms, where K is an integer greater than or equal to 0.
  • the K key agreement algorithms supported by the sender device indicated by the first information received by the receiver device and the N key agreement algorithms supported by the sender device indicated in the first information sent by the sender device The relationship includes at least:
  • K is equal to N, and the K key agreement algorithms supported by the sender device indicated in the first information received by the receiver device and N supported by the sender device indicated in the first information sent by the sender device One-to-one correspondence between a variety of key agreement algorithms;
  • K is equal to N, but the K key agreement algorithms supported by the sender device indicated by the first information received by the receiver device and the sender device supported by the sender device indicated in the first information sent by the sender device N types of key agreement algorithms are not one-to-one correspondence;
  • the third relationship: K is not equal to N.
  • K types of key agreement algorithms and N types of key agreement algorithms is the first type of relationship, it means that the N types of key agreement algorithms indicated in the first message sent by the sender device have not been tampered with; if K The relationship between the two key agreement algorithms and the N key agreement algorithms is the second relationship or the third relationship, indicating that the first information sent by the sender device has been tampered with.
  • the key agreement algorithm shown in this application further includes: receiving fifth information from the receiver device, where the fifth information is used to instruct the sender device to send the first information; correspondingly, one of S401
  • One possible implementation manner is: unicast sending the first information to the receiver device.
  • the receiver device needs to communicate with the sender device, it can first send information to the sender device, that is, the fifth information.
  • the fifth information is used to instruct the sender device to send the first information to the receiver device.
  • the party device sends the first information to the receiver device.
  • the sender device sends the first information in a unicast manner.
  • the fifth information carries an indication identifier.
  • the indication identifier may be negotiated in advance by the sender device and the receiver device, for example, when the receiver device needs to instruct the sender device to send the first information to the receiver device,
  • the fifth information includes the pre-negotiated indication identifier, and after receiving the fifth information including the indication identifier, the sender device sends the first information to the receiver device.
  • the fifth information includes an empty target key agreement algorithm, for example, the identifier used to indicate the bit of the key agreement calculation is "null", when the receiver device needs to instruct the sender device to send the receiver device to the receiver device.
  • the fifth information includes an empty target key negotiation algorithm, and the sender device sends the first information to the receiver device after receiving the fifth information including the empty target key negotiation algorithm.
  • the receiver device determines a target key agreement algorithm.
  • the target key agreement algorithm is a key agreement algorithm that is supported by the receiver device among the N types of key agreement algorithms.
  • the receiver device determines the key agreement algorithm it supports from the N types of key agreement algorithms in the first information as the target agreement algorithm.
  • the recipient device determines the highest priority key agreement supported by the recipient device from the N key agreement algorithms according to the priority information of the N key agreement algorithms indicated in the received first information Algorithm, which is used as the target negotiation algorithm. It should be noted that the highest priority here is determined according to the priority order of the sender device for the key agreement algorithm.
  • Table 3 shows all the key agreement algorithms supported by the receiver device.
  • the first information received by the receiver device indicates the five key agreement algorithms shown in Table 1.
  • the identifiers of the five algorithms are arranged in order of priority from high to low.
  • the receiver device supports Algorithm 2, Algorithm 3, and Algorithm 5, and the priority of Algorithm 2 is higher than Algorithm 3 and Algorithm 5. Therefore, the receiver Party equipment selection algorithm 2 is the target negotiation algorithm.
  • the receiver device determines the key that it supports and has the highest priority for itself from the N key agreement algorithms indicated in the received first information Negotiation algorithm, as the target negotiation algorithm. That is, among the N types of key agreement algorithms, for the key agreement algorithms supported by both the receiver device and the sender device, the target key agreement algorithm is determined according to the priority order of the key agreement algorithm by the receiver device.
  • Table 4 shows priority information of the key agreement algorithm supported by the receiver device.
  • the first information received by the receiver device indicates the five key agreement algorithms shown in Table 1.
  • the receiver device supports Algorithm 2, Algorithm 3, and Algorithm 5.
  • the priority of algorithm 3 is higher than that of algorithm 2
  • the priority of algorithm 2 is higher than that of algorithm 5.
  • the receiver device selects algorithm 3 as the target negotiation algorithm.
  • the N types of key agreement algorithms supported by the sender device indicated in the first information may not be arranged according to priority, that is, the first information does not indicate the N types of keys supported by the sender device.
  • Priority information of the negotiation algorithm may be arranged according to priority, that is, the first information does not indicate the N types of keys supported by the sender device.
  • Algorithm priority algorithm Algorithm ID Priority 1 Algorithm 3 ID3 Priority 2 Algorithm 6 ID6 Priority 3 Algorithm 2 ID2 Priority 4 Algorithm 5 ID5
  • the receiver device generates a first key agreement parameter according to the target key agreement algorithm.
  • the first key agreement parameter is a key agreement parameter corresponding to the receiver device and obtained based on the target key agreement algorithm.
  • the recipient device uses S304 to generate a private key.
  • the private key is only known by the recipient device.
  • the public key corresponding to the recipient device is generated through the selected key agreement algorithm, and the public key is used as the first public key.
  • a key agreement parameter namely the key agreement parameter KE1.
  • this application does not limit the method of obtaining the first key agreement parameter.
  • S404 The receiver device sends the second information to the sender device.
  • the sender device receives the second information from the receiver device.
  • the second information indicates the target key agreement algorithm and includes the first key agreement parameter.
  • the second information also carries a first random number, where the first random number NONCE1 is a random number generated by the receiver device.
  • the sender device generates a target key according to the target key agreement algorithm and the first key agreement parameter.
  • the sender device since the identification of the target key agreement algorithm is carried in the second information, the sender device uses the identification of the target key agreement algorithm to determine the key agreement algorithm selected by the recipient device.
  • the sender device uses the method of S305, for example. , Generate a private key that only the sender device knows, and then calculate the public key corresponding to the sender device according to the first target key agreement algorithm, and use the public key as the second key agreement parameter, denoted as KE2. Then according to the target key agreement algorithm and the key agreement parameter KE1, the target key KE is generated.
  • the sender device determines whether the target key agreement algorithm is one of the N key agreement algorithms indicated by the first information, and if so, according to The target key agreement algorithm obtains the target key and/or key agreement parameter KE2; if not, the sender device discards the second information.
  • the sender device obtains the encryption key and the integrity protection key according to the target key KE.
  • the encryption key is used to encrypt the information transmitted between the sender's device and the receiver's device.
  • the integrity protection key is used to protect the integrity of the information transmitted between the sender's device and the receiver's device.
  • one way of the sender's device encryption key and integrity protection key is:
  • KDF key derivation function
  • KDF1, KDF2, and KDF3 can be the same or different.
  • this application does not limit the KDF used to obtain the shared key Kgt, the KDF used to obtain the encryption key Kenc, and the KDF used to obtain the integrity protection key Kint.
  • Kenc KDF2 (Kgt, ID1)
  • Kint KDF3 (Kgt, ID2)
  • ID1 is the identifier of the encryption algorithm
  • ID2 is the identifier of the integrity protection algorithm
  • the method further includes S406.
  • the sender device sends third information to the receiver device.
  • the receiver device receives the third information from the sender device.
  • the third information includes a second key agreement parameter, and the second key agreement parameter is a key agreement parameter corresponding to the sender device and based on the target key agreement algorithm.
  • the third information carries the second random number NONCE2.
  • the second information sent by the receiver device to the sender device Since the second information sent by the receiver device to the sender device is not secured, the second information may be tampered with during the sending process. If the second information is tampered with, it will cause the sender device and the receiver device to be tampered with. The key negotiation fails, therefore, it is necessary to verify whether the second information has been tampered with.
  • the method of verifying whether the second information has been tampered with may be, for example:
  • the sender device performs authentication processing on the second information, uses the second information as a parameter to generate first authentication data AUTH1, and sends the first authentication data AUTH1 to the receiver device, so that the receiver device verifies whether the second information Has been tampered with.
  • the third information includes the first authentication data AUTH1.
  • the ways to obtain AUTH1 include:
  • the preset shared key PSK is a key shared in advance between the sender's device and the receiver's device to verify the identity of both parties based on the preset shared key PSK to avoid communication between the sender's device and the receiver's device. Information has been tampered with. It should be noted that the embodiment of the present application does not limit the manner in which the preset shared key PSK is preset. For example, it may be obtained by separately inputting the same number into the sender's device and the receiver's device in advance, or obtained by using the same deduction algorithm after obtaining the target key KE.
  • the receiver device after receiving the third information, obtains the authentication data AUTH1, and matches the authentication data AUTH1 with the first reference authentication data.
  • the receiver device can determine whether the second information received by the sender device is consistent with the second information sent by the receiver device. If the authentication data AUTH1 matches the reference authentication data, it means that the second information has not been tampered with; otherwise, the receiver device discards the third information, disconnects the connection with the sender device this time, and then can resend the second information.
  • the receiver device can determine whether the second information received by the sender device is consistent with the second information sent by the receiver device.
  • the receiver device discards the third information, disconnects the connection with the sender device this time, and then can resend the second information Two information.
  • the embodiment of the application does not limit the acquisition of AUTH1 and the KDF of the first reference authentication data.
  • the KDF of AUTH1 is the same as the KDF of the first reference authentication data
  • the parameters of AUTH1 and the parameters of the first reference authentication data are obtained.
  • One-to-one correspondence is sufficient.
  • AUTH1 is obtained through KDF4, the second information received by the sender's device, and the preset shared key PSK.
  • KDF4 the receiver's device obtains the second information according to the sent second information and the preset shared key PSK. 1. Refer to the authentication data.
  • the third information is information processed through an integrity protection algorithm.
  • the sender device before performing S406, after the sender device obtains the encryption key Kenc and the integrity protection key Kint, according to the integrity protection algorithm, the integrity protection key Kint, and part of the third information sent by the sender device Or all the information obtains a first message authentication code (message authentication code, MAC), and the integrity of the third information is protected through the first MAC.
  • the third information includes the first MAC.
  • the receiver device generates the target key according to the second key agreement parameter and the target key agreement algorithm.
  • the receiver device after receiving the key agreement parameter KE2 of the sender device, the receiver device obtains the target key KE according to the key agreement algorithm and the received key agreement parameter KE2.
  • the receiver device uses the same method as the sender device to obtain the encryption key Kenc and the integrity protection key Kint according to the target key KE.
  • the second MAC is obtained according to the integrity protection algorithm, the integrity protection key Kint, and some or all of the third information received by the receiver device. If the first MAC and the second MAC are consistent, the third information has not been tampered with; otherwise, the receiver device discards the third information, disconnects the connection with the sender device this time, and then can resend the second information.
  • the method further includes S408.
  • the receiver device sends fourth information to the sender device.
  • the sender device receives the fourth information.
  • the fourth information is used by the sender device to determine whether the key negotiation is successful.
  • the fourth information is information encrypted by the encryption key Kenc.
  • the receiver device uses the encryption key Kenc to encrypt the fourth information.
  • the sender device uses the encryption key Kenc to decrypt the encrypted fourth information to obtain the fourth information.
  • the fourth information further includes third authentication data.
  • the ways to obtain the third authentication data AUTH3 include:
  • the fourth information is information processed through an integrity protection algorithm.
  • the receiver device obtains the third message authentication code MAC according to the integrity protection algorithm, the integrity protection key Kint, and some or all of the fourth information sent by the receiver device, and completes the fourth information through the third MAC Sexual protection.
  • the fourth information includes the third MAC.
  • the method further includes S409.
  • the sender device verifies the fourth information.
  • the sender device obtains the fourth message authentication code MAC according to the integrity protection algorithm, the integrity protection key Kint, and some or all of the fourth information received by the sender device.
  • the MAC is consistent, indicating that the fourth information has not been tampered with, and subsequent operations are performed; otherwise, the receiver device discards the fourth information.
  • the embodiment of the present application does not limit the specific operation content of the subsequent operation.
  • the fourth information includes authentication data AUTH3, and correspondingly, the sender device obtains the authentication data AUTH3, and matches the authentication data AUT3 with the third reference authentication data.
  • the KDF and parameters of obtaining the third reference authentication data correspond to the way of obtaining AUTH3.
  • the authentication The data AUTH3 matches the third reference authentication data; if the first information and/or the third information are tampered with during the sending process, the authentication data AUTH3 does not match the third reference authentication data. Therefore, according to the matching result of the authentication data AUTH3 and the third reference authentication data, the sender device can determine whether the first information received by the receiver device is consistent with the first information sent by the sender device, and whether the first information received by the receiver device is consistent with the first information sent by the sender device.
  • the third information is consistent with the third information sent by the sender device. If the authentication data AUTH3 matches the reference authentication data, it means that neither the first information nor the third information has been tampered with, and the key negotiation between the sender device and the receiver device is successful; otherwise, the fourth information is discarded, and the disconnection and reception The connection of the party device.
  • the authentication The data AUTH3 matches the third reference authentication data; if the first information and/or the third information are tampered with during the sending process, the authentication data AUTH3 does not match the third reference authentication data. Therefore, according to the matching result of the authentication data AUTH3 and the third reference authentication data, the sender device can determine whether the first information received by the receiver device is consistent with the first information sent by the sender device, and whether the first information received by the receiver device is consistent with the first information sent by the sender device.
  • the third information is consistent with the third information sent by the sender device. If the authentication data AUTH3 matches the reference authentication data, it means that neither the first information nor the third information has been tampered with, and the key negotiation between the sender device and the receiver device is successful; otherwise, the fourth information is discarded, and the disconnection and reception The connection of the party device.
  • the embodiment of this application does not limit the acquisition of AUTH3 and the KDF of the third reference authentication data, as long as the KDF of AUTH3 is the same as the KDF of the third reference authentication data, the parameters of AUTH3 and the parameters of the third reference authentication data are obtained. One-to-one correspondence is sufficient.
  • the sender device obtains the third reference authentication data according to the N types of key agreement algorithms indicated in the sent first information, the sent third information, the preset shared key PSK, and the random number NONCE1.
  • the sender device when the sender device and the receiver device perform key agreement, the sender device notifies the receiver device of all the key agreement algorithms it supports through the first information, and the receiver device receives the information from the sender device. Select the key agreement algorithm supported by itself from the supported key agreement algorithms.
  • the key agreement algorithm selected by the recipient device is a key agreement algorithm supported by both the sender device and the recipient device, avoiding the key agreement algorithm negotiation caused by the key agreement algorithm selected by the recipient device that the sender device does not support Failure to improve the efficiency of key negotiation.
  • the key agreement method provided by the embodiment of the present application supports the national secret algorithm.
  • Fig. 5 is a flowchart of a key agreement method provided by another embodiment of the application. As shown in FIG. 5, the key agreement method in the embodiment of the present application includes:
  • the sender device sends first information to the receiver device.
  • the receiver device receives the first information.
  • the first information is used to indicate N types of key agreement algorithms, where N is an integer greater than or equal to 1, and the N types of key agreement algorithms are algorithms supported by the sender device.
  • the first information is carried in the negotiation message. Specifically, before the two devices in the communication system perform data transmission, they need to perform key agreement to obtain the target key, so as to encrypt and decrypt the transmitted data according to the target key. Wherein, when the sender device and the receiver device perform key negotiation, the initiator device sends a negotiation message to the receiver device.
  • the first information is also used to indicate priority information of the N key agreement algorithms; wherein the identification information of the N key agreement algorithms included in the first information is the priority information according to the N key agreement algorithms Arranged or packaged.
  • the priorities of the N key agreement algorithms indicated by the first information are arranged from high to low, or the priorities of the N key agreement algorithms indicated by the first information are arranged from low to high.
  • the first information is used to indicate algorithm 1, algorithm 2, algorithm 3, algorithm 4, and algorithm 5.
  • the priority of algorithm 4 is higher than that of algorithm 2
  • the priority of algorithm 2 is higher than that of algorithm 5.
  • Algorithm 5 has a higher priority than Algorithm 1
  • Algorithm 1 has a higher priority than Algorithm 3.
  • the receiver device determines a target key agreement algorithm.
  • the target key agreement algorithm is a key agreement algorithm that is supported by the receiver device among the N types of key agreement algorithms.
  • the receiver device determines the key agreement algorithm it supports from the N types of key agreement algorithms in the first information as the target agreement algorithm.
  • the recipient device selects from the N key agreement algorithms that the recipient device supports and is for the sender device
  • the key agreement algorithm with the highest priority is used as the target agreement algorithm.
  • Table 3 shows all the key agreement algorithms supported by the receiver device.
  • the first information received by the receiver device indicates the five key agreement algorithms shown in Table 1.
  • the identifiers of the five algorithms are arranged in order of priority from high to low.
  • the receiver device supports Algorithm 2, Algorithm 3, and Algorithm 5, and the priority of Algorithm 2 is higher than Algorithm 3 and Algorithm 5. Therefore, the receiver Party equipment selection algorithm 2 is the target negotiation algorithm.
  • the receiver device determines the key that it supports and has the highest priority for itself from the N key agreement algorithms indicated in the received first information Negotiation algorithm, as the target negotiation algorithm.
  • Table 4 shows priority information of the key agreement algorithm supported by the receiver device.
  • the first information received by the receiver device indicates the five key agreement algorithms shown in Table 1.
  • the receiver device supports Algorithm 2, Algorithm 3, and Algorithm 5.
  • the priority of algorithm 3 is higher than that of algorithm 2
  • the priority of algorithm 2 is higher than that of algorithm 5.
  • the receiver device selects algorithm 3 as the target negotiation algorithm.
  • the N types of key agreement algorithms supported by the sender device indicated in the first information may not be arranged according to the photo priority information, that is, the first information does not indicate the N types of key agreement algorithms supported by the sender device. Priority information of the key agreement algorithm.
  • the receiver device generates a first key agreement parameter according to the target key agreement algorithm.
  • the first key agreement parameter is a key agreement parameter corresponding to the receiver device and obtained based on the target key agreement algorithm.
  • the receiver device calculates the key agreement parameter KE1 through the selected key agreement algorithm.
  • S504 The receiver device sends the second information to the sender device.
  • the sender device receives the second information from the receiver device.
  • the second information indicates the target key agreement algorithm and includes the first key agreement parameter. Further optionally, the second information further indicates M types of key agreement algorithms supported by the receiver device.
  • the second information also indicates M types of key agreement algorithms supported by the receiver device, so that the sender device determines whether the key agreement algorithm selected by the receiver device is supported by both the receiver device and the sender device.
  • Key agreement algorithm When it is determined that the key agreement algorithm selected by the recipient device is a key agreement algorithm supported by both the recipient device and the sender device, S505 is executed; otherwise, the second information is discarded, and the connection with the recipient device is disconnected.
  • the second information can indicate M types of key agreement algorithms in any of the following ways:
  • the second information includes the identifiers of the M key agreement algorithms supported by the receiver device, so that the sender device can obtain the M key agreement algorithms supported by the receiver device.
  • the second information when the second information includes ID2, ID3, and ID5, the second information is used to indicate algorithm 2, algorithm 3, and algorithm 5; when the second information includes ID1 and ID5 When the time, the second information is used to indicate Algorithm 1 and Algorithm 5.
  • Table 1 is only an example of the key agreement algorithm identification indicated by the second information.
  • the key agreement algorithm indicated by the second information may also be in other forms and is not limited.
  • the second information includes a bit sequence, one bit in the bit sequence corresponds to an algorithm, and each bit in the bit sequence can indicate whether the second information indicates the algorithm corresponding to the bit through 0 or 1. For example, if the bit is 1, it may indicate that the second information indicates the algorithm corresponding to the bit, and if the bit is 0, it may indicate that the second information does not indicate the algorithm corresponding to the bit, and vice versa.
  • the first information includes 4 bits, the first bit of the 4 bits corresponds to algorithm 1, the second bit corresponds to algorithm 2, the third bit corresponds to algorithm 3, and the fourth bit corresponds to algorithm
  • the 4 bits are 1001, it can indicate that the second information is used to indicate algorithm 1 and algorithm 4; if the 5 bits are 1100, it can indicate that the first algorithm negotiation request information is used to indicate algorithm 1 and algorithm 2.
  • the sender device determines the priority of the key agreement algorithm supported by the receiver device according to the M types of key agreement algorithms supported by the receiver device indicated in the received second information, so as to determine the priority of the key agreement algorithm selected by the receiver device Whether the key agreement algorithm is the key agreement algorithm with the highest priority of the sender device or the receiver device among the algorithms supported by both the receiver device and the sender device. If yes, execute S505; otherwise, discard the second message, and disconnect the connection with the receiver device.
  • the key agreement algorithm supported by the receiving device includes algorithm 2, algorithm 3, algorithm 5, and algorithm 6.
  • algorithm 3 has a higher priority than algorithm 6
  • algorithm 6 has a higher priority than algorithm 2
  • algorithm 2 has a higher priority than algorithm 5.
  • the target negotiation algorithm obtained by the sender device through the second information should be algorithm 3. . If the target negotiation algorithm obtained by the sender device through the second information is not Algorithm 3, the second information is discarded.
  • the method for the sender device to determine the priority of the key agreement algorithm supported by the receiver device includes:
  • the sender device receives priority information of M types of key agreement algorithms from the receiver device.
  • the sender device and the receiver device have conducted key negotiation.
  • the receiver device indicates to the sending device the priority of the key negotiation algorithm supported by the receiver device through information. Therefore, the sender The device associates and saves the priority of the key agreement algorithm supported by the recipient device with the recipient device. Therefore, in this key negotiation process, the sender device determines the priority of the key agreement algorithm supported by the receiver device according to the identifier of the receiver device and the identifier of the receiver device.
  • the second information is also used to indicate the priority information of the M types of key agreement algorithms supported by the receiver's device; the second information contains the identification information of the M types of key agreement algorithms, and the identification information is based on the M types of key agreement algorithms Therefore, the sender device obtains the priority information of the key agreement algorithm supported by the key supported by the receiver device according to the second information.
  • the second information also carries a first random number, where the first random number NONCE1 is a random number generated by the receiver device.
  • the second information also carries the identifier of the receiver device.
  • the identifier of the receiver device is used to identify the receiver device.
  • the sender device generates a target key according to the target key agreement algorithm and the first key agreement parameter.
  • the sender device since the identification of the target key agreement algorithm is carried in the second information, uses the identification of the target key agreement algorithm to determine the key agreement algorithm selected by the recipient device, so as to negotiate according to the target key agreement. Algorithm and key agreement parameter KE1, generate target key KE. In addition, the sender device calculates the key agreement parameter KE2 according to the target key agreement algorithm.
  • the sender device determines whether the target key agreement algorithm is one of the N key agreement algorithms indicated by the first information, and if so, according to The target key agreement algorithm obtains the target key and/or key agreement parameter KE2; if not, the sender device discards the second information.
  • the sender device obtains the encryption key and the integrity protection key according to the target key KE.
  • the encryption key is used to encrypt the information transmitted between the sender's device and the receiver's device.
  • the integrity protection key is used to protect the integrity of the information transmitted between the sender's device and the receiver's device.
  • one way of the sender's device encryption key and integrity protection key is:
  • KDF key derivation function
  • KDF1, KDF2, and KDF3 can be the same or different.
  • this application does not limit the KDF used to obtain the shared key Kgt, the KDF used to obtain the encryption key Kenc, and the KDF used to obtain the integrity protection key Kint.
  • Kenc KDF2 (Kgt, ID1)
  • Kint KDF3 (Kgt, ID2)
  • ID1 is the identifier of the encryption algorithm
  • ID2 is the identifier of the integrity protection algorithm
  • the method further includes S506.
  • the sender device sends third information to the receiver device.
  • the receiver device receives the third information from the sender device.
  • the third information includes a second key agreement parameter, and the second key agreement parameter is a key agreement parameter corresponding to the sender device and based on the target key agreement algorithm.
  • the third information carries the second random number NONCE2.
  • the second information sent by the receiver device to the sender device since the second information sent by the receiver device to the sender device is not secured, the second information may be tampered with during the sending process. If the second information is tampered with, it will cause the sender device The key negotiation with the receiver device fails, therefore, it is necessary to verify whether the second information has been tampered with.
  • the method of verifying whether the second information has been tampered with may be, for example:
  • the sender device performs authentication processing on the second information, uses the second information as a parameter to generate the first authentication data AUTH1, and sends the authentication data AUTH1 to the receiver device, so that the receiver device verifies whether the second information has been tampered with.
  • the third information includes authentication data AUTH1.
  • the ways to obtain AUTH1 include:
  • the preset shared key PSK is a key shared in advance between the sender's device and the receiver's device to verify the identity of both parties based on the preset shared key PSK to avoid communication between the sender's device and the receiver's device. Information has been tampered with. It should be noted that the embodiment of the present application does not limit the manner in which the preset shared key PSK is preset. For example, it may be obtained by separately inputting the same number to the sender's device and the receiver's device in advance, or obtained by using the same deduction algorithm after obtaining the target key KE.
  • the receiver device after receiving the third information, obtains the authentication data AUTH1, and matches the authentication data AUTH1 with the first reference authentication data.
  • the receiver device can determine whether the second information received by the sender device is consistent with the second information sent by the receiver device. If the authentication data AUTH1 matches the reference authentication data, it means that the second information has not been tampered with; otherwise, the receiver device discards the third information, disconnects the connection with the sender device this time, and then can resend the second information.
  • the receiver device can determine whether the second information received by the sender device is consistent with the second information sent by the receiver device.
  • the receiver device discards the third information, disconnects the connection with the sender device this time, and then can resend the second information Two information.
  • the embodiment of the application does not limit the acquisition of AUTH1 and the KDF of the first reference authentication data.
  • the KDF of AUTH1 is the same as the KDF of the first reference authentication data
  • the parameters of AUTH1 and the parameters of the first reference authentication data are obtained.
  • One-to-one correspondence is sufficient.
  • AUTH1 is obtained through KDF4, the second information received by the sender's device, and the preset shared key PSK.
  • KDF4 the receiver's device obtains the second information according to the sent second information and the preset shared key PSK. 1. Refer to the authentication data.
  • the third information is information processed through an integrity protection algorithm.
  • the sender device before performing S406, after the sender device obtains the encryption key Kenc and the integrity protection key Kint, according to the integrity protection algorithm, the integrity protection key Kint, and part of the third information sent by the sender device Or all the information obtains a first message authentication code (message authentication code, MAC), and the integrity of the third information is protected through the first MAC.
  • the third information includes the first MAC.
  • the receiver device generates the target key according to the second key agreement parameter and the target key agreement algorithm.
  • the receiver device after receiving the key agreement parameter KE2 of the sender device, the receiver device obtains the target key KE according to the key agreement algorithm and the received key agreement parameter KE2.
  • the receiver device uses the same method as the sender device to obtain the encryption key Kenc and the integrity protection key Kint according to the target key KE.
  • the method further includes S508.
  • the receiver device sends fourth information to the sender device.
  • the sender device receives the fourth information.
  • the method further includes S509.
  • the sender device verifies the fourth information.
  • the fourth information also includes second authentication data AUTH2.
  • the second authentication data AUTH2 is the authentication data obtained by the receiver device performing authentication processing on the third information; the second authentication data AUTH2 is used to indicate whether the third information is Falsified, whether the third information has been tampered with is indicated by the matching result of the second authentication data AUTH2 and the second reference authentication data, and the second reference authentication data is authentication data obtained after authentication processing is performed on the third information.
  • the sender device sends the third information to the receiver device, so that the receiver device obtains the target key.
  • the receiver device did not generate the target key, it cannot generate the encryption key. Therefore, the sender device cannot encrypt the third information, that is, the third information is information that is not secured, so that during the transmission process If the third information is tampered with, the information communicated between the sender's device and the receiver's device may leak. Therefore, it is necessary to determine whether the third information has been tampered with. Therefore, the receiver device performs authentication processing on the third information to obtain the second authentication data AUTH2.
  • the authentication data AUTH2 is included in the fourth information and sent to the sender device, and the sender device confirms whether the third information has been tampered with.
  • the sender device obtains AUTH2 from the fourth information, and matches the authentication data AUTH2 with the second reference authentication data.
  • the second reference authentication data is the third information sent by the sender device and the preset shared secret.
  • the sender device can determine whether the third information received by the receiver device is consistent with the third information sent by the sender device. If the authentication data AUTH2 matches the reference authentication data, it means that none of the third information has been tampered with, and the key negotiation between the sender device and the receiver device is successful; otherwise, the fourth information is discarded and the connection with the receiver device is disconnected .
  • FIG. 6 is a flowchart of a key agreement method provided by another embodiment of the application. As shown in FIG. 6, the key agreement method of the embodiment of the present application includes:
  • the sender device sends first information to the receiver device.
  • the receiver device receives the first information.
  • the first information is used to indicate N types of key agreement algorithms, where N is an integer greater than or equal to 1, and the N types of key agreement algorithms are algorithms supported by the sender device.
  • the first information is carried in the negotiation message. Specifically, before the two devices in the communication system perform data transmission, they need to perform key agreement to obtain the target key, so as to encrypt and decrypt the transmitted data according to the target key. Wherein, when the sender device and the receiver device perform key negotiation, the initiator device sends a negotiation message to the receiver device.
  • the first information is also used to indicate priority information of the N key agreement algorithms; wherein the identification information of the N key agreement algorithms included in the first information is the priority information according to the N key agreement algorithms Arranged or packaged.
  • the priorities of the N key agreement algorithms indicated by the first information are arranged from high to low, or the priorities of the N key agreement algorithms indicated by the first information are arranged from low to high.
  • the first information is used to indicate algorithm 1, algorithm 2, algorithm 3, algorithm 4, and algorithm 5.
  • the priority of algorithm 4 is higher than that of algorithm 2
  • the priority of algorithm 2 is higher than that of algorithm 5.
  • Algorithm 5 has a higher priority than Algorithm 1
  • Algorithm 1 has a higher priority than Algorithm 3.
  • the receiver device determines a target key agreement algorithm.
  • the target key agreement algorithm is a key agreement algorithm that is supported by the receiver device among the N types of key agreement algorithms.
  • the receiver device determines the key agreement algorithm it supports from the N types of key agreement algorithms in the first information as the target agreement algorithm.
  • the recipient device selects from the N key agreement algorithms that the recipient device supports and is for the sender device
  • the key agreement algorithm with the relatively highest priority is used as the target negotiation algorithm.
  • Table 3 shows all the key agreement algorithms supported by the receiver device.
  • the first information received by the receiver device indicates the five key agreement algorithms shown in Table 1.
  • the identifiers of the five algorithms are arranged in order of priority from high to low.
  • the receiver device supports Algorithm 2, Algorithm 3, and Algorithm 5, and the priority of Algorithm 2 is higher than Algorithm 3 and Algorithm 5. Therefore, the receiver Party equipment selection algorithm 2 is the target negotiation algorithm.
  • the receiver device determines the key that it supports and has the highest priority for itself from the N key agreement algorithms indicated in the received first information Negotiation algorithm, as the target negotiation algorithm.
  • Table 4 shows priority information of the key agreement algorithm supported by the receiver device.
  • the first information received by the receiver device indicates the five key agreement algorithms shown in Table 1.
  • the receiver device supports Algorithm 2, Algorithm 3, and Algorithm 5.
  • the priority of algorithm 3 is higher than that of algorithm 2
  • the priority of algorithm 2 is higher than that of algorithm 5.
  • the receiver device selects algorithm 3 as the target negotiation algorithm.
  • the N types of key agreement algorithms supported by the sender device indicated in the first information may not be arranged according to the photo priority information, that is, the first information does not indicate the N types of key agreement algorithms supported by the sender device. Priority information of the key agreement algorithm.
  • the receiver device generates a first key agreement parameter according to the target key agreement algorithm.
  • the first key agreement parameter is a key agreement parameter corresponding to the receiver device and obtained based on the target key agreement algorithm.
  • the receiver device calculates the key agreement parameter KE1 through the selected key agreement algorithm.
  • S604 The receiver device sends the second information to the sender device.
  • the sender device receives the second information from the receiver device.
  • the second information indicates the target key agreement algorithm and includes the first key agreement parameter.
  • the second information also carries a first random number, where the first random number NONCE1 is a random number generated by the receiver device.
  • the second information also carries the identifier of the receiver device.
  • the identifier of the receiver device is used to identify the receiver device.
  • the sender device generates a target key according to the target key agreement algorithm and the first key agreement parameter.
  • the sender device since the identification of the target key agreement algorithm is carried in the second information, uses the identification of the target key agreement algorithm to determine the key agreement algorithm selected by the recipient device, so as to negotiate according to the target key agreement. Algorithm and key agreement parameter KE1, generate target key KE. In addition, the sender device calculates the second key agreement parameter according to the target key agreement algorithm, denoted as KE2.
  • the sender device determines whether the target key agreement algorithm is one of the N key agreement algorithms indicated by the first information, and if so, according to The target key agreement algorithm obtains the target key and/or key agreement parameter KE2; if not, the sender device discards the second information.
  • the sender device obtains the encryption key and the integrity protection key according to the target key KE.
  • the encryption key is used to encrypt the information transmitted between the sender's device and the receiver's device.
  • the integrity protection key is used to protect the integrity of the information transmitted between the sender's device and the receiver's device.
  • one way of the sender's device encryption key and integrity protection key is:
  • KDF key derivation function
  • KDF1, KDF2, and KDF3 can be the same or different.
  • this application does not limit the KDF used to obtain the shared key Kgt, the KDF used to obtain the encryption key Kenc, and the KDF used to obtain the integrity protection key Kint.
  • Kenc KDF2 (Kgt, ID1)
  • Kint KDF3 (Kgt, ID2)
  • ID1 is the identifier of the encryption algorithm
  • ID2 is the identifier of the integrity protection algorithm
  • the method further includes S606.
  • the sender device sends third information to the receiver device.
  • the receiver device receives the third information from the sender device.
  • the third information includes the second key agreement parameter, the second key agreement parameter is the key agreement parameter based on the target key agreement algorithm corresponding to the sender device, and the third information is also used to indicate the N supported by the sender device.
  • This kind of key agreement algorithm is used by the receiver device to determine whether the first information has been tampered with.
  • the third information again indicates the N types of key agreement algorithms supported by the sender device. Since the integrity of the third information is protected, the receiver device can determine whether the third information has been tampered with based on the comparison result of the first MAC and the second MAC. In the case that the third information has not been tampered with, if the N key agreement algorithms supported by the sender device indicated by the third information are consistent with the N key agreement algorithms supported by the sender device obtained from the first information , Indicating that the first information has not been tampered with; otherwise, indicating that the first information has been tampered with, discard the third information, and disconnect the connection with the sender device.
  • the receiver device generates the target key according to the second key agreement parameter and the target key agreement algorithm.
  • the receiver device after receiving the key agreement parameter KE2 of the sender device, the receiver device obtains the target key KE according to the key agreement algorithm and the received key agreement parameter KE2.
  • the receiver device uses the same method as the sender device to obtain the encryption key Kenc and the integrity protection key Kint according to the target key KE.
  • the method further includes S608.
  • the receiver device sends fourth information to the sender device.
  • the sender device receives the fourth information.
  • the method further includes S609.
  • the sender device verifies the fourth information.
  • the fourth information also includes second authentication data AUTH2.
  • the second authentication data is the authentication data obtained by the recipient device performing authentication processing on the third information; the second authentication data is used to indicate whether the third information has been tampered with , Whether the third information has been tampered with is indicated by the matching result of the second authentication data and the second reference authentication data, and the second reference authentication data is authentication data obtained after performing authentication processing on the third information.
  • the sender device sends the third information to the receiver device, so that the receiver device obtains the target key.
  • the receiver device did not generate the target key, it cannot generate the encryption key. Therefore, the sender device cannot encrypt the third information, that is, the third information is information that is not secured, so that during the transmission process If the third information is tampered with, the information communicated between the sender's device and the receiver's device may leak. Therefore, it is necessary to determine whether the third information has been tampered with. Therefore, the receiver device performs authentication processing on the third information, obtains the second authentication data AUTH2, includes the authentication data AUTH2 in the fourth information, and sends it to the sender device.
  • the sender device obtains AUTH2 from the fourth information, and matches the authentication data AUTH2 with the second reference authentication data.
  • the second reference authentication data is the third information sent by the sender device and the preset shared secret.
  • the sender device can determine whether the third information received by the receiver device is consistent with the third information sent by the sender device. If the authentication data AUTH2 matches the reference authentication data, it means that none of the third information has been tampered with, and the key negotiation between the sender device and the receiver device is successful; otherwise, the connection with the receiver device is disconnected.
  • FIG. 7 is a flowchart of a key agreement method provided by another embodiment of the application. As shown in FIG. 7, the key agreement method in the embodiment of the present application includes:
  • the receiver device receives the sixth information.
  • the sixth information is compared with the first information.
  • the sixth information does not indicate the N types of key agreement algorithms supported by the sender device. Therefore, the receiver device cannot know the sender device after receiving the sixth information. Supported key agreement algorithm.
  • the receiver device determines a first target key agreement algorithm.
  • the first target key agreement algorithm is a key agreement algorithm determined by the receiver device from M types of key agreement algorithms.
  • the receiver device since the receiver device does not know the key agreement algorithm supported by the sender device, the receiver device determines the first target key agreement algorithm according to the M types of key agreement algorithms supported by the receiver device.
  • the receiver device generates a first key agreement parameter according to the first target key agreement algorithm.
  • the receiver device generates a private key that only the receiver device knows, and generates a public key through the selected key agreement algorithm, and the public key is the key agreement parameter KE1.
  • the receiver device sends the second information to the sender device.
  • the sender device receives the second information from the receiver device.
  • the second information is used to indicate M types of key agreement algorithms, the first target key agreement parameter, and the first key agreement parameter supported by the receiver device.
  • the sender device judges whether to negotiate the target key according to the first target key agreement algorithm, if yes, execute S706; if not, execute S710.
  • the recipient device since the recipient device does not know the key agreement algorithm supported by the sender device when selecting the first target key agreement algorithm, the first target key agreement algorithm may not be the secret key agreement supported by the sender device. Key agreement algorithm. Therefore, after receiving the second message, the sender device confirms whether the first target key agreement algorithm is a supported key agreement algorithm, and if so, executes S706, otherwise, executes S710.
  • the sender device may also determine whether the first target key agreement is an algorithm supported by the sender device and also supported by the receiver device, the key agreement algorithm with the highest priority corresponding to the sender device, and if so, then Perform S706, otherwise, perform S710.
  • the second information also indicates priority information of the key agreement algorithms in the M types of key agreement algorithms supported by the receiver device. Therefore, the sender device can learn the M types of key agreement algorithms supported by the receiver device according to the second information. Priority information of the key agreement algorithm in the key agreement algorithm. Therefore, the sender device can also determine whether the first target key agreement is an algorithm supported by the sender device and also supported by the receiver device, which corresponds to the key agreement algorithm with the highest priority of the receiver device, and if so, execute S706 , Otherwise, execute S710.
  • the sender device generates a target key according to the first target key agreement algorithm and the first key agreement parameter.
  • the sender device generates the target key KE according to the first target key agreement algorithm and the key agreement parameter KE1.
  • the sender device generates a private key that only the sender device knows, and then calculates the corresponding public key according to the first target key agreement algorithm, that is, the second key agreement parameter, denoted as KE2.
  • the sender device sends third information to the receiver device.
  • the receiver device receives the third information from the sender device.
  • the third information includes the second key agreement parameter.
  • the receiver device generates a target key according to the second key agreement parameter and the first target key agreement algorithm.
  • the third information includes the key agreement parameter KE2.
  • the receiver device After receiving the third information, the receiver device generates the target key KE according to the key agreement parameter KE2 and the first target key agreement algorithm.
  • the receiver device sends fourth information to the sender device.
  • the sender device receives the fourth information.
  • the fourth information is used for the sender device to determine whether the key negotiation is successful.
  • the sender device determines a second target key agreement algorithm.
  • the second target key agreement algorithm is a key agreement algorithm supported by both the sender device and the receiver device determined by the sender device from N types of key agreement algorithms and M types of key agreement algorithms.
  • the sender device knows the M types of key agreement algorithms supported by the receiver device. Therefore, the sender device selects from N types of key agreement algorithms supported by itself and M types of key agreement algorithms supported by the receiver. A key agreement algorithm supported by both the sender device and the receiver device is used as the second target key agreement algorithm.
  • the sender device can also select one of the N key agreement algorithms supported by the sender and the M key agreement algorithms supported by the receiver, and the corresponding sender device is preferred.
  • the key agreement algorithm with the highest level is used as the second target key agreement algorithm.
  • the second information also indicates priority information of the key agreement algorithm in the M types of key agreement algorithms supported by the receiver device. Therefore,
  • the sender device can also select one of the N key agreement algorithms supported by the sender and the M key agreement algorithms supported by the receiver, and the corresponding sender device is preferred.
  • the key agreement algorithm with the highest level is used as the second target key agreement algorithm.
  • the second information also indicates the priority information of the key agreement algorithm in the M types of key agreement algorithms supported by the receiver device. Therefore, the sender device may also receive from the N types of key agreement algorithms supported by itself. Among the M types of key agreement algorithms supported by the party, a key agreement algorithm that is supported by both the sender device and the receiver device and has the highest priority corresponding to the receiver device is selected as the second target key agreement algorithm.
  • the sender device sends seventh information to the receiver device.
  • the seventh information is used to indicate the second target key agreement algorithm selected by the sender device.
  • the sender device sends the second target key agreement algorithm to the receiver device through the seventh information.
  • the receiver device executes the steps S403-S408 in Figure 4, except that the target key agreement algorithm is the second target key agreement algorithm, that is, the receiver device learns the second target key agreement according to the seventh information Algorithm, and then generate a private key, the private key is only known by the recipient device, and the public key is generated through the second key agreement algorithm, the public key is the key agreement parameter KE1, and the recipient device sends the second information to the sender device , Where the second information includes the key agreement parameter KE1.
  • the sender device After receiving the second information, the sender device obtains the key agreement parameter KE1, and the sender device generates a private key that only the sender device knows.
  • the sender device uses the key agreement parameter KE1 and corresponds to the private key of the sender device. Key and the second target key agreement algorithm to obtain the target key KE.
  • the sender device generates a public key through the second key agreement algorithm according to the generated private key.
  • the public key is the key agreement parameter KE2.
  • the sender device sends the third information to the receiver device, where the third information Include the key agreement parameter KE2.
  • the receiver device After receiving the third information, the receiver device obtains the key agreement parameter KE2, and the receiver device generates a private key that only the receiver device knows.
  • the receiver device uses the key agreement parameter KE2 and corresponds to the private key of the receiver device. Key and the second target key agreement algorithm to obtain the target key KE.
  • the seventh information is used to indicate the second target key agreement algorithm and the second key agreement parameter selected by the sender device.
  • the sender device determines the second target key agreement algorithm, it generates a private key that only the sender device knows.
  • the second target key agreement algorithm generates the key negotiation parameter KE2, and the sender device negotiates the key
  • the parameter KE2 and the second target key agreement algorithm are sent to the recipient device so that the recipient device can directly learn the key agreement parameter KE2 through the seventh message, so that the sender device does not need to send another message to indicate the key agreement parameter KE2 reduces the information interaction between the sender's device and the receiver's device, and improves the efficiency of key negotiation.
  • the receiver device After the receiver device receives the seventh message, it can obtain the key agreement parameter KE2 of the sender device and the second target key agreement algorithm. The receiver device generates a private key that only the receiver device knows. Then, According to the second target key agreement algorithm, the key agreement parameter KE1 is generated. After that, the receiver device generates the target key KE according to the key agreement parameter KE2 and the second target key agreement algorithm. Then, the receiver device sends second information to the sender device, where the second information includes the key agreement parameter KE1.
  • the second information further includes a first random number NONCE1 randomly generated by the receiver device.
  • the sender device compares the fourth authentication data with the fourth reference authentication data, where the fourth reference authentication data is obtained by the sender device according to the seventh information sent, the preset shared key PSK and KDF9 of. Therefore, the fourth authentication data matches the fourth reference authentication data, indicating that the seventh information has not been tampered with during the sending process; otherwise, the second information is discarded and the connection with the receiver device is disconnected.
  • the second information is information for integrity protection.
  • the sender device sends the third information to the receiver device, and the third information is information that has been encrypted and integrity protected.
  • the third information includes fifth authentication data, where the fifth authentication data is that the sender device receives the corresponding second information in S704 according to the sender device, the preset shared key PSK, and the sender device receives
  • the sender device After receiving the third information, the sender device compares the fifth authentication data with the fifth reference authentication data, where the fifth reference authentication data is the preset shared secret according to the second information sent by the receiver device in S704.
  • the key PSK, the sent second information carrying the fourth authentication data, and the KDF10 are obtained. Therefore, the fifth authentication data matches the fifth reference authentication data, indicating that the corresponding second information in S704 and the second information carrying the fourth authentication data have not been tampered with during the sending process; otherwise, the third information is discarded, and the third information is disconnected. Open the connection with the receiving device.
  • the sender device After receiving the second information, the sender device obtains the key agreement parameter KE1, and obtains the target key KE according to the key agreement parameter KE1 and the second target key agreement algorithm.
  • the seventh information further includes a second random number NONCE2 randomly generated by the sender device.
  • the methods or steps implemented by the sender’s device can also be implemented by components that can be used on the receiver’s device, and the methods or steps implemented by the receiver’s device can also be implemented by the sender’s device.
  • the component realization of the device can also be implemented by the sender’s device.
  • FIG. 8 is a schematic structural diagram of a key agreement device provided by an embodiment of this application.
  • the key agreement apparatus 800 described in this embodiment may be the sender device or the receiver device mentioned in the foregoing method embodiment.
  • the key agreement apparatus can be used to implement the method corresponding to the sender device or the receiver device described in the foregoing method embodiment. For details, refer to the description in the foregoing method embodiment.
  • the key agreement apparatus 800 may include one or more processors 801, and the processor 801 may also be referred to as a processing unit, which may implement certain control or processing functions.
  • the processor 801 may be a general-purpose processor or a special-purpose processor. For example, it can be a baseband processor or a central processing unit.
  • the baseband processor can be used to process the communication protocol and communication data
  • the central processor can be used to control the communication device, execute the software program, and process the data of the software program.
  • the processor 801 may also store instructions 803 or data (for example, intermediate data). Wherein, the instruction 803 may be executed by the processor, so that the key agreement apparatus 800 executes the method corresponding to the sender device or the receiver device described in the foregoing method embodiment.
  • the key agreement device 800 may include a circuit, which may implement the sending or receiving or communication functions in the foregoing method embodiments.
  • the key agreement apparatus 800 may include one or more memories 802, on which instructions 804 may be stored, and the instructions may be executed on the processor, so that the key agreement apparatus 800 Perform the method described in the above method embodiment.
  • data may also be stored in the memory.
  • the processor and the memory can be provided separately or integrated together.
  • the key agreement device 800 may further include a transceiver 805 and/or an antenna 806.
  • the processor 801 may be referred to as a processing unit, which controls the key agreement device (the sender device or the receiver device).
  • the transceiver 805 may be called a transceiver unit, a transceiver, a transceiver circuit, or a transceiver, etc., and is used to implement the transceiver function of the key agreement device.
  • the key agreement apparatus 800 is used to implement operations corresponding to the receiver device in the foregoing embodiments.
  • the transceiver 805 may receive the first information from the sender device; the processor 801 determines, according to the first information, that the receiver device and the sender device perform key agreement.
  • the key agreement device 800 is used to implement operations corresponding to the sender device in the foregoing embodiments.
  • the processor 801 may determine the first information, where the first information indicates the key agreement algorithm capability supported by the sender device; the transceiver 805 sends the first information to the receiver device.
  • the processor 801 and the transceiver 805 described in this application can be implemented in integrated circuits (IC), analog ICs, radio frequency integrated circuits (RFICs), mixed signal ICs, and application specific integrated circuits (application specific integrated circuits). circuit, ASIC), printed circuit board (PCB), electronic equipment, etc.
  • the processor and transceiver can also be manufactured using various 1C process technologies, such as complementary metal oxide semiconductor (CMOS), nMetal-oxide-semiconductor (NMOS), and P-type Metal oxide semiconductor (positive channel metal oxide semiconductor, PMOS), bipolar junction transistor (BJT), bipolar CMOS (BiCMOS), silicon germanium (SiGe), gallium arsenide (GaAs), etc.
  • CMOS complementary metal oxide semiconductor
  • NMOS nMetal-oxide-semiconductor
  • PMOS bipolar junction transistor
  • BiCMOS bipolar CMOS
  • SiGe silicon germanium
  • GaAs gallium arsenide
  • the key agreement device 800 is described by taking the sender device or the receiver device as an example, the scope of the key agreement device described in this application is not limited to the foregoing sender device or the foregoing receiver device. Device, and the structure of the key agreement device may not be limited by the figure 8.
  • the key agreement apparatus 800 may be a stand-alone device or may be a part of a larger device.
  • the device may be:
  • the IC collection may also include storage components for storing data and/or instructions;
  • ASIC such as modem (MSM)
  • FIG. 9 is a schematic structural diagram of a key agreement device provided by another embodiment of the application.
  • the device may be a sender device, a component of a sender device (for example, an integrated circuit, a chip, etc.), or may be another communication module, which is used to implement the corresponding method in the method embodiments shown in FIGS. 4 to 6 The operation or procedure of the sender's device.
  • the key agreement device provided in this embodiment includes: a first sending module 901, a first receiving module 902, and a first processing module 903. in,
  • the first sending module 901 is configured to send first information to the receiver device.
  • the first information is used to indicate N types of key agreement algorithms, where N is an integer greater than or equal to 1, and the N types of key agreement algorithms are supported by the sender device. algorithm;
  • the first receiving module 902 is configured to receive second information from the receiver device, the second information is used to indicate the target key agreement algorithm, and includes the first key agreement parameter, the target key agreement algorithm is N types of key agreement A key agreement algorithm in the algorithm and supported by the recipient device, the first key agreement parameter is a key agreement parameter corresponding to the recipient device and obtained based on the target key agreement algorithm;
  • the first processing module 903 is configured to generate a target key according to the target key agreement algorithm and the first key agreement parameter.
  • the first sending module 901 is also used to:
  • the third information is sent to the receiver device, the third information includes a second key agreement parameter, and the second key agreement parameter is a key agreement parameter corresponding to the sender device and based on the target key agreement algorithm.
  • the first sending module 901 sends the third information to the receiver device, it is specifically used to:
  • the first information is also used to indicate priority information of N types of key agreement algorithms
  • the first information includes identification information of N types of key agreement algorithms, and the identification information is arranged or encapsulated according to priority information of N types of key agreement algorithms.
  • the second information is also used to indicate M types of key agreement algorithms supported by the receiver device, where M is an integer greater than or equal to 1;
  • the target key is generated, including:
  • the target key agreement algorithm is the key agreement algorithm with the highest priority corresponding to the receiver device among the M types of key agreement algorithms
  • the target key is generated.
  • the first receiving module 902 is further configured to:
  • the second information is also used to indicate priority information of M types of key agreement algorithms supported by the receiver device;
  • the second information includes identification information of M types of key agreement algorithms, and the identification information is arranged or encapsulated according to the priority of the M types of key agreement algorithms.
  • the first sending module 901 is also used to:
  • the first authentication data is sent to the receiver device, where the first authentication data is the authentication data obtained by the sender device performing authentication processing on the second information.
  • the first receiving module 902 is further configured to:
  • the first processing module 903 is also used for:
  • the fourth information includes second authentication data
  • the second authentication data is data from the recipient device that is obtained by performing authentication processing on the third information.
  • the first receiving module 902 is further configured to:
  • the first processing module 903 is also used for:
  • the fourth information includes third authentication data
  • the third authentication data is data from the receiver device that is obtained by performing authentication processing on the N key agreement algorithms indicated in the first information and the third information.
  • the fourth information is the fourth information processed by the integrity protection algorithm.
  • the authentication processing further includes performing authentication processing according to a preset shared key.
  • the third information further indicates N types of key agreement algorithms supported by the sender device.
  • the first sending module 901 sends the first information to the receiver device, it is specifically used to:
  • the device provided in this embodiment can correspondingly be used to implement the technical solutions of any of the foregoing method embodiments, and its implementation principles and technical effects are similar, and will not be repeated here.
  • FIG. 10 is a schematic structural diagram of a key agreement device provided by another embodiment of this application.
  • the device can be a receiver's device, a component of a receiver's device (for example, an integrated circuit, a chip, etc.), or can be another communication module, which is used to implement the corresponding method in the method embodiments shown in FIGS. 4-6 The operation or procedure of the recipient's device.
  • the key agreement device provided in this embodiment includes: a second receiving module 1001, a second processing module 1002, and a second sending module 1003. in,
  • the second receiving module 1001 is configured to receive first information from the sender device, where the first information indicates N key agreement algorithms supported by the sender device, and N is an integer greater than or equal to 1;
  • the second processing module 1002 is used to determine the target key agreement algorithm, and generate the first key agreement parameter according to the target key agreement algorithm, where the target key agreement algorithm is one of the N key agreement algorithms and receives A key agreement algorithm supported by the party device; the first key agreement parameter is a key agreement parameter corresponding to the receiver device and obtained based on the target key agreement algorithm;
  • the second sending module 1003 is configured to send second information to the sender device, where the second information indicates the target key agreement algorithm and includes the first key agreement parameter;
  • the second receiving module 1001 is configured to receive third information from the sender device, the third information indicates the second key agreement parameter, and the second key agreement parameter corresponds to the sender device’s value based on the target key agreement algorithm Key agreement parameters;
  • the second processing module 1002 is further configured to generate a target key according to the second key agreement parameter and the target key agreement algorithm.
  • the third information is the third information processed by the integrity protection algorithm.
  • the first information is also used to indicate priority information of N types of key agreement algorithms; wherein, the first information includes identification information of the N types of key agreement algorithms, and the identification information is based on the N types of key agreement algorithms.
  • Priority information is arranged or encapsulated;
  • the second processing module 1002 determines the target key agreement algorithm:
  • the key agreement algorithm with the highest priority corresponding to the sender device is determined from the N types of key agreement algorithms as the target key agreement algorithm.
  • the second processing module 1002 determines the target key agreement algorithm, it is specifically used to:
  • the key agreement algorithm with the highest priority corresponding to the receiver device is determined as the target key agreement algorithm.
  • the second information also indicates priority information of M types of key agreement algorithms supported by the receiver device;
  • the second information includes identification information of M types of key agreement algorithms, and the identification information is arranged or encapsulated according to priority information of M types of key agreement algorithms.
  • the second receiving module 1001 is also used for:
  • the first authentication data is the authentication data obtained by the sender device by performing authentication processing on the second information.
  • the second sending module 1003 is also used for:
  • the fourth information is sent to the sender device, where the fourth information includes second authentication data, and the second authentication data is authentication data obtained by the receiver device by performing authentication processing on the third information.
  • the second sending module 1003 is also used for:
  • Send fourth information to the sender device includes third authentication data
  • the third authentication data is the authentication data obtained by the recipient device performing authentication processing on the N types of key agreement algorithms indicated in the first information and the third information .
  • the second sending module 1003 sends the fourth information to the sender device, it is specifically used to:
  • the authentication processing further includes performing authentication processing according to a preset key.
  • the third information further indicates N types of key agreement algorithms supported by the sender device.
  • the device provided in this embodiment can correspondingly be used to implement the technical solutions of any of the above-described method embodiments, and its implementation principles and technical effects are similar, and will not be repeated here.
  • FIG. 11 is a schematic structural diagram of a communication system provided by an embodiment of this application. As shown in FIG. 11, the communication system 1100 described in this embodiment may include: a sender device 1101 and a receiver device 1102.
  • the sender device 1101 may adopt the structure of the apparatus embodiment shown in FIG. 8 or FIG.
  • the implementation principle and technical effect are similar, and will not be repeated here.
  • the receiver device 1102 may adopt the structure of the apparatus embodiment shown in FIG. 8 or FIG.
  • the implementation principle and technical effect are similar, and will not be repeated here.
  • the sender device 1101 may adopt the structure of the apparatus embodiment shown in FIG. 8 or FIG.
  • the implementation principle and technical effect are similar, and will not be repeated here.
  • the receiver device 1102 can adopt the structure of the device embodiment shown in FIG. 8 or FIG. 10, and correspondingly, it can execute the technical solution related to the receiver device in any of the foregoing method embodiments.
  • the implementation principles and technical effects are similar. Repeat it again.
  • the integrated module is implemented in the form of a software function module and sold or used as an independent product, it can be stored in a computer readable storage medium.
  • the technical solution of the present application essentially or the part that contributes to the existing technology or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium , Including several instructions to enable a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor to execute all or part of the steps of the methods described in the various embodiments of the present application.
  • the aforementioned storage media include: U disk, mobile hard disk, read-only memory (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 embodiment of the present application also provides a computer-readable storage medium, the computer-readable storage medium stores a computer program, and when the computer program runs on one or more processors, execute Figure 3-7 The method described in any one of the embodiments.
  • An embodiment of the application also provides a chip system, the chip system includes at least one processor, a memory, and an interface circuit.
  • the interface circuit is used to provide information input and/or output for the at least one processor.
  • At least one memory stores a computer program, and when the computer program runs on one or more processors, the method described in any one of the embodiments in FIG. 3 to FIG. 7 is executed.
  • An embodiment of the present application also provides a smart cockpit product, the smart cockpit product includes the key agreement device provided in FIG. 8 or FIG. 10 or the key agreement device provided in FIG. 8 or FIG. 9 above, the key agreement device
  • the method executed by the sender device or the receiver device corresponding to the key agreement apparatus in any one of the embodiments in FIG. 3 to FIG. 7 may be executed.
  • An embodiment of the present application also provides an intelligent terminal, which includes the key agreement device provided in FIG. 8 or FIG. 10 or the key agreement device provided in FIG. 8 or FIG. 9 above, and the key agreement device can execute The method executed by the sender device or the receiver device corresponding to the key agreement apparatus in any one of the embodiments in FIG. 3 to FIG. 7.
  • the smart terminal may be a means of transportation or smart equipment, including drones, unmanned transport vehicles, smart cars, or robots.
  • the various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments.
  • the description is relatively simple, and for related parts, please refer to the part of the description of the method embodiment.
  • the device embodiments described above are merely illustrative, where the units described as separate components may or may not be physically separate, and the components displayed as units may or may not be physical units, that is, they may be located in One place, or it can be distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the objectives of the solutions of the embodiments. Those of ordinary skill in the art can understand and implement without creative work.
  • the computer may be implemented in whole or in part by software, hardware, firmware, or any combination thereof.
  • software it can be implemented in the form of a computer program product in whole or in part.
  • the computer program product includes one or more computer instructions.
  • the computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices.
  • the computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium.
  • the computer instructions may be transmitted from a website, computer, server, or data center.
  • the computer-readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server or a data center integrated with one or more available media.
  • the usable medium may be a magnetic medium (for example, a floppy disk, a hard disk, and a magnetic tape), an optical medium (for example, a DVD), or a semiconductor medium (for example, a solid state disk (SSD)).

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

本申请提供一种密钥协商方法、装置和系统,可以应用于通信领域,例如短距离通信(含座舱域)等。其中,发送方设备和接收方设备进行密钥协商时,发送方设备通过第一信息将其支持的所有密钥协商算法通知给接收方设备,由接收方设备从接收到的发送方设备支持的密钥协商算法中选择自身支持的密钥协商算法。这样,接收方设备选择的密钥协商算法是发送方设备和接收方设备均支持的密钥协商算法,避免接收方设备选择的密钥协商算法发送方设备不支持而导致的密钥协商算法协商失败,提高了密钥协商的效率。并且,本申请提供的密钥协商方法支持国密算法。

Description

密钥协商方法、装置和系统 技术领域
本申请涉及通信技术领域,尤其涉及一种密钥协商方法、装置和系统。具体可以应用于短距离通信,例如座舱域通信等。
背景技术
IKEv2(Internet Key Exchange Version 2,互联网密钥交换协议版本2)是一种用于协商密钥的协议,可以为IPsec(Internet Protocol Security,互联网协议安全性)隧道协商安全协议、算法、密钥等参数。
一次IKEv2协商过程可以是:发送方设备向接收方设备发送的协商报文中包括发送方设备支持的至少一种密钥协商算法,以及发送方设备对应的其中一种密钥协商算法的密钥协商参数。接收方设备接收到协商报文后,从协商报文中包括的密钥协商算法中选择接收方设备支持的一种密钥协商算法。如果协商报文中包括发送方设备的密钥协商参数与接收方设备选中的密钥协商算法不对应,接收方设备就向发送方设备发送包括接收方设备支持的密钥协商算法的报文,然后发送方设备根据接收方设备支持的密钥协商算法,重新发送协商报文,这样使得发送方设备和接收方设备之间报文交互的次数增加,导致密钥协商效率低下。
发明内容
本申请实施例提供一种密钥协商方法、装置和系统,以提高密钥协商的效率。
第一方面,本申请实施例提供一种密钥协商方法,包括:
发送第一信息,所述第一信息用于指示N种密钥协商算法,所述N为大于等于1的整数,所述N种密钥协商算法为发送方设备支持的算法;
接收来自所述接收方设备的第二信息,所述第二信息用于指示目标密钥协商算法,并包括第一密钥协商参数,所述目标密钥协商算法为所述N种密钥协商算法中的且所述接收方设备支持的密钥协商算法。具体的,所述第一密钥协商参数为对应于所述接收方设备的、基于所述目标密钥协商算法得到的密钥协商参数,或者说,所述第一密钥协商参数为所述接收方设备基于所述目标密钥协商算法生成的密钥协商参数;
根据所述目标密钥协商算法与所述第一密钥协商参数,生成目标密钥。
在一种可能的设计中,所述方法还包括:
向所述接收方设备发送第三信息,所述第三信息包括第二密钥协商参数,所述第二密钥协商参数为对应于发送方设备的、基于所述目标密钥协商算法得到的密钥协商参数。
在一种可能的设计中,所述向所述接收方设备发送第三信息,包括:
向所述接收方设备发送通过完整性保护算法处理后的第三信息。
在一种可能的设计中,所述第一信息还用于指示所述N种密钥协商算法的优先级信息;
其中,所述第一信息包含所述N种密钥协商算法的标识信息,所述标识信息是按照所述N种密钥协商算法的优先级信息排列或者封装的。
在一种可能的设计中,所述第二信息还用于指示所述接收方设备支持的M种密钥协商算法,M为大于等于1的整数。
在一种可能的设计中,所述根据所述目标密钥协商算法与所述第一密钥协商参数,生成目标密钥,包括:
确定所述目标密钥协商算法是所述N种密钥协商算法中所述接收方设备支持的、优先级最高的密钥协商算法;
根据所述目标密钥协商算法与所述第一密钥协商参数,生成目标密钥。
或者说,在该可能的设计中,所述目标密钥协商算法为所述N种密钥协商算法中所述接收方设备支持的、优先级最高的密钥协商算法。
在一种可能的设计中,所述方法还包括:
接收来自所述接收方设备的所述M种密钥协商算法的优先级信息。
在一种可能的设计中,所述第二信息还用于指示所述接收方设备支持的M种密钥协商算法的优先级信息;
其中,所述第二信息包含所述M种密钥协商算法的标识信息,所述标识信息是按照所述M种密钥协商算法的优先级排列或者封装的。
在一种可能的设计中,所述第三信息中还包括第一认证数据,所述第一认证数据是所述发送方设备对所述第二信息进行认证处理获得的认证数据。或者在该可能的设计中,所述方法还包括:向所述接收方设备发送第一认证数据,所述第一认证数据是所述发送方设备对所述第二信息进行认证处理获得的认证数据。所述第一认证数据可以通过第三信息指示,也可以通过其他信息指示或者承载。
在一种可能的设计中,所述方法还包括:
接收并验证所述接收方设备发送的第四信息;
其中,所述第四信息包括第二认证数据,所述第二认证数据是来自所述接收方设备的、对所述第三信息进行认证处理获得的数据。
在一种可能的设计中,所述方法包括:
接收并验证所述接收方设备发送的第四信息;
其中,所述第四信息包括第三认证数据,所述第三认证数据是来自所述接收方设备的、对所述第一信息中指示的所述N种密钥协商算法和所述第三信息进行认证处理获得的数据。
在一种可能的设计中,所述第四信息是通过完整性保护算法处理后的第四信息。
在一种可能的设计中,所述认证处理还包括根据预设共享密钥进行认证处理。
在一种可能的设计中,所述第三信息还指示所述发送方设备支持的N种密钥协商算法。
在一种可能的设计中,所述向接收方设备发送第一信息,包括:
向所述接收方设备广播发送所述第一信息。
在一种可能的设计中,所述向接收方设备发送第一信息之前,还包括:
接收来自所述接收方设备的第五信息,所述第五信息用于指示所述发送方设备向所述接收方设备发送所述第一信息;
所述向接收方设备发送第一信息,包括:
向所述接收方设备单播发送所述第一信息。
第二方面,本申请实施例提供密钥协商方法,所述方法包括:
接收来自发送方设备的第一信息,所述第一信息中指示所述发送方设备支持的N种密钥协商算法,所述N为大于等于1的整数;
确定目标密钥协商算法,所述目标密钥协商算法为所述N种密钥协商算法中的、且所述接收方设备支持的密钥协商算法;
根据所述目标密钥协商算法,生成第一密钥协商参数,其中,所述第一密钥协商参数为对应于所述接收方设备的、基于所述目标密钥协商算法得到的密钥协商参数或者说,所述第一密钥协商参数为所述接收方设备基于所述目标密钥协商算法生成的密钥协商参数;
向所述发送方设备发送第二信息,所述第二信息指示所述目标密钥协商算法,并包括所述第一密钥协商参数。
在一种可能的设计中,所述方法还包括:接收来自所述发送方设备的第三信息,所述第三信息指示第二密钥协商参数,所述第二密钥协商参数对应于所述发送方设备的、基于所述目标密钥协商算法得到的密钥协商参数;
根据所述第二密钥协商参数和所述目标密钥协商算法,生成目标密钥。
在一种可能的设计中,所述第三信息为通过完整性保护算法处理后的第三信息。
在一种可能的设计中,所述第二信息还指示所述接收方设备支持的M种密钥协商算法的优先级信息;
其中,所述第二信息包含所述M种密钥协商算法的标识信息,所述标识信息是按照所述M种密钥协商算法的优先级信息排列或者封装的。
在一种可能的设计中,所述第一信息还用于指示所述N种密钥协商算法的优先级信息;其中,所述第一信息中包含所述N种密钥协商算法的标识信息,所述标识信息是按照所述N种密钥协商算法的优先级信息排列或者封装的。
在一种可能的设计中,所述确定目标密钥协商算法,包括:
从N种密钥协商算法中确定优先级最高的密钥协商算法作为目标密钥协商算法。
或者说,在该可能的设计中,所述目标密钥协商算法为所述N种密钥协商算法中所述接收方设备支持的、优先级最高的密钥协商算法。
在一种可能的设计中,所述方法还包括:
接收来自所述发送方设备的第一认证数据;所述第一认证数据是所述发送方设备对所述第二信息进行认证处理获得的认证数据。或者所述第三信息中还包括第一认证数据,所述第一认证数据是所述发送方设备对所述第二信息进行认证处理获得的认证数据。所述第一认证数据可以通过第三信息指示,也可以通过其他信息指示或者承载。
在一种可能的设计中,还包括:
向所述发送方设备发送第四信息,所述第四信息包括第二认证数据,所述第二认证数据是接收方设备对所述第三信息进行认证处理获得的认证数据。
在一种可能的设计中,还包括:
向所述发送方设备发送第四信息,所述第四信息包括第三认证数据,所述第三认证数据是接收方设备对所述第一信息中指示的所述N种密钥协商算法和所述第三信息进行认证处理获得的认证数据。
在一种可能的设计中,向所述发送方设备发送第四信息,包括:
向所述发送方设备发送通过完整性保护算法处理后的第四信息。
在一种可能的设计中,所述认证处理还包括根据预设密钥进行认证处理。
在一种可能的设计中,所述第三信息还指示所述发送方设备支持的N种密钥协商算法。
在一种可能的设计中,所述接收来自发送方设备的第一信息之前,还包括:
向所述发送方设备发送第五信息,所述第五信息用于指示所述发送方设备向所述接收方设备发送所述第一信息。
第三方面,本申请实施例提供一种密钥协商装置,包括:
用于实现第一方面的密钥协商方法的至少一个模块,部件或者电路;或者,
用于实现第二方面的密钥协商方法的至少一个模块,部件或者电路。
第四方面,本申请实施例提供一种密钥协商装置,包括:至少一个处理器和存储器;该至少一个处理器用于运行该存储器中的计算机程序,使得该密钥协商装置执行第一方面或第二方面本申请实施例所述的密钥协商方法。
第五方面,本申请实施例提供一种密钥协商装置,所述密钥协商装置包括一个或多个处理器和通信单元。所述一个或多个处理器被配置为支持所述通信装置执行第一方面或第二方面本申请实施例所述的密钥协商方法。所述通信单元用于支持所述密钥协商装置与其他设备通信,实现接收和/或发送功能。
可选的,所述装置还可以包括一个或多个存储器,所述存储器用于与处理器耦合,其保存装置必要的程序指令和/或数据。所述一个或多个存储器可以和处理器集成在一起,也可以与处理器分离设置。本申请并不限定。
所述密钥协商装置还可以为芯片。所述通信单元可以为通信芯片的输入/输出电路或者接口。
第六方面,本申请实施例提供一种计算机可读存储介质,用于存储计算机程序,该计算机程序包括用于执行上述第一方面或第二方面本申请实施例所述的密钥协商方法的指令。
第七方面,本申请实施例提供一种计算机程序产品,所述计算机程序产品包括:计算机程序代码,当所述计算机程序代码在计算机上运行时,使得计算机执行上述第一方面或第二方面本申请实施例任一所述的密钥协商方法。
第八方面,本申请实施例提供一种密钥协商系统,包括:用于执行第一方面本申请实施例所述的密钥协商装置和用于执行第二方面本申请实施例所述的密钥协商装置。
第九方面,本申请实施例提供一种终端,可以为运输工具或者智能设备,含无人机、无人运输车、汽车或者机器人等,该运输工具或者智能设备包含上述第三方面和/或第四方面和/或第五方面所述的密钥协商装置。
本申请实施例提供一种密钥协商方法、装置和系统,其中,发送方设备和接收方设备进行密钥协商时,发送方设备通过第一信息将其支持的所有密钥协商算法通知给 接收方设备,由接收方设备从接收到的发送方设备支持的密钥协商算法中选择自身支持的密钥协商算法。这样,接收方设备选择的密钥协商算法是发送方设备和接收方设备均支持的密钥协商算法,避免接收方设备选择的密钥协商算法发送方设备不支持而导致的密钥协商算法协商失败,提高了密钥协商的效率。并且,本申请实施例提供的密钥协商方法支持国密算法。
附图说明
图1为本申请一实施例提供的一种应用场景示意图;
图2为可适用于本申请实施例的通信装置的硬件结构示意图;
图3为一种密钥协商方法的流程图;
图4为本申请一实施例提供的密钥协商方法的流程图;
图5为本申请另一实施例提供的密钥协商方法的流程图;
图6为本申请另一实施例提供的密钥协商方法的流程图;
图7为本申请另一实施例提供的密钥协商方法的流程图;
图8为本申请一实施例提供的一种密钥协商装置的结构示意图;
图9为本申请另一实施例提供的密钥协商装置的结构示意图;
图10为本申请另一实施例提供的密钥协商装置的结构示意图;
图11为本申请一实施例提供的一种密钥协商系统的结构示意图。
具体实施方式
本申请的实施方式部分使用的术语仅用于对本申请的具体实施例进行解释,而非旨在限定本申请。
本申请实施例可应用于各种类型的通信系统。图1为本申请一实施例提供的一种应用场景示意图。如图1所示的通信系统,主要包括发送方设备11和接收方设备12。其中,发送方设备11为通信的发起方,接收方设备12为通信的接收方。
图1所示的通信系统中所包含的发送方设备11或接收方设备12可以是任意一种具有收发功能的设备。包括但不限于:通用移动通信技术的长期演进(long term evolution,LTE)系统中的演进型基站(NodeB或eNB或e-NodeB,evolutional Node B),新空口(new radio,NR)系统中的基站(gNodeB或gNB)或收发点(transmission receiving point/transmission reception point,TRP),第三代合作伙伴计划(the 3rd generation partnership project,3GPP)后续演进的基站,无线通信系统(例如WiFi,蓝牙等)中的接入节点,无线中继节点,无线回传节点,数据中转设备(如路由器、中继器、桥接器或交换机)等。基站可以是:宏基站,微基站,微微基站,小站,中继站,或,气球站等。
发送方设备11或接收方设备12还可以是云无线接入网络(cloud radio access network,CRAN)场景下的无线控制器、集中单元(centralized unit,CU),和/或,分布单元(distributed unit,DU)。
发送方设备11或接收方设备12还可以是服务器,可穿戴设备(如智能手表,智能手环,计步器等),机器通信设备、或车载设备等。
发送方设备11或接收方设备12还可以是手机(mobile phone)、平板电脑(Pad)、带无线收发功能的电脑、耳机、音响、虚拟现实(virtual reality,VR)终端设备、增强现实(augmented reality,AR)终端设备、机器类型通信(machine type communication,MTC)中的终端、工业控制(industrial control)中的终端、车载终端设备、无人驾驶(self driving)中的终端、辅助驾驶中的终端设备、远程医疗(remote medical)中的终端、智能电网(smart grid)中的终端、运输安全(transportation safety)中的终端、智慧城市(smart city)中的终端、智慧家庭(smart home)中的终端等等。
发送方设备11或接收方设备12还可以是汽车座舱(cockpit domain)设备,或者汽车座舱设备中的一个模块(座舱域控制器(cockpit domain controller,CDC)、摄像头、屏幕、麦克风、音响、电子钥匙、无钥匙进入及启动系统控制器等模块)。
本申请的实施例对应用场景不做限定。终端有时也可以称为终端设备、用户设备(user equipment,UE)、接入终端设备、车载终端、工业控制终端、UE单元、UE站、移动站、移动台、远方站、远程终端设备、移动设备、UE终端设备、无线通信设备、机器终端、UE代理或UE装置等。终端可以是固定的,也可以是移动。
图1所示的通信系统10仅用于举例,并非用于限制本申请的技术方案。本领域的技术人员应当明白,在具体实现过程中,通信系统10还可以包括其他设备,同时也可根据具体需要来确定发送方设备和接收方设备的数量,不予限制。
可选的,本申请实施例图1中的各设备,例如发送方设备11和接收方设备12,可以是一个装置内的一个功能模块。可以理解的是,该功能模块既可以是硬件设备中的元件,例如,终端设备或网络设备中的芯片或通信部件,也可以是在硬件上运行的软件功能模块,或者是平台(例如,云平台)上实例化的虚拟化功能。
例如,图1中的各设备均可以通过图2中的通信装置200来实现,其中,通信装置200可以为设备本身或者设备内部的芯片或者集成电路。图2所示为可适用于本申请实施例的通信装置的硬件结构示意图。该通信装置200可以包括至少一个处理器201以及至少一个通信接口204。可选的,该通信装置200还可以包含通信线路202和存储器203中的至少一个
处理器201可以是一个通用中央处理器(central processing unit,CPU),微处理器,特定应用集成电路(application-specific integrated circuit,ASIC),或一个或多个用于控制本申请方案程序执行的集成电路。
通信线路202可包括一通路,在上述组件之间传送信息,例如总线。
通信接口204,使用任何收发器一类的装置,用于与其他设备或通信网络通信,如以太网接口,无线接入网接口(radio access network,RAN),无线局域网接口(wireless local area networks,WLAN)等。
存储器203可以是只读存储器(read-only memory,ROM)或可存储静态信息和指令的其他类型的静态存储设备,随机存取存储器(random access memory,RAM)或者可存储信息和指令的其他类型的动态存储设备,也可以是电可擦可编程只读存储器(electrically erasable programmable read-only memory,EEPROM)、只读光盘(compact disc read-only  memory,CD-ROM)或其他光盘存储、光碟存储(包括压缩光碟、激光碟、光碟、数字通用光碟、蓝光光碟等)、磁盘存储介质或者其他磁存储设备、或者能够用于携带或存储具有指令或数据结构形式的期望的程序代码并能够由计算机存取的任何其他介质,但不限于此。存储器可以是独立存在,通过通信线路202与处理器相连接。存储器也可以和处理器集成在一起。本申请实施例提供的存储器通常可以具有非易失性。其中,存储器203用于存储执行本申请方案所涉及的计算机执行指令,并由处理器201来控制执行。处理器201用于执行存储器203中存储的计算机执行指令,从而实现本申请实施例提供的方法。
可选的,本申请实施例中的计算机执行指令也可以称之为应用程序代码,本申请实施例对此不作具体限定。
在具体实现中,作为一种实施例,处理器201可以包括一个或多个CPU,例如图2中的CPU0和CPU1。
在具体实现中,作为一种实施例,通信装置200可以包括多个处理器,例如图2中的处理器201和处理器207。这些处理器中的每一个可以是一个单核(single-CPU)处理器,也可以是一个多核(multi-CPU)处理器。这里的处理器可以指一个或多个设备、电路、和/或用于处理数据(例如计算机程序指令)的处理核。
在具体实现中,作为一种实施例,通信装置200还可以包括输出设备205和输入设备206。输出设备205和处理器201通信,可以以多种方式来显示信息。例如,输出设备205可以是液晶显示器(liquid crystal display,LCD),发光二级管(light emitting diode,LED)显示设备,阴极射线管(cathode ray tube,CRT)显示设备,或投影仪(projector)等。输入设备206和处理器201通信,可以以多种方式接收用户的输入。例如,输入设备206可以是鼠标、键盘、触摸屏设备或传感设备等。
在具体实现中,通信装置200可以是台式机、便携式电脑、网络服务器、掌上电脑(personal digital assistant,PDA)、移动手机、平板电脑、无线终端设备、嵌入式设备或有图2中类似结构的设备。本申请实施例不限定通信装置200的类型。
下面结合图1和图2对一种可能的密钥协商方法进行具体阐述。其中,下述实施例中的发送方设备和接收方设备可以具备图2所示部件。
对于发送方设备和接收方设备之间的密钥协商,其密钥协商方法如图3所示,密钥协商方法包括:
S301、发送方设备向接收方设备发送协商报文。相应的,接收方设备接收协商报文。
该协商报文用于指示N种密钥协商算法,并包括发送方设备的密钥协商参数,该密钥协商参数是基于发送方设备的支持的其中一种密钥协商算法得到的密钥协商参数。
本实施例中,发送方设备将自己支持的任一密钥协商算法作为生成目标密钥的算法,并基于选择的密钥协商算法获得密钥协商参数,并在发送方设备发送协商报文时,将该密钥协商参数包括在协商报文中发送给接收方设备。因此,接收方设备通过协商报文不仅可以确定发送方设备支持的所有的密钥协商算法,还可以直接获得用于接收方设备生成目标密钥的发送方设备的密钥协商参数。
S302、接收方设备确定目标密钥协商算法,并根据目标协商算法,生成接收方设备的密钥协商参数。
接收方设备的密钥协商参数是基于目标密钥协商算法得到的密钥协商参数。
本实施例中,接收方设备从根据协商报文获得的发送方设备支持的所有的密钥协商算法中也选择任一密钥协商算法作为生成目标密钥的算法,并基于选择的密钥协商算法获得密钥协商参数。其中,接收方设备在选择目标密钥协商算法时,并不考虑发送方设备选择的密钥协商算法,也就是,发送方设备和接收方设备在选择各自的用于作为生成目标密钥的密钥协商算法时,是互相独立的。因此,容易导致接收方设备选择的密钥协商算法与发送方设备选择的密钥协商算法不匹配,因此,就导致接收方设备选择的密钥协商算法与发送方设备的密钥协商参数不匹配。
S303、若发送方设备的密钥协商参数与目标密钥协商算法匹配,接收方设备向所述发送方设备协商响应报文。
该协商响应报文用于指示目标密钥协商算法,并包括接收方设备的密钥协商参数。
S304、接收方设备根据发送方设备的密钥协商参数和目标密钥协商算法,生成目标密钥。
S305、发送方设备根据接收方设备的密钥协商参数和目标密钥协商算法,生成目标密钥。
本实施例中,接收方设备和发送方设备生成目标密钥的过程为:
以迪菲赫尔曼DH算法为例,两个节点使用同一个数值较大的素数p和同一个随机数g(即素数p与随机数g为发送方设备与接收方设备之间的公钥),各自产生的随机数a和b(即随机数a为接收方设备的私钥,随机数b为发送方设备的私钥),上述的素数p、随机数g、随机数a和b都可以看作是密钥协商算法的参数。接收方设备将g的a次方模(mod)P产生的数值A(即A=g a mod p,A为第一密钥协商算法参数)发送给发送方设备,发送方设备再对接收的数值A做b次方运算生成秘密值KE;发送方设备将g的b次方mod P产生的数值B(即B=g b mod p,B为第二密钥协商算法参数)发送给接收方设备,接收方设备对接收的数值B做a次方运算生成秘密值KE。由于KE=A b mod p=(g a mod p) bmod p=g ab mod p=(g b mod p) a mod p=B a mod p,因此发送方设备与接收方设备生成的秘密值KE是相同的,即目标密钥相同。
由此可知,现有技术中,由于接收方设备和发送方设备各自选择自己支持的密钥协商发算法,容易导致接收方设备选择的密钥协商算法与发起方设备的密钥协商参数不匹配,从而导致协商失败。在接收方设备选择的密钥协商算法与发起方设备的密钥协商参数不匹配时,接收方设备需要向发起方设备发送一个报文,以使发起方设备重新发送协商报文,再次重复上述动作,直至接收方设备选择的密钥协商算法与发起方设备的密钥协商参数匹配。如此,使得发送方设备和接收方设备之间报文交互的次数增加,导致密钥协商效率低下。
为解决上述问题,本申请实施例提出:发送方设备将自己支持的密钥协商算法通知给接收方设备,由接收方设备从中选择接收方设备和发送方设备均支持的密钥协商算法,将选择的密钥协商算法以及根据该密钥协商算法生成的对应于接收方设备的密钥协商参数发送给发送方设备,而不是发送方设备和接收方设备各自选择自己支持的密钥协商算法,解决了发送方设备和接收方设备各自选择自己支持的密钥协商算法时容易出现双方选择的密钥协商算法不匹配的问题,提高了密钥协商的效率。
下面结合具体的实施例对本申请提出的密钥协商方法进行详细介绍。
图4为本申请一实施例提供的密钥协商方法的流程图。如图4所示,本申请实施例的密钥协商方法包括:
S401、发送方设备向接收方设备发送第一信息。相应的,接收方设备接收第一信息。
该第一信息用于指示N种密钥协商算法,N为大于等于1的整数,N种密钥协商算法为发送方设备支持的算法。
示例性的,第一信息承载于协商报文中。具体的,通信系统中的两个设备进行数据传输前,需要进行密钥协商,以获得目标密钥,从而根据目标密钥对传输的数据进行加密和解密。其中,发送方设备与接收方设备进行密钥协商时,由发起方设备发送协商报文至接收方设备。
第一信息可以通过下述方式中的任一种方式指示N种密钥协商算法:
方式一、第一信息包括发起方设备支持的N种密钥协商算法的标识,以使接收方设备获取发起方设备支持的N种密钥协商算法。
示例性的,以表1所示的算法的标识为例,当第一信息包括ID1、ID3和ID5时,第一信息用于指示算法1、算法3和算法5;当第一信息包括ID2和ID4时,第一信息用于指示算法2和算法4。
表1
算法 算法的标识
算法1 ID1
算法2 ID2
算法3 ID3
算法4 ID4
算法5 ID5
可以理解的,表1仅是第一信息指示的密钥协商算法标识的示例,在具体应用中,第一信息指示的密钥协商算法还可以是其他形式的,不予限制。
方式二、第一信息包括一个比特序列,该比特序列中的一个比特与一个算法对应,该比特序列中的每个比特可以通过0或1指示第一信息是否指示该比特对应的算法。例如,若该比特为1,可以表示第一信息指示该比特对应的算法,若该比特为0,可以表示第一信息不指示该比特对应的算法,反之亦然。
示例性的,以第一信息包括5比特,该5比特中的第1个比特与算法1对应,第2个比特和算法2对应,第3个比特和算法3对应,第4个比特和算法4对应,第5个比特和算法5对应为例,若该5比特为01010,可以表示第一信息用于指示算法2和算法4;若该5比特为11001,可以表示第一信息用于指示算法1、算法2和算法5。
可选的,第一信息还用于指示N种密钥协商算法的优先级信息;其中,第一信息包含的N种密钥协商算法的标识信息是按照N种密钥协商算法的优先级信息排列或者封装的。
示例性的,第一信息指示的N种密钥协商算法的优先级从高到低排列,或第一信息指示的N种密钥协商算法的优先级从低到排列高。例如,如表2所示,第一信息用于指示算法1、算法2、算法3、算法4、算法5,其中,算法4的优先级高于算法2,算法2的优先级高于算法5,算法5的优先级高于算法1,算法1的优先级高于算法3。
表2
算法的优先级 算法 算法的标识
优先级1 算法4 ID4
优先级2 算法2 ID2
优先级3 算法5 ID5
优先级4 算法1 ID1
优先级5 算法3 ID3
可选的,发送方设备通过广播的方式向接收方设备发送协商报文,从而不需要额外的报文交互,提高了密钥协商效率。并且,通过广播的方式向接收方设备发送协商报文,可以实现多个接收方设备接收该协商报文,进一步减少了报文的交互。
需要说明的是,由于第一信息在发送过程中可能会受到第三方设备的截获,第三方设备对第一信息进行篡改,将篡改后的第一信息发送给接收方设备。因此,接收方设备接收到的第一信息指示的发送方设备支持的密钥协商算法与发送方设备发送的第一信息中指示的发送方设备支持的密钥协商算法之间可能存在差异。因此,接收方设备接收到的第一信息指示的发送方设备支持的密钥协商算法为K种密钥协商算法,其中,K为大于或等于0的整数。
可以理解的是,接收方设备接收到的第一信息指示的发送方设备支持的K种密钥协商算法与发送方设备发送的第一信息中指示的发送方设备支持的N种密钥协商算法的关系至少包括:
第一种关系:K等于N,且接收方设备接收到的第一信息指示的发送方设备支持的K种密钥协商算法与发送方设备发送的第一信息中指示的发送方设备支持的N种密钥协商算法一一对应;
第二种关系:K等于N,但是,接收方设备接收到的第一信息指示的发送方设备支持的K种密钥协商算法与发送方设备发送的第一信息中指示的发送方设备支持的N种密钥协商算法不是一一对应的;
第三种关系:K不等于N。
其中,若K种密钥协商算法和N种密钥协商算法的关系为第一种关系,说明发送方方设备发送到的第一信息中指示的N种密钥协商算法没有被篡改;若K种密钥协商算法和N种密钥协商算法的关系为第二种关系或第三种关系,说明发送方方设备发送到的第一信息被篡改。
可选的,在S401之前,本申请所示的密钥协商算法还包括:接收来自接收方设备的第五信息,第五信息用于指示发送方设备发送第一信息;相应的,S401的一种可能的实现方式为:向接收方设备单播发送第一信息。具体的,接收方设备需要与发送方设备通信时,可以先向发送方设备发送信息,即第五信息,第五信息用来指示发送方设备向该接收方设备发送第一信息,这样,发送方设备收到第五信息后,向该接收方设备发送第一信息。其中,发送方设备通过单播的方式发送第一信息。
可选的,第五信息中携带一个指示标识,该指示标识例如可以是发送方设备和接收方设备预先协商的,当接收方设备需要指示发送方设备向该接收方设备发送第一信息时,第 五信息中包括该预先协商的指示标识,发送方设备接收到包括该指示标识的第五信息后,向接收方设备发送第一信息。
可选的,第五信息包括空的目标密钥协商的算法,例如,用于指示密钥协商算的比特为的标识为“null”,当接收方设备需要指示发送方设备向该接收方设备发送第一信息时,第五信息中包括空的目标密钥协商的算法,发送方设备接收到包括空的目标密钥协商的算法的第五信息后,向接收方设备发送第一信息。
S402、接收方设备确定目标密钥协商算法。
目标密钥协商算法为N种密钥协商算法中的、且接收方设备支持的密钥协商算法。
本实施例中,接收方设备从第一信息中的N种密钥协商算法中确定出自己支持的密钥协商算法作为目标协商算法。
可选的,接收方设备根据接收到的第一信息中指示的N种密钥协商算法的优先级信息,从N种密钥协商算法中确定接收方设备支持的、优先级最高的密钥协商算法,将其作为目标协商算法。需要说明的是,这里的优先级最高是按照所述发送方设备对密钥协商算法的优先级顺序确定的。
示例性的,表3示出了接收方设备支持的所有的密钥协商算法。其中,接收方设备接收到的第一信息指示了如表1所示的5种密钥协商算法,在第一信息中,5种算法的标识按照优先级从高到低的顺序排列。其中,在该5种密钥协商算法中,根据表1-表3可知,接收方设备支持算法2、算法3和算法5,且算法2的优先级高于算法3和算法5,因此,接收方设备选择算法2为目标协商算法。
表3
算法 算法的标识
算法2 ID2
算法3 ID3
算法5 ID5
算法6 ID6
可选的,接收方设备根据接收到的第一信息中指示的N种密钥协商算法,从N种密钥协商算法中确定出自己支持的、且对于自身来说优先级相对最高的密钥协商算法,将其作为目标协商算法。即在N种密钥协商算法中,对于接收方设备和发送方设备均支持的密钥协商算法,按照所述接收方设备对密钥协商算法的优先级顺序确定目标密钥协商算法。
示例性的,表4示出了接收方设备支持的密钥协商算法的优先级信息。如表3所示,接收方设备接收到的第一信息指示了如表1所示的5种密钥协商算法,在该5种密钥协商算法中,接收方设备支持算法2、算法3和算法5。根据表4可知,在接收方设备中,算法3的优先级高于算法2,算法2的优先级高于算法5,则接收方设备选择算法3作为目标协商算法。需要说明的是,在该实施例中,第一信息中指示的发送方设备支持的N种密钥协商算法可以不按照优先级排列,即第一信息不指示发送方设备支持的N种密钥协商算法的优先级信息。
表4
算法的优先级 算法 算法的标识
优先级1 算法3 ID3
优先级2 算法6 ID6
优先级3 算法2 ID2
优先级4 算法5 ID5
S403、接收方设备根据目标密钥协商算法,生成第一密钥协商参数。
第一密钥协商参数为对应于接收方设备的、基于目标密钥协商算法得到的密钥协商参数。
示例性的,接收方设备例如采用S304的方式,产生私钥,该私钥只有接收方设备知道,然后通过选择的密钥协商算法,生成对应接收方设备的公钥,将该公钥作为第一密钥协商参数,即密钥协商参数KE1。
其中,本申请对获得第一密钥协商参数的方式不做限定。
S404、接收方设备向发送方设备发送第二信息。相应的,发送方设备接收来自接收方设备的第二信息。
该第二信息指示目标密钥协商算法,并包括第一密钥协商参数。
可选的,第二信息中还携带第一随机数,其中,第一随机数NONCE1是接收方设备生成的随机数。
S405、发送方设备根据目标密钥协商算法与第一密钥协商参数,生成目标密钥。
本实施例中,由于在第二信息中携带目标密钥协商算法的标识,发送方设备通过目标密钥协商算法的标识确定接收方设备选择的密钥协商算法,发送方设备例如采用S305的方式,产生一个私钥,该私钥只有发送方设备知道,然后根据第一目标密钥协商算法计算得到对应发送方设备的公钥,将该公钥作为第二密钥协商参数,记为KE2。然后根据目标密钥协商算法和密钥协商参数KE1,生成目标密钥KE。
可选的,发送方设备通过第二信息确定目标密钥协商算法后,判断该目标密钥协商算法是否为第一信息所指示的N种密钥协商算法中的其中一种算法,若是,根据目标密钥协商算法获得目标密钥和/或密钥协商参数KE2;若否,发送方设备丢弃第二信息。
可选的,发送方设备根据目标密钥KE获得加密密钥和完整性保护密钥。其中,加密密钥用于对发送方设备和接收方设备之间传输的信息进行加密。完整性保护密钥用于对发送方设备和接收方设备之间传输的信息进行完整性保护。
其中,发送方设备加密密钥和完整性保护密钥的一种方式为:
发送方设备随机生成第二随机数NONCE2,发送方设备将目标密钥KE、随机数NONCE1和随机数NONCE2作为密钥派生函数(key derivation function,KDF)KDF1的输入,获得共享密钥Kgt,即Kgt=KDF1(KE,NONCE1,NONCE2)。
发送方设备将共享密钥Kgt作为KDF2的输入,得到加密密钥和完整性保护密钥,即Kenc=KDF2(Kgt);同理,Kint=KDF3(Kgt),其中,Kenc为加密密钥,Kint为完整性保护密钥。
另一种方式为:发送方设备在获得目标密钥KE后,将目标密钥KE作为KDF2的输入,得到加密密钥和完整性保护密钥,即Kenc=KDF2(KE);同理,Kint=KDF3 (KE),其中,Kenc为加密密钥,Kint为完整性保护密钥。
需要说明的是,KDF1、KDF2和KDF3可以相同,也可以不同。并且,本申请对获得共享密钥Kgt所采用的KDF、获得加密密钥Kenc所采用的KDF以及获得完整性保护密钥Kint所采用的KDF不进行限制。
可以理解,本申请实施例中示出的获得共享密钥Kgt、加密密钥Kenc、完整性保护密钥Kint的方式并不用于限制本申请,也可以选择其他方式获得。例如,Kenc=KDF2(Kgt,ID1),Kint=KDF3(Kgt,ID2),其中,ID1为加密算法的标识,ID2为完整性保护算法的标识。
可选的,所述方法还包括S406、发送方设备向接收方设备发送第三信息。相应的,接收方设备接收来自发送方设备的第三信息。
第三信息包括第二密钥协商参数,第二密钥协商参数为对应于发送方设备的、基于目标密钥协商算法的密钥协商参数。
具体的,第三信息中携带第二随机数NONCE2。
由于接收方设备发送给发送方设备的第二信息是没有进行安全保护的,因此,第二信息在发送过程中有可能被篡改,如果第二信息被篡改,会导致发送方设备和接收方设备的密钥协商失败,因此,需要验证第二信息是否被篡改。其中,验证第二信息是否被篡改的方式例如可以是:
发送方设备对第二信息进行认证处理,将第二信息作为参数,生成第一认证数据AUTH1,并将所述第一认证数据AUTH1发送给接收方设备,以使接收方设备验证第二信息是否被篡改。可选的,第三信息包括所述第一认证数据AUTH1。其中,获取AUTH1的方式包括:
方式一、认证数据AUTH1是发送方设备根据发送方设备接收到的第二信息、预设共享密钥PSK和KDF4得到的,即AUTH1=KDF4(PSK,第二信息)。其中,预设共享密钥PSK为预先在发送方设备和接收方设备之间共享的密钥,以根据该预设共享密钥PSK验证双方身份,避免发送方设备和接收方设备之间往来的信息被篡改。需要说明的是,本申请实施例对预先设置预设共享密钥PSK的方式不做限制。例如,可以是预先分别向发送方设备和接收方设备输入相同的数字获得的,或者在获得目标密钥KE后,采用相同的推演算法获得的。
相应的,接收方设备接收到第三信息后,获取认证数据AUTH1,将认证数据AUTH1与第一参照认证数据进行匹配。其中,第一参照认证数据是接收方设备根据发送的第二信息、预设共享密钥PSK和KDF4得到的,即第一参照认证数据=KDF4(PSK,第二信息),因此,如果第二信息在发送过程中没有被篡改,即发送方设备接收到的第二信息与接收方设备发出的第二信息一致,则认证数据AUTH1与参照认证数据匹配,否则不匹配。因此,根据认证数据AUTH1与第一参照认证数据匹配的结果,接收方设备可以判断出发送方设备接收到的第二信息是否与接收方设备发出的第二信息是否一致。如果认证数据AUTH1与参照认证数据匹配,则说明第二信息没有被篡改;否则,接收方设备丢弃该第三信息,断开该次与发送方设备的连接,然后可以重新发送第二信息。
方式二、认证数据AUTH1是发送方设备根据发送方设备接收到的第二信息、随机数NONCE2、预设共享密钥PSK和KDF5得到的,即AUTH1=KDF5(PSK,NONCE2,第 二信息)。相应的,第一参照认证数据是接收方设备根据发送的第二信息、接收到的第三信息中的随机数NONCE2、预设共享密钥PSK和KDF5得到的,即第一参照认证数据=KDF5(PSK,NONCE2,第二信息)。因此,如果第二信息在发送过程中没有被篡改,即发送方设备接收到的第二信息与接收方设备发出的第二信息一致,并且,第三信息中的随机数NONCE2也没被篡改,则则认证数据AUTH1与参照认证数据匹配,否则不匹配。因此,根据认证数据AUTH1与第一参照认证数据匹配的结果,接收方设备可以判断出发送方设备接收到的第二信息是否与接收方设备发出的第二信息是否一致。如果认证数据AUTH1与参照认证数据匹配,则说明第二信息和随机数NONCE2没有被篡改;否则,接收方设备丢弃该第三信息,断开该次与发送方设备的连接,然后可以重新发送第二信息。
本申请实施例还可以选择其他方式获得AUTH1,此处不再一一列举。
需要说明的是,本申请实施例不限制获得AUTH1和第一参照认证数据的KDF,只要获得AUTH1的KDF和第一参照认证数据的KDF相同,获得AUTH1的参数和第一参照认证数据的参数一一对应即可。例如,通过KDF4,以及发送方设备接收到的第二信息、预设共享密钥PSK获得AUTH1,相应的,通过KDF4,以及接收方设备根据发送的第二信息、预设共享密钥PSK获得第一参照认证数据。
可选的,第三信息为通过完整性保护算法处理后的信息。
示例性的,在执行S406之前,发送方设备获得加密密钥Kenc和完整性保护密钥Kint后,根据完整性保护算法、完整性保护密钥Kint和发送方设备发送的第三信息中的部分或全部信息得到第一消息认证码(message authentication code,MAC),并通过该第一MAC对第三信息进行完整性保护。示例性的,第三信息中包括第一MAC。
S407、接收方设备根据第二密钥协商参数和目标密钥协商算法,生成目标密钥。
本实施例中,接收方设备在接收到发送方设备的密钥协商参数后KE2,根据密钥协商算法和接收到的密钥协商参数KE2,获得目标密钥KE。
可选的,接收方设备采用和发送方设备相同的方法,根据目标密钥KE获得加密密钥Kenc和完整性保护密钥Kint。根据完整性保护算法、完整性保护密钥Kint和接收方设备接收到的第三信息中的部分或全部信息得到第二MAC。如果第一MAC和第二MAC一致,说明第三信息没有被篡改;否则,接收方设备丢弃第三信息,断开该次和发送方设备的连接,然后可以重新发送第二信息。
可选的,所述方法还包括S408、接收方设备向发送方设备发送第四信息。相应的,发送方设备接收第四信息。
其中,第四信息用于发送方设备判断密钥协商是否成功。
可选的,第四信息为经过加密密钥Kenc加密后的信息。接收方设备采用加密密钥Kenc对第四信息进行加密。发送方设备接收到第四信息后,采用加密密钥Kenc对加密后的第四信息进行解密,获第四信息。
可选的,第四信息中还包括第三认证数据。其中,获得第三认证数据AUTH3的方式包括:
方式一、接收方设备根据接收方设备接收到的第一信息中指示的K种密钥协商算法、接收到的第三信息、预设共享密钥PSK、随机数NONCE1和KDF6得到AUTH3,即AUTH3=KDF6(PSK,K种密钥协商算法,第三信息,NONCE1)。
方式二、接收方设备根据接收方设备接收到的第一信息中指示的K种密钥协商算法、接收到的第三信息、预设共享密钥PSK和KDF7得到AUTH3,即AUTH3=KDF7(PSK,K种密钥协商算法,第三信息)。
本申请实施例还可以选择其他方式获得AUTH1,此处不再一一列举。
可选的,第四信息是通过完整性保护算法处理后的信息。
接收方设备根据完整性保护算法、完整性保护密钥Kint和接收方设备发送的第四信息中的部分或全部信息得到第三消息认证码MAC,并通过该第三MAC对第四信息进行完整性保护。示例性的,第四信息中包括第三MAC。
可选的,所述方法还包括S409、发送方设备验证第四信息。
可选的,发送方设备根据完整性保护算法、完整性保护密钥Kint和发送方设备接收到的第四信息中的部分或全部信息得到第四消息认证码MAC,如果第三MAC和第四MAC一致,说明第四信息没有被篡改,执行后续操作;否则,接收方设备丢弃第四信息。其中,本申请实施例对后续操作的具体操作内容不进行限定。
可选的,第四信息中包括认证数据AUTH3,相应的,发送方设备获取认证数据AUTH3,将认证数据AUT3与第三参照认证数据进行匹配。
其中,获得第三参照认证数据的KDF和参数与获得AUTH3的方式对应。例如:
采用方式一获得AUTH3时,第三参照认证数据是发送方设备根据发送方设备发送的第一信息中指示的N种密钥协商算法、发送的第三信息、预设共享密钥PSK、随机数NONCE1和KDF6得到的,即第三参照认证数据=KDF6(PSK,发送的第一信息中指示的N种密钥协商算法,第三信息,NONCE1)。因此,如果第一信息和第三信息在发送过程中没有被篡改,即接收方设备接收到的第一信息、第三信息分别与发送方设备发出的第一信息、第三信息一致,则认证数据AUTH3与第三参照认证数据匹配;如果第一信息和/或第三信息在发送过程中被篡改,则认证数据AUTH3与第三参照认证数据不匹配。因此,根据认证数据AUTH3与第三参照认证数据匹配的结果,发送方设备可以判断出接收方设备接收到的第一信息是否与发送方设备发送的第一信息一致,以及接收方设备接收到的第三信息是否与发送方设备发送的第三信息一致。如果认证数据AUTH3与参照认证数据匹配,则说明第一信息和第三信息均没有被篡改,则发送方设备和接收方设备之间密钥协商成功;否则,丢弃第四信息,断开与接收方设备的连接。
采用方式二获得AUTH3时,第三参照认证数据是发送方设备根据发送方设备发送的第一信息中指示的N种密钥协商算法、发送的第三信息、预设共享密钥PSK和KDF6得到的,即第三参照认证数据=KDF7(PSK,发送的第一信息中指示的N种密钥协商算法,第三信息)。因此,如果第一信息和第三信息在发送过程中没有被篡改,即接收方设备接收到的第一信息、第三信息分别与发送方设备发出的第一信息、第三信息一致,则认证数据AUTH3与第三参照认证数据匹配;如果第一信息和/或第三信息在发送过程中被篡改,则认证数据AUTH3与第三参照认证数据不匹配。因此,根据认证数据AUTH3与第三参照认证数据匹配的结果,发送方设备可以判断出接收方设备接收到的第一信息是否与发送方设备发送的第一信息一致,以及接收方设备接收到的第三信息是否与发送方设备发送的第三信息一致。如果认证数据AUTH3与参照认证数据匹配,则说明第一信息和第三信息均没有被篡改,则发送方设备和接收方设备之间密钥协商成功;否则,丢弃第四信息,断 开与接收方设备的连接。
需要说明的是,本申请实施例不限制获得AUTH3和第三参照认证数据的KDF,只要获得AUTH3的KDF和第三参照认证数据的KDF相同,获得AUTH3的参数和第三参照认证数据的参数一一对应即可。例如,通过KDF6,以及接收方设备接收到的第一信息中指示的K种密钥协商算法、接收到的第三信息、预设共享密钥PSK、随机数NONCE1获得AUTH3,相应的,通过KDF6,以及发送方设备根据发送的第一信息中支指示的N种密钥协商算法、发送的第三信息、预设共享密钥PSK、随机数NONCE1获得第三参照认证数据。
本实施例,发送方设备和接收方设备进行密钥协商时,发送方设备通过第一信息将其支持的所有密钥协商算法通知给接收方设备,由接收方设备从接收到的发送方设备支持的密钥协商算法中选择自身支持的密钥协商算法。这样,接收方设备选择的密钥协商算法是发送方设备和接收方设备均支持的密钥协商算法,避免接收方设备选择的密钥协商算法发送方设备不支持而导致的密钥协商算法协商失败,提高了密钥协商的效率。并且,本申请实施例提供的密钥协商方法支持国密算法。
图5为本申请另一实施例提供的密钥协商方法的流程图。如图5所示,本申请实施例的密钥协商方法包括:
S501、发送方设备向接收方设备发送第一信息。相应的,接收方设备接收第一信息。
该第一信息用于指示N种密钥协商算法,N为大于等于1的整数,N种密钥协商算法为发送方设备支持的算法。
示例性的,第一信息承载于协商报文中。具体的,通信系统中的两个设备进行数据传输前,需要进行密钥协商,以获得目标密钥,从而根据目标密钥对传输的数据进行加密和解密。其中,发送方设备与接收方设备进行密钥协商时,由发起方设备发送协商报文至接收方设备。
可选的,第一信息还用于指示N种密钥协商算法的优先级信息;其中,第一信息包含的N种密钥协商算法的标识信息是按照N种密钥协商算法的优先级信息排列或者封装的。
示例性的,第一信息指示的N种密钥协商算法的优先级从高到低排列,或第一信息指示的N种密钥协商算法的优先级从低到排列高。例如,如表2所示,第一信息用于指示算法1、算法2、算法3、算法4、算法5,其中,算法4的优先级高于算法2,算法2的优先级高于算法5,算法5的优先级高于算法1,算法1的优先级高于算法3。
S502、接收方设备确定目标密钥协商算法。
目标密钥协商算法为N种密钥协商算法中的、且接收方设备支持的密钥协商算法。
本实施例中,接收方设备从第一信息中的N种密钥协商算法中确定出自己支持的密钥协商算法作为目标协商算法。
可选的,接收方设备根据接收到的第一信息中指示的N种密钥协商算法的优先级信息,从N种密钥协商算法中选择接收方设备支持的、且对于发送方设备来说优先级最高的密钥协商算法,将其作为目标协商算法。
示例性的,表3示出了接收方设备支持的所有的密钥协商算法。其中,接收方设备接收到的第一信息指示了如表1所示的5种密钥协商算法,在第一信息中,5种算法的标识按照优先级从高到低的顺序排列。其中,在该5种密钥协商算法中,根据表1-表3可知, 接收方设备支持算法2、算法3和算法5,且算法2的优先级高于算法3和算法5,因此,接收方设备选择算法2为目标协商算法。
可选的,接收方设备根据接收到的第一信息中指示的N种密钥协商算法,从N种密钥协商算法中确定出自己支持的、且对于自身来说优先级相对最高的密钥协商算法,将其作为目标协商算法。
示例性的,表4示出了接收方设备支持的密钥协商算法的优先级信息。如表3所示,接收方设备接收到的第一信息指示了如表1所示的5种密钥协商算法,在该5种密钥协商算法中,接收方设备支持算法2、算法3和算法5。根据表4可知,在接收方设备中,算法3的优先级高于算法2,算法2的优先级高于算法5,则接收方设备选择算法3作为目标协商算法。需要说明的是,在该实施例中,第一信息中指示的发送方设备支持的N种密钥协商算法可以不按照片优先级信息排列,即第一信息不指示发送方设备支持的N种密钥协商算法的优先级信息。
S503、接收方设备根据目标密钥协商算法,生成第一密钥协商参数。
第一密钥协商参数为对应于接收方设备的、基于目标密钥协商算法得到的密钥协商参数。
示例性的,接收方设备通过选择的密钥协商算法,计算得到密钥协商参数KE1。
S504、接收方设备向发送方设备发送第二信息。相应的,发送方设备接收来自接收方设备的第二信息。
该第二信息指示目标密钥协商算法,并包括第一密钥协商参数。进一步可选的,该第二信息还指示接收方设备支持的M种密钥协商算法。
本实施例中,第二信息中还指示接收方设备支持的M种密钥协商算法,以使发送方设备确定接收方设备选择的密钥协商算法是否为接收方设备和发送方设备均支持的密钥协商算法。当确定接收方设备选择的密钥协商算法是接收方设备和发送方设备均支持的密钥协商算法,则执行S505;否则,丢弃第二信息,断开与接收方设备的连接。
其中,第二信息可以通过下述方式中的任一种方式指示M种密钥协商算法:
方式一、第二信息包括接收方设备支持的M种密钥协商算法的标识,以使发送方设备获取接收方设备支持的M种密钥协商算法。
示例性的,以表1所示的算法的标识为例,当第二信息包括ID2、ID3和ID5时,第二信息用于指示算法2、算法3和算法5;当第二包括ID1和ID5时,第二信息用于指示算法1和算法5。
可以理解的,表1仅是第二信息指示的密钥协商算法标识的示例,在具体应用中,第二信息指示的密钥协商算法还可以是其他形式的,不予限制。
方式二、第二信息包括一个比特序列,该比特序列中的一个比特与一个算法对应,该比特序列中的每个比特可以通过0或1指示第二信息是否指示该比特对应的算法。例如,若该比特为1,可以表示第二信息指示该比特对应的算法,若该比特为0,可以表示第二信息不指示该比特对应的算法,反之亦然。
示例性的,以第一信息包括4比特,该4比特中的第1个比特与算法1对应,第2个比特和算法2对应,第3个比特和算法3对应,第4个比特和算法4对应为例,若该4比特为1001,可以表示第二信息用于指示算法1和算法4;若该5比特为1100,可以表示第 一算法协商请求信息用于指示算法1和算法2。
可选的,发送方设备根据接收到的第二信息中指示的接收方设备支持的M种密钥协商算法,确定接收方设备支持的密钥协商算法的优先级,从而确定接收方设备选择的密钥协商算法是否为接收方设备和发送方设备均支持的算法中发送方设备或接收方设备优先级最高的密钥协商算法。若是,则执行S505;否则,丢弃第二信息,断开与接收方设备的连接。
例如,接收方设备支持的密钥协商算法包括算法2、算法3、算法5和算法6。其中,如上述表4所示,对于接收方设备来说,算法3的优先级高于算法6,算法6的优先级高于算法2,算法2的优先级高于算法5。
结合表2和表4可知,若接收方设备选择接收方设备和发送方设备均支持的算法中发送方设备优先级最高的密钥协商算法为目标协商算法,则发送方设备通过第二信息获得的目标协商算法应该是算法2。若发送方设备通过第二信息获得的目标协商算法不是算法2,则丢弃第二信息。
若接收方设备选择接收方设备和发送方设备均支持的算法中接收方设备优先级最高的密钥协商算法为目标协商算法,则发送方设备通过第二信息获得的目标协商算法应该是算法3。若发送方设备通过第二信息获得的目标协商算法不是算法3,则丢弃第二信息。
其中,示例性的,发送方设备确定接收方设备支持的密钥协商算法的优先级的方式包括:
方式1:发送方设备接收来自接收方设备的M种密钥协商算法的优先级信息。例如,发送方设备与接收方设备之间进行过密钥协商,在密钥协商时,接收方设备通过信息向发送设备指示接收方设备支持的密钥协商的算法的优先级,因此,发送方设备将该接收方设备支持的密钥协商算法的优先级与该接收方设备进行关联保存。因此,在该次密钥协商过程中,发送方设备根据接收方设备的标识,根据接收方设备的标识确定该接收方设备所支持的密钥协商算法的优先级。
方式2:第二信息还用于指示接收方设备支持的M种密钥协商算法的优先级信息;第二信息包含M种密钥协商算法的标识信息,标识信息是按照M种密钥协商算法的优先级排列或者封装的,因此,发送方设备根据第二信息获取接收方设备支持的密钥支持的密钥协商算法的优先级信息。
可选的,第二信息中还携带第一随机数,其中,第一随机数NONCE1是接收方设备生成的随机数。
可选的,第二信息中还携带接收方设备的标识。其中,接收方设备的标识用于标识该接收方设备。
S505、发送方设备根据目标密钥协商算法与第一密钥协商参数,生成目标密钥。
本实施例中,由于在第二信息中携带目标密钥协商算法的标识,因此,发送方设备通过目标密钥协商算法的标识确定接收方设备选择的密钥协商算法,从而根据目标密钥协商算法和密钥协商参数KE1,生成目标密钥KE。并且,发送方设备根据目标密钥协商算法计算得密钥协商参数KE2。
可选的,发送方设备通过第二信息确定目标密钥协商算法后,判断该目标密钥协商算法是否为第一信息所指示的N种密钥协商算法中的其中一种算法,若是,根据目标密钥协 商算法获得目标密钥和/或密钥协商参数KE2;若否,发送方设备丢弃第二信息。
可选的,发送方设备根据目标密钥KE获得加密密钥和完整性保护密钥。其中,加密密钥用于对发送方设备和接收方设备之间传输的信息进行加密。完整性保护密钥用于对发送方设备和接收方设备之间传输的信息进行完整性保护。
其中,发送方设备加密密钥和完整性保护密钥的一种方式为:
发送方设备随机生成第二随机数NONCE2,发送方设备将目标密钥KE、随机数NONCE1和随机数NONCE2作为密钥派生函数(key derivation function,KDF)KDF1的输入,获得共享密钥Kgt,即Kgt=KDF1(KE,NONCE1,NONCE2)。
发送方设备将共享密钥Kgt作为KDF2的输入,得到加密密钥和完整性保护密钥,即Kenc=KDF2(Kgt);同理,Kint=KDF3(Kgt),其中,Kenc为加密密钥,Kint为完整性保护密钥。
另一种方式为:发送方设备在获得目标密钥KE后,将目标密钥KE作为KDF2的输入,得到加密密钥和完整性保护密钥,即Kenc=KDF2(KE);同理,Kint=KDF3(KE),其中,Kenc为加密密钥,Kint为完整性保护密钥。
需要说明的是,KDF1、KDF2和KDF3可以相同,也可以不同。并且,本申请对获得共享密钥Kgt所采用的KDF、获得加密密钥Kenc所采用的KDF以及获得完整性保护密钥Kint所采用的KDF不进行限制。
可以理解,本申请实施例中示出的获得共享密钥Kgt、加密密钥Kenc、完整性保护密钥Kint的方式并不用于限制本申请,也可以选择其他方式获得。例如,Kenc=KDF2(Kgt,ID1),Kint=KDF3(Kgt,ID2),其中,ID1为加密算法的标识,ID2为完整性保护算法的标识。
可选的,所述方法还包括S506、发送方设备向接收方设备发送第三信息。相应的,接收方设备接收来自发送方设备的第三信息。
第三信息包括第二密钥协商参数,第二密钥协商参数为对应于发送方设备的、基于目标密钥协商算法的密钥协商参数。
具体的,第三信息中携带第二随机数NONCE2。
可选的,由于接收方设备发送给发送方设备的第二信息是没有进行安全保护的,因此,第二信息在发送过程中有可能被篡改,如果第二信息被篡改,会导致发送方设备和接收方设备的密钥协商失败,因此,需要验证第二信息是否被篡改。其中,验证第二信息是否被篡改的方式例如可以是:
发送方设备对第二信息进行认证处理,将第二信息作为参数,生成第一认证数据AUTH1,并将认证数据AUTH1发送给接收方设备,以使接收方设备验证第二信息是否被篡改。可选的,第三信息包括认证数据AUTH1。其中,获取AUTH1的方式包括:
方式一、认证数据AUTH1是发送方设备根据发送方设备接收到的第二信息、预设共享密钥PSK和KDF4得到的,即AUTH1=KDF4(PSK,第二信息)。其中,预设共享密钥PSK为预先在发送方设备和接收方设备之间共享的密钥,以根据该预设共享密钥PSK验证双方身份,避免发送方设备和接收方设备之间往来的信息被篡改。需要说明的是,本申请实施例对预先设置预设共享密钥PSK的方式不做限制。例如,可以是预先分别向发送方设备和接收方设备输入相同的数字获得的,或者在获得目标密钥KE后,采用相同的推 演算法获得的。
相应的,接收方设备接收到第三信息后,获取认证数据AUTH1,将认证数据AUTH1与第一参照认证数据进行匹配。其中,第一参照认证数据是接收方设备根据发送的第二信息、预设共享密钥PSK和KDF4得到的,即第一参照认证数据=KDF4(PSK,第二信息),因此,如果第二信息在发送过程中没有被篡改,即发送方设备接收到的第二信息与接收方设备发出的第二信息一致,则认证数据AUTH1与参照认证数据匹配,否则不匹配。因此,根据认证数据AUTH1与第一参照认证数据匹配的结果,接收方设备可以判断出发送方设备接收到的第二信息是否与接收方设备发出的第二信息是否一致。如果认证数据AUTH1与参照认证数据匹配,则说明第二信息没有被篡改;否则,接收方设备丢弃该第三信息,断开该次与发送方设备的连接,然后可以重新发送第二信息。
方式二、认证数据AUTH1是发送方设备根据发送方设备接收到的第二信息、随机数NONCE2、预设共享密钥PSK和KDF5得到的,即AUTH1=KDF5(PSK,NONCE2,第二信息)。相应的,第一参照认证数据是接收方设备根据发送的第二信息、接收到的第三信息中的随机数NONCE2、预设共享密钥PSK和KDF5得到的,即第一参照认证数据=KDF5(PSK,NONCE2,第二信息)。因此,如果第二信息在发送过程中没有被篡改,即发送方设备接收到的第二信息与接收方设备发出的第二信息一致,并且,第三信息中的随机数NONCE2也没被篡改,则则认证数据AUTH1与参照认证数据匹配,否则不匹配。因此,根据认证数据AUTH1与第一参照认证数据匹配的结果,接收方设备可以判断出发送方设备接收到的第二信息是否与接收方设备发出的第二信息是否一致。如果认证数据AUTH1与参照认证数据匹配,则说明第二信息和随机数NONCE2没有被篡改;否则,接收方设备丢弃该第三信息,断开该次与发送方设备的连接,然后可以重新发送第二信息。
本申请实施例还可以选择其他方式获得AUTH1,此处不再一一列举。
需要说明的是,本申请实施例不限制获得AUTH1和第一参照认证数据的KDF,只要获得AUTH1的KDF和第一参照认证数据的KDF相同,获得AUTH1的参数和第一参照认证数据的参数一一对应即可。例如,通过KDF4,以及发送方设备接收到的第二信息、预设共享密钥PSK获得AUTH1,相应的,通过KDF4,以及接收方设备根据发送的第二信息、预设共享密钥PSK获得第一参照认证数据。
可选的,第三信息为通过完整性保护算法处理后的信息。
示例性的,在执行S406之前,发送方设备获得加密密钥Kenc和完整性保护密钥Kint后,根据完整性保护算法、完整性保护密钥Kint和发送方设备发送的第三信息中的部分或全部信息得到第一消息认证码(message authentication code,MAC),并通过该第一MAC对第三信息进行完整性保护。示例性的,第三信息中包括第一MAC。
S507、接收方设备根据第二密钥协商参数和目标密钥协商算法,生成目标密钥。
本实施例中,接收方设备在接收到发送方设备的密钥协商参数后KE2,根据密钥协商算法和接收到的密钥协商参数KE2,获得目标密钥KE。
可选的,接收方设备采用和发送方设备相同的方法,根据目标密钥KE获得加密密钥Kenc和完整性保护密钥Kint。根据完整性保护算法、完整性保护密钥Kint和接收方设备接收到的第三信息中的部分或全部信息得到第二消息认证码MAC。如果第一MAC和第二MAC一致,说明第三信息没有被篡改;否则,接收方设备丢弃第三信息,断开该次和发 送方设备的连接,然后可以重新发送第二信息。
可选的,所述方法还包括S508、接收方设备向发送方设备发送第四信息。相应的,发送方设备接收第四信息。
可选的,所述方法还包括S509、发送方设备验证第四信息。
本实施例中,第四信息中还包括第二认证数据AUTH2,第二认证数据AUTH2是接收方设备对第三信息进行认证处理获得的认证数据;第二认证数据AUTH2用于指示第三信息是否被篡改,第三信息是否被篡改是通过第二认证数据AUTH2与第二参照认证数据的匹配结果指示的,第二参照认证数据为对第三信息进行认证处理后获得的认证数据。
这是因为通过在第二信息中指示了接收方设备支持的所有的密钥协商算法,如果执行S508,说明第一信息和第二信息在发送过程中没有被篡改,因此,无需确认第一信息是否被篡改。
而发送方设备向接收方设备发送第三信息,以使接收方设备获得目标密钥。但是,由于接收方设备没有生成目标密钥,因此,也就无法生成加密密钥,因此,发送方设备无法对第三信息加密,即第三信息是没有进行安全保护的信息,使得在传输过程中有被篡改的可能性,如果第三信息被篡改,发送方设备和接收方设备之间通信的信息有泄露的可能,因此,需要确定第三信息是否被篡改。因此,接收方设备对第三信息进行认证处理,获得第二认证数据AUTH2。又由于第三信息是发送方设备发出的,因此,将认证数据AUTH2包括在第四信息中,发送给发送方设备,由发送方设备确认第三信息是否被篡改。示例性的,AUTH2是接收方设备根据接收到的第三信息、预设共享密钥PSK、随机数NONCE1和KDF6得到的,即AUTH2=KDF8(PSK,第三信息,NONCE1)。
发送方设备从第四信息中获取到AUTH2,将认证数据AUTH2与第二参照认证数据进行匹配,其中,第二参照认证数据是发送方设备根据发送方设备发送的第三信息、预设共享密钥PSK、随机数NONCE1和KDF8得到的,即第三参照认证数据=KDF8(PSK,第三信息,NONCE1)。因此,如果第三信息在发送过程中没有被篡改,即接收方设备接收到的第三信息与发送方设备发出的第三信息一致,则认证数据AUTH2与第二参照认证数据匹配;如果第三信息在发送过程中被篡改,则认证数据AUTH2与第二参照认证数据不匹配。因此,根据认证数据AUTH2与第二参照认证数据匹配的结果,发送方设备可以判断出接收方设备接收到的第三信息是否与发送方设备发送的第三信息一致。如果认证数据AUTH2与参照认证数据匹配,则说明第三信息均没有被篡改,则发送方设备和接收方设备之间密钥协商成功;否则,丢弃第四信息,断开与接收方设备的连接。
图6为本申请另一实施例提供的密钥协商方法的流程图。如图6所示,本申请实施例的密钥协商方法包括:
S601、发送方设备向接收方设备发送第一信息。相应的,接收方设备接收第一信息。
该第一信息用于指示N种密钥协商算法,N为大于等于1的整数,N种密钥协商算法为发送方设备支持的算法。
示例性的,第一信息承载于协商报文中。具体的,通信系统中的两个设备进行数据传输前,需要进行密钥协商,以获得目标密钥,从而根据目标密钥对传输的数据进行加密和解密。其中,发送方设备与接收方设备进行密钥协商时,由发起方设备发送协商报文至接收方设备。
可选的,第一信息还用于指示N种密钥协商算法的优先级信息;其中,第一信息包含的N种密钥协商算法的标识信息是按照N种密钥协商算法的优先级信息排列或者封装的。
示例性的,第一信息指示的N种密钥协商算法的优先级从高到低排列,或第一信息指示的N种密钥协商算法的优先级从低到排列高。例如,如表2所示,第一信息用于指示算法1、算法2、算法3、算法4、算法5,其中,算法4的优先级高于算法2,算法2的优先级高于算法5,算法5的优先级高于算法1,算法1的优先级高于算法3。
S602、接收方设备确定目标密钥协商算法。
目标密钥协商算法为N种密钥协商算法中的、且接收方设备支持的密钥协商算法。
本实施例中,接收方设备从第一信息中的N种密钥协商算法中确定出自己支持的密钥协商算法作为目标协商算法。
可选的,接收方设备根据接收到的第一信息中指示的N种密钥协商算法的优先级信息,从N种密钥协商算法中选择接收方设备支持的、且对于发送方设备来说优先级相对最高的密钥协商算法,将其作为目标协商算法。
示例性的,表3示出了接收方设备支持的所有的密钥协商算法。其中,接收方设备接收到的第一信息指示了如表1所示的5种密钥协商算法,在第一信息中,5种算法的标识按照优先级从高到低的顺序排列。其中,在该5种密钥协商算法中,根据表1-表3可知,接收方设备支持算法2、算法3和算法5,且算法2的优先级高于算法3和算法5,因此,接收方设备选择算法2为目标协商算法。
可选的,接收方设备根据接收到的第一信息中指示的N种密钥协商算法,从N种密钥协商算法中确定出自己支持的、且对于自身来说优先级相对最高的密钥协商算法,将其作为目标协商算法。
示例性的,表4示出了接收方设备支持的密钥协商算法的优先级信息。如表3所示,接收方设备接收到的第一信息指示了如表1所示的5种密钥协商算法,在该5种密钥协商算法中,接收方设备支持算法2、算法3和算法5。根据表4可知,在接收方设备中,算法3的优先级高于算法2,算法2的优先级高于算法5,则接收方设备选择算法3作为目标协商算法。需要说明的是,在该实施例中,第一信息中指示的发送方设备支持的N种密钥协商算法可以不按照片优先级信息排列,即第一信息不指示发送方设备支持的N种密钥协商算法的优先级信息。
S603、接收方设备根据目标密钥协商算法,生成第一密钥协商参数。
第一密钥协商参数为对应于接收方设备的、基于目标密钥协商算法得到的密钥协商参数。
示例性的,接收方设备通过选择的密钥协商算法,计算得到密钥协商参数KE1。
S604、接收方设备向发送方设备发送第二信息。相应的,发送方设备接收来自接收方设备的第二信息。
该第二信息指示目标密钥协商算法,并包括第一密钥协商参数。
可选的,第二信息中还携带第一随机数,其中,第一随机数NONCE1是接收方设备生成的随机数。
可选的,第二信息中还携带接收方设备的标识。其中,接收方设备的标识用于标识该接收方设备。
S605、发送方设备根据目标密钥协商算法与第一密钥协商参数,生成目标密钥。
本实施例中,由于在第二信息中携带目标密钥协商算法的标识,因此,发送方设备通过目标密钥协商算法的标识确定接收方设备选择的密钥协商算法,从而根据目标密钥协商算法和密钥协商参数KE1,生成目标密钥KE。并且,发送方设备根据目标密钥协商算法计算得到第二密钥协商参数,记为KE2。
可选的,发送方设备通过第二信息确定目标密钥协商算法后,判断该目标密钥协商算法是否为第一信息所指示的N种密钥协商算法中的其中一种算法,若是,根据目标密钥协商算法获得目标密钥和/或密钥协商参数KE2;若否,发送方设备丢弃第二信息。
可选的,发送方设备根据目标密钥KE获得加密密钥和完整性保护密钥。其中,加密密钥用于对发送方设备和接收方设备之间传输的信息进行加密。完整性保护密钥用于对发送方设备和接收方设备之间传输的信息进行完整性保护。
其中,发送方设备加密密钥和完整性保护密钥的一种方式为:
发送方设备随机生成第二随机数NONCE2,发送方设备将目标密钥KE、随机数NONCE1和随机数NONCE2作为密钥派生函数(key derivation function,KDF)KDF1的输入,获得共享密钥Kgt,即Kgt=KDF1(KE,NONCE1,NONCE2)。
发送方设备将共享密钥Kgt作为KDF2的输入,得到加密密钥和完整性保护密钥,即Kenc=KDF2(Kgt);同理,Kint=KDF3(Kgt),其中,Kenc为加密密钥,Kint为完整性保护密钥。
另一种方式为:发送方设备在获得目标密钥KE后,将目标密钥KE作为KDF2的输入,得到加密密钥和完整性保护密钥,即Kenc=KDF2(KE);同理,Kint=KDF3(KE),其中,Kenc为加密密钥,Kint为完整性保护密钥。
需要说明的是,KDF1、KDF2和KDF3可以相同,也可以不同。并且,本申请对获得共享密钥Kgt所采用的KDF、获得加密密钥Kenc所采用的KDF以及获得完整性保护密钥Kint所采用的KDF不进行限制。
可以理解,本申请实施例中示出的获得共享密钥Kgt、加密密钥Kenc、完整性保护密钥Kint的方式并不用于限制本申请,也可以选择其他方式获得。例如,Kenc=KDF2(Kgt,ID1),Kint=KDF3(Kgt,ID2),其中,ID1为加密算法的标识,ID2为完整性保护算法的标识。
可选的,所述方法还包括S606、发送方设备向接收方设备发送第三信息。相应的,接收方设备接收来自发送方设备的第三信息。
第三信息包括第二密钥协商参数,第二密钥协商参数为对应于发送方设备的、基于目标密钥协商算法的密钥协商参数,第三信息还用于指示发送方设备支持的N种密钥协商算法,由接收方设备判断第一信息是否被篡改。
其中,第三信息再次指示发送方设备支持的N种密钥协商算法。由于对第三信息进行了完整性保护,因此,接收方设备通过第一MAC和第二MAC的比较结果可以判断出第三信息是否被篡改。在第三信息没有用被篡改的情况下,如果第三信息指示的发送方设备支持的N种密钥协商算法和从第一信息中获取到的发送方设备支持的N种密钥协商算法一致,说明第一信息没有被篡改;否则,说明第一信息被篡改,丢弃第三信息,断开与发送方设备的连接。
S607、接收方设备根据第二密钥协商参数和目标密钥协商算法,生成目标密钥。
本实施例中,接收方设备在接收到发送方设备的密钥协商参数后KE2,根据密钥协商算法和接收到的密钥协商参数KE2,获得目标密钥KE。
可选的,接收方设备采用和发送方设备相同的方法,根据目标密钥KE获得加密密钥Kenc和完整性保护密钥Kint。根据完整性保护算法、完整性保护密钥Kint和接收方设备接收到的第三信息中的部分或全部信息得到第二消息认证码MAC。如果第一MAC和第二MAC一致,说明第三信息没有被篡改;否则,接收方设备丢弃第三信息,断开该次和发送方设备的连接,然后可以重新发送第二信息。
可选的,所述方法还包括S608、接收方设备向发送方设备发送第四信息。相应的,发送方设备接收第四信息。
可选的,所述方法还包括S609、发送方设备验证第四信息。
本实施例中,第四信息中还包括第二认证数据AUTH2,第二认证数据是接收方设备对第三信息进行认证处理获得的认证数据;第二认证数据用于指示第三信息是否被篡改,第三信息是否被篡改是通过第二认证数据与第二参照认证数据的匹配结果指示的,第二参照认证数据为对第三信息进行认证处理后获得的认证数据。
发送方设备向接收方设备发送第三信息,以使接收方设备获得目标密钥。但是,由于接收方设备没有生成目标密钥,因此,也就无法生成加密密钥,因此,发送方设备无法对第三信息加密,即第三信息是没有进行安全保护的信息,使得在传输过程中有被篡改的可能性,如果第三信息被篡改,发送方设备和接收方设备之间通信的信息有泄露的可能,因此,需要确定第三信息是否被篡改。因此,接收方设备对第三信息进行认证处理,获得第二认证数据AUTH2,将认证数据AUTH2包括在第四信息中,发送给发送方设备。由于第三信息是发送方设备发出的,因此,由发送方设备确认第三信息是否被篡改。示例性的,AUTH2是接收方设备根据接收到的第三信息、预设共享密钥PSK、随机数NONCE1和KDF6得到的,即AUTH2=KDF6(PSK,第三信息,NONCE1)。
发送方设备从第四信息中获取到AUTH2,将认证数据AUTH2与第二参照认证数据进行匹配,其中,第二参照认证数据是发送方设备根据发送方设备发送的第三信息、预设共享密钥PSK、随机数NONCE1和KDF5得到的,即第三参照认证数据=KDF6(PSK,第三信息,NONCE1)。因此,如果第三信息在发送过程中没有被篡改,即接收方设备接收到的第三信息与发送方设备发出的第三信息一致,则认证数据AUTH2与第二参照认证数据匹配;如果第三信息在发送过程中被篡改,则认证数据AUTH2与第二参照认证数据不匹配。因此,根据认证数据AUTH2与第二参照认证数据匹配的结果,发送方设备可以判断出接收方设备接收到的第三信息是否与发送方设备发送的第三信息一致。如果认证数据AUTH2与参照认证数据匹配,则说明第三信息均没有被篡改,则发送方设备和接收方设备之间密钥协商成功;否则,断开与接收方设备的连接。
图7为本申请另一实施例提供的密钥协商方法的流程图。如图7所示,本申请实施例的密钥协商方法包括:
S701、第六信息。相应的,接收方设备接收第六信息。
本实施例中,第六信息与第一信息相比,第六信息不指示发送方设备支持的N种密钥协商算法,因此,接收方设备接收到第六信息后,也无法获知发送方设备支持的密钥协商 算法。
S702、接收方设备确定第一目标密钥协商算法。
第一目标密钥协商算法为接收方设备从M种密钥协商算法中确定的密钥协商算法。
本实施例中,由于接收方设备没有获知发送方设备支持的密钥协商算法,因此,接收方设备根据自己支持的M种密钥协商算法中确定第一目标密钥协商算法。
S703、接收方设备根据第一目标密钥协商算法,生成第一密钥协商参数。
本实施例中,接收方设备产生一个私钥,该私钥只有接收方设备知道,通过选择的密钥协商算法,生成公钥,该公钥为密钥协商参数KE1。
S704、接收方设备向发送方设备发送第二信息。相应的,发送方设备接收来自接收方设备的第二信息。
其中,第二信息用于指示接收方设备支持的M种密钥协商算法、第一目标密钥协商参数和第一密钥协商参数。
S705、发送方设备判断是否根据第一目标密钥协商算法进行目标密钥的协商,若是,执行S706;若否,执行S710。
本实施例中,由于接收方设备在选择第一目标密钥协商算法时,并不知道发送方设备支持的密钥协商算法,因此,第一目标密钥协商算法可能不是发送方设备支持的密钥协商算法。因此,发送方设备接收到第二消息后,确认第一目标密钥协商算法是否为其支持的密钥协商算法,若是,则执行S706,否则,执行S710。
可选的,发送方设备还可以判断第一目标密钥协商是否为发送方设备支持的、接收方设备也支持的算法中,对应发送方设备的优先级最高的密钥协商算法,若是,则执行S706,否则,执行S710。
可选的,第二信息中还指示接收方设备支持的M种密钥协商算法中的密钥协商算法的优先级信息,因此,发送方设备根据第二信息可以获知接收方设备支持的M种密钥协商算法中的密钥协商算法的优先级信息。因此,发送方设备还可以判断第一目标密钥协商是否为发送方设备支持的、接收方设备也支持的算法中,对应接收方设备的优先级最高的密钥协商算法,若是,则执行S706,否则,执行S710。
S706、发送方设备根据第一目标密钥协商算法与第一密钥协商参数,生成目标密钥。
本实施例中,发送方设备根据第一目标密钥协商算法和密钥协商参数KE1,生成目标密钥KE。并且,发送方设备产生一个私钥,该私钥只有发送方设备知道,然后根据第一目标密钥协商算法计算得到相应的公钥,即第二密钥协商参数,记为KE2。
S707、发送方设备向接收方设备发送第三信息。相应的,接收方设备接收来自发送方设备的第三信息。
第三信息中包括第二密钥协商参数。
S708、接收方设备根据第二密钥协商参数和第一目标密钥协商算法,生成目标密钥。
本实施例中,第三信息中包括密钥协商参数KE2,接收方设备收到第三信息后,根据密钥协商参数KE2和第一目标密钥协商算法,生成目标密钥KE。
S709、接收方设备向发送方设备发送第四信息。相应的,发送方设备接收第四信息。
其中,第四信息用于使发送方设备判断密钥协商是否成功。
S710、发送方设备确定第二目标密钥协商算法。
其中,第二目标密钥协商算法为发送方设备从N种密钥协商算法和M种密钥协商算法中确定的发送方设备和接收方设备均支持的密钥协商算法。
本实施例中,发送方设备已知接收方设备支持的M种密钥协商算法,因此,发送方设备从自身支持的N种密钥协商算法和接收方支持的M种密钥协商算法中选择一个发送方设备和接收方设备均支持的密钥协商算法作为第二目标密钥协商算法。
可选的,发送方设备还可以从自身支持的N种密钥协商算法和接收方支持的M种密钥协商算法中选择一个发送方设备和接收方设备均支持的、且对应发送方设备优先级最高的密钥协商算法作为第二目标密钥协商算法。
可选的,第二信息还指示接收方设备支持的M种密钥协商算法中的密钥协商算法的优先级信息,因此,
可选的,发送方设备还可以从自身支持的N种密钥协商算法和接收方支持的M种密钥协商算法中选择一个发送方设备和接收方设备均支持的、且对应发送方设备优先级最高的密钥协商算法作为第二目标密钥协商算法。
可选的,第二信息还指示接收方设备支持的M种密钥协商算法中的密钥协商算法的优先级信息,因此,发送方设备还可以从自身支持的N种密钥协商算法和接收方支持的M种密钥协商算法中选择一个发送方设备和接收方设备均支持的、且对应接收方设备优先级最高的密钥协商算法作为第二目标密钥协商算法。
S711、发送方设备向接收方设备发送第七信息。
第七信息用于指示发送方设备选择的第二目标密钥协商算法。
示例性的,发送方设备通过第七信息将第二目标密钥协商算法发送给接收方设备。接收方设备接收到第七信息后,执行图4中S403-S408的步骤,只是目标密钥协商算法为第二目标密钥协商算法,即接收方设备根据第七信息获知第二目标密钥协商算法,然后生成一个私钥,该私钥只有接收方设备知道,通过第二密钥协商算法,生成公钥,该公钥为密钥协商参数KE1,接收方设备向发送方设备发送第二信息,其中,第二信息中包括密钥协商参数KE1。
发送方设备接收到第二信息后,获取密钥协商参数KE1,发送方设备生成一个私钥,该私钥只有发送方设备知道,发送方设备根据密钥协商参数KE1、对应发送方设备的私钥和第二目标密钥协商算法,获得目标密钥KE。并且,发送方设备根据生成的私钥,通过第二密钥协商算法,生成公钥,该公钥为密钥协商参数KE2,发送方设备向接收方设备发送第三信息,其中,第三信息中包括密钥协商参数KE2。
接收方设备接收到第三信息后,获取密钥协商参数KE2,接收方设备生成一个私钥,该私钥只有接收方设备知道,接收方设备根据密钥协商参数KE2、对应接收方设备的私钥和第二目标密钥协商算法,获得目标密钥KE。
可选的,第七信息用于指示发送方设备选择的第二目标密钥协商算法和第二密钥协商参数。发送方设备确定第二目标密钥协商算法后,生成一个私钥,该私钥只有发送方设备知道,通过第二目标密钥协商算法,生成密钥协商参数KE2,发送方设备将密钥协商参数KE2和第二目标密钥协商算法发送给接收方设备,以使接收方设备可以直接通过第七信息获知密钥协商参数KE2,从而不需要发送方设备再次发送一个信息来指示密钥协商参数KE2,减少了发送方设备和接收方设备之间的信息交互,提高了密钥协商效率。
接收方设备接收到第七信息后,可以获取到发送方设备的密钥协商参数KE2和第二目标密钥协商算法,接收方设备生成一个私钥,该私钥只有接收方设备知道,然后,根据第二目标密钥协商算法,生成密钥协商参数KE1。之后,接收方设备根据密钥协商参数KE2和第二目标密钥协商算法,生成目标密钥KE。然后,接收方设备向发送方设备发送第二信息,其中,该第二信息中包括密钥协商参数KE1。
可选的,第二信息中还包括接收方设备随机生成的第一随机数NONCE1。
可选的,该第二信息中还可以包括第四认证数据,该第四认证数据是接收方设备根据接收到的第七信息、预设共享密钥PSK和KDF9获得的,即第四参照认证数据=KDF9(PSK,接收方接收到的第七信息)。发送方设备接收到第二信息后,将第四认证数据与第四参考认证数据比较,其中,第四参考认证数据是发送方设备根据发送的第七信息、预设共享密钥PSK和KDF9获得的。因此,第四认证数据与第四参考认证数据匹配,说明第七信息在发送过程中没有被篡改;否则,丢弃第二信息,断开与接收方设备的连接。可选的,第二信息为进行完整性保护的信息。
其中,若第七信息在发送过程中没有被篡改,则发送方设备向接收方设备发送第三信息,该第三信息是经过加密保护和完整性保护的信息。其中,该第三信息中包括第五认证数据,其中,第五认证数据为发送方设备根据发送方设备接收到的S704中对应的第二信息、预设共享密钥PSK、发送方设备接收到的携带第四认证数据的第二信息和KDF10获得的,即第四参照认证数据=KDF9(PSK,发送方设备接收到的S704中对应的第二信息、发送方设备接收到的携带第四认证数据的第二信息)。发送方设备接收到该第三信息后,将第五认证数据与第五参考认证数据比较,其中,第五参考认证数据是接收方设备根据发送的S704中对应的第二信息、预设共享密钥PSK、发送的携带第四认证数据的第二信息和KDF10获得的。因此,第五认证数据与第五参考认证数据匹配,说明S704中对应的第二信息和携带第四认证数据的第二信息在发送过程中均没有被篡改;否则,丢弃该第三信息,断开与接收方设备的连接。
发送方设备接收到第二信息后,获取密钥协商参数KE1,根据密钥协商参数KE1和第二目标密钥协商算法,获得目标密钥KE。
可选的,第七信息中还包括发送方设备随机生成的第二随机数NONCE2。
可以理解的是,上述各个实施例中,由发送方设备实现的方法或者步骤,也可以由可用于接收方设备的部件实现,由接收方设备实现的方法或者步骤,也可以由可用于发送方设备的部件实现。
图8为本申请一实施例提供的一种密钥协商装置的结构示意图。如图8所示,本实施例所述的密钥协商装置800可以是前述方法实施例中提到的发送方设备或者接收方设备。密钥协商装置可用于实现上述方法实施例中描述的对应于发送方设备或者接收方设备的方法,具体参见上述方法实施例中的说明。
所述密钥协商装置800可以包括一个或多个处理器801,所述处理器801也可以称为处理单元,可以实现一定的控制或者处理功能。所述处理器801可以是通用处理器或者专用处理器等。例如可以是基带处理器、或中央处理器。基带处理器可以用于对通信协议以及通信数据进行处理,中央处理器可以用于对通信装置进行控制,执行软件程序,处理软件程序的数据。
在一种可选的设计中,处理器801也可以存有指令803或者数据(例如中间数据)。其中,所述指令803可以被所述处理器运行,使得所述密钥协商装置800执行上述方法实施例中描述的对应于发送方设备或者接收方设备的方法。
在又一种可能的设计中,密钥协商装置800可以包括电路,所述电路可以实现前述方法实施例中发送或接收或者通信的功能。
可选的,所述密钥协商装置800中可以包括一个或多个存储器802,其上可以存有指令804,所述指令可在所述处理器上被运行,使得所述密钥协商装置800执行上述方法实施例中描述的方法。
可选的,所述存储器中也可以是存储有数据。所述处理器和存储器可以单独设置,也可以集成在一起。
可选的,所述密钥协商装置800还可以包括收发器805和/或天线806。所述处理器801可以称为处理单元,对密钥协商装置(发送方设备或者接收方设备)进行控制。所述收发器805可以称为收发单元、收发机、收发电路、或者收发器等,用于实现密钥协商装置的收发功能。
在一个设计中,若该密钥协商装置800用于实现对应于上述各实施例中接收方设备的操作时。例如,可以由收发器805从发送方设备接收第一信息;由处理器801根据所述第一信息确定接收方设备与发送方设备进行密钥协商。
另一个设计中,若该密钥协商装置800用于实现对应于上述各实施例中发送方设备的操作时。例如可以由处理器801确定第一信息,所述第一信息指示发送方设备支持的密钥协商算法能力;由收发器805向所述接收方设备发送所述第一信息。
其中,上述收发器805与处理器801的具体实现过程可以参见上述各实施例的相关描述,此处不再赘述。
本申请中描述的处理器801和收发器805可实现在集成电路(integrated circuit,IC)、模拟IC、射频集成电路(radio frequency integrated circuit,RFIC)、混合信号IC、专用集成电路(application specific integrated circuit,ASIC)、印刷电路板(printed circuit board,PCB)、电子设备等上。该处理器和收发器也可以用各种1C工艺技术来制造,例如互补金属氧化物半导体(complementary metal oxide semiconductor,CMOS)、N型金属氧化物半导体(nMetal-oxide-semiconductor,NMOS)、P型金属氧化物半导体(positive channel metal oxide semiconductor,PMOS)、双极结型晶体管(Bipolar Junction Transistor,BJT)、双极CMOS(BiCMOS)、硅锗(SiGe)、砷化镓(GaAs)等。
虽然在以上的实施例描述中,密钥协商装置800以发送方设备或者接收方设备为例来描述,但本申请中描述的密钥协商装置的范围并不限于上述发送方设备或上述接收方设备,而且密钥协商装置的结构可以不受图8的限制。密钥协商装置800可以是独立的设备或者可以是较大设备的一部分。例如所述设备可以是:
(1)独立的集成电路IC,或芯片,或,芯片系统或子系统;
(2)具有一个或多个IC的集合,可选的,该IC集合也可以包括用于存储数据和/或指令的存储部件;
(3)ASIC,例如调制解调器(MSM);
(4)可嵌入在其他设备内的模块;
(5)接收机、终端、蜂窝电话、无线设备、手持机、移动单元,网络设备等等;
(6)其他等等。
图9为本申请另一实施例提供的密钥协商装置的结构示意图。该装置可以是发送方设备,也可以是发送方设备的部件(例如,集成电路,芯片等等),或者可以是其他通信模块,用于实现图4-图6所示方法实施例中对应于发送方设备的操作或者步骤。如图9所示,本实施提供的密钥协商装置包括:第一发送模块901、第一接收模块902和第一处理模块903。其中,
第一发送模块901,用于向接收方设备发送第一信息,第一信息用于指示N种密钥协商算法,N为大于等于1的整数,N种密钥协商算法为发送方设备支持的算法;
第一接收模块902,用于接收来自接收方设备的第二信息,第二信息用于指示目标密钥协商算法,并包括第一密钥协商参数,目标密钥协商算法为N种密钥协商算法中的且接收方设备支持的密钥协商算法,第一密钥协商参数为对应于接收方设备的、基于目标密钥协商算法得到的密钥协商参数;
第一处理模块903,用于根据目标密钥协商算法与第一密钥协商参数,生成目标密钥。
可选的,第一发送模块901还用于:
向接收方设备发送第三信息,第三信息包括第二密钥协商参数,第二密钥协商参数为对应于发送方设备的、基于目标密钥协商算法的密钥协商参数。
可选的,第一发送模块901向接收方设备发送第三信息时,具体用于:
向接收方设备发送通过完整性保护算法处理后的第三信息。
可选的,第一信息还用于指示N种密钥协商算法的优先级信息;
其中,第一信息包含N种密钥协商算法的标识信息,标识信息是按照N种密钥协商算法的优先级信息排列或者封装的。
可选的,第二信息还用于指示接收方设备支持的M种密钥协商算法,M为大于等于1的整数;
根据目标密钥协商算法与第一密钥协商参数,生成目标密钥,包括:
确定目标密钥协商算法是M种密钥协商算法中对应接收方设备的、优先级最高的密钥协商算法;
根据目标密钥协商算法与第一密钥协商参数,生成目标密钥。
可选的,第一接收模块902还用于:
接收来自接收方设备的M种密钥协商算法的优先级信息。
可选的,第二信息还用于指示接收方设备支持的M种密钥协商算法的优先级信息;
其中,第二信息包含M种密钥协商算法的标识信息,标识信息是按照M种密钥协商算法的优先级排列或者封装的。
可选的,第一发送模块901还用于:
向接收方设备发送第一认证数据,第一认证数据是发送方设备对第二信息进行认证处理获得的认证数据。
可选的,第一接收模块902还用于:
接收接收方设备发送的第四信息;
第一处理模块903还用于:
对第四信息进行验证;
其中,第四信息包括第二认证数据,第二认证数据是来自接收方设备的、对第三信息进行认证处理获得的数据。
可选的,第一接收模块902还用于:
接收接收方设备发送的第四信息;
第一处理模块903还用于:
对第四信息进行验证;
其中,第四信息包括第三认证数据,第三认证数据是来自接收方设备的、对第一信息中指示的N种密钥协商算法和第三信息进行认证处理获得的数据。
可选的,第四信息是通过完整性保护算法处理后的第四信息。
可选的,认证处理还包括根据预设共享密钥进行认证处理。
可选的,第三信息还指示发送方设备支持的N种密钥协商算法。
可选的,第一发送模块901向接收方设备发送第一信息时,具体用于:
向接收方设备广播发送第一信息。
具体地,本实施例提供的设备对应地可用于执行上述任一方法实施例的技术方案,其实现原理和技术效果类似,此处不再赘述。
图10为本申请另一实施例提供的密钥协商装置的结构示意图。该装置可以是接收方设备,也可以是接收方设备的部件(例如,集成电路,芯片等等),或者可以是其他通信模块,用于实现图4-图6所示方法实施例中对应于接收方设备的操作或者步骤。如图10所示,本实施提供的密钥协商装置包括:第二接收模块1001、第二处理模块1002和第二发送模块1003。其中,
第二接收模块1001,用于接收来自发送方设备的第一信息,第一信息中指示发送方设备支持的N种密钥协商算法,N为大于等于1的整数;
第二处理模块1002,用于确定目标密钥协商算法,并根据目标密钥协商算法,生成第一密钥协商参数,其中,目标密钥协商算法为N种密钥协商算法中的、且接收方设备支持的密钥协商算法;第一密钥协商参数为对应于接收方设备的、基于目标密钥协商算法得到的密钥协商参数;
第二发送模块1003,用于向发送方设备发送第二信息,第二信息指示目标密钥协商算法,并包括第一密钥协商参数;
第二接收模块1001,用于接收来自发送方设备的第三信息,第三信息指示第二密钥协商参数,第二密钥协商参数对应于发送方设备的、基于目标密钥协商算法得到的密钥协商参数;
第二处理模块1002,还用于根据第二密钥协商参数和目标密钥协商算法,生成目标密钥。
可选的,第三信息为通过完整性保护算法处理后的第三信息。
可选的,第一信息还用于指示N种密钥协商算法的优先级信息;其中,第一信息中包含N种密钥协商算法的标识信息,标识信息是按照N种密钥协商算法的优先级信息排列或者封装的;
第二处理模块1002确定目标密钥协商算法:
从N种密钥协商算法中确定对应于发送方设备的优先级最高的密钥协商算法作为目标密钥协商算法。
可选的,第二处理模块1002确定目标密钥协商算法时,具体用于:
从N种密钥协商算法中确定对应于接收方设备的优先级最高的密钥协商算法作为目标密钥协商算法。
可选的,第二信息还指示接收方设备支持的M种密钥协商算法的优先级信息;
其中,第二信息包含M种密钥协商算法的标识信息,标识信息是按照M种密钥协商算法的优先级信息排列或者封装的。
可选的,第二接收模块1001还用于:
接收来自发送方设备的第一认证数据;第一认证数据是发送方设备对第二信息进行认证处理获得的认证数据。
可选的,第二发送模块1003还用于:
向发送方设备发送第四信息,第四信息包括第二认证数据,第二认证数据是接收方设备对第三信息进行认证处理获得的认证数据。
可选的,第二发送模块1003还用于:
向发送方设备发送第四信息,第四信息包括第三认证数据,第三认证数据是接收方设备对第一信息中指示的N种密钥协商算法和第三信息进行认证处理获得的认证数据。
可选的,第二发送模块1003向发送方设备发送第四信息时,具体用于:
向发送方设备发送通过完整性保护算法处理后的第四信息。
可选的,认证处理还包括根据预设密钥进行认证处理。
可选的,第三信息还指示发送方设备支持的N种密钥协商算法。
具体地,本实施例提供的设备对应地可用于执行上述任一所示方法实施例的技术方案,其实现原理和技术效果类似,此处不再赘述。
图11为本申请一实施例提供的一种通信系统的结构示意图。如图11所示,本实施例所述的通信系统1100可以包括:发送方设备1101和接收方设备1102。
在另一种可能的实现方式中,发送方设备1101可以采用图8或图9所示装置实施例的结构,其对应地,可以执行上述任一方法实施例有关发送方设备的技术方案,其实现原理和技术效果类似,此处不再赘述。
在另一种可能的实现方式中,接收方设备1102可以采用图8或图10所示装置实施例的结构,其对应地,可以执行上述任一方法实施例有关接收方设备的技术方案,其实现原理和技术效果类似,此处不再赘述。
在另一种可能的实现方式中,发送方设备1101可以采用图8或图9所示装置实施例的结构,其对应地,可以执行上述任一方法实施例有关发送方设备的技术方案,其实现原理和技术效果类似,此处不再赘述。接收方设备1102可以采用图8或图10所示装置实施例的结构,其对应地,可以执行上述任一方法实施例有关接收方设备的技术方案,其实现原理和技术效果类似,此处不再赘述。
所述集成的模块如果以软件功能模块的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现 出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)或处理器(processor)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。
本申请实施例还提供了一种计算机可读存储介质,所述计算机可读存储介质中存储有计算机程序,当所述计算机程序在一个或多个处理器上运行时,执行图3-图7中任意一种实施例所述的方法。
本申请实施例还提供了一种芯片系统,所述芯片系统包括至少一个处理器,存储器和接口电路,所示接口电路用于为所述至少一个处理器提供信息输入和/或输出,所述至少一个存储器中存储有计算机程序,当所述计算机程序在一个或多个处理器上运行时,执行图3-图7中任意一种实施例所述的方法。
本申请实施例还提供一种智能座舱产品,所述智能座舱产品包括上述图8或者图10提供的密钥协商装置或上述图8或图9提供的密钥协商装置,所述密钥协商装置可以执行图3-图7中任意一种实施例中所述密钥协商装置所对应的发送方设备或者接收方设备所执行的方法。
本申请实施例还提供一种智能终端,所述智能终端包括上述图8或者图10提供的密钥协商装置或上述图8或图9提供的密钥协商装置,所述密钥协商装置可以执行图3-图7中任意一种实施例中所述密钥协商装置所对应的发送方设备或者接收方设备所执行的方法。进一步,所述智能终端可以为运输工具或者智能设备,含无人机、无人运输车、智能汽车或者机器人等。
本说明书中的各个实施例均采用递进的方式描述,各个实施例之间相同相似的部分互相参见即可,每个实施例重点说明的都是与其他实施例的不同之处。尤其,对于装置实施例而言,由于其基本相似于方法实施例,所以描述得比较简单,相关之处参见方法实施例的部分说明即可。以上所描述的装置实施例仅仅是示意性的,其中所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。本领域普通技术人员在不付出创造性劳动的情况下,即可以理解并实施。
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行所述计算机程序指令时,全部或部分地产生按照本申请实施例所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线(DSL))或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述 可用介质可以是磁性介质,(例如,软盘、硬盘、磁带)、光介质(例如,DVD)、或者半导体介质(例如固态硬盘Solid State Disk(SSD))等。
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。

Claims (33)

  1. 一种密钥协商方法,其特征在于,所述方法包括:
    发送第一信息,所述第一信息用于指示N种密钥协商算法,所述N为大于等于1的整数,所述N种密钥协商算法为发送方设备支持的算法;
    接收来自接收方设备的第二信息,所述第二信息用于指示目标密钥协商算法,并包括第一密钥协商参数,所述目标密钥协商算法为所述N种密钥协商算法中的且所述接收方设备支持的密钥协商算法,所述第一密钥协商参数为对应于所述接收方设备的、基于所述目标密钥协商算法得到的密钥协商参数;
    根据所述目标密钥协商算法与所述第一密钥协商参数,生成目标密钥。
  2. 根据权利要求1所述的方法,其特征在于,所述方法还包括:
    向所述接收方设备发送第三信息,所述第三信息包括第二密钥协商参数,所述第二密钥协商参数为对应于所述发送方设备的、基于所述目标密钥协商算法得到的密钥协商参数。
  3. 根据权利要求2所述的方法,其特征在于,所述向所述接收方设备发送第三信息,包括:
    向所述接收方设备发送通过完整性保护算法处理后的第三信息。
  4. 根据权利要求1-3任一项所述的方法,其特征在于,所述第一信息还用于指示所述N种密钥协商算法的优先级信息;
    其中,所述第一信息包含所述N种密钥协商算法的标识信息,所述标识信息是按照所述N种密钥协商算法的优先级信息排列或者封装的。
  5. 根据权利要求1-4任一项所述的方法,其特征在于,所述第二信息还用于指示所述接收方设备支持的M种密钥协商算法,M为大于等于1的整数。
  6. 根据权利要求1-5任一项所述的方法,其特征在于,所述根据所述目标密钥协商算法与所述第一密钥协商参数,生成目标密钥,包括:
    确定所述目标密钥协商算法是所述N种密钥协商算法中所述接收方设备支持的、优先级最高的密钥协商算法;
    根据所述目标密钥协商算法与所述第一密钥协商参数,生成所述目标密钥。
  7. 根据权利要求5或6所述的方法,其特征在于,所述方法还包括:
    接收来自所述接收方设备的所述M种密钥协商算法的优先级信息。
  8. 根据权利要求5或6所述的方法,其特征在于,所述第二信息还用于指示所述接收方设备支持的M种密钥协商算法的优先级信息;
    其中,所述第二信息包含所述M种密钥协商算法的标识信息,所述标识信息是按照所述M种密钥协商算法的优先级排列或者封装的。
  9. 根据权利要求2-6任一项所述的方法,其特征在于,所述第三信息中还包括第一认证数据,所述第一认证数据是所述发送方设备对所述第二信息进行认证处理获得的认证数据。
  10. 根据权利要求2-9任一项所述的方法,其特征在于,所述方法还包括:
    接收并验证来自所述接收方设备的第四信息;
    其中,所述第四信息包括第二认证数据,所述第二认证数据是对所述第三信息进行认 证处理获得的数据。
  11. 根据权利要求2-9任一项所述的方法,其特征在于,所述方法包括:
    接收并验证来自所述接收方设备发送的第四信息;
    其中,所述第四信息包括第三认证数据,所述第三认证数据是对所述第一信息中指示的所述N种密钥协商算法和所述第三信息进行认证处理获得的数据。
  12. 根据权利要求10或11所述的方法,其特征在于,所述第四信息是通过完整性保护算法处理后的信息。
  13. 根据权利要求9-12任一项所述的方法,其特征在于,所述认证处理还包括根据预设共享密钥进行认证处理。
  14. 根据权利要求2-13任一项所述的方法,其特征在于,所述第三信息还指示所述N种密钥协商算法。
  15. 根据权利要求1-14任一项所述的方法,其特征在于,所述发送第一信息,包括:
    向所述接收方设备广播发送所述第一信息。
  16. 根据权利要求1-14任一项所述的方法,其特征在于,所述发送第一信息之前,还包括:
    接收来自所述接收方设备的第五信息,所述第五信息用于指示所述发送方设备发送所述第一信息;
    所述发送第一信息,包括:
    向所述接收方设备单播发送所述第一信息。
  17. 一种密钥协商方法,其特征在于,所述方法包括:
    接收来自发送方设备的第一信息,所述第一信息中指示所述发送方设备支持的N种密钥协商算法,所述N为大于等于1的整数;
    确定目标密钥协商算法,所述目标密钥协商算法为所述N种密钥协商算法中的、且接收方设备支持的密钥协商算法;
    根据所述目标密钥协商算法,生成第一密钥协商参数;
    向所述发送方设备发送第二信息,所述第二信息指示所述目标密钥协商算法,并包括所述第一密钥协商参数。
  18. 根据权利要求17所述的方法,其特征在于,所述方法还包括:
    接收来自所述发送方设备的第三信息,所述第三信息指示第二密钥协商参数,所述第二密钥协商参数对应于所述发送方设备的、基于所述目标密钥协商算法得到的密钥协商参数;以及
    根据所述第二密钥协商参数和所述目标密钥协商算法,生成目标密钥。
  19. 根据权利要求18所述的方法,其特征在于,所述第三信息为通过完整性保护算法处理后的第三信息。
  20. 根据权利要求17-19任一项所述的方法,其特征在于,所述第二信息还指示所述接收方设备支持的M种密钥协商算法的优先级信息;
    其中,所述第二信息包含所述M种密钥协商算法的标识信息,所述标识信息是按照所述M种密钥协商算法的优先级信息排列或者封装的。
  21. 根据权利要求17-20任一项所述的方法,其特征在于,所述第一信息还用于指示 所述N种密钥协商算法的优先级信息;其中,所述第一信息中包含所述N种密钥协商算法的标识信息,所述标识信息是按照所述N种密钥协商算法的优先级信息排列或者封装的。
  22. 根据权利要求17-21任一项所述的方法,其特征在于,所述确定目标密钥协商算法,包括:
    从所述N种密钥协商算法中确定优先级最高的密钥协商算法作为目标密钥协商算法。
  23. 根据权利要求17-22任一项所述的方法,其特征在于,所述方法还包括:
    接收来自所述发送方设备的第一认证数据;所述第一认证数据是所述发送方设备对所述第二信息进行认证处理获得的认证数据。
  24. 根据权利要求18-23中任一项所述的方法,其特征在于,还包括:
    向所述发送方设备发送第四信息,所述第四信息包括第二认证数据,所述第二认证数据是接收方设备对所述第三信息进行认证处理获得的认证数据。
  25. 根据权利要求18-23中任一项所述的方法,其特征在于,还包括:
    向所述发送方设备发送第四信息,所述第四信息包括第三认证数据,所述第三认证数据是接收方设备对所述第一信息中指示的所述N种密钥协商算法和所述第三信息进行认证处理获得的认证数据。
  26. 根据权利要求24或25所述的方法,其特征在于,向所述发送方设备发送第四信息,包括:
    向所述发送方设备发送通过完整性保护算法处理后的第四信息。
  27. 根据权利要求23-26任一项所述的方法,其特征在于,所述认证处理还包括根据预设密钥进行认证处理。
  28. 根据权利要求18-27任一项所述的方法,其特征在于,所述第三信息还指示所述发送方设备支持的N种密钥协商算法。
  29. 根据权利要求17-28任一项所述的方法,其特征在于,所述接收来自发送方设备的第一信息之前,还包括:
    向所述发送方设备发送第五信息,所述第五信息用于指示所述发送方设备发送所述第一信息。
  30. 一种密钥协商装置,其特征在于,用于实现如权利要求1至16任一项所述的方法,和/或用于执行权利要求17-29中任一项所述的方法。
  31. 一种密钥协商装置,其特征在于,包括:一个或多个处理器,所述一个或多个处理器与一个或多个存储器耦合;
    一个或多个存储器,用于存储计算机程序或指令;
    一个或多个处理器,用于执行所述一个或多个存储器中存储的计算机程序或指令,以使得所述装置执行如权利要求1至16任一项所述的方法,和/或用于执行权利要求17-29中任一项所述的方法。
  32. 一种通信系统,其特征在于,包括:用于执行如权利要求1-16任一项所述的发送方设备以及用于执行如权利要求17-29任一项所述的接收方设备。
  33. 一种可读存储介质,其特征在于,包括程序或指令,当所述程序或指令在处理器上运行时,如权利要求1至16任一项所述的方法,和/或用于执行权利要求17-29中任一项所述的方法被执行。
PCT/CN2020/093490 2020-05-29 2020-05-29 密钥协商方法、装置和系统 WO2021237724A1 (zh)

Priority Applications (9)

Application Number Priority Date Filing Date Title
MX2022015025A MX2022015025A (es) 2020-05-29 2020-05-29 Método, aparato y sistema de negociación de clave.
CN202080101497.XA CN115668858A (zh) 2020-05-29 2020-05-29 密钥协商方法、装置和系统
EP20937745.6A EP4149048A4 (en) 2020-05-29 2020-05-29 Key negotiation method, apparatus and system
PCT/CN2020/093490 WO2021237724A1 (zh) 2020-05-29 2020-05-29 密钥协商方法、装置和系统
CA3183089A CA3183089A1 (en) 2020-05-29 2020-05-29 Key negotiation method, apparatus, and system
KR1020227045418A KR20230016662A (ko) 2020-05-29 2020-05-29 키 네고시에이션 방법, 장치 및 시스템
JP2022573316A JP7534445B2 (ja) 2020-05-29 2020-05-29 鍵ネゴシエーション方法、装置、およびシステム
US18/070,241 US20230087265A1 (en) 2020-05-29 2022-11-28 Key negotiation method, apparatus, and system
JP2024125889A JP2024153865A (ja) 2020-05-29 2024-08-01 鍵ネゴシエーション方法、装置、およびシステム

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2020/093490 WO2021237724A1 (zh) 2020-05-29 2020-05-29 密钥协商方法、装置和系统

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US18/070,241 Continuation US20230087265A1 (en) 2020-05-29 2022-11-28 Key negotiation method, apparatus, and system

Publications (1)

Publication Number Publication Date
WO2021237724A1 true WO2021237724A1 (zh) 2021-12-02

Family

ID=78745342

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/093490 WO2021237724A1 (zh) 2020-05-29 2020-05-29 密钥协商方法、装置和系统

Country Status (8)

Country Link
US (1) US20230087265A1 (zh)
EP (1) EP4149048A4 (zh)
JP (2) JP7534445B2 (zh)
KR (1) KR20230016662A (zh)
CN (1) CN115668858A (zh)
CA (1) CA3183089A1 (zh)
MX (1) MX2022015025A (zh)
WO (1) WO2021237724A1 (zh)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101605324A (zh) * 2008-06-13 2009-12-16 华为技术有限公司 算法协商的方法、装置及系统
CN106789023A (zh) * 2016-12-29 2017-05-31 杭州迪普科技股份有限公司 一种基于IKEv2的DH算法协商方法及装置
WO2018177905A1 (en) * 2017-03-29 2018-10-04 Koninklijke Philips N.V. Hybrid key exchange
CN110380868A (zh) * 2019-08-22 2019-10-25 广东浪潮大数据研究有限公司 一种通信方法、装置及通信系统和存储介质

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101060712B (zh) * 2006-04-20 2011-08-24 华为技术有限公司 无线连接建立方法
CN101272241B (zh) * 2008-04-09 2010-05-12 西安西电捷通无线网络通信有限公司 一种密钥的分配与管理方法
WO2018076365A1 (zh) * 2016-10-31 2018-05-03 美的智慧家居科技有限公司 密钥协商方法及装置
WO2019047197A1 (en) * 2017-09-11 2019-03-14 Telefonaktiebolaget Lm Ericsson (Publ) METHOD AND SYSTEM FOR INTEGRATING FIXED ACCESS IN A CONVERGED 5G HEART

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101605324A (zh) * 2008-06-13 2009-12-16 华为技术有限公司 算法协商的方法、装置及系统
CN106789023A (zh) * 2016-12-29 2017-05-31 杭州迪普科技股份有限公司 一种基于IKEv2的DH算法协商方法及装置
WO2018177905A1 (en) * 2017-03-29 2018-10-04 Koninklijke Philips N.V. Hybrid key exchange
CN110380868A (zh) * 2019-08-22 2019-10-25 广东浪潮大数据研究有限公司 一种通信方法、装置及通信系统和存储介质

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP4149048A4 *

Also Published As

Publication number Publication date
US20230087265A1 (en) 2023-03-23
MX2022015025A (es) 2023-03-10
JP2023527212A (ja) 2023-06-27
JP7534445B2 (ja) 2024-08-14
EP4149048A1 (en) 2023-03-15
KR20230016662A (ko) 2023-02-02
JP2024153865A (ja) 2024-10-29
CA3183089A1 (en) 2021-12-02
EP4149048A4 (en) 2023-06-28
CN115668858A (zh) 2023-01-31

Similar Documents

Publication Publication Date Title
US12058745B2 (en) System and method for RRC connection using a relay terminal
JP7255949B2 (ja) 通信方法および装置
WO2020050138A1 (ja) コアネットワーク装置、アクセスネットワーク装置、通信端末、通信システム、及び通信方法
WO2021047276A1 (zh) 一种密钥生成方法及装置
WO2019062621A1 (zh) 一种进行重复传输的方法和设备
WO2021031768A1 (zh) 一种安全加密的方法及装置
CN108574935B (zh) 一种组播业务处理方法及接入点
WO2022183350A1 (zh) 物联网设备配网方法、终端设备和物联网设备
WO2018049689A1 (zh) 密钥协商方法及装置
US20230091113A1 (en) Communications Method and Apparatus
WO2021237724A1 (zh) 密钥协商方法、装置和系统
CN113228722B (zh) 一种配对方法及装置
WO2023050373A1 (zh) 一种通信方法、装置及系统
WO2022082667A1 (zh) 一种数据安全传输的方法及装置
CN117749355A (zh) 一种通信方法及相关装置
WO2024065469A1 (zh) 一种直连链路建立方法、设备及存储介质
WO2024050846A1 (zh) 近邻通信方法和装置
JP2024160226A (ja) 通信方法及び装置
WO2022160275A1 (zh) 无线通信方法、设备及存储介质
WO2022205230A1 (zh) 一种分组数据汇聚协议实体的超帧号确定方法及其装置
WO2023056852A1 (zh) 一种通信方法、装置及系统
EP4404536A1 (en) Method, apparatus and system for transmitting blockchain information

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

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2022573316

Country of ref document: JP

Kind code of ref document: A

ENP Entry into the national phase

Ref document number: 3183089

Country of ref document: CA

WWE Wipo information: entry into national phase

Ref document number: 202237069814

Country of ref document: IN

ENP Entry into the national phase

Ref document number: 2020937745

Country of ref document: EP

Effective date: 20221209

ENP Entry into the national phase

Ref document number: 20227045418

Country of ref document: KR

Kind code of ref document: A

NENP Non-entry into the national phase

Ref country code: DE