A time-controlled fine-grained traceability method for large-scale supply chain data

By adopting the aggregate access control tree method and dynamic update access strategy in the blockchain traceability system, time-controlled fine-grained access control is realized, solving the problem of data security and access policy update in the existing technology, and improving the system's Performance and reliability.

CN119272313BActive Publication Date: 2025-02-25NANJING UNIV OF POSTS & TELECOMM
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202411804884.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-10
Publication Date
2025-02-25
Estimated Expiration
2044-12-10

AI Technical Summary

Technical Problem

The prior art is difficult to implement time-controlled fine-grained access control in blockchain traceability systems, making it difficult to achieve dynamic updates of data security and access policies.

Method used

The aggregated access control tree method is used to encrypt user data, and the access permission control in the time dimension is realized through dynamic update of access policies and blockchain timestamp verification.

Benefits of technology

It realizes fine-grained access control, ensures the privacy and security of data, and supports dynamic updates of access policies, improving system performance and reliability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119272313B_ABST
    Figure CN119272313B_ABST
Patent Text Reader

Abstract

The present invention discloses a time-controlled fine-grained traceability method for large-scale supply chain data, which belongs to the technical field of fine-grained traceability processing; including: building a large-scale supply system; initializing, generating public parameters and master keys; encrypting user data; tracing the encrypted user data; decrypting user data; obtaining data. The present invention adopts an aggregated access control tree method, including all attribute nodes of the user, adopts a basic access strategy, and implements fine-grained access control according to different user attributes, effectively solving the increased amount of calculation in the encryption and decryption process; controls the timeliness of user permissions by dynamically updating access strategies, and uses smart contracts and blockchain timestamp verification to ensure the fairness and non-tamperability of access control, solves the problem of access control for different identities, implements access authority control in the time dimension, and ensures the privacy and security of data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of fine-grained traceability processing, and in particular relates to a time-controlled fine-grained traceability method for large-scale supply chain data. Background Art

[0002] The traceability application of blockchain technology has expanded to multiple fields. In addition to digital currency, some other technologies also play an important role in improving data traceability and system security. First, smart contracts automatically execute preset rules to ensure that every link of the product from production to sales is effectively verified and recorded. It eliminates the need for intermediaries and enhances the transparency and efficiency of the supply chain. Secondly, decentralized identity (DID) provides an effective identity authentication method for blockchain traceability, ensuring that the operations of each participant on the chain are traceable, thereby improving the credibility of the system. In addition, the combination of the Internet of Things and blockchain can record and upload product status data in real time, ensuring the transparency and traceability of products at every link in the supply chain. Although the above technologies are more important in the blockchain traceability system, encryption technology is still a prerequisite for ensuring data security. Blockchain uses encryption technology to ensure the immutability of data and the privacy protection of participants, ensuring the security and authenticity of traceability data.

[0003] Ciphertext-based attribute-based encryption (CP-ABE) can perform fine-grained access control on encrypted data and realize one-to-many data sharing. In recent years, combining blockchain with CP-ABE to achieve more secure and efficient fine-grained data traceability has become a research hotspot.

[0004] At present, it is proposed to use the distributed key management service (KMS) and zero-knowledge paradigm to eliminate the problem of centralized central institutions in the original CP-ABE traceability scheme. In order to solve the problem that structured and descriptive data cannot be obtained during data sharing, the ChainMaker privacy computing system is proposed, which not only ensures data security but also ensures the accuracy of traceability. A CP-ABE-based identity management framework is also proposed to solve the problem of identity information leakage caused by the transparency of blockchain. Combining inner product searchable encryption with CP-ABE, the functions of policy hiding and keyword search are realized, while retaining the permission access control of CP-ABE. However, there are still some problems with the above scheme, and the attribute access permission generation of CP-ABE is not modified. In traditional CP-ABE, users need to generate an access tree as their access policy every time they encrypt data. With the increase of data scale and access policy complexity, this puts higher requirements on system performance and increases the amount of calculation in the encryption and decryption process. At the same time, once the CP-ABE algorithm generates an access policy, it cannot be changed. If you want to change the access policy, you need to re-encrypt the data to generate ciphertext, which will slow down the performance of the traceability system that frequently modifies user permissions.

[0005] The Chinese patent disclosed (application number: 202311181986.2) a supply chain traceability data access control method based on improved multi-authorization CP-ABE. The core of this method is to use the CP-ABE encryption algorithm to embed the access policy defined by the data owner into the ciphertext. Only users whose attribute sets meet the access policy can decrypt and obtain the data. The access policy is represented by the LSSS matrix. In order to improve efficiency and security, this method adopts a multi-authorization center architecture, allowing multiple attribute authorization centers to collaboratively generate attribute keys for users, and using the Hyperledger Fabric blockchain platform to store ciphertext and access policy update records. This method effectively solves the single-point performance bottleneck and attribute key distribution efficiency problems, and realizes the timely update of access policies.

[0006] The Chinese patent disclosed (application number: 202310499597.8) a blockchain-based access control system, which realizes transparent management of user identity information, dynamic management of nodes and data, inspection and analysis control of traceability data, and statistical processing of access records by applying blockchain technology to traceability access control. Specifically, the system performs identity authentication and authority management for different types of users, such as suppliers, manufacturers, logistics companies, regulatory authorities, and consumers, to ensure that only authorized users can access and operate data. At the same time, the system uses the decentralized and tamper-proof characteristics of blockchain to ensure the security and reliability of traceability data, making the entire circulation process of the product traceable and the responsible party easy to locate, effectively improving traceability efficiency and user satisfaction.

[0007] The Chinese patent discloses (application number: 202410771147.4) a data traceability method, device and equipment. The method first determines the type of traceability task according to the traceability task request, including data-level traceability and record-level traceability; then, the traceability data to be traced is initialized according to the traceability task type to form an initialized traceability link; then, the traceability header data at this level is accessed and its upper-level traceability header metadata is extracted in turn to form a traceability link node, and the node is added to the traceability link; finally, according to the traceability task type and the traceability link node information, the updated traceability header data at this level is determined until all traceability headers are accessed to form a complete traceability link; this method realizes traceability at two granularities, data level and record level, by recording the key processing clues and related information in the data processing process, and ensures the reliability and credibility of the traceability link by verifying the integrity of the traceability header data and the traceability clue data.

[0008] The patent application based on the improved multi-authorization CP-ABE supply chain traceability data access control method has the following deficiencies:

[0009] 1. Although this method uses multiple key authorization centers to eliminate the centralization problem of the key center, it still requires generating an LSSS matrix corresponding to its access policy for each encryption;

[0010] 2. The access policy of the data encrypted by this method cannot be updated dynamically. If you want to change the access policy, you need to re-encrypt the data.

[0011] Patent applications for blockchain-based access control systems have the following shortcomings:

[0012] 1. Although this solution implements access control management, it cannot achieve fine-grained access control. It can only perform access control management according to hierarchical permissions, and cannot manage according to attributes;

[0013] 2. This solution cannot implement dynamic access control management, and once the access policy is determined, it cannot be changed.

[0014] A patent for a data tracing method, device and equipment has the following deficiencies:

[0015] Although this solution implements fine-grained traceability and divides traceability requests into data-level traceability and record-level traceability, it still does not provide an access control method and cannot ensure data security.

[0016] To sum up, how to solve the time control mechanism and fine-grained traceability problems for different identities and realize access permission control in the time dimension. Summary of the invention

[0017] The purpose of the present invention is to provide a time-controlled fine-grained traceability method for large-scale supply chain data to solve the problems raised in the above background technology.

[0018] The object of the present invention is achieved by: a time-controlled fine-grained traceability method for large-scale supply chain data, characterized in that the method comprises the following steps:

[0019] Step S1: Building a large-scale supply system;

[0020] The large-scale supply system includes data owners, data users, blockchain, database, authority, traceability platform and attribute authorization center;

[0021] Step S2: Initialize the large-scale provisioning system and generate public parameters and master keys;

[0022] Step S3: Generate a user key;

[0023] Step S4: using an aggregated access control tree method to encrypt user data;

[0024] Step S5: tracing the encrypted user data;

[0025] Step S6: decrypt the user data;

[0026] Use dynamically updated access policies to control user permissions and decrypt for ordinary users;

[0027] Use timestamp verification method to control and supervise user permissions;

[0028] Step S7: Obtain data.

[0029] Preferably, the data owner is a completely trusted individual, and according to the access structure set by the owner, the data uploaded to the blockchain is encrypted using CP-ABE, and the encrypted data is transported to the blockchain and the database and stored;

[0030] Data users are untrusted individuals and need to submit a registration application to an authority before using the data. When the data owner wants to obtain the data, he will initiate a request to the traceability platform. After obtaining the data returned by the traceability platform, CP-ABE will be used to decrypt it. If the attributes meet the access policy initially set by the data owner, the data can be successfully decrypted. Otherwise, it cannot be decrypted.

[0031] The blockchain is used to store transaction data uploaded by the data owner on the chain, and the database stores the data on the chain in the database off the chain;

[0032] The authority generates the corresponding user key based on the attributes provided by the data user;

[0033] When the traceability platform receives a request from a data user, it obtains data from the off-chain database, processes it, and returns it to the data user;

[0034] The Attribute Authorization Center is responsible for managing and issuing attribute certificates to ensure the legitimacy and accuracy of user attributes. The Attribute Authorization Center works in collaboration with authoritative agencies to provide reliable attribute certificates for data users.

[0035] Preferably, in step S2, the large-scale supply system is initialized to generate public parameters and a master key, specifically:

[0036] Assume that Zr represents the group of integers from 0 to p-1, and p is a large prime number, is a group of order p, for Generators of; select two fixed elements from the Zr group and , calculate the following values:

[0037] ;

[0038] Among them, the bilinear map ; The ciphertext used to generate the public key part; is the group where the mapping result belongs;

[0039] And design a hash function ;

[0040] Returns the master private key MSK and the master public key PK:

[0041] ;

[0042] ;

[0043] in, To generate the ciphertext of the public key, for The reverse operation is used to process the decryption logic; To generate the secret parameters of the public key, is the secret parameter of the key in the encryption process, For the bilinear pairing result, the bilinear pairing result is improved to Power; Generator of The exponent term used to generate the elements in the key pair.

[0044] Preferably, the user key is generated in step S3, specifically:

[0045] Suppose the attribute set of the large-scale supply system is , node combination of all attributes in large-scale supply system ,remember , Corresponds to , for each attribute , generate another random number from the Zr group , the following values ​​are calculated:

[0046] ;

[0047] ;

[0048] ;

[0049] in, is a value generated based on the master private key MSK. To set the attribute The hash calculation result and the random number The calculation results are: is a random number With generator The result of the operation is is the hash calculation function, is the result of the operation of the random number r and the generator g;

[0050] The private key SK is obtained as:

[0051] ;

[0052] in, is the public part of the private key, is the private key portion associated with the attribute, is the auxiliary encryption part related to the attribute, is the user's attribute, and .

[0053] Preferably, the aggregated access control tree method is to divide the nodes of the access control tree into three layers of nodes, the first layer is the basic access policy node, denoted as B, which is used to control the basic access policy, and only those who meet the policy have the authority to view the subsequent content;

[0054] The second layer is the enterprise type name, which represents the different types of enterprises involved in the commodity circulation of the entire traceability system, recorded as , is the number of enterprise types;

[0055] The third layer is the name of the specific enterprise, recorded as ;in, for The specific company name under the enterprise type is And so on. , for the enterprise type The specific company names under Let the total number of nodes in the third layer be m, and we get 1+k+m=n, where n is the total number of nodes in the whole tree;

[0056] Assume that the user sets the access permission to ,in Indicates The first Enterprises, Indicates The first If there are multiple enterprises, the system will automatically match the logical expression of the access control tree as follows:

[0057] ;

[0058] in, , is the specific number of enterprises under the corresponding enterprise type, and B is the basic access strategy; Indicates Type of enterprise, Indicates Type of enterprise.

[0059] Preferably, in step S4, an aggregated access control tree method is used to encrypt user data, specifically:

[0060] A three-layer access control tree structure is used, and recursive polynomial calculation is used to ensure fine-grained access control, where the secret value of each layer is obtained through the polynomial calculation of the previous layer and used for ciphertext generation;

[0061] First calculate the parameters , the calculation formula is as follows:

[0062] ;

[0063] Then calculate the ciphertext, which consists of two parts:

[0064] ;

[0065] ;

[0066] in, is the secret value of the root node, It is the first part of the ciphertext, used to encrypt the message itself; The second part of the ciphertext is used to verify the integrity and correctness of the ciphertext; For plain text, It is the result of bilinear mapping and is an important part of access control. The plaintext M is mapped to the group through hashing and bilinear operations superior; To generate the ciphertext and root node secret value of the public key The result of the operation; g is the generator; is the result obtained by hashing the plaintext M; The ciphertext used to generate the public key part;

[0067] Basic Access Policy Node Polynomial The value of, that is:

[0068] ;

[0069] The root node's secret value s will be the polynomial The constant term is used to recursively generate the secret value of the child node;

[0070] For each node, the polynomial of the node has an order d, that is, the polynomial of the node is expressed as:

[0071] ;

[0072] in, is the secret value of the node, is randomly generated in the Zr group, is the independent variable of the polynomial function;

[0073] The secret value of the second layer node, i.e. the enterprise type node, is obtained by the root node polynomial The calculation results in:

[0074] Assume that the attributes of the second layer nodes are , through the hash function Calculate the secret value of the node ,Right now:

[0075] ;

[0076] Secret value of the second layer node The ciphertext part will be used to calculate the second-layer nodes and used as the input of the third-layer nodes to recursively generate leaf nodes;

[0077] In the third layer of nodes, each leaf node has an attribute The secret value of a leaf node is determined by its parent node polynomial The specific formula is as follows:

[0078] ;

[0079] When the attribute of a node meets the access policy, the relevant ciphertext of the attribute is calculated:

[0080] ;

[0081] ;

[0082] in, It is the secret value of the third-layer node, ensuring that only attributes that meet the policy requirements can be processed correctly. is the calculation result of the generator and node secret value, The properties of the node The hash operation result of Right now The hash operation result of and the operation result of the node secret value;

[0083] The access expiration time Time of the ciphertext is designed, that is, the supervisor will not be able to access the data after the expiration time. The entire ciphertext CT structure is calculated as follows:

[0084] ;

[0085] in, To access the secret value of a tree node, To store the ciphertext part related to each user attribute value; A collection of aggregate access tree nodes required for the current encryption algorithm.

[0086] Preferably, in step S5, the encrypted user data is traced back to its source, specifically:

[0087] First, all ciphertext data is obtained from the blockchain and off-chain database. All ciphertext that meets the requirements of the traceability initiator and receiver passed in by the user is sent to the user. The user decrypts it using his own private key. If the attributes meet the requirements of the data owner, the decryption can be successful. If not, the corresponding plaintext cannot be obtained.

[0088] Preferably, the user data is decrypted in step S6, specifically:

[0089] Step S6-1: confirm whether the user is a supervisor. If the user is a supervisor, directly perform time judgment without checking the attribute judgment. If the time does not exceed the expiration time, access is allowed, otherwise access is denied.

[0090] Step S6-2: Get the user attribute set in the SK private key And determine whether the ciphertext access policy is satisfied, if not, return directly, if satisfied, execute step S6-3 to decrypt the access tree node;

[0091] Step S6-3: Starting from the root node, calculate each ciphertext access policy:

[0092] Let node z be one of the ciphertext access policy nodes, then the decrypted value of the node is recorded as :

[0093] ;

[0094] in, is the private key part related to the attribute of node z, The auxiliary encryption part related to the attribute of node z, To access a node in the tree The result of the operation on the secret value, To access a node in the tree Stores the ciphertext part related to the user attribute value;

[0095] When all ciphertext access policy nodes are calculated, the final result is obtained. :

[0096] ;

[0097] Finally decrypted to get the plaintext :

[0098] ;

[0099] in, is the first part of the ciphertext, is the second part of the ciphertext, for and The result of the bilinear map.

[0100] Compared with the prior art, the present invention has the following improvements and advantages:

[0101] 1. By adopting the aggregated access control tree method, all attribute nodes of the user are included, and basic access strategies are adopted to implement fine-grained access control according to different user attributes, effectively solving the increased computational complexity during encryption and decryption.

[0102] 2. Control the timeliness of user permissions by dynamically updating access policies, use smart contracts and blockchain timestamp verification to ensure the fairness and immutability of access control, solve access control problems for different identities, implement access permission control in the time dimension, and ensure data privacy and security. BRIEF DESCRIPTION OF THE DRAWINGS

[0103] Figure 1 Flow chart of the method of the present invention.

[0104] Figure 2 This is a flow chart of the large-scale supply system framework of the present invention.

[0105] Figure 3 This is a schematic diagram of the aggregated access control tree structure in the present invention.

[0106] Figure 4 This is a data initialization flow chart of the present invention.

[0107] Figure 5 It is a flow chart of the traceability process in the present invention.

[0108] Figure 6 It is a structural diagram of the time-controlled mechanism for different identities in the present invention.

[0109] Figure 7 This is a diagram showing how tree generation time changes with the number of nodes.

[0110] Figure 8 This is a schematic diagram of the response time effects of three types of cross-layer traceability for different enterprise categories.

[0111] Fig. 9 This is a comparison chart of the total encryption time versus the number of attributes.

[0112] Fig.10 This is a comparison chart of the total encryption time versus the number of ciphertexts. DETAILED DESCRIPTION

[0113] The present invention is further summarized below with reference to the accompanying drawings.

[0114] like Figure 1 As shown, a time-controlled fine-grained traceability method for large-scale supply chain data includes the following steps:

[0115] Step S1: Building a large-scale supply system;

[0116] like Figure 2 As shown, the large-scale supply system includes data owners, data users, blockchain, database, authority, traceability platform and attribute authorization center;

[0117] The data owner is a fully trusted individual. According to the access structure set by the owner, the data uploaded to the blockchain is encrypted by CP-ABE. The encrypted data is transported to the blockchain and database and stored.

[0118] Data users are untrusted individuals and need to submit a registration application to an authority before using the data. When the data owner wants to obtain the data, he will initiate a request to the traceability platform. After obtaining the data returned by the traceability platform, CP-ABE will be used to decrypt it. If the attributes meet the access policy initially set by the data owner, the data can be successfully decrypted. Otherwise, it cannot be decrypted.

[0119] The blockchain is used to store transaction data uploaded by the data owner on the chain, and the database stores the data on the chain in the database off the chain;

[0120] The authority generates the corresponding user key based on the attributes provided by the data user;

[0121] When the traceability platform receives a request from a data user, it obtains data from the off-chain database, processes it, and returns it to the data user;

[0122] The Attribute Authorization Center is responsible for managing and issuing attribute certificates to ensure the legitimacy and accuracy of user attributes. The Attribute Authorization Center works in collaboration with authoritative agencies to provide reliable attribute certificates for data users.

[0123] Step S2: Initialize the large-scale supply system and generate public parameters and master keys, specifically:

[0124] like Figure 4 As shown, suppose Zr represents the group of integers from 0 to p-1, and p is a large prime number, is a group of order p, for Generators of; select two fixed elements from the Zr group and , calculate the following values:

[0125] ;

[0126] Among them, the bilinear map ; The ciphertext used to generate the public key part; is the group where the mapping result belongs;

[0127] And design a hash function ;

[0128] Returns the master private key MSK and the master public key PK:

[0129] ;

[0130] ;

[0131] in, To generate the ciphertext of the public key, for The reverse operation is used to process the decryption logic; To generate the secret parameters of the public key, is the secret parameter of the key in the encryption process, For the bilinear pairing result, the bilinear pairing result is improved to Power; Generator of The exponent term used to generate the elements in the key pair.

[0132] Step S3: Generate a user key, specifically:

[0133] Suppose the attribute set of the large-scale supply system is , node combination of all attributes in large-scale supply system ,remember , Corresponds to , for each attribute , generate another random number from the Zr group , the following values ​​are calculated:

[0134] ;

[0135] ;

[0136] ;

[0137] in, is a value generated based on the master private key MSK. To set the attribute The hash calculation result and the random number The calculation results are: is a random number With generator The result of the operation is is the hash calculation function, is the result of the operation of the random number r and the generator g;

[0138] The private key SK is obtained as:

[0139] ;

[0140] in, is the public part of the private key, is the private key portion associated with the attribute, is the auxiliary encryption part related to the attribute, is the user's attribute, and .

[0141] Step S4: Encrypt user data using an aggregated access control tree method, specifically:

[0142] The aggregated access control tree method is to divide the nodes of the access control tree into three layers of nodes. The first layer is the basic access policy node, denoted as B, which is used to control the basic access policy. Only those who meet the policy have the authority to view the subsequent content.

[0143] The second layer is the enterprise type name, which represents the different types of enterprises involved in the commodity circulation of the entire traceability system, recorded as , is the number of enterprise types;

[0144] The third layer is the name of the specific enterprise, recorded as ;in, for The specific company name under the enterprise type is And so on. , for the enterprise type The specific company names under Let the total number of nodes in the third layer be m, and we get 1+k+m=n, where n is the total number of nodes in the whole tree;

[0145] Assume that the user sets the access permission to , Indicates The first Enterprises, Indicates The first If there are multiple enterprises, the system will automatically match the logical expression of the access control tree as follows:

[0146] ;

[0147] in, , is the specific number of enterprises under the corresponding enterprise type, and B is the basic access strategy; Indicates Type of enterprise, Indicates Type of enterprise.

[0148] like Figure 3 As shown, there are four types of enterprises involved, namely enterprise type A, enterprise type B, enterprise type C, enterprise type D, etc. Enterprise type A includes enterprise A1, enterprise A2, etc., and the same applies to other enterprises.

[0149] A three-layer access control tree structure is used, and recursive polynomial calculation is used to ensure fine-grained access control, where the secret value of each layer is obtained through the polynomial calculation of the previous layer and used for ciphertext generation;

[0150] First calculate the parameters , the calculation formula is as follows:

[0151] ;

[0152] Then calculate the ciphertext, which consists of two parts:

[0153] ;

[0154] ;

[0155] in, is the secret value of the root node, It is the first part of the ciphertext, used to encrypt the message itself; The second part of the ciphertext is used to verify the integrity and correctness of the ciphertext; For plain text, It is the result of bilinear mapping and is an important part of access control. The plaintext M is mapped to the group through hashing and bilinear operations superior; To generate the ciphertext and root node secret value of the public key The result of the operation; g is the generator; is the result obtained by hashing the plaintext M; The ciphertext used to generate the public key part;

[0156] Basic Access Policy Node Polynomial The value of, that is:

[0157] ;

[0158] The root node's secret value s will be the polynomial The constant term is used to recursively generate the secret value of the child node;

[0159] For each node, the polynomial of the node has an order d, that is, the polynomial of the node is expressed as:

[0160] ;

[0161] in, is the secret value of the node, is randomly generated in the Zr group, is the independent variable of the polynomial function;

[0162] The secret value of the second layer node, i.e. the enterprise type node, is obtained by the root node polynomial The calculation results in:

[0163] Assume that the attributes of the second layer nodes are , through the hash function Calculate the secret value of the node ,Right now:

[0164] ;

[0165] Secret value of the second layer node The ciphertext part will be used to calculate the second-layer nodes and used as the input of the third-layer nodes to recursively generate leaf nodes;

[0166] In the third layer of nodes, each leaf node has an attribute The secret value of a leaf node is determined by its parent node polynomial The specific formula is as follows:

[0167] ;

[0168] When the attribute of a node meets the access policy, the relevant ciphertext of the attribute is calculated:

[0169] ;

[0170] ;

[0171] in, It is the secret value of the third-layer node, ensuring that only attributes that meet the policy requirements can be processed correctly. is the calculation result of the generator and node secret value, The properties of the node The hash operation result of Right now The hash operation result of and the operation result of the node secret value;

[0172] The access expiration time Time of the ciphertext is designed, that is, the supervisor will not be able to access the data after the expiration time. The entire ciphertext CT structure is calculated as follows:

[0173] ;

[0174] in, To access the secret value of a tree node, To store the ciphertext part related to each user attribute value; A collection of aggregate access tree nodes required for the current encryption algorithm.

[0175] Step S5: Tracing the encrypted user data, specifically:

[0176] like Figure 5 As shown in the figure, the data traceability part includes three entities, namely data users, traceability platform, and database: first, all ciphertext data is obtained from the blockchain and the off-chain database, and all satisfied ciphertexts are sent to the user according to the traceability initiator and receiver requirements passed in by the user. The user decrypts according to his own private key. If the attributes meet the requirements of the data owner, it can be successfully decrypted. If not, the corresponding plaintext cannot be obtained.

[0177] In order to facilitate the traceability process on the traceability platform, the encrypted data returned to the traceability platform contains three parts, including the initiating company ciphertext, the receiving company ciphertext and the ciphertext data. The initiating and receiving companies are used for data traceability, and the ciphertext data is the only part returned to the user.

[0178] In the traceability system, it is necessary to set up supervisory users to supervise the compliance of data to ensure that the traced data is authentic, reliable, safe and compliant;

[0179] Supervisory users will be verified based on access timeliness to ensure that users can access data within the specified time window; once the validity period is exceeded, the system automatically revokes the relevant attributes and denies access; to implement this mechanism, the access time window and attribute access tree are combined to control the timeliness of user permissions by dynamically updating access policies; the mechanism uses smart contracts and blockchain timestamp verification to ensure the fairness and immutability of access control, and adopts an incremental update strategy to optimize system performance.

[0180] like Figure 6 As shown in the figure, the following will introduce fine-grained access control from the perspectives of ordinary users and supervisory users:

[0181] Ordinary users:

[0182] The access rights of ordinary users are based on their attributes. Only when their attributes meet the encryption policy can they access the corresponding data; time limits are not effective for ordinary users.

[0183] Assume that there is a supply chain in the system as follows: Enterprise A1->Enterprise B2->Enterprise C1->Enterprise D1. The user of Enterprise D1 has the attributes of Enterprise A1, Enterprise C1, and Enterprise D1. Now if the user wants to view the data in the entire traceability chain, he can only obtain access to the data of Enterprise C1->Enterprise D1. If the user tries to access other data, the system will return a null value. No matter how long the data of Enterprise C1->Enterprise D1 was generated, the user can access the data at any time without time constraints.

[0184] Regulatory Users:

[0185] Regulatory users are a special type of user who will not appear in the designed aggregate access tree. Instead, they have the attributes of all participants in the system, which means that they can view any data. The access rights of regulatory users are subject to time restrictions. By default, regulatory users only have access rights within one month after the data is generated. After more than one month, the system will automatically revoke their access rights to prevent regulatory users from continuing to view data after the timeout.

[0186] Step S6: Decrypt the user data, specifically:

[0187] Step S6-1: confirm whether the user is a supervisor. If the user is a supervisor, directly perform time judgment without checking the attribute judgment. If the time does not exceed the expiration time, access is allowed, otherwise access is denied.

[0188] Step S6-2: Get the user attribute set in the SK private key And determine whether the ciphertext access policy is satisfied, if not, return directly, if satisfied, execute step S6-3 to decrypt the access tree node;

[0189] Step S6-3: Starting from the root node, calculate each ciphertext access policy:

[0190] Let node z be one of the ciphertext access policy nodes, then the decrypted value of the node is recorded as :

[0191] ;

[0192] in, The private key part related to the attribute of node z, The auxiliary encryption part related to the attribute of node z, To access a node in the tree The result of the operation on the secret value, To access a node in the tree Stores the ciphertext part related to the user attribute value;

[0193] When all ciphertext access policy nodes are calculated, the final result is obtained :

[0194] ;

[0195] Finally decrypted to get the plaintext :

[0196] ;

[0197] in, is the first part of the ciphertext, is the second part of the ciphertext, for and The result of the bilinear map.

[0198] In order to verify the feasibility and effectiveness of the present invention, multiple sets of simulation experiments were designed to evaluate the performance of the time-controlled fine-grained traceability method we proposed. The performance was comprehensively evaluated from the aspects of tree generation time, transaction generation time, and traceability response time.

[0199] Experimental configuration:

[0200] It is written in Java and JPBC2.0 is used for experiments. This experiment is conducted on a laptop with Intel i7-13700H 2.4GHz, 16GB memory, and Windows 11 operating system.

[0201] The access control tree method used in the present invention is different from the general access control tree method. The present invention generates all nodes in a whole tree. Since there are many enterprise nodes involved in the traceability system, the time of generating the whole tree is closely related to the total number of nodes involved in the traceability system. Figure 7 As shown in the figure, it shows how the tree generation time changes with the number of nodes. As the number of nodes increases, the time required becomes longer.

[0202] The traceability framework of this invention designs four different enterprise categories, and there are three cross-layer traceability situations. The response time of these three situations is as follows: Figure 8 As shown, as the level increases, the tracing time becomes longer.

[0203] The original intention of designing the access control tree method in this invention is to solve the time-consuming problem caused by generating multiple access trees when encrypting multiple pieces of data. Next, we will compare the impact of data attributes and data quantity on the initialization time of the general CP-ABE and the method of this invention, including the change in the number of ciphertexts and the change in the number of attributes:

[0204] Number of data attributes:

[0205] When comparing the number of data attributes, we encrypt the same data but change the number of its attributes. The initialization time of the two is as follows: Fig. 9 shown; from Fig. 9It can be seen that when encrypting a piece of data, the total encryption time of the original CP-ABE algorithm is significantly shorter than that of the algorithm designed by the present invention, and the total encryption time = tree generation time + encryption time; this is because when encrypting a piece of data, the traditional CP-ABE only needs to generate an access tree corresponding to the access policy corresponding to the segment of data, while the access control tree method designed by the present invention includes all access nodes, so the tree generation time of the present invention is significantly higher than that of the traditional CP-ABE, so the encryption time of the present invention is also slightly longer than that of the traditional CP-ABE.

[0206] Number of encrypted ciphertexts:

[0207] When comparing the number of encrypted ciphertexts, the attribute value of each ciphertext is set to a fixed value (such as 100 attributes), while the number of encrypted ciphertexts changes. The total encryption time of the two is as follows: Fig.10 shown; from Fig.10 It can be seen that both the traditional CP-ABE and the present invention increase or decrease the encryption time as the number of ciphertexts increases, but for the tree generation time, the present invention does not generate any more after the first generation, while the traditional CP-ABE algorithm needs to regenerate a new access tree each time, which leads to the linear growth of the encryption time of the traditional CP-ABE algorithm as the number of ciphertexts changes, while the encryption time of the present invention hardly changes. When only one record is generated, the traditional CP-ABE strategy is faster than the method of the present invention, but as the number of ciphertexts to be encrypted increases, when 6 or more data are encrypted, the scheme of the present invention is lower than the original CP-ABE algorithm.

[0208] The above description is only an embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent substitution, improvement, etc. made within the spirit and principle of the present invention should be included in the scope of the claims of the present invention.

Claims

1. A time-controlled fine-grained traceability method for large-scale supply chain data, characterized by: The method comprises the following steps: Step S1: Building a large-scale supply system; The large-scale supply system includes data owners, data users, blockchain, database, authority, traceability platform and attribute authorization center; Step S2: Initialize the large-scale provisioning system and generate public parameters and a master key; Step S3: Generate a user key; Step S4: using an aggregated access control tree method to encrypt user data; The aggregated access control tree method is to divide the nodes of the access control tree into three layers of nodes. The first layer is the basic access policy node, denoted as B, which is used to control the basic access policy. Only those who meet the policy have the right to view the subsequent content. The second layer is the enterprise type name, which represents the different types of enterprises involved in the commodity circulation of the entire traceability system, recorded as , is the number of enterprise types; The third layer is the name of the specific enterprise, recorded as ;in, for The specific company name under the enterprise type is And so on. , for the enterprise type The specific company names under Let the total number of nodes in the third layer be m, and we get 1+k+m=n, where n is the total number of nodes in the whole tree; Assume that the user sets the access permission to ,in Indicates The first Enterprises, Indicates The first If there are multiple enterprises, the system will automatically match the logical expression of the access control tree as follows: ; in, , is the specific number of enterprises under the corresponding enterprise type, and B is the basic access strategy; Indicates Type of enterprise, Indicates Type of business; The aggregate access control tree method is used to encrypt user data, specifically: A three-layer access control tree structure is used, and recursive polynomial calculation is used to ensure fine-grained access control, where the secret value of each layer is obtained through the polynomial calculation of the previous layer and used for ciphertext generation; First calculate the parameters , the calculation formula is as follows: ; Then calculate the ciphertext, which consists of two parts: ; ; in, is the secret value of the root node, It is the first part of the ciphertext, used to encrypt the message itself; The second part of the ciphertext is used to verify the integrity and correctness of the ciphertext; For plain text, It is the result of bilinear mapping and is an important part of access control. The plaintext M is mapped to the group through hashing and bilinear operations superior; To generate the ciphertext and root node secret value of the public key The result of the operation; g is the generator; is the result obtained by hashing the plaintext M; The ciphertext used to generate the public key part; Basic Access Policy Node Polynomial The value of, that is: ; The root node's secret value s will be the polynomial The constant term is used to recursively generate the secret value of the child node; For each node, the polynomial of the node has an order d, that is, the polynomial of the node is expressed as: ; in, is the secret value of the node, is randomly generated in the Zr group, is the independent variable of the polynomial function; The secret value of the second layer node, i.e. the enterprise type node, is obtained by the root node polynomial The calculations show that: Assume that the attributes of the second layer nodes are , through the hash function Calculate the secret value of the node ,Right now: ; Secret value of the second layer node The ciphertext part will be used to calculate the second-layer nodes and used as the input of the third-layer nodes to recursively generate leaf nodes; In the third layer of nodes, each leaf node has an attribute The secret value of a leaf node is determined by its parent node polynomial The specific formula is as follows: ; When the attribute of a node meets the access policy, the relevant ciphertext of the attribute is calculated: ; ; in, It is the secret value of the third-layer node, ensuring that only attributes that meet the policy requirements can be processed correctly. is the calculation result of the generator and node secret value, The properties of the node The hash operation result of Right now The hash operation result of and the operation result of the node secret value; The access expiration time Time of the ciphertext is designed, that is, the supervisor will not be able to access the data after the expiration time. The entire ciphertext CT structure is calculated as follows: ; in, To access the secret value of a tree node, To store the ciphertext part related to each user attribute value; The aggregate access tree node set required for the current encryption algorithm; Step S5: tracing the encrypted user data; Step S6: decrypt the user data; Use dynamically updated access policies to control user permissions and decrypt for ordinary users; Use timestamp verification method to control and supervise user permissions; Step S7: Obtain data.

2. The time-controlled fine-grained traceability method for large-scale supply chain data according to claim 1 is characterized by: The data owner is a completely trusted individual. According to the access structure set by the owner, the data uploaded to the blockchain is encrypted by CP-ABE. The encrypted data is transported to the blockchain and database and stored. Data users are untrusted individuals and need to submit a registration application to an authority before using the data. When the data owner wants to obtain the data, he will initiate a request to the traceability platform. After obtaining the data returned by the traceability platform, CP-ABE will be used to decrypt it. If the attributes meet the access policy initially set by the data owner, the data can be successfully decrypted. Otherwise, it cannot be decrypted. The blockchain is used to store transaction data uploaded by the data owner on the chain, and the database stores the data on the chain in the database off the chain; The authority generates the corresponding user key based on the attributes provided by the data user; When the traceability platform receives a request from a data user, it obtains data from the off-chain database, processes it, and returns it to the data user; The Attribute Authorization Center is responsible for managing and issuing attribute certificates to ensure the legitimacy and accuracy of user attributes. The Attribute Authorization Center works in collaboration with authoritative agencies to provide reliable attribute certificates for data users.

3. The time-controlled fine-grained traceability method for large-scale supply chain data according to claim 2 is characterized by: In step S2, the large-scale supply system is initialized to generate public parameters and a master key, specifically: Assume that Zr represents the group of integers from 0 to p-1, and p is a large prime number, is a group of order p, for Generators of; select two fixed elements from the Zr group and , calculate the following values: ; Among them, the bilinear map ; The ciphertext used to generate the public key part; is the group where the mapping result belongs; And design a hash function ; Returns the master private key MSK and the master public key PK: ; ; in, To generate the ciphertext of the public key, for The reverse operation is used to process the decryption logic; To generate the secret parameters of the key in the process of generating the public key, is the secret parameter of the key in the encryption process, For the bilinear pairing result, the bilinear pairing result is improved to Power; Generator of The exponent term used to generate the elements in the key pair.

4. The time-controlled fine-grained traceability method for large-scale supply chain data according to claim 1 is characterized by: The user key is generated in step S3, specifically: Suppose the attribute set of the large-scale supply system is , node combination of all attributes in large-scale supply system ,remember , Corresponds to , for each attribute , generate another random number from the Zr group , the following values ​​are calculated: ; ; ; in, is a value generated based on the master private key MSK. To set the attribute The hash calculation result and the random number The calculation result is is a random number With generator The result of the operation is is the hash calculation function, is the result of the operation of the random number r and the generator g; The private key SK is obtained as: ; in, is the public part of the private key, is the private key portion associated with the attribute, is the auxiliary encryption part related to the attribute, is the user's attribute, and .

5. The time-controlled fine-grained traceability method for large-scale supply chain data according to claim 1 is characterized by: In step S5, the encrypted user data is traced back to its source, specifically: First, all ciphertext data is obtained from the blockchain and off-chain database. All ciphertext that meets the requirements of the traceability initiator and receiver passed in by the user is sent to the user. The user decrypts it using his own private key. If the attributes meet the requirements of the data owner, the decryption can be successful. If not, the corresponding plaintext cannot be obtained.

6. The time-controlled fine-grained traceability method for large-scale supply chain data according to claim 1 is characterized by: In step S6, the user data is decrypted, specifically: Step S6-1: confirm whether the user is a supervisor. If the user is a supervisor, directly perform time judgment without checking the attribute judgment. If the time does not exceed the expiration time, access is allowed, otherwise access is denied. Step S6-2: Get the user attribute set in the SK private key And determine whether the ciphertext access policy is satisfied, if not, return directly, if satisfied, execute step S6-3 to decrypt the access tree node; Step S6-3: Starting from the root node, calculate each ciphertext access policy: Let node z be one of the ciphertext access policy nodes, then the decrypted value of the node is recorded as : ; in, is the private key part related to the attribute of node z, The auxiliary encryption part related to the attribute of node z, To access a node in the tree The result of the operation on the secret value, To access a node in the tree Stores the ciphertext part related to the user attribute value; When all ciphertext access policy nodes are calculated, the final result is obtained : ; Finally decrypted to get the plaintext : ; in, is the first part of the ciphertext, is the second part of the ciphertext, for and The result of the bilinear map.

Citation Information

Patent Citations

  • Access control system based on block chain

    CN116738498A

  • Improved multi-authorization CP-ABE supply chain source tracing data access control method

    CN117371003A

  • Data tracing method, device and equipment

    CN118331931A

  • Electronic medical data sharing system and method based on alliance chain and CP-ABE

    CN115883214A

  • Attribute classification and grade division data security storage and access control method

    CN115964751A