A signature key management method, device, equipment and storage medium
Patent Information
- Application Number
- CN202510914380.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-03
- Publication Date
- 2026-10-30
- Estimated Expiration
- 2045-07-03
AI Technical Summary
如果为不同的消息生成不同的密钥,将造成过重的密钥管理负担
[0047]本申请中,在对签名密钥进行管理时,获取目标消息,利用目标安全参数生成一次密钥对,并利用所述一次密钥对中的一次私钥对所述目标消息进行签名,以得到第一签名参数;利用当前的第一动态树的叶子节点对所述一次密钥对中的一次公钥进行存储以得到新的所述第一动态树;在所述第一动态树的Shrubs节点发生变化时对第二动态树进行更新以得到新的所述第二动态树,在所述Shrubs节点的数量发生变化时更新目标树容量标志,以基于新的所述第一动态树和新的所述第二动态树更新目标动态树;其中,所述目标动态树为基于所述第一动态树和所述第二动态树构造的动态树,所述目标树容量标志用于确定当前的第二动态树的目标树容量是否符合目标树容量增加条件,若符合,则增加所述第二动态树的目标树层数并更新所述目标树容量;所述目标树容量为所述第二动态树的叶子节点的数量;基于当前的所述目标动态树对目标私钥进行更新并确定第二签名参数,基于所述第一签名参数、所述第二签名参数和所述一次公钥确定目标签名,并基于所述目标消息和所述目标签名确定消息签名对,以利用所述目标签名基于所述目标动态树对所述消息签名对进行验证;所述目标私钥为基于所述目标动态树的陷门密钥生成的;其中,所述陷门密钥和所述目标动态树的哈希密钥对应的安全参数与所述目标安全参数一致;所述第一动态树为动态Shrubs树,所述第二动态树为动态Shrubs节点认证树,所述第二动态树的叶子节点为变色龙哈希节点,所述第二动态树的叶子节点对应的消息与所述第一动态树的Shrubs节点的哈希值相对应;所述第二签名参数包括所述一次公钥在所述目标动态树对应的认证路径和索引。可见,本申请利用第一动态树和第二动态树构造了目标动态树,其中第一动态树为规模可根据需求动态扩展的动态Shrubs树,第二动态树为规模可根据需求动态扩展的动态Shrubs节点认证树,第一动态树的叶子节点用来储存一次密钥对中的一次公钥,第二动态树的叶子节点对应的消息与第一动态树的Shrubs节点的哈希值相对应,从而实现了利用目标动态树对一次签名密钥的动态无界管理。当需要对利用一次密钥对中的一次私钥进行签名的消息进行验证时,仅需根据该消息所在的消息签名对中包含的目标签名来确定该一次私钥对应的一次公钥,以及该一次公钥在目标动态树中所在的位置,利用目标动态树即可完成对该消息签名对的验证,从而在实现一次签名密钥的动态无界管理的同时,削弱树规模的扩展对认证路径长度的影响,降低树的管理开销。
Smart Images

Figure CN120658481B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of information security, and in particular to a signature key management method, apparatus, device, and storage medium. Background Technology
[0002] One-time signatures are a special type of digital signature. The basic idea is to use a one-way function to sign a message. Compared to public-key signatures based on trapdoor functions, one-time signatures are more efficient in generating and verifying. However, one-time signatures expose part of the private key during the signing process. Therefore, to ensure signature security, each key pair can only be used once. Generating different keys for different messages would create an excessively heavy key management burden.
[0003] Currently, Merkle tree-based one-time signature key management mechanisms require pre-compiling all one-time signature key pairs to construct a complete Merkle tree, resulting in significant computational and storage overhead during initialization. If an incremental Merkle tree is used, adding a leaf node requires updating nodes at the specified depth, leading to substantial update overhead. While chameleon-based one-time signature key management mechanisms can dynamically add leaf nodes, each leaf node still needs to be authenticated to the root node, resulting in a long authentication path and significant overhead for the final signature size and verification. Furthermore, adding a leaf node requires traversing the entire path from the root node to that leaf node, generating missing nodes and their siblings, and then updating from the bottom up using the actual leaf node until the chameleon hash node is reached. This "generate first, then update" approach results in significant update overhead. The authentication path length of a one-time signature key management mechanism based on a dynamic chameleon authentication tree is the depth of the subtree root closest to a leaf node. Therefore, as the tree size increases, the authentication path length grows too rapidly, leading to a rapid increase in signature size and verification overhead. Furthermore, when adding a leaf node, if the tree size needs to be expanded, a new verification root node needs to be generated. Then, the entire path from the verification root node to the leaf node needs to be traversed, generating missing nodes and their siblings. Finally, the actual leaf nodes are used to update from bottom to top until the chameleon hash node is reached. This "generate first, then update" method results in significant update operation overhead.
[0004] In summary, how to achieve dynamic unbounded management of signature keys, reduce the impact of tree expansion on authentication path length, and lower tree management overhead are urgent problems to be solved. Summary of the Invention
[0005] In view of this, the purpose of this invention is to provide a signature key management method, apparatus, device, and storage medium, which can realize dynamic unbounded management of a single signature key, reduce the impact of tree expansion on authentication path length, and lower tree management overhead. The specific solution is as follows:
[0006] Firstly, this application discloses a signature key management method, including:
[0007] Obtain the target message, generate a primary key pair using the target security parameters, and sign the target message using the primary private key in the primary key pair to obtain the first signature parameter;
[0008] The first public key in the first key pair is stored using the leaf nodes of the current first dynamic tree to obtain a new first dynamic tree;
[0009] When the Shrubs nodes of the first dynamic tree change, the second dynamic tree is updated to obtain a new second dynamic tree. When the number of Shrubs nodes changes, the target tree capacity flag is updated to update the target dynamic tree based on the new first dynamic tree and the new second dynamic tree. The target dynamic tree is a dynamic tree constructed based on the first dynamic tree and the second dynamic tree. The target tree capacity flag is used to determine whether the current target tree capacity of the second dynamic tree meets the target tree capacity increase condition. If it does, the target tree level of the second dynamic tree is increased and the target tree capacity is updated. The target tree capacity is the number of leaf nodes in the second dynamic tree.
[0010] The target private key is updated based on the current target dynamic tree, and the second signature parameter is determined. The target signature is determined based on the first signature parameter, the second signature parameter, and the primary public key. A message signature pair is determined based on the target message and the target signature, so as to verify the message signature pair using the target signature based on the target dynamic tree. The target private key is generated based on the trapdoor key of the target dynamic tree.
[0011] The security parameters corresponding to the trapdoor key and the hash key of the target dynamic tree are consistent with the target security parameters; the first dynamic tree is a dynamic Shrubs tree, the second dynamic tree is a dynamic Shrubs node authentication tree, the leaf nodes of the second dynamic tree are chameleon hash nodes, and the messages corresponding to the leaf nodes of the second dynamic tree correspond to the hash values of the Shrubs nodes of the first dynamic tree; the second signature parameter includes the authentication path and index of the primary public key in the target dynamic tree.
[0012] Optionally, the process of obtaining the initial target dynamic tree includes:
[0013] Generate the trapdoor key and hash key of the chameleon hash function corresponding to the target dynamic tree using the target security parameters;
[0014] The target tree capacity and target tree level are set to zero for each counter, the initial second dynamic tree, and the target tree capacity. The counters include a data counter and a Shrubs node counter. The Shrubs node counter corresponds to the target tree capacity flag.
[0015] The target database and all verification root nodes are initialized to empty, and the initial structure of the first dynamic tree and the initial structure of the second dynamic tree are initialized to empty;
[0016] An initial target dynamic tree is constructed based on the values of each counter, the target tree capacity and the number of target tree layers, the target database, the verification root node, the initial first dynamic tree, and the initial second dynamic tree.
[0017] Optionally, the signature key management method further includes:
[0018] Based on the initial structure of the first dynamic tree, the initial structure of the second dynamic tree, and the trapdoor key, construct the target private key of the initial target dynamic tree;
[0019] Construct the initial target public key for the target dynamic tree using the hash key;
[0020] Accordingly, updating the target private key based on the current target dynamic tree and determining the second signature parameters includes:
[0021] Based on the current structure of the first dynamic tree, the current structure of the second dynamic tree, and the trapdoor key, the target private key is updated and the second signature parameters are determined.
[0022] Optionally, the step of storing the primary public key in the primary key pair using the leaf nodes of the current first dynamic tree to obtain a new first dynamic tree includes:
[0023] Add the target leaf node to the current first dynamic tree;
[0024] The target leaf node is used to store the public key of the primary key pair;
[0025] Perform a hash operation by backtracking upwards from the target leaf node to determine the target Shrubs node corresponding to the target leaf node;
[0026] Determine whether the target Shrubs node already exists;
[0027] If the target Shrubs node already exists, the hash value of the target Shrubs node is updated to obtain a new first dynamic tree;
[0028] Increment the current value of the data counter by one.
[0029] Optionally, updating the second dynamic tree to obtain a new second dynamic tree when the Shrubs node of the first dynamic tree changes includes:
[0030] If the changes in the Shrubs node of the first dynamic tree meet the first update condition, then the random number corresponding to the leaf node of the second dynamic tree is updated based on the trapdoor key and the hash value of the new Shrubs node of the first dynamic tree to obtain a new second dynamic tree.
[0031] If the changes in the Shrubs nodes of the first dynamic tree meet the second update condition, then using the target tree capacity flag and the target tree capacity, a corresponding chameleon hash node is added to the second dynamic tree for the newly added Shrubs nodes of the first dynamic tree, and the random number corresponding to the leaf node of the second dynamic tree is updated based on the trapdoor key and the hash value of the new Shrubs nodes of the first dynamic tree to obtain a new second dynamic tree.
[0032] The first update condition is that the Shrubs node and its corresponding hash value of the first dynamic tree change, but the number of Shrubs nodes in the first dynamic tree does not change; the second update condition is that the Shrubs node and its corresponding hash value of the first dynamic tree change, and the number of Shrubs nodes in the first dynamic tree changes.
[0033] Optionally, the condition for increasing the target tree capacity is that the difference between the value of the target tree capacity flag and the target tree capacity is less than a preset target tree capacity difference.
[0034] Optionally, the step of verifying the message signature pair using the target signature based on the target dynamic tree includes:
[0035] Using the first verification algorithm, based on the public key in the target signature, the first parameter verification is performed on the target message in the message signature pair and the first signature parameter in the target signature to obtain the first verification result;
[0036] If the first verification result indicates that the target signature passes the first parameter verification, then the second verification algorithm is used to perform second parameter verification on the second target parameter in the target signature based on the target public key of the target dynamic tree and the primary public key, so as to obtain the second verification result.
[0037] Secondly, this application discloses a signature key management device, comprising:
[0038] The message signing module is used to obtain a target message, generate a primary key pair using the target security parameters, and sign the target message using the primary private key in the primary key pair to obtain the first signature parameter;
[0039] The first dynamic tree update module is used to store the public key in the key pair using the leaf nodes of the current first dynamic tree to obtain a new first dynamic tree and update the value of the data counter.
[0040] The second dynamic tree update module is used to update the second dynamic tree to obtain a new second dynamic tree when the Shrubs nodes of the first dynamic tree change, and to update the target tree capacity flag when the number of Shrubs nodes changes, so as to update the target dynamic tree based on the new first dynamic tree and the new second dynamic tree; wherein, the target dynamic tree is a dynamic tree constructed based on the first dynamic tree and the second dynamic tree, and the target tree capacity flag is used to determine whether the target tree capacity of the current second dynamic tree meets the target tree capacity increase condition. If it does, the target tree level of the second dynamic tree is increased and the target tree capacity is updated; the target tree capacity is the number of leaf nodes of the second dynamic tree.
[0041] The signature verification module is used to update the target private key based on the current target dynamic tree and determine the second signature parameter, determine the target signature based on the first signature parameter, the second signature parameter and the primary public key, and determine the message signature pair based on the target message and the target signature, so as to verify the message signature pair using the target signature based on the target dynamic tree; the target private key is generated based on the trapdoor key of the target dynamic tree;
[0042] The security parameters corresponding to the trapdoor key and the hash key of the target dynamic tree are consistent with the target security parameters; the first dynamic tree is a dynamic Shrubs tree, the second dynamic tree is a dynamic Shrubs node authentication tree, the leaf nodes of the second dynamic tree are chameleon hash nodes, and the messages corresponding to the leaf nodes of the second dynamic tree correspond to the hash values of the Shrubs nodes of the first dynamic tree; the second signature parameter includes the authentication path and index of the primary public key in the target dynamic tree.
[0043] Thirdly, this application discloses an electronic device, including:
[0044] Memory, used to store computer programs;
[0045] A processor is used to execute the computer program to implement the aforementioned signature key management method.
[0046] Fourthly, this application discloses a computer-readable storage medium for storing a computer program, wherein the computer program, when executed by a processor, implements the aforementioned signature key management method.
[0047] In this application, when managing the signature key, a target message is obtained, a primary key pair is generated using the target security parameters, and the target message is signed using the primary private key in the primary key pair to obtain a first signature parameter; the primary public key in the primary key pair is stored using the leaf nodes of the current first dynamic tree to obtain a new first dynamic tree; when the Shrubs nodes of the first dynamic tree change, the second dynamic tree is updated to obtain a new second dynamic tree; when the number of Shrubs nodes changes, the target tree capacity flag is updated to update the target dynamic tree based on the new first dynamic tree and the new second dynamic tree; wherein, the target dynamic tree is a dynamic tree constructed based on the first dynamic tree and the second dynamic tree, and the target tree capacity flag is used to determine whether the target tree capacity of the current second dynamic tree meets the target tree capacity increase condition; if it does, the target tree layer number of the second dynamic tree is increased and the target tree capacity is updated; the target tree capacity... The quantity is the number of leaf nodes in the second dynamic tree; the target private key is updated based on the current target dynamic tree, and the second signature parameter is determined; the target signature is determined based on the first signature parameter, the second signature parameter, and the primary public key; and a message signature pair is determined based on the target message and the target signature, so as to verify the message signature pair using the target signature based on the target dynamic tree; the target private key is generated based on the trapdoor key of the target dynamic tree; wherein, the security parameters corresponding to the trapdoor key and the hash key of the target dynamic tree are consistent with the target security parameters; the first dynamic tree is a dynamic Shrubs tree, the second dynamic tree is a dynamic Shrubs node authentication tree, the leaf nodes of the second dynamic tree are chameleon hash nodes, and the message corresponding to the leaf node of the second dynamic tree corresponds to the hash value of the Shrubs node of the first dynamic tree; the second signature parameter includes the authentication path and index of the primary public key in the target dynamic tree. As can be seen, this application constructs a target dynamic tree using a first dynamic tree and a second dynamic tree. The first dynamic tree is a dynamic Shrubs tree whose size can be dynamically expanded according to needs, and the second dynamic tree is a dynamic Shrubs node authentication tree whose size can be dynamically expanded according to needs. The leaf nodes of the first dynamic tree are used to store the public key in a key pair. The message corresponding to the leaf node of the second dynamic tree corresponds to the hash value of the Shrubs node of the first dynamic tree, thereby realizing the dynamic unbounded management of the signature key using the target dynamic tree.When it is necessary to verify a message signed using a private key in a key pair, it is only necessary to determine the public key corresponding to the private key and the position of the public key in the target dynamic tree based on the target signature contained in the message signature pair containing the message. The verification of the message signature pair can be completed using the target dynamic tree. This achieves dynamic unbounded management of the signature key while reducing the impact of tree expansion on the authentication path length and reducing the management overhead of the tree. Attached Figure Description
[0048] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0049] Figure 1 A schematic diagram of the initialization state of a Shrubs tree provided in this application;
[0050] Figure 2 A schematic diagram illustrating the state of adding leaf nodes to a Shrubs tree provided in this application;
[0051] Figure 3 A schematic diagram illustrating the correspondence between Shrubs nodes in a Shrubs tree update provided in this application;
[0052] Figure 4 This is a flowchart of a signature key management method disclosed in this application;
[0053] Figure 5 A schematic diagram illustrating the process of adding leaf nodes to a dynamic Shrubs tree provided in this application;
[0054] Figure 6 This application provides a schematic diagram of a dynamic Shrubs node authentication tree structure.
[0055] Figure 7 This application provides a schematic diagram of the structure of a dynamic Shrubs tree before and after adding nodes;
[0056] Figure 8 This application provides a schematic diagram illustrating the structure of a dynamic Shrubs node authentication tree before and after adding nodes.
[0057] Figure 9 This is a schematic diagram of the structure of a signature key management device disclosed in this application;
[0058] Figure 10 This is a structural diagram of an electronic device disclosed in this application. Detailed Implementation
[0059] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0060] Currently, Merkle tree-based one-time signature key management mechanisms require pre-compiling all one-time signature key pairs to construct a complete Merkle tree, resulting in significant computational and storage overhead during initialization. If an incremental Merkle tree is used, adding a leaf node requires updating nodes at the specified depth, leading to substantial update overhead. While chameleon-based one-time signature key management mechanisms can dynamically add leaf nodes, each leaf node still needs to be authenticated to the root node, resulting in a long authentication path and significant overhead for the final signature size and verification. Furthermore, adding a leaf node requires traversing the entire path from the root node to that leaf node, generating missing nodes and their siblings, and then updating from the bottom up using the actual leaf node until the chameleon hash node is reached. This "generate first, then update" approach results in significant update overhead. The authentication path length of a one-time signature key management mechanism based on a dynamic chameleon authentication tree is the depth of the subtree root closest to a leaf node. Therefore, as the tree size increases, the authentication path length grows too rapidly, leading to a rapid increase in signature size and verification overhead. Furthermore, when adding a leaf node, if the tree size needs to be expanded, a new verification root node needs to be generated. Then, the entire path from the verification root node to the leaf node needs to be traversed, generating missing nodes and their siblings. The actual leaf nodes are then used to update from bottom to top until the chameleon hash node is reached. This "generate first, then update" method results in significant update overhead. To address these technical problems, this application discloses a signature key management method that enables dynamic unbounded management of one-time signature keys, reduces the impact of tree size expansion on the authentication path length, and lowers the tree management overhead.
[0061] To facilitate understanding, we will first introduce the chameleon hash function and shrubs tree involved in the key management scheme.
[0062] The Chameleon Hash Function family includes three algorithms. These are the key generation functions. Chameleon hash function and random number update function Input security parameters to the key generation function. It will output the hash key. and trapdoor key Input the hash key for the Chameleon hash function. ,information and random numbers It will output a hash value with a fixed length. ,in, , Set the pre-defined message range and random number range; input the trapdoor key into the random number update function. ,information and random numbers Output and satisfy .
[0063] Based on the above, a secure chameleon hash function must satisfy collision resistance and semantic security. Collision resistance means that an adversary, without knowing the trapdoor key TK, can avoid collisions with a given message. random numbers Output random numbers satisfy The probability of this is negligible, meaning that updating the message and the random number will yield the same hash value, thus maintaining the hash value unchanged; semantic safety refers to the ability to maintain the hash value for any message. hash value and The probability distribution of is computationally indistinguishable. In particular, for randomly selected Unable to obtain from hash value Get any information about Information.
[0064] Building upon this, the Shrubs tree is a variant of the Merkle tree. Unlike the Merkle tree, the Shrubs tree does not use a single root node to "represent" the entire tree. Instead, it selects a node (called a Shrubs node) at each level to "represent" the entire tree. Assuming a Shrubs tree of depth D, D Shrubs nodes are needed as root nodes for their subtrees. These subtree roots can represent a complete Merkle tree (uniqueness) and cover all the added leaf nodes. For example... Figure 1 The diagram (using depth D=4 as an example) shows the initial state of the Shrubs tree. There are four Shrubs nodes initialized with empty nodes, and each Shrub node is the root of the rightmost complete subtree of its respective level. Figure 2As shown, when adding a leaf node to the Shrubs tree, the hash value is calculated upwards until the root of the subtree closest to that leaf node is reached. Then, the root of that subtree is updated to the Shrubs node of its level. In other words, for each leaf node added, the root of the subtree (Shrubs node) closest to that leaf node is updated. Specifically, if a left leaf node is added, the added position is the subtree root, and it is updated accordingly; if a right leaf node is added, the process backtracks upwards until the left node is reached, and then that node is updated. Figure 3 The diagram shows the correspondence between Shrubs nodes and their updates during the process of adding leaf nodes to the Shrubs tree. It can be seen that the left node at each level is updated only once. Therefore, the average update path length... for:
[0065] ;
[0066] For authentication paths, we only need to find the authentication path of the subtree closest to the leaf node. Therefore, if the authentication path is given immediately after adding the leaf node, the average authentication path length is... Because the authentication path does not include the verification root node (Shrubs node), it is one less than the update path. Therefore, each time a leaf node is added, only one Shrubs node needs to be updated, meaning the storage update when adding a leaf node is O(1). To prove whether a leaf node is on the Shrubs tree, only the authentication path of the nearest subtree to that leaf node needs to be given. Table 1 shows a comparison between the Shrubs tree and the Merkle tree. It can be seen that the Shrubs tree has significant advantages in terms of update overhead and authentication path. However, it should be noted that the Shrubs tree requires D subtree root nodes to represent the entire tree, while the Merkle tree only requires one root node.
[0067] Table 1 Comparison of Shrubs trees and Merkel trees
[0068]
[0069] See Figure 4 As shown, an embodiment of the present invention discloses a signature key management method, including:
[0070] Step S11: Obtain the target message, generate a primary key pair using the target security parameters, and sign the target message using the primary private key in the primary key pair to obtain the first signature parameter.
[0071] In this embodiment, As a signature scheme, upon obtaining the target message, the target security parameters are first utilized. Based on a single key pair generation algorithm Generate a key pair for signing (i.e., a single key pair). This process can be represented as, ,in For a private key, This is a public key. Then use... The target message to be signed Perform the signing to obtain the first signature parameters. This process can be represented as .
[0072] Step S12: Use the leaf nodes of the current first dynamic tree to store the public key in the key pair to obtain a new first dynamic tree, and update the first tree capacity flag; wherein, the first tree capacity flag is used to determine whether the first tree capacity of the current first dynamic tree meets the condition for increasing the first tree capacity. If it meets the condition, the first tree level of the first dynamic tree is increased and the first tree capacity is updated; the first tree capacity is the number of leaf nodes of the first dynamic tree.
[0073] In this embodiment, the chameleon hash function is introduced into the shrubs tree to construct a new target dynamic tree, which is used to achieve dynamic unbounded management of the one-time signature key. The target dynamic tree is a Dynamic Chameleon Shrubs Authentication Tree (DCSAT), which consists of a first dynamic tree and a second dynamic tree. The first dynamic tree is a Dynamic Shrubs Tree (DST), and its capacity is equal to the number of leaf nodes in the first dynamic tree. The second dynamic tree is a Dynamic Shrubs Nodes Authentication Tree (DSNAT).
[0074] In this embodiment, the method of adding leaf nodes to the first dynamic tree DST is similar to that of the Shrubs tree. The difference is that the size of the DST can be dynamically expanded; therefore, Shrubs nodes are not pre-generated (initialized), but added as needed. For example... Figure 5 The diagram illustrates the process of adding leaf nodes 0 through 7 to DST. Figure 6 The diagram shows the structure of the second dynamic tree, DSNAT, which is a dynamic Merkle tree whose size can be expanded as needed. Specifically, DSNAT can dynamically expand the size of the tree based on the number of leaf nodes. This represents the number of tree levels in DSNAT. This represents the maximum number of leaves that DSNAT can accommodate. The node on the leftmost path of DSNAT is the verification root node, and different... Corresponding to different verification root nodes. Leaf nodes. For chameleon hash nodes, for random numbers The random number corresponding to the leaf node of the second dynamic tree corresponds to the hash value of the Shrubs node of the first dynamic tree, that is:
[0075] .
[0076] In this embodiment, to achieve dynamic unbounded management of a single-signature key using the target dynamic tree, after signing the target message using the private key from a single key pair, the public key from that single key pair can be saved to an empty leaf node of the first dynamic tree of the target dynamic tree. Let... For the target dynamic tree, Used to initialize the target dynamic tree and obtain the corresponding target public key and target private key. Used to add a public key from a key pair to the target dynamic tree. This is used to verify whether the public key is an element stored under the corresponding path and index in the target dynamic tree.
[0077] In this embodiment, it is possible to utilize Describe the initialization operation and input security parameters. The target public key of the target dynamic tree can then be obtained. and target private key In one specific implementation, the process of obtaining the initial target dynamic tree may include: generating a trapdoor key and a hash key for the chameleon hash function corresponding to the target dynamic tree using target security parameters; setting each counter, the target tree capacity corresponding to the initial second dynamic tree, and the target tree level to zero; the counters include data counters. and Shrubs node counters The Shrubs node counter corresponds to the target tree capacity flag; the target database and all verification root nodes are initialized to empty, and the structures of the initial first dynamic tree and the initial second dynamic tree are also initialized to empty; the initial target dynamic tree is constructed based on the values of each counter, the capacity of the first tree and the target tree, the number of target tree levels, the target database, the verification root nodes, the initial first dynamic tree, and the initial second dynamic tree. The security parameters corresponding to the trapdoor key and hash key of the target dynamic tree are consistent with the target security parameters. After obtaining the initial target dynamic tree, the target private key of the initial target dynamic tree is constructed based on the structure of the initial first dynamic tree, the structure of the initial second dynamic tree, and the trapdoor key; the target public key of the initial target dynamic tree is constructed using the hash key.
[0078] In other words, when performing initialization operations, security parameters will be used first. Generate the public / private key pair for the chameleon hash function, that is... Simultaneously, the database used for storing data will be initialized to empty, the root node will be initialized to empty, and the corresponding data counters, Shrubs node counters, the capacity and level of the second dynamic tree will be set to zero. The tree structure of the first dynamic tree will also be initialized. Tree structure of the second dynamic tree It will also be initialized to empty, at which point both the first and second dynamic trees will be empty, and the corresponding target dynamic tree will also be empty. After initializing the target dynamic tree, the trapdoor key obtained in the aforementioned process will be used. and To construct the initial target private key And use the hash key to construct the initial target public key. This process can be specifically described as and Thus, the target public-private key pair is obtained. It is understandable that, since the tree structure of the first dynamic tree and the tree structure of the second dynamic tree are considered when constructing the target private key, the target private key will also change when the first dynamic tree and the second dynamic tree change.
[0079] In this embodiment, when the primary public key in the primary key pair is stored using the leaf nodes of the current first dynamic tree to obtain a new first dynamic tree, the value of the data counter is updated accordingly. In actual use, the primary public key is generally added as data to the empty leaf nodes of the DST from left to right. After the primary public key is added to the DST, the index corresponding to the added data (i.e., the primary public key) is obtained. This index can be the current value of the data counter, after which the added public key can be added to the target database. When updating the first dynamic tree (DST), the updated content includes the leaf nodes, intermediate hash nodes, and the counter value.
[0080] In one specific implementation, when adding data to the first dynamic tree, the hash operation is performed by backtracking upwards, following the same procedure as adding a leaf node to a Shrubs tree, until the root node (Shrubs node) of the subtree closest to the leaf node is reached. If the Shrubs node already exists, the corresponding hash value is updated, and the random number of the Chameleon hash node corresponding to the Shrubs node is updated using the trapdoor key of the Chameleon hash function. Otherwise, a new Shrubs node needs to be added, and then added to DSNAT, incrementing the Shrubs node counter.
[0081] Step S13: When the Shrubs node of the first dynamic tree changes, the second dynamic tree is updated to obtain a new second dynamic tree. When the number of Shrubs nodes changes, the target tree capacity flag is updated to update the target dynamic tree based on the new first dynamic tree and the new second dynamic tree. The target dynamic tree is a dynamic tree constructed based on the first dynamic tree and the second dynamic tree. The target tree capacity flag is used to determine whether the target tree capacity of the current second dynamic tree meets the target tree capacity increase condition. If it does, the target tree level of the second dynamic tree is increased and the target tree capacity is updated. The target tree capacity is the number of leaf nodes of the second dynamic tree.
[0082] In this embodiment, when the first tree level of the first dynamic tree changes, the number of its Shrubs nodes also changes, and the first tree level and the number of Shrubs nodes are always equal. When the number of Shrubs nodes in the first dynamic tree changes, a corresponding chameleon hash node needs to be added to the newly added Shrubs node in DSNAT, the value of the Shrubs node counter needs to be increased, and the target tree capacity flag needs to be updated, so that the second dynamic tree is updated when the number of Shrubs nodes in the first dynamic tree changes. That is, when updating the second dynamic tree, the updated content includes the random number of the chameleon hash node.
[0083] In this embodiment, when the Shrubs node of the first dynamic tree changes, the second dynamic tree is updated to obtain a new second dynamic tree. Specifically, this may include: if the change in the Shrubs node of the first dynamic tree meets the first update condition, then the random number corresponding to the leaf node of the second dynamic tree is updated based on the trapdoor key and the hash value of the new Shrubs node of the first dynamic tree to obtain a new second dynamic tree; if the change in the Shrubs node of the first dynamic tree meets the second update condition, then using the target tree capacity flag and the target tree capacity, a corresponding chameleon hash node is added to the second dynamic tree for the newly added Shrubs node of the first dynamic tree, and the random number corresponding to the leaf node of the second dynamic tree is updated based on the trapdoor key and the hash value of the new Shrubs node of the first dynamic tree to obtain a new second dynamic tree; wherein, the first update condition is that the Shrubs node and the corresponding hash value of the first dynamic tree change, and the number of Shrubs nodes in the first dynamic tree does not change; the second update condition is that the Shrubs node and the corresponding hash value of the first dynamic tree change, and the number of Shrubs nodes in the first dynamic tree changes. In other words, since different Shrubs nodes in the first dynamic tree correspond to different leaf nodes in the second dynamic tree, based on the aforementioned content and this correspondence, it can be known that when the hash value in a Shrubs node changes, the random number of the leaf node corresponding to that Shrubs node in DSNAT will also change. When the DST is expanded, its first tree level will increase, and the number of Shrubs nodes will also increase accordingly. Therefore, it is necessary to add corresponding leaf nodes for the newly added Shrubs nodes in DSNAT to save the random number corresponding to the hash value of the newly added Shrubs node in DSNAT.
[0084] In this embodiment, to ensure that DSNAT has empty leaf nodes to cope with changes in the number of Shrubs nodes, the target tree capacity increase condition can be used to determine whether DSNAT needs to be expanded. The target tree capacity increase condition is that the difference between the target tree capacity flag and the target tree capacity is less than a preset target tree capacity difference. It can be understood that the target tree capacity is usually greater than or equal to the target tree capacity flag, and the preset target tree capacity difference can be 0 or other values. In actual use, DSNAT leaf nodes (i.e., chameleon hash nodes) are usually used from left to right. In other words, when adding chameleon hash nodes to DSNAT, it is first determined whether the number of Shrubs nodes in the DST is equal to the target tree capacity of DSNAT (i.e., whether the target tree capacity of DSNAT is full). If they are equal, the target tree capacity needs to be expanded. Specifically, when the target tree capacity is equal to the target tree capacity flag, if the target tree capacity is not 0, it will be initialized first. There are Shrubs nodes, and a tree of depth is constructed using these nodes as leaf nodes. The original tree is taken as the expanded left subtree, and the root nodes of these two subtrees are taken as the left and right child nodes. The new root node of DCSAT is calculated. Then, the target tree level and target tree capacity of DSNAT are updated. The new target tree level is one greater than the original target tree level, and the new target tree capacity is twice the original tree capacity. In other words, each time the size of DSNAT is expanded, a right subtree of the same size as the original tree is generated at once (e.g., ...). Figure 6 (Marked by the yellow dashed box). If the target tree capacity is equal to the target tree capacity flag and the target tree capacity is 0, then a Shrubs node will be initialized first, and this node will be used as the new root node. Then, the target tree level of DSNAT is updated to 1, and the target tree capacity is updated to 1. After successful expansion, the hash value of the Shrubs node is used to update the random number of the corresponding Chameleon Hash node, thereby adding the Shrubs node to DSNAT.
[0085] In one specific implementation, the target tree capacity increase condition can be adjusted to set the target tree capacity to increase when the value of the target tree capacity flag is equal to the target tree capacity. DSNAT is initialized to empty, and the target tree level is initialized to 0. When Shrubs[0] is added to DST, it needs to be added to DSNAT synchronously. At this time, the capacity of DSNAT is insufficient, and its size needs to be expanded first. The value is increased to 1. During the expansion process, the chameleon hash node will be initialized, that is:
[0086] ;
[0087] Then, using the hash value of Shrubs[0], update Corresponding random number To obtain ,Right now:
[0088] ;
[0089] Shrubs[0] was added to DSNAT using the above method. When shrubs[1] and Shrubs[2] are added to DST, the operation is similar to the above: first, the size of DSNAT is expanded, and then the hash value of the Shrubs node is used to update the random number of the corresponding Chameleon hash node. Specifically, as shown in the example... Figure 7 (a) shows the DST after adding node 1, where [1] is the Shrubs node that was added. At this time, Shrubs[1] needs to be converted into a Chameleon hash node. Stored in DSNAT. For example... Figure 8 As shown in (a), after adding the chameleon hash node corresponding to Shrubs[1] Afterwards, the target tree capacity and the target tree level of DSNAT are both 1, and the target tree level is also 1. Therefore, it can be determined that there are no empty leaf nodes in DSNAT used to store chameleon hash nodes. DSNAT needs to be expanded to increase the number of target tree levels. After increasing from 1 to 2, the target tree capacity increases by 1. Chameleon hash nodes are initialized during the resizing process. ,Right now:
[0090] ;
[0091] Then update using the hash value of Shrubs[1]. The random number, that is:
[0092] ;
[0093] In the above manner, Shrubs[1] is stored in DSNAT, such as Figure 8 As shown in (b). Figure 7 (b) is the DST after adding node 2, at which point node 2 becomes the new DST. That is, the hash value of Shrubs[0] has been updated, so it is necessary to update DSNAT synchronously. Corresponding random number get ,Right now:
[0094] .
[0095] Understandably, as the tree capacity and number of levels of DST and DSNAT increase, the frequency of scaling up DST and DSNAT will gradually decrease, assuming other conditions remain unchanged. Furthermore, due to the correspondence between the leaf nodes of DSNAT and the Shrubs nodes of DST, the scaling up frequency of DSNAT will be lower than that of DST. For example, when DST has two levels, a two-level DSNAT can handle changes in the hash value of DST's Shrubs nodes; when DST has three levels, DSNAT will also be scaled up to three levels to handle the increase in the number of DST's Shrubs nodes and changes in hash value; when DST has four levels, a three-level DSNAT can still satisfy the increase in the number of DST's Shrubs nodes and changes in hash value; and when DSNAT has four levels, the target tree capacity is 8, thus it can satisfy the increase in the number of DST's Shrubs nodes and changes in hash value for DSTs with a first tree level not exceeding eight. Specifically, when Shrubs[3] is added to the DST (that is, when the DST is expanded from two layers to three layers), there is no need to expand the size of DSNAT; the hash value of Shrubs[3] can be used directly to update the DST. Corresponding random number To obtain ,Right now:
[0096] ;
[0097] Similarly, when the Shrubs node is updated in DST, the random number of the corresponding Chameleon Hash node in DSNAT is updated using the hash value of the Shrubs node.
[0098] Step S14: Update the target private key based on the current target dynamic tree and determine the second signature parameter; determine the target signature based on the first signature parameter, the second signature parameter and the primary public key; and determine the message signature pair based on the target message and the target signature, so as to verify the message signature pair using the target signature based on the target dynamic tree; the target private key is generated based on the trapdoor key of the target dynamic tree.
[0099] In this embodiment, since the target dynamic tree DCSAT is constructed based on the first dynamic tree DST and the second dynamic tree DSNAT, and the target private key of the target dynamic tree is constructed based on the trapdoor key, the tree structure of the first dynamic tree DST, and the tree structure of the second dynamic tree DSNAT, after storing the public key into the leaf node of the first dynamic tree, the tree structure of the first dynamic tree and the tree structure of the second dynamic tree will change. Therefore, each time a public key is added to the DST, the target dynamic tree and the target private key will change. That is to say, after completing the data storage and updating the tree structures of the first and second dynamic trees, the target dynamic tree and the target private key need to be updated based on the current structure of the first dynamic tree, the current structure of the second dynamic tree, and the trapdoor key. Specifically, the target private key of DCSAT needs to be updated. To obtain It can be described as:
[0100] ;
[0101] in, For the updated tree structure of DST, This is the updated tree structure of DSNAT.
[0102] In this embodiment, the updated tree structure and Besides being used to update the target's private key, it can also be used to determine the stored public key. The second signature parameter includes the authentication path corresponding to the public key in the target dynamic tree DCSAT. and index Specifically, according to and You can find the data authentication path. For example, for Figure 7 For node 1 in (a), its authentication path for:
[0103] .
[0104] Table 2 below shows a comparison between the Dynamic Chameleon Authentication Tree (DCSAT) and the Dynamic Chameleon Authentication Tree (DCAT) proposed in this embodiment. As can be seen from Table 2, DCSAT and DCAT are comparable in terms of the number of root nodes, capacity, average update path length, and the number of chameleon hash collisions calculated per update. Both can dynamically add leaf nodes and dynamically expand the tree size. However, DCAT uses a "generate first, then update" approach when adding leaf nodes, which leads to additional update overhead. DCSAT, on the other hand, can directly add leaf nodes and then generate other related nodes. Furthermore, DCSAT has a shorter average authentication path length than DCAT. In contrast, the DCSAT proposed in this embodiment optimizes the authentication path of leaf nodes, resulting in a shorter average authentication path length, thereby effectively reducing the signature size and verification overhead. Simultaneously, adding leaf nodes does not require "generate first, then update," avoiding additional update overhead, thus reducing the overall tree management overhead.
[0105] Table 2 Comparison results of DCSAT and DCAT
[0106]
[0107] In this embodiment, the second signature parameter is denoted as Ultimately, it can be based on the first signature parameter Second signature parameters and a public key Determine the target signature Thus based on the target message and target signature Determine message signature pair When verifying message signature pairs using the target signature based on the target dynamic tree, the first verification algorithm in the one-time signature scheme can be used. Based on the public key in the target signature, the first parameter verification is performed on the target message and the first signature parameter in the target signature in the message signature pair to obtain the first verification result; if the first verification result indicates that the target signature passes the first parameter verification, then the second verification algorithm of the target dynamic tree is used. The second target parameter in the target signature is verified based on the target public key and the primary public key of the target dynamic tree to obtain the second verification result.
[0108] As can be seen, this application constructs a target dynamic tree using a first dynamic tree and a second dynamic tree. The first dynamic tree is a dynamic Shrubs tree whose size can be dynamically expanded according to needs, and the second dynamic tree is a dynamic Shrubs node authentication tree whose size can be dynamically expanded according to needs. The leaf nodes of the first dynamic tree are used to store the primary public key in a primary key pair. The message corresponding to the leaf node of the second dynamic tree corresponds to the hash value of the Shrubs node in the first dynamic tree, thus achieving dynamic unbounded management of primary signature keys using the target dynamic tree. When it is necessary to verify a message signed using a primary private key in a primary key pair, it is only necessary to determine the primary public key corresponding to the primary private key and its position in the target dynamic tree based on the target signature contained in the message signature pair. The verification of the message signature pair can then be completed using the target dynamic tree. This achieves dynamic unbounded management of primary signature keys while mitigating the impact of tree expansion on the authentication path length and reducing tree management overhead.
[0109] As can be seen from the previous embodiment, this application discloses a signature key management method that can achieve dynamic unbounded management of signature keys in a single operation, reduce the impact of tree expansion on authentication path length, and lower tree management overhead. The specific process of signature key storage and verification will be described below.
[0110] In this embodiment, DCSAT is used to manage the keys for a single signature. Specifically, a target dynamic tree DCSAT is constructed using the public key of a key pair as leaf nodes to transform a single signature scheme into a signature scheme that can be used an unlimited number of times. As a signature scheme, let For the target dynamic tree, if set For a signature scheme based on DCSAT, the specific construction is as follows:
[0111] 1) For key generation algorithms. The key generation algorithm running DCSAT. Output multiple signature private keys and multiple signature public keys .
[0112] 2) For the signature algorithm, multiple signature private keys are used. Regarding the message Perform the signing. First, generate a key pair for signing. Then use the private key once. Regarding the message Perform the signing to obtain the first signature parameters. Then the public key will be used once. Add to DCSAT, that is:
[0113] ;
[0114] Let the second signature parameter be Finally, the signature is returned. .
[0115] 3) To verify the algorithm, multiple signature public keys were used. message signature pairs Verification is performed. First, the public key is used. For the first signature parameter To perform verification, that is:
[0116] ;
[0117] Then run DCSAT's verification algorithm to verify the public key once. Whether it is an element under the corresponding authentication path and index in DCSAT, i.e.:
[0118] ;
[0119] If both of the above verification steps pass, output 1; if either of the above two steps fails, output 0.
[0120] As can be seen, this application constructs a target dynamic tree using a first dynamic tree and a second dynamic tree. The first dynamic tree is a dynamic Shrubs tree whose size can be dynamically expanded according to needs, and the second dynamic tree is a dynamic Shrubs node authentication tree whose size can be dynamically expanded according to needs. The leaf nodes of the first dynamic tree are used to store the primary public key in a primary key pair. The message corresponding to the leaf node of the second dynamic tree corresponds to the hash value of the Shrubs node in the first dynamic tree, thus achieving dynamic unbounded management of primary signature keys using the target dynamic tree. When it is necessary to verify a message signed using a primary private key in a primary key pair, it is only necessary to determine the primary public key corresponding to the primary private key and its position in the target dynamic tree based on the target signature contained in the message signature pair. The verification of the message signature pair can then be completed using the target dynamic tree. This achieves dynamic unbounded management of primary signature keys while mitigating the impact of tree expansion on the authentication path length and reducing tree management overhead.
[0121] See Figure 9 As shown, this application discloses a signature key management device, comprising:
[0122] The message signing module 11 is used to obtain a target message, generate a primary key pair using the target security parameters, and sign the target message using the primary private key in the primary key pair to obtain the first signature parameter;
[0123] The first dynamic tree update module 12 is used to store the public key in the key pair using the leaf nodes of the current first dynamic tree to obtain a new first dynamic tree.
[0124] The second dynamic tree update module 13 is used to update the second dynamic tree to obtain a new second dynamic tree when the Shrubs node of the first dynamic tree changes, and to update the target tree capacity flag when the number of Shrubs nodes changes, so as to update the target dynamic tree based on the new first dynamic tree and the new second dynamic tree; wherein, the target dynamic tree is a dynamic tree constructed based on the first dynamic tree and the second dynamic tree, and the target tree capacity flag is used to determine whether the target tree capacity of the current second dynamic tree meets the target tree capacity increase condition. If it meets the condition, the target tree level of the second dynamic tree is increased and the target tree capacity is updated; the target tree capacity is the number of leaf nodes of the second dynamic tree.
[0125] The signature verification module 14 is used to update the target private key based on the current target dynamic tree and determine the second signature parameter, determine the target signature based on the first signature parameter, the second signature parameter and the primary public key, and determine the message signature pair based on the target message and the target signature, so as to verify the message signature pair using the target signature based on the target dynamic tree; the target private key is generated based on the trapdoor key of the target dynamic tree;
[0126] The security parameters corresponding to the trapdoor key and the hash key of the target dynamic tree are consistent with the target security parameters; the first dynamic tree is a dynamic Shrubs tree, the second dynamic tree is a dynamic Shrubs node authentication tree, the leaf nodes of the second dynamic tree are chameleon hash nodes, and the messages corresponding to the leaf nodes of the second dynamic tree correspond to the hash values of the Shrubs nodes of the first dynamic tree; the second signature parameter includes the authentication path and index of the primary public key in the target dynamic tree.
[0127] As can be seen, this application constructs a target dynamic tree using a first dynamic tree and a second dynamic tree. The first dynamic tree is a dynamic Shrubs tree whose size can be dynamically expanded according to needs, and the second dynamic tree is a dynamic Shrubs node authentication tree whose size can be dynamically expanded according to needs. The leaf nodes of the first dynamic tree are used to store the primary public key in a primary key pair. The message corresponding to the leaf node of the second dynamic tree corresponds to the hash value of the Shrubs node in the first dynamic tree, thus achieving dynamic unbounded management of primary signature keys using the target dynamic tree. When it is necessary to verify a message signed using a primary private key in a primary key pair, it is only necessary to determine the primary public key corresponding to the primary private key and its position in the target dynamic tree based on the target signature contained in the message signature pair. The verification of the message signature pair can then be completed using the target dynamic tree. This achieves dynamic unbounded management of primary signature keys while mitigating the impact of tree expansion on the authentication path length and reducing tree management overhead.
[0128] In one specific embodiment, the device may include:
[0129] The key generation module is used to generate the trapdoor key and hash key of the chameleon hash function corresponding to the target dynamic tree using the target security parameters;
[0130] The zeroing module is used to zero out each counter, the target tree capacity corresponding to the initial second dynamic tree, and the target tree level; the counters include a data counter and a Shrubs node counter; the Shrubs node counter corresponds to the target tree capacity flag;
[0131] An initialization module is used to initialize the target database and all verification root nodes to empty, and to initialize the initial structure of the first dynamic tree and the initial structure of the second dynamic tree to empty;
[0132] A dynamic tree construction module is used to construct an initial target dynamic tree based on the values of each of the counters, the target tree capacity and the number of target tree layers, the target database, the verification root node, the initial first dynamic tree, and the initial second dynamic tree.
[0133] In one specific embodiment, the device may further include:
[0134] A target private key construction module is used to construct the target private key of the initial target dynamic tree based on the initial structure of the first dynamic tree, the initial structure of the second dynamic tree, and the trapdoor key;
[0135] A target public key construction module is used to construct the initial target public key of the target dynamic tree using the hash key;
[0136] Accordingly, the signature verification module 14 may specifically include:
[0137] The parameter determination unit is used to update the target private key and determine the second signature parameters based on the current structure of the first dynamic tree, the current structure of the second dynamic tree, and the trapdoor key.
[0138] In one specific embodiment, the first dynamic tree update module 12 may specifically include:
[0139] The leaf node addition unit is used to add a target leaf node to the current first dynamic tree.
[0140] Data storage unit, used to store the public key of the primary key pair using the target leaf node;
[0141] The target node determination unit is used to perform a hash operation by backtracking upwards from the target leaf node to determine the target Shrubs node corresponding to the target leaf node;
[0142] The judgment unit is used to determine whether the target Shrubs node already exists;
[0143] The first dynamic tree update unit is used to update the hash value of the target Shrubs node to obtain a new first dynamic tree if the target Shrubs node already exists.
[0144] The data counter update unit increments the current value of the data counter by one.
[0145] In one specific embodiment, the second dynamic tree update module 13 may specifically include:
[0146] The first update unit is used to update the random number corresponding to the leaf node of the second dynamic tree based on the trapdoor key and the hash value of the new Shrubs node of the first dynamic tree if the change of the Shrubs node of the first dynamic tree meets the first update condition, so as to obtain a new second dynamic tree.
[0147] The second update unit is used to add a corresponding chameleon hash node to the newly added Shrubs node in the first dynamic tree in the second dynamic tree if the change of the Shrubs node in the first dynamic tree meets the second update condition, using the target tree capacity flag and the target tree capacity, and update the random number corresponding to the leaf node of the second dynamic tree based on the trapdoor key and the hash value of the new Shrubs node in the first dynamic tree to obtain a new second dynamic tree.
[0148] The first update condition is that the Shrubs node and its corresponding hash value of the first dynamic tree change, but the number of Shrubs nodes in the first dynamic tree does not change; the second update condition is that the Shrubs node and its corresponding hash value of the first dynamic tree change, and the number of Shrubs nodes in the first dynamic tree changes.
[0149] In one specific embodiment, the signature verification module 14 may include:
[0150] The first verification unit is used to perform first parameter verification on the target message in the message signature pair and the first signature parameter in the target signature based on the first public key in the target signature using a first verification algorithm, so as to obtain a first verification result;
[0151] The second verification unit is configured to, if the first verification result indicates that the target signature has passed the first parameter verification, use a second verification algorithm to perform second parameter verification on the second target parameter in the target signature based on the target public key of the target dynamic tree and the primary public key, so as to obtain a second verification result.
[0152] Furthermore, embodiments of this application also disclose an electronic device, Figure 10 This is a structural diagram of an electronic device 20 according to an exemplary embodiment. The content of the diagram should not be construed as limiting the scope of this application.
[0153] Figure 10 This is a schematic diagram of the structure of an electronic device 20 provided in an embodiment of this application. Specifically, the electronic device 20 may include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 stores a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the signature key management method disclosed in any of the foregoing embodiments. Alternatively, the electronic device 20 in this embodiment may specifically be an electronic computer.
[0154] In this embodiment, the power supply 23 is used to provide operating voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and external devices, and the communication protocol it follows can be any communication protocol applicable to the technical solution of this application, and is not specifically limited here; the input / output interface 25 is used to acquire external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs, and is not specifically limited here.
[0155] In addition, the memory 22, as a carrier for resource storage, can be a read-only memory, random access memory, disk, or optical disk, etc. The resources stored thereon can include an operating system 221, computer programs 222, etc., and the storage method can be temporary storage or permanent storage.
[0156] The operating system 221 is used to manage and control the various hardware devices on the electronic device 20 and the computer program 222, which may be Windows Server, Netware, Unix, Linux, etc. In addition to including a computer program capable of performing the signature key management method executed by the electronic device 20 as disclosed in any of the foregoing embodiments, the computer program 222 may further include a computer program capable of performing other specific tasks.
[0157] Furthermore, this application also discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, it implements the aforementioned disclosed signature key management method. Specific steps of this method can be found in the corresponding content disclosed in the foregoing embodiments, and will not be repeated here.
[0158] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to in the method section.
[0159] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0160] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented directly by hardware, a software module executed by a processor, or a combination of both. The software module can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.
[0161] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0162] The technical solutions provided in this application have been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the methods and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. A signature key management method, characterized in that, include: Obtain the target message, generate a primary key pair using the target security parameters, and sign the target message using the primary private key in the primary key pair to obtain the first signature parameter; The first public key in the first key pair is stored using the leaf nodes of the current first dynamic tree to obtain a new first dynamic tree; When the Shrubs nodes of the first dynamic tree change, the second dynamic tree is updated to obtain a new second dynamic tree. When the number of Shrubs nodes changes, the target tree capacity flag is updated to update the target dynamic tree based on the new first dynamic tree and the new second dynamic tree. The target dynamic tree is a dynamic tree constructed based on the first dynamic tree and the second dynamic tree. The target tree capacity flag is used to determine whether the current target tree capacity of the second dynamic tree meets the target tree capacity increase condition. If it does, the target tree level of the second dynamic tree is increased and the target tree capacity is updated. The target tree capacity is the number of leaf nodes in the second dynamic tree. The target private key is updated based on the current target dynamic tree, and the second signature parameter is determined. The target signature is determined based on the first signature parameter, the second signature parameter, and the primary public key. A message signature pair is determined based on the target message and the target signature, so as to verify the message signature pair using the target signature based on the target dynamic tree. The target private key is generated based on the trapdoor key of the target dynamic tree. The security parameters corresponding to the trapdoor key and the hash key of the target dynamic tree are consistent with the target security parameters; the first dynamic tree is a dynamic Shrubs tree, the second dynamic tree is a dynamic Shrubs node authentication tree, the leaf nodes of the second dynamic tree are chameleon hash nodes, and the messages corresponding to the leaf nodes of the second dynamic tree correspond to the hash values of the Shrubs nodes of the first dynamic tree; the second signature parameter includes the authentication path and index of the primary public key in the target dynamic tree.
2. The signature key management method according to claim 1, characterized in that, The process of obtaining the initial target dynamic tree includes: Generate the trapdoor key and hash key of the chameleon hash function corresponding to the target dynamic tree using the target security parameters; The target tree capacity and target tree level are set to zero for each counter, the initial second dynamic tree, and the target tree capacity. The counters include a data counter and a Shrubs node counter. The Shrubs node counter corresponds to the target tree capacity flag. The target database and all verification root nodes are initialized to empty, and the initial structure of the first dynamic tree and the initial structure of the second dynamic tree are initialized to empty; An initial target dynamic tree is constructed based on the values of each counter, the target tree capacity and the number of target tree layers, the target database, the verification root node, the initial first dynamic tree, and the initial second dynamic tree.
3. The signature key management method according to claim 1, characterized in that, Also includes: Based on the initial structure of the first dynamic tree, the initial structure of the second dynamic tree, and the trapdoor key, construct the target private key of the initial target dynamic tree; Construct the initial target public key for the target dynamic tree using the hash key; Accordingly, updating the target private key based on the current target dynamic tree and determining the second signature parameters includes: Based on the current structure of the first dynamic tree, the current structure of the second dynamic tree, and the trapdoor key, the target private key is updated and the second signature parameters are determined.
4. The signature key management method according to claim 1, characterized in that, The step of storing the public key of the primary key pair in the primary key pair using the leaf nodes of the current first dynamic tree to obtain a new first dynamic tree includes: Add the target leaf node to the current first dynamic tree; The target leaf node is used to store the public key of the primary key pair; Perform a hash operation by backtracking upwards from the target leaf node to determine the target Shrubs node corresponding to the target leaf node; Determine whether the target Shrubs node already exists; If the target Shrubs node already exists, the hash value of the target Shrubs node is updated to obtain a new first dynamic tree; Increment the current value of the data counter by one.
5. The signature key management method according to claim 1, characterized in that, The step of updating the second dynamic tree to obtain a new second dynamic tree when the Shrubs node of the first dynamic tree changes includes: If the changes in the Shrubs node of the first dynamic tree meet the first update condition, then the random number corresponding to the leaf node of the second dynamic tree is updated based on the trapdoor key and the hash value of the new Shrubs node of the first dynamic tree to obtain a new second dynamic tree. If the changes in the Shrubs nodes of the first dynamic tree meet the second update condition, then using the target tree capacity flag and the target tree capacity, a corresponding chameleon hash node is added to the second dynamic tree for the newly added Shrubs nodes of the first dynamic tree, and the random number corresponding to the leaf node of the second dynamic tree is updated based on the trapdoor key and the hash value of the new Shrubs nodes of the first dynamic tree to obtain a new second dynamic tree. The first update condition is that the Shrubs node and its corresponding hash value of the first dynamic tree change, but the number of Shrubs nodes in the first dynamic tree does not change; the second update condition is that the Shrubs node and its corresponding hash value of the first dynamic tree change, and the number of Shrubs nodes in the first dynamic tree changes.
6. The signature key management method according to claim 1, characterized in that, The condition for increasing the target tree capacity is that the difference between the value of the target tree capacity flag and the target tree capacity is less than a preset target tree capacity difference.
7. The signature key management method according to any one of claims 1 to 6, characterized in that, The step of verifying the message signature pair using the target signature based on the target dynamic tree includes: Using the first verification algorithm, based on the public key in the target signature, the first parameter verification is performed on the target message in the message signature pair and the first signature parameter in the target signature to obtain the first verification result; If the first verification result indicates that the target signature passes the first parameter verification, then the second verification algorithm is used to perform second parameter verification on the second target parameter in the target signature based on the target public key of the target dynamic tree and the primary public key, so as to obtain the second verification result.
8. A signature key management device, characterized in that, include: The message signing module is used to obtain a target message, generate a primary key pair using the target security parameters, and sign the target message using the primary private key in the primary key pair to obtain the first signature parameter; The first dynamic tree update module is used to store the public key in the key pair using the leaf nodes of the current first dynamic tree to obtain a new first dynamic tree and update the value of the data counter. The second dynamic tree update module is used to update the second dynamic tree to obtain a new second dynamic tree when the Shrubs nodes of the first dynamic tree change, and to update the target tree capacity flag when the number of Shrubs nodes changes, so as to update the target dynamic tree based on the new first dynamic tree and the new second dynamic tree; wherein, the target dynamic tree is a dynamic tree constructed based on the first dynamic tree and the second dynamic tree, and the target tree capacity flag is used to determine whether the target tree capacity of the current second dynamic tree meets the target tree capacity increase condition. If it does, the target tree level of the second dynamic tree is increased and the target tree capacity is updated; the target tree capacity is the number of leaf nodes of the second dynamic tree. The signature verification module is used to update the target private key based on the current target dynamic tree and determine the second signature parameter, determine the target signature based on the first signature parameter, the second signature parameter and the primary public key, and determine the message signature pair based on the target message and the target signature, so as to verify the message signature pair using the target signature based on the target dynamic tree; the target private key is generated based on the trapdoor key of the target dynamic tree; The security parameters corresponding to the trapdoor key and the hash key of the target dynamic tree are consistent with the target security parameters; the first dynamic tree is a dynamic Shrubs tree, the second dynamic tree is a dynamic Shrubs node authentication tree, the leaf nodes of the second dynamic tree are chameleon hash nodes, and the messages corresponding to the leaf nodes of the second dynamic tree correspond to the hash values of the Shrubs nodes of the first dynamic tree; the second signature parameter includes the authentication path and index of the primary public key in the target dynamic tree.
9. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor for executing the computer program to implement the signature key management method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, Used to store a computer program, wherein the computer program, when executed by a processor, implements the signature key management method as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Improved CAT-based cloud-side cooperative power terminal acquisition data integrity verification system
CN113312652A
Tree-based document batch signature and signature verification method and system
CN114781007A