A hybrid key encapsulation method and system

Through the hybrid key encapsulation method, combined with quantum-resistant keys and national keys, encrypted session keys are generated, which solves the data security problem in the communication process in the quantum computing era and realizes security protection against quantum attacks and on traditional computers.

CN119483934BActive Publication Date: 2025-09-19ORIGIN QUANTUM COMPUTING TECH (HEFEI) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411543566.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-31
Publication Date
2025-09-19
Estimated Expiration
2044-10-31

AI Technical Summary

Technical Problem

The data security of existing technologies in the communication process in the era of quantum computing is low. Traditional public key encryption algorithms face the risk of quantum computer attacks, and quantum-resistant cryptographic algorithms may be attacked by traditional computers.

Method used

A hybrid key encapsulation method is adopted, combining quantum-resistant keys and national secret keys. Encryption keys are generated through a random number generator, and symmetric encryption session keys are generated using quantum-resistant cryptographic algorithms and national secret algorithms to ensure the security of messages during transmission.

Benefits of technology

It improves data security, has anti-quantum attack capabilities, meets the semantic security requirements of public key encryption algorithms, and protects the security of session keys when they become invalid on classical computers.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119483934B_ABST
    Figure CN119483934B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of information security technology, and specifically to a hybrid key encapsulation method and system, comprising: determining a first encryption key, a subkey, and a second encryption key based on the obtained public key of a quantum-resistant key pair corresponding to an information request to be encrypted and the public key of a national secret key pair; generating a first symmetric encryption session key based on the subkey, a first random number, and a second national secret algorithm; encrypting a message plaintext corresponding to the information request to be encrypted using the first symmetric encryption session key; decrypting at a receiving end in the same manner, adding quantum-resistant key encapsulation technology to a traditional national secret key encapsulation scheme so that the encapsulated key has quantum attack resistance; and when the quantum-resistant key encapsulation technical solution fails on a classical computer, the national secret algorithm in hardware can still be used to protect the session key security, thereby meeting the semantic security required by current public key encryption algorithms and improving data security.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of information security technology, and in particular to a hybrid key encapsulation method and system. Background Art

[0002] With the rapid development of quantum computing technology, traditional public key encryption algorithms (such as RSA and ECC) face the risk of being cracked by quantum computers. The powerful computing power of quantum computers can crack many existing cryptographic systems in a very short time, which poses a huge threat to information security. As the national cryptographic standard, the national secret algorithm has been widely used in the field of information security. In order to meet the challenges brought by quantum computing in the future, it is necessary to introduce quantum-resistant cryptographic technology to enhance its ability to resist quantum attacks. However, although quantum-resistant cryptographic algorithms can resist attacks from quantum computers, due to the short development and verification time, they may be attacked by traditional computers due to problems in the algorithm design. Therefore, how to improve the data security of the communication process in the quantum computing era is a technical problem that needs to be solved urgently. Summary of the Invention

[0003] The present invention provides a hybrid key encapsulation method and system to solve the problem of low data security in the communication process in the quantum computing era in the prior art.

[0004] The present invention provides a hybrid key encapsulation method, including:

[0005] Obtain the public key of the quantum-resistant key pair and the public key of the national secret key pair corresponding to the information request to be encrypted;

[0006] Calling a first random number generator to generate a first random number, and encrypting the first random number according to the public key of the national secret key pair and the first national secret algorithm to obtain a first encryption key;

[0007] calling a second random number generator to generate a second random number, generating a subkey based on the second random number and the quantum-resistant cryptographic algorithm, and encrypting the subkey based on the public key of the quantum-resistant key pair and the quantum-resistant cryptographic algorithm to obtain a second encryption key;

[0008] Generate a first symmetric encryption session key based on the subkey, the first random number, and the second national secret algorithm; and encrypt the message plaintext corresponding to the information request to be encrypted based on the first symmetric encryption session key and the third national secret algorithm to obtain a message ciphertext;

[0009] The first encryption key, the second encryption key and the message ciphertext are sent to a receiving end so that the receiving end uses the private key of the quantum-resistant key pair and the private key of the national secret key pair to decrypt the message ciphertext to obtain a message plaintext.

[0010] Optionally, before obtaining the public key in the quantum-resistant key pair and the public key in the national secret key pair corresponding to the information request to be encrypted, the following steps may also be performed:

[0011] The receiving end receives a request for information to be encrypted, and calls a quantum-resistant cryptographic algorithm in a trusted execution environment to generate a quantum-resistant key pair and calls a first national secret algorithm to generate a national secret key pair; wherein the quantum-resistant key pair includes a public key of the quantum-resistant key pair and a private key of the quantum-resistant key pair, and the national secret key pair includes a public key of the national secret key pair and a private key of the national secret key pair.

[0012] Optionally, before calling the trusted execution environment, the method further includes:

[0013] Building a trusted execution environment based on the second random number generator, the quantum-resistant cryptographic algorithm, and a preset private key;

[0014] Performing a security check on the trusted execution environment, and generating a verification certificate when the security check is correct;

[0015] The verification certificate is signed using the preset private key and sent to the verifier. The verifier verifies the signed verification certificate using the preset public key. When the verification is successful, the trusted execution environment is in a secure state, and the second random number generator and the quantum-resistant cryptographic algorithm can be called. The preset private key and the preset public key form a pair of keys.

[0016] Optionally, the verification party verifies the signed verification certificate using a preset public key, including:

[0017] The verifying party sends the signed verification certificate to the server, and the server verifies the signed verification certificate according to the public key preset in the server.

[0018] Optionally, the verification party verifies the signed verification certificate using a preset public key, further comprising:

[0019] The verification party downloads the preset public key from the server or the root certificate, and uses the preset public key to verify the signed verification certificate.

[0020] Optionally, the receiving end uses the private key of the quantum-resistant key pair and the private key of the national secret key pair to decrypt the message ciphertext to obtain the message plaintext, including:

[0021] The receiving end decrypts the first encryption key using the private key of the national secret key pair and the fourth national secret algorithm to obtain the first random number;

[0022] The receiving end decrypts the second encryption key using the private key of the quantum-resistant key pair and the quantum-resistant cryptographic algorithm to obtain the subkey;

[0023] The receiving end generates a second symmetric encryption session key according to the first random number, the subkey, and the fifth national secret algorithm;

[0024] The receiving end decrypts the message ciphertext based on the second symmetric encryption session key and the sixth national secret algorithm to obtain a message plaintext.

[0025] Optionally, the quantum-resistant cryptographic algorithm is the Kyber algorithm, the first national secret algorithm and the fourth national secret algorithm are the SM2 algorithm, the third national secret algorithm and the fifth national secret algorithm are the SM3 algorithm, and the third national secret algorithm and the sixth national secret algorithm are the SM4 algorithm.

[0026] The embodiments of this specification also provide a hybrid key encapsulation system, including a requesting end and a receiving end, wherein the system includes:

[0027] The requesting end obtains the public key of the quantum-resistant key pair and the public key of the national secret key pair corresponding to the information request to be encrypted;

[0028] The requesting end calls a first random number generator to generate a first random number, and encrypts the first random number according to the public key of the national secret key pair and the first national secret algorithm to obtain a first encryption key;

[0029] The requesting end calls a second random number generator to generate a second random number, generates a subkey based on the second random number and the quantum-resistant cryptographic algorithm, and encrypts the subkey based on the public key of the quantum-resistant key pair and the quantum-resistant cryptographic algorithm to obtain a second encryption key;

[0030] The requesting end generates a first symmetric encryption session key based on the subkey, the first random number, and the second national secret algorithm; and encrypts the message plaintext corresponding to the information request to be encrypted based on the first symmetric encryption session key and the third national secret algorithm to obtain a message ciphertext;

[0031] The requesting end sends the first encryption key, the second encryption key and the message ciphertext to the receiving end;

[0032] The receiving end uses the private key of the quantum-resistant key pair and the private key of the national secret key pair to decrypt the message ciphertext to obtain the message plaintext.

[0033] Optionally, the system further includes:

[0034] The receiving end decrypts the first encryption key using the private key of the national secret key pair and the fourth national secret algorithm to obtain the first random number;

[0035] The receiving end decrypts the second encryption key using the private key of the quantum-resistant key pair and the quantum-resistant cryptographic algorithm to obtain the subkey;

[0036] The receiving end generates a second symmetric encryption session key according to the first random number, the subkey, and the fifth national secret algorithm;

[0037] The receiving end decrypts the message ciphertext based on the second symmetric encryption session key and the sixth national secret algorithm to obtain a message plaintext.

[0038] An electronic device includes a memory and a processor, wherein the memory stores computer instructions, and the processor is configured to run the computer instructions to execute the method described above.

[0039] A storage medium, characterized in that computer instructions are stored in the storage medium, and the computer instructions are configured to execute the above-mentioned method when running.

[0040] Its beneficial effects are: this application adds a technical solution of quantum-resistant key encapsulation on the basis of the traditional national secret key encapsulation solution, so that the key has the function of resisting quantum attack after encapsulation; when the technical solution of quantum-resistant key encapsulation fails on a classical computer, the national secret algorithm in the hardware can still be used to protect the security of the session key, meet the semantic security required by the current public key encryption algorithm, and improve data security. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0042] Figure 1 A flow chart of a hybrid key encapsulation method provided in an embodiment of this specification;

[0043] Figure 2 A schematic diagram of a feasible execution environment security detection in a hybrid key encapsulation provided in an embodiment of this specification;

[0044] Figure 3 A schematic diagram of the structure of a hybrid key encapsulation system provided in an embodiment of this specification;

[0045] Figure 4 A schematic diagram of the structure of an electronic device provided in an embodiment of this specification;

[0046] Figure 5 A schematic diagram of a computer-readable medium provided in accordance with an embodiment of this specification. DETAILED DESCRIPTION

[0047] The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and are not to be construed as limiting the present invention.

[0048] The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and are not to be construed as limiting the present invention.

[0049] It should be noted that the relative arrangement of components and steps, the numerical expressions and numerical values ​​set forth in these embodiments do not limit the scope of the present invention unless specifically stated otherwise.

[0050] The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the invention, its application, or uses.

[0051] Technologies, methods, and equipment known to ordinary technicians in the relevant art may not be discussed in detail, but where appropriate, the technologies, methods, and equipment should be considered part of the specification.

[0052] In all examples shown and discussed herein, any specific values ​​should be interpreted as merely exemplary and not limiting. Therefore, other examples of the exemplary embodiments may have different values.

[0053] It should be noted that like reference numerals and letters refer to like items in the following figures, and therefore, once an item is defined in one figure, it need not be further discussed in subsequent figures.

[0054] Reference Figure 1A schematic diagram of the principle of a hybrid key encapsulation method provided in an embodiment of this specification includes: S101: obtaining the public key of the quantum-resistant key pair and the public key of the national secret key pair corresponding to the information request to be encrypted; S102: calling a first random number generator to generate a first random number, encrypting the first random number according to the public key of the national secret key pair and the first national secret algorithm to obtain a first encryption key; S103: calling a second random number generator to generate a second random number, generating a subkey according to the second random number and the quantum-resistant cryptographic algorithm, and generating a subkey according to the public key of the quantum-resistant key pair and the quantum-resistant cryptographic algorithm. The subkey is encrypted using a subcipher algorithm to obtain a second encryption key; S104: a first symmetric encryption session key is generated according to the subkey, the first random number, and the second national secret algorithm; and the message plaintext corresponding to the information request to be encrypted is encrypted based on the first symmetric encryption session key and the third national secret algorithm to obtain a message ciphertext; S105: the first encryption key, the second encryption key, and the message ciphertext are sent to a receiving end so that the receiving end uses the private key of the quantum-resistant key pair and the private key of the national secret key pair to decrypt the message ciphertext to obtain the message plaintext.

[0055] In an optional embodiment, the requesting end initiates a request for information to be encrypted, the receiving end receives the request for information to be encrypted, and calls the quantum-resistant cryptographic algorithm in the trusted execution environment to generate a quantum-resistant key pair and calls the first national secret algorithm to generate a national secret key pair, wherein the quantum-resistant key pair includes a public key K1 of the quantum-resistant key pair and a private key K2 of the quantum-resistant key pair, and the national secret key pair includes a public key S1 of the national secret key pair and a private key S2 of the national secret key pair; then, the receiving end sends the public key K1 and the public key S1 to the requesting end, and the requesting end calls the first random number generator to generate a first random number, and encrypts the first random number according to the public key S1 and the first national secret algorithm. Obtaining the first encryption key S3; then, the requesting end invokes a second random number generator in the trusted execution environment to generate a second random number, generates a subkey K3 based on the second random number and the quantum-resistant cryptographic algorithm, and encrypts the subkey K3 using the public key K1 of the quantum-resistant key pair and the quantum-resistant cryptographic algorithm to obtain the second encryption key K4; finally, the requesting end generates a first symmetric encryption session key based on the subkey K3, the first random number, and the second national secret algorithm, and encrypts the message plaintext corresponding to the encrypted information request based on the first symmetric encryption session key and the third national secret algorithm to obtain the message ciphertext, thereby completing the message encryption phase. After the message encryption phase is completed, the receiving end needs to obtain the message plaintext through decryption. Therefore, the requesting end also needs to send the first encryption key S3, the second encryption key K4, and the message ciphertext to the receiving end so that the receiving end can use the private key K2 of the quantum-resistant key pair and the private key S2 of the national secret key pair to decrypt the message ciphertext to obtain the message plaintext. This application adds a quantum-resistant key encapsulation technology solution on the basis of the traditional national secret key encapsulation solution, so that the encapsulated key has the function of resisting quantum attacks; when the quantum-resistant key encapsulation technology solution fails on a classical computer, the national secret algorithm in the hardware can still be used to protect the security of the session key, meet the semantic security required by the current public key encryption algorithm, and improve data security.

[0056] Specifically, the receiving end uses the private key of the quantum-resistant key pair and the private key of the national secret key pair to decrypt the message ciphertext to obtain the message plaintext, including: the receiving end uses the private key S1 of the national secret key pair and the fourth national secret algorithm to decrypt the first encryption key S3 to obtain the first random number; then, the receiving end uses the private key K1 of the quantum-resistant key pair and the quantum-resistant cryptographic algorithm to decrypt the second encryption key K4 to obtain the subkey K3; thereafter, the receiving end generates a second symmetric encryption session key according to the first random number, the subkey K3, and the fifth national secret algorithm; the receiving end decrypts the message ciphertext based on the second symmetric encryption session key and the sixth national secret algorithm to obtain the message plaintext. Among them, since the first symmetric encryption session key and the second symmetric encryption session key are obtained using the same input and algorithm, the first symmetric encryption session key and the second symmetric encryption session key are the same symmetric encryption session key; this application adds a technical solution for quantum-resistant key encapsulation on the basis of the traditional national secret key encapsulation solution, so that the key has quantum attack resistance after encapsulation; at the same time, the same symmetric encryption session key is used to encrypt and decrypt messages, thereby ensuring the security of messages during transmission.

[0057] It should be noted that the above-mentioned quantum-resistant cryptographic algorithm is the Kyber algorithm, the first and fourth national secret algorithms are the SM2 algorithm, the third and fifth national secret algorithms are the SM3 algorithm, and the third and sixth national secret algorithms are the SM4 algorithm.

[0058] Optionally, before calling the trusted execution environment, it also includes: constructing a trusted execution environment based on the second random number generator, the quantum-resistant cryptographic algorithm and a preset private key; performing a security check on the trusted execution environment, and generating a verification certificate when the security check is correct; signing the verification certificate using the preset private key and sending it to the verification party, the verification party verifying the signed verification certificate using the preset public key, when the verification passes, the trusted execution environment is in a secure state, and the second random number generator and the quantum-resistant cryptographic algorithm can be called; wherein, the preset private key and the preset public key are a pair of keys.

[0059] In an alternative embodiment, Figure 2As shown, the test end responds to the user's security detection instruction and runs an internal security detection program to implement security detection of the trusted execution environment. When the security detection is correct, a verification certificate is generated. Then, the test end uses the preset private key within the test end to sign the verification certificate and sends it to the verification party. The verification party verifies the signed verification certificate using the preset public key. When the verification is successful, it indicates that the trusted execution environment is in a secure state, the second random number generator and the quantum-resistant cryptographic algorithm are trusted objects and can be called. By using the trusted execution environment, sensitive data of the quantum-resistant cryptographic algorithm is protected, avoiding security issues caused by software storage. The trusted execution environment is constructed by the second random number generator, the quantum-resistant cryptographic algorithm, and the preset private key. The preset private key and the preset public key form a pair of keys.

[0060] In an optional embodiment, the verification party verifies the signed verification certificate using a preset public key, including: the verification party sends the signed verification certificate to the server, and the server verifies the signed verification certificate based on the preset public key in the server; the verification party can also download the preset public key from the server or the root certificate, and use the preset public key to verify the signed verification certificate. The verification certificate can be verified by the above-mentioned multiple methods to ensure the authenticity of the verification certificate. If the verification is successful, the verification party believes that the quantum-resistant cryptographic algorithm and random number generator in the trusted execution environment are safe and complete and can be used. If the verification fails, it means that the quantum-resistant cryptographic algorithm and random number generator in the trusted execution environment may have been tampered with or destroyed. At this time, the quantum-resistant cryptographic algorithm and random number generator in the trusted execution environment are refused to be used to avoid information leakage. It should be noted that the preset public key itself has been pre-stored in the server or the root certificate. Therefore, the verification party can obtain the preset public key by downloading.

[0061] In an optional embodiment, the quantum-resistant cryptographic algorithm and random number generator in the trusted execution environment are hardware modules placed in the SIM card, and the two communicating parties then perform the corresponding key negotiation process, namely the key encapsulation process mentioned above.

[0062] In an optional embodiment, the requesting end or the receiving end may refer to a client, or may refer to a server, a SIM card, or other hardware and software, and is not limited here.

[0063] In an optional embodiment, the present application adds a technical solution for quantum-resistant key encapsulation on the basis of the traditional national secret key encapsulation solution, so that the key has the function of resisting quantum attacks after encapsulation; when the technical solution for quantum-resistant key encapsulation fails on a classical computer, the national secret algorithm in the hardware can still be used to protect the security of the session key, meet the semantic security required by the current public key encryption algorithm, and improve data security.

[0064] Reference Figure 3 The embodiment of this specification also provides a hybrid secret key encapsulation system, including a requesting end 1 and a receiving end 2, the system including: the requesting end 1 obtains the public key of the quantum-resistant key pair and the public key of the national secret key pair corresponding to the information request to be encrypted; the requesting end 1 calls a first random number generator to generate a first random number, encrypts the first random number according to the public key of the national secret key pair and the first national secret algorithm to obtain a first encryption key; the requesting end 1 calls a second random number generator to generate a second random number, generates a subkey according to the second random number and the quantum-resistant cryptographic algorithm, and generates a subkey according to the public key of the quantum-resistant key pair. , the quantum-resistant cryptographic algorithm encrypts the subkey to obtain a second encryption key; the requesting end 1 generates a first symmetric encryption session key according to the subkey, the first random number, and the second national secret algorithm; and encrypts the message plaintext corresponding to the information request to be encrypted based on the first symmetric encryption session key and the third national secret algorithm to obtain a message ciphertext; the requesting end 1 sends the first encryption key, the second encryption key, and the message ciphertext to the receiving end 2; the receiving end 2 uses the private key of the quantum-resistant key pair and the private key of the national secret key pair to decrypt the message ciphertext to obtain a message plaintext.

[0065] In an alternative embodiment, Figure 3As shown, the requesting end 1 initiates a request for information to be encrypted, the receiving end 2 receives the request for information to be encrypted, and calls the quantum-resistant cryptographic algorithm in the trusted execution environment 3 to generate a quantum-resistant key pair and calls the first national secret algorithm in the trusted execution environment 3 to generate a national secret key pair, wherein the quantum-resistant key pair includes a public key K1 of the quantum-resistant key pair and a private key K2 of the quantum-resistant key pair, and the national secret key pair includes a public key S1 of the national secret key pair and a private key S2 of the national secret key pair; then, the receiving end 2 sends the public key K1 and the public key S1 to the requesting end 1, and the requesting end 1 calls the first random number generator to generate a first random number, and performs a random operation on the first random number according to the public key S1 and the first national secret algorithm. The first encryption key S3 is obtained by encrypting the message. The requesting end 1 then invokes a second random number generator in the trusted execution environment 3 to generate a second random number. The subkey K3 is generated based on the second random number and the quantum-resistant cryptographic algorithm. The subkey K3 is then encrypted based on the public key K1 of the quantum-resistant key pair and the quantum-resistant cryptographic algorithm to obtain a second encryption key K4. Finally, the requesting end 1 generates a first symmetric encryption session key based on the subkey K3, the first random number, and the second national secret algorithm. The message plaintext corresponding to the encrypted information request is encrypted based on the first symmetric encryption session key and the third national secret algorithm to obtain the message ciphertext, thus completing the message encryption phase. After the message encryption phase is completed, the receiving end 2 needs to obtain the message plaintext by decryption. Therefore, the requesting end 1 also needs to send the first encryption key S3, the second encryption key K4, and the message ciphertext to the receiving end 2 so that the receiving end 2 can decrypt the message ciphertext using the private key K2 of the quantum-resistant key pair and the private key S2 of the national secret key pair to obtain the message plaintext. This application adds a quantum-resistant key encapsulation technology solution on the basis of the traditional national secret key encapsulation solution, so that the encapsulated key has the function of resisting quantum attacks; when the quantum-resistant key encapsulation technology solution fails on a classical computer, the national secret algorithm in the hardware can still be used to protect the security of the session key, meet the semantic security required by the current public key encryption algorithm, and improve data security.

[0066] Specifically, the receiving end 2 uses the private key of the quantum-resistant key pair and the private key of the national secret key pair to decrypt the message ciphertext to obtain the message plaintext, including: the receiving end 2 uses the private key S1 of the national secret key pair and the fourth national secret algorithm to decrypt the first encryption key S3 to obtain the first random number; then, the receiving end 2 uses the private key K1 of the quantum-resistant key pair and the quantum-resistant cryptographic algorithm to decrypt the second encryption key K4 to obtain the subkey K3; thereafter, the receiving end 2 generates a second symmetric encryption session key according to the first random number, the subkey K3, and the fifth national secret algorithm; the receiving end 2 decrypts the message ciphertext based on the second symmetric encryption session key and the sixth national secret algorithm to obtain the message plaintext. Among them, since the first symmetric encryption session key and the second symmetric encryption session key are obtained using the same input and algorithm, the first symmetric encryption session key and the second symmetric encryption session key are the same symmetric encryption session key; this application adds a technical solution for quantum-resistant key encapsulation on the basis of the traditional national secret key encapsulation solution, so that the key has quantum attack resistance after encapsulation; at the same time, the same symmetric encryption session key is used to encrypt and decrypt messages, thereby ensuring the security of messages during transmission.

[0067] Based on the same inventive concept, an embodiment of this specification also provides an electronic device.

[0068] The following describes an electronic device embodiment of the present invention, which can be considered a specific physical implementation of the method and apparatus embodiments of the present invention described above. Details described in the electronic device embodiment of the present invention should be considered supplementary to the above-mentioned method or apparatus embodiments; details not disclosed in the electronic device embodiment of the present invention can be implemented with reference to the above-mentioned method or apparatus embodiments.

[0069] Reference Figure 4 This is a schematic diagram of the structure of an electronic device provided in the embodiment of this specification. Figure 4 The electronic device 300 according to this embodiment of the present invention will be described. Figure 4 The electronic device 300 shown is merely an example and should not limit the functions and scope of use of the embodiments of the present invention.

[0070] like Figure 4 As shown, electronic device 300 is implemented as a general-purpose computing device. Components of electronic device 300 may include, but are not limited to, at least one processing unit 310, at least one storage unit 320, a bus 330 connecting various device components (including storage unit 320 and processing unit 310), and a display unit 340.

[0071] The storage unit stores program codes that can be executed by the processing unit 310, so that the processing unit 310 performs the steps according to various exemplary embodiments of the present invention described in the above processing method section of this specification. For example, the processing unit 310 can perform the following steps: Figure 1 Steps shown.

[0072] The storage unit 320 may include a readable medium in the form of a volatile storage unit, such as a random access memory unit (RAM) 3201 and / or a cache memory unit 3202 , and may further include a read-only memory unit (ROM) 3203 .

[0073] The storage unit 320 may also include a program / utility 3204 having a set (at least one) of program modules 3205, such program modules 3205 including but not limited to: operating means, 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.

[0074] Bus 330 may represent one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.

[0075] The electronic device 300 may also communicate with one or more external devices 400 (e.g., keyboards, pointing devices, Bluetooth devices, etc.), one or more devices that enable a user to interact with the electronic device 300, and / or any device that enables the electronic device 300 to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed through an input / output (I / O) interface 350. Furthermore, the electronic device 300 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) through a network adapter 360. The network adapter 360 may communicate with other modules of the electronic device 300 through the bus 330. It should be understood that although Figure 4 Not shown, other hardware and / or software modules may be used in conjunction with the electronic device 300, including but not limited to microcode, device drivers, redundant processing units, external disk drive arrays, RAID devices, tape drives, and data backup storage devices.

[0076] Through the description of the above embodiments, it is easy for those skilled in the art to understand that the exemplary embodiments described in the present invention can be implemented by software, or by combining software with necessary hardware. Therefore, the technical solution according to the embodiment of the present invention can be embodied in the form of a software product, which can be stored in a computer-readable storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes a number of instructions to enable a computing device (which can be a personal computer, a server, or a network device, etc.) to execute the above method according to the present invention. When the computer instructions are executed by a data processing device, the computer-readable medium is enabled to implement the above method of the present invention, that is: Figure 1 The method shown.

[0077] Reference Figure 5 A schematic diagram of a computer-readable medium provided in accordance with an embodiment of this specification.

[0078] accomplish Figure 1 The computer instructions of the illustrated method can be stored on one or more computer-readable media. The computer-readable medium can be a readable signal medium or a readable storage medium. The readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor device, device or component, or any combination thereof. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof.

[0079] The computer-readable storage medium may include a data signal propagated in baseband or as part of a carrier wave, wherein the readable program code is carried. The data signal propagated may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. The readable storage 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 device, device, or component. The program code contained on the 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 thereof.

[0080] The program code for performing the operations of the present invention may be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java, C++, and the like, as well as 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 stand-alone 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 cases involving a remote computing device, the remote computing device may be connected to the user computing device via 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., via the Internet using an Internet service provider).

[0081] In summary, the present invention can be implemented in hardware, or in a software module running on one or more processors, or in a combination thereof. It will be appreciated by those skilled in the art that general data processing equipment such as a microprocessor or a digital signal processor (DSP) can be used in practice to implement some or all of the functions of some or all of the components in the embodiments of the present invention. The present invention can also be implemented as a device or apparatus program (e.g., a computer program and a computer program product) for executing a part or all of the methods described herein. Such a program for implementing the present invention can be stored on a computer-readable medium, or can have the form of one or more signals. Such a signal can be downloaded from an Internet website, or provided on a carrier signal, or provided in any other form.

[0082] The specific embodiments described above further illustrate the objectives, technical solutions, and beneficial effects of the present invention. It should be understood that the present invention is not inherently related to any specific computer, virtual device, or electronic device, and various general-purpose devices can also implement the present invention. The above description is only a specific embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention shall be included in the scope of protection of the present invention.

[0083] The various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referred to each other. Each embodiment focuses on the differences from other embodiments.

[0084] The foregoing is merely an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application should all be included within the scope of the claims of the present application.

Claims

1. A hybrid key encapsulation method, characterized in that: include: Obtain the public key of the quantum-resistant key pair and the public key of the national secret key pair corresponding to the information request to be encrypted; Calling a first random number generator to generate a first random number, encrypting the first random number according to the public key of the national secret key pair and the first national secret algorithm to obtain a first encryption key; calling a second random number generator to generate a second random number, generating a subkey based on the second random number and the quantum-resistant cryptographic algorithm, and encrypting the subkey based on the public key of the quantum-resistant key pair and the quantum-resistant cryptographic algorithm to obtain a second encryption key; Generate a first symmetric encryption session key according to the subkey, the first random number, and a second national secret algorithm; and encrypting the message plaintext corresponding to the information request to be encrypted based on the first symmetric encryption session key and a third-country secret algorithm to obtain a message ciphertext; The first encryption key, the second encryption key and the message ciphertext are sent to a receiving end so that the receiving end uses the private key of the quantum-resistant key pair and the private key of the national secret key pair to decrypt the message ciphertext to obtain a message plaintext.

2. The method according to claim 1, wherein Before obtaining the public key in the quantum-resistant key pair and the public key in the national secret key pair corresponding to the information request to be encrypted, it also includes: The receiving end receives a request for information to be encrypted, and calls a quantum-resistant cryptographic algorithm in a trusted execution environment to generate a quantum-resistant key pair and calls a first national secret algorithm to generate a national secret key pair; wherein the quantum-resistant key pair includes a public key of the quantum-resistant key pair and a private key of the quantum-resistant key pair, and the national secret key pair includes a public key of the national secret key pair and a private key of the national secret key pair.

3. The method according to claim 2, wherein Before calling the trusted execution environment, the method further includes: Building a trusted execution environment based on the second random number generator, the quantum-resistant cryptographic algorithm, and a preset private key; Performing a security check on the trusted execution environment, and generating a verification certificate when the security check is correct; The verification certificate is signed using the preset private key and sent to the verifier. The verifier verifies the signed verification certificate using the preset public key. When the verification is successful, the trusted execution environment is in a secure state, and the second random number generator and the quantum-resistant cryptographic algorithm can be called. The preset private key and the preset public key form a pair of keys.

4. The method according to claim 3, wherein The verification party verifies the signed verification certificate using a preset public key, including: The verifying party sends the signed verification certificate to the server, and the server verifies the signed verification certificate according to the public key preset in the server.

5. The method according to claim 4, wherein The verification party verifies the signed verification certificate using a preset public key, further comprising: The verification party downloads the preset public key from the server or the root certificate, and uses the preset public key to verify the signed verification certificate.

6. The method according to claim 1, wherein The receiving end uses the private key of the quantum-resistant key pair and the private key of the national secret key pair to decrypt the message ciphertext to obtain the message plaintext, including: The receiving end decrypts the first encryption key using the private key of the national secret key pair and the fourth national secret algorithm to obtain the first random number; The receiving end decrypts the second encryption key using the private key of the quantum-resistant key pair and the quantum-resistant cryptographic algorithm to obtain the subkey; The receiving end generates a second symmetric encryption session key according to the first random number, the subkey, and the fifth national secret algorithm; The receiving end decrypts the message ciphertext based on the second symmetric encryption session key and the sixth national secret algorithm to obtain a message plaintext.

7. The method according to claim 6, wherein The quantum-resistant cryptographic algorithm is the Kyber algorithm, the first and fourth national secret algorithms are the SM2 algorithms, the third and fifth national secret algorithms are the SM3 algorithms, and the third and sixth national secret algorithms are the SM4 algorithms.

8. A hybrid key encapsulation system, comprising a requesting end and a receiving end, characterized in that , the system comprises: The requesting end obtains the public key of the quantum-resistant key pair and the public key of the national secret key pair corresponding to the information request to be encrypted; The requesting end calls a first random number generator to generate a first random number, and encrypts the first random number according to the public key of the national secret key pair and the first national secret algorithm to obtain a first encryption key; The requesting end calls a second random number generator to generate a second random number, generates a subkey based on the second random number and the quantum-resistant cryptographic algorithm, and encrypts the subkey based on the public key of the quantum-resistant key pair and the quantum-resistant cryptographic algorithm to obtain a second encryption key; The requesting end generates a first symmetric encryption session key based on the subkey, the first random number, and the second national secret algorithm; and encrypts the message plaintext corresponding to the information request to be encrypted based on the first symmetric encryption session key and the third national secret algorithm to obtain a message ciphertext; The requesting end sends the first encryption key, the second encryption key and the message ciphertext to the receiving end; The receiving end uses the private key of the quantum-resistant key pair and the private key of the national secret key pair to decrypt the message ciphertext to obtain the message plaintext.

9. The system according to claim 8, wherein The system further comprises: The receiving end decrypts the first encryption key using the private key of the national secret key pair and the fourth national secret algorithm to obtain the first random number; The receiving end decrypts the second encryption key using the private key of the quantum-resistant key pair and the quantum-resistant cryptographic algorithm to obtain the subkey; The receiving end generates a second symmetric encryption session key according to the first random number, the subkey, and the fifth national secret algorithm; The receiving end decrypts the message ciphertext based on the second symmetric encryption session key and the sixth national secret algorithm to obtain a message plaintext.

10. An electronic device, characterized in that: The method comprises a memory and a processor, wherein the memory stores computer instructions, and the processor is configured to execute the computer instructions to perform the method according to any one of claims 1 to 7.

11. A storage medium, characterized in that: The storage medium stores computer instructions, which are configured to execute the method according to any one of claims 1 to 7 when executed.

Citation Information

Patent Citations

  • Information verification method and related equipment

    CN118174967A

  • National password IPSec secure communication method supporting quantum cryptography resistance

    CN118631448A