Key generation method and apparatus

By generating session keys through parameter sharding and triples for inter-device exchange, and combining blockchain network verification and message authentication codes, the problem of PKI certificate dependence in inter-device communication is solved, achieving secure and low-cost inter-device key generation and communication.

CN115396097BActive Publication Date: 2026-02-27LENOVO (BEIJING) LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202211050432.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-08-31
Publication Date
2026-02-27
Estimated Expiration
2042-08-31

AI Technical Summary

Technical Problem

In existing technologies, device-to-device communication authentication relies on PKI certificates, which results in high costs and high requirements for device computing power, and there is a risk of leakage during key transmission between devices.

Method used

By exchanging parameter shards and triples between devices, a session key is generated. Security is ensured by using blockchain network verification and message authentication codes, avoiding direct parameter transmission and reducing the computing power requirements of device key generation.

Benefits of technology

It enables secure communication between devices, reduces the cost and risk of key generation and leakage between devices, improves communication security, and avoids dependence on PKI certificates.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115396097B_ABST
    Figure CN115396097B_ABST
Patent Text Reader

Abstract

The present disclosure provides a secret key generation method and device, wherein the secret key generation method is applied to a first device, and the method comprises: determining a first parameter; performing data exchange with a second device according to a first strategy based on the first parameter to obtain a second parameter of the second device, and enabling the second device to obtain the first parameter, wherein the first parameter and the second parameter are not included in information transmitted between the first device and the second device during the data exchange; and generating a first session key according to the first parameter and the second parameter, wherein the first session key matches a second session key, and the second session key is a session key generated by the second device according to the first parameter and the second parameter.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present disclosure relates to the field of computer security, and in particular, to a secret key generation method and device. BACKGROUND

[0002] A secret key is an important means to ensure information security. Before devices communicate with each other, a secure channel is established through a secret key to ensure secure communication. Device authentication is generally completed through a PKI certificate. A certificate is issued by an authority, which has a cost. Moreover, the signature algorithm for authentication has a high requirement for the computing power of a device. SUMMARY

[0003] According to a first aspect of the present disclosure, a secret key generation method is provided, applied to a first device, and the method comprises:

[0004] determining a first parameter;

[0005] performing data exchange with a second device according to a first strategy based on the first parameter, to obtain a second parameter of the second device, and causing the second device to obtain the first parameter, wherein information transmitted between the first device and the second device in the process of data exchange does not include the first parameter and the second parameter;

[0006] generating a first session secret key according to the first parameter and the second parameter, wherein the first session secret key matches a second session secret key, and the second session secret key is a session secret key generated by the second device according to the first parameter and the second parameter.

[0007] In an implementation manner, performing data exchange with a second device according to a first strategy based on the first parameter comprises:

[0008] splitting the first parameter to obtain a first parameter shard and a second parameter shard;

[0009] sending the second parameter shard to the second device;

[0010] receiving a third parameter shard sent by the second device, wherein the second parameter is split by the second device to obtain the third parameter shard and a fourth parameter shard;

[0011] determining a first secret parameter shard according to the first parameter shard and the third parameter shard;

[0012] sending the first secret parameter shard to the second device;

[0013] receiving a second secret parameter shard sent by the second device, wherein the second secret parameter shard is determined by the second device according to the second parameter shard and the fourth parameter shard;

[0014] determining a target secret parameter according to the first secret parameter slice and the second secret parameter slice;

[0015] determining the second parameter according to the target secret parameter and the first parameter.

[0016] In an implementation, the determining the first secret parameter slice according to the first parameter slice and the third parameter slice comprises:

[0017] determining the first secret parameter slice according to a pre-stored first triple and the first parameter slice and the third parameter slice, the first triple corresponding to a second triple, the second triple being pre-stored in the second device to enable the second device to determine the second secret parameter according to the second triple, the second parameter slice and the fourth parameter slice.

[0018] In an implementation, after the generating the first session key according to the first parameter and the second parameter, the method further comprises:

[0019] determining first digest information of the first triple;

[0020] storing the first digest information in a target blockchain network, the first device being a node of the target blockchain network.

[0021] In an implementation, in the data exchange process between the first device and the second device according to the first strategy, the data source is verified by a message authentication code, and if the message authentication code verification fails, the data exchange is ended.

[0022] In an implementation, the message authentication code comprises verification key information, the verification key information being generated according to a first triple and a second triple matched with each other, the first triple being pre-stored in the first device, the second triple being pre-stored in the second device, the first triple and the second triple being applied in the data exchange process according to the first strategy.

[0023] In an implementation, in the data exchange process according to the first strategy, the message authentication code sent by the first device to the second device comprises first verification key information, the first verification key information being generated according to the first triple.

[0024] In an implementation, the first parameter is a random number generated by the first device.

[0025] According to a second aspect of the present disclosure, a key generation device is provided, the device comprising:

[0026] determining a first parameter;

[0027] exchanging a first parameter with a second device according to a first strategy to obtain a second parameter of the second device, and causing the second device to obtain the first parameter, wherein the first parameter and the second parameter are not included in information transmitted between the first device and the second device during the data exchange;

[0028] generating a first session key according to the first parameter and the second parameter, wherein the first session key matches a second session key generated by the second device according to the first parameter and the second parameter.

[0029] According to a third aspect of the present disclosure, an electronic device is provided, comprising:

[0030] at least one processor; and

[0031] a memory connected with the at least one processor in communication; wherein,

[0032] the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method of the present disclosure.

[0033] According to a fourth aspect of the present disclosure, a non-transitory computer readable storage medium storing computer instructions is provided, the computer instructions being used to cause the computer to perform the method of the present disclosure.

[0034] It should be understood that the content described in this section is not intended to identify key or important features of the embodiments of the present disclosure, nor is it used to limit the scope of the present disclosure. Other features of the present disclosure will become apparent through the following description. BRIEF DESCRIPTION OF DRAWINGS

[0035] The above and other objects, features and advantages of the exemplary embodiments of the present disclosure will be more apparent from the following detailed description taken in conjunction with the accompanying drawings, in which:

[0036] In the drawings, the same or corresponding reference numerals indicate the same or corresponding parts.

[0037] Figure 1 An implementation flowchart of a key generation method according to an embodiment of the present disclosure is shown Figure 1 ;

[0038] Figure 2 An implementation flowchart of a key generation method according to an embodiment of the present disclosure is shownFigure 2 ;

[0039] Figure 3 A component structure schematic diagram of a key generation apparatus in an embodiment of the present disclosure is shown.

[0040] Figure 4 A component structure schematic diagram of an electronic device in an embodiment of the present disclosure is shown. DETAILED DESCRIPTION

[0041] In order to make the objectives, characteristics and advantages of the present disclosure more obvious and easy to understand, the technical solutions in the embodiments of the present disclosure will be described clearly and completely below with reference to the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are only part of the embodiments of the present disclosure, rather than all the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by those skilled in the art without creative work fall within the scope of protection of the present disclosure.

[0042] The key generation method in the embodiments of the present disclosure can be used for secure communication between two devices, and the key generated by the method in the embodiments of the present disclosure can be used to establish a secure channel between the two devices to achieve secure communication.

[0043] Referring to Figure 1 , the embodiments of the present disclosure provide a key generation method applied to a first device, and the method comprises:

[0044] determining a first parameter;

[0045] performing data exchange with a second device according to a first strategy based on the first parameter, to obtain a second parameter of the second device and make the second device obtain the first parameter, and the information transmitted between the first device and the second device in the process of data exchange does not include the first parameter and the second parameter;

[0046] generating a first session key according to the first parameter and the second parameter, the first session key matches a second session key, and the second session key is a session key generated by the second device according to the first parameter and the second parameter.

[0047] In the key generation method of the present disclosure, the first device determines a first parameter; the first device exchanges data with the second device according to a first strategy based on the first parameter to obtain a second parameter of the second device, and causes the second device to obtain the first parameter. In the process of data exchange, the information transmitted between the first device and the second device does not include the first parameter and the second parameter; a first session key is generated according to the first parameter and the second parameter, the first session key matches a second session key, and the second session key is a session key generated by the second device according to the first parameter and the second parameter. Since the information transmitted between the first device and the second device in the process of data exchange does not include the first parameter and the second parameter, the leakage of the first parameter and the second parameter is avoided, the session key is generated by the first device and the second device according to the first parameter and the second parameter, the security is high, and the first device and the second device can securely communicate. In the key generation method of the present disclosure, the session key is generated based on the first parameter and the second parameter, and no PKI certificate is needed, thereby avoiding the cost caused by using the PKI certificate. Since the first device and the second device generate the session key based on the same parameter, symmetric encryption of the session between the two devices can be realized.

[0048] In an implementation, the data exchange between the first device and the second device based on the first parameter includes: splitting the first parameter to obtain a first parameter fragment and a second parameter fragment; sending the second parameter fragment to the second device; receiving a third parameter fragment sent by the second device, the second parameter being split by the second device to obtain the third parameter fragment and a fourth parameter fragment; determining a first secret parameter fragment according to the first parameter fragment and the third parameter fragment; sending the first secret parameter fragment to the second device; receiving a second secret parameter fragment sent by the second device, the second secret parameter fragment being determined by the second device according to the second parameter fragment and the fourth parameter fragment; determining a target secret parameter according to the first secret parameter fragment and the second secret parameter fragment; and determining the second parameter according to the target secret parameter and the first parameter. In the present disclosure, the first parameter is split to obtain the first parameter fragment and the second parameter fragment, the second parameter is sent to the second device, and the received third parameter fragment is obtained by splitting the second parameter. In the process of data exchange, the first parameter and the second parameter are not exposed. The first secret parameter fragment is determined according to the first parameter fragment and the third parameter fragment, and the second secret parameter fragment is determined by the second device according to the second parameter fragment and the fourth parameter fragment. In the process of data exchange, the first parameter and the second parameter are not exposed. The target secret parameter can be determined according to the first secret parameter fragment and the second secret parameter fragment, and the second parameter can be determined according to the target secret parameter and the first parameter.

[0049] In the embodiments of the present disclosure, the data exchange is performed by the first strategy, that is, the first device and the second device both obtain the target secret parameter without directly exchanging the first parameter and the second parameter, and the target secret parameter is the same as the result directly obtained by the first parameter and the second parameter through a specific operation. Therefore, after obtaining the target secret parameter, the first device can obtain the second parameter according to the first parameter possessed by the first device, and then generate the first session key through the first parameter and the second parameter, and the second device can also obtain the first parameter through the same way, and then generate the second session key through the first parameter and the second parameter.

[0050] In an implementation, the first secret parameter slice is determined according to the first parameter slice and the third parameter slice, including: determining the first secret parameter slice according to the pre-stored first three-element group and the first parameter slice and the third parameter slice, the first three-element group corresponding to the second three-element group, and the second three-element group being pre-stored in the second device, so that the second device determines the second secret parameter according to the second three-element group, the second parameter slice and the fourth parameter slice. In the embodiments of the present disclosure, the three-element group is used to participate in the data exchange, wherein the first secret parameter slice is determined according to the first three-element group, the first parameter slice and the third parameter slice, and the second secret parameter slice is determined according to the second three-element group corresponding to the first three-element group, and the second parameter slice and the fourth parameter slice, so that the security of the data exchange can be improved, and the risk of leakage of the first parameter and the second parameter can be reduced.

[0051] Further, in the above-mentioned embodiments, the target secret parameter is determined according to the first secret parameter slice and the second secret parameter slice, including: adding the first secret parameter slice and the second secret parameter slice to obtain the target secret parameter. The second parameter is determined according to the target secret parameter and the first parameter, including: dividing the target secret parameter by the first parameter to obtain the second parameter.

[0052] In an implementation, the first secret parameter slice is determined according to the first parameter slice and the third parameter slice, including: adding the first parameter slice and the third parameter slice to obtain the first secret parameter slice.

[0053] Further, in the above-mentioned embodiments, the target secret parameter is determined according to the first secret parameter slice and the second secret parameter slice, including: adding the first secret parameter slice and the second secret parameter slice to obtain the target secret parameter. The second parameter is determined according to the target secret parameter and the first parameter, including: subtracting the first parameter from the target secret parameter to obtain the second parameter.

[0054] In an implementation, after the first session key is generated according to the first parameter and the second parameter, the method further comprises: determining first digest information of the first triad; and storing the first digest information in a target blockchain network, the first device being a node of the target blockchain network. The first digest information can be used to determine that the first triad has participated in data exchange, so that the first triad is deregistered from the target blockchain network after the first session key is generated.

[0055] In an implementation, during the data exchange process between the first device and the second device according to the first strategy, the data source is verified by a message authentication code, and if the message authentication code verification fails, the data exchange is ended. The data source is verified by the message authentication code, so that it can be checked whether the content is changed during data transmission, and the identity of the message source is verified to confirm the source of the message. If the message authentication code verification fails, the data exchange is ended in time to avoid data leakage. For example, the message authentication code is carried in the process of sending the second parameter fragment and the first secret parameter fragment, so that the second device verifies whether the data is from the first device, and the message authentication code is used to verify whether the data is from the second device in the process of receiving the third parameter fragment and the second secret parameter fragment, and if the message authentication code verification fails, the data exchange is ended.

[0056] In an implementation, the verification key information is included in the message authentication code, and the verification key information is generated according to the first triad and the second triad that match each other, the first triad is pre-stored in the first device, the second triad is pre-stored in the second device, and the first triad and the second triad are applied to the process of data exchange according to the first strategy. In the embodiment of the disclosure, the first triad and the second triad that match each other are applied to the process of data exchange according to the first strategy, for example, the first secret parameter fragment is determined according to the first triad, the first parameter fragment and the third parameter fragment, and the second triad is used by the second device to determine the second secret parameter according to the second parameter fragment and the fourth parameter fragment. In the above implementation, the first triad and the second triad used to generate the verification key information are used to determine the first secret parameter fragment.

[0057] In an embodiment, in the process of data exchange according to the first strategy, the first device includes the first authentication key information in the message authentication code sent to the second device, and the first authentication key information is generated according to the first triple. Similarly, the second authentication key information in the message authentication code received by the first device from the second device includes the second authentication key information generated according to the second triple. The first authentication key information is included in the message authentication code sent by the first device to the second device, so that the second device verifies whether the first authentication key information is generated according to the first triple, and if not, the data exchange is ended. The second authentication key information in the message authentication code received from the second device is verified whether it is generated according to the second triple, and if not, the data exchange is ended.

[0058] In an embodiment, the first parameter is a random number generated by the first device. The received second parameter is a random number generated by the second device, the first parameter and the second parameter are random numbers respectively, and in the process of data exchange, the information transmitted between the first device and the second device does not include the first parameter and the second parameter, the key can be generated without relying on the PKI certificate, and then the secure channel is established to realize secure communication.

[0059] In an embodiment, the first device and the second device perform data exchange according to the first parameter, including:

[0060] The first parameter is scrambled according to a preset manner, and the scrambled first parameter is sent to the second device; the second device sends the second parameter scrambled according to the preset manner, and the scrambled second parameter received is restored to obtain the second parameter. The key generation method of the embodiment of the present disclosure is used as an example for establishing a secure channel between the first device and the second device.

[0061] The first device pre-stores the first triple (a1, b1, c1), and the second device pre-stores the second triple (a2, b2, c2), and (c1+c2) = (a1+a2)(b1+b2).

[0062] The first device generates the first authentication key information k1 according to the first triple, k1 = GenKey(a1, b1, c1), and the second device generates the second authentication key information k2 according to the second triple, k2 = GenKey(a2, b2, c2).

[0063] In the process of data exchange between the first device and the second device, the information source is verified by MAC (message authentication code): before the second device sends any information msg to the first device, MAC2(k2, msg) is calculated and added in front of msg, and then sent to the first device; before the first device sends any information msg to the second device, MAC1(k1, msg) is calculated and added in front of msg, and then sent to the second device.

[0064] The first device checks MAC2 and the second device checks MAC1. If one of them does not pass, the negotiation is stopped.

[0065] The data exchange process is as follows:

[0066] The first device randomly generates a first parameter x, and then generates the fragments of the first parameter x: a first parameter fragment x1 and a second parameter fragment x2.

[0067] The second device randomly generates a second parameter y, and then generates the fragments of the second parameter y: a third parameter fragment y1 and a fourth parameter fragment y2.

[0068] The second device transmits MAC2 and the third parameter fragment y1 to the first device.

[0069] The first device checks MAC2, and if it does not pass, the data exchange is aborted.

[0070] The first device calculates a first scrambling parameter fragment a1 and a third scrambling parameter fragment b1 according to the first parameter fragment x1 and the third parameter fragment y1, a1 = x1 - a1, b1 = y1 - b1.

[0071] The first device transmits MAC1, a1, b1, the second parameter fragment x2 to the second device.

[0072] The second device checks MAC1, and if it does not pass, the data exchange is aborted.

[0073] The second device calculates a second scrambling parameter fragment a2 and a fourth scrambling parameter fragment b2, a2 = x2 - a2, b2 = y2 - b2.

[0074] The second device transmits MAC2, a2, b2 to the first device.

[0075] The first device checks MAC2, and if it does not pass, the data exchange is aborted.

[0076] The second device calculates a first scrambling parameter a and a second scrambling parameter b, and then determines a second secret parameter fragment z2, a = a1 + a2 = x - a, b = b1 + b2 = x - b, z2 = a b2 + b a2 + c2 + a b.

[0077] The first device calculates a and b, and then calculates a first secret parameter fragment z1, z1 = a b1 + b a1 + c1.

[0078] The first device transmits MAC1, the first secret parameter fragment z1 to the second device.

[0079] The second device checks MAC1, and if it does not pass, the data exchange is aborted.

[0080] The second device calculates a target secret parameter z, z = z1 + z2, and then calculates a first parameter x, z = xy.

[0081] The second device derives a1, b1, and c1.

[0082] The second device checks whether the first verification key information k1 is generated according to the first triple, and if not, the data exchange is aborted.

[0083] The second device generates a session key sk according to the first parameter x and the second parameter y.

[0084] The second device determines second digest information of the second triple (a2, b2, c2); and stores the second digest information in the target blockchain network.

[0085] The second device transmits MAC2 and the second verification key information z2 to the first device.

[0086] The first device checks MAC2, and if it does not pass, the data exchange is aborted.

[0087] The first device calculates a target secret parameter z, and then calculates a second parameter y.

[0088] The first device derives a2, b2, and c2.

[0089] The first device checks whether the second verification key information k2 is generated according to the second triple, and if not, the data exchange is aborted.

[0090] The first device generates a session key sk according to the first parameter x and the second parameter y.

[0091] The first device determines first digest information of the first triple (a1, b1, c1); and stores the first digest information in the target blockchain network.

[0092] Referring to Figure 3 The embodiments of the present disclosure provide a key generation apparatus, which comprises a determination module, an exchange module, and a generation module. The determination module is configured to determine a first parameter. The exchange module is configured to perform data exchange with a second device according to a first strategy based on the first parameter, to obtain a second parameter of the second device, and to enable the second device to obtain the first parameter. In the process of data exchange, the information transmitted between the first device and the second device does not include the first parameter and the second parameter. The generation module is configured to generate a first session key according to the first parameter and the second parameter. The first session key matches a second session key, which is a session key generated by the second device according to the first parameter and the second parameter.

[0093] In the key generation apparatus of the present disclosure, the determining module determines the first parameter; the exchange module performs data exchange with the second device according to the first parameter based on the first parameter, to obtain the second parameter of the second device, and causes the second device to obtain the first parameter. In the process of data exchange, the information transmitted between the first device and the second device does not include the first parameter and the second parameter; the first session key is generated according to the first parameter and the second parameter, the first session key matches the second session key, and the second session key is a session key generated by the second device according to the first parameter and the second parameter. Since the information transmitted between the first device and the second device does not include the first parameter and the second parameter in the process of data exchange, the leakage of the first parameter and the second parameter is avoided, the session key is generated by the first device and the second device according to the first parameter and the second parameter, the security is high, and the first device and the second device can securely communicate. In the key generation method of the embodiment of the present disclosure, the session key is generated based on the first parameter and the second parameter, and no PKI certificate is needed, thereby avoiding the cost caused by using the PKI certificate.

[0094] In an implementation manner, the exchange module performs data exchange with the second device according to the first parameter based on the first parameter, including: splitting the first parameter to obtain a first parameter fragment and a second parameter fragment; sending the second parameter fragment to the second device; receiving the third parameter fragment sent by the second device, the second parameter being split by the second device to obtain the third parameter fragment and a fourth parameter fragment; determining a first secret parameter fragment according to the first parameter fragment and the third parameter fragment; sending the first secret parameter fragment to the second device; receiving the second secret parameter fragment sent by the second device, the second secret parameter fragment being determined by the second device according to the second parameter fragment and the fourth parameter fragment; determining a target secret parameter according to the first secret parameter fragment and the second secret parameter fragment; and determining the second parameter according to the target secret parameter and the first parameter.

[0095] In an implementation manner, the exchange module determines the first secret parameter fragment according to the first parameter fragment and the third parameter fragment, including: determining the first secret parameter fragment according to a pre-stored first three-tuple, the first parameter fragment and the third parameter fragment, the first three-tuple corresponding to a second three-tuple, and the second three-tuple being pre-stored in the second device, so that the second device determines the second secret parameter according to the second three-tuple, the second parameter fragment and the fourth parameter fragment.

[0096] In an implementation manner, the apparatus of the embodiment of the present disclosure further includes a logout module, the logout module is configured to determine first digest information of the first three-tuple after the first session key is generated according to the first parameter and the second parameter; and store the first digest information in a target blockchain network, and the first device is a node of the target blockchain network.

[0097] In an implementation, the exchange module verifies the data source by the message authentication code in the data exchange process between the first device and the second device according to the first strategy based on the first parameter, and ends the data exchange if the message authentication code verification fails.

[0098] In an implementation, the verification key information is included in the message authentication code, and the verification key information is generated according to the first triple and the second triple matched with each other, the first triple is pre-stored in the first device, the second triple is pre-stored in the second device, and the first triple and the second triple are applied to the data exchange process according to the first strategy.

[0099] In an implementation, the exchange module includes the first verification key information in the message authentication code sent by the first device to the second device in the data exchange process according to the first strategy, and the first verification key information is generated according to the first triple.

[0100] In an implementation, the first parameter is a random number generated by the first device.

[0101] The key generation apparatus of the embodiments of the present disclosure can implement the method of the above embodiments, and the description of the key generation apparatus embodiments above is similar to the description of the above method embodiments, has similar beneficial effects as the above method embodiments, and thus is not described in detail. For the technical details of the key generation apparatus embodiments of the present disclosure that have not been disclosed, please refer to the description of the above method embodiments of the present disclosure for understanding, and thus are not described in detail for saving space.

[0102] According to the embodiments of the present disclosure, the present disclosure further provides an electronic device and a readable storage medium.

[0103] Figure 4 A schematic block diagram of an example electronic device 400 that can be used to implement embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptops, desktops, tablets, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device can also represent various forms of mobile devices, such as personal digital assistants, cellular telephones, smartphones, wearable devices, and other similar computing devices. The components shown here, their connections and relationships, and their functions, are meant to be examples only, and are not meant to limit implementations of the present disclosure described and / or claimed in this document.

[0104] As Figure 4As shown, the device 400 includes a computing unit 401 that can perform various appropriate actions and processes in accordance with a computer program stored in a read-only memory (ROM) 402 or a computer program loaded from a storage unit 408 into a random access memory (RAM) 403. In the RAM 403, various programs and data required for the operation of the device 400 can also be stored. The computing unit 401, the ROM 402, and the RAM 403 are connected to each other through a bus 404. An input / output (I / O) interface 405 is also connected to the bus 404.

[0105] A plurality of components in the device 400 are connected to the I / O interface 405, including: an input unit 406, such as a keyboard, a mouse, etc.; an output unit 407, such as various types of displays, speakers, etc.; a storage unit 408, such as a magnetic disk, an optical disk, etc.; and a communication unit 409, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 409 allows the device 400 to exchange information / data with other devices through a computer network, such as the Internet, and / or various telecommunication networks.

[0106] The computing unit 401 can be various general and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 401 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The computing unit 401 performs various methods and processes described above, such as the secret key generation method. For example, in some embodiments, the secret key generation method can be implemented as a computer software program that is tangibly embodied in a machine-readable medium, such as the storage unit 408. In some embodiments, part or all of the computer program can be loaded and / or installed on the device 400 via the ROM 402 and / or the communication unit 409. When the computer program is loaded into the RAM 403 and executed by the computing unit 401, one or more steps of the secret key generation method described above can be performed. Alternatively, in other embodiments, the computing unit 401 can be configured to perform the secret key generation method by any other appropriate means, such as by means of firmware.

[0107] Various implementations of the systems and techniques described above can be realized in digital electronic circuitry, integrated circuitry, a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), a system on a chip (SOC), a complex programmable logic device (CPLD), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include implementation in one or more computer programs that are executable and / or interpretable on a programmable system including at least one programmable processor, which can be special or general purpose, coupled to receive data and instructions from, and to transmit data and instructions to, a storage system, at least one input device, and at least one output device.

[0108] Program code for carrying out methods of the present disclosure can be written in any combination of one or more programming languages. The program code can be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the program code, when executed by the processor or controller, produces the functions / operations specified in the flowcharts and / or the block diagrams. The program code can be executed entirely on a machine, partially on a machine, partially on a machine as a stand-alone software package, partially on a machine and partially on a remote machine or entirely on a remote machine or server.

[0109] In the context of the present disclosure, a machine-readable medium can be a tangible medium that contains or stores a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include but is not limited to an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium will include one or more lines of electrical connections, portable computer disks, hard disk drives, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or Flash memory), optical fibers, portable compact disc read-only memories (CD-ROMs), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0110] To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user and a keyboard and a pointing device (e.g., a mouse or a trackball) by which the user can provide input to the computer. Other kinds of devices can be used to provide for interaction with a user as well; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form, including acoustic, speech, or tactile input.

[0111] The systems and techniques described here can be implemented in a computing system that includes a back end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front end component (e.g., a user computer having a graphical user interface or a Web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back end, middleware, or front end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network (LAN), a wide area network (WAN), and the Internet.

[0112] The computer system can include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server is generally established by computer programs running on the respective computers and having a client-server relationship to each other. The servers can be cloud servers, servers of a distributed system, or servers combined with a blockchain.

[0113] It should be understood that various forms of flow shown above can be used, with steps re-ordered, added, or removed. For example, the steps recited in the present disclosure can be performed in parallel, in series, or in a different order, as long as the desired results of the technology disclosed in the present disclosure are achieved, and the present disclosure is not limited herein.

[0114] In addition, the terms "first", "second", etc., are used herein only to describe different instances, and do not imply or suggest relative importance or imply the number of indicated technical features. Therefore, the features defined with "first", "second" can explicitly or implicitly include at least one of the features. In the description of the present disclosure, the meaning of "a plurality of" is two or more, unless otherwise specifically limited.

[0115] The above merely provides the specific implementation of the present disclosure, but the protection scope of the present disclosure is not limited thereto, any person skilled in the art can easily think of the changes or replacements within the technical range disclosed by the present disclosure, which should be covered within the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure should be subject to the protection scope of the claims.

Claims

1. A key generation method, applied to a first device, the method comprising: Determine the first parameter; Based on the first parameter, the first device and the second device exchange data according to the first strategy to obtain the second parameter of the second device and enable the second device to obtain the first parameter. During the data exchange process, the information transmitted between the first device and the second device does not include the first parameter and the second parameter. A first session key is generated based on the first parameter and the second parameter. The first session key is matched with a second session key. The second session key is a session key generated by the second device based on the first parameter and the second parameter. Based on the first parameter, data is exchanged with the second device according to the first strategy, including: The first parameter is split to obtain a first parameter fragment and a second parameter fragment; The second parameter is sent to the second device in fragments; The third parameter fragment sent by the second device is received, and the second parameter is split by the second device to obtain the third parameter fragment and the fourth parameter fragment; The first secret parameter fragment is determined based on the first parameter fragment and the third parameter fragment; The first secret parameter is fragmented and sent to the second device; The device receives a second secret parameter fragment sent by the second device, the second secret parameter fragment being determined by the second device based on the second parameter fragment and the fourth parameter fragment; The target secret parameter is determined based on the first secret parameter fragment and the second secret parameter fragment; The second parameter is determined based on the target secret parameter and the first parameter.

2. The method according to claim 1, wherein determining the first secret parameter fragment based on the first parameter fragment and the third parameter fragment comprises: The first secret parameter fragment is determined based on the pre-stored first triplet, the first parameter fragment, and the third parameter fragment. The first triplet corresponds to the second triplet, and the second triplet is preset in the second device, so that the second device determines the second secret parameter based on the second triplet, the second parameter fragment, and the fourth parameter fragment.

3. The method according to claim 2, wherein after generating the first session key based on the first parameter and the second parameter, the method further includes: Determine the first summary information of the first triplet; The first digest information is stored in the target blockchain network, and the first device is a node of the target blockchain network.

4. The method according to claim 1, wherein, During the data exchange process between the second device and the first device based on the first parameter and in accordance with the first strategy, the data source is verified by a message authentication code. If the message authentication code verification fails, the data exchange ends.

5. The method according to claim 4, wherein the message authentication code includes verification key information, the verification key information is generated based on a first triplet and a second triplet that match each other, the first triplet is pre-stored in the first device, the second triplet is pre-stored in the second device, and the first triplet and the second triplet are applied in the process of exchanging data according to the first strategy.

6. The method according to claim 5, wherein during the data exchange according to the first strategy, the message authentication code sent by the first device to the second device includes first verification key information, which is generated based on the first triplet.

7. The method according to claim 1, wherein the first parameter is a random number generated by the first device.

8. A key generation apparatus, applied to a first device, the apparatus comprising: The determination module is used to determine the first parameter; The exchange module is used to exchange data with the second device according to the first strategy based on the first parameter, so as to obtain the second parameter of the second device and enable the second device to obtain the first parameter. During the data exchange process, the information transmitted between the first device and the second device does not include the first parameter and the second parameter. A generation module is used to generate a first session key based on the first parameter and the second parameter, wherein the first session key matches a second session key, and the second session key is a session key generated by the second device based on the first parameter and the second parameter; The switching module is also used to split the first parameter to obtain a first parameter fragment and a second parameter fragment; The second parameter is sent to the second device in fragments; The system receives a third parameter fragment sent by the second device, and the second parameter is split by the second device to obtain the third parameter fragment and a fourth parameter fragment; a first secret parameter fragment is determined based on the first parameter fragment and the third parameter fragment; and the first secret parameter fragment is sent to the second device. The device receives a second secret parameter fragment sent by the second device, the second secret parameter fragment being determined by the second device based on the second parameter fragment and the fourth parameter fragment; determines a target secret parameter based on the first secret parameter fragment and the second secret parameter fragment; and determines the second parameter based on the target secret parameter and the first parameter.

9. An electronic device, characterized in that, include: At least one processor; as well as A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-7.

Citation Information

Patent Citations

  • Method and device for negotiating session secret key

    CN106817219A