TPM external key revocation system based on MPT tree
By adopting a key management system with an MPT tree structure in TPM, the problems of low efficiency and insufficient storage space in TPM external key revocation are solved, and efficient key management and storage security are achieved.
Patent Information
- Application Number
- CN202411518898.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-29
- Publication Date
- 2025-02-25
AI Technical Summary
In the prior art, in TPM external key revocation, there are problems such as low data retrieval and update efficiency, low information storage in tree structure, and limited internal storage space of TPM.
The TPM external key revocation system based on the MPT tree is adopted. By storing the root node of the MPT tree within the TPM and storing other nodes of the MPT tree externally, the efficient search, insertion and revocation of keys is achieved.
It improves the efficiency of key update and revocation in TPM, reduces operation complexity, and ensures the storage security of data and external keys through rollback mechanism.
Smart Images

Figure CN119519944A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of information security, and in particular relates to a TPM external key revocation system based on an MPT tree. Background Art
[0002] Trusted Platform Module (TPM) is an industry-recognized key protection solution that integrates keys and encryption and decryption engines to provide hardware-based secure storage of sensitive information. With the development of trusted computing, most commercial computers have TPM, and mainstream operating systems also support TPM functions.
[0003] The internal storage space of TPM is limited. Most of the generated keys are not stored in the relatively secure TPM, but are encrypted by the parent key and then stored in the external storage space. They are not completely controlled by TPM. The TPM1.2 and TPM2.0 specifications do not provide commands to revoke a single invalid key, but only provide commands to revoke all keys. If the invalid key is not revoked, an attacker may load it into the TPM for use, which will bring security risks.
[0004] Existing research has built an external key management structure based on the Chameleon Hash tree and the Merkle tree to solve the problem of revoking a single invalid key. However, these two structures have low efficiency in data retrieval and update, and the tree structure has a small amount of information storage. When the tree structure is destroyed or deleted, it is difficult to recover the data.
[0005] The method of constructing a prefix tree in the prior art is inefficient in direct search and may also cause a large waste of space. If there is a node with a very long key value, when there are no other branches with the same prefix in the tree, in order to store the node, many non-leaf nodes need to be created to construct the path from the root node to the node, resulting in a waste of storage space; the Merkle tree also has a relatively large storage space overhead. Summary of the invention
[0006] The present invention provides a TPM external key revocation system based on an MPT tree, which is used to solve the technical problems of low data retrieval and update efficiency, small amount of tree structure storage information and limited TPM internal storage space in the revocation of a single invalid key.
[0007] The present invention provides a TPM external key revocation system based on an MPT tree, comprising:
[0008] A key linking node inside the TPM, wherein the key linking node is used to link the newly generated key of the TPM to the leaf node of the MPT tree to calculate the hash value of the key, and to transmit the relevant node value to be updated in the MPT tree out of the TPM, wherein the root node of the MPT tree is stored inside the TPM for verifying the validity of the key; and
[0009] The node processing part is used to issue requests for three key-related operations and perform preprocessing, read nodes of the MPT tree from node-related files according to the requests, and write nodes into node-related files;
[0010] The TPM external key revocation method based on the system is specifically as follows:
[0011] Search operation: First, the key to be searched is calculated by the Keccak-256 algorithm to obtain a 32-byte compressed key, and the last 20 bytes of the compressed key are used as the search path key; starting from the root node, a path that is consistent with the search path key content is searched to find the key;
[0012] Insertion operation: Based on the completion of the search operation, if the key prefix of the newly inserted key is the same as the root node, then at the branch node below the root node, if it is found that the key of the newly inserted key shares the longest prefix with the key in the original MPT tree, an extension node with the value corresponding to the prefix is created, and then a branch node is created under this extension node;
[0013] Undo operation: Based on the completion of the search operation, after the key is found through the search operation, the node hash value of the accompanying field at the node where the key is located is set to NULL, and the dirty flag is set to 1, which means that the undo is successful.
[0014] Furthermore, the system further comprises:
[0015] At the node transmission part in the TPM software stack, the transmission node transmits the data between the key link node and the processing node.
[0016] Furthermore, the data items transmitted to the MPT interface in the MPT tree are: (key, value), wherein key refers to the last twenty bytes of a 32-byte compressed key obtained by calculating the key using the Keccak-256 algorithm, and value refers to the value obtained by encrypting the key using the AES encryption algorithm and then calculating it using the SHA-256 hash algorithm.
[0017] Furthermore, there are four types of nodes in the MPT tree: empty nodes, branch nodes, leaf nodes, and extension nodes; and each node definition has an accompanying field that records the node hash value, dirty flag, and birth flag.
[0018] The TPM external key revocation system based on the MPT tree of the present application realizes the TPM external key revocation based on the MPT tree. The constructed MPT tree adds several different types of tree nodes (empty nodes, branch nodes, leaf nodes, and extended nodes), compresses the overall tree height as much as possible, reduces the complexity of the operation, and thus greatly improves the efficiency of the key update and revocation in the TPM. In addition, the rollback mechanism of the MPT tree effectively guarantees the storage security of data and external keys. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the technical solutions of 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 some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0020] Figure 1 A schematic diagram of a TPM external key revocation system based on an MPT tree provided by an embodiment of the present invention;
[0021] Figure 2 A schematic diagram of a preliminarily constructed MPT tree is provided for an embodiment of the present invention;
[0022] Figure 3 A schematic diagram of an MPT tree after adding a new node according to a specific embodiment of the present invention. DETAILED DESCRIPTION
[0023] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0024] Reference Figure 1 , a TPM external key revocation system based on the MPT tree, including the key linking part inside the TPM, the node transmission part in the TPM software stack (TSS layer), the node processing part in the application layer, and the node-related files stored externally;
[0025] The key linking part is responsible for linking the newly generated key of the TPM to the leaf node of the MPT tree to calculate the hash value of the key and transmit the relevant node value to be updated in the MPT tree out of the TPM; storing the root node of the MPT tree inside the TPM for verifying the validity of the key;
[0026] The TPM software stack is responsible for data transmission and analysis between the key link and the node processing.
[0027] The node processing unit is responsible for issuing requests for three key-related operations and performing preprocessing; reading nodes of the MPT tree from node-related files according to the requests and writing the nodes into node-related files.
[0028] The data items in the MPT tree that are passed into the MPT interface are: (key, value). Among them, key refers to the last twenty bytes of a 32-byte compressed key obtained by calculating the key through the Keccak-256 algorithm. Value refers to the hash value of the key calculated by the hash function SHA256. The key of the data item is then encoded in the path of the MPT tree; there are four types of nodes in the MPT tree constructed to store keys: empty nodes, branch nodes, leaf nodes, and extension nodes. At the same time, each node definition has an accompanying field (nodeFlag) to record the node hash value, dirty flag, and birth flag. The present invention provides three operations for keys: search, insert, and revoke.
[0029] An example is used to illustrate the construction process of the MPT tree (Merkle Patricia tree). Assume that there are three keys, and the data items passed into the MPT interface are: key 1 (a711355612, value1), key 2 (a77d337521, value2), and key 3 (a7f9365221, value3). The first item in the brackets is the last twenty bytes of a 32-byte compressed key calculated by the Keccak-256 algorithm for the corresponding key, and the second item is the hash value calculated by the hash function SHA256 for the key. In order to show the structure of the MPT tree, the specific values are written in detail. The MPT tree obtained by storing the three keys in sequence is shown in the attached figure. Figure 2 shown.
[0030] The TPM external key revocation method based on the MPT tree includes:
[0031] Search operation: First, use the Keccak-256 algorithm to calculate a 32-byte compressed key of the key to be searched, and use the last twenty bytes of the compressed key as the search path key. Start searching from the root node for a path that is consistent with the search path key content. For example, when searching for key 1, the first two digits of the search path key of key 1 are consistent with the root node 'a7'. Continue to search downwards and find that it is consistent with '1' of the next branch node. Then continue to search downwards under this branch node and compare the content to find key 1.
[0032] The insertion operation is completed based on the search operation. For example, based on the above MPT tree, a data item of key 4 (a77d397221, value4) is inserted. The key prefix of the newly inserted key 4 and the root node are both 'a7'. At the branch node '7' below it, it is found that the key of the newly inserted key 4 shares the longest prefix 'd3' with the key 2 in the original MPT tree, so an extension node with value 'd3' is created, and then a branch node is created under this extension node. Since the remaining digits of the search path key of key 2 and the newly inserted key 4 are both greater than 1, a leaf node is created for '3' and '9' under this branch node and the two values are stored in the value of the corresponding node. The result is as follows: Figure 3 As shown;
[0033] The revocation operation is also completed based on the search operation. For example, to revoke key 4, after finding key 4 through the search operation, the node hash value of the accompanying field (nodeFlag) at the node of key 4 is set to NULL, and the dirty flag is set to 1, which means the revocation is successful.
[0034] The key check tree recovery algorithm that effectively ensures the storage security of data and external keys is described as follows:
[0035] enter:
[0036] damaged-tree: damaged MPT tree;
[0037] backup-tree: a copy of the undamaged MPT tree;
[0038] key-value-pairs: a list of key copies, each element of which is a key-value pair (key, value);
[0039] Output:
[0040] Repaired MPT tree
[0041] Recovery algorithm pseudo code:
[0042] Function restore-mpt-tree(damaged-tree, backup-tree, key-value-pairs)
[0043] {
[0044] Set damaged-node to the root node of damaged-tree;
[0045] Set backup-node to the root node of backup_tree;
[0046] Traverse each character char in key
[0047] {
[0048] If char is not in the child nodes of damaged-node:
[0049] Find the corresponding child node in backup-node;
[0050] Copy the child nodes of backup-node to damaged-node;
[0051] Move damaged-node to the child node corresponding to char;
[0052] Move backup-node to the child node corresponding to char;
[0053] }
[0054] Set the value of damaged-node to value;
[0055] Returns the repaired damaged-tree;
[0056] }.
[0057] In summary, in this embodiment, the storage security of data and external keys is effectively guaranteed by utilizing the rollback mechanism of the MPT tree (i.e., the recovery scheme of the key verification tree). Specifically, the MPT tree has the characteristics of a dictionary tree, and the storage path of each key is fixed. This means that even if an attacker destroys part or all of the MPT tree managed by the external key, the key holder can easily restore the original key management tree by using only the retained key copy.
[0058] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A TPM external key revocation system based on MPT tree, characterized in that: include: A key linking node inside the TPM, wherein the key linking node is used to link the newly generated key of the TPM to the leaf node of the MPT tree to calculate the hash value of the key, and to transmit the relevant node value to be updated in the MPT tree out of the TPM, wherein the root node of the MPT tree is stored inside the TPM for verifying the validity of the key; and The node processing part is used to issue requests for three key-related operations and perform preprocessing, read nodes of the MPT tree from node-related files according to the requests, and write nodes into node-related files; The TPM external key revocation method based on the system is specifically as follows: Search operation: First, the key to be searched is calculated by the Keccak-256 algorithm to obtain a 32-byte compressed key, and the last 20 bytes of the compressed key are used as the search path key; starting from the root node, a path that is consistent with the search path key content is searched to find the key; Insertion operation: Based on the completion of the search operation, if the key prefix of the newly inserted key is the same as the root node, then at the branch node below the root node, if it is found that the key of the newly inserted key shares the longest prefix with the key in the original MPT tree, an extension node with the value corresponding to the prefix is created, and then a branch node is created under this extension node; Undo operation: Based on the completion of the search operation, after the key is found through the search operation, the node hash value of the accompanying field at the node where the key is located is set to NULL, and the dirty flag is set to 1, which means that the undo is successful.
2. A TPM external key revocation system based on MPT tree according to claim 1, characterized in that: The system further comprises: At the node transmission part in the TPM software stack, the transmission node transmits the data between the key link node and the processing node.
3. A TPM external key revocation system based on MPT tree according to claim 1, characterized in that: The data items transmitted to the MPT interface in the MPT tree are: (key, value), where key refers to the last twenty bytes of a 32-byte compressed key calculated by the Keccak-256 algorithm, and value refers to the value obtained by encrypting the key with the AES encryption algorithm and then calculating it with the SHA-256 hash algorithm.
4. A TPM external key revocation system based on MPT tree according to claim 1, characterized in that: There are four types of nodes in the MPT tree: empty nodes, branch nodes, leaf nodes, and extended nodes; at the same time, each node definition has an accompanying field to record the node hash value, dirty flag, and birth flag.
Citation Information
Patent Citations
TPM external key revocation system and method based on MPT tree
CN117879817A
Multi-party broadcast encryption method, device and equipment based on MPT tree
CN118764196A