A post-quantum digital signature construction method and device combined with a hash tree chain

Through the hash tree chain combination method, the signature scheme is constructed using the SM3 algorithm, which solves the problem of traditional long signature values ​​and low security, and realizes efficient and secure post-quantum digital signatures, which are suitable for quantum computing environments.

CN118337398BActive Publication Date: 2024-11-19BEIJING ELECTRONICS SCI & TECH INST
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410583695.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-05-11
Publication Date
2024-11-19
Estimated Expiration
2044-05-11

AI Technical Summary

Technical Problem

The traditional hash function-based signature scheme generates a long signature value and is low in security, making it difficult to resist quantum computing attacks and cannot meet the needs of quantum computers for information security.

Method used

The post-quantum digital signature construction method combined with hash tree chain is adopted to generate the signature private key and public key through the SM3 algorithm, and the signature scheme is constructed using the hash chain and binary hash tree to improve signature efficiency and security.

Benefits of technology

It realizes a signature solution with reliable post-quantum security, fills the gap in quantum majeure for domestic commercial digital signature algorithms, and can digitally sign messages multiple times. It is suitable for platforms with resource-constrained, and has a wide range of application fields.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118337398B_ABST
    Figure CN118337398B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of information security and cryptography, and in particular to a post-quantum digital signature construction method and device combined with a hash tree chain, the method comprising: obtaining a signature private key generated under preset security parameters; generating multiple hash chains according to multiple private key blocks, constructing multiple binary hash trees according to the multiple hash chains, generating signature verification public keys according to the multiple binary hash trees; obtaining a message to be signed, performing a hash operation on the message using an SM3 algorithm to obtain a message digest, and obtaining a signature value according to the message digest; performing signature verification according to the signature verification public key and the signature value, and obtaining a signature verification result. The present invention constructs a digital signature scheme by constructing a hash chain and a hash tree through a hash function SM3. The security of the signature scheme depends on the security of the hash function SM3, has a very reliable post-quantum security guarantee, and the same hash tree can be signed multiple times, which improves the applicability of the hash-based signature scheme.
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 and cryptographic technology, and in particular to a post-quantum digital signature construction method and device combined with a hash tree chain. Background Art

[0002] With the application and development of quantum computers, traditional public key cryptographic algorithms based on mathematical problems such as large integer factorization, discrete logarithms, and elliptic curves will face more threatening quantum computing attacks. In order to combat the impact of quantum computing on information security, the research and optimization of a new generation of post-quantum cryptographic algorithms that can resist quantum computing attacks is imminent.

[0003] In July 2022, the National Institute of Standards and Technology of the United States released the first batch of standardized post-quantum cryptographic algorithms, including a public key encryption algorithm CRYSTALS-Kyber and three digital signature algorithms, CRYSTALS-Dilithium, Falcon, and SPHINCS+. Among them, SPHINCS+ is a stateless signature scheme constructed using a hash function. SPHINCS+ uses the one-time signature scheme WOTS+ and the few-time signature scheme FORS at the bottom layer, and expands it into a multiple-time signature scheme by expanding the binary tree.

[0004] A one-time signature scheme means that the key pair can only be used once, and after the signature is completed, the key pair completely loses its security. A pair of keys in a few-time signature scheme will not completely lose their security after use, but the security will decrease with the number of times it is used, which is more practical than a one-time signature.

[0005] In conventional hash-based few-time signature schemes, the hash tree leaf nodes are not connected to the hash chain, the generated signature value is larger, and the signature security is lower.

[0006] Traditional digital signature schemes are generally based on mathematical problems such as large integer factorization, discrete logarithms, and elliptic curves. With the application and development of quantum computers, digital signature schemes based on the above difficult problems will face more threatening quantum computing attacks. In order to combat the impact of quantum computers on information security, the research and optimization of a new generation of post-quantum cryptographic algorithms that can resist quantum computing attacks is imminent. Summary of the invention

[0007] In order to solve the problem of long signature values ​​generated by the hash function-based few-time signature scheme in the prior art, as well as the technical problem of how to improve signature efficiency and signature scheme security, the embodiment of the present invention provides a post-quantum digital signature construction method and device combined with a hash tree chain. The technical solution is as follows:

[0008] On the one hand, a post-quantum digital signature construction method combined with a hash tree chain is provided, the method is implemented by a post-quantum digital signature construction device, and the method includes:

[0009] S1. Obtain the signature private key generated under preset security parameters.

[0010] The signature private key includes multiple private key blocks.

[0011] S2. Generate multiple hash chains based on the multiple private key blocks, build multiple binary hash trees based on the multiple hash chains, and generate signature verification public keys based on the multiple binary hash trees.

[0012] S3. Obtain the message to be signed, perform a hash operation on the message using the SM3 algorithm to obtain a message digest, and obtain a signature value based on the message digest.

[0013] S4. Perform signature verification based on the signature verification public key and the signature value to obtain a signature verification result.

[0014] Optionally, obtaining the signature private key generated under preset security parameters in S1 includes:

[0015] S11. Obtain a private key seed under preset security parameters.

[0016] S12. Use the private key seed as seed data of a pseudo-random number generator PRNG to generate 32x32 pseudo-random numbers.

[0017] Each of the 32x32 pseudo-random numbers is 32 bytes of pseudo-random hexadecimal data.

[0018] S13. Use each pseudo-random number as a private key block to obtain 32x32 private key blocks, and construct a signature private key based on the 32x32 private key blocks.

[0019] Optionally, generating multiple hash chains according to the multiple private key blocks in S2, constructing multiple binary hash trees according to the multiple hash chains, and generating signature verification public keys according to the multiple binary hash trees include:

[0020] S21. Perform multiple hash operations on each of the 32x32 private key blocks to generate 32x32 hash chains.

[0021] Each hash chain includes multiple nodes.

[0022] S22. Obtain two adjacent hash chains from the 32x32 hash chains, connect the tail nodes of the two adjacent hash chains in series, perform a hash operation on the connected tail nodes, and generate 32x16 leaf nodes.

[0023] S23. Obtain two adjacent leaf nodes from the 32x16 leaf nodes, connect the two adjacent leaf nodes in series, perform a hash operation on the series-connected leaf nodes, and then generate 32 binary hash trees.

[0024] S24. Connect the root nodes of the 32 binary hash trees in series, use the SM3 algorithm to perform a hash operation on the connected root nodes, and obtain the SM3 hash value as the signature scheme public key.

[0025] Optionally, in S21, multiple hash operations are performed on each of the 32x32 private key blocks to generate 32x32 hash chains, including:

[0026] For each private key block in the 32x32 private key blocks, each private key block is used as the first node of the hash chain, and a hash operation is performed on the data in the first node to obtain the first node hash value as the second node, and a hash operation is performed on the data in the second node to obtain the second node hash value as the third node, and a hash operation is performed on the data in the third node to obtain the third node hash value as the tail node. A hash chain is formed based on the first node, the second node, the third node and the tail node.

[0027] Optionally, obtaining the message to be signed in S3, performing a hash operation on the message using the SM3 algorithm to obtain a message digest, and obtaining a signature value according to the message digest includes:

[0028] S31. Obtain the message to be signed, and use the SM3 algorithm to perform a hash operation on the message to obtain a message digest.

[0029] S32. Group the message digests, and each group of message digests after grouping corresponds to a hash tree.

[0030] S33. Obtain the leaf nodes of the hash tree corresponding to each group of message digests, obtain the hash chain of the leaf nodes and the identity authentication path of the leaf nodes as signature values.

[0031] Optionally, grouping the message digests in S32 includes:

[0032] Divide the message digests into 32 groups, divide each group of message digests into the first group of data, the second group of data and the third group of data, use the first group of data as the index of the leaf node position of the binary hash tree, use the second group of data as the index of one hash chain position of the leaf node, and use the third group of data as the index of another hash chain position of the leaf node.

[0033] Optionally, the signature verification is performed according to the signature verification public key and the signature value in S4 to obtain a signature verification result, including:

[0034] The signature verification public key is calculated according to the signature value to obtain the signature verification public key calculation result, the hash chain and identity authentication path corresponding to the signature verification public key calculation result are obtained, and the hash chain and identity authentication path corresponding to the signature verification public key are compared to obtain the signature verification result.

[0035] On the other hand, a post-quantum digital signature construction device combined with a hash tree chain is provided, and the device is applied to a post-quantum digital signature construction method combined with a hash tree chain, and the device includes:

[0036] The acquisition module is used to obtain the signature private key generated under preset security parameters.

[0037] The signature private key includes multiple private key blocks.

[0038] The signature verification public key generation module is used to generate multiple hash chains based on multiple private key blocks, build multiple binary hash trees based on the multiple hash chains, and generate signature verification public keys based on the multiple binary hash trees.

[0039] The signature value generation module is used to obtain the message to be signed, use the SM3 algorithm to perform a hash operation on the message to obtain a message digest, and obtain the signature value based on the message digest.

[0040] The output module is used to perform signature verification based on the signature verification public key and the signature value to obtain the signature verification result.

[0041] Optionally, the acquisition module is further used to:

[0042] S11. Obtain a private key seed under preset security parameters.

[0043] S12. Use the private key seed as seed data of a pseudo-random number generator PRNG to generate 32x32 pseudo-random numbers.

[0044] Each of the 32x32 pseudo-random numbers is 32 bytes of pseudo-random hexadecimal data.

[0045] S13. Use each pseudo-random number as a private key block to obtain 32x32 private key blocks, and construct a signature private key based on the 32x32 private key blocks.

[0046] Optionally, the signature verification public key generation module is further used to:

[0047] S21. Perform multiple hash operations on each of the 32x32 private key blocks to generate 32x32 hash chains.

[0048] Each hash chain includes multiple nodes.

[0049] S22. Obtain two adjacent hash chains from the 32x32 hash chains, connect the tail nodes of the two adjacent hash chains in series, perform a hash operation on the connected tail nodes, and generate 32x16 leaf nodes.

[0050] S23. Obtain two adjacent leaf nodes from the 32x16 leaf nodes, connect the two adjacent leaf nodes in series, perform a hash operation on the series-connected leaf nodes, and then generate 32 binary hash trees.

[0051] S24. Connect the root nodes of the 32 binary hash trees in series, use the SM3 algorithm to perform a hash operation on the connected root nodes, and obtain the SM3 hash value as the signature scheme public key.

[0052] Optionally, the signature verification public key generation module is further used to:

[0053] For each private key block in the 32x32 private key blocks, each private key block is used as the first node of the hash chain, and a hash operation is performed on the data in the first node to obtain the first node hash value as the second node, and a hash operation is performed on the data in the second node to obtain the second node hash value as the third node, and a hash operation is performed on the data in the third node to obtain the third node hash value as the tail node. A hash chain is formed based on the first node, the second node, the third node and the tail node.

[0054] Optionally, the signature value generation module is further used to:

[0055] S31. Obtain the message to be signed, and use the SM3 algorithm to perform a hash operation on the message to obtain a message digest.

[0056] S32. Group the message digests, and each group of message digests after grouping corresponds to a hash tree.

[0057] S33. Obtain the leaf nodes of the hash tree corresponding to each group of message digests, obtain the hash chain of the leaf nodes and the identity authentication path of the leaf nodes as signature values.

[0058] Optionally, the signature value generation module is further used to:

[0059] Divide the message digests into 32 groups, divide each group of message digests into the first group of data, the second group of data and the third group of data, use the first group of data as the index of the leaf node position of the binary hash tree, use the second group of data as the index of one hash chain position of the leaf node, and use the third group of data as the index of another hash chain position of the leaf node.

[0060] Optionally, the output module is further configured to:

[0061] The signature verification public key is calculated according to the signature value to obtain the signature verification public key calculation result, the hash chain and identity authentication path corresponding to the signature verification public key calculation result are obtained, and the hash chain and identity authentication path corresponding to the signature verification public key are compared to obtain the signature verification result.

[0062] On the other hand, a post-quantum digital signature construction device is provided, comprising: a processor; a memory, wherein the memory stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, any one of the post-quantum digital signature construction methods combined with the above-mentioned hash tree chain is implemented.

[0063] On the other hand, a computer-readable storage medium is provided, wherein at least one instruction is stored in the storage medium, and the at least one instruction is loaded and executed by a processor to implement any one of the above-mentioned hash tree chain combined post-quantum digital signature construction methods.

[0064] The beneficial effects brought about by the technical solution provided by the embodiment of the present invention include at least:

[0065] In the embodiment of the present invention, a signature scheme is constructed by constructing a hash chain, a binary hash tree and a key using the national secret algorithm SM3. The security of the signature scheme relies on the security of SM3 and has a very reliable post-quantum security guarantee, filling the gap of the current domestic commercial digital signature algorithm that is not resistant to quantum.

[0066] In terms of practicality, traditional digital signature schemes based on hash functions can generally only complete digital signatures once, while this scheme can digitally sign messages multiple times, making it more practical.

[0067] The present invention is based on the national secret algorithm SM3. The signature scheme constructed by the hash function SM3 not only broadens the application field of the hash function, but also makes the scheme have good compatibility and applicability. It can be deployed on various resource-constrained hardware and software platforms and has a wide range of applications. BRIEF DESCRIPTION OF THE DRAWINGS

[0068] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0069] Figure 1 This is a flow chart of a post-quantum digital signature construction method combined with a hash tree chain provided by an embodiment of the present invention;

[0070] Figure 2A schematic diagram of private key generation provided in an embodiment of the present invention;

[0071] Figure 3 This is the hash chain and binary hash tree generation intention provided by the embodiment of the present invention;

[0072] Figure 4 This is a schematic diagram of generating a public key provided by an embodiment of the present invention.

[0073] Figure 5 It is a schematic diagram of generating a binary hash tree identity authentication path provided by an embodiment of the present invention;

[0074] Figure 6 It is a schematic diagram of binary hash tree signature generation provided by an embodiment of the present invention;

[0075] Figure 7 It is a schematic diagram of generating a message digest (partial) signature provided by an embodiment of the present invention;

[0076] Figure 8 This is a block diagram of a post-quantum digital signature construction device combined with a hash tree chain provided by an embodiment of the present invention;

[0077] Fig. 9 It is a structural schematic diagram of a post-quantum digital signature construction device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0078] The technical solution of the present invention is described below in conjunction with the accompanying drawings.

[0079] In the embodiments of the present invention, words such as "exemplarily" and "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "example" in the present invention should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of the word "example" is intended to present the concept in a specific way. In addition, in the embodiments of the present invention, the meaning expressed by "and / or" can be both, or it can be either of the two.

[0080] In the embodiments of the present invention, "image" and "picture" can sometimes be used interchangeably. It should be noted that when the difference between them is not emphasized, the meanings they intend to express are the same. "of", "corresponding, relevant" and "corresponding" can sometimes be used interchangeably. It should be noted that when the difference between them is not emphasized, the meanings they intend to express are the same.

[0081] In the embodiments of the present invention, sometimes a subscript such as W1 may be written as a non-subscript such as W1. When the difference is not emphasized, the meanings to be expressed are the same.

[0082] In order to make the technical problems, technical solutions and advantages to be solved by the present invention more clear, a detailed description will be given below with reference to the accompanying drawings and specific embodiments.

[0083] The embodiment of the present invention provides a post-quantum digital signature construction method combined with a hash tree chain, which can be implemented by a post-quantum digital signature construction device, which can be a terminal or a server. Figure 1 The flowchart of the post-quantum digital signature construction method combined with the hash tree chain shown in the figure can include the following steps:

[0084] S1. Obtain the signature private key generated under preset security parameters.

[0085] The signature private key includes multiple private key blocks.

[0086] Optionally, the above step S1 can be: obtaining a private key seed under preset security parameters, using the private key seed as seed data of a pseudo-random number generator PRNG, generating 32x32 pseudo-random numbers, using each pseudo-random number as a private key block to obtain 32x32 private key blocks, and constructing a signature private key based on the 32x32 private key blocks.

[0087] Each of the 32x32 pseudo-random numbers is 32 bytes of pseudo-random hexadecimal data.

[0088] In a feasible implementation, Figure 2 As shown in the figure, under the security parameter of 256 bits, the private key seed SK.seed is used as the seed data of the PRNG (Pseudo-Random Number Generator) to generate 32x32 pseudo-random numbers: ,in, , , , each pseudo-random number is a 32-byte pseudo-random hexadecimal data. Each pseudo-random number is a constituent element of the signature private key SK, called a private key block. The signature private key SK contains 32x32 private key blocks, recorded as .

[0089] The generated pseudo-random numbers may be 32x32, or other numbers such as 64x64, etc., which is not limited in the present invention.

[0090] S2. Generate multiple hash chains based on the multiple private key blocks, build multiple binary hash trees based on the multiple hash chains, and generate signature verification public keys based on the multiple binary hash trees.

[0091] Optionally, the above step S2 may include the following steps S21-S24:

[0092] S21. For each private key block in the 32x32 private key blocks, take each private key block as the first node of the hash chain, perform hash operation on the data in the first node, and obtain the hash value of the first node as the second node, perform hash operation on the data in the second node, and obtain the hash value of the second node as the third node, perform hash operation on the data in the third node, and obtain the hash value of the third node as the tail node, and form a hash chain based on the first node, the second node, the third node and the tail node.

[0093] S22. Obtain two adjacent hash chains from the 32x32 hash chains, connect the tail nodes of the two adjacent hash chains in series, perform a hash operation on the connected tail nodes, and generate 32x16 leaf nodes.

[0094] S23. Obtain two adjacent leaf nodes from the 32x16 leaf nodes, connect the two adjacent leaf nodes in series, perform a hash operation on the series-connected leaf nodes, and then generate 32 binary hash trees.

[0095] S24. Connect the root nodes of the 32 binary hash trees in series, use the SM3 algorithm to perform a hash operation on the connected root nodes, and obtain the SM3 hash value as the signature scheme public key.

[0096] In a feasible implementation, SM3 is used to perform three hash operations on 32x32 private key blocks to generate 32x32 hash chains of length 4. Each hash chain contains 4 hash nodes. Each private key block serves as the head node of the corresponding hash chain. The data in the next node in the hash chain is the SM3 hash value of the data in the previous node. After every two adjacent nodes in the tail nodes of the 32x32 hash chains are connected in series, a hash operation is performed to generate 32x16 leaf nodes. After two adjacent leaf nodes are connected in series, a hash operation is performed until 32 binary hash trees are generated. Each hash tree contains 16 leaf nodes. Each leaf node corresponds to two hash chains. Starting from the bottom leaf node of the binary hash tree to the root node, a hash tree can be constructed for every 32 private key blocks. A total of 32 hash trees are constructed for 32x32 private key blocks. Two adjacent nodes are spliced ​​and the hash function SM3 is used to calculate the parent node of the previous layer. The root node of the binary hash tree is calculated by analogy. Figure 3 As shown in Figure 1, it is the structure of a single binary hash tree. Figure 4 As shown, the hash function SM3 is used to calculate the hash value of the concatenated root nodes of 32 binary hash trees as the signature method public key.

[0097] Among them, SM3 is China's commercial encryption algorithm and hash algorithm.

[0098] S3. Obtain the message to be signed, perform a hash operation on the message using the SM3 algorithm to obtain a message digest, and obtain a signature value based on the message digest.

[0099] Optionally, the above step S3 may include the following steps S31-S33:

[0100] S31. Obtain the message to be signed, and use the SM3 algorithm to perform a hash operation on the message to obtain a message digest.

[0101] S32. Group the message digests, and each group of message digests after grouping corresponds to a hash tree.

[0102] Optionally, grouping the message digests in S32 includes:

[0103] Divide the message digests into 32 groups, divide each group of message digests into the first group of data, the second group of data and the third group of data, use the first group of data as the index of the leaf node position of the binary hash tree, use the second group of data as the index of one hash chain position of the leaf node, and use the third group of data as the index of another hash chain position of the leaf node.

[0104] S33. Obtain the leaf nodes of the hash tree corresponding to each group of message digests, obtain the hash chain of the leaf nodes and the identity authentication path of the leaf nodes as signature values.

[0105] In a feasible implementation, a hash operation is performed on the message to be signed using the national secret algorithm SM3 to obtain a 256-bit message digest, and the 256-bit message digest is divided into 32 groups of 8 bits each. When signing, each group corresponds to a hash tree, and each group is divided into 4, 2, and 2 bits of data (N, L1, L2), respectively. The first group of data N is used as the index of the position of the leaf node of the binary hash tree, and the next two groups of data L1 and L2 are used as the indexes of the positions of the two hash chain nodes adjacent to the leaf node, respectively. The indexed chain node and the binary hash tree identity authentication path corresponding to the leaf node are used as the signature value.

[0106] Furthermore, the verification path of the leaf nodes of the binary hash tree can calculate the root node from the leaf nodes, and the nodes in the authentication path of the binary hash tree can reconstruct the root node of the hash tree. When the root nodes of the 32 hash trees are reconstructed, the signature public key of the signature method can be calculated. Figure 5 As shown in the figure, the authentication path of the fifth leaf node is gray. Figure 6 As shown in the figure, it is the signature generation diagram under three binary hash trees.

[0107] like Figure 7As shown, for the message "Hello World!", the binary form of the first byte of the message digest of the SM3 function is "01110111", then the first 4 bits of the message digest group are used as the index of the position of the corresponding binary hash tree leaf node, the next two bits are used as the index of the first hash chain node corresponding to the leaf node, and the last two bits are used as the index of the second hash chain node corresponding to the leaf node.

[0108] S4. Calculate the signature verification public key according to the signature value to obtain the signature verification public key calculation result, obtain the hash chain and identity authentication path corresponding to the signature verification public key calculation result, compare them with the hash chain and identity authentication path corresponding to the signature verification public key, and obtain the signature verification result.

[0109] In a feasible implementation, the signature verification process is to calculate the verification public key from the signature value. When the hash chain node corresponding to the signature value is verified and the corresponding binary hash tree identity authentication path is verified, it means that the signature value is valid, otherwise the signature value is invalid.

[0110] The present invention constructs a new one-time signature scheme by using the Chinese commercial cipher SM3, and the lengths of the public and private keys used and the generated signature values ​​are shorter than the lengths of the public and private keys and the generated signature values ​​of the WOTS+ signature scheme used in the SPHINCS+ scheme.

[0111] In the embodiment of the present invention, a signature scheme is constructed by constructing a hash chain, a binary hash tree and a key using the national secret algorithm SM3. The security of the signature scheme relies on the security of SM3 and has a very reliable post-quantum security guarantee, filling the gap of the current domestic commercial digital signature algorithm that is not resistant to quantum.

[0112] In terms of practicality, traditional digital signature schemes based on hash functions can generally only complete digital signatures once, while this scheme can digitally sign messages multiple times, making it more practical.

[0113] The present invention is based on the national secret algorithm SM3. The signature scheme constructed by the hash function SM3 not only broadens the application field of the hash function, but also makes the scheme have good compatibility and applicability. It can be deployed on various resource-constrained hardware and software platforms and has a wide range of applications.

[0114] Figure 8 This is a block diagram of a post-quantum digital signature construction device combined with a hash tree chain according to an exemplary embodiment, and the device is used in a post-quantum digital signature construction method combined with a hash tree chain. Figure 8 The device includes an acquisition module 310, a signature verification public key generation module 320, a signature value generation module 330, and an output module 340. Among them:

[0115] The acquisition module 310 is used to acquire a signature private key generated under preset security parameters.

[0116] The signature private key includes multiple private key blocks.

[0117] The signature verification public key generation module 320 is used to generate multiple hash chains according to multiple private key blocks, construct multiple binary hash trees according to the multiple hash chains, and generate signature verification public keys according to the multiple binary hash trees.

[0118] The signature value generating module 330 is used to obtain a message to be signed, perform a hash operation on the message using the SM3 algorithm to obtain a message digest, and obtain a signature value based on the message digest.

[0119] The output module 340 is used to perform signature verification according to the signature verification public key and the signature value to obtain a signature verification result.

[0120] Optionally, the acquisition module 310 is further configured to:

[0121] S11. Obtain a private key seed under preset security parameters.

[0122] S12. Use the private key seed as seed data of a pseudo-random number generator PRNG to generate 32x32 pseudo-random numbers.

[0123] Each of the 32x32 pseudo-random numbers is 32 bytes of pseudo-random hexadecimal data.

[0124] S13. Use each pseudo-random number as a private key block to obtain 32x32 private key blocks, and construct a signature private key based on the 32x32 private key blocks.

[0125] Optionally, the signature verification public key generation module 320 is further used to:

[0126] S21. Perform multiple hash operations on each of the 32x32 private key blocks to generate 32x32 hash chains.

[0127] Each hash chain includes multiple nodes.

[0128] S22. Obtain two adjacent hash chains from the 32x32 hash chains, connect the tail nodes of the two adjacent hash chains in series, perform a hash operation on the connected tail nodes, and generate 32x16 leaf nodes.

[0129] S23. Obtain two adjacent leaf nodes from the 32x16 leaf nodes, connect the two adjacent leaf nodes in series, perform a hash operation on the series-connected leaf nodes, and then generate 32 binary hash trees.

[0130] S24. Connect the root nodes of the 32 binary hash trees in series, use the SM3 algorithm to perform a hash operation on the connected root nodes, and obtain the SM3 hash value as the signature scheme public key.

[0131] Optionally, the signature verification public key generation module 320 is further used to:

[0132] For each private key block in the 32x32 private key blocks, each private key block is used as the first node of the hash chain, and a hash operation is performed on the data in the first node to obtain the first node hash value as the second node, and a hash operation is performed on the data in the second node to obtain the second node hash value as the third node, and a hash operation is performed on the data in the third node to obtain the third node hash value as the tail node. A hash chain is formed based on the first node, the second node, the third node and the tail node.

[0133] Optionally, the signature value generating module 330 is further used to:

[0134] S31. Obtain the message to be signed, and use the SM3 algorithm to perform a hash operation on the message to obtain a message digest.

[0135] S32. Group the message digests, and each group of message digests after grouping corresponds to a hash tree.

[0136] S33. Obtain the leaf nodes of the hash tree corresponding to each group of message digests, obtain the hash chain of the leaf nodes and the identity authentication path of the leaf nodes as signature values.

[0137] Optionally, the signature value generating module 330 is further used to:

[0138] Divide the message digests into 32 groups, divide each group of message digests into the first group of data, the second group of data and the third group of data, use the first group of data as the index of the leaf node position of the binary hash tree, use the second group of data as the index of one hash chain position of the leaf node, and use the third group of data as the index of another hash chain position of the leaf node.

[0139] Optionally, the output module 340 is further configured to:

[0140] The signature verification public key is calculated according to the signature value to obtain the signature verification public key calculation result, the hash chain and identity authentication path corresponding to the signature verification public key calculation result are obtained, and the hash chain and identity authentication path corresponding to the signature verification public key are compared to obtain the signature verification result.

[0141] In the embodiment of the present invention, a signature scheme is constructed by constructing a hash chain, a binary hash tree and a key using the national secret algorithm SM3. The security of the signature scheme relies on the security of SM3 and has a very reliable post-quantum security guarantee, filling the gap of the current domestic commercial digital signature algorithm that is not resistant to quantum.

[0142] In terms of practicality, traditional digital signature schemes based on hash functions can generally only complete digital signatures once, while this scheme can digitally sign messages multiple times, making it more practical.

[0143] The present invention is based on the national secret algorithm SM3. The signature scheme constructed by the hash function SM3 not only broadens the application field of the hash function, but also makes the scheme have good compatibility and applicability. It can be deployed on various resource-constrained hardware and software platforms and has a wide range of applications.

[0144] Fig. 9 is a schematic diagram of a post-quantum digital signature construction device provided by an embodiment of the present invention, such as Fig. 9 As shown, the post-quantum digital signature construction device may include the above Figure 8 The post-quantum digital signature construction device combined with the hash tree chain shown. Optionally, the post-quantum digital signature construction device 410 may include a first processor 2001.

[0145] Optionally, the post-quantum digital signature construction device 410 may further include a memory 2002 and a transceiver 2003 .

[0146] The first processor 2001, the memory 2002 and the transceiver 2003 may be connected via a communication bus.

[0147] Combine the following Fig. 9 The components of the post-quantum digital signature construction device 410 are specifically introduced:

[0148] The first processor 2001 is the control center of the post-quantum digital signature construction device 410, and may be a processor or a general term for multiple processing elements. For example, the first processor 2001 is one or more central processing units (CPUs), or may be application specific integrated circuits (ASICs), or may be configured to implement one or more integrated circuits of the embodiments of the present invention, such as one or more microprocessors (digital signal processors, DSPs), or one or more field programmable gate arrays (field programmable gate arrays, FPGAs).

[0149] Optionally, the first processor 2001 can perform various functions of the post-quantum digital signature construction device 410 by running or executing a software program stored in the memory 2002 and calling data stored in the memory 2002.

[0150] In a specific implementation, as an embodiment, the first processor 2001 may include one or more CPUs, such as Fig. 9 CPU0 and CPU1 are shown in FIG.

[0151] In a specific implementation, as an embodiment, the post-quantum digital signature construction device 410 may also include multiple processors, such as Fig. 9 The first processor 2001 and the second processor 2004 are shown in FIG. Each of these processors may be a single-core processor (single-CPU) or a multi-core processor (multi-CPU). The processor here may refer to one or more devices, circuits, and / or processing cores for processing data (e.g., computer program instructions).

[0152] The memory 2002 is used to store the software program for executing the solution of the present invention, and is controlled to be executed by the first processor 2001. The specific implementation method can refer to the above method embodiment, which will not be repeated here.

[0153] Optionally, the memory 2002 may be a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, a random access memory (RAM) or other types of dynamic storage devices that can store information and instructions, or an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical disc, laser disc, optical disc, digital versatile disc, Blu-ray disc, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory 2002 may be integrated with the first processor 2001, or may exist independently, and may be connected to the interface circuit ( Fig. 9 (not shown) is coupled to the first processor 2001, which is not specifically limited in this embodiment of the present invention.

[0154] The transceiver 2003 is used to communicate with a network device or a terminal device.

[0155] Optionally, the transceiver 2003 may include a receiver and a transmitter ( Fig. 9 The receiver is used to implement a receiving function, and the transmitter is used to implement a sending function.

[0156] Optionally, the transceiver 2003 may be integrated with the first processor 2001, or may exist independently, and construct an interface circuit of the device 410 through a post-quantum digital signature ( Fig. 9 (not shown) is coupled to the first processor 2001, which is not specifically limited in this embodiment of the present invention.

[0157] It should be noted that Fig. 9 The structure of the post-quantum digital signature construction device 410 shown in the figure does not constitute a limitation on the router. The actual knowledge structure recognition device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.

[0158] In addition, the technical effects of the post-quantum digital signature construction device 410 can refer to the technical effects of the post-quantum digital signature construction method combined with the hash tree chain described in the above method embodiment, which will not be repeated here.

[0159] It should be understood that the first processor 2001 in the embodiment of the present invention may be a central processing unit (CPU), and the processor may also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.

[0160] It should also be understood that the memory in the embodiments of the present invention may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of random access memory (RAM) are available, such as static RAM (SRAM), dynamic random access memory (DRAM), synchronous DRAM (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link DRAM (SLDRAM), and direct rambus RAM (DR RAM).

[0161] The above embodiments can be implemented in whole or in part by software, hardware (such as circuits), firmware or any other combination. When implemented by software, the above embodiments can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer programs are loaded or executed on a computer, the process or function described in the embodiment of the present invention is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website, computer, server or data center to another website, computer, server or data center by wired (such as infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that contains one or more available media sets. The available medium can be a magnetic medium (for example, a floppy disk, a hard disk, a tape), an optical medium (for example, a DVD), or a semiconductor medium. The semiconductor medium can be a solid-state hard disk.

[0162] It should be understood that the term "and / or" in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. A and B can be singular or plural. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship, but it may also indicate an "and / or" relationship. Please refer to the context for specific understanding.

[0163] In the present invention, "at least one" means one or more, and "plurality" means two or more. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b, or c can mean: a, b, c, ab, ac, bc, or abc, where a, b, and c can be single or multiple.

[0164] It should be understood that in various embodiments of the present invention, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.

[0165] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0166] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described equipment, devices and units can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0167] In the several embodiments provided by the present invention, it should be understood that the disclosed devices, apparatuses 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 device, 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.

[0168] 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.

[0169] 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.

[0170] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, and other media that can store program codes.

[0171] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art 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 post-quantum digital signature construction method combined with a hash tree chain, characterized in that: The method comprises: S1. Obtain the signature private key generated under preset security parameters; Wherein, the signature private key includes multiple private key blocks; S2. Generate multiple hash chains according to the multiple private key blocks, construct multiple binary hash trees according to the multiple hash chains, and generate signature verification public keys according to the multiple binary hash trees; S3. Obtain a message to be signed, perform a hash operation on the message using the SM3 algorithm to obtain a message digest, and obtain a signature value based on the message digest; S4. Perform signature verification according to the signature verification public key and the signature value to obtain a signature verification result; The step of obtaining the signature private key generated under the preset security parameters in S1 includes: S11. Obtaining a private key seed under preset security parameters; S12, using the private key seed as seed data of a pseudo-random number generator PRNG to generate 32x32 pseudo-random numbers; Wherein, each of the 32x32 pseudo-random numbers is 32 bytes of pseudo-random hexadecimal data; S13, using each pseudo-random number as a private key block to obtain 32x32 private key blocks, and constructing a signature private key according to the 32x32 private key blocks; The step of generating a plurality of hash chains according to the plurality of private key blocks, constructing a plurality of binary hash trees according to the plurality of hash chains, and generating a signature verification public key according to the plurality of binary hash trees in S2 includes: S21, perform multiple hash operations on each of the 32x32 private key blocks to generate 32x32 hash chains; Wherein, each hash chain includes multiple nodes; S22, obtaining two adjacent hash chains from the 32x32 hash chains, connecting the tail nodes of the two adjacent hash chains in series, performing a hash operation on the connected tail nodes, and thereby generating 32x16 leaf nodes; S23, obtaining two adjacent leaf nodes from the 32x16 leaf nodes, connecting the two adjacent leaf nodes in series, performing a hash operation on the connected leaf nodes, and thereby generating 32 binary hash trees; S24, concatenating the root nodes of the 32 binary hash trees, performing a hash operation on the concatenated root nodes using the SM3 algorithm, and obtaining an SM3 hash value as a signature scheme public key; The step of obtaining a message to be signed in S3, performing a hash operation on the message using the SM3 algorithm to obtain a message digest, and obtaining a signature value according to the message digest includes: S31, obtaining a message to be signed, and performing a hash operation on the message using the SM3 algorithm to obtain a message digest; S32, grouping the message digests, where each group of message digests corresponds to a hash tree; S33, obtaining the leaf nodes of the hash tree corresponding to each group of message digests, obtaining the hash chain of the leaf nodes and the identity authentication path of the leaf nodes as signature values; The step S4 performs signature verification according to the signature verification public key and the signature value to obtain a signature verification result, including: The signature verification public key is calculated according to the signature value to obtain the signature verification public key calculation result, the hash chain and identity authentication path corresponding to the signature verification public key calculation result are obtained, and the hash chain and identity authentication path corresponding to the signature verification public key are compared to obtain the signature verification result.

2. The post-quantum digital signature construction method combined with a hash tree chain according to claim 1 is characterized in that: The step S21 performs multiple hash operations on each of the 32x32 private key blocks to generate 32x32 hash chains, including: For each private key block in the 32x32 private key blocks, each private key block is used as the first node of the hash chain, and a hash operation is performed on the data in the first node to obtain the first node hash value as the second node, and a hash operation is performed on the data in the second node to obtain the second node hash value as the third node, and a hash operation is performed on the data in the third node to obtain the third node hash value as the tail node. A hash chain is formed based on the first node, the second node, the third node and the tail node.

3. The post-quantum digital signature construction method combined with a hash tree chain according to claim 1 is characterized in that: The step of grouping the message digests in S32 includes: The message digests are divided into 32 groups, each group of message digests is divided into a first group of data, a second group of data and a third group of data, the first group of data is used as an index of a leaf node position of a binary hash tree, the second group of data is used as an index of a hash chain position of the leaf node, and the third group of data is used as an index of another hash chain position of the leaf node.

4. A post-quantum digital signature construction device combined with a hash tree chain, wherein the post-quantum digital signature construction device combined with a hash tree chain is used to implement the post-quantum digital signature construction method combined with a hash tree chain as claimed in any one of claims 1 to 3, characterized in that: The device comprises: An acquisition module is used to obtain a signature private key generated under preset security parameters; Wherein, the signature private key includes multiple private key blocks; A signature verification public key generation module, used to generate multiple hash chains according to the multiple private key blocks, construct multiple binary hash trees according to the multiple hash chains, and generate a signature verification public key according to the multiple binary hash trees; A signature value generation module is used to obtain a message to be signed, perform a hash operation on the message using the SM3 algorithm to obtain a message digest, and obtain a signature value based on the message digest; The output module is used to perform signature verification according to the signature verification public key and the signature value to obtain a signature verification result.

5. A post-quantum digital signature construction device, characterized in that: The post-quantum digital signature construction device comprises: processor; A memory having computer-readable instructions stored thereon, wherein when the computer-readable instructions are executed by the processor, the method according to any one of claims 1 to 3 is implemented.

6. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores program codes, which can be called by a processor to execute the method according to any one of claims 1 to 3.