Key negotiation method, device, related equipment and computer program product
The key seed is generated and encrypted by the key distribution center, combined with the shared keys and rules of the communicating parties, and the session key is generated using the key seed of the third-party key distribution center, which solves the problem of session key security in the communication system. issues, achieving greater security and diversity.
Patent Information
- Application Number
- CN202410642634.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-22
- Publication Date
- 2024-08-27
- Estimated Expiration
- 2044-05-22
AI Technical Summary
The security of session keys in existing communication systems is insufficient, and it is difficult to effectively negotiate between communicating parties to improve their security.
The key seed is generated and encrypted by the key distribution center, using the shared key and shared key generation rules shared by both communicating parties, and combined with the key seed of the third-party key distribution center to generate the session key, ensuring that only The session key can only be cracked when both communicating parties and the third party are compromised.
It improves the security and diversity of session keys, avoids the limitation of session keys caused by the limited shared keys and rules stored by both communicating parties, and enhances communication security.
Smart Images

Figure CN118233097B
Abstract
Description
Technical Field
[0001] The present disclosure relates to the fields of network technology and security technology, and in particular to a key negotiation method, device, electronic device, computer-readable storage medium, and computer program product. Background Art
[0002] This section is intended to provide a background or context to the embodiments of the disclosure that are recited in the claims. No description herein is admitted to be prior art by inclusion in this section.
[0003] Currently, in various communication systems, symmetric session keys are usually used to protect the interactive information between users to ensure the security and confidentiality of the communication content.
[0004] The technical problem to be solved by the present application is how to negotiate a session key between two communicating parties to improve the security of the session key. Summary of the invention
[0005] The purpose of the present disclosure is to provide a key negotiation method, device, electronic device, computer-readable storage medium and computer program product, which can improve the security of session keys.
[0006] Other features and advantages of the present disclosure will become apparent from the following detailed description, or may be learned in part by the practice of the present disclosure.
[0007] The disclosed embodiment provides a key negotiation method, comprising: the first device receives a first ciphertext sent by the key distribution center, the first ciphertext is generated by the key distribution center after encrypting a first key seed and a second ciphertext by using the first key, the second ciphertext is generated by the key distribution center after encrypting the first key seed by using the second key, and the first key seed is generated by the key distribution center; the first device decrypts the first ciphertext according to the first key to obtain the first key seed, the first key seed identifier and the second ciphertext; the first device determines the first shared key in the at least one shared key, and determines the first shared key generation rule in the at least one shared key generation rule; the first device generates a first ciphertext according to the first key, and the first key seed identifier and the second ciphertext are obtained ... The first shared key generation rule performs key generation processing on the first shared key and the first key seed to generate a first session key, wherein the first session key is used when the first device and the second device conduct an encrypted session; the first device sends the second ciphertext, the first shared key identifier corresponding to the first shared key, and the first shared key generation rule identifier corresponding to the first shared key generation rule to the second device, so that the second device determines the first key seed, the first shared key, and the first shared key generation rule according to the second ciphertext, the first shared key identifier, and the first shared key generation rule identifier, and performs key generation processing on the first shared key and the first key seed according to the first shared key generation rule to generate the first session key.
[0008] In some embodiments, the first ciphertext also includes a first key seed identifier corresponding to the first key seed, and the second ciphertext also includes a first key seed identifier corresponding to the first key seed; the first device stores the first key seed and the first key seed identifier so that the first device stores at least one key seed and the key seed identifier corresponding to each key seed; the second device stores the first key seed and the first key seed identifier so that the second device stores at least one key seed and the key seed identifier corresponding to each key seed; wherein the method also includes: the first device determines a second key seed and a second key seed identifier corresponding to the second key seed in the at least one key seed; the first device determines a second shared key and a second shared key identifier corresponding to the second shared key in the at least one shared key; the first device determines a second shared key generation rule and the second shared key identifier in the at least one shared key generation rule the second shared key generation rule identifier corresponding to the second shared key generation rule; the first device performs key generation processing on the second shared key and the second key seed according to the second shared key generation rule to generate a second session key, wherein the second session key is used when the first device and the second device perform an encrypted session; the first device sends the second key seed identifier, the second shared key identifier and the second shared key generation rule identifier to the second device, so that the second device determines the second key seed, the second shared key and the second shared key generation rule from the at least one key seed, the at least one shared key and the at least one shared key generation rule according to the second key seed identifier, the second shared key identifier and the second shared key generation rule identifier, and performs key generation processing on the second shared key and the second key seed according to the second shared key generation rule to generate the second session key.
[0009] In some embodiments, the first device decrypts the first ciphertext according to the first key to obtain the first key seed, the first key seed identifier and the second ciphertext, including: if the first key is a symmetric key, the first device decrypts the first ciphertext by using the first key to obtain the first key seed, the first key seed identifier and the second ciphertext; if the first key is a public key in an asymmetric key, the first device determines the private key corresponding to the first key, and decrypts the first ciphertext according to the private key to obtain the first key seed, the first key seed identifier and the second ciphertext.
[0010] In some embodiments, before the first device receives the first ciphertext issued by the key distribution center, the method also includes: the first device determines to communicate with the second device; the first device determines the first device identifier corresponding to the first device and the second device identifier corresponding to the second device; the first device generates a first key seed request information based on the first device identifier and the second device identifier; the first device sends the first key seed request information to the key distribution center, so that the key distribution center determines the first key and the second key based on the first device identifier and the second device identifier in the first key seed request information, and encrypts the first key seed based on the first key and the second key to generate the second ciphertext and the first ciphertext.
[0011] In some embodiments, the third device and the key distribution center share and store a third key, the third device also stores the at least one shared key and the at least one shared key generation rule, the first ciphertext also includes a third ciphertext, and the third ciphertext is generated by the key distribution center after encrypting the first key seed with the third key; the method also includes: the first device sends the third ciphertext, the first shared key identifier and the first shared key generation rule identifier to the third device, so that the third device determines the first key seed, the first shared key and the first shared key generation rule according to the third ciphertext, the first shared key identifier and the first shared key generation rule identifier, and performs key generation processing on the first shared key and the first key seed according to the first shared key generation rule to generate the first session key, wherein the first session key is used when the first device, the second device and the third device conduct encrypted calls.
[0012] In some embodiments, before the first device receives the first ciphertext issued by the key distribution center, the method also includes: the first device determines to communicate with the second device and the third device; the first device determines the first device identifier corresponding to the first device, the second device identifier corresponding to the second device, and the third device identifier corresponding to the third device; the first device generates a second key seed request information based on the first device identifier, the second device identifier, and the third device identifier; the first device sends the second key seed request information to the key distribution center, so that the key distribution center determines the first key, the second key, and the third key based on the first device identifier, the second device identifier, and the third device identifier in the second key seed request information, and encrypts the first key seed and the first key seed identifier based on the first key, the second key, and the third key to generate the second ciphertext, the third ciphertext, and the first ciphertext.
[0013] In some embodiments, the second device and the key distribution center share and store a second key; the second device stores at least one shared key and at least one shared key generation rule; wherein the method includes: the second device receives a second ciphertext, a first shared key identifier and a first shared key generation rule identifier from the first device, the second ciphertext is generated by the key distribution center after encrypting a first key seed according to the second key, and the first key seed is generated by the key distribution center; the second device determines the first shared key in the at least one shared key according to the first shared key identifier; the second device determines the first shared key generation rule in the at least one shared key generation rule according to the first shared key generation rule identifier; the second device decrypts the second ciphertext according to the second key to obtain the first key seed; the second device performs key generation processing on the first shared key and the first key seed through the first shared key generation rule to generate a first session key, so as to conduct an encrypted session with the first device through the first session key.
[0014] In some embodiments, the second device stores the first key seed and the first key seed identifier so that the second device includes at least one key seed and the key seed identifier corresponding to each key seed; wherein the method also includes: the second device receives a second key seed identifier, a second shared key identifier and a second shared key generation rule identifier from the first device; the second device determines a second key seed in the at least one key seed according to the second key seed identifier; the second device determines a second shared key in the at least one shared key according to the second shared key identifier; the second device determines a second shared key generation rule in the at least one shared key generation rule according to the second shared key generation rule identifier; the second device performs key generation processing on the second shared key and the second key seed through the second shared key generation rule to generate a second session key, wherein the second session key is used when the first device and the second device conduct an encrypted session.
[0015] The embodiment of the present disclosure provides a key negotiation device, including: a first ciphertext receiving module, a first ciphertext decryption processing module, a first shared key determination module, a first session key first generation module and a second ciphertext forwarding module.
[0016] Among them, the first ciphertext receiving module is used for the first device to receive the first ciphertext issued by the key distribution center, the first ciphertext is generated by the key distribution center after encrypting the first key seed and the second ciphertext by the first key, the second ciphertext is generated by the key distribution center after encrypting the first key seed by the second key, and the first key seed is generated by the key distribution center; the first ciphertext decryption processing module can be used by the first device to decrypt the first ciphertext according to the first key to obtain the first key seed, the first key seed identifier and the second ciphertext; the first shared key determination module can be used by the first device to determine the first shared key in the at least one shared key, and determine the first shared key generation rule in the at least one shared key generation rule; the first session key first generation module The block can be used for the first device to perform key generation processing on the first shared key and the first key seed according to the first shared key generation rule to generate a first session key, wherein the first session key is used when the first device and the second device conduct an encrypted session; the second ciphertext forwarding module can be used for the first device to send the second ciphertext, the first shared key identifier corresponding to the first shared key, and the first shared key generation rule identifier corresponding to the first shared key generation rule to the second device, so that the second device determines the first key seed, the first shared key, and the first shared key generation rule according to the second ciphertext, the first shared key identifier, and the first shared key generation rule identifier, and performs key generation processing on the first shared key and the first key seed according to the first shared key generation rule to generate the first session key.
[0017] An embodiment of the present disclosure proposes an electronic device, which includes: a memory and a processor; the memory is used to store computer program instructions; the processor calls the computer program instructions stored in the memory to implement any of the key negotiation methods described above.
[0018] The embodiment of the present disclosure provides a computer-readable storage medium on which computer program instructions are stored to implement the key negotiation method as described in any one of the above items.
[0019] The embodiment of the present disclosure provides a computer program product or a computer program, which includes computer program instructions stored in a computer-readable storage medium. The computer program instructions are read from the computer-readable storage medium, and a processor executes the computer program instructions to implement the above-mentioned key negotiation method.
[0020] The key negotiation method, device, electronic device, computer-readable storage medium and computer program product provided by the embodiments of the present disclosure, on the one hand, use not only the shared key and shared key generation rules shared by the communicating parties but also the key seed encrypted and issued by a third party (key distribution center) when generating a session key, so that the session key can only be cracked when both the communicating parties and the third party are simultaneously hacked, so the present application improves the creativity of the session key; on the other hand, the present application combines the key seed of the third party when generating the session key, and the key seed can be used to improve the diversity of the session key, thereby avoiding the limitation of the session key caused by the limitation of the shared key and shared key rules stored by the communicating parties.
[0021] It is to be understood that the foregoing general description and the following detailed description are exemplary only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] The accompanying drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the specification are used to explain the principles of the present disclosure. Obviously, the accompanying drawings described below are only some embodiments of the present disclosure, and for ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without creative work.
[0023] Figure 1 A schematic diagram of a scenario that can be applied to a key negotiation method or a key negotiation device in an embodiment of the present disclosure is shown.
[0024] Figure 2 The present invention is a flowchart of a key negotiation method according to an exemplary embodiment.
[0025] Figure 3 A session key negotiation method is shown according to an exemplary embodiment.
[0026] Figure 4 The figure is a flowchart of a key seed request method according to an exemplary embodiment.
[0027] Figure 5 The present invention is a flowchart of a session key negotiation method according to an exemplary embodiment.
[0028] Figure 6 The present invention is a flowchart of a session key negotiation method according to an exemplary embodiment.
[0029] Figure 7 The present invention is a flowchart of a session key negotiation method according to an exemplary embodiment.
[0030] Figure 8The present invention is a flowchart of a session key negotiation method according to an exemplary embodiment.
[0031] Fig. 9 The present invention is a flowchart of a session key negotiation method according to an exemplary embodiment.
[0032] Fig.10 The present invention is a timing diagram showing a session key negotiation method according to an exemplary embodiment.
[0033] Fig.11 The present invention is a flowchart of a session key negotiation method according to an exemplary embodiment.
[0034] Fig.12 The present invention is a block diagram of a key negotiation device according to an exemplary embodiment.
[0035] Fig.13 The present invention is a block diagram of a key negotiation device according to an exemplary embodiment.
[0036] Fig.14 A schematic diagram of the structure of an electronic device suitable for implementing the embodiments of the present disclosure is shown. DETAILED DESCRIPTION
[0037] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in many forms and should not be construed as limited to the embodiments set forth herein; rather, these embodiments are provided so that this disclosure will be comprehensive and complete and will fully convey the concepts of the example embodiments to those skilled in the art. The same reference numerals in the figures represent the same or similar parts, and thus their repeated description will be omitted.
[0038] Those skilled in the art will appreciate that the embodiments of the present disclosure may be a system, device, apparatus, method or computer program product. Therefore, the present disclosure may be specifically implemented in the following forms, namely: complete hardware, complete software (including firmware, resident software, microcode, etc.), or a combination of hardware and software.
[0039] The features, structures or characteristics described in the present disclosure may be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present disclosure. However, those skilled in the art will appreciate that the technical solutions of the present disclosure may be practiced while omitting one or more of the specific details, or other methods, components, devices, steps, etc. may be adopted. In other cases, known methods, devices, implementations or operations are not shown or described in detail to avoid blurring the various aspects of the present disclosure.
[0040] In the embodiments of the present disclosure, the term "module" or "unit" refers to a computer program or a part of a computer program that has a predetermined function and works together with other related parts to achieve a predetermined goal, and can be implemented in whole or in part by using software, hardware (such as processing circuits or memories), or a combination thereof. Similarly, a processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be part of an overall module or unit that includes the function of the module or unit.
[0041] The accompanying drawings are only schematic diagrams of the present disclosure, and the same reference numerals in the drawings represent the same or similar parts, so their repeated description will be omitted. Some block diagrams shown in the accompanying drawings do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.
[0042] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the contents and steps, nor must they be executed in the order described. For example, some steps can be decomposed, and some steps can be combined or partially combined, so the actual execution order may change according to actual conditions.
[0043] In the description of the present disclosure, unless otherwise specified, " / " means "or", for example, A / B can mean A or B. "And / or" in this article is only a kind of association relationship describing the associated objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, "at least one" means one or more, and "plurality" means two or more. The words "first", "second", etc. do not limit the quantity and execution order, and the words "first", "second", etc. do not limit them to be different; the terms "comprising", "including" and "having" are used to express the meaning of open inclusion and mean that in addition to the listed elements / components / etc., there may be other elements / components / etc.
[0044] In order to more clearly understand the above-mentioned objects, features and advantages of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific implementation methods. It should be noted that the embodiments of the present invention and the features in the embodiments can be combined with each other without conflict.
[0045] It should be noted that the collection, collection, updating, analysis, processing, use, transmission, storage and other aspects of user personal information involved in the technical solution of this disclosure are in compliance with the provisions of relevant laws and regulations, are used for legitimate purposes, and do not violate public order and good morals. Necessary measures are taken for user personal information to prevent illegal access to user personal information data and maintain the security of user personal information and network security.
[0046] First, some terms involved in the embodiments of the present disclosure are explained below to facilitate understanding by those skilled in the art.
[0047] KDC (Key Distribution Center): is a central organization responsible for generating, distributing and managing keys for each node in a computer network.
[0048] QKD (Quantum Key Distribution): uses the characteristics of quantum mechanics to ensure communication security. It enables both parties in communication to generate and share a random, secure key.
[0049] ID (Identity) is a relatively unique code in a system, which is equivalent to an "identity card".
[0050] Keys are an important part of cryptographic technology and are divided into symmetric keys and asymmetric keys. The present invention discloses a method for generating and distributing symmetric keys, which can be used in scenarios where symmetric keys need to be generated between communicating parties in a network.
[0051] The foregoing introduces some terms and concepts involved in the embodiments of the present disclosure. The following introduces the technical features involved in the embodiments of the present disclosure.
[0052] The exemplary embodiments of the present disclosure are described in detail below with reference to the accompanying drawings.
[0053] Figure 1 A schematic diagram of a scenario that can be applied to a key negotiation method or a key negotiation device in an embodiment of the present disclosure is shown.
[0054] Please refer to Figure 1 , which shows a schematic diagram of an implementation environment provided by an exemplary embodiment of the present disclosure.
[0055] like Figure 1 As shown, the system architecture 100 may include terminal devices 101, 102, 103, a network 104 and a server 105. The network 104 is used to provide a medium for communication links between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.
[0056] Users can use terminal devices 101, 102, 103 to interact with server 105 through network 104 to receive or send messages, etc. Terminal devices 101, 102, 103 can be various electronic devices with display screens and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, desktop computers, wearable devices, virtual reality devices, smart homes, etc.
[0057] The server 105 may be a server that provides various services, such as a background management server that provides support for devices operated by users using the terminal devices 101, 102, and 103. The background management server may analyze and process the received request data, and feed back the processing results to the terminal device.
[0058] The server can be an independent physical server or a server cluster or distributed system composed of multiple physical servers. It can also be a cloud server that provides cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), as well as basic cloud computing services such as big data and artificial intelligence platforms, etc. The present disclosure does not impose any restrictions on this.
[0059] The server 105 may be, for example, a first device that receives a first ciphertext sent by a key distribution center. The first ciphertext is generated by the key distribution center after encrypting the first key seed and the second ciphertext with the first key. The second ciphertext is generated by the key distribution center after encrypting the first key seed with the second key. The first key seed is generated by the key distribution center. The server 105 may be, for example, a first device that decrypts the first ciphertext according to the first key to obtain the first key seed, the first key seed identifier, and the second ciphertext. The server 105 may be, for example, a first device that determines the first shared key in at least one shared key, and determines the first shared key generation rule in at least one shared key generation rule. The server 105 may be, for example, a first device that performs key generation processing on the first shared key and the first key seed according to the first shared key generation rule to generate a first session key, wherein the first session key is used when the first device and the second device have an encrypted session. The server 105 may, for example, send the second ciphertext, the first shared key identifier corresponding to the first shared key, and the first shared key generation rule identifier corresponding to the first shared key generation rule to the second device, so that the second device determines the first key seed, the first shared key, and the first shared key generation rule according to the second ciphertext, the first shared key identifier, and the first shared key generation rule identifier, and performs key generation processing on the first shared key and the first key seed according to the first shared key generation rule to generate a first session key.
[0060] It should be understood that Figure 1 The number of terminal devices, networks and servers in the figure is only for illustration. The server 105 may be a physical server or may be composed of multiple servers. According to actual needs, it may have any number of terminal devices, networks and servers.
[0061] Under the above system architecture, a key negotiation method is provided in an embodiment of the present disclosure, and the method can be executed by any electronic device with computing and processing capabilities.
[0062] Figure 2 The method provided in the embodiment of the present disclosure can be executed by any electronic device with computing and processing capabilities. For example, the method can be executed by the above-mentioned Figure 1 The server or terminal device in the embodiment may be executed, or the server and the terminal device may be executed together. In the following embodiments, the server is used as the execution subject for example, but the present disclosure is not limited to this.
[0063] Reference Figure 2 The key negotiation method provided by the embodiment of the present disclosure may include the following steps.
[0064] In some embodiments, the first device and the key distribution center share a first key, the second device and the key distribution center share a second key, and the first device and the second device share at least one shared key and at least one shared key generation rule.
[0065] The at least one shared key is at least one key that is set in advance and shared between the first device and the second device, and the at least one shared key generation rule is a key generation rule that is set in advance and shared between the first device and the second device. The key generation rule refers to a series of principles and requirements followed when generating keys for encrypting and decrypting data. These rules ensure the security, randomness, complexity and uniqueness of the key, thereby preventing unauthorized access and cracking.
[0066] Among them, the first device, the second device and the key distribution center can be independent parts, the first device (or the second device or the key distribution center) can be a terminal device, or a server, etc., and the present disclosure does not limit this.
[0067] Among them, the key distribution center can be a device independent of the first device, the second device, the third device and other devices that need to conduct encrypted calls, and the present disclosure does not impose any restrictions on this.
[0068] In some embodiments, a first key may be stored in the first device. The first key may be a key of the first device. The first key may be shared only between the first device and a key distribution center.
[0069] Similarly, the second device may store a second key, which may be shared only between the second device and the key distribution center; the third device may store a third key, which may be shared only between the third device and the key distribution center; and so on.
[0070] In step S202, the first device receives a first ciphertext issued by a key distribution center. The first ciphertext is generated by the key distribution center after encrypting a first key seed and a second ciphertext using a first key. The second ciphertext is generated by the key distribution center after encrypting a first key seed using a second key. The first key seed is generated by the key distribution center.
[0071] In some embodiments, the first key seed may be a random number generated by a key distribution center, and the first key seed may be used to generate a session key in the first device, the second device, or the third device.
[0072] The key distribution center may use the second key of the second device to encrypt the first key seed (or the first key seed identifier corresponding to the first key seed) to generate a second ciphertext, and then use the first key of the first device to encrypt the first key (or the first key seed identifier corresponding to the first key seed) and the second ciphertext to generate a first ciphertext.
[0073] In some embodiments, the key distribution center may send the first ciphertext to the first device.
[0074] Since the first key is only shared between the first device and the key distribution center, it will not be acquired by other devices, so that the first key seed will not be acquired by other people, thereby ensuring the security of the first key seed.
[0075] Step S204: The first device decrypts the first ciphertext according to the first key to obtain a first key seed, a first key seed identifier, and a second ciphertext.
[0076] In some embodiments, when the first device receives the first ciphertext sent by the key distribution center, it can decrypt the first ciphertext according to the first key to obtain the first key seed (and the first key seed identifier) and the second ciphertext.
[0077] In some embodiments, if the first key is a symmetric key, the first device decrypts the first ciphertext using the first key to obtain a first key seed, a first key seed identifier, and a second ciphertext.
[0078] In some embodiments, if the first key is a public key in an asymmetric key, the first device determines a private key corresponding to the first key, and decrypts the first ciphertext according to the private key to obtain a first key seed, a first key seed identifier, and a second ciphertext.
[0079] Step S206: The first device determines a first shared key from at least one shared key, and determines a first shared key generation rule from at least one shared key generation rule.
[0080] In some embodiments, the first device can determine a first shared key from at least one shared key (for example, randomly determine a shared key from at least one shared key as the first shared key) and a first shared key identifier corresponding to the first shared key, wherein the first shared key identifier corresponds one-to-one to the first shared key.
[0081] In some embodiments, the first device can determine a first shared key generation rule in at least one shared key generation rule (for example, randomly determine a key generation rule in at least one shared key generation rule as the first shared key generation rule) and a first shared key generation rule identifier corresponding to the first shared key generation rule, wherein the first shared key generation rule identifier corresponds one-to-one to the first shared key generation rule.
[0082] Step S208: The first device performs key generation processing on the first shared key and the first key seed according to the first shared key generation rule to generate a first session key, wherein the first session key is used when the first device and the second device perform an encrypted session.
[0083] In step S210, the first device sends the second ciphertext, the first shared key identifier corresponding to the first shared key, and the first shared key generation rule identifier corresponding to the first shared key generation rule to the second device, so that the second device determines the first key seed, the first shared key, and the first shared key generation rule according to the second ciphertext, the first shared key identifier, and the first shared key generation rule identifier, and performs key generation processing on the first shared key and the first key seed according to the first shared key generation rule to generate a first session key.
[0084] In some embodiments, the first device may send the second ciphertext, the first shared key identifier corresponding to the first shared key, and the first shared key generation rule identifier corresponding to the first shared key generation rule to the second device. For example, the second ciphertext, the first shared key identifier corresponding to the first shared key, and the first shared key generation rule identifier corresponding to the first shared key generation rule may be sent to the second device in an encrypted manner, or the second ciphertext, the first shared key identifier corresponding to the first shared key, and the first shared key generation rule identifier corresponding to the first shared key generation rule may be directly sent to the second device, and the present disclosure does not limit this.
[0085] In some embodiments, after receiving the second ciphertext, the first shared key identifier and the first shared key generation rule identifier, the second device can determine the first shared key in at least one shared key according to the first shared key identifier; the second device determines the first shared key generation rule in at least one shared key generation rule according to the first shared key generation rule identifier; the second device decrypts the second ciphertext according to the second key to obtain a first key seed; the second device performs key generation processing on the first shared key and the first key seed through the first shared key generation rule to generate a first session key, so as to conduct an encrypted session with the first device through the first session key.
[0086] In the above embodiment, the security of session key negotiation is improved by setting the key seed.
[0087] The technical solution provided by the above-mentioned embodiment, on the one hand, not only combines the shared key and shared key generation rules shared by the communicating parties when generating the session key, but also uses the key seed encrypted and issued by the third party (key distribution center), so that the session key can be cracked only when the communicating parties and the third party are simultaneously hacked, so the present application improves the security of the session key; on the other hand, the present application combines the key seed of the third party when generating the session key, and the key seed can be used to improve the diversity of the session key, thereby avoiding the limitation of the session key caused by the limitation of the shared key and shared key rules stored by the communicating parties.
[0088] Figure 3 A session key negotiation method is shown according to an exemplary embodiment.
[0089] In some embodiments, the first ciphertext may further include a first key seed identifier corresponding to the first key seed, and the second ciphertext may further include the first key seed identifier corresponding to the first key seed.
[0090] In some embodiments, the first device may store the first key seed and the first key seed identifier, so that the first device stores at least one key seed and a key seed identifier corresponding to each key seed.
[0091] In some embodiments, the second device may store the first key seed and the first key seed identifier, so that the second device stores at least one key seed and a key seed identifier corresponding to each key seed.
[0092] refer to Figure 3 The above session key negotiation method may include the following steps.
[0093] Step S302: The first device determines a second key seed and a second key seed identifier corresponding to the second key seed from at least one key seed.
[0094] In some embodiments, the first device determines the second key seed and the second key seed identifier corresponding to the second key seed from at least one key seed. For example, a key seed may be randomly determined from at least one key seed as the second key seed.
[0095] Step S304: The first device determines a second shared key and a second shared key identifier corresponding to the second shared key from at least one shared key.
[0096] In some embodiments, the first device may determine the second shared key (such as randomly determined) and a second shared key identifier corresponding to the second shared key from at least one shared key.
[0097] Step S306: The first device determines a second shared key generation rule and a second shared key generation rule identifier corresponding to the second shared key generation rule in at least one shared key generation rule.
[0098] In some embodiments, the first device may determine (eg, randomly determine) the second shared key generation rule and the second shared key generation rule identifier corresponding to the second shared key generation rule from at least one shared key generation rule.
[0099] Step S308: The first device performs key generation processing on the second shared key and the second key seed according to the second shared key generation rule to generate a second session key, wherein the second session key is used when the first device and the second device perform an encrypted session.
[0100] In step S310, the first device sends the second key seed identifier, the second shared key identifier and the second shared key generation rule identifier to the second device, so that the second device determines the second key seed, the second shared key and the second shared key generation rule from at least one key seed, at least one shared key and at least one shared key generation rule according to the second key seed identifier, the second shared key identifier and the second shared key generation rule identifier, and performs key generation processing on the second shared key and the second key seed according to the second shared key generation rule to generate a second session key.
[0101] In some embodiments, the second device can determine the second key seed from at least one key seed stored in the second device according to the second key seed identifier; the second device can also determine the second shared key from at least one shared key stored in the second device according to the second shared key identifier; the second device can also determine the second shared key generation rule from at least one shared key generation rule stored in the second device according to the second shared key generation rule identifier.
[0102] In some embodiments, the second device may perform key generation processing on the second shared key and the second key seed according to a second shared key generation rule to generate a second session key.
[0103] In some embodiments, the first device or the second device may store at least one key seed, and the first device may directly negotiate a session key with the second device through the key seed stored in the device, or the first device may apply to the key distribution center for a new key seed to negotiate a session key with the second device.
[0104] It should be understood that the storage space of the first device or the second device is limited, so the shared keys they store are also limited. As a result, if the session key is generated only based on the shared key, the number of session keys will also be single and limited.
[0105] The present disclosure introduces a key seed when generating a session key, and the key seed can be applied for from a key distribution center and stored in the first device and the second device. Then the key seed issued by the key distribution center can increase the diversity of the session key, thereby improving the security of the session key.
[0106] Next, the present disclosure will explain how the first device requests a key seed from a key distribution center in conjunction with a specific embodiment.
[0107] Figure 4 The figure is a flowchart of a key seed request method according to an exemplary embodiment.
[0108] refer to Figure 4The above-mentioned key seed request method may include the following steps.
[0109] Step S402: The first device determines to communicate with the second device.
[0110] Step S404: The first device determines a first device identifier corresponding to the first device and a second device identifier corresponding to the second device.
[0111] In some embodiments, when the first device determines to communicate with the second device, the first device may obtain a first device identifier corresponding to the first device and a second device identifier corresponding to the second device.
[0112] Step S406: The first device generates first key seed request information according to the first device identifier and the second device identifier.
[0113] In some embodiments, the first device may generate a key seed request message according to the first device identifier and the second device identifier as the first key seed request message, and the first key seed request message may carry the first device identifier and the second device identifier.
[0114] In step S408, the first device sends the first key seed request information to the key distribution center, so that the key distribution center determines the first key and the second key according to the first device identifier and the second device identifier in the first key seed request information, and encrypts the first key seed according to the first key and the second key to generate the second ciphertext and the first ciphertext.
[0115] In some embodiments, when the key distribution center receives the first key seed request information, it obtains the first device identifier and the second device identifier, and then learns that the first device and the second device want to communicate. Then the key distribution center associates the first key through the first device identifier and associates the second key through the second device identifier, and then randomly generates a random number as the first key seed.
[0116] In some embodiments, when the key distribution center determines that the first key is to negotiate a session key with the second key, the key distribution center will first encrypt the first key seed (or the first key seed identifier) with the second key to obtain the second ciphertext; and then encrypt the second ciphertext and the first key seed (or the first key seed identifier) with the first key to obtain the first ciphertext.
[0117] In some embodiments, after the key distribution center generates the first ciphertext, it sends the first ciphertext to the first device.
[0118] Through the above method, it is possible to prevent the first key seed from being obtained by other devices other than the communicating parties, thereby improving the security of the first key seed.
[0119] Figure 5 The present invention is a flowchart of a session key negotiation method according to an exemplary embodiment.
[0120] In some embodiments, the third device may share and store a third key with the key distribution center. The third device also stores at least one shared key and at least one shared key generation rule. The first ciphertext may also include a third ciphertext, which is generated by the key distribution center after encrypting the first key seed using the third key.
[0121] refer to Figure 5 The above session key negotiation method may include the following steps.
[0122] In step S502, the first device receives a first ciphertext issued by a key distribution center. The first ciphertext is generated by the key distribution center after encrypting the first key seed, the second ciphertext and the third ciphertext with the first key. The second ciphertext is generated by the key distribution center after encrypting the first key seed with the second key. The third ciphertext is generated by the key distribution center after encrypting the first key seed with the third key. The first key seed is generated by the key distribution center.
[0123] Step S504: The first device decrypts the first ciphertext according to the first key to obtain a first key seed, a first key seed identifier, and a second ciphertext.
[0124] Step S506: The first device determines a first shared key from at least one shared key, and determines a first shared key generation rule from at least one shared key generation rule.
[0125] Step S508: The first device performs key generation processing on the first shared key and the first key seed according to the first shared key generation rule to generate a first session key, wherein the first session key is used when the first device and the second device perform an encrypted session.
[0126] In step S510, the first device sends the second ciphertext, the first shared key identifier corresponding to the first shared key, and the first shared key generation rule identifier corresponding to the first shared key generation rule to the second device, so that the second device determines the first key seed, the first shared key, and the first shared key generation rule according to the second ciphertext, the first shared key identifier, and the first shared key generation rule identifier, and performs key generation processing on the first shared key and the first key seed according to the first shared key generation rule to generate a first session key.
[0127] In step S512, the first device sends the third ciphertext, the first shared key identifier and the first shared key generation rule identifier to the third device, so that the third device determines the first key seed, the first shared key and the first shared key generation rule according to the third ciphertext, the first shared key identifier and the first shared key generation rule identifier, and performs key generation processing on the first shared key and the first key seed according to the first shared key generation rule to generate a first session key, wherein the first session key is used when the first device, the second device and the third device conduct encrypted calls.
[0128] Through the above method, the session key can be securely negotiated during multi-party communication, thereby improving the security of the session key.
[0129] Figure 6 The present invention is a flowchart of a session key negotiation method according to an exemplary embodiment.
[0130] refer to Figure 6 The above session key negotiation method may include the following steps.
[0131] Step S602: The first device determines to communicate with the second device and the third device.
[0132] Step S604: The first device determines a first device identifier corresponding to the first device, a second device identifier corresponding to the second device, and a third device identifier corresponding to the third device.
[0133] Step S606: The first device generates second key seed request information according to the first device identifier, the second device identifier, and the third device identifier.
[0134] Step S608, the first device sends the second key seed request information to the key distribution center, so that the key distribution center determines the first key, the second key and the third key according to the first device identifier, the second device identifier and the third device identifier in the second key seed request information, and encrypts the first key seed and the first key seed identifier according to the first key, the second key and the third key to generate the second ciphertext, the third ciphertext and the first ciphertext.
[0135] Through the above method, the first key seed can be securely generated for the first device, the second device and the third device, so that the first device, the second device and the third device can securely generate a session key according to the first key seed.
[0136] Figure 7 The present invention is a flowchart of a session key negotiation method according to an exemplary embodiment.
[0137] In some embodiments, the second device and the key distribution center share and store the second key.
[0138] In some embodiments, the second device stores at least one shared key and at least one shared key generation rule.
[0139] Step S702, the second device receives a second ciphertext, a first shared key identifier and a first shared key generation rule identifier from the first device, the second ciphertext is generated by the key distribution center after encrypting the first key seed according to the second key, and the first key seed is generated by the key distribution center.
[0140] Step S704: The second device determines a first shared key from at least one shared key according to the first shared key identifier.
[0141] Step S706: The second device determines a first shared key generation rule from at least one shared key generation rule according to the first shared key generation rule identifier.
[0142] Step S708: The second device decrypts the second ciphertext according to the second key to obtain the first key seed.
[0143] In step S710, the second device performs key generation processing on the first shared key and the first key seed according to the first shared key generation rule to generate a first session key, so as to perform an encrypted session with the first device through the first session key.
[0144] Through the above method, the security of the first session key generated by the second device is improved.
[0145] Figure 8 The present invention is a flowchart of a session key negotiation method according to an exemplary embodiment.
[0146] In some embodiments, the second device may store the first key seed and the first key seed identifier, so that the second device includes at least one key seed and a key seed identifier corresponding to each key seed.
[0147] In some embodiments, the key seed used by the second device when generating the session key may be obtained locally or from a key distribution center.
[0148] Next, the present disclosure will explain how to obtain a key seed locally to generate a session key.
[0149] refer to Figure 8 The above session key negotiation method may include the following steps.
[0150] Step S802: The second device receives a second key seed identifier, a second shared key identifier, and a second shared key generation rule identifier from the first device.
[0151] Step S804: The second device determines a second key seed from at least one key seed according to the second key seed identifier.
[0152] Step S806: The second device determines a second shared key from at least one shared key according to the second shared key identifier.
[0153] Step S808: The second device determines a second shared key generation rule from at least one shared key generation rule according to the second shared key generation rule identifier.
[0154] Step S810: The second device performs key generation processing on the second shared key and the second key seed according to the second shared key generation rule to generate a second session key, wherein the second session key is used when the first device and the second device perform an encrypted session.
[0155] Fig. 9 The present invention is a flowchart of a session key negotiation method according to an exemplary embodiment.
[0156] Technical highlights of this embodiment: (1) The symmetric key is transparent to the third-party key distribution center, and only the communicating parties know the key; (2) The symmetric key can be generated and updated in real time; (3) The communicating parties do not need to have quantum mechanics means or configure expensive QKD equipment to obtain high entropy keys in real time.
[0157] refer to Fig. 9 The above session key negotiation method may include the following steps.
[0158] The first device 901 and the key distribution center 902 pre-share a key K A-KDC The second device 903 and the key distribution center 902 pre-share the key K B-KDC ; The first device 901 and the second device 903 pre-share a key group: K1, K2, K3, ..., K n (n≥1); a pre-shared key generation rule group of the first device 901 and the second device 903: K DF1 , K DF2 , …, K DFn (n≥1).
[0159] In some embodiments, the first device may be identified by the first device ID DA and the second device identifier I DB Request the key seed from the distribution center.
[0160] In some embodiments, in response to a request from the first device, the key distribution center may generate a random number R as a key seed.
[0161] In some embodiments, the key distribution center can use the first key KA-KDC and the second key K B-KDC Generate ciphertext K A-KDC (I DR , R, K B-KDC (I DR , R), and then sent to the first device. DR It can be the identifier corresponding to the random number R.
[0162] The first device can use the first key K A-KDC K A-KDC (I DR , R, K B-KDC (I DR , R) is decrypted to obtain the random number R.
[0163] In some embodiments, the first device 901 and the second device 903 may determine whether to generate a key seed through negotiation. If a key seed needs to be generated, the first device 901 may request a key seed from the key distribution center 902 through the above method.
[0164] In some embodiments, the first device 901 may process a certain key in the pre-shared key and a random number R according to a certain rule in the pre-shared key generation rule group to generate a session key.
[0165] In some embodiments, the first device 901 may use the key seed identifier used when generating the session key or the key K B-KDC (I DR , R) is sent to the second device 903, and the rule used in generating the session key and the identifier corresponding to the pre-shared key are sent to the second device 903, so that the second device 903 also generates a corresponding session key.
[0166] in addition, Fig. 9 The session key negotiation method shown can be achieved by Fig.10 The timing diagram shown is implemented. Fig.10 The timing diagram shown can be Fig.11 The flowchart shown is explained and illustrated.
[0167] refer to Fig.11 , Fig.10 The session key negotiation method shown may include the following steps.
[0168] Step S1102: Preparation. The first device and the KDC pre-share a key K A-KDC , the second device and KDC pre-shared key K B-KDC ; The first device and the second device pre-shared key group: K1, K2, K3..., K n(n≥1); The first device and the second device pre-shared key generation rule group: K DF1 , K DF2 , …, K DFn (n≥1).
[0169] Among them, KDC is the key distribution center.
[0170] Step S1104, determine whether it is necessary to generate a key seed.
[0171] If it is not necessary to generate a key seed, execute steps S1106 to S1108; if it is necessary to generate a key seed, execute steps S1110 to S1118.
[0172] Step S1106 , the first device sends the ID of the pre-shared key (Ki), the ID of the pre-shared key generation rule (KDFi), and the ID of the key seed (R) to the second device.
[0173] Step S1108: The second device selects the corresponding key rule and shared key locally according to the received parameters to generate a symmetric key NR, where NR = KDF i (K i , R).
[0174] Step S1110: The first device applies for a key seed from the KDC, and the application message includes the first device identity and the second device identity.
[0175] In step S1112, the KDC locally generates a random number R as a key seed, and sends it to the first device in an encrypted manner.
[0176] Step S1114: After receiving the first device, use K A-KDC Decrypt to obtain R identification (ID) plaintext, R plaintext, K B-KDC (I DR Optionally, the first device may securely store the R identifier and R locally.
[0177] Step S1116: The first device sets K B-KDC (I DR , R) the ciphertext is sent to the second device, and the first device sends the pre-shared key ID and the pre-shared key generation rule ID to the second device.
[0178] Step S1118: After receiving the second device, use K B-KDC The R identifier plaintext and R plaintext are obtained by decryption. Optionally, the second device may securely store the R identifier and R locally.
[0179] The second device selects the corresponding secret locally based on the received pre-shared key ID and pre-shared key generation rule ID. The second device generates a symmetric key NR, NR = KDF i (K i , R).
[0180] In some embodiments, when there is only one key or one rule in the pre-shared key group or the pre-shared key rule group, the communicating parties do not need to perform parameter negotiation, and the network bandwidth and communication load are not increased.
[0181] In the above embodiment, all communicating parties can obtain a high entropy key, which requires little equipment modification and has a wider range of application scenarios.
[0182] The technical solution provided in this application can be used not only for the generation and distribution of symmetric keys for two-party communications, but also for multi-party communications.
[0183] The symmetric key generation methods in the related art mainly include those based on third-party KDC, pre-set keys, and quantum key distribution, which have the disadvantages of the key being known to the third party, difficulty in key update, and high cost. In view of the shortcomings of the existing methods, the method proposed in the present invention can generate high-entropy symmetric keys in real time, and the generated symmetric keys will not be known to the third party.
[0184] Symmetric keys are widely used. The method proposed in the present disclosure can be arbitrarily combined with various implementation methods to meet different application requirements.
[0185] In the present disclosure, the number of pre-shared keys, the number of pre-shared key rules, and the generation frequency of key seeds can all be flexibly set, and these three parameters can be arbitrarily combined, and the generation source of the key seeds can also be selected as needed. Therefore, the local storage capacity size of the communicating parties, the network communication bandwidth size, and the third-party KDC cost size can have high flexibility and can be used in different application scenarios.
[0186] The present disclosure is applicable to scenarios where communicating parties need to generate symmetric keys. High entropy keys can be obtained in real time without the need for quantum mechanics. The keys are only known to the communicating parties and will not be leaked to a third-party KDC. It has the characteristics of high flexibility and high security.
[0187] In the method described in the present disclosure, each communication party pre-shares a key group and a key generation rule group, and these keys and key generation rules are securely stored locally. When a symmetric key needs to be generated, the communication initiator applies for a key seed from a third-party KDC. The key seed is equipped with a key unique identifier and is issued in a symmetric encryption manner. After receiving the key seed, each communication party can store it locally for a long time in a secure manner for subsequent multiple uses; it can also be destroyed after use and the key seed can be replaced as needed to achieve higher security. The generation of symmetric keys in the present disclosure is based on the pre-shared key identifier and pre-shared key generation rule identifier negotiated by the communication parties, and the corresponding secret is selected locally, and then combined with the key seed, according to the previously stored derivation method, to generate a symmetric key. Each communication party does not need to be equipped with a dedicated QKD device, and can configure a quantum random number generator or other true random number generator at the third-party KDC, so that the generated key seed has high entropy, and the symmetric key generated based on the key seed has higher security, avoiding cracking by quantum computers or other high-computing computers.
[0188] In addition, it should be noted that the various different implementations in the present disclosure can also be combined arbitrarily. The present disclosure is not only used for two-party communication, but also for multi-party communication.
[0189] It should be particularly pointed out that the various steps in the various embodiments of the above key negotiation method can be mutually crossed, replaced, added, or deleted. Therefore, these reasonable permutations and combinations of the key negotiation method should also fall within the scope of protection of the present disclosure, and the scope of protection of the present disclosure should not be limited to the embodiments.
[0190] Based on the same inventive concept, the present disclosure also provides a key negotiation device, such as the following embodiment. Since the principle of solving the problem in the device embodiment is similar to that in the above method embodiment, the implementation of the device embodiment can refer to the implementation of the above method embodiment, and the repeated parts will not be repeated.
[0191] Fig.12 The present invention is a block diagram of a key negotiation device according to an exemplary embodiment.
[0192] The first device and the key distribution center share a first key, the second device and the key distribution center share a second key, and the first device and the second device share at least one shared key and at least one shared key generation rule. Fig.12 The key negotiation device 1200 provided in the embodiment of the present disclosure may include: a first ciphertext receiving module 1201, a first ciphertext decryption processing module 1202, a first shared key determination module 1203, a first session key first generation module 1204 and a second ciphertext forwarding module 1205.
[0193] Among them, the first ciphertext receiving module 1201 can be used to receive the first ciphertext issued by the key distribution center, the first ciphertext is generated by the key distribution center after encrypting the first key seed and the second ciphertext with the first key, the second ciphertext is generated by the key distribution center after encrypting the first key seed with the second key, and the first key seed is generated by the key distribution center; the first ciphertext decryption processing module 1202 can be used to decrypt the first ciphertext according to the first key to obtain the first key seed, the first key seed identifier and the second ciphertext; the first shared key determination module 1203 can be used to determine the first shared key in at least one shared key, and determine the first shared key generation rule in at least one shared key generation rule; the first session key first generation module 1203 Module 1204 can be used to perform key generation processing on the first shared key and the first key seed according to the first shared key generation rule to generate a first session key, wherein the first session key is used when the first device and the second device conduct an encrypted session; the second ciphertext forwarding module 1205 can be used to send the second ciphertext, the first shared key identifier corresponding to the first shared key, and the first shared key generation rule identifier corresponding to the first shared key generation rule to the second device, so that the second device determines the first key seed, the first shared key, and the first shared key generation rule according to the second ciphertext, the first shared key identifier, and the first shared key generation rule identifier, and performs key generation processing on the first shared key and the first key seed according to the first shared key generation rule to generate a first session key.
[0194] It should be noted that the first ciphertext receiving module 1201, the first ciphertext decryption processing module 1202, the first shared key determination module 1203, the first session key first generation module 1204 and the second ciphertext forwarding module 1205 correspond to S202 to S210 in the method embodiment, and the examples and application scenarios implemented by the above modules and the corresponding steps are the same, but are not limited to the contents disclosed in the above method embodiment. It should be noted that the above modules as part of the device can be executed in a computer system such as a set of computer executable instructions.
[0195] In some embodiments, the first ciphertext also includes a first key seed identifier corresponding to the first key seed, and the second ciphertext also includes a first key seed identifier corresponding to the first key seed; the first device stores the first key seed and the first key seed identifier so that the first device stores at least one key seed and the key seed identifier corresponding to each key seed; the second device stores the first key seed and the first key seed identifier so that the second device stores at least one key seed and the key seed identifier corresponding to each key seed; wherein the key negotiation device 1200 may also include: a second key seed identifier determination module, a second shared key identifier determination module, a second shared key generation rule identifier generation module, a second session key negotiation module, and a second key seed identifier sending module.
[0196] Among them, the second key seed identifier determination module can be used to determine the second key seed and the second key seed identifier corresponding to the second key seed in at least one key seed; the second shared key identifier determination module can be used to determine the second shared key identifier corresponding to the second shared key in at least one shared key; the second shared key generation rule identifier generation module can be used to determine the second shared key generation rule and the second shared key generation rule identifier corresponding to the second shared key generation rule in at least one shared key generation rule; the second session key negotiation module can be used to perform key generation processing on the second shared key and the second key seed according to the second shared key generation rule to generate a second session key, wherein the second session key is used when the first device and the second device perform an encrypted session; the second key seed identifier sending module can be used to send the second key seed identifier, the second shared key identifier and the second shared key generation rule identifier to the second device, so that the second device determines the second key seed, the second shared key and the second shared key generation rule in at least one key seed, at least one shared key and at least one shared key generation rule respectively according to the second key seed identifier, the second shared key identifier and the second shared key generation rule identifier, and performs key generation processing on the second shared key and the second key seed according to the second shared key generation rule to generate a second session key.
[0197] In some embodiments, the first ciphertext decryption processing module 1202 may include: a first decryption submodule and a second decryption submodule.
[0198] Among them, the first decryption submodule is used to decrypt the first ciphertext by using the first key if the first key is a symmetric key, so as to obtain the first key seed, the first key seed identifier and the second ciphertext; the second decryption submodule is used to determine the private key corresponding to the first key if the first key is a public key in an asymmetric key, and decrypt the first ciphertext according to the private key to obtain the first key seed, the first key seed identifier and the second ciphertext.
[0199] In some embodiments, key agreement apparatus 1200 may include: a first communication object determination module, a first device identification determination module, a first key seed request information generation module, and a first key seed request information sending module.
[0200] Among them, the first communication object determination module is used to determine the communication with the second device before receiving the first ciphertext issued by the key distribution center; the first device identification determination module can be used to determine the first device identification corresponding to the first device and the second device identification corresponding to the second device; the first key seed request information generation module can be used to generate the first key seed request information according to the first device identification and the second device identification; the first key seed request information sending module can be used to send the first key seed request information to the key distribution center, so that the key distribution center determines the first key and the second key according to the first device identification and the second device identification in the first key seed request information, and encrypts the first key seed according to the first key and the second key to generate the second ciphertext and the first ciphertext.
[0201] In some embodiments, the third device and the key distribution center share and store a third key, the third device also stores at least one shared key and at least one shared key generation rule, the first ciphertext also includes a third ciphertext, and the third ciphertext is generated by the key distribution center after encrypting the first key seed using the third key; the key agreement device 1200 may also include: a third ciphertext sending module.
[0202] Among them, the third ciphertext sending module can be used to send the third ciphertext, the first shared key identifier and the first shared key generation rule identifier to the third device, so that the third device determines the first key seed, the first shared key and the first shared key generation rule according to the third ciphertext, the first shared key identifier and the first shared key generation rule identifier, and performs key generation processing on the first shared key and the first key seed according to the first shared key generation rule to generate a first session key, wherein the first session key is used when the first device, the second device and the third device conduct encrypted calls.
[0203] In some embodiments, before the first device receives the first ciphertext sent by the key distribution center, the key agreement apparatus 1200 may further include: a second communication device determination module, a third device identification determination module, a second key seed request information generation module and a second key seed request information sending module.
[0204] Among them, the second communication device determination module can be used to determine communication with the second device and the third device; the third device identification determination module can be used to determine the first device identification corresponding to the first device, the second device identification corresponding to the second device, and the third device identification corresponding to the third device; the second key seed request information generation module can be used to generate the second key seed request information according to the first device identification, the second device identification and the third device identification; the second key seed request information sending module can be used to send the second key seed request information to the key distribution center, so that the key distribution center determines the first key, the second key and the third key according to the first device identification, the second device identification and the third device identification in the second key seed request information, and encrypts the first key seed and the first key seed identification according to the first key, the second key and the third key to generate the second ciphertext, the third ciphertext and the first ciphertext.
[0205] Since the functions of the device 1200 have been described in detail in the corresponding method embodiments, the present disclosure will not elaborate on them here.
[0206] Fig.13 The block diagram of a key negotiation device according to an exemplary embodiment is shown. The key negotiation device is deployed on a second device, and the second device and the key distribution center share and store a second key; the second device stores at least one shared key and at least one shared key generation rule. Fig.13 The key negotiation device 1300 provided in the embodiment of the present disclosure may include: a second ciphertext receiving module 1301, a first shared key screening module 1302, a first shared key generation rule screening module 1303, a first ciphertext decryption module 1304 and a first session key second generation module 1305.
[0207] Among them, the second ciphertext receiving module 1301 can be used to receive the second ciphertext, the first shared key identifier and the first shared key generation rule identifier from the first device, the second ciphertext is generated by the key distribution center after encrypting the first key seed according to the second key, and the first key seed is generated by the key distribution center; the first shared key screening module 1302 can be used to determine the first shared key in at least one shared key according to the first shared key identifier; the first shared key generation rule screening module 1303 can be used to determine the first shared key generation rule in at least one shared key generation rule according to the first shared key generation rule identifier; the first ciphertext decryption module 1304 can be used to decrypt the second ciphertext according to the second key to obtain the first key seed; the first session key second generation module 1305 can be used to perform key generation processing on the first shared key and the first key seed through the first shared key generation rule to generate a first session key, so as to conduct an encrypted session with the first device through the first session key.
[0208] In some embodiments, the second device stores the first key seed and the first key seed identifier so that the second device includes at least one key seed and a key seed identifier corresponding to each key seed; wherein the key agreement apparatus 1300 may further include: a second key seed identifier receiving module, a second key seed determination module, a second shared key determination module, a second shared key generation rule determination module, and a second key generation module.
[0209] Among them, the second key seed identifier receiving module can be used to receive the second key seed identifier, the second shared key identifier and the second shared key generation rule identifier from the first device; the second key seed determination module can be used to determine the second key seed in at least one key seed according to the second key seed identifier; the second shared key determination module can be used to determine the second shared key in at least one shared key according to the second shared key identifier; the second shared key generation rule determination module can be used to determine the second shared key generation rule in at least one shared key generation rule according to the second shared key generation rule identifier; the second key generation module can be used to perform key generation processing on the second shared key and the second key seed through the second shared key generation rule to generate a second session key, wherein the second session key is used when the first device and the second device conduct an encrypted session.
[0210] Since the functions of the device 1300 have been described in detail in the corresponding method embodiments, the present disclosure will not elaborate on them here.
[0211] The modules and / or submodules involved in the embodiments described in the present disclosure may be implemented by software or hardware. The modules and / or submodules described may also be arranged in a processor. The names of these modules and / or submodules do not, in certain cases, constitute limitations on the modules and / or submodules themselves.
[0212] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a part of a module or program segment, and a part of the above-mentioned module or program segment contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in an order different from that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart, can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer program instructions.
[0213] In addition, the above-mentioned figures are only schematic illustrations of the processes included in the method according to the exemplary embodiments of the present disclosure, and are not intended to be limiting. It is easy to understand that the processes shown in the above-mentioned figures do not indicate or limit the time sequence of these processes. In addition, it is also easy to understand that these processes can be performed synchronously or asynchronously, for example, in multiple modules.
[0214] Fig.14 FIG. 1 shows a schematic diagram of the structure of an electronic device suitable for implementing the embodiment of the present disclosure. It should be noted that: Fig.14 The electronic device 1400 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0215] like Fig.14 As shown, the electronic device 1400 includes a central processing unit (CPU) 1401, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1402 or a program loaded from a storage part 1408 into a random access memory (RAM) 1403. In the RAM 1403, various programs and data required for the operation of the electronic device 1400 are also stored. The CPU 1401, the ROM 1402, and the RAM 1403 are connected to each other via a bus 1404. An input / output (I / O) interface 1405 is also connected to the bus 1404.
[0216] The following components are connected to the I / O interface 1405: an input section 1406 including a keyboard, a mouse, etc.; an output section 1407 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 1408 including a hard disk, etc.; and a communication section 1409 including a network interface card such as a LAN card, a modem, etc. The communication section 1409 performs communication processing via a network such as the Internet. A drive 1410 is also connected to the I / O interface 1405 as needed. A removable medium 1411, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 1410 as needed, so that a computer program read therefrom is installed into the storage section 1408 as needed.
[0217] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable storage medium, and the computer program contains computer program instructions for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through the communication part 1409, and / or installed from a removable medium 1411. When the computer program is executed by the central processing unit (CPU) 1401, the above-mentioned functions defined in the system of the present disclosure are executed.
[0218] It should be noted that the computer-readable storage medium shown in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries computer-readable computer program instructions. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer-readable signal medium may also be any computer-readable storage medium other than a computer-readable storage medium that can send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The computer program instructions contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0219] As another aspect, the present disclosure also provides a computer-readable storage medium, which may be included in the device described in the above embodiment; or it may exist independently and not be assembled into the device. The above computer-readable storage medium carries one or more programs. When the above one or more programs are executed by a device, the device can realize functions including: the first device receives a first ciphertext issued by a key distribution center, the first ciphertext is generated by the key distribution center after encrypting the first key seed and the second ciphertext with the first key, the second ciphertext is generated by the key distribution center after encrypting the first key seed with the second key, and the first key seed is generated by the key distribution center; the first device decrypts the first ciphertext according to the first key to obtain the first key seed, the first key seed identifier and the second ciphertext; the first device determines the first shared key in at least one shared key, and determines the first shared key in at least one shared key generation rule. a first shared key generation rule; the first device performs key generation processing on the first shared key and the first key seed according to the first shared key generation rule to generate a first session key, wherein the first session key is used when the first device and the second device conduct an encrypted session; the first device sends the second ciphertext, the first shared key identifier corresponding to the first shared key, and the first shared key generation rule identifier corresponding to the first shared key generation rule to the second device, so that the second device determines the first key seed, the first shared key, and the first shared key generation rule according to the second ciphertext, the first shared key identifier, and the first shared key generation rule identifier, and performs key generation processing on the first shared key and the first key seed according to the first shared key generation rule to generate a first session key.
[0220] According to one aspect of the present disclosure, a computer program product or a computer program is provided, the computer program product or the computer program comprising computer program instructions, the computer program instructions being stored in a computer-readable storage medium. The computer program instructions are read from the computer-readable storage medium, and a processor executes the computer program instructions to implement the methods provided in various optional implementations of the above embodiments.
[0221] Through the description of the above implementation methods, it is easy for those skilled in the art to understand that the example implementation methods described here can be implemented by software, or by combining software with necessary hardware. Therefore, the technical solution of the embodiment of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.), including a number of computer program instructions for enabling an electronic device (which can be a server or a terminal device, etc.) to execute the method according to the embodiment of the present disclosure.
[0222] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the disclosure disclosed herein. The present disclosure is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary technical means in the art that are not disclosed in the present disclosure. The specification and embodiments are to be regarded as exemplary only, and the true scope and spirit of the present disclosure are indicated by the claims.
[0223] It should be understood that the present disclosure is not limited to the detailed structures, drawings or implementations shown herein, but rather the present disclosure is intended to cover various modifications and equivalent arrangements included within the spirit and scope of the appended claims.
Claims
1. A key negotiation method, characterized in that: The first device and the key distribution center share a first key, the second device and the key distribution center share a second key, and the first device and the second device share at least one shared key and at least one shared key generation rule; wherein the method includes: The first device receives a first ciphertext sent by the key distribution center, where the first ciphertext is generated by the key distribution center encrypting a first key seed and a second ciphertext by using the first key, the second ciphertext is generated by the key distribution center encrypting the first key seed by using the second key, and the first key seed is generated by the key distribution center; The first device decrypts the first ciphertext according to the first key to obtain the first key seed, the first key seed identifier, and the second ciphertext; The first device determines a first shared key in the at least one shared key, and determines a first shared key generation rule in the at least one shared key generation rule; The first device performs key generation processing on the first shared key and the first key seed according to the first shared key generation rule to generate a first session key, wherein the first session key is used when the first device and the second device perform an encryption session; The first device sends the second ciphertext, the first shared key identifier corresponding to the first shared key, and the first shared key generation rule identifier corresponding to the first shared key generation rule to the second device, so that the second device determines the first key seed, the first shared key, and the first shared key generation rule according to the second ciphertext, the first shared key identifier, and the first shared key generation rule identifier, and performs key generation processing on the first shared key and the first key seed according to the first shared key generation rule to generate the first session key; The first ciphertext further includes a first key seed identifier corresponding to the first key seed, and the second ciphertext further includes a first key seed identifier corresponding to the first key seed; the first device stores the first key seed and the first key seed identifier, so that the first device stores at least one key seed and a key seed identifier corresponding to each key seed; the second device stores the first key seed and the first key seed identifier, so that the second device stores at least one key seed and a key seed identifier corresponding to each key seed; the method further includes: The first device determines a second key seed and a second key seed identifier corresponding to the second key seed from the at least one key seed; The first device determines, from the at least one shared key, a second shared key and a second shared key identifier corresponding to the second shared key; The first device determines, from the at least one shared key generation rule, a second shared key generation rule and a second shared key generation rule identifier corresponding to the second shared key generation rule; The first device performs key generation processing on the second shared key and the second key seed according to the second shared key generation rule to generate a second session key, wherein the second session key is used when the first device and the second device perform an encryption session; The first device sends the second key seed identifier, the second shared key identifier and the second shared key generation rule identifier to the second device, so that the second device determines the second key seed, the second shared key and the second shared key generation rule from the at least one key seed, the at least one shared key and the at least one shared key generation rule according to the second key seed identifier, the second shared key identifier and the second shared key generation rule identifier, and performs key generation processing on the second shared key and the second key seed according to the second shared key generation rule to generate the second session key.
2. The method according to claim 1, characterized in that: The first device decrypts the first ciphertext according to the first key to obtain the first key seed, the first key seed identifier, and the second ciphertext, including: If the first key is a symmetric key, the first device decrypts the first ciphertext by using the first key to obtain the first key seed, the first key seed identifier and the second ciphertext; If the first key is a public key in an asymmetric key, the first device determines a private key corresponding to the first key, and decrypts the first ciphertext according to the private key to obtain the first key seed, the first key seed identifier and the second ciphertext.
3. The method according to claim 1, characterized in that: Before the first device receives the first ciphertext sent by the key distribution center, the method further includes: The first device determines to communicate with the second device; Determining, by the first device, a first device identifier corresponding to the first device and a second device identifier corresponding to the second device; The first device generates first key seed request information according to the first device identifier and the second device identifier; The first device sends the first key seed request information to the key distribution center, so that the key distribution center determines the first key and the second key according to the first device identifier and the second device identifier in the first key seed request information, and encrypts the first key seed according to the first key and the second key to generate the second ciphertext and the first ciphertext.
4. The method according to claim 1, characterized in that: The third device and the key distribution center store a third key in a shared manner, the third device also stores the at least one shared key and the at least one shared key generation rule, the first ciphertext further includes a third ciphertext, and the third ciphertext is generated by the key distribution center after encrypting the first key seed with the third key; the method further includes: The first device sends the third ciphertext, the first shared key identifier and the first shared key generation rule identifier to the third device, so that the third device determines the first key seed, the first shared key and the first shared key generation rule according to the third ciphertext, the first shared key identifier and the first shared key generation rule identifier, and performs key generation processing on the first shared key and the first key seed according to the first shared key generation rule to generate the first session key, wherein the first session key is used when the first device, the second device and the third device conduct encrypted calls.
5. The method according to claim 4, characterized in that: Before the first device receives the first ciphertext sent by the key distribution center, the method further includes: The first device determines to communicate with the second device and the third device; Determining, by the first device, a first device identifier corresponding to the first device, a second device identifier corresponding to the second device, and a third device identifier corresponding to the third device; The first device generates second key seed request information according to the first device identifier, the second device identifier, and the third device identifier; The first device sends the second key seed request information to the key distribution center, so that the key distribution center determines the first key, the second key and the third key according to the first device identifier, the second device identifier and the third device identifier in the second key seed request information, and encrypts the first key seed and the first key seed identifier according to the first key, the second key and the third key to generate the second ciphertext, the third ciphertext and the first ciphertext.
6. A key negotiation method, characterized in that: The second device and the key distribution center store a second key in a shared manner; the second device stores at least one shared key and at least one shared key generation rule; wherein the method comprises: The second device receives a second ciphertext, a first shared key identifier, and a first shared key generation rule identifier from the first device, wherein the second ciphertext is generated by the key distribution center after encrypting a first key seed according to the second key, and the first key seed is generated by the key distribution center; The second device determines a first shared key from the at least one shared key according to the first shared key identifier; The second device determines a first shared key generation rule from the at least one shared key generation rule according to the first shared key generation rule identifier; The second device decrypts the second ciphertext according to the second key to obtain the first key seed; The second device performs key generation processing on the first shared key and the first key seed according to the first shared key generation rule to generate a first session key, so as to perform an encrypted session with the first device through the first session key; wherein the second device stores the first key seed and the first key seed identifier, so that the second device includes at least one key seed and a key seed identifier corresponding to each key seed; wherein the method further includes: The second device receives a second key seed identifier, a second shared key identifier, and a second shared key generation rule identifier from the first device; The second device determines a second key seed from the at least one key seed according to the second key seed identifier; The second device determines a second shared key from the at least one shared key according to the second shared key identifier; The second device determines, according to the second shared key generation rule identifier, a second shared key generation rule from among the at least one shared key generation rule; The second device performs key generation processing on the second shared key and the second key seed according to the second shared key generation rule to generate a second session key, wherein the second session key is used when the first device and the second device perform an encryption session.
7. A key agreement device, characterized in that: The key agreement device is deployed in a first device, the first device and a key distribution center share a first key, the second device and the key distribution center share a second key, and the first device and the second device share at least one shared key and at least one shared key generation rule; including: A first ciphertext receiving module is used to receive a first ciphertext issued by the key distribution center, where the first ciphertext is generated by the key distribution center after encrypting a first key seed and a second ciphertext using the first key, and the second ciphertext is generated by the key distribution center after encrypting the first key seed using the second key, and the first key seed is generated by the key distribution center; A first ciphertext decryption processing module, used to decrypt the first ciphertext according to the first key to obtain the first key seed, the first key seed identifier and the second ciphertext; a first shared key determination module, configured to determine a first shared key from the at least one shared key, and to determine a first shared key generation rule from the at least one shared key generation rule; A first session key first generation module, configured to perform key generation processing on the first shared key and the first key seed according to the first shared key generation rule to generate a first session key, wherein the first session key is used when the first device and the second device perform an encrypted session; a second ciphertext forwarding module, configured to send the second ciphertext, the first shared key identifier corresponding to the first shared key, and the first shared key generation rule identifier corresponding to the first shared key generation rule to the second device, so that the second device determines the first key seed, the first shared key, and the first shared key generation rule according to the second ciphertext, the first shared key identifier, and the first shared key generation rule identifier, and performs key generation processing on the first shared key and the first key seed according to the first shared key generation rule to generate the first session key; The first ciphertext further includes a first key seed identifier corresponding to the first key seed, and the second ciphertext further includes a first key seed identifier corresponding to the first key seed; the first device stores the first key seed and the first key seed identifier, so that the first device stores at least one key seed and a key seed identifier corresponding to each key seed; the second device stores the first key seed and the first key seed identifier, so that the second device stores at least one key seed and a key seed identifier corresponding to each key seed; the key agreement apparatus further includes: A second key seed identifier determination module, configured to determine a second key seed and a second key seed identifier corresponding to the second key seed from the at least one key seed; A second shared key identifier determination module, configured to determine a second shared key and a second shared key identifier corresponding to the second shared key from the at least one shared key; A second shared key generation rule identifier generating module, used to determine a second shared key generation rule and a second shared key generation rule identifier corresponding to the second shared key generation rule in the at least one shared key generation rule; a second session key negotiation module, configured to perform key generation processing on the second shared key and the second key seed according to the second shared key generation rule to generate a second session key, wherein the second session key is used when the first device and the second device perform an encrypted session; A second key seed identifier sending module is used to send the second key seed identifier, the second shared key identifier and the second shared key generation rule identifier to the second device, so that the second device determines the second key seed, the second shared key and the second shared key generation rule from the at least one key seed, the at least one shared key and the at least one shared key generation rule according to the second key seed identifier, the second shared key identifier and the second shared key generation rule identifier, and performs key generation processing on the second shared key and the second key seed according to the second shared key generation rule to generate the second session key.
8. A key negotiation device, characterized in that: The key agreement device is deployed on a second device, the second device and the key distribution center share and store a second key; the second device stores at least one shared key and at least one shared key generation rule; wherein the device includes: a second ciphertext receiving module, configured to receive a second ciphertext, a first shared key identifier, and a first shared key generation rule identifier from a first device, wherein the second ciphertext is generated by the key distribution center after encrypting a first key seed according to the second key, and the first key seed is generated by the key distribution center; A first shared key screening module, configured to determine a first shared key from the at least one shared key according to the first shared key identifier; A first shared key generation rule screening module, configured to determine a first shared key generation rule from the at least one shared key generation rule according to the first shared key generation rule identifier; A first ciphertext decryption module, configured to decrypt the second ciphertext according to the second key to obtain the first key seed; a first session key second generation module, configured to perform key generation processing on the first shared key and the first key seed according to the first shared key generation rule to generate a first session key, so as to perform an encrypted session with the first device through the first session key; The second device stores the first key seed and the first key seed identifier, so that the second device includes at least one key seed and a key seed identifier corresponding to each key seed; wherein the apparatus further includes: A second key seed identifier receiving module, configured to receive a second key seed identifier, a second shared key identifier, and a second shared key generation rule identifier from the first device; A second key seed determining module, configured to determine a second key seed from the at least one key seed according to the second key seed identifier; A second shared key determination module, configured to determine a second shared key from the at least one shared key according to the second shared key identifier; A second shared key generation rule determination module, configured to determine a second shared key generation rule from the at least one shared key generation rule according to the second shared key generation rule identifier; The second key generation module is used to perform key generation processing on the second shared key and the second key seed according to the second shared key generation rule to generate a second session key, wherein the second session key is used when the first device and the second device perform an encrypted session.
9. An electronic device, characterized in that: include: Memory; as well as A processor coupled to the memory, the processor being configured to execute the key negotiation method according to any one of claims 1 to 5 or the key negotiation method according to any one of claims 6 to 7 based on computer program instructions stored in the memory.
10. A computer-readable storage medium having computer program instructions stored thereon, characterized in that: When the computer program instructions are executed by a processor, the key negotiation method according to any one of claims 1 to 5 or the key negotiation method according to any one of claims 6 to 7 is implemented.
11. A computer program product, comprising computer program instructions, wherein the computer program instructions are stored in a computer-readable storage medium, characterized in that: When the computer program instructions are executed by a processor, the method according to any one of claims 1 to 5 or 6 to 7 is implemented.
