Hybrid encryption and decryption method and device for post quantum cryptography and national cryptographic algorithm

By using a hybrid encryption method combining post-quantum cryptography and national cryptographic algorithms, the security and compatibility issues during the migration process were resolved, achieving a smooth transition in security and compatibility, and providing resistance to quantum attacks.

CN119602946APending Publication Date: 2025-03-11CHINA TELECOM QUANTUM TECH CO LTD

Patent Information

Application Number
CN202411608129.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-12
Publication Date
2025-03-11

AI Technical Summary

Technical Problem

Existing technologies face challenges in migrating from the SM2 algorithm to the PQC algorithm, including unverified security, incompatible interfaces, and a large migration workload, making a smooth transition to the post-quantum era difficult.

Method used

The method employs a hybrid encryption approach combining post-quantum cryptography and Chinese national cryptographic algorithms. By obtaining the recipient's hybrid encryption public key, it decapsulates the public key into a Chinese national cryptographic encryption public key component and a post-quantum key encapsulated public key component, generating Chinese national cryptographic encryption ciphertext, post-quantum key encapsulated ciphertext, and a message hash value. These are then encapsulated to generate hybrid encryption ciphertext.

Benefits of technology

It enables a safer and smoother transition to the post-quantum era, improves the security of encryption operations, reduces migration difficulty and workload, has the ability to resist quantum attacks, and is fully compatible with national cryptographic algorithms.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119602946A_ABST
    Figure CN119602946A_ABST
Patent Text Reader

Abstract

The invention provides a post quantum cryptography and national cryptographic algorithm hybrid encryption and decryption method and device, and relates to the technical field of password application. The hybrid encryption method comprises the following steps: acquiring a hybrid encryption public key of a receiver and plaintext data to be encrypted, performing de-encapsulation processing on the hybrid encryption public key to obtain a first national cryptographic encryption public key component and a post-quantum key encapsulation public key component, generating a first national cryptographic encryption ciphertext and a post-quantum key encapsulation ciphertext, and transmitting the first national cryptographic encryption ciphertext and the post-quantum key encapsulation ciphertext to the receiver; generating a first temporary key according to a first random number corresponding to the first national cryptographic encryption ciphertext and a symmetric key corresponding to the post-quantum key encapsulation ciphertext, and encrypting the plaintext data to be encrypted by adopting a second national cryptographic encryption algorithm according to the first temporary key to obtain a second national cryptographic message ciphertext, and performing third national cryptographic algorithm hash operation on the to-be-encrypted plaintext data to obtain a message hash value, and performing packaging processing on the first national cryptographic encrypted ciphertext, the post quantum key packaging ciphertext, the second national cryptographic message ciphertext and the message hash value to obtain a mixed encrypted ciphertext.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of cryptographic application technology, and in particular to a hybrid encryption and decryption method and device of post-quantum cryptography and national secret algorithm. Background Art

[0002] With the development of quantum computing, quantum computers use algorithms such as quantum Shor to break the elliptic curve SM2 public key encryption based on the mathematical problem of elliptic curve discrete logarithm in polynomial time.

[0003] In order to resist the threat of quantum computing and improve the security of public key encryption, the method of integrating post-quantum cryptography algorithms is adopted. However, during the implementation process, the algorithm is directly migrated from SM2 to PQC. During the standardization transition period, the security of the PQC algorithm has not been fully verified, and coexistence with SM2 classical keys and how to transition to the post-quantum era more safely and smoothly have not been considered. At the same time, although the PQC algorithm provides key encapsulation operations, this operation is incompatible with the interface and functions of SM2 public key encryption operations. Therefore, when the upper-layer cryptographic protocols and applications are migrated from SM2 to PQC, the modification workload is extremely large. Summary of the invention

[0004] The purpose of the present invention is to provide a hybrid encryption and decryption method and device of post-quantum cryptography and national secret algorithm to address the deficiencies in the above-mentioned prior art, so as to realize hybrid encryption of post-quantum cryptography and national secret algorithm, and enable a safer and smoother transition to the post-quantum era.

[0005] To achieve the above purpose, the technical solution adopted in the embodiment of the present application is as follows:

[0006] In a first aspect, an embodiment of the present application provides a hybrid encryption method of post-quantum cryptography and national secret algorithm, which is applied to a sender, and the method includes:

[0007] Obtain the recipient's hybrid encryption public key and the plaintext data to be encrypted;

[0008] Decapsulating the hybrid encrypted public key to obtain a first national secret encrypted public key component and a post-quantum key encapsulated public key component; the first national secret encrypted public key component is an encrypted public key component obtained by the first national secret encryption algorithm;

[0009] Generate a first national secret encrypted ciphertext and a post-quantum key encapsulated ciphertext respectively according to the first national secret encrypted public key component and the post-quantum key encapsulated public key component;

[0010] Generate a first temporary key according to a first random number corresponding to the first national secret encrypted ciphertext and a symmetric key corresponding to the post-quantum key encapsulation ciphertext;

[0011] According to the first temporary key, the plaintext data to be encrypted is encrypted using a second national secret encryption algorithm to obtain a second national secret message ciphertext;

[0012] Perform a hash operation using a third-party encryption algorithm on the plaintext data to be encrypted to obtain a message hash value;

[0013] The first national secret encrypted ciphertext, the post-quantum key encapsulated ciphertext, the second national secret message ciphertext and the message hash value are encapsulated to obtain a mixed encrypted ciphertext.

[0014] In an optional implementation manner, generating a first national secret encrypted ciphertext and a post-quantum key encapsulated ciphertext respectively according to the first national secret encrypted public key component and the post-quantum key encapsulated public key component includes:

[0015] According to the first national secret encryption public key component, the first random number is encrypted using the first national secret encryption algorithm to obtain the first national secret encryption ciphertext;

[0016] A post-quantum key encapsulation algorithm is used to encapsulate the post-quantum key encapsulation public key component to obtain the post-quantum key encapsulation ciphertext and the symmetric key.

[0017] In an optional implementation, generating a first temporary key according to a first random number corresponding to the first national secret encrypted ciphertext and a symmetric key corresponding to the post-quantum key encapsulation ciphertext includes:

[0018] A key derivation operation is performed on the first random number and the symmetric key to generate the first temporary key.

[0019] In an optional implementation, before respectively generating the first national secret encrypted ciphertext and the post-quantum key encapsulated ciphertext according to the first national secret encrypted public key component and the post-quantum key encapsulated public key component, the method further includes:

[0020] A random number request is sent to the national secret cryptographic operation module so that the national secret cryptographic operation module returns the first random number.

[0021] In the second aspect, the embodiment of the present application also provides a hybrid decryption method of post-quantum cryptography and national secret algorithm, which is applied to the receiving party, and the method includes:

[0022] Obtaining a mixed encrypted ciphertext to be decrypted; the mixed encrypted ciphertext to be decrypted is a ciphertext obtained by the sender using a mixed encryption public key to perform mixed encryption on the encrypted plaintext data;

[0023] Decapsulating the mixed encrypted ciphertext to be decrypted to obtain the first national secret encrypted ciphertext to be decrypted, the post-quantum key encapsulated ciphertext to be decrypted, the second national secret message ciphertext to be decrypted, and the first message hash value;

[0024] According to the first national secret encryption private key component and the post-quantum key encapsulation private key component in the hybrid encryption private key, the first national secret encrypted ciphertext to be decrypted and the post-quantum key encapsulation ciphertext to be decrypted are respectively decrypted to obtain a second temporary key; the first national secret encryption private key component is the encrypted private key component obtained by the first national secret encryption algorithm;

[0025] Decrypt the second national secret message ciphertext to be decrypted using the second national secret decryption algorithm according to the second temporary key to obtain the plaintext data to be verified;

[0026] Perform a hash operation using a third-country secret algorithm on the plaintext data to be verified to obtain a second message hash value;

[0027] The first message hash value and the second message hash value are compared to determine target plaintext data.

[0028] In an optional implementation, the decrypting the first national secret encrypted ciphertext to be decrypted and the post-quantum key encapsulated ciphertext to be decrypted respectively according to the first national secret encrypted private key component and the post-quantum key encapsulated private key component in the hybrid encrypted private key to obtain the second temporary key includes:

[0029] Decrypting the first national secret encrypted ciphertext to be decrypted using the first national secret decryption algorithm according to the first national secret encrypted private key component to obtain a first key;

[0030] According to the post-quantum key encapsulation private key component, a post-quantum key encapsulation algorithm is used to decapsulate the post-quantum key encapsulation ciphertext to be decrypted to obtain a second key;

[0031] A key derivation operation is performed on the first key and the second key to generate the second temporary key.

[0032] In an optional implementation manner, comparing the first message hash value and the second message hash value to determine the target plaintext data includes:

[0033] If the first message hash value and the second message hash value are the same, it is determined that the comparison is successful, and the plaintext data to be verified is determined to be the target plaintext data.

[0034] In an optional implementation manner, comparing the first message hash value and the second message hash value to determine the target plaintext data includes:

[0035] If the first message hash value and the second message hash value are different, it is determined that the comparison fails, and it is determined that the plaintext data to be verified is not the target plaintext data.

[0036] In an optional embodiment, the method further comprises:

[0037] Calling the first national secret algorithm to generate a key pair interface to generate a first national secret encryption key pair, wherein the first national secret encryption key pair includes: the first national secret encryption private key component and the first national secret encryption public key component;

[0038] Calling a post-quantum key encapsulation algorithm to generate a key pair interface, generating a post-quantum key encapsulation key pair, the post-quantum key encapsulation key pair comprising: the post-quantum key encapsulation private key component and the post-quantum key encapsulation public key component;

[0039] Encapsulating the first national secret encryption private key component and the post-quantum key encapsulation private key component to obtain the hybrid encryption private key;

[0040] The post-quantum key encapsulation public key component of the first national secret encryption public key component is encapsulated to obtain the hybrid encryption public key, and the hybrid encryption public key is made public.

[0041] In the third aspect, an embodiment of the present application also provides a computer device, comprising: a processor, a storage medium and a bus, the storage medium storing program instructions executable by the processor, when the computer device is running, the processor and the storage medium communicate through the bus, and the processor executes the program instructions to perform the steps of the hybrid encryption method of post-quantum cryptography and national secret algorithm as described in any of the first aspects, or perform the steps of the hybrid decryption method of post-quantum cryptography and national secret algorithm as described in any of the second aspects.

[0042] The beneficial effects of this application are:

[0043] The embodiment of the present application provides a hybrid encryption and decryption method and device of post-quantum cryptography and national secret algorithm. The hybrid encryption method includes: obtaining a hybrid encryption public key and plaintext data to be encrypted of a recipient, decapsulating the hybrid encryption public key to obtain a first national secret encryption public key component and a post-quantum key encapsulation public key component, wherein the first national secret encryption public key component is an encrypted public key component obtained by a first national secret encryption algorithm, generating a first national secret encryption ciphertext and a post-quantum key encapsulation ciphertext according to the first national secret encryption public key component and the post-quantum key encapsulation public key component, generating a first temporary key according to a first random number corresponding to the first national secret encryption ciphertext and a symmetric key corresponding to the post-quantum key encapsulation ciphertext, encrypting the plaintext data to be encrypted by a second national secret encryption algorithm according to the first temporary key to obtain a second national secret message ciphertext, then performing a hash operation of a third national secret algorithm on the plaintext data to obtain a message hash value, and finally encapsulating the first national secret encryption ciphertext, the post-quantum key encapsulation ciphertext, the second national secret message ciphertext and the message hash value to obtain a hybrid encryption ciphertext. The implementation of hybrid encryption of post-quantum cryptography and national secret algorithms can enable a safer and smoother transition to the post-quantum era. In addition, the hybrid encrypted ciphertext includes multiple components, which attackers need to crack simultaneously to obtain the plaintext data to be encrypted, which improves the security of hybrid encryption operations and has the ability to resist quantum attacks. Finally, due to the hybrid encryption operations of post-quantum cryptography and national secret algorithms, they are fully compatible with the interfaces and functions of national secret algorithm encryption operations, which greatly reduces the difficulty and workload of migrating upper-level cryptographic protocols and applications from national secret algorithms to post-quantum algorithms. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.

[0045] Figure 1 A schematic diagram of a hybrid encryption method of post-quantum cryptography and national secret algorithm provided in an embodiment of the present application;

[0046] Figure 2 A flowchart of another hybrid encryption method of post-quantum cryptography and national secret algorithm provided in an embodiment of the present application;

[0047] Figure 3 A flowchart of a hybrid decryption method of post-quantum cryptography and national secret algorithm provided in an embodiment of the present application;

[0048] Figure 4 A flowchart of another hybrid decryption method of post-quantum cryptography and national secret algorithm provided in an embodiment of the present application;

[0049] Figure 5 A schematic diagram of a process for generating a hybrid encryption cipher pair of post-quantum cryptography and national secret algorithm provided in an embodiment of the present application;

[0050] Figure 6 A functional module diagram of a hybrid encryption device of post-quantum cryptography and national secret algorithm provided in an embodiment of the present application;

[0051] Figure 7 A functional module diagram of a post-quantum cryptography and national secret algorithm hybrid decryption device provided in an embodiment of the present application;

[0052] Figure 8 A schematic diagram of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0053] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments.

[0054] Therefore, the following detailed description of the embodiments of the present application provided in the accompanying drawings is not intended to limit the scope of the present application for which protection is sought, but merely represents selected embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of the present application.

[0055] In the description of the present application, it should be noted that if the terms "upper", "lower", etc. appear, the orientation or position relationship indicated is based on the orientation or position relationship shown in the drawings, or is the orientation or position relationship in which the product of the application is usually placed when used. It is only for the convenience of describing the present application and simplifying the description, and does not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation on the present application.

[0056] In addition, the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0057] It should be noted that, in the absence of conflict, the features in the embodiments of the present application may be combined with each other.

[0058] In order to achieve double encryption protection for encrypted plaintext data, so that it has the ability to resist quantum attacks, the embodiment of the present application provides a hybrid encryption method of post-quantum cryptography and national secret algorithm, wherein post-quantum cryptography (PQC) is a new encryption algorithm that can resist quantum computer attacks. Post-quantum cryptography can not only run safely on traditional computers, but also resist future quantum computer attacks. National secret algorithms include the first national secret algorithm, the second national secret algorithm and the third national secret algorithm, wherein the first national secret algorithm is the SM2 algorithm, which uses elliptic curve cryptography as its mathematical basis and is an asymmetric cryptographic algorithm for digital signatures and key exchange; the second national secret encryption algorithm is the SM4 encryption algorithm, which is a symmetric cryptographic algorithm for data encryption and decryption, which supports a packet length of 128 bits, and a key length of 128 bits, 192 bits or 256 bits, and is suitable for various data encryption scenarios; the third national secret algorithm is the SM3 algorithm, which is a cryptographic hash (hash) algorithm, suitable for the generation and verification of digital signatures and verification message authentication codes in cryptographic applications and the generation of random numbers, which can meet the security requirements of various cryptographic applications.

[0059] Four algorithms are used to hybrid encrypt plaintext data to be encrypted. The method includes: generating a first national secret encrypted ciphertext and a post-quantum key encapsulation ciphertext according to a first national secret encryption public key component and a post-quantum key encapsulation public key component respectively; generating a first temporary key according to a first random number corresponding to the first national secret encrypted ciphertext and a symmetric key corresponding to the post-quantum key encapsulation ciphertext; then, according to the first temporary key, encrypting the plaintext data to be encrypted using a second national secret encryption algorithm to obtain a second national secret message ciphertext; performing a third national secret algorithm hash operation on the plaintext data to obtain a message hash value; finally, encapsulating the first national secret encrypted ciphertext, the post-quantum key encapsulation ciphertext, the second national secret message ciphertext and the message hash value to obtain a hybrid encrypted ciphertext. The hybrid encrypted ciphertext includes multiple components, and an attacker needs to crack them simultaneously to obtain the plaintext data to be encrypted. This can improve the security of the hybrid encryption operation and has the ability to resist quantum attacks.

[0060] The following is a detailed explanation of the hybrid encryption method of post-quantum cryptography and national secret algorithm provided in the embodiment of the present application through specific examples in combination with the accompanying drawings. Figure 1 A flow chart of a hybrid encryption method of post-quantum cryptography and national secret algorithm provided in an embodiment of the present application; Figure 1 As shown, the method includes:

[0061] S101. Obtain the recipient's hybrid encryption public key and the plaintext data to be encrypted.

[0062] In this embodiment, the receiver makes the hybrid encryption public key public in advance so that the sender can obtain the receiver's hybrid encryption public key. The plaintext data to be encrypted is the data output by the business system in the sender's client, and is also the data that needs to be transmitted to the receiver.

[0063] The sender encrypts the plaintext data to be encrypted by using the hybrid encryption public key to obtain the hybrid encryption ciphertext, and sends it to the receiver. The following example explains the process of obtaining the hybrid encryption ciphertext.

[0064] S102. Decapsulate the hybrid encrypted public key to obtain a first national secret encrypted public key component and a post-quantum key encapsulated public key component.

[0065] Among them, the first national secret encryption public key component is the encrypted public key component obtained by the first national secret encryption algorithm.

[0066] Specifically, the first national secret encryption algorithm is the SM2 algorithm, and the first national secret encryption public key component is the public key component of the first national secret encryption algorithm public-private key pair of the recipient, that is, the SM2 encryption public key.

[0067] The post-quantum key encapsulation public key component is the public key component of the public-private key pair of the recipient's post-quantum key encapsulation (Key Encapsulation Mechanism, KEM) algorithm, that is, the PQC KEM public key, where the post-quantum key encapsulation algorithm can adopt the post-quantum cryptography standard Kyber algorithm.

[0068] The receiver encapsulates the first national secret encryption public key component and the post-quantum key encapsulation public key component to obtain a hybrid encrypted public key. Therefore, the sender decapsulates the hybrid encrypted public key to obtain the first national secret encryption public key component and the post-quantum key encapsulation public key component.

[0069] S103. Generate a first national secret encrypted ciphertext and a post-quantum key encapsulated ciphertext respectively according to the first national secret encrypted public key component and the post-quantum key encapsulated public key component.

[0070] S104. Generate a first temporary key according to a first random number corresponding to the first national secret encrypted ciphertext and a symmetric key corresponding to the post-quantum key encapsulation ciphertext.

[0071] Specifically, the sender generates the first national secret encrypted ciphertext and the post-quantum key encapsulation ciphertext according to the first national secret encrypted public key component and the post-quantum key encapsulation public key component, that is, generates the SM2 encrypted ciphertext and the PQC KEM ciphertext.

[0072] And based on the first random number K1 corresponding to the first national secret encrypted ciphertext and the symmetric key K2 corresponding to the post-quantum key encapsulation ciphertext, a first temporary key KEY is generated.

[0073] Optionally, a key derivation operation is performed on the first random number and the symmetric key to generate a first temporary key.

[0074] Specifically, the key derivation operation may adopt an XOR operation, and then an XOR operation is performed on the first random number and the symmetric key to generate a first temporary key.

[0075] S105. Encrypt the plaintext data to be encrypted using the second national secret encryption algorithm according to the first temporary key to obtain a second national secret message ciphertext.

[0076] Specifically, the second national secret encryption algorithm is the SM4 encryption algorithm. According to the first temporary key, the SM4 encryption algorithm is used to perform symmetric encryption operation on the plaintext data to be encrypted to obtain the SM4 message ciphertext.

[0077] S106. Perform a hash operation using a third-party cryptographic algorithm on the plaintext data to be encrypted to obtain a message hash value.

[0078] Specifically, the third-party secret algorithm is the SM3 algorithm, which performs a hash operation of the SM3 algorithm on the plaintext data to be encrypted to obtain an SM3 message hash value.

[0079] S107, encapsulate the first national secret encrypted ciphertext, the post-quantum key encapsulated ciphertext, the second national secret message ciphertext and the message hash value to obtain a mixed encrypted ciphertext.

[0080] Specifically, the four components of SM2 encrypted ciphertext, PQC KEM ciphertext, SM4 message ciphertext and SM3 message hash value are concatenated and packaged to obtain a mixed encrypted ciphertext, and then the mixed encrypted ciphertext is sent to the receiver.

[0081] It should be noted that the upper-layer applications and cryptographic protocols pre-provide interfaces compatible with the SM2 encryption algorithm, making the interfaces and functions of post-quantum cryptography fully compatible with the first national secret algorithm encryption operations.

[0082] In summary, an embodiment of the present application provides a hybrid encryption method of post-quantum cryptography and national secret algorithm, the method comprising: obtaining a hybrid encrypted public key and plaintext data to be encrypted of a recipient, decapsulating the hybrid encrypted public key, obtaining a first national secret encrypted public key component and a post-quantum key encapsulated public key component, the first national secret encrypted public key component being an encrypted public key component obtained by a first national secret encryption algorithm, generating a first national secret encrypted ciphertext and a post-quantum key encapsulated ciphertext according to the first national secret encrypted public key component and the post-quantum key encapsulated public key component, generating a first national secret encrypted ciphertext and a post-quantum key encapsulated ciphertext according to a first random number corresponding to the first national secret encrypted ciphertext and a symmetric key corresponding to the post-quantum key encapsulated ciphertext, generating a first temporary key according to the first temporary key, encrypting the plaintext data to be encrypted using a second national secret encryption algorithm to obtain a second national secret message ciphertext, then performing a third national secret algorithm hash operation on the encrypted plaintext data to obtain a message hash value, and finally encapsulating the first national secret encrypted ciphertext, the post-quantum key encapsulated ciphertext, the second national secret message ciphertext and the message hash value to obtain a hybrid encrypted ciphertext. The implementation of hybrid encryption of post-quantum cryptography and national secret algorithms can enable a safer and smoother transition to the post-quantum era. In addition, the hybrid encrypted ciphertext includes multiple components, which attackers need to crack simultaneously to obtain the plaintext data to be encrypted, which improves the security of hybrid encryption operations and has the ability to resist quantum attacks. Finally, due to the hybrid encryption operations of post-quantum cryptography and national secret algorithms, they are fully compatible with the interfaces and functions of national secret algorithm encryption operations, which greatly reduces the difficulty and workload of migrating upper-level cryptographic protocols and applications from national secret algorithms to post-quantum algorithms.

[0083] Based on the hybrid encryption of post-quantum cryptography and national secret algorithm provided in the above embodiment, the embodiment of the present application also provides another possible implementation method of the hybrid encryption method of post-quantum cryptography and national secret algorithm, Figure 2 A flow chart of another hybrid encryption method of post-quantum cryptography and national secret algorithm provided in the embodiment of the present application. Figure 2As shown, according to the first national secret encryption public key component and the post-quantum key encapsulation public key component, the first national secret encryption ciphertext and the post-quantum key encapsulation ciphertext are generated respectively, including:

[0084] S201. Encrypt a first random number using a first national secret encryption algorithm according to a first national secret encryption public key component to obtain a first national secret encryption ciphertext.

[0085] In this embodiment, the sender performs encryption operation on the first random number using the SM2 encryption algorithm according to the first national secret encryption public key component, namely, the SM2 encryption public key component, to obtain an SM2 encrypted ciphertext.

[0086] Optionally, before respectively generating the first national secret encrypted ciphertext and the post-quantum key encapsulated ciphertext according to the first national secret encrypted public key component and the post-quantum key encapsulated public key component, the method further includes:

[0087] A random number request is sent to the national secret cryptographic operation module so that the national secret cryptographic operation module returns a first random number.

[0088] Among them, the national secret cryptographic operation module is used to provide cryptographic operation services, including cryptographic algorithms such as SM2, SM4, and SM3, and at the same time provide the first random number to the sender based on the random number request.

[0089] S202. Using a post-quantum key encapsulation algorithm, encapsulate the post-quantum key encapsulation public key component to obtain a post-quantum key encapsulation ciphertext and a symmetric key.

[0090] Specifically, a random number is generated in the mechanism of the post-quantum key encapsulation algorithm. According to the post-quantum key encapsulation public key component, that is, the PQC KEM public key component, the post-quantum key encapsulation algorithm is used to perform an encryption operation on the generated random number to obtain a PQC KEM ciphertext, and the symmetric key is the plaintext of a random number generated in the mechanism of the post-quantum key encapsulation algorithm.

[0091] It should be noted that the first national secret encryption ciphertext is obtained by encrypting the first random number, and the post-quantum key encapsulation ciphertext is obtained by encrypting a random number generated in the mechanism of the post-quantum key encapsulation algorithm. The two random numbers are obtained in different ways.

[0092] In the method provided in the embodiment of the present application, the first random number is encrypted according to the first national secret encryption public key component, and the first national secret encryption algorithm is used to obtain the first national secret encrypted ciphertext. The post-quantum key encapsulation algorithm is used to encapsulate the post-quantum key encapsulation public key component to obtain the post-quantum key encapsulation ciphertext and the symmetric key, thereby realizing the hybrid encryption of post-quantum cryptography and national secret algorithm.

[0093] After the receiver receives the hybrid encrypted ciphertext sent by the sender, it is still necessary to decrypt the hybrid encrypted ciphertext. Therefore, the embodiment of the present application also provides a hybrid decryption method of post-quantum cryptography and national secret algorithm, which is applied to the receiver. The hybrid decryption method of post-quantum cryptography and national secret algorithm provided in the embodiment of the present application is explained in detail through specific examples in combination with the accompanying drawings. Figure 3 A flowchart of a hybrid decryption method of post-quantum cryptography and national secret algorithm provided in an embodiment of the present application; Figure 3 As shown, the method includes:

[0094] S301. Obtain the mixed encrypted ciphertext to be decrypted.

[0095] The mixed encrypted ciphertext to be decrypted is the ciphertext obtained by the sender using the mixed encryption public key to perform mixed encryption on the plaintext data to be encrypted.

[0096] In this embodiment, the receiving party receives the mixed encrypted ciphertext to be decrypted sent by the sending party. The steps of generating the mixed encrypted ciphertext to be decrypted can refer to the above steps S101-S202, which will not be described in detail here.

[0097] S302, decapsulate the hybrid encrypted ciphertext to be decrypted to obtain the first national secret encrypted ciphertext to be decrypted, the post-quantum key encapsulated ciphertext to be decrypted, the second national secret message ciphertext to be decrypted, and the first message hash value.

[0098] Since the sender encapsulates the first national secret encrypted ciphertext, the post-quantum key encapsulated ciphertext, the second national secret message ciphertext and the message hash value to obtain a mixed encrypted ciphertext, the receiver decapsulates the mixed encrypted ciphertext to be decrypted and obtains the first national secret encrypted ciphertext to be decrypted, the post-quantum key encapsulated ciphertext to be decrypted, the second national secret message ciphertext to be decrypted and the first message hash value, that is, the SM2 encrypted ciphertext to be decrypted, the PQC KEM ciphertext to be decrypted, the SM4 message ciphertext to be decrypted and the first SM3 message hash value.

[0099] S303. Decrypt the first national secret encrypted ciphertext to be decrypted and the post-quantum key encapsulated ciphertext to be decrypted respectively according to the first national secret encrypted private key component and the post-quantum key encapsulated private key component in the hybrid encrypted private key to obtain a second temporary key.

[0100] Among them, the first national secret encrypted private key component is the encrypted private key component obtained by the first national secret encryption algorithm.

[0101] The first national secret encryption algorithm is the SM2 encryption algorithm. The receiver decapsulates the hybrid encryption private key to obtain the first national secret encryption private key component and the post-quantum key encapsulation private key component, that is, the SM2 encryption private key component and the PQC KEM private key component.

[0102] The receiver decrypts the SM2 encrypted ciphertext to be decrypted and the PQC KEM ciphertext to be decrypted according to the SM2 encrypted private key component and the PQC KEM private key component, respectively, to obtain a second temporary key.

[0103] S304. Decrypt the second national secret message ciphertext to be decrypted using the second national secret decryption algorithm according to the second temporary key to obtain the plaintext data to be verified.

[0104] Specifically, the second national secret encryption algorithm is the SM4 encryption algorithm. According to the second temporary key, the SM4 encryption algorithm is used to perform a decryption operation on the ciphertext of the second national secret message to be decrypted to obtain the plaintext data to be verified.

[0105] S305. Perform a hash operation using a third-country secret algorithm on the plaintext data to be verified to obtain a second message hash value.

[0106] Specifically, the third national secret algorithm is the SM3 algorithm, which performs a hash operation of the SM3 algorithm on the plaintext data to be verified to obtain a second SM3 message hash value.

[0107] S306: Compare the first message hash value and the second message hash value to determine the target plaintext data.

[0108] Optionally, if the first message hash value and the second message hash value are the same, it is determined that the comparison is successful, and the plaintext data to be verified is determined to be the target plaintext data.

[0109] The receiver compares the first SM3 message hash value with the second SM3 message hash value, and if it is determined that the two message hash values ​​are the same, it is determined that the comparison is successful, thereby determining that the plaintext data to be verified is the target plaintext data.

[0110] Optionally, if the first message hash value and the second message hash value are not the same, it is determined that the comparison fails, and it is determined that the plaintext data to be verified is not the target plaintext data.

[0111] The receiver compares the first SM3 message hash value with the second SM3 message hash value and determines that the two message hash values ​​are different, then determines that the comparison fails and the hybrid encrypted ciphertext is illegally tampered with. Therefore, the plaintext data to be verified is not the target plaintext data.

[0112] In summary, an embodiment of the present application provides a hybrid decryption method of post-quantum cryptography and national secret algorithm, the method comprising: obtaining a hybrid encrypted ciphertext to be decrypted; the hybrid encrypted ciphertext to be decrypted is the ciphertext obtained by the sender using a hybrid encryption public key to perform hybrid encryption on the encrypted plaintext data; decapsulating the hybrid encrypted ciphertext to be decrypted to obtain a first national secret encrypted ciphertext to be decrypted, a post-quantum key encapsulated ciphertext to be decrypted, a second national secret message ciphertext to be decrypted, and a first message hash value; according to the first national secret encryption private key component and the post-quantum key encapsulated private key component in the hybrid encryption private key, the first national secret encrypted ciphertext to be decrypted and the post-quantum key encapsulated ciphertext to be decrypted are respectively decrypted to obtain a second temporary key; the first national secret encryption private key component is the encrypted private key component obtained by the first national secret encryption algorithm; according to the second temporary key, the second national secret message ciphertext to be decrypted is decrypted using the second national secret decryption algorithm to obtain the plaintext data to be verified; the third national secret algorithm hash operation is performed on the plaintext data to be verified to obtain the second message hash value; the first message hash value and the second message hash value are compared to determine the target plaintext data. The receiver needs to decrypt the four components in the mixed encrypted ciphertext to be decrypted at the same time, and finally compare the first message hash value and the second message hash value to determine the target plaintext data, and realize the mixed decryption of post-quantum cryptography and national secret algorithm. Since the mixed encrypted ciphertext to be decrypted includes multiple components, the attacker needs to crack them at the same time to obtain the target plaintext data, which improves the security of the mixed encryption operation and has the ability to resist quantum attacks.

[0113] Based on the hybrid decryption of post-quantum cryptography and national secret algorithm provided in the above embodiment, the embodiment of the present application also provides another possible implementation method of the hybrid decryption method of post-quantum cryptography and national secret algorithm. Figure 4 A flow chart of another hybrid decryption method of post-quantum cryptography and national secret algorithm provided in the embodiment of the present application. Figure 4 As shown, according to the first national secret encryption private key component and the post-quantum key encapsulation private key component in the hybrid encryption private key, the first national secret encrypted ciphertext to be decrypted and the post-quantum key encapsulation ciphertext to be decrypted are respectively decrypted to obtain a second temporary key, including:

[0114] S401. Decrypt the first national secret encrypted ciphertext to be decrypted using the first national secret decryption algorithm according to the first national secret encrypted private key component to obtain a first key.

[0115] In this embodiment, the receiver uses the SM2 encryption algorithm to perform a decryption operation on the SM2 encrypted ciphertext to be decrypted according to the first national secret encryption private key component, namely the SM2 encryption private key component, to obtain the first key.

[0116] S402, encapsulating the private key component according to the post-quantum key, and using the post-quantum key encapsulation algorithm to decrypt the post-quantum key encapsulation ciphertext to obtain a second key.

[0117] Specifically, according to the post-quantum key encapsulation private key component, that is, the PQC KEM private key component, a post-quantum key encapsulation algorithm is used to perform a decapsulation operation on the PQC KEM ciphertext to be decrypted to obtain a second key.

[0118] S403: Perform a key derivation operation on the first key and the second key to generate a second temporary key.

[0119] Specifically, the key derivation operation may adopt an exclusive OR operation, and then an exclusive OR operation is performed on the first key and the second key to generate a second temporary key.

[0120] In the method provided in the embodiment of the present application, according to the first national secret encryption private key component, the first national secret decryption algorithm is used to decrypt the first national secret encrypted ciphertext to obtain a first key; according to the post-quantum key encapsulation private key component, the post-quantum key encapsulation algorithm is used to decapsulate the post-quantum key encapsulation ciphertext to obtain a second key; the first key and the second key are subjected to a key derivation operation to generate a second temporary key, which is used to decrypt the second national secret message ciphertext to be decrypted.

[0121] The embodiment of the present application also provides another possible implementation method of a hybrid decryption method of post-quantum cryptography and national secret algorithm by generating a hybrid encryption key pair. Figure 5 A schematic diagram of a process for generating a hybrid encryption key pair of post-quantum cryptography and national secret algorithm provided in an embodiment of the present application. Figure 5 As shown, the method also includes:

[0122] S501. Call the first national secret algorithm to generate a key pair interface to generate a first national secret encryption key pair.

[0123] The first national secret encryption key pair includes: a first national secret encryption private key component and a first national secret encryption public key component.

[0124] In this embodiment, the receiver generates an SM2 encryption key pair by calling the SM2 algorithm to generate a key pair interface. The SM2 encryption key pair includes: an SM2 encryption private key component and an SM2 encryption public key component.

[0125] S502: Call the post-quantum key encapsulation algorithm to generate a key pair interface to generate a post-quantum key encapsulation key pair.

[0126] Among them, the post-quantum key encapsulation key pair includes: a post-quantum key encapsulation private key component and a post-quantum key encapsulation public key component.

[0127] The receiver generates a PQC KEM key pair by calling the PQC KEM algorithm to generate a key pair interface. The PQC KEM key pair includes: a PQC KEM private key component and a PQC KEM public key component.

[0128] S503. Encapsulate the first national secret encryption private key component and the post-quantum key encapsulation private key component to obtain a hybrid encryption private key.

[0129] Specifically, the SM2 encrypted private key component and the PQC KEM private key component are concatenated and encapsulated to obtain a hybrid encrypted private key. It should be noted that the hybrid encrypted private key is stored in the recipient's device as key sensitive data, and has security protection measures such as confidentiality and integrity. It does not appear in plain text outside the recipient's device.

[0130] S504: Encapsulate the first national secret encryption public key component and the post-quantum key encapsulation public key component to obtain a hybrid encryption public key, and make it public.

[0131] Specifically, the SM2 encryption public key component and the PQC KEM public key component are concatenated and encapsulated to obtain a hybrid encryption private key. It should be noted that the hybrid encryption public key is a public key and is securely stored in the non-volatile storage area of ​​the receiver's device. The receiver and the sender can use the other party's hybrid encryption public key to perform hybrid encryption protection on important data by exchanging hybrid encryption public keys or certificates containing hybrid encryption public keys.

[0132] In the method provided in the embodiment of the present application, the hybrid encryption operation of post-quantum cryptography and national secret algorithm is encapsulated, and an interface compatible with the SM2 encryption algorithm is provided. Therefore, when the SM2 encryption operation is migrated to the PQC algorithm, the modification of the upper-layer application and cryptographic protocol is minimal, greatly reducing the difficulty and workload of migration.

[0133] The following is a corresponding explanation of the post-quantum cryptography and national secret algorithm hybrid encryption device, post-quantum cryptography and national secret algorithm hybrid decryption device and computer equipment provided by any of the above embodiments of the present application. Its specific implementation process and the technical effects produced are the same as those of the corresponding method embodiments mentioned above. For the sake of brief description, the parts not mentioned in this embodiment can refer to the corresponding content in the method embodiment.

[0134] Figure 6 A functional module diagram of a hybrid encryption device of post-quantum cryptography and national secret algorithm provided in an embodiment of the present application. Applied to the sender, such as Figure 6 As shown, the post-quantum cryptography and national secret algorithm hybrid encryption device 100 includes:

[0135] The first acquisition module 110 is used to obtain the mixed encryption public key of the recipient and the plaintext data to be encrypted;

[0136] The first decapsulation processing module 120 is used to decapsulate the hybrid encryption public key to obtain a first national secret encryption public key component and a post-quantum key encapsulation public key component; the first national secret encryption public key component is an encrypted public key component obtained by the first national secret encryption algorithm;

[0137] The first generating module 130 is used to generate a first national secret encrypted ciphertext and a post-quantum key encapsulated ciphertext according to the first national secret encrypted public key component and the post-quantum key encapsulated public key component respectively;

[0138] The first generation module 130 is further used to generate a first temporary key according to a first random number corresponding to the first national secret encrypted ciphertext and a symmetric key corresponding to the post-quantum key encapsulation ciphertext;

[0139] The encryption module 140 is used to encrypt the plaintext data to be encrypted using the second national secret encryption algorithm according to the first temporary key to obtain the second national secret message ciphertext;

[0140] The first operation module 150 is used to perform a hash operation of a third-country encryption algorithm on the encrypted plaintext data to obtain a message hash value;

[0141] The first encapsulation processing module 160 is used to encapsulate the first national secret encrypted ciphertext, the post-quantum key encapsulation ciphertext, the second national secret message ciphertext and the message hash value to obtain a mixed encrypted ciphertext.

[0142] Optionally, the first generation module 130 is also used to encrypt the first random number according to the first national secret encryption public key component using the first national secret encryption algorithm to obtain the first national secret encrypted ciphertext; and use the post-quantum key encapsulation algorithm to encapsulate the post-quantum key encapsulation public key component to obtain the post-quantum key encapsulation ciphertext and the symmetric key.

[0143] Optionally, the first generating module 130 is further configured to perform a key derivation operation on the first random number and the symmetric key to generate a first temporary key.

[0144] Optionally, the device further comprises:

[0145] The sending module is used to send a random number request to the national secret cryptographic operation module so that the national secret cryptographic operation module returns a first random number.

[0146] Figure 7 A functional module diagram of a post-quantum cryptography and national secret algorithm hybrid decryption device provided in an embodiment of the present application. Applied to the receiving party, such as Figure 7 As shown, the post-quantum cryptography and national secret algorithm hybrid decryption device 200 includes:

[0147] The second acquisition module 210 is used to obtain the hybrid encrypted ciphertext to be decrypted; the hybrid encrypted ciphertext to be decrypted is the ciphertext obtained by the sender using the hybrid encryption public key to perform hybrid encryption on the encrypted plaintext data;

[0148] The second decapsulation module 220 is used to decapsulate the hybrid encrypted ciphertext to be decrypted, and obtain the first national secret encrypted ciphertext to be decrypted, the post-quantum key encapsulated ciphertext to be decrypted, the second national secret message ciphertext to be decrypted, and the first message hash value;

[0149] The decryption module 230 is used to decrypt the first national secret encrypted ciphertext to be decrypted and the post-quantum key encapsulation ciphertext to be decrypted according to the first national secret encrypted private key component and the post-quantum key encapsulation private key component in the hybrid encryption private key, respectively, to obtain a second temporary key; the first national secret encrypted private key component is the encrypted private key component obtained by the first national secret encryption algorithm;

[0150] The decryption module 230 is further used to decrypt the second national secret message ciphertext to be decrypted using the second national secret decryption algorithm according to the second temporary key to obtain the plaintext data to be verified;

[0151] The second operation module 240 is used to perform a hash operation of a third-country encryption algorithm on the plaintext data to be verified to obtain a second message hash value;

[0152] The determination module 250 is used to compare the first message hash value and the second message hash value to determine the target plaintext data.

[0153] Optionally, the decryption module 230 is further used to decrypt the first national secret encrypted ciphertext to be decrypted according to the first national secret encrypted private key component, using the first national secret decryption algorithm to obtain a first key; decapsulate the post-quantum key encapsulation ciphertext to be decrypted according to the post-quantum key encapsulation private key component, using the post-quantum key encapsulation algorithm to obtain a second key; perform key derivation operations on the first key and the second key to generate a second temporary key.

[0154] Optionally, the determination module 250 is further configured to determine that the comparison is successful if the first message hash value and the second message hash value are the same, and determine that the plaintext data to be verified is the target plaintext data.

[0155] Optionally, the determination module 250 is further configured to determine that the comparison fails if the first message hash value and the second message hash value are different, and determine that the plaintext data to be verified is not the target plaintext data.

[0156] Optionally, the device further comprises:

[0157] The second generation module is used to call the first national secret algorithm to generate a key pair interface to generate a first national secret encryption key pair, the first national secret encryption key pair including: a first national secret encryption private key component and a first national secret encryption public key component;

[0158] The second generation module is also used to call the post-quantum key encapsulation algorithm to generate a key pair interface to generate a post-quantum key encapsulation key pair, the post-quantum key encapsulation key pair including: a post-quantum key encapsulation private key component and a post-quantum key encapsulation public key component;

[0159] The second encapsulation processing module is used to encapsulate the first national secret encryption private key component and the post-quantum key encapsulation private key component to obtain a hybrid encryption private key;

[0160] The second encapsulation processing module is also used to encapsulate the first national secret encryption public key component and the post-quantum key encapsulation public key component to obtain a hybrid encryption public key and make it public.

[0161] The above-mentioned device is used to execute the method provided by the aforementioned embodiment, and its implementation principle and technical effect are similar, which will not be repeated here.

[0162] The above modules may be one or more integrated circuits configured to implement the above methods, such as one or more application specific integrated circuits (ASICs), or one or more microprocessors, or one or more field programmable gate arrays (FPGAs). For another example, when a module is implemented in the form of a processing element scheduling program code, the processing element may be a general-purpose processor, such as a central processing unit (CPU) or other processor that can call program code. For another example, these modules may be integrated together and implemented in the form of a system-on-a-chip (SOC).

[0163] Figure 8 A schematic diagram of a computer device provided in an embodiment of the present application. If the computer device is a computer device corresponding to the sender, it can be used for hybrid encryption of post-quantum cryptography and national secret algorithm. If the computer device is a computer device corresponding to the receiver, it can be used for hybrid decryption of post-quantum cryptography and national secret algorithm. Figure 8 As shown, the computer device includes: a processor 310 , a storage medium 320 , and a bus 330 .

[0164] The storage medium 320 stores machine-readable instructions executable by the processor 310. When the computer device is running, the processor 310 communicates with the storage medium 320 via the bus 330, and the processor 310 executes the machine-readable instructions to perform the steps of the above method embodiment. The specific implementation method and technical effect are similar and will not be repeated here.

[0165] Optionally, the present application further provides a storage medium 320, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the above method embodiment are executed. The specific implementation method and technical effect are similar and will not be repeated here.

[0166] In the several embodiments provided by the present invention, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0167] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0168] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional units.

[0169] The above-mentioned integrated unit implemented in the form of a software functional unit can be stored in a computer-readable storage medium. The above-mentioned software functional unit is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor (English: processor) to perform some steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (English: Read-Only Memory, abbreviated: ROM), random access memory (English: Random Access Memory, abbreviated: RAM), disk or optical disk and other media that can store program codes.

[0170] The above are only specific embodiments of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art who is familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.

Claims

1. A hybrid encryption method of post-quantum cryptography and national secret algorithm, characterized in that: Applied to the sender, the method includes: Obtain the recipient's hybrid encryption public key and the plaintext data to be encrypted; Decapsulating the hybrid encrypted public key to obtain a first national secret encrypted public key component and a post-quantum key encapsulated public key component; the first national secret encrypted public key component is an encrypted public key component obtained by the first national secret encryption algorithm; Generate a first national secret encrypted ciphertext and a post-quantum key encapsulated ciphertext respectively according to the first national secret encrypted public key component and the post-quantum key encapsulated public key component; Generate a first temporary key according to a first random number corresponding to the first national secret encrypted ciphertext and a symmetric key corresponding to the post-quantum key encapsulation ciphertext; According to the first temporary key, the plaintext data to be encrypted is encrypted using a second national secret encryption algorithm to obtain a second national secret message ciphertext; Perform a hash operation using a third-party encryption algorithm on the plaintext data to be encrypted to obtain a message hash value; The first national secret encrypted ciphertext, the post-quantum key encapsulated ciphertext, the second national secret message ciphertext and the message hash value are encapsulated to obtain a mixed encrypted ciphertext.

2. The method according to claim 1, characterized in that The generating, according to the first national secret encryption public key component and the post-quantum key encapsulation public key component, a first national secret encryption ciphertext and a post-quantum key encapsulation ciphertext respectively, comprises: According to the first national secret encryption public key component, the first random number is encrypted using the first national secret encryption algorithm to obtain the first national secret encryption ciphertext; A post-quantum key encapsulation algorithm is used to encapsulate the post-quantum key encapsulation public key component to obtain the post-quantum key encapsulation ciphertext and the symmetric key.

3. The method according to claim 1, characterized in that The generating a first temporary key according to the first random number corresponding to the first national secret encrypted ciphertext and the symmetric key corresponding to the post-quantum key encapsulation ciphertext includes: A key derivation operation is performed on the first random number and the symmetric key to generate the first temporary key.

4. The method according to claim 1, characterized in that: Before respectively generating the first national secret encrypted ciphertext and the post-quantum key encapsulated ciphertext according to the first national secret encrypted public key component and the post-quantum key encapsulated public key component, the method further includes: Send a random number request to the national secret cryptographic operation module so that the national secret cryptographic operation module returns the first random number.

5. A hybrid decryption method of post-quantum cryptography and national secret algorithm, characterized in that: Applied to a receiving party, the method comprises: Obtaining a mixed encrypted ciphertext to be decrypted; the mixed encrypted ciphertext to be decrypted is a ciphertext obtained by the sender using a mixed encryption public key to perform mixed encryption on the encrypted plaintext data; Decapsulating the mixed encrypted ciphertext to be decrypted to obtain the first national secret encrypted ciphertext to be decrypted, the post-quantum key encapsulated ciphertext to be decrypted, the second national secret message ciphertext to be decrypted, and the first message hash value; According to the first national secret encryption private key component and the post-quantum key encapsulation private key component in the hybrid encryption private key, the first national secret encrypted ciphertext to be decrypted and the post-quantum key encapsulation ciphertext to be decrypted are respectively decrypted to obtain a second temporary key; the first national secret encryption private key component is the encrypted private key component obtained by the first national secret encryption algorithm; Decrypt the second national secret message ciphertext to be decrypted using the second national secret decryption algorithm according to the second temporary key to obtain the plaintext data to be verified; Perform a hash operation using a third-country secret algorithm on the plaintext data to be verified to obtain a second message hash value; The first message hash value and the second message hash value are compared to determine target plaintext data.

6. The method according to claim 5, characterized in that The method of decrypting the first national secret encrypted ciphertext to be decrypted and the post-quantum key encapsulated ciphertext to be decrypted respectively according to the first national secret encrypted private key component and the post-quantum key encapsulated private key component in the hybrid encrypted private key to obtain a second temporary key includes: Decrypting the first national secret encrypted ciphertext to be decrypted using the first national secret decryption algorithm according to the first national secret encrypted private key component to obtain a first key; According to the post-quantum key encapsulation private key component, a post-quantum key encapsulation algorithm is used to decapsulate the post-quantum key encapsulation ciphertext to be decrypted to obtain a second key; A key derivation operation is performed on the first key and the second key to generate the second temporary key.

7. The method according to claim 5, characterized in that The comparing the first message hash value and the second message hash value to determine the target plaintext data includes: If the first message hash value and the second message hash value are the same, it is determined that the comparison is successful, and the plaintext data to be verified is determined to be the target plaintext data.

8. The method according to claim 5, characterized in that The comparing the first message hash value and the second message hash value to determine the target plaintext data includes: If the first message hash value and the second message hash value are different, it is determined that the comparison fails, and it is determined that the plaintext data to be verified is not the target plaintext data.

9. The method according to claim 5, characterized in that The method further comprises: Calling the first national secret algorithm to generate a key pair interface to generate a first national secret encryption key pair, wherein the first national secret encryption key pair includes: the first national secret encryption private key component and the first national secret encryption public key component; Calling a post-quantum key encapsulation algorithm to generate a key pair interface, generating a post-quantum key encapsulation key pair, the post-quantum key encapsulation key pair comprising: the post-quantum key encapsulation private key component and the post-quantum key encapsulation public key component; Encapsulating the first national secret encryption private key component and the post-quantum key encapsulation private key component to obtain the hybrid encryption private key; The post-quantum key encapsulation public key component of the first national secret encryption public key component is encapsulated to obtain the hybrid encryption public key, and the hybrid encryption public key is made public.

10. A computer device, characterized in that: include: A processor, a storage medium and a bus, wherein the storage medium stores program instructions executable by the processor. When the computer device is running, the processor and the storage medium communicate through the bus, and the processor executes the program instructions to perform the steps of the hybrid encryption method of post-quantum cryptography and national secret algorithm as described in any one of claims 1 to 4, or perform the steps of the hybrid decryption method of post-quantum cryptography and national secret algorithm as described in any one of claims 5 to 9.

Citation Information

Patent Citations

  • Post-quantum enhanced encryption channel construction method, device and system

    CN112039670A

  • Post-quantum security enhancement digital envelope method, device and system

    CN112118098A

  • Encryption method and device and decryption method and device for fused quantum cryptography

    CN118337369A

Cited By

  • Cryptographic equipment supporting post-quantum cryptographic algorithm

    CN120150941A

  • Cryptographic device supporting post-quantum cryptographic algorithms

    CN120150941B

  • Session key generation method and device, electronic equipment and storage medium

    CN120856331A

  • AI governance secure communication infrastructure method and system

    CN122891235A