Hybrid secret key packaging method and system

Through the hybrid key packaging method, combining anti-quantum keys and national secret keys, the problem of low data security in the communication process in the era of quantum computing is solved, and the dual protection of quantum computers and traditional computers is achieved, and data is improved. security.

CN119483934AActive Publication Date: 2025-02-18ORIGIN QUANTUM COMPUTING TECH (HEFEI) CO LTD

Patent Information

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

AI Technical Summary

Technical Problem

In the era of quantum computing, the data security of the communication process is low, and the existing technology is difficult to effectively resist the attacks of quantum computers. At the same time, the attacks of traditional computers also have risks.

Method used

Adopt a hybrid key packaging method, combining anti-quantum key and national secret key, and generate encryption keys through a random number generator, and generate symmetric encryption session keys using anti-quantum cryptography algorithm and national secret algorithm, and encrypt the encrypted information. and decrypt.

Benefits of technology

It has achieved data security improvement in communication process in the era of quantum computing, can withstand attacks from quantum computers, and protect the security of session keys through the national secret algorithm when it fails on classical computers, meeting semantic security requirements.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119483934A_ABST
    Figure CN119483934A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of information security, in particular to a hybrid key packaging method and system, and the method comprises the steps: determining a first encryption key, a sub-key and a second encryption key according to a public key of an anti-quantum key pair and a public key of a national secret key pair corresponding to an obtained to-be-encrypted information request; generating a first symmetric encryption session key according to the sub-key, the first random number and a second cryptographic algorithm; encrypting a message plaintext corresponding to the to-be-encrypted message request by using the first symmetric encryption session key; a receiving end carries out decryption based on the same mode, and an anti-quantum key packaging technology is added to a traditional national secret key packaging scheme, so that the key has an anti-quantum attack function after being packaged; when the anti-quantum key packaging technical scheme loses efficacy on a classical computer, the security of the session key can still be protected by using a national cryptographic algorithm in hardware, the semantic security required by a current public key encryption algorithm is met, and the security of data is improved.
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) are at 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 a 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 anti-quantum cryptographic technology to enhance its ability to resist quantum attacks. However, although anti-quantum 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 algorithm design. Therefore, how to improve the data security of the communication process in the era of quantum computing 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 era of quantum computing in the prior art.

[0004] The embodiment of this specification 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, 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 according to the second random number and the quantum-resistant cryptographic algorithm, and encrypting the subkey according to 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 according to 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 process further includes:

[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 process 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 by using the preset private key and sent to the verification party, and the verification party verifies the signed verification certificate by 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.

[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 a 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 a 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 embodiment of this specification also provides a hybrid key encapsulation system, including a requesting end and a receiving end, and 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 according to the second random number and the quantum-resistant cryptographic algorithm, and encrypts the subkey according to 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 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;

[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 comprises 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 the security of the data. 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 for 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, but should not 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, but should not 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 as 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 similar 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 secret key encapsulation method provided in an embodiment of this specification includes: S101: obtaining a public key of a quantum-resistant key pair and a public key of a national secret key pair corresponding to an 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 encrypting the subkey according to the public key of the quantum-resistant key pair and the quantum-resistant cryptographic algorithm; The subkey is encrypted by a sub-cipher 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 the 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, 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. Get the first encryption key S3; then, the requesting end calls the second random number generator in the trusted execution environment to generate a second random number, generates a subkey K3 according to the second random number and the quantum-resistant cryptographic algorithm, and encrypts the subkey K3 according to 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 the first symmetric encryption session key according to 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 link. After the message encryption link is completed, the receiving end needs to obtain the message plaintext by 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 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 the security of the data.

[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 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; 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 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.

[0058] Optionally, before calling the trusted execution environment, it also 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; signing the verification certificate using the preset private key and sending it to the verifier, the verifier verifying the signed verification certificate using a preset public key, and 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 to run the internal security detection program to achieve security detection of the trusted execution environment, and generates a verification certificate when the security detection is correct; then, the test end uses the preset private key in the test end to sign the verification certificate and send it to the verification party, and the verification party uses the preset public key to verify the signed verification certificate. When the verification passes, it means that the trusted execution environment is in a secure state, the second random number generator and the anti-quantum cryptographic algorithm are trusted objects and can be called. By using the trusted execution environment, the sensitive data of the anti-quantum cryptographic algorithm is protected to avoid security issues caused by software storage. Among them, the trusted execution environment is constructed by the second random number generator, the anti-quantum cryptographic algorithm and the preset private key, and the preset private key and the preset public key are 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 according to 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 completely usable; if the verification fails, it means that the quantum-resistant cryptographic algorithm and random number generator in the trusted execution environment may be 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, so 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 then the communicating parties 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 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 the security of the data.

[0064] Reference Figure 3 A hybrid secret key encapsulation system is also provided for the embodiment of this specification, including a requesting end 1 and a receiving end 2, the system comprising: 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. Encrypt to obtain the first encryption key S3; then, the request end 1 calls the second random number generator in the trusted execution environment 3 to generate a second random number, generates a subkey K3 according to the second random number and the quantum-resistant cryptographic algorithm, and encrypts the subkey K3 according to 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 request end 1 generates the first symmetric encryption session key according to 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 link. After the message encryption link is completed, the receiving end 2 needs to obtain the message plaintext by decryption. Therefore, the request 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 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 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 the security of the data.

[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 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; 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 regarded as a specific physical implementation of the method and device embodiments of the present invention. The details described in the electronic device embodiment of the present invention should be regarded as a supplement to the above method or device embodiments; details not disclosed in the electronic device embodiment of the present invention can be implemented with reference to the above method or device embodiments.

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

[0070] like Figure 4 As shown, the electronic device 300 is in the form of a general computing device. The components of the 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 different device components (including the storage unit 320 and the processing unit 310), a display unit 340, etc.

[0071] The storage unit stores program codes, which 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 the implementation of a network environment.

[0074] Bus 330 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.

[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 implementation methods, 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 software combined with necessary hardware. Therefore, the technical solution according to the implementation method 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, USB flash drive, mobile hard disk, etc.) or on a network, including a number of instructions to enable a computing device (which can be a personal computer, server, or 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 can 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 for an embodiment of this specification.

[0078] accomplish Figure 1 The computer instructions of the method shown 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 of the above. 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 of the above.

[0079] The computer readable storage medium may include a data signal propagated in a baseband or as part of a carrier wave, wherein a readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. 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 combination with an instruction execution device, device, or device. The program code contained on the readable storage medium may be transmitted using any suitable medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the above.

[0080] 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++, 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 cases involving 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., through 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 should be understood by those skilled in the art that general data processing devices such as microprocessors or digital signal processors (DSPs) 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 part or all of the methods described herein. Such a program 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 describe the purpose, technical solutions and beneficial effects of the present invention in detail. It should be understood that the present invention is not inherently related to any specific computer, virtual device or electronic device, and various general 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 should be included in the protection scope 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 referenced to each other, and each embodiment focuses on the differences from other embodiments.

[0084] The above is only 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 modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in 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 according to the second random number and the quantum-resistant cryptographic algorithm, and encrypting the subkey according to 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 the third country encryption 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, characterized in that 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, characterized in that 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 by using the preset private key and sent to the verification party, and the verification party verifies the signed verification certificate by 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.

4. The method according to claim 3, characterized in that 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 a public key preset in the server.

5. The method according to claim 4, characterized in that 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, characterized in 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, 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, characterized in that 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.

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 according to the second random number and the quantum-resistant cryptographic algorithm, and encrypts the subkey according to 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 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 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, characterized in that 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, and the computer instructions 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

  • Application program communication processing system, apparatus, method, and client terminal, and server terminal

    WO2018000886A1

Cited By

  • IPSec mixed anti-quantum computing security method and electronic equipment

    CN119652525A

  • Method and system for realizing internal secure communication of BMC (Baseboard Management Controller) based on desktop bus

    CN120277692A

  • Anti-quantum tunnel communication security enhancement method and system based on software definition

    CN120434048A

  • Software-defined anti-quantum tunneling communication security enhancement method and system

    CN120434048B

  • Data sending method, data receiving method, sender device and receiver device

    CN120498684A