Anti-quantum-attack key packaging method, device, equipment and medium

By using SM3 and SM4 algorithms to replace international cryptographic algorithms in the key encapsulation algorithm, a key encapsulation solution that is resistant to quantum attacks is constructed, which solves the problem of dependence on international cryptographic algorithms in the existing technology and improves the ability and information to resist quantum attacks. Security.

CN118764188APending Publication Date: 2024-10-11ZHEJIANG LAB
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202411036619.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-31
Publication Date
2024-10-11

AI Technical Summary

Technical Problem

Existing key encapsulation algorithms have the risk of relying on international cryptographic algorithms in terms of resisting quantum attacks. In particular, the AES, SHA2, and SHA3 algorithms may be threatened by national surveillance and cracking, making it difficult to meet domestic information security needs.

Method used

SM3 and SM4 algorithms are used as symmetry primitives to replace traditional international cryptographic algorithms, and the CRYSTALS-KYBER algorithm is used to build an anti-quantum attack key encapsulation scheme, including scalable output function XOF, hash function G, hash function H, and pseudo-random The function PRF and the key derivation function KDF realize the secure generation, encryption and decryption process of the key.

Benefits of technology

It reduces the dependence on international cryptographic algorithms, improves the ability to resist quantum attacks, meets domestic information security needs, and enhances the ability to resist external threats.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118764188A_ABST
    Figure CN118764188A_ABST
Patent Text Reader

Abstract

The invention relates to an anti-quantum-attack key packaging method, device and equipment and a medium, input to-be-encrypted original data is subjected to key packaging by adopting a CRYSTALS-KYBER algorithm, symmetric primitives of the CRYSTALS-KYBER algorithm adopt SM3 and SM4 algorithms, and the symmetric primitives of the CRYSTALS-KYBER algorithm adopt SM3 and SM4 algorithms. An extensible output function XOF, a hash function G, a hash function H, a pseudo-random function PRF and a key derivation function KDF are respectively arranged to realize a key packaging process. Compared with the prior art, the method has the advantages that the safety requirement can be met, and the capability of being lower than external threats 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 quantum attack-resistant key encapsulation method, device, equipment and medium for data protection. Background Art

[0002] Key encapsulation algorithms are used to solve the key distribution problem, and quantum attack resistance refers to the ability to resist quantum computer attacks. Key encapsulation algorithms play an important role in protecting the security of data, ensuring the confidentiality and integrity of keys, thereby protecting data from unauthorized access and tampering. Key encapsulation algorithms play an important role in various cryptographic protocols and applications, including secure communications, virtual private networks (VPNs), digital signatures, and authentication. They are one of the key components for building secure communication systems.

[0003] In encrypted communication, the sender and receiver need to share a symmetric key for encryption and decryption. However, ensuring the secure distribution of symmetric keys is a challenge, especially over insecure communication channels. Key encapsulation algorithms usually consist of two parts: encapsulation and decapsulation.

[0004] 1. Encapsulation: The sender uses the receiver's public key to generate an encrypted ciphertext that contains a randomly generated symmetric key. The encapsulation operation may also involve other encryption and hash operations to ensure the security and integrity of the ciphertext.

[0005] 2. Unpacking: The receiver uses its corresponding private key to decrypt the ciphertext and extract the sealed key. The unpacking operation may also involve other decryption and hashing operations to verify the integrity of the ciphertext and ensure security.

[0006] By using a key encapsulation algorithm, the sender can securely send a sealed key to the receiver, and only the receiver can use its private key to unseal the key. In this way, both parties can share a secure symmetric key for encrypting and decrypting their communications.

[0007] The CRYSTALS-KYBER algorithm is a lattice-based post-quantum key encapsulation algorithm designed to provide a secure key exchange mechanism that is resistant to quantum attacks. The CRYSTALS-KYBER algorithm is a formal post-quantum cryptography standardization scheme proposed by NIST, and its security is based on the difficulty of the MLWE (Module Learning With Errors) problem.

[0008] When the CRYSTALS-KYBER algorithm selects symmetric primitives, it needs to set an extendable output function XOF (Extendable Output Function), two hash functions G and H, a pseudorandom function PRF (Pseudorandom Function) and a key derivation function KDF (Key-Derivation Function). Based on multiple considerations of security and ease of use, the CRYSTALS-KYBER algorithm chooses the underlying symmetric primitive as the SHA3 hash function family. The "90s" variant of the CRYSTALS-KYBER algorithm chooses AES and SHA-256 as symmetric primitives. Hardware acceleration of these two algorithms is implemented on Intel, AMD and ARM processors.

[0009] However, AES, SHA2 hash function family, and SHA3 hash function family are all international cryptographic algorithms, whose design and standard setting are controlled by a few major countries and may be threatened by monitoring, attack, and cracking by other countries. Summary of the invention

[0010] The purpose of the present invention is to provide a quantum attack resistant key encapsulation method, device, equipment and medium for data protection. The symmetric primitives select SM3 and SM4 algorithms to replace AES, SHA2 hash function family and SHA3 hash function family. By adopting the independently developed national commercial cryptographic algorithm, the domestic information security needs are met, the dependence on international cryptographic algorithms is reduced, and the ability to resist external threats is improved.

[0011] The purpose of the present invention can be achieved by the following technical solutions:

[0012] A quantum attack resistant key encapsulation method for data protection uses a CRYSTALS-KYBER algorithm to perform key encapsulation on input original data to be encrypted, wherein the symmetric primitive of the CRYSTALS-KYBER algorithm uses SM3 and SM4 algorithms.

[0013] The parameters set when the CRYSTALS-KYBER algorithm selects a symmetric primitive include an extensible output function XOF, a hash function G, a hash function H, a pseudo-random function PRF, and a key derivation function KDF.

[0014] The extensible output function XOF is defined as follows:

[0015] XOF(ρ,i,j)=SM4-CTR(SM3(ρ),i,j)

[0016] Among them, SM4-CTR represents the counting mode of the block cipher algorithm SM4, whose basic idea is to divide the plaintext into blocks of fixed length and generate the corresponding key stream by using the key encryption counter; SM3 represents the hash cipher algorithm, which converts the 64-byte random bits ρ into a 32-byte hash value, which is used as the SM4 counting mode encryption key K; i and j represent the row index and column index of the matrix A, which are the first and second bytes of the 12-byte length 0-filled random factor nonce, that is,

[0017] nonce[0] = i

[0018] nonce[1] = j

[0019] The nonce variable is used as a component of the counter initialization vector in the counting mode CTR.

[0020] The hash function H is defined as follows:

[0021] H(m)=SM3(m)

[0022] The input m of the hash function H is of any length, and the output length is a 32-byte hash value. SM3 represents the hash cryptographic algorithm.

[0023] The hash function G is defined as follows:

[0024] G(m)=SM3(m)|||SM3(SM3(m))

[0025] The hash function G is implemented using a hash chain based on SM3. The input m is of any length and the output length is two 32-byte hash values. SM3 represents a hash cryptographic algorithm.

[0026] The pseudo-random function PRF is defined as follows:

[0027] PRF(s,b)=SM4-CTR(SM3(s),b)

[0028] The pseudo-random PRF function is used to generate random bits. The input is 64-byte s and 1-byte b. The output is random bits of any length. SM4-CTR represents the counting mode of the block cipher algorithm SM4.

[0029] The key derivation function KDF is defined as follows:

[0030] KDF(k)=SM3(k)

[0031] The key derivation function is used to generate a key. The input k is of any length and the output is a 32-byte key. SM3 represents a hashing algorithm.

[0032] The implementation of the CRYSTALS-KYBER algorithm includes two stages. The first stage adopts an IND-CPA secure public key encryption scheme to encrypt messages with a length of 32 bytes. The second stage uses an improved FO transformation to construct an IND-CCA2 secure KEM based on the IND-CPA security scheme of the first stage to achieve key encapsulation. In the random oracle model, the security reduction from the IND-CPA security scheme to the IND-CCA2 security scheme is a tight reduction, and in the quantum oracle model, the security reduction from the IND-CPA security scheme to the IND-CCA2 security scheme is a non-tight reduction.

[0033] The IND-CPA security scheme includes key generation, public key encryption and public key decryption processes, where:

[0034] The key generation comprises the following steps:

[0035] S101, generating a first random bit;

[0036] S102, generating parameters ρ and σ using a hash function G based on the first random bit;

[0037] S103, based on the parameter ρ, generating a polynomial ring matrix A through an extensible output function XOF;

[0038] S104, based on the parameter σ, generating a factor s and a noise e through a pseudo-random function PRF and a central binomial distribution function CBD;

[0039] S105, converting the factor s and the noise e into the NTT domain respectively;

[0040] S106, calculating the public key pk and the private key sk through an encryption function based on the factor s and the noise e in the NTT domain;

[0041] The public key encryption comprises the following steps:

[0042] S201, decoding the public key pk to obtain parameter ρ through a decoding function Decode;

[0043] S202, based on the parameter ρ, generate a polynomial coefficient matrix A through the scalable output function XOF and the Parse function;

[0044] S203, based on the generated second random bit, respectively generate sequences r and e1, and noise e2 through a pseudo-random function PRF and a central binomial distribution function CBD;

[0045] S204, converting the sequence r into an NTT domain;

[0046] S205, based on r converted to the NTT domain, the algorithm input m, the sequence e1 and the noise e2, intermediate parameters u and v are calculated respectively through an inverse NTT function, a decoding function and a decompression function;

[0047] S206, based on the intermediate parameters u and v, c1 and c2 are calculated by compression function and encryption function, and concatenated to obtain the final encrypted ciphertext c;

[0048] The public key decryption comprises the following steps:

[0049] S301, processing the encrypted ciphertext c through a decoding function and a decompression function to obtain intermediate parameters u and v;

[0050] S302, decoding the private key sk by a decoding function to obtain a parameter s;

[0051] S303, based on the intermediate parameters u, v and parameter s, restore the input m through the NTT function, the inverse NTT function, the compression function and the encryption function.

[0052] The IND-CCA2 security scheme includes KEM key generation, key encapsulation and key decapsulation processes, wherein:

[0053] The KEM key generation comprises the following steps:

[0054] S401, generating a random factor z;

[0055] S402, using the key generation process of the IND-CPA security scheme to generate a key pair pk, sk';

[0056] S403, based on the key pair pk, sk' and the random factor z, the private key sk of KEM is calculated by the hash function H to obtain the public key pair pk, sk;

[0057] The key encapsulation comprises the following steps:

[0058] S501, generating a random factor m;

[0059] S502, calculating the hash value of the random factor m by using the hash function H, and assigning the hash value to the random factor m;

[0060] S503, based on the random factor m and the public key pk in step S403, calculate the intermediate parameter through the hash function G and r;

[0061] S504, based on the public key pk, random factor m and intermediate parameter r in step S403, perform the public key encryption process of the IND-CPA security scheme to obtain the ciphertext c;

[0062] S505, based on the parameters c and Generate a shared key K through a key derivation function KDF;

[0063] The key decapsulation comprises the following steps:

[0064] S601, calculating pk, h, z based on the private key sk obtained in step S403;

[0065] S602, based on the private key sk and ciphertext c obtained in step S403, perform the public key decryption process of the IND-CPA security scheme on the confidential ciphertext c to obtain m';

[0066] S603, based on m' and h, calculate the intermediate parameter using the hash function G and r';

[0067] S604, based on the pk, m' and r' calculated in step S601, perform the public key encryption process of the IND-CPA security scheme to obtain a comparison ciphertext c';

[0068] S605, determining whether the ciphertext c is equal to the comparison ciphertext c', and restoring the shared key K using a key derivation function KDF according to the comparison result.

[0069] A quantum attack-resistant key encapsulation device for data protection, comprising:

[0070] The key encapsulation module is used to perform key encapsulation on the input original data to be encrypted using the CRYSTALS-KYBER algorithm, wherein the symmetric primitive of the CRYSTALS-KYBER algorithm uses the SM3 and SM4 algorithms.

[0071] An electronic device comprises a memory and a processor, wherein the memory stores a computer program, and the processor implements the method described above when executing the program.

[0072] A computer-readable storage medium stores a computer program, which implements the method described above when executed by a processor.

[0073] Compared with the prior art, the present invention has the following beneficial effects:

[0074] The present invention adopts symmetric primitives based on SM3 and SM4 algorithms to construct an overall key encapsulation scheme to replace the international cryptographic algorithms AES and SHA2 algorithms adopted by the CRYSTALS-KYBER algorithm, which can meet domestic information security needs, reduce dependence on international cryptographic algorithms, and improve the ability to resist external threats. BRIEF DESCRIPTION OF THE DRAWINGS

[0075] Figure 1is a flow chart of the method of the present invention;

[0076] Figure 2 Schematic diagram of the key generation process of the IND-CPA security scheme;

[0077] Figure 3 Schematic diagram of the public key encryption process of the IND-CPA security scheme;

[0078] Figure 4 Schematic diagram of the public key decryption process of the IND-CPA security scheme;

[0079] Figure 5 Schematic diagram of the KEM key generation process for the IND-CCA2 security solution;

[0080] Figure 6 Schematic diagram of the key encapsulation process of the IND-CCA2 security scheme;

[0081] Figure 7 Schematic diagram of the key decapsulation process of the IND-CCA2 security scheme. DETAILED DESCRIPTION

[0082] The present invention is described in detail below in conjunction with the accompanying drawings and specific embodiments. This embodiment is implemented based on the technical solution of the present invention, and provides a detailed implementation method and specific operation process, but the protection scope of the present invention is not limited to the following embodiments.

[0083] The CRYSTALS-KYBER algorithm is a key-encapsulation mechanism (KEM) that meets IND-CCA2 security. Its construction adopts a two-stage approach: first, in the first stage, an IND-CPA-secure public key encryption scheme is introduced to encrypt messages of length 32 bytes, called Kyber.CPAPKE; based on the IND-CPA security scheme in the first stage, the second stage uses the improved Fujisaki-Okamoto (FO) transformation to construct an IND-CCA2-secure KEM to achieve key encapsulation, called Kyber.CCAKEM. Under the random oracle model, the security reduction from the IND-CPA security scheme to the IND-CCA2 security scheme is a tight reduction, but under the quantum oracle model it is a non-tight reduction.

[0084] Based on this, this embodiment provides a quantum attack resistant key encapsulation method for data protection based on the CRYSTALS-KYBER algorithm to perform key encapsulation on the input original data to be encrypted. Figure 1 As shown, the method comprises the following steps:

[0085] Step 1) Determine the symmetric primitive to be used

[0086] In the present invention, the symmetric primitives use SM3 and SM4 algorithms. The SM3 algorithm is a hash cryptographic algorithm used for data integrity verification and digital signature applications. The SM4 algorithm is a block cipher algorithm used for symmetric encryption and decryption of data.

[0087] Step 2) Set the corresponding function

[0088] The parameters set when the CRYSTALS-KYBER algorithm selects the symmetric primitive include the extensible output function XOF, the hash function G, the hash function H, the pseudo-random function PRF and the key derivation function KDF.

[0089] In this embodiment, the extensible output function XOF is defined as follows:

[0090] XOF(ρ,i,j)=SM4-CTR(SM3(ρ),i,j)

[0091] Among them, SM4-CTR represents the counter mode of the block cipher algorithm SM4, whose basic idea is to divide the plaintext into blocks of fixed length and generate the corresponding key stream by using the key encryption counter; SM3 represents the hash cipher algorithm, which converts the 64-byte random bits ρ into a 32-byte hash value, which is used as the SM4 counting mode encryption key K; i and, represent the row index and column index of the matrix A, which are the first and second bytes of the 12-byte length 0-filled random factor nonce, that is,

[0092] nonce[0] = i

[0093] nonce[1] = j

[0094] The nonce variable is used as a component of the counter initialization vector in the counting mode CTR.

[0095] The hash function H is defined as follows:

[0096] H(m)=SM3(m)

[0097] The input m of the hash function H can be of any length, and the output length is a 32-byte hash value. SM3 represents the hash cryptographic algorithm.

[0098] The hash function G is defined as follows:

[0099] G(m)=SM3(m)||SM3(SM3(m))

[0100] The hash function G is implemented using a hash chain based on SM3. The input m is of any length and the output length is two 32-byte hash values. SM3 represents a hash cryptographic algorithm.

[0101] The pseudo-random function PRF is defined as follows:

[0102] PRF(s,b)=SM4-CTR(SM3(s),b)

[0103] The pseudo-random PRF function is used to generate random bits. The input is 64-byte s and 1-byte b. The output is random bits of any length. SM4-CTR represents the counting mode of the block cipher algorithm SM4.

[0104] The key derivation function KDF is defined as follows:

[0105] KDF(k)=SM3(k)

[0106] The key derivation function is used to generate a key. The input k is of any length and the output is a 32-byte key. SM3 represents a hashing algorithm.

[0107] The algorithm flow of the post-quantum key encapsulation algorithm proposed in the present invention is basically consistent with the CRYSTALS-KYBER algorithm. The difference from the CRYSTALS-KYBER algorithm is that the symmetric primitive adopts the national commercial encryption standard algorithms SM3 and SM4, which is mainly reflected in the settings of the above-mentioned different functions.

[0108] Step 3) IND-CPA security solution implementation

[0109] The IND-CPA security scheme includes key generation, public key encryption, and public key decryption processes.

[0110] like Figure 2 As shown, key generation CPAPKE.KeyGen() includes the following steps:

[0111] S101, generating a first random bit d;

[0112] S102, based on the first random bit d, generate parameters ρ and σ using a hash function G, (ρ, σ) = G(d);

[0113] S103, based on the parameter ρ, generate a polynomial ring matrix A through the scalable output function XOF and the Parse function, where A[i][j]=Parse(XOF(v,j,i));

[0114] S104, based on the parameter σ, generating a factor s and a noise e through a pseudo-random function PRF and a central binomial distribution function CBD;

[0115] S105, convert the factor s and the noise e into the NTT domain respectively

[0116] S106, based on the factor s and the noise e in the NTT domain, the public key pk and the private key sk are calculated through an encryption function.

[0117] like Figure 3 As shown, public key encryption includes the following steps:

[0118] S201, decoding the public key pk to obtain parameter ρ through a decoding function Decode;

[0119] S202, based on the parameter ρ, generate a polynomial coefficient matrix A through the scalable output function XOF and the Parse function;

[0120] S203, based on the generated second random bit, respectively generate sequences r and e1, and noise e2 through a pseudo-random function PRF and a central binomial distribution function CBD;

[0121] S204, converting the sequence r into an NTT domain;

[0122] S205, based on r converted to the NTT domain, the algorithm input m, the sequence e1 and the noise e2, intermediate parameters u and v are calculated respectively through an inverse NTT function, a decoding function and a decompression function;

[0123] S206, based on the intermediate parameters u and v, c1 and c2 are calculated by compression function and encryption function, and concatenated to obtain the final encrypted ciphertext c.

[0124] like Figure 4 As shown, public key decryption includes the following steps:

[0125] S301, the encrypted ciphertext c is processed by a decoding function and a decompression function to obtain intermediate parameters u and v;

[0126] S302, decoding the private key sk by a decoding function to obtain a parameter s;

[0127] S303, based on the intermediate parameters u, v and parameter s, restore the input m through the NTT function, the inverse NTT function, the compression function and the encryption function.

[0128] Step 4) IND-CCA2 security solution implementation

[0129] The IND-CCA2 security solution includes KEM key generation, key encapsulation and key decapsulation processes.

[0130] like Figure 5 As shown, KEM key generation includes the following steps:

[0131] S401, generating a random factor z;

[0132] S402, using the key generation process of the IND-CPA security scheme to generate a key pair pk, sk';

[0133] S403, based on the key pair pk, sk' and the random factor z, the private key sk of KEM is calculated by the hash function H to obtain the public key pair pk, sk.

[0134] like Figure 6 As shown, key encapsulation includes the following steps:

[0135] S501, generating a random factor m;

[0136] S502, calculating the hash value of the random factor m by using the hash function H, and assigning the hash value to the random factor m;

[0137] S503, based on the random factor m and the public key pk in step S403, calculate the intermediate parameter through the hash function G and r;

[0138] S504, based on the public key pk, random factor m and intermediate parameter r in step S403, perform the public key encryption process of the IND-CPA security scheme to obtain the ciphertext c;

[0139] S505, based on the parameters c and The shared key K is generated by the key derivation function KDF.

[0140] like Figure 7 As shown, key decapsulation includes the following steps:

[0141] S601, calculating pk, h, z based on the private key sk obtained in step S403;

[0142] S602, based on the private key sk and ciphertext c obtained in step S403, perform the public key decryption process of the IND-CPA security scheme on the confidential ciphertext c to obtain m';

[0143] S603, based on m' and h, calculate the intermediate parameter using the hash function G and r';

[0144] S604, based on the pk, m' and r' calculated in step S601, perform the public key encryption process of the IND-CPA security scheme to obtain a comparison ciphertext c';

[0145] S605, determining whether the ciphertext c is equal to the comparison ciphertext c', and restoring the shared key K using a key derivation function KDF according to the comparison result.

[0146] The specific implementation process of the above method is:

[0147] 1. Encapsulate the key. The sender uses the receiver's public key to encapsulate the key and calculates a ciphertext. Then, a shared key is generated based on the intermediate result. This shared key is usually used in symmetric encryption algorithms. The sender sends the encapsulated ciphertext to the receiver and keeps the shared key privately.

[0148] 2. Decapsulate the key. The recipient receives the ciphertext of the encapsulated key and uses his own private key to decapsulate the ciphertext and recover the shared key.

[0149] As a result, the sender and receiver share the same key over an insecure channel, which can be used for encryption or decryption using a symmetric cryptographic algorithm.

[0150] Example 2

[0151] This embodiment provides a quantum attack resistant key encapsulation device for data protection, including a key encapsulation module, which is used to perform key encapsulation on input original data to be encrypted using the CRYSTALS-KYBER algorithm, wherein the symmetric primitive of the CRYSTALS-KYBER algorithm uses the SM3 and SM4 algorithms.

[0152] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the described module can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.

[0153] Example 3

[0154] In one embodiment, an electronic device provided by an embodiment of the present invention includes one or more processors for implementing an asynchronous switching and optimal control method for a heterogeneous multi-agent system in the above embodiment.

[0155] The electronic device includes one or more processors (CPU), input / output interface, network interface and memory.

[0156] Multiple components in the device are connected to the I / O interface, including: input units, such as keyboards, mice, etc.; output units, such as various types of displays, speakers, etc.; storage units, such as disks, optical disks, etc.; and communication units, such as network cards, modems, wireless communication transceivers, etc. The communication unit allows the device to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunication networks.

[0157] The processor performs the various methods and processes described above, such as method steps 1)-step 4). For example, in some embodiments, method steps 1)-step 4) can be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit. In some embodiments, part or all of the computer program can be loaded and / or installed on the device via a ROM and / or a communication unit. When the computer program is loaded into the RAM and executed by the CPU, one or more steps of the method steps 1)-step 4) described above can be executed. Alternatively, in other embodiments, the CPU can be configured to execute method steps 1)-step 4) by any other appropriate means (for example, by means of firmware).

[0158] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.

[0159] The program code for implementing the method of the present invention can be written in any combination of one or more programming languages. These program codes can be provided to a processor or controller of a general-purpose computer, a special-purpose computer or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code can be executed entirely on the machine, partially on the machine, partially on the machine as a stand-alone software package and partially on a remote machine, or entirely on a remote machine or server.

[0160] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0161] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0162] The preferred specific embodiments of the present invention are described in detail above. It should be understood that a person skilled in the art can make many modifications and changes based on the concept of the present invention without creative work. Therefore, any technical solution that can be obtained by a person skilled in the art through logical analysis, reasoning, or limited experiments based on the concept of the present invention on the basis of the prior art should be within the scope of protection determined by the claims.

Claims

1. A quantum attack-resistant key encapsulation method for data protection, characterized in that: The input original data to be encrypted is key encapsulated using the CRYSTALS-KYBER algorithm, and the symmetric primitive of the CRYSTALS-KYBER algorithm uses the SM3 and SM4 algorithms.

2. A quantum attack resistant key encapsulation method for data protection according to claim 1, characterized in that: The parameters set when the CRYSTALS-KYBER algorithm selects a symmetric primitive include an extensible output function XOF, a hash function G, a hash function H, a pseudo-random function PRF, and a key derivation function KDF.

3. A quantum attack resistant key encapsulation method for data protection according to claim 2, characterized in that: The extensible output function XOF is defined as follows: XOF(ρ,i,j)=SM4-CTR(SM3(ρ),i,j) Among them, SM4-CTR represents the counting mode of the block cipher algorithm SM4, whose basic idea is to divide the plaintext into blocks of fixed length and generate the corresponding key stream by using the key encryption counter; SM3 represents the hash cipher algorithm, which converts the 64-byte random bits ρ into a 32-byte hash value, which is used as the SM4 counting mode encryption key K; i and, represent the row index and column index of the matrix A, which are the first and second bytes of the 12-byte length 0-filled random factor nonce, that is, nonce[0] = i nonce[1] = j The nonce variable is used as a component of the counter initialization vector in the counting mode CTR.

4. A quantum attack resistant key encapsulation method for data protection according to claim 2, characterized in that: The hash function H is defined as follows: H(m)=SM3(m) The input m of the hash function H is of arbitrary length, and the output length is a 32-byte hash value. SM3 represents the hash cryptographic algorithm.

5. A quantum attack resistant key encapsulation method for data protection according to claim 2, characterized in that: The hash function G is defined as follows: G(m)=SM3(m)||SM3(SM3(m)) The hash function G is implemented using a hash chain based on SM3. The input m is of any length and the output length is two 32-byte hash values. SM3 represents a hash cryptographic algorithm.

6. A quantum attack resistant key encapsulation method for data protection according to claim 2, characterized in that: The pseudo-random function PRF is defined as follows: PRF(s,b)=SM4-CTR(SM3(s),b) The pseudo-random PRF function is used to generate random bits. The input is 64-byte s and 1-byte b. The output is random bits of any length. SM4-CTR represents the counting mode of the block cipher algorithm SM4.

7. A quantum attack resistant key encapsulation method for data protection according to claim 2, characterized in that: The key derivation function KDF is defined as follows: KDF(k)=SM3(k) The key derivation function is used to generate a key. The input k is of any length and the output is a 32-byte key. SM3 represents a hashing algorithm.

8. The method for quantum attack resistant key encapsulation for data protection according to claim 1, characterized in that: The implementation of the CRYSTALS-KYBER algorithm includes two stages. The first stage adopts an IND-CPA secure public key encryption scheme to encrypt messages with a length of 32 bytes. The second stage uses an improved FO transformation to construct an IND-CCA2 secure KEM based on the IND-CPA security scheme of the first stage to achieve key encapsulation. In the random oracle model, the security reduction from the IND-CPA security scheme to the IND-CCA2 security scheme is a tight reduction, and in the quantum oracle model, the security reduction from the IND-CPA security scheme to the IND-CCA2 security scheme is a non-tight reduction.

9. A quantum attack resistant key encapsulation method for data protection according to claim 8, characterized in that: The IND-CPA security scheme includes key generation, public key encryption and public key decryption processes, where: The key generation comprises the following steps: S101, generating a first random bit; S102, generating parameters ρ and σ using a hash function G based on the first random bit; S103, based on the parameter ρ, generating a polynomial ring matrix A through an extensible output function XOF; S104, based on the parameter σ, generating a factor s and a noise e through a pseudo-random function PRF and a central binomial distribution function CBD; S105, converting the factor s and the noise e into the NTT domain respectively; S106, based on the factor s and the noise e in the NTT domain, the public key pk and the private key sk are calculated by an encryption function; The public key encryption comprises the following steps: S201, decoding the public key pk to obtain parameter ρ through a decoding function Decode; S202, based on the parameter ρ, generate a polynomial coefficient matrix A through the scalable output function XOF and the Parse function; S203, based on the generated second random bit, respectively generate sequences r and e1, and noise e2 through a pseudo-random function PRF and a central binomial distribution function CBD; S204, converting the sequence r into an NTT domain; S205, based on r converted to the NTT domain, the algorithm input m, the sequence e1 and the noise e2, intermediate parameters u and v are calculated respectively through an inverse NTT function, a decoding function and a decompression function; S206, based on the intermediate parameters u and v, c1 and c2 are calculated by compression function and encryption function, and concatenated to obtain the final encrypted ciphertext c; The public key decryption comprises the following steps: S301, processing the encrypted ciphertext c through a decoding function and a decompression function to obtain intermediate parameters u and v; S302, decoding the private key sk by a decoding function to obtain a parameter s; S303, based on the intermediate parameters u, v and parameter s, restore the input m through the NTT function, the inverse NTT function, the compression function and the encryption function.

10. A quantum attack resistant key encapsulation method for data protection according to claim 9, characterized in that: The IND-CCA2 security scheme includes KEM key generation, key encapsulation and key decapsulation processes, wherein: The KEM key generation comprises the following steps: S401, generating a random factor z; S402, using the key generation process of the IND-CPA security scheme to generate a key pair pk, sk'; S403, based on the key pair pk, sk' and the random factor z, the private key sk of KEM is calculated by the hash function H to obtain the public key pair pk, sk; The key encapsulation comprises the following steps: S501, generating a random factor m; S502, calculating the hash value of the random factor m by using the hash function H, and assigning the hash value to the random factor m; S503, based on the random factor m and the public key pk in step S403, calculate the intermediate parameter through the hash function G and r; S504, based on the public key pk, random factor m and intermediate parameter r in step S403, perform the public key encryption process of the IND-CPA security scheme to obtain the ciphertext c; S505, based on the parameters c and Generate a shared key K through a key derivation function KDF; The key decapsulation comprises the following steps: S601, calculating pk, h, z based on the private key sk obtained in step S403; S602, based on the private key sk and ciphertext c obtained in step S403, perform the public key decryption process of the IND-CPA security scheme on the confidential ciphertext c to obtain m'; S603, based on m' and h, calculate the intermediate parameter using the hash function G and r'; S604, based on the pk, m' and r' calculated in step S601, perform the public key encryption process of the IND-CPA security scheme to obtain a comparison ciphertext c'; S605, determining whether the ciphertext c is equal to the comparison ciphertext c', and restoring the shared key K using a key derivation function KDF according to the comparison result.

11. A quantum attack resistant key encapsulation device for data protection, characterized in that: include: The key encapsulation module is used to perform key encapsulation on the input original data to be encrypted using the CRYSTALS-KYBER algorithm, wherein the symmetric primitive of the CRYSTALS-KYBER algorithm uses the SM3 and SM4 algorithms.

12. An electronic device comprising a memory and a processor, wherein a computer program is stored in the memory, wherein: When the processor executes the program, the method according to any one of claims 1 to 10 is implemented.

13. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 10 is implemented.

Citation Information

Cited By

  • Kyber and SM3 fused post quantum cryptography encryption system, method and device

    CN119675847A

  • Post-quantum cryptography system, method, and device integrating Kyber and SM3

    CN119675847B

  • Data encryption method and device, data decryption method and device, equipment and medium

    CN119675864A