Key generation method and device, electronic equipment and storage medium
Shared keys are generated through quantum key distribution, PQC algorithm and asymmetric cryptographic algorithm, and session keys are generated based on the security evaluation results, which solves the threat of quantum computers to the security of traditional keys and achieves higher key security sex.
Patent Information
- Application Number
- CN202411237393.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-04
- Publication Date
- 2024-12-03
AI Technical Summary
The emergence of quantum computers has threatened the security of the keys of traditional public key cryptography algorithms. The existing technology cannot effectively deal with the exponential acceleration of the large integer decomposition and discrete logarithm problems of quantum computers, resulting in an increase in key length that cannot solve the security problem. .
Shared keys are generated based on quantum key distribution, post-quantum cryptography (PQC) algorithm and asymmetric cryptography algorithm, and different combination rules are selected through security evaluation results to generate session keys to improve the security of the key.
Generate session keys through multiple key combinations to ensure the security of session keys to the greatest extent, resist attacks from quantum computers, and ensure communication security.
Smart Images

Figure CN119070987A_ABST
Abstract
Description
Background Art
[0002] With the rapid development of quantum computing technology, traditional cryptography is facing unprecedented challenges. The Grover quantum algorithm in quantum computing can achieve quadratic acceleration of unstructured database search, improving search efficiency with an exponential halving effect, that is, halving the effective key size, which is equivalent to halving the security of symmetric cryptography. Therefore, in order to ensure that the algorithm security remains unchanged, the key length needs to be doubled.
[0003] The security of traditional public key cryptographic algorithms depends on the computational complexity of certain difficult mathematical problems, such as the RSA algorithm based on the difficult problem of large integer decomposition, and the ECC and Diffie-Hellman key exchange algorithms based on the difficult problem of discrete logarithms. The reason why these public key encryption algorithms can guarantee security is that classical computers cannot effectively solve the above problems within an acceptable time. However, the emergence of quantum computers makes fast cracking possible. For example, Shor's algorithm can solve large integer decomposition and discrete logarithm problems in polynomial time, achieving exponential acceleration. Therefore, quantum computers of sufficient scale can pose a threat to public key cryptographic systems and cannot be solved by increasing the key length. The security of currently generated keys is affected.
[0004] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present disclosure, and therefore may include information that does not constitute the prior art known to ordinary technicians in the field. Summary of the invention
[0005] The present disclosure provides a key generation method, device, electronic device and storage medium, which at least to a certain extent overcome the problem that the security of the generated key in the related art is affected.
[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] According to a first aspect of the present disclosure, a key generation method is provided, which is applied to a first communication party, comprising:
[0008] Generate a first shared key based on quantum key distribution;
[0009] Generate a second shared key based on a post-quantum cryptography PQC algorithm;
[0010] generating a third shared key based on an asymmetric cryptographic algorithm;
[0011] Performing a security assessment on the first shared key;
[0012] In response to a security evaluation result of the first shared key being a first evaluation result, combining the first shared key, the second shared key and the third shared key according to a first combination rule to generate a session key;
[0013] In response to the security evaluation result of the first shared key being a second evaluation result, the first shared key, the second shared key and the third shared key are combined according to a second combination rule to generate a session key.
[0014] According to a second aspect of the present disclosure, a key generation method is provided, which is applied to a second communication party, comprising:
[0015] generating a fourth shared key based on quantum key distribution;
[0016] Generate a fifth shared key based on a post-quantum cryptography PQC algorithm;
[0017] generating a sixth shared key based on an asymmetric cryptographic algorithm;
[0018] Performing a security assessment on the fourth shared key;
[0019] In response to the security evaluation result of the fourth shared key being the third evaluation result, combining the fourth shared key, the fifth shared key and the sixth shared key according to a third combination rule to generate a session key;
[0020] In response to the security evaluation result of the fourth shared key being a fourth evaluation result, the fourth shared key, the fifth shared key and the sixth shared key are combined according to a fourth combination rule to generate a session key.
[0021] According to a third aspect of the present disclosure, there is also provided a key generation device, applied to a first communication party, comprising:
[0022] A first generating module, configured to generate a first shared key based on quantum key distribution;
[0023] A second generating module, used to generate a second shared key based on a post-quantum cryptography PQC algorithm;
[0024] A third generating module, used to generate a third shared key based on an asymmetric cryptographic algorithm;
[0025] A first evaluation module, used for performing a security evaluation on the first shared key;
[0026] A first session key generation module, configured to generate a session key by combining the first shared key, the second shared key and the third shared key according to a first combination rule in response to a security evaluation result of the first shared key being a first evaluation result;
[0027] The second session key generation module is used to combine the first shared key, the second shared key and the third shared key to generate a session key according to a second combination rule in response to the security evaluation result of the first shared key being a second evaluation result.
[0028] According to a fourth aspect of the present disclosure, there is also provided a key generation device, applied to a second communication party, comprising:
[0029] A fourth generating module, used to generate a fourth shared key based on quantum key distribution;
[0030] A fifth generating module, used to generate a fifth shared key based on a post-quantum cryptography PQC algorithm;
[0031] A sixth generating module, used to generate a sixth shared key based on an asymmetric cryptographic algorithm;
[0032] A second evaluation module, configured to perform a security evaluation on the fourth shared key;
[0033] a third session key generating module, configured to generate a session key by combining the fourth shared key, the fifth shared key and the sixth shared key according to a third combination rule in response to the security evaluation result of the fourth shared key being a third evaluation result;
[0034] The fourth session key generation module is used to generate a session key by combining the fourth shared key, the fifth shared key and the sixth shared key according to a fourth combination rule in response to the security evaluation result of the fourth shared key being a fourth evaluation result.
[0035] According to the fifth aspect of the present disclosure, an electronic device is also provided, which includes: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute the key generation method described in any one of the first and second aspects above by executing the executable instructions.
[0036] According to a sixth aspect of the present disclosure, a computer-readable storage medium is further provided, on which a computer program is stored. When the computer program is executed by a processor, the key generation method described in any one of the first and second aspects above is implemented.
[0037] According to a seventh aspect of the present disclosure, a computer program product is also provided, including a computer program, and when the computer program is executed by a processor, the key generation method described in any one of the first and second aspects above is implemented.
[0038] The key generation method provided in the embodiment of the present disclosure generates a first shared key based on quantum key distribution, generates a second shared key based on a PQC algorithm, generates a third shared key based on an asymmetric cryptographic algorithm, and when the security evaluation result of the first shared key is the first evaluation result, the first shared key, the second shared key and the third shared key are combined according to a first combination rule to generate a session key; when the security evaluation result of the first shared key is the second evaluation result, the first shared key, the second shared key and the third shared key are combined according to a second combination rule to generate a session key. By combining three different keys into a session key, the security of the generated session key is improved. And based on different security evaluation results of the first shared key, different key combination methods are selected to maximize the security of the generated session key.
[0039] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] 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.
[0041] Figure 1 A schematic diagram of an interaction process of a key generation system in an embodiment of the present disclosure is shown;
[0042] Figure 2 A schematic diagram of a key generation method applied to a first communication party in an embodiment of the present disclosure is shown;
[0043] Figure 3 A schematic diagram showing the implementation process of step S202 in some embodiments of the present disclosure is shown;
[0044] Figure 4 A schematic diagram showing the implementation process of step S208 in some embodiments of the present disclosure is shown;
[0045] Figure 5 A schematic diagram showing the implementation process of step S210 in some embodiments of the present disclosure is shown;
[0046] Figure 6 A schematic diagram showing the implementation process of step S506 in some embodiments of the present disclosure is shown;
[0047] Figure 7 A schematic diagram showing the implementation process of step S212 in some embodiments of the present disclosure is shown;
[0048] Figure 8 A schematic diagram showing the implementation process of step S706 in some embodiments of the present disclosure is shown;
[0049] Fig. 9 A schematic diagram of a key generation method applied to a first communication party in some embodiments of the present disclosure is shown;
[0050] Fig.10 A schematic diagram of a key generation method applied to a second communication party in an embodiment of the present disclosure is shown;
[0051] Fig.11 A communication system and a communication process schematic diagram constructed based on the key generation method in a specific example of the present disclosure are shown;
[0052] Fig.12 A schematic diagram showing a communication processing flow of a communication party A in a system in a specific example of the present disclosure is shown;
[0053] Fig.13 A schematic diagram showing a communication processing flow of a communication party B in a system in a specific example of the present disclosure is shown;
[0054] Fig.14 A schematic diagram of a key generation device applied to a first communication party in an embodiment of the present disclosure is shown;
[0055] Fig.15 A schematic diagram of a key generation device applied to a second communication party in an embodiment of the present disclosure is shown; and
[0056] Fig.16 A structural block diagram of an electronic device in an embodiment of the present disclosure is shown. DETAILED DESCRIPTION
[0057] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that the disclosure will be more comprehensive and complete and to fully convey the concepts of the example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.
[0058] In addition, the accompanying drawings are only schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and their repeated description will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and / or processor devices and / or microcontroller devices.
[0059] The specific implementation of the embodiment of the present disclosure is described in detail below with reference to the accompanying drawings.
[0060] Figure 1 The figure shows a schematic diagram of a communication architecture to which the key generation method provided by the embodiment of the present disclosure can be applied. Figure 1 As shown, the system architecture may include: a first communication party 10 and a second communication party 20. The two devices in the system are connected via a network, which may be a wireless network.
[0061] Optionally, the wireless network described above uses standard communication technologies and / or protocols. The network is typically the Internet, but may also be any network, including but not limited to a local area network (LAN), a metropolitan area network (MAN), a wide area network (WAN), a mobile or wireless network, a dedicated network, or any combination of a virtual private network). In some embodiments, technologies and / or formats including Hyper Text Mark-up Language (HTML), Extensible Markup Language (XML), etc. are used to represent data exchanged over the network. In addition, conventional encryption technologies such as Secure Socket Layer (SSL), Transport Layer Security (TLS), Virtual Private Network (VPN), Internet Protocol Security (IPSec) may be used to encrypt all or some links. In other embodiments, customized and / or dedicated data communication technologies may also be used to replace or supplement the above data communication technologies.
[0062] In some embodiments of the present disclosure, the first communication party 10 generates a first shared key based on quantum key distribution; generates a second shared key based on a PQC algorithm; and generates a third shared key based on an asymmetric cryptographic algorithm. The second communication party 20 generates a fourth shared key based on quantum key distribution; generates a fifth shared key based on a PQC algorithm; and generates a sixth shared key based on an asymmetric cryptographic algorithm.
[0063] It should be noted that Quantum Key Distribution (QKD) is a technology that uses the principles of quantum mechanics to achieve secure communication. A random key is distributed between the communicating parties through a quantum channel (usually an optical fiber or a free-space optical link), and the key is used to encrypt and decrypt information. The security of QKD is based on the basic principles of quantum mechanics, especially the quantum state non-cloning theorem and the measurement perturbation effect. The first communicating party 10 and the second communicating party 20 obtain the quantum state based on the quantum channel, and the two independently select the measurement basis, and then compare some of the selections through the classical channel to determine which basis is the same. The same basis is used for measurement, and the results of different basis are discarded. Both parties disclose a part of the data to check for errors, which helps to detect potential eavesdropping, and finally generate the final key through error correction protocols and privacy amplification technology.
[0064] It should be noted that the PQC (Post-Quantum cryptography) algorithm is a new generation of cryptographic algorithms that can resist quantum computing attacks on existing cryptographic algorithms. It can ensure the security of cryptographic algorithms in quantum environments and ensure long-term data security and privacy protection.
[0065] It should be noted that an asymmetric cryptographic algorithm (also known as a public key cryptographic algorithm) is a type of cryptographic algorithm that uses a pair of keys (a public key and a private key) during encryption and decryption. Compared with a symmetric key cryptographic algorithm (using the same key for encryption and decryption), it can provide a more flexible and secure way to ensure the secure transmission of data. In some embodiments of the present disclosure, the first communication party 10 and the second communication party may generate a shared key using an asymmetric cryptographic algorithm such as a classic DH algorithm, so that the communicating parties can exchange keys securely through an insecure channel. In an exemplary embodiment, a more secure variant may be used, such as an elliptic curve Diffie-Hellman (ECDH) algorithm.
[0066] In some embodiments of the present disclosure, the first communication party 10 and the second communication party 20 negotiate a shared key using a PQC algorithm through a secure channel, and negotiate a shared key using a classic DH algorithm.
[0067] In some embodiments, after generating the first shared key, the second shared key, and the third shared key, the first communication party 10 performs a security assessment on the first shared key to determine the trust value of the first shared key, and selects different key combination methods based on different trust values. Specifically, in response to the security assessment result of the first shared key being the first assessment result, the first shared key, the second shared key, and the third shared key are combined to generate a session key according to the first combination rule; in response to the security assessment result of the first shared key being the second assessment result, the first shared key, the second shared key, and the third shared key are combined to generate a session key according to the second combination rule.
[0068] In a specific embodiment of the present disclosure, the first evaluation result may be that the first shared key is a directly generated quantum key, that is, a quantum key that has not been subjected to a derivation process. The second evaluation result may be that the second shared key is a derived quantum key, that is, a quantum key that has been subjected to a derivation process. It should be noted that key derivation refers to the process of deriving one or more keys from an original key (also called a seed key). Due to the limited coding rate of QKD, when the initial number of quantum keys is lower than a preset threshold when generating the first shared key, a key derivation process is required to improve security. It can be understood that, corresponding to the first evaluation result, the security of the security evaluation result of the first shared key is relatively high. According to the first combination rule, when the first shared key, the second shared key and the third shared key are combined to generate a session key, the complete first shared key can be retained, and then combined with part of the second shared key and the third shared key to generate a session key. Corresponding to the second evaluation result, the security evaluation result of the first shared key is relatively less secure. According to the second combination rule, when the first shared key, the second shared key and the third shared key are combined to generate a session key, part of the first shared key can be retained and then combined with part of the second shared key and the third shared key to generate a session key.
[0069] It should be noted that when the first communication party 10 and the second communication party 20 generate a session key, they will select a part of the second shared key and the third shared key when combining the keys. In order to maximize the security of the generated session key, they can randomly select from the second shared key and the third shared key. At the same time, in order to ensure that the session key generated by the first communication party 10 and the second communication party 20 is the same, after the first communication party 10 randomly selects from the second shared key and the third shared key, the selected part can be notified to the second communication party 20 in a secure manner.
[0070] like Figure 1 The interactive process of the key generation system is shown in FIG. 1 , including:
[0071] S102, the first communication party 10 generates a first shared key based on quantum key distribution;
[0072] S104, the second communication party 20 generates a fourth shared key based on quantum key distribution;
[0073] It should be noted that the first shared key and the fourth shared key are the same shared keys negotiated by the first communication party 10 and the second communication party 20 based on the quantum channel and the classical channel.
[0074] S106, the first communication party 10 generates a second shared key based on the PQC algorithm;
[0075] S108, the second communication party 20 generates a fifth shared key based on the PQC algorithm;
[0076] It should be noted that the second shared key and the fifth shared key are the same shared keys negotiated by the first communication party 10 and the second communication party 20 .
[0077] S110, the first communication party 10 generates a third shared key based on an asymmetric cryptographic algorithm;
[0078] S112, the second communication party 20 generates a sixth shared key based on an asymmetric cryptographic algorithm;
[0079] It should be noted that the third shared key and the sixth shared key are the same shared keys negotiated by the first communication party 10 and the second communication party 20 .
[0080] S114, the first communication party 10 performs a security assessment on the first shared key;
[0081] S116, in response to the security evaluation result of the first shared key being the first evaluation result, the first communication party 10 combines the first shared key, the second shared key and the third shared key according to the first combination rule to generate a session key;
[0082] S118, in response to the security evaluation result of the first shared key being the second evaluation result, the first communication party 10 combines the first shared key, the second shared key and the third shared key according to the second combination rule to generate a session key;
[0083] S120, the second communication party 20 performs a security assessment on the fourth shared key;
[0084] S122, in response to the security evaluation result of the fourth shared key being the third evaluation result, the second communication party 20 combines the fourth shared key, the fifth shared key and the sixth shared key according to the third combination rule to generate a session key;
[0085] S124: In response to the security evaluation result of the fourth shared key being the fourth evaluation result, the second communication party 20 combines the fourth shared key, the fifth shared key and the sixth shared key to generate a session key according to a fourth combination rule.
[0086] It should be noted that the first combination rule and the third combination rule are the same combination rule, and the second combination rule and the fourth combination rule are the same combination rule.
[0087] It can be understood by those skilled in the art that, in specific implementation, the execution order of the above steps is not limited. Figure 1 This is only an example, and the steps are executed in a different order, so the embodiments of the present disclosure will not be described in detail one by one.
[0088] Under the above system architecture, a key generation method is provided in an embodiment of the present disclosure. In some embodiments, the key generation method provided in an embodiment of the present disclosure can be implemented by the first communication party, or by the second communication party, or by the interaction between the first communication party and the second communication party.
[0089] like Figure 2 As shown, a key generation method applied to a first communication party provided in an embodiment of the present disclosure includes the following steps:
[0090] S202, generating a first shared key based on quantum key distribution;
[0091] S204, generating a second shared key based on the PQC algorithm;
[0092] S206, generating a third shared key based on an asymmetric cryptographic algorithm;
[0093] S208, performing a security assessment on the first shared key;
[0094] S210, in response to the security evaluation result of the first shared key being a first evaluation result, combining the first shared key, the second shared key, and the third shared key according to a first combination rule to generate a session key;
[0095] S212: In response to the security evaluation result of the first shared key being the second evaluation result, the first shared key, the second shared key and the third shared key are combined according to a second combination rule to generate a session key.
[0096] It can be seen from the above steps that the key generation method provided in the embodiment of the present disclosure generates a first shared key based on quantum key distribution, generates a second shared key based on a PQC algorithm, generates a third shared key based on an asymmetric cryptographic algorithm, and when the security evaluation result of the first shared key is the first evaluation result, the first shared key, the second shared key and the third shared key are combined according to the first combination rule to generate a session key; when the security evaluation result of the first shared key is the second evaluation result, the first shared key, the second shared key and the third shared key are combined according to the second combination rule to generate a session key. By combining three different keys into a session key, the security of the generated session key is improved. And based on the different security evaluation results of the first shared key, different key combination methods are selected to maximize the security of the generated session key.
[0097] In some embodiments of the present disclosure, the specific implementation process of step S202 is as follows: Figure 3 As shown, the following steps are included:
[0098] S302, generating a first quantum key using quantum key distribution QKD;
[0099] S304, determining whether the key amount of the first quantum key exceeds a preset threshold;
[0100] S306, in response to the key amount of the first quantum key exceeding a preset threshold, determining the first quantum key as a first shared key;
[0101] S308: In response to the key amount of the first quantum key not exceeding a preset threshold, derive the first quantum key, and determine the derived first quantum key as a first shared key.
[0102] It should be noted that, due to the limited coding rate of QKD, when generating the first shared key, when the initial number of quantum keys is lower than the preset threshold, key derivation processing is required to improve security. It is understandable that the above preset threshold is set according to actual needs, and the embodiments of the present disclosure are not limited here.
[0103] It should be noted that the reliability of the first quantum key generated after the derivation process is relatively lower than that of the first quantum key that has not been derivation processed. Figure 4 As shown, the following steps are included:
[0104] S402, determining whether the first shared key is a derived first quantum key;
[0105] S404, in response to the first shared key being the derived first quantum key, determining that the security evaluation result of the first shared key is a second evaluation result;
[0106] S406: In response to the first shared key being a first quantum key, determine that a security evaluation result of the first shared key is a first evaluation result.
[0107] It should be noted that the reliability represented by the first evaluation result is higher than that of the second evaluation result.
[0108] In some embodiments of the present disclosure, the implementation process of step S210 is as follows: Figure 5 As shown, the following steps are included:
[0109] S502, randomly selecting a preset first bit number of data from the second shared key to obtain a first key;
[0110] S504, randomly selecting a preset second number of bits of data from the third shared key to obtain a second key;
[0111] S506: Calculate a session key obtained by combining the first shared key, the first key, and the second key based on the first combination calculation rule.
[0112] It should be noted that the first combination rule includes: a first bit number, a second bit number, and a first combination calculation rule. The first bit number and the second bit number are preset and can be set according to the bit number requirement of the session key. For example, the bit number requirement of the session key is 128 bits, the bit number of the first shared key is 128 bits, and the sum of the first bit number and the second bit number is determined to be 128 bits in combination with the first combination calculation rule. The first bit number can be set to 64 and the second bit number can be set to 64; the first bit number can also be set to 32 and the second bit number can be set to 96. The above values are only examples and are not used to limit the protection scope of the embodiments of the present disclosure.
[0113] It should be noted that, in order to ensure the security of the generated session key, a random selection method is adopted to improve the security of key generation. And because the first evaluation result indicates a high degree of trust, the first shared key is retained and fully trusted.
[0114] Accordingly, the specific implementation process of step S506 is as follows: Figure 6 As shown, the following steps are included:
[0115] S602, concatenating the first key and the second key to obtain a first concatenated key;
[0116] S604: Perform an XOR calculation on the first concatenated key and the first shared key to obtain a session key.
[0117] Since the first communication party and the second communication party communicate with each other, in order to ensure that the generated session keys are consistent, the first communication party needs to inform the second communication party of the corresponding information when randomly selecting. In the above embodiment of the present disclosure, the key generation method provided also includes: sending the first position information of the first key relative to the second shared key to the second communication party, so that the second communication party selects the first bit number of data in the fifth shared key based on the first position information to obtain the sixth key; sending the second position information of the second key relative to the third shared key to the second communication party, so that the second communication party selects the second bit number of data in the sixth shared key based on the second position information to obtain the seventh key.
[0118] In some embodiments of the present disclosure, the implementation process of step S212 is as follows: Figure 7 As shown, the following steps are included:
[0119] S702, selecting a preset third number of bits of data in the first shared key to obtain a third key;
[0120] S704, randomly selecting a preset fourth number of bits of data from the second shared key to obtain a fourth key;
[0121] S706, randomly selecting a preset fifth number of bits of data from the third shared key to obtain a fifth key;
[0122] S708: Calculate a session key obtained by combining the third key, the fourth key and the fifth key based on the second combination calculation rule.
[0123] It should be noted that the second combination rule includes: the third bit number, the fourth bit number, the fifth bit number and the second combination calculation rule. The third bit number, the fourth bit number and the fifth bit number are preset and can be set according to the bit number requirement of the session key. For example, the bit number requirement of the session key is 128 bits. In combination with the first combination calculation rule, the third bit number can be set to 64, the fourth bit number can be set to 128, and the fifth bit number can be set to 64. The above values are only examples and are not used to limit the protection scope of the embodiments of the present disclosure.
[0124] It should be noted that, in order to ensure the security of the generated session key, a random selection method is adopted to improve the security of key generation. And because the reliability represented by the second evaluation result is low, the first shared key is partially retained and only a part is intercepted. In specific implementation, the first third bit portion is intercepted from the first shared key, for example, the first 64 bits of the key are intercepted from the 128-bit first shared key as the third key.
[0125] Accordingly, the specific implementation process of step S706 is as follows: Figure 8As shown, the following steps are included:
[0126] S802, concatenating the third key and the fifth key to obtain a second concatenated key;
[0127] S802, perform XOR calculation on the second concatenated key and the fourth key to obtain a session key.
[0128] Since the first communication party and the second communication party communicate with each other, in order to ensure that the generated session keys are consistent, the first communication party needs to inform the second communication party of the corresponding information when randomly selecting. In the above embodiment of the present disclosure, the key generation method provided also includes: sending the third position information of the fourth key relative to the second shared key to the second communication party, so that the second communication party selects the fourth bit number of data in the fifth shared key based on the third position information to obtain the ninth key; sending the fourth position information of the fifth key relative to the third shared key to the second communication party, so that the second communication party selects the fifth bit number of data in the sixth shared key based on the fourth position information to obtain the tenth key.
[0129] In some embodiments of the present disclosure, a key generation method is provided, such as Fig. 9 As shown, in Figure 2 On the basis of, after generating the session key, the following steps are also included:
[0130] S902, storing the generated session key in a first key storage;
[0131] S904: Based on the number of session keys stored in the first key storage device, adjust the number of times each stored session key is used.
[0132] It should be noted that, since the generation rate of session keys is limited, the number of times a single session key can be used for encryption and decryption can be dynamically configured according to the number of session keys, so that when the number of session keys is small, the number of times a single session key can be used for encryption and decryption can be increased to ensure that the session keys are sufficient for use. And when the number of session keys is sufficient, the number of times a single session key can be used for encryption and decryption can be reduced to reduce the impact of a single session key leak.
[0133] Based on the same inventive concept, the present disclosure also provides a key generation method applied to a second communication party in an embodiment, wherein the first communication party and the second communication party are the two parties of the communication, such as Fig.10 As shown, the following steps are included:
[0134] S1002, generating a fourth shared key based on quantum key distribution;
[0135] S1004, generating a fifth shared key based on the PQC algorithm;
[0136] S1006, generating a sixth shared key based on an asymmetric cryptographic algorithm;
[0137] S1008, performing security assessment on the fourth shared key;
[0138] S1010, in response to the security evaluation result of the fourth shared key being the third evaluation result, combining the fourth shared key, the fifth shared key and the sixth shared key according to the third combination rule to generate a session key;
[0139] S1012: In response to the security evaluation result of the fourth shared key being a fourth evaluation result, the fourth shared key, the fifth shared key and the sixth shared key are combined according to a fourth combination rule to generate a session key.
[0140] It should be noted that in order to ensure that the session key generated by the second communication party is consistent with the session key generated by the first communication party, the fourth shared key is the same as the first shared key, the fifth shared key is the same as the second shared key, the sixth shared key is the same as the third shared key, the third combination rule is the same as the rule represented by the first combination rule, and the fourth combination rule is the same as the rule represented by the second combination rule.
[0141] In some embodiments of the present disclosure, the specific implementation process of step S1002 includes:
[0142] generating a second quantum key using quantum key distribution;
[0143] Determining whether the key amount of the second quantum key exceeds a preset threshold;
[0144] In response to the key amount of the second quantum key exceeding a preset threshold, determining the second quantum key as a fourth shared key;
[0145] In response to the key amount of the second quantum key not exceeding a preset threshold, the second quantum key is derived, and the derived second quantum key is determined as a fourth shared key.
[0146] It should be noted that, due to the limited coding rate of QKD, when generating the fourth shared key, when the initial number of quantum keys is lower than the preset threshold, key derivation processing is required to improve security. It is understandable that the above preset threshold is set according to actual needs, and the embodiments of the present disclosure are not limited here.
[0147] It should be noted that the reliability of the fourth quantum key generated after the derivation process is relatively lower than that of the fourth quantum key that has not been derivation processed. Accordingly, the implementation process of step S1008 includes:
[0148] determining whether the fourth shared key is the derived second quantum key;
[0149] In response to the fourth shared key being the derived second quantum key, determining that the security evaluation result of the fourth shared key is a fourth evaluation result;
[0150] In response to the fourth shared key being the second quantum key, determining the security evaluation result of the fourth shared key as the third evaluation result.
[0151] It should be noted that the reliability represented by the third evaluation result is higher than that of the fourth evaluation result.
[0152] In some embodiments of the present disclosure, the implementation process of step S1010 includes:
[0153] Selecting a first number of bits of data in the fifth shared key based on the first position information to obtain a sixth key;
[0154] Selecting a second number of bits of data in the sixth shared key based on the second position information to obtain a seventh key;
[0155] Calculate the session key obtained by combining the fourth shared key, the sixth key and the seventh key based on the third combination calculation rule;
[0156] It should be noted that the third combination rule includes: the first bit number, the second bit number and the third combination calculation rule. The third combination calculation rule is consistent with the first combination calculation rule.
[0157] It should be noted that, in order to ensure the security of the generated session key, a random selection method is adopted to improve the security of key generation. And because the third evaluation result indicates a high degree of trust, the fourth shared key is retained and fully trusted.
[0158] Correspondingly, based on the third combination calculation rule, the session key obtained by combining the fourth shared key, the sixth key and the seventh key is calculated, including: concatenating the sixth key and the seventh key to obtain the third concatenated key; performing an XOR calculation on the third concatenated key and the fourth shared key to obtain the session key.
[0159] It should be noted that, in order to ensure that the generated session keys are consistent, the second communication party generates the sixth key and the seventh key according to the randomly selected selection rule sent by the first communication party. Accordingly, in the above embodiment of the present disclosure, the key generation method provided also includes: receiving the first position information of the first key sent by the first communication party relative to the second shared key; receiving the second position information of the second key sent by the first communication party relative to the third shared key.
[0160] In some embodiments of the present disclosure, the implementation process of step S1012 includes:
[0161] Selecting a preset third number of bits of data from the fourth shared key to obtain an eighth key;
[0162] Selecting a fourth number of bits of data in the fifth shared key based on the third position information to obtain a ninth key;
[0163] Selecting a fifth number of bits of data in the sixth shared key based on the fourth position information to obtain a tenth key;
[0164] Calculate the session key obtained by combining the eighth key, the ninth key and the tenth key based on the fourth combination calculation rule;
[0165] It should be noted that the fourth combination rule includes: the third bit number, the fourth bit number, the fifth bit number and the fourth combination calculation rule. The fourth combination calculation rule is consistent with the second combination calculation rule.
[0166] In some embodiments of the present disclosure, based on the fourth combination calculation rule, calculating the session key obtained by combining the eighth key, the ninth key, and the tenth key includes:
[0167] The eighth key and the tenth key are concatenated and calculated to obtain a fourth concatenated key;
[0168] The fourth concatenated key and the ninth key are XORed to obtain a session key.
[0169] It should be noted that, in order to ensure the security of the generated session key, a random selection method is adopted to improve the security of key generation. And because the trust represented by the fourth evaluation result is relatively low, the fourth shared key portion is retained and only part of it is intercepted. In specific implementation, the first third bit portion is intercepted from the fourth shared key. For example, the first 64 bits of the key are intercepted from the 128-bit fourth shared key as the third key. It is worth noting that the position selected by the second communication party for selecting the preset third bit number of data in the fourth shared key needs to be the same as the position selected by the first communication party for selecting the preset third bit number of data in the first shared key, and can be pre-set or pre-agreed.
[0170] It should be noted that, in order to ensure that the generated session keys are consistent, the second communication party generates the ninth key and the tenth key according to the randomly selected selection rule sent by the first communication party. Accordingly, in the above embodiment of the present disclosure, the key generation method provided also includes: receiving the third position information of the fourth key sent by the first communication party relative to the second shared key; receiving the fourth position information of the fifth key sent by the first communication party relative to the third shared key.
[0171] In some embodiments of the present disclosure, a key generation method is provided. Fig.10After generating the session key, it also includes:
[0172] storing the generated session key in a second key storage;
[0173] Based on the number of session keys stored in the second key storage, the number of times each stored session key is used is adjusted.
[0174] It should be noted that, since the generation rate of session keys is limited, the number of times a single session key can be used for encryption and decryption can be dynamically configured according to the number of session keys, so that when the number of session keys is small, the number of times a single session key can be used for encryption and decryption can be increased to ensure that the session keys are sufficient for use. And when the number of session keys is sufficient, the number of times a single session key can be used for encryption and decryption can be reduced to reduce the impact of a single session key leak.
[0175] In order to better illustrate the key generation method provided by the embodiment of the present disclosure, a specific example is now given for further explanation. Fig.11 As shown in FIG. 1 , a communication system and a communication process constructed based on the key generation method provided in the embodiment of the present disclosure are shown. Fig.12 The communication process of the communication party A in the system is shown as follows: Fig.13 The figure shows the communication processing flow of the communication party B in the system.
[0176] Depend on Figures 11 to 13 As shown, A and B are two communication entities that need to perform quantum secure encrypted communication.
[0177] The QKD nodes in A and B perform quantum key distribution and generate the quantum key K_q (128bit). Since the coding rate of QKD is limited, the key derivation module is configured to set the QKD key quantity threshold L. When the key quantity M is less than the first threshold L, based on the derivation function of the QKD key, a derived shared key K1 is generated and identified (P_K1); when the key quantity M is greater than the second threshold H, the QKD key K_q is directly used as the shared key K1 and identified (Q_K1); K1 is input into the key combination module.
[0178] It should be noted that the first threshold L may be equal to the second threshold H, or may be different.
[0179] The key combination module determines the QKD key for security assessment based on the K1 identifier. If the K1 identifier is Q_K1, the key is 100% trusted, that is, the 128-bit QKD key is retained; if the K1 identifier is P_K1, the first 64 bits are cut out from the 128-bit K1 as the retained QKD key K1'.
[0180] If K1 is identified as P_K1, that is, the length is 128 bits, then 64 bits are randomly selected from the 256-bit key K2 generated by PQC as K2', and the randomly selected 64-bit position is passed to the receiver during the PQC negotiation process. 64 bits are randomly selected from the 128-bit key negotiated by DH as K3', and the randomly selected 64-bit position is passed to the receiver during the DH negotiation process. The final session key K = K1 ⊕ (K2'|K3'), that is, K2' and K3' are concatenated and XORed with K1.
[0181] If K1' is identified as Q_K1, the trust value of the key K2 generated by PQC increases, 128 bits are randomly selected from the 256-bit key K2 as K2', and the randomly selected 128-bit position is passed to the receiver during the PQC negotiation process, and 64 bits are randomly selected from the 128-bit key negotiated by DH as K3', and the randomly selected 64-bit position is passed to the receiver during the DH negotiation process. The final session key K = K2'⊕(K1'|K3'), that is, K1' and K3' are concatenated and XORed with K2'.
[0182] A encapsulates the public key Pk and the parameter M1 of the ECDH algorithm with the PQC algorithm, and sends the randomly selected bit position to B. After receiving Pk, M1, and the randomly selected bit position, B generates the shared key K2 and ciphertext C based on the public key Pk using the PQC algorithm, generates the parameter M2 using the ECDH algorithm, and generates the shared key K3 based on the parameters M1 and M2. The ciphertext C and the parameter M2 are sent to A, and A generates the shared key K2 using the ciphertext C, and generates the shared key K3 based on the received parameter M2 and the parameter M1.
[0183] The final generated session key K is stored in the key storage, which has a dynamic key adjustment mechanism. That is, according to the number of session keys M currently stored, the number of times a single key can be used for encryption and decryption N is configured. For example, when the number of keys M>10G, the number of times a single key can be decrypted N=50, which is used to reduce the amount of data affected by the leakage of a single key, and use the session key to encrypt and decrypt data.
[0184] The communication system constructed in this specific example takes into account the risks of quantum computing-resistant technologies QKD and PQC in their applications. Therefore, the keys negotiated by QKD, PQC and traditional DH keys are evaluated for security. The length of the QKD key is determined based on whether the QKD key is derived, and then the keys generated by the PQC and DH algorithms are randomly selected. Different combinations can maximize the security of the key. Even if the negotiated key is leaked, the final session key cannot be cracked. Since the generation rate of the session key is limited, the key storage is designed with a dynamic adjustment mechanism. The amount of data that can be decrypted by a single key is dynamically configured according to the number of stored keys, which can effectively reduce the risks brought by key security issues.
[0185] It should be noted that the acquisition, storage, use, and processing of data in the technical solution disclosed in this disclosure are in compliance with the relevant provisions of national laws and regulations.
[0186] Based on the same inventive concept, the present disclosure also provides a key generation device in the following embodiments. 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.
[0187] Fig.14 A schematic diagram of a key generation device applied to a first communication party in an embodiment of the present disclosure is shown. Fig.14 As shown, the device comprises:
[0188] A first generating module 1401, configured to generate a first shared key based on quantum key distribution;
[0189] A second generating module 1402, configured to generate a second shared key based on a post-quantum cryptography PQC algorithm;
[0190] The third generating module 1403 is used to generate a third shared key based on an asymmetric cryptographic algorithm;
[0191] A first evaluation module 1404, configured to perform a security evaluation on the first shared key;
[0192] The first session key generation module 1405 is configured to generate a session key by combining the first shared key, the second shared key and the third shared key according to a first combination rule in response to the security evaluation result of the first shared key being the first evaluation result;
[0193] The second session key generating module 1406 is configured to generate a session key by combining the first shared key, the second shared key and the third shared key according to a second combination rule in response to the security evaluation result of the first shared key being the second evaluation result.
[0194] It should be noted that the first generation module 1401, the second generation module 1402, the third generation module 1403, the first evaluation module 1404, the first session key generation module 1405 and the second session key generation module 1406 correspond to S202 to S212 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 of the present disclosure, the first generating module 1401 is specifically used to:
[0196] generating a first quantum key using quantum key distribution;
[0197] Determining whether the key amount of the first quantum key exceeds a preset threshold;
[0198] In response to a key amount of the first quantum key exceeding a preset threshold, determining the first quantum key as a first shared key;
[0199] In response to the key amount of the first quantum key not exceeding a preset threshold, the first quantum key is derived, and the derived first quantum key is determined as a first shared key.
[0200] In some embodiments of the present disclosure, the first evaluation module 1404 is specifically used to:
[0201] Determining whether the first shared key is the derived first quantum key;
[0202] In response to the first shared key being the derived first quantum key, determining that the security evaluation result of the first shared key is a second evaluation result;
[0203] In response to the first shared key being a first quantum key, a security evaluation result of the first shared key is determined to be a first evaluation result.
[0204] In some embodiments of the present disclosure, the first session key generation module 1405 is specifically used to:
[0205] Randomly selecting a preset first bit number of data from the second shared key to obtain a first key;
[0206] Randomly select a preset second number of bits of data from the third shared key to obtain a second key;
[0207] Calculate a session key obtained by combining the first shared key, the first key and the second key based on the first combination calculation rule;
[0208] The first combination rule includes: a first bit quantity, a second bit quantity and a first combination calculation rule.
[0209] Furthermore, the first session key generation module 1405 is specifically used for:
[0210] Concatenate the first key and the second key to obtain a first concatenated key;
[0211] The first concatenated key and the first shared key are XORed to obtain a session key.
[0212] In some embodiments of the present disclosure, the first position information sending module is further included, which is used to:
[0213] Sending first position information of the first key relative to the second shared key to the second communication party, so that the second communication party selects data of a first number of bits in the fifth shared key based on the first position information to obtain a sixth key;
[0214] The second position information of the second key relative to the third shared key is sent to the second communication party, so that the second communication party selects data of a second number of bits in the sixth shared key based on the second position information to obtain the seventh key.
[0215] In some embodiments of the present disclosure, the second session key generation module 1406 is specifically used to:
[0216] Selecting a preset third number of bits of data from the first shared key to obtain a third key;
[0217] Randomly selecting a preset fourth number of bits of data from the second shared key to obtain a fourth key;
[0218] Randomly selecting a preset fifth number of bits of data from the third shared key to obtain a fifth key;
[0219] Based on the second combination calculation rule, calculate the session key obtained by combining the third key, the fourth key and the fifth key;
[0220] The second combination rule includes: the third bit number, the fourth bit number, the fifth bit number and the second combination calculation rule.
[0221] Further, the second session key generation module 1406 is specifically used for:
[0222] The third key and the fifth key are concatenated and calculated to obtain a second concatenated key;
[0223] The second concatenated key and the fourth key are XORed to obtain a session key.
[0224] In some embodiments of the present disclosure, the second location information sending module is further included, which is used to:
[0225] Sending third position information of the fourth key relative to the second shared key to the second communication party, so that the second communication party selects data of a fourth number of bits in the fifth shared key based on the third position information to obtain a ninth key;
[0226] The fourth position information of the fifth key relative to the third shared key is sent to the second communication party, so that the second communication party selects data of a fifth number of bits in the sixth shared key based on the fourth position information to obtain the tenth key.
[0227] In some embodiments of the present disclosure, the first key storage module is further included, which is used to:
[0228] storing the generated session key in a first key storage;
[0229] Based on the number of session keys stored in the first key storage, the number of times each stored session key is used is adjusted.
[0230] Based on the same inventive concept, the present disclosure also provides a key generation device in the following embodiments. 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.
[0231] Fig.15 A schematic diagram of a key generation device applied to a second communication party in an embodiment of the present disclosure is shown. Fig.15 As shown, the device comprises:
[0232] A fourth generating module 1501, configured to generate a fourth shared key based on quantum key distribution;
[0233] A fifth generating module 1502, configured to generate a fifth shared key based on a post-quantum cryptography PQC algorithm;
[0234] The sixth generating module 1503 is used to generate a sixth shared key based on an asymmetric cryptographic algorithm;
[0235] A second evaluation module 1504, configured to perform a security evaluation on the fourth shared key;
[0236] The third session key generating module 1505 is used for generating a session key by combining the fourth shared key, the fifth shared key and the sixth shared key according to a third combination rule in response to the security evaluation result of the fourth shared key being the third evaluation result;
[0237] The fourth session key generating module 1506 is configured to generate a session key by combining the fourth shared key, the fifth shared key and the sixth shared key according to a fourth combination rule in response to the security evaluation result of the fourth shared key being a fourth evaluation result.
[0238] It should be noted that the fourth generation module 1501, the fifth generation module 1502, the sixth generation module 1503, the second evaluation module 1504, the third session key generation module 1505 and the fourth session key generation module 1506 correspond to S1002 to S1012 in the method embodiment, and the examples and application scenarios implemented by the above modules and 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.
[0239] In some embodiments of the present disclosure, the fourth generating module 1501 is specifically used to:
[0240] generating a second quantum key using quantum key distribution;
[0241] Determining whether the key amount of the second quantum key exceeds a preset threshold;
[0242] In response to the key amount of the second quantum key exceeding a preset threshold, determining the second quantum key as a fourth shared key;
[0243] In response to the key amount of the second quantum key not exceeding a preset threshold, the second quantum key is derived, and the derived second quantum key is determined as a fourth shared key.
[0244] In some embodiments of the present disclosure, the second evaluation module 1504 is specifically used to:
[0245] determining whether the fourth shared key is the derived second quantum key;
[0246] In response to the fourth shared key being the derived second quantum key, determining that the security evaluation result of the fourth shared key is a fourth evaluation result;
[0247] In response to the fourth shared key being the second quantum key, determining the security evaluation result of the fourth shared key as the third evaluation result.
[0248] In some embodiments of the present disclosure, the third session key generation module 1505 is specifically used to:
[0249] Selecting a first number of bits of data in the fifth shared key based on the first position information to obtain a sixth key;
[0250] Selecting a second number of bits of data in the sixth shared key based on the second position information to obtain a seventh key;
[0251] Calculate the session key obtained by combining the fourth shared key, the sixth key and the seventh key based on the third combination calculation rule;
[0252] The third combination rule includes: the first bit number, the second bit number and the third combination calculation rule.
[0253] Furthermore, the third session key generation module 1505 is specifically used for:
[0254] The sixth key and the seventh key are concatenated and calculated to obtain a third concatenated key;
[0255] The third concatenated key and the fourth shared key are XORed to obtain a session key.
[0256] In some embodiments of the present disclosure, the first position information receiving module is further included, which is used to:
[0257] Receiving first position information of a first key relative to a second shared key sent by a first communication party;
[0258] Second position information of the second key relative to the third shared key sent by the first communication party is received.
[0259] In some embodiments of the present disclosure, the fourth session key generation module 1506 is specifically used to:
[0260] Selecting a preset third number of bits of data from the fourth shared key to obtain an eighth key;
[0261] Selecting a fourth number of bits of data in the fifth shared key based on the third position information to obtain a ninth key;
[0262] Selecting a fifth number of bits of data in the sixth shared key based on the fourth position information to obtain a tenth key;
[0263] Calculate the session key obtained by combining the eighth key, the ninth key and the tenth key based on the fourth combination calculation rule;
[0264] The fourth combination rule includes: the third bit quantity, the fourth bit quantity, the fifth bit quantity and the fourth combination calculation rule.
[0265] Furthermore, the fourth session key generation module 1506 is specifically used for:
[0266] The eighth key and the tenth key are concatenated and calculated to obtain a fourth concatenated key;
[0267] The fourth concatenated key and the ninth key are XORed to obtain a session key.
[0268] In some embodiments of the present disclosure, the second location information receiving module is further included, which is used to:
[0269] receiving third position information of a fourth key relative to the second shared key sent by the first communication party;
[0270] Fourth position information of a fifth key relative to the third shared key sent by the first communication party is received.
[0271] In some embodiments of the present disclosure, the second key storage module is further included, which is used to:
[0272] storing the generated session key in a second key storage;
[0273] Based on the number of session keys stored in the second key storage, the number of times each stored session key is used is adjusted.
[0274] Those skilled in the art will appreciate that various aspects of the present disclosure may be implemented as systems, methods or program products. Therefore, various aspects of the present disclosure may be specifically implemented in the following forms, namely: complete hardware implementation, complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software, which may be collectively referred to herein as "circuits", "modules" or "systems".
[0275] Refer to the following Fig.16 1600 according to this embodiment of the present disclosure is described. Fig.16 The electronic device 1600 shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0276] like Fig.16 As shown, the electronic device 1600 is in the form of a general computing device. The components of the electronic device 1600 may include but are not limited to: at least one processing unit 1610, at least one storage unit 1620, and a bus 1630 connecting different system components (including the storage unit 1620 and the processing unit 1610).
[0277] The storage unit stores a program code, which can be executed by the processing unit 1610, so that the processing unit 1610 performs the steps of various exemplary embodiments of the present disclosure described in the above “Exemplary Method” section of this specification. For example, the processing unit 1610 can perform the following steps of the above method embodiment:
[0278] Generate a first shared key based on quantum key distribution;
[0279] Generate a second shared key based on the PQC algorithm;
[0280] generating a third shared key based on an asymmetric cryptographic algorithm;
[0281] Performing a security assessment on the first shared key;
[0282] In response to the security evaluation result of the first shared key being the first evaluation result, combining the first shared key, the second shared key and the third shared key according to the first combination rule to generate a session key;
[0283] In response to the security evaluation result of the first shared key being the second evaluation result, the first shared key, the second shared key and the third shared key are combined according to a second combination rule to generate a session key.
[0284] Or, generating a fourth shared key based on quantum key distribution;
[0285] generating a fifth shared key based on the PQC algorithm;
[0286] generating a sixth shared key based on an asymmetric cryptographic algorithm;
[0287] Performing a security assessment on the fourth shared key;
[0288] In response to the security evaluation result of the fourth shared key being the third evaluation result, combining the fourth shared key, the fifth shared key and the sixth shared key according to the third combination rule to generate a session key;
[0289] In response to the security evaluation result of the fourth shared key being a fourth evaluation result, the fourth shared key, the fifth shared key and the sixth shared key are combined to generate a session key according to a fourth combination rule.
[0290] The storage unit 1620 may include a readable medium in the form of a volatile storage unit, such as a random access storage unit (RAM) 16201 and / or a cache storage unit 16202 , and may further include a read-only storage unit (ROM) 16203 .
[0291] The storage unit 1620 may also include a program / utility 16204 having a set (at least one) of program modules 16205, such program modules 16205 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.
[0292] Bus 1630 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
[0293] The electronic device 1600 may also communicate with one or more external devices 1640 (e.g., keyboards, pointing devices, Bluetooth devices, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device 1600, and / or communicate with any device that enables the electronic device 1600 to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed via an input / output (I / O) interface 1650. Furthermore, the electronic device 1600 may also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) via a network adapter 1660. As shown, the network adapter 1660 communicates with other modules of the electronic device 1600 via a bus 1630. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 1600, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0294] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation 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.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the implementation of the present disclosure.
[0295] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart may be implemented as a computer program product, which includes: a computer program, which implements the above-mentioned key generation method when executed by a processor.
[0296] In an exemplary embodiment of the present disclosure, a computer-readable storage medium is also provided, which may be a readable signal medium or a readable storage medium. In some possible implementations, various aspects of the present disclosure may also be implemented in the form of a program product, which includes a program code, and when the program product is run on a terminal device, the program code is used to enable the terminal device to execute the steps according to various exemplary implementations of the present disclosure described in the above “Exemplary Method” section of this specification.
[0297] More specific examples of computer-readable storage media in the present disclosure may include, but are not limited to, an electrical connection having one or more conductors, 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), 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 foregoing.
[0298] In the present disclosure, a computer readable storage medium may include a data signal propagated in baseband or as part of a carrier wave, wherein a readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A readable signal medium may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0299] Alternatively, the program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the foregoing.
[0300] In a specific implementation, the program code for performing the operations of the present disclosure may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., using an Internet service provider to connect through the Internet).
[0301] It should be noted that, although several modules or units of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into multiple modules or units to be embodied.
[0302] In addition, although the steps of the method in the present disclosure are described in a specific order in the drawings, this does not require or imply that the steps must be performed in this specific order, or that all the steps shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps, etc.
[0303] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation 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.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a mobile terminal, or a network device, etc.) to execute the method according to the implementation of the present disclosure.
[0304] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. The present disclosure is intended to cover any variations, uses or adaptations of the present disclosure, which follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The description and examples are intended to be exemplary only, and the true scope and spirit of the present disclosure are indicated by the appended claims.
Claims
1. A key generation method, characterized in that: Applied to the first communication party, comprising: Generate a first shared key based on quantum key distribution; Generate a second shared key based on a post-quantum cryptography PQC algorithm; generating a third shared key based on an asymmetric cryptographic algorithm; Performing a security assessment on the first shared key; In response to a security evaluation result of the first shared key being a first evaluation result, combining the first shared key, the second shared key and the third shared key according to a first combination rule to generate a session key; In response to the security evaluation result of the first shared key being a second evaluation result, the first shared key, the second shared key and the third shared key are combined according to a second combination rule to generate a session key.
2. The key generation method according to claim 1, characterized in that: Generating a first shared key based on quantum key distribution includes: generating a first quantum key using quantum key distribution; Determining whether the key amount of the first quantum key exceeds a preset threshold; In response to a key amount of the first quantum key exceeding a preset threshold, determining the first quantum key as the first shared key; In response to the key amount of the first quantum key not exceeding a preset threshold, the first quantum key is derived, and the derived first quantum key is determined as the first shared key.
3. The key generation method according to claim 2, characterized in that: Performing a security assessment on the first shared key includes: Determining whether the first shared key is the derived first quantum key; In response to the first shared key being the derived first quantum key, determining that the security evaluation result of the first shared key is the second evaluation result; In response to the first shared key being the first quantum key, determining a security evaluation result of the first shared key as the first evaluation result.
4. The key generation method according to claim 1, characterized in that: Combining the first shared key, the second shared key, and the third shared key according to a first combination rule to generate a session key includes: Randomly selecting a preset first bit number of data from the second shared key to obtain a first key; Randomly selecting a preset second number of bits of data from the third shared key to obtain a second key; Calculate the session key obtained by combining the first shared key, the first key and the second key based on a first combination calculation rule; The first combination rule includes: a first bit quantity, a second bit quantity and a first combination calculation rule.
5. The key generation method according to claim 4, characterized in that: Calculating the session key obtained by combining the first shared key, the first key, and the second key based on a first combination calculation rule includes: Concatenate the first key and the second key to obtain a first concatenated key; Perform an XOR calculation on the first concatenated key and the first shared key to obtain the session key.
6. The key generation method according to claim 4, characterized in that: Also includes: Sending first position information of the first key relative to the second shared key to a second communication party, so that the second communication party selects the first bit number of data in a fifth shared key based on the first position information to obtain a sixth key; The second position information of the second key relative to the third shared key is sent to the second communication party, so that the second communication party selects the second bit number of data in the sixth shared key based on the second position information to obtain the seventh key.
7. The key generation method according to claim 1, characterized in that: Combining the first shared key, the second shared key, and the third shared key according to a second combination rule to generate a session key includes: Selecting a preset third number of bits of data from the first shared key to obtain a third key; Randomly selecting a preset fourth bit number of data from the second shared key to obtain a fourth key; Randomly selecting a preset fifth number of bits of data from the third shared key to obtain a fifth key; Calculate the session key obtained by combining the third key, the fourth key and the fifth key based on the second combination calculation rule; The second combination rule includes: the third bit number, the fourth bit number, the fifth bit number and the second combination calculation rule.
8. The key generation method according to claim 7, characterized in that: Calculating the session key obtained by combining the third key, the fourth key, and the fifth key based on the second combination calculation rule includes: Concatenate the third key and the fifth key to obtain a second concatenated key; The second concatenated key and the fourth key are XOR-ed together to obtain the session key.
9. The key generation method according to claim 7, characterized in that: Also includes: Sending third position information of the fourth key relative to the second shared key to the second communication party, so that the second communication party selects the fourth number of bits of data in the fifth shared key based on the third position information to obtain a ninth key; The fourth position information of the fifth key relative to the third shared key is sent to the second communication party, so that the second communication party selects the fifth number of bits of data in the sixth shared key based on the fourth position information to obtain the tenth key.
10. The key generation method according to any one of claims 1 to 9, characterized in that: After generating the session key, also include: storing the generated session key in a first key storage; Based on the number of session keys stored in the first key storage, the number of times each stored session key is used is adjusted.
11. A key generation method, characterized in that: Applicable to the second communication party, including: generating a fourth shared key based on quantum key distribution; Generate a fifth shared key based on a post-quantum cryptography PQC algorithm; generating a sixth shared key based on an asymmetric cryptographic algorithm; Performing a security assessment on the fourth shared key; In response to the security evaluation result of the fourth shared key being the third evaluation result, combining the fourth shared key, the fifth shared key and the sixth shared key according to a third combination rule to generate a session key; In response to the security evaluation result of the fourth shared key being a fourth evaluation result, the fourth shared key, the fifth shared key and the sixth shared key are combined according to a fourth combination rule to generate a session key.
12. The key generation method according to claim 11, characterized in that: Generating a fourth shared key based on quantum key distribution includes: generating a second quantum key using quantum key distribution; Determining whether the key amount of the second quantum key exceeds a preset threshold; In response to the key amount of the second quantum key exceeding a preset threshold, determining the second quantum key as the fourth shared key; In response to the key amount of the second quantum key not exceeding a preset threshold, the second quantum key is derived, and the derived second quantum key is determined as the fourth shared key.
13. The key generation method according to claim 12, characterized in that: Performing a security assessment on the fourth shared key includes: Determining whether the fourth shared key is the derived second quantum key; In response to the fourth shared key being the derived second quantum key, determining a security evaluation result of the fourth shared key to be the fourth evaluation result; In response to the fourth shared key being the second quantum key, determining a security evaluation result of the fourth shared key to be the third evaluation result.
14. The key generation method according to claim 11, characterized in that: Combining the fourth shared key, the fifth shared key, and the sixth shared key according to the third combination rule to generate a session key includes: Selecting a first number of bits of data in the fifth shared key based on the first position information to obtain a sixth key; Selecting a second number of bits of data in the sixth shared key based on the second position information to obtain a seventh key; Calculate the session key obtained by combining the fourth shared key, the sixth key and the seventh key based on the third combination calculation rule; The third combination rule includes: the first bit number, the second bit number and the third combination calculation rule.
15. The key generation method according to claim 14, characterized in that: Calculating the session key obtained by combining the fourth shared key, the sixth key, and the seventh key based on the third combination calculation rule includes: Concatenate the sixth key and the seventh key to obtain a third concatenated key; The third concatenated key and the fourth shared key are XOR-ed together to obtain the session key.
16. The key generation method according to claim 14, characterized in that: Also includes: Receiving the first position information of the first key relative to the second shared key sent by the first communication party; The second position information of the second key relative to the third shared key sent by the first communication party is received.
17. The key generation method according to claim 11, characterized in that: Combining the fourth shared key, the fifth shared key, and the sixth shared key according to the fourth combination rule to generate a session key includes: Selecting a preset third number of bits of data from the fourth shared key to obtain an eighth key; Selecting a fourth number of bits of data in the fifth shared key based on the third position information to obtain a ninth key; Selecting a fifth number of bits of data in the sixth shared key based on the fourth position information to obtain a tenth key; Calculate the session key obtained by combining the eighth key, the ninth key and the tenth key based on the fourth combination calculation rule; The fourth combination rule includes: the third bit quantity, the fourth bit quantity, the fifth bit quantity and the fourth combination calculation rule.
18. The key generation method according to claim 17, characterized in that: Calculating the session key obtained by combining the eighth key, the ninth key, and the tenth key based on the fourth combination calculation rule includes: Concatenate the eighth key and the tenth key to obtain a fourth concatenated key; The fourth concatenated key and the ninth key are XOR-ed together to obtain the session key.
19. The key generation method according to claim 17, characterized in that: Also includes: Receiving the third position information of the fourth key relative to the second shared key sent by the first communication party; The fourth position information of the fifth key relative to the third shared key sent by the first communication party is received.
20. The key generation method according to any one of claims 11 to 19, characterized in that: After generating the session key, also include: storing the generated session key in a second key storage; Based on the number of session keys stored in the second key storage, the number of times each stored session key is used is adjusted.
21. A key generation device, characterized in that: Applied to the first communication party, comprising: A first generating module, configured to generate a first shared key based on quantum key distribution; A second generating module, used to generate a second shared key based on a post-quantum cryptography PQC algorithm; A third generating module, used to generate a third shared key based on an asymmetric cryptographic algorithm; A first evaluation module, used for performing a security evaluation on the first shared key; A first session key generation module, configured to generate a session key by combining the first shared key, the second shared key and the third shared key according to a first combination rule in response to a security evaluation result of the first shared key being a first evaluation result; The second session key generation module is used to combine the first shared key, the second shared key and the third shared key to generate a session key according to a second combination rule in response to the security evaluation result of the first shared key being a second evaluation result.
22. A key generation device, characterized in that: Applicable to the second communication party, including: A fourth generating module, used to generate a fourth shared key based on quantum key distribution; A fifth generating module, used to generate a fifth shared key based on a post-quantum cryptography PQC algorithm; A sixth generating module, used to generate a sixth shared key based on an asymmetric cryptographic algorithm; A second evaluation module, configured to perform a security evaluation on the fourth shared key; a third session key generating module, configured to generate a session key by combining the fourth shared key, the fifth shared key and the sixth shared key according to a third combination rule in response to the security evaluation result of the fourth shared key being a third evaluation result; The fourth session key generation module is used to generate a session key by combining the fourth shared key, the fifth shared key and the sixth shared key according to a fourth combination rule in response to the security evaluation result of the fourth shared key being a fourth evaluation result.
23. An electronic device, characterized in that: include: processor; as well as A memory, configured to store executable instructions of the processor; The processor is configured to execute the key generation method according to any one of claims 1 to 20 by executing the executable instructions.
24. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the key generation method according to any one of claims 1 to 20 is implemented.
Citation Information
Cited By
Encryption methods, devices, and media that combine quantum keys and post-quantum cryptography algorithms
JP7885999B1
