Block chain driven distributed private data storage and access control method and system
Through semantic analysis and bilinear pairing encryption algorithm, private data is sharded and encrypted, and combined with Bloom filter and a hierarchical integrity proof tree, the problem of private data storage and access control on the blockchain is solved, and the secure storage of data and fine-grained access control is realized.
Patent Information
- Application Number
- CN202510264900.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-07
- Publication Date
- 2025-04-08
- Estimated Expiration
- 2045-03-07
AI Technical Summary
The prior art is difficult to realize secure storage and fine-grained access control of private data on the blockchain, and lacks a quantitative evaluation mechanism for data sensitivity, so it is impossible to dynamically adjust access rights based on visitors' behavior.
The sensitivity of private data is evaluated through semantic analysis, sharding is performed and data sharding is encrypted using a bilinear pairing encryption algorithm. At the same time, build a Bloom filter and a hierarchical integrity proof tree to ensure data integrity. Based on the visitor behavior characteristics, dynamic hierarchical access keys are generated through deep learning, and the threshold signature scheme based on grid password is used for key distribution and authorization.
It realizes secure storage and fine-grained access control for private data, ensures dynamic management of data integrity and access rights, and improves the security and transparency of the system.
Smart Images

Figure CN119783138A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of access control technology, and in particular to a blockchain-driven distributed privacy data storage and access control method and system. Background Art
[0002] As the value of data continues to increase, the secure storage and controllable sharing of private data has become an important research topic. The traditional centralized storage model has the risk of single point failure and it is difficult to ensure the availability and integrity of data. Blockchain technology has the characteristics of decentralization and immutability. Combined with a distributed storage network, it can provide a more secure and reliable data storage solution. However, in practical applications, how to achieve secure storage and fine-grained access control of private data based on blockchain still faces many technical challenges.
[0003] The existing technology still has some shortcomings. It lacks a quantitative assessment mechanism for the sensitivity of privacy data, and cannot adopt differentiated protection strategies based on data sensitivity. Existing access control schemes often adopt a static key distribution mechanism, which makes it difficult to dynamically adjust access rights based on visitor behavior. Traditional data integrity verification methods have high computational overhead and low verification efficiency. The authorization process in existing schemes has low credibility, making it difficult to prevent malicious behavior of authorized nodes.
[0004] In summary, it is urgent to combine blockchain and distributed storage to achieve secure storage of private data; implement differentiated access control based on data sensitivity; provide an efficient data integrity verification mechanism; and build a trusted authorization mechanism. The present invention can solve the problems in the prior art. Summary of the invention
[0005] The embodiments of the present invention provide a blockchain-driven distributed privacy data storage and access control method and system, which can solve the problems in the prior art.
[0006] According to a first aspect of the embodiments of the present invention, A blockchain-driven distributed privacy data storage and access control method is provided, comprising: Receive private data, perform semantic analysis on the private data to obtain a sensitivity score, and perform sharding on the private data based on the sensitivity score to obtain data shards; calculate the data fingerprint value of each data shard, organize the data fingerprint value into a Bloom filter, and construct a hierarchical integrity proof tree based on the Bloom filter; use a bilinear pairing encryption algorithm to encrypt the data shards to obtain encrypted data shards; submit the encrypted data shards and the integrity proof tree to a distributed storage network, and generate a data fingerprint storage record in the blockchain; Receive a data access application, extract visitor behavior characteristics, obtain a behavior risk score based on the visitor behavior characteristics through deep learning, dynamically generate a hierarchical access key according to the behavior risk score, and perform threshold segmentation on the hierarchical access key to obtain key components; build an authentication node trust network, select an authorized node group in the authentication node trust network based on a consensus algorithm; distribute key components in the authorized node group; use a threshold signature scheme based on a lattice cipher to collect authorization signatures of the authorized node group; generate an authorization certificate containing the authorization signature, and write the authorization certificate into the blockchain; Accept the visitor's request, read the corresponding authorization certificate, obtain the data fingerprint from the evidence record in the blockchain, and obtain the corresponding encrypted data shard and integrity proof tree from the distributed storage network to verify the data integrity; obtain the key component from the authorized node group; execute the secure multi-party computing protocol to reorganize the key component to obtain the hierarchical access key, use the hierarchical access key to decrypt the encrypted data shard of the corresponding permission level to obtain the decrypted data, and create an access record at the same time, submit the access record to the blockchain, and update the visitor's behavior risk score.
[0007] In an optional embodiment, Calculate the data fingerprint value of each data shard, organize the data fingerprint value into a Bloom filter, and build a hierarchical integrity proof tree based on the Bloom filter, including: A secure hash algorithm is used to calculate the data fingerprint value on the data slice, and an XOR operation is performed on the data fingerprint value to generate a verification sequence; Adaptively adjust the size of the Bloom filter according to the number of data fragments and the system security level, select multiple independent hash functions to process the data fingerprint value respectively, obtain multiple mapping positions, update the bits corresponding to the multiple mapping positions in the Bloom filter to valid values, determine the marking position, divide the check sequence into subsequences equal to the number of the marking positions in order, store each subsequence in one-to-one correspondence in one of the marking positions, and form a check information matrix; The Bloom filter is dynamically adjusted to divide into granularities according to the distribution law of data sensitivity to obtain a plurality of data blocks of different sizes, each of which constitutes a leaf node, and a weight coefficient of the corresponding leaf node is calculated according to the number of marked positions contained in each of the data blocks; Perform weighted sorting on the leaf nodes, pair the leaf nodes whose weight coefficients are less than the similar weight threshold according to the preset first node weight threshold to form a node group, calculate the weighted hash connection value of the two leaf nodes in each node group to obtain the parent node, record the weight coefficient of the corresponding leaf node and the number of the mark position in the parent node, repeat the pairing until the root node is generated, and construct a hierarchical integrity proof tree; The nodes of the integrity proof tree are rebalanced according to a preset period. When the difference in weight coefficients of leaf nodes exceeds a preset second node weight threshold, node reorganization is triggered. The weight coefficients are recalculated based on the number of marked positions contained in the reorganized nodes, and the subsequence of the corresponding marked positions in the Bloom filter is updated.
[0008] In an optional embodiment, The encrypted data fragments obtained by encrypting the data fragments using the bilinear pairing encryption algorithm include: Selecting a system security parameter to obtain a prime order value, constructing a first cyclic group and a second cyclic group based on the prime order value, and verifying that the order of the first cyclic group is equal to the order of the second cyclic group; Selecting a first generator in the first cyclic group, generating a system master private key by using random number operation, performing a scalar multiplication operation on the system master private key and the first generator to generate a system public parameter, and selecting a corresponding second generator in the second cyclic group; Constructing a bilinear mapping, mapping the elements of the first cyclic group and the second cyclic group to a target group, and determining the bilinear properties of the target group and the bilinear mapping operation method; Obtain user identity information and current system time, concatenate the user identity information with the current system time, generate a space-time joint identifier, perform a secure hash operation, and map the space-time joint identifier to the first cycle group to obtain a first mapping point; receiving data to be encrypted, slicing the data to be encrypted according to a preset length to obtain a plurality of data slicings, generating a random number for each of the data slicings, and performing a bilinear pairing operation using the first mapping point and the second generator to generate a session key belonging to the target group; Each session key is used to perform a symmetric encryption operation on the corresponding data slice to obtain a ciphertext slice, a scalar multiplication operation is performed on each random number and the system public parameter to generate an encryption auxiliary parameter, and the ciphertext slice is combined with the corresponding encryption auxiliary parameter to form an encrypted data slice.
[0009] In an optional embodiment, Dynamically generate a hierarchical access key according to the behavior risk score, and perform threshold segmentation on the hierarchical access key to obtain key components including: receiving a behavior risk score, wherein the behavior risk score is a real number between 0 and 1; Multiplying the behavior risk score by a preset maximum number of levels to obtain a product value, and rounding up the product value to obtain a level value of the hierarchical access key; Obtain a random salt value, concatenate the behavior risk score, the level value, and the random salt value in a preset order to obtain a concatenated value, and calculate the concatenated value using a secure hash function to obtain a hierarchical access key; Generating a polynomial, wherein the highest degree of the polynomial is equal to a preset threshold value minus one, and a constant term of the polynomial is equal to the hierarchical access key; Substituting consecutive integers starting from 1 into the polynomial in sequence to obtain a plurality of function values, and combining the consecutive integers and the corresponding function values to form a plurality of key components; The level value and the behavior risk score are added to the key component to generate a key component with identification information.
[0010] In an optional embodiment, Selecting an authorized node group in the authentication node trust network based on a consensus algorithm includes: Obtaining the computing power index, online time ratio, and historical credit record of each authentication node in the authentication node trust network, summing the product of the computing power index and the first weight, the product of the online time ratio and the second weight, and the product of the historical credit record and the third weight to obtain the authentication node trust value of each authentication node; Sorting the authentication nodes based on their authentication node trust values, selecting the authentication node with the highest authentication node trust value as the primary authentication node, the primary authentication node generating a pre-prepared message including a view number, a sequence number, and an information digest; The master authentication node sends the pre-preparation message to other authentication nodes in the authentication node trust network, and the other authentication nodes are divided into different trust groups based on their respective authentication node trust values, wherein the authentication nodes whose authentication node trust values are greater than a first preset threshold are divided into a high trust group, the authentication nodes whose authentication node trust values are greater than a second preset threshold and less than the first preset threshold are divided into a medium trust group, and the authentication nodes whose authentication node trust values are less than the second preset threshold are divided into a low trust group; After receiving the pre-prepare message, the authentication node in the high-trust group verifies the continuity of the view number, the uniqueness of the sequence number, and the integrity of the information digest in the pre-prepare message, generates a first prepare message after the verification is passed, and sends the first prepare message to the authentication nodes in the medium-trust group and the low-trust group; The authentication node in the medium trust group receives the pre-prepare message and the first prepare message, verifies the consistency of the pre-prepare message and the first prepare message, generates a second prepare message and sends it; the authentication node in the low trust group receives the pre-prepare message, the first prepare message and the second prepare message, performs a verification operation, generates a third prepare message and sends it; The authentication nodes in the authentication node trust network receive the first preparation message, the second preparation message and the third preparation message, and when the total number of preparation messages received by a certain authentication node exceeds two times the preset number of faulty nodes plus one, the corresponding authentication node generates a confirmation message; Receive the confirmation message sent by each authentication node, and set a weighting coefficient according to the trust value of the authentication node sending the confirmation message, wherein the weighting coefficient is positively correlated with the trust value of the authentication node, weight the confirmation message to obtain a weighted confirmation message, and calculate the total number of the weighted confirmation messages; When the total number of the weighted confirmation messages does not exceed twice the preset number of faulty nodes plus one, the authentication node with the second highest authentication node trust value is selected as the new master authentication node, and the new master authentication node regenerates the pre-prepared message and executes it until a consensus is reached; when the total number of the weighted confirmation messages exceeds twice the preset number of faulty nodes plus one, a consensus is reached, and based on the consensus, the authentication nodes in the high-trust group are selected to construct an authorized node group.
[0011] In an optional embodiment, Collecting the authorization signatures of the authorized node group using a threshold signature scheme based on a lattice cipher includes: Get the authentication node information in the authorized node group; Selecting a first dimension parameter, a second dimension parameter and a modulus parameter, determining a lattice password parameter, and determining a Gaussian distribution parameter based on a Gaussian distributed random number; Construct a random matrix according to the first dimension parameter, the second dimension parameter and the modulus parameter, wherein the number of rows of the random matrix corresponds to the first dimension parameter, the number of columns corresponds to the second dimension parameter, and the value range of the elements is determined based on the modulus parameter; Constructing a unit vector according to the first dimension parameter, and combining the random matrix and the unit vector to generate a group public key; Generate a short base matrix and an error vector for each authentication node in the authorized node group based on the Gaussian distribution parameters, wherein the number of rows and the number of columns of the short base matrix correspond to the second dimension parameter, and combine the short base matrix and the error vector to generate a signature private key; Receiving a message to be signed, calculating a hash mapping vector of the message to be signed, and each authentication node in the authorization node group uses its own signature private key to multiply the short base matrix by the hash mapping vector and add the error vector to obtain a respective partial signature; All partial signatures generated by the authorized node group are merged through an iteratively optimized lattice shortest vector algorithm, and the norm of the partial signatures is calculated and reduced during each iteration to finally obtain a merged signature; The norm of the merged signature and the product of the random matrix and the merged signature are calculated. When the norm of the merged signature is less than a preset norm threshold and the product of the random matrix and the merged signature is equal to the unit vector, it is confirmed that the authorization signature of the authorized node group is obtained.
[0012] In an optional embodiment, Accept the visitor's request, read the corresponding authorization certificate, obtain the data fingerprint from the evidence record in the blockchain, and obtain the corresponding encrypted data slice and integrity proof tree from the distributed storage network to verify the data integrity; obtain the key component from the authorized node group; execute the secure multi-party computing protocol to reorganize the key component to obtain the hierarchical access key, use the hierarchical access key to decrypt the encrypted data slice of the corresponding permission level to obtain the decrypted data, and create an access record at the same time, submit the access record to the blockchain, and update the visitor's behavior risk score, including: Receive a data access request from a visitor, extract the visitor identity, target data identifier and access permission level from the data access request, and query a corresponding authorization credential from the blockchain according to the visitor identity; Verify the threshold signature in the authorization certificate, where the threshold signature is generated by the authorization node group using a threshold signature scheme based on a lattice cipher, and compare the access permission level recorded in the authorization certificate with the access permission level in the data access request; Obtaining a data fingerprint and a Bloom filter parameter from the evidence record of the blockchain according to the target data identifier, and constructing a Bloom filter structure based on the Bloom filter parameter; Obtaining an encrypted data shard and an integrity proof tree from a distributed storage network, calculating a data fingerprint of the encrypted data shard, inputting the data fingerprint into the Bloom filter structure for searching, and verifying the integrity of the encrypted data shard through the integrity proof tree; Sending a key component acquisition request to the authorization node group, wherein the key component acquisition request carries the authorization credential, and receiving the key component returned by the authorization node group; Initiate a secure multi-party computing protocol, use the visitor as the protocol initiator, use the nodes of the authorized node group as protocol participants, the protocol participants input the key components they hold, and use homomorphic encryption to reorganize the key components to obtain a hierarchical access key; Decrypt the encrypted data slice using a key in the hierarchical access key corresponding to the access permission level to obtain decrypted data; Generate an access record, the access record including the visitor identity, the target data identifier, the access permission level, and an access timestamp, and submit the access record to the blockchain; The visitor's access frequency and time interval distribution are calculated based on the access records, and the visitor's behavior risk score is updated in combination with the visitor's historical access records.
[0013] According to a second aspect of the embodiments of the present invention, Provide a blockchain-driven distributed privacy data storage and access control system, including: The first unit is used to receive private data, perform semantic analysis on the private data to obtain a sensitivity score, and perform sharding on the private data based on the sensitivity score to obtain data shards; calculate a data fingerprint value of each data shard, organize the data fingerprint value into a Bloom filter, and construct a hierarchical integrity proof tree based on the Bloom filter; use a bilinear pairing encryption algorithm to encrypt the data shards to obtain encrypted data shards; submit the encrypted data shards and the integrity proof tree to a distributed storage network, and generate a data fingerprint storage record in the blockchain; The second unit is used to receive a data access application, extract visitor behavior characteristics, obtain a behavior risk score based on the visitor behavior characteristics through deep learning, dynamically generate a hierarchical access key according to the behavior risk score, and perform threshold segmentation on the hierarchical access key to obtain a key component; construct an authentication node trust network, select an authorized node group in the authentication node trust network based on a consensus algorithm; distribute key components in the authorized node group; collect authorization signatures of the authorized node group using a threshold signature scheme based on a lattice cipher; generate an authorization certificate containing the authorization signature, and write the authorization certificate into a blockchain; The third unit is used to accept visitor requests, read the corresponding authorization credentials, obtain data fingerprints from the evidence records in the blockchain, and obtain the corresponding encrypted data shards and integrity proof trees from the distributed storage network to verify data integrity; obtain key components from the authorized node group; execute the secure multi-party computing protocol to reorganize the key components to obtain a hierarchical access key, use the hierarchical access key to decrypt the encrypted data shards of the corresponding permission level to obtain decrypted data, and create an access record at the same time, submit the access record to the blockchain, and update the visitor's behavioral risk score.
[0014] According to a third aspect of the embodiments of the present invention, An electronic device is provided, comprising: processor; a memory for storing processor-executable instructions; The processor is configured to call the instructions stored in the memory to execute the aforementioned method.
[0015] A fourth aspect of the embodiments of the present invention is: A computer-readable storage medium is provided, on which computer program instructions are stored. When the computer program instructions are executed by a processor, the aforementioned method is implemented.
[0016] In an embodiment of the present invention, privacy data is sharded through semantic analysis and sensitivity scoring, and the data shards are encrypted using a bilinear pairing encryption algorithm, which effectively prevents unauthorized access and data leakage and improves data security; Bloom filters and hierarchical integrity proof trees are used to ensure data integrity and verifiability and prevent data tampering; dynamic hierarchical access keys generated based on visitor behavior characteristics and deep learning are used to achieve more refined data access control; threshold segmentation and a threshold signature scheme based on lattice cryptography are used to ensure the reliability of key security distribution and authorization process, further improving the security and flexibility of access control; encrypted data shards and integrity proof trees are stored in a distributed storage network to reduce data access delays; by building an authentication node trust network and selecting an authorized node group through a consensus algorithm, the key distribution and authorization process are optimized and data access efficiency is improved; at the same time, access records are uploaded to the chain to facilitate auditing and tracking, and also promote transparency and standardization of data use. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 This is a flowchart of a distributed privacy data storage and access control method driven by blockchain according to an embodiment of the present invention; Figure 2 This is a schematic diagram of the structure of a distributed privacy data storage and access control system driven by blockchain in an embodiment of the present invention. DETAILED DESCRIPTION
[0018] 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 only 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.
[0019] The technical solution of the present invention is described in detail with specific embodiments below. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments.
[0020] Figure 1 Schematic diagram of the process of the distributed privacy data storage and access control method driven by blockchain in an embodiment of the present invention. Figure 1 As shown, the method includes: S101. Receive private data, perform semantic analysis on the private data to obtain a sensitivity score, and perform sharding on the private data based on the sensitivity score to obtain data shards; calculate the data fingerprint value of each data shard, organize the data fingerprint value into a Bloom filter, and construct a hierarchical integrity proof tree based on the Bloom filter; use a bilinear pairing encryption algorithm to encrypt the data shards to obtain encrypted data shards; submit the encrypted data shards and the integrity proof tree to a distributed storage network, and generate a data fingerprint storage record in the blockchain; In this embodiment, sharding is performed based on sensitivity scores, and a bilinear pairing encryption algorithm is used to encrypt data shards to ensure the security and privacy of sensitive data. A data integrity verification mechanism is effectively constructed through Bloom filters and hierarchical integrity proof trees to ensure the integrity and credibility of data during storage and access. Data sharding and distributed storage are combined to optimize the performance of data storage, while blockchain evidence is used to ensure the traceability of data access and operations. The blockchain evidence record of data fingerprints realizes the immutability and high transparency of operations, providing strong security protection for the storage and management of private data.
[0021] S102. Receive a data access application, extract visitor behavior characteristics, obtain a behavior risk score based on the visitor behavior characteristics through deep learning, dynamically generate a hierarchical access key according to the behavior risk score, and perform threshold segmentation on the hierarchical access key to obtain key components; construct an authentication node trust network, select an authorized node group in the authentication node trust network based on a consensus algorithm; distribute key components in the authorized node group; collect authorization signatures of the authorized node group using a threshold signature scheme based on a lattice cipher; generate an authorization certificate containing the authorization signature, and write the authorization certificate into the blockchain; In this embodiment, a behavioral risk score is generated based on visitor behavioral characteristics and deep learning, and the generation of hierarchical access keys is dynamically adjusted to achieve refined and risk-aware security access control; the access key is decomposed into multiple key components through threshold segmentation technology, distributed and stored, so as to improve the security and reliability of key management and prevent single point failure; the authentication node trust network and consensus algorithm are used to select the authorization node group, and the signatures are collected through the threshold signature scheme based on lattice cryptography to ensure the credibility and anti-attack capability of the authorization process; the authorization certificate generated by the authorization signature is written into the blockchain to ensure the transparency and non-tamperability of the access authorization process, and provide a reliable basis for subsequent tracing; combined with lattice cryptography technology, the system's ability to resist advanced attack methods such as quantum computing is enhanced, and the overall security of the system is improved.
[0022] S103. Accept the visitor's request, read the corresponding authorization certificate, obtain the data fingerprint from the evidence record in the blockchain, and obtain the corresponding encrypted data shard and integrity proof tree from the distributed storage network to verify the data integrity; obtain the key component from the authorized node group; execute the secure multi-party computing protocol to reorganize the key component to obtain a hierarchical access key, use the hierarchical access key to decrypt the encrypted data shard of the corresponding permission level to obtain the decrypted data, and create an access record at the same time, submit the access record to the blockchain, and update the visitor's behavioral risk score.
[0023] In this embodiment, by verifying the data fingerprint and integrity proof tree in the blockchain evidence record, it is ensured that the data has not been tampered with, thereby improving the reliability of storage and transmission; a secure multi-party computing protocol is used to reorganize the key components to generate a hierarchical access key, thereby avoiding the risk of key leakage and ensuring the security of the key in a distributed environment; data shards corresponding to the hierarchical access key decryption permission level are used to achieve strict matching of permission control and data decryption to prevent unauthorized access; access records are submitted to the blockchain and the visitor's behavioral risk score is updated in real time, providing complete operation traceability and risk assessment feedback, and enhancing the transparency and dynamic security of the system; the update mechanism of the behavioral risk score is used to continuously optimize the access control strategy, dynamically adjust the security level, and achieve adaptive management of potential risks.
[0024] In an optional implementation, calculating the data fingerprint value of each data shard, organizing the data fingerprint value into a Bloom filter, and constructing a hierarchical integrity proof tree based on the Bloom filter includes: A secure hash algorithm is used to calculate the data fingerprint value on the data slice, and an XOR operation is performed on the data fingerprint value to generate a verification sequence; Adaptively adjust the size of the Bloom filter according to the number of data fragments and the system security level, select multiple independent hash functions to process the data fingerprint value respectively, obtain multiple mapping positions, update the bits corresponding to the multiple mapping positions in the Bloom filter to valid values, determine the marking position, divide the check sequence into subsequences equal to the number of the marking positions in order, store each subsequence in one-to-one correspondence in one of the marking positions, and form a check information matrix; The Bloom filter is dynamically adjusted to divide into granularities according to the distribution law of data sensitivity to obtain a plurality of data blocks of different sizes, each of which constitutes a leaf node, and a weight coefficient of the corresponding leaf node is calculated according to the number of marked positions contained in each of the data blocks; Perform weighted sorting on the leaf nodes, pair the leaf nodes whose weight coefficients are less than the similar weight threshold according to the preset first node weight threshold to form a node group, calculate the weighted hash connection value of the two leaf nodes in each node group to obtain the parent node, record the weight coefficient of the corresponding leaf node and the number of the mark position in the parent node, repeat the pairing until the root node is generated, and construct a hierarchical integrity proof tree; The nodes of the integrity proof tree are rebalanced according to a preset period. When the difference in weight coefficients of leaf nodes exceeds a preset second node weight threshold, node reorganization is triggered. The weight coefficients are recalculated based on the number of marked positions contained in the reorganized nodes, and the subsequence of the corresponding marked positions in the Bloom filter is updated.
[0025] In a specific implementation, first, the data is sliced, for example, a 1GB file is sliced into 1024 1MB data slices. Then, a secure hash algorithm, such as SHA-256, is used to calculate the fingerprint value of each data slice. Assume that the hash value of a data slice is "e5b7e998". The fingerprint values of all data slices are subjected to a bitwise XOR operation to generate a verification sequence. For example, the XOR result of two fingerprint values "e5b7e998" and "a1b2c3d4" is "44458a6c".
[0026] Next, the size of the Bloom filter is adaptively adjusted according to the number of data slices and the security level of the system. For example, if there are 1024 data slices and the security level requires the false alarm rate to be less than 0.1%, the size of the Bloom filter can be set to 10240 bits. Select multiple independent hash functions, such as three hash functions h1, h2, and h3, to process the fingerprint value of each data slice respectively to obtain multiple mapping positions. Assume that after the fingerprint value "e5b7e998" is processed by three hash functions, the mapping positions obtained are 100, 200, and 300 respectively. Set the bits corresponding to these three positions in the Bloom filter to 1, indicating that these positions have been marked. The fingerprint values of all data slices are processed in this way, and finally a Bloom filter is formed, in which some bits are 1 and the rest are 0. The positions of these bits with values 1 are the marked positions. Split the previously generated check sequence into subsequences equal to the number of marked positions in order. For example, if the check sequence is "44458a6c" and has three marked positions, it is divided into three subsequences of "44", "45" and "8a6c". Each subsequence is stored in a marked position one by one to form a check information matrix.
[0027] Then, the partitioning granularity is dynamically adjusted according to the distribution law of data sensitivity, and the Bloom filter is divided into multiple data blocks of different sizes. For example, the Bloom filter is divided into three data blocks, containing 200, 300 and 540 marked positions respectively. Each data block constitutes a leaf node. According to the number of marked positions contained in each data block, the weight coefficient of the corresponding leaf node is calculated. For example, the weight coefficient of a leaf node containing 200 marked positions is 200.
[0028] Perform weighted sorting on the leaf nodes, for example, sorting them from small to large according to the weight coefficient. According to the preset first node weight threshold, for example 500, the leaf nodes with weight coefficients less than this threshold are paired to form a node group. For example, two leaf nodes with weight coefficients of 200 and 300 are paired. The weighted hash connection value of the two leaf nodes in each node group is calculated to obtain the parent node. For example, the weight coefficients of the two leaf nodes and the numbers of the marked positions are connected, and then their hash values are calculated as the value of the parent node. The weight coefficients of the corresponding leaf nodes and the numbers of the marked positions are recorded in the parent node. Repeat the pairing until the root node is generated to build a hierarchical integrity proof tree.
[0029] Finally, the nodes of the integrity proof tree are rebalanced according to a preset period, such as once a day. When the difference in the weight coefficients of the leaf nodes exceeds the preset second node weight threshold, such as 100, the node reorganization is triggered. For example, if the weight coefficient of one leaf node is 600 and the other is 200, the reorganization is triggered. The weight coefficient is recalculated according to the number of marked positions contained in the reorganized node, and the subsequence of the corresponding marked position in the Bloom filter is updated.
[0030] In this embodiment, the hierarchical integrity proof tree structure can quickly locate the location of data tampering, avoid full data scanning, and improve verification efficiency; the Bloom filter can effectively compress data fingerprint information and reduce storage overhead; the Bloom filter division granularity and node structure are dynamically adjusted according to data sensitivity and node weight differences to adapt to different data scenarios and security requirements.
[0031] In an optional implementation, encrypting the data slices using a bilinear pairing encryption algorithm to obtain encrypted data slices includes: Selecting a system security parameter to obtain a prime order value, constructing a first cyclic group and a second cyclic group based on the prime order value, and verifying that the order of the first cyclic group is equal to the order of the second cyclic group; Selecting a first generator in the first cyclic group, generating a system master private key by using random number operation, performing a scalar multiplication operation on the system master private key and the first generator to generate a system public parameter, and selecting a corresponding second generator in the second cyclic group; Constructing a bilinear mapping, mapping the elements of the first cyclic group and the second cyclic group to a target group, and determining the bilinear properties of the target group and the bilinear mapping operation method; Obtain user identity information and current system time, concatenate the user identity information with the current system time, generate a space-time joint identifier, perform a secure hash operation, and map the space-time joint identifier to the first cycle group to obtain a first mapping point; receiving data to be encrypted, slicing the data to be encrypted according to a preset length to obtain a plurality of data slicings, generating a random number for each of the data slicings, and performing a bilinear pairing operation using the first mapping point and the second generator to generate a session key belonging to the target group; Each session key is used to perform a symmetric encryption operation on the corresponding data slice to obtain a ciphertext slice, a scalar multiplication operation is performed on each random number and the system public parameter to generate an encryption auxiliary parameter, and the ciphertext slice is combined with the corresponding encryption auxiliary parameter to form an encrypted data slice.
[0032] The cyclic group specifically refers to a mathematical structure, all of whose elements can be generated by repeatedly performing group operations on a specific "generator", and will eventually return to the starting point to form a cyclic closed system. The results of the operations in the group always remain within the group, and each element has an inverse element, so that the results of the operations can be restored to their original state. In simple terms, a cyclic group is a periodic set of all members generated by repeated operations on a single element, and is often used in cryptography to ensure the determinism and security of calculations.
[0033] The prime order specifically refers to a property in a mathematical structure that describes the total number of elements in a cyclic group. It is a prime number, meaning that the number can only be divided by 1 and itself. In group theory, the prime order ensures that the group has special properties, such as each non-zero element has a unique inverse and the entire group can be generated through specific operations. The prime order is a key number used to define the size of a cyclic group, ensuring that the operations and structure of the group follow specific mathematical rules.
[0034] The generator specifically refers to a special element in the group. By performing multiple repeated operations on it, all other elements in the group can be generated. It is the "core component" of the group and determines the structure and scope of the group. The generator is a special "starting element" through which the entire group can be constructed.
[0035] In a specific implementation, first, select appropriate system security parameters, such as setting a key length, to determine a prime number p, the value of which determines the security strength of the system. Based on this prime number p, construct two cyclic groups, denoted as G1 and G2. The orders of these two cyclic groups, that is, the number of elements in the group, must be equal and equal to p. For example, a point group on an elliptic curve can be selected as a cyclic group, and the order can be ensured to be equal through the elliptic curve parameters. Verify whether the orders of G1 and G2 are equal.
[0036] Then, a generator g1 is selected in the G1 group. A generator refers to an element in a group. By repeatedly performing group operations on it, all other elements in the group can be obtained. A secure random number generator is used to generate the system master private key x, where x is a positive integer less than p. A scalar multiplication operation is performed on the system master private key x and the generator g1 in the G1 group, that is, g1 is calculated to the power of x, and the result is used as the system public parameter P, and P is made public. At the same time, a generator g2 corresponding to g1 is selected in the G2 group. For example, g2 can be a mapping of g1 in the G2 group.
[0037] Next, construct a bilinear map e that maps elements of the G1 group and the G2 group to another cyclic group GT, which is called the target group. This bilinear map needs to satisfy certain mathematical properties, such as bilinearity and non-degeneracy. The bilinear property refers to e(g1^a, g2^b)=e(g1, g2)^(ab), where a and b are arbitrary integers. Non-degeneracy means that e(g1, g2) is not equal to the identity element of the target group GT. Determine the bilinear properties of the target group GT and the specific operation method of the bilinear map. For example, a suitable elliptic curve pairing algorithm can be selected as the bilinear map.
[0038] Get the user's identity information ID, such as user name or ID number, and the current system time T. Concatenate the user's identity information ID and the current system time T to form a space-time joint identifier ID||T. Perform a secure hash operation on this space-time joint identifier, such as the SHA-256 algorithm, and map the hash result H(ID||T) to the G1 group to obtain an element in the G1 group, denoted as Q. This mapping can be achieved by converting the hash result to an integer and then raising the generator g1 of G1 to the power of the integer.
[0039] Receive the data D to be encrypted. Slice the data D according to a preset length, such as 128 bits, to obtain multiple data slices Di. Generate a random number ri for each data slice Di. Use the previously obtained element Q in the G1 group and the generator g2 in the G2 group, as well as the random number ri, perform a bilinear pairing operation, calculate e(Q, g2)^ri, and obtain an element belonging to the target group GT as the session key Ki.
[0040] Use each session key Ki to perform symmetric encryption operations on the corresponding data slice Di, such as using the AES algorithm, to obtain the ciphertext slice Ci. Perform scalar multiplication operations on each random number ri and the system public parameter P, that is, calculate P to the power of ri to obtain the encryption auxiliary parameter Ai. Combine the ciphertext slice Ci with the corresponding encryption auxiliary parameter Ai to form an encrypted data slice (Ci, Ai).
[0041] For example, suppose the user identity ID is "User123", the current system time T is "20241027100000", and the data D to be encrypted is "This is a test message.". Concatenate ID and T and perform a hash operation to obtain a hash value, which is mapped to the G1 group to obtain Q. Assuming that the fragment length is 8 bits, divide the data D into multiple fragments. Generate a random number ri for each fragment, and calculate the session key Ki=e(Q, g2)^ri. Use Ki to encrypt the corresponding fragment and obtain Ci. Calculate Ai=P^ri. Finally, the encrypted data fragments (C1, A1), (C2, A2),... are obtained.
[0042] In this embodiment, a combination of a bilinear pairing encryption algorithm and a symmetric encryption algorithm is adopted, and a session key is generated using random numbers, which improves the security of data encryption and effectively prevents data leakage; by combining user identity information and time information to generate a space-time joint identifier, fine-grained access control of data shards can be achieved, and only users with correct identity information and within the specified time can decrypt the data; by sharding the data, encryption and decryption operations can be performed on the data shards in parallel, which improves data processing efficiency, and is particularly suitable for encryption and decryption scenarios of large-scale data.
[0043] In an optional implementation, dynamically generating a hierarchical access key according to the behavior risk score, and performing threshold segmentation on the hierarchical access key to obtain key components includes: receiving a behavior risk score, wherein the behavior risk score is a real number between 0 and 1; Multiplying the behavior risk score by a preset maximum number of levels to obtain a product value, and rounding up the product value to obtain a level value of the hierarchical access key; Obtain a random salt value, concatenate the behavior risk score, the level value, and the random salt value in a preset order to obtain a concatenated value, and calculate the concatenated value using a secure hash function to obtain a hierarchical access key; Generating a polynomial, wherein the highest degree of the polynomial is equal to a preset threshold value minus one, and a constant term of the polynomial is equal to the hierarchical access key; Substituting consecutive integers starting from 1 into the polynomial in sequence to obtain a plurality of function values, and combining the consecutive integers and the corresponding function values to form a plurality of key components; The level value and the behavior risk score are added to the key component to generate a key component with identification information.
[0044] The random salt value specifically refers to a randomly generated additional data introduced in the field of cryptography or data security to enhance the security of the encryption or hashing process. Its main function is to make the same input data produce different output results after encryption or hashing, thereby effectively preventing attackers from reversing the original data through pre-calculated tables (such as rainbow tables). The random salt value is a randomly generated additional data used to increase the unpredictability and security of encryption or hashing.
[0045] In a specific implementation, first, the system parameters are preset, the maximum number of levels is set to 5, the secure hash function is selected as SHA-256, and the threshold value is preset to 3.
[0046] Next, the user's behavior risk score is received. For example, a user's behavior risk score is 0.6.
[0047] Then, the hierarchical access key level value is calculated. The behavior risk score 0.6 is multiplied by the maximum level number 5, and the product value is 3. The product value 3 is rounded up to 3, so the hierarchical access key level value of the user is 3.
[0048] Generate a random salt value. For example, the generated random salt value is "SaltValue123".
[0049] Concatenate and calculate the hierarchical access key. Concatenate the behavior risk score 0.6, the level value 3, and the random salt value "SaltValue123" in the order of "behavior risk score-level value-random salt value" to obtain the string "0.6-3-SaltValue123". Use the SHA-256 algorithm to calculate the concatenated string to obtain the hierarchical access key, such as "hash_value_example".
[0050] Construct a polynomial. Construct a polynomial with a maximum degree of 2 (preset threshold 3 minus 1), and the constant term of the polynomial is equal to the hierarchical access key "hash_value_example". Assume that the other coefficients of the polynomial are randomly generated, for example, the coefficient of the linear term is 1234 and the coefficient of the quadratic term is 5678, then the polynomial can be expressed as: f(x)=5678×x×x+1234×x+hash_value_example.
[0051] Generate the key components. Substitute consecutive integers starting from 1 into the polynomial.
[0052] For example, substituting 1 into the polynomial, we get the first function value f(1)=5678+1234+hash_value_example="first_function_value".
[0053] Substituting 2 into the polynomial, we get the second function value f(2)=5678×4+1234×2+hash_value_example="second_function_value".
[0054] Consecutive integers and their corresponding function values are grouped into multiple key components, for example: (1, "first_function_value"), (2, "second_function_value").
[0055] Add identification information. Add the level value 3 and the behavior risk score 0.6 to each key component to generate key components with identification information, for example: (1, "first_function_value", 3, 0.6), (2, "second_function_value", 3, 0.6).
[0056] In this embodiment, by introducing hierarchical access control and threshold secret sharing mechanism, the security of the key is effectively protected. Even if part of the key components are leaked, it will not lead to the leakage of the complete key, thereby enhancing the security of the system; hierarchical access keys are dynamically generated based on behavioral risk scores, thereby achieving more refined permission management, and the access rights of users can be dynamically adjusted according to their risk level, thereby improving the security and flexibility of the system; even if part of the key components are lost or damaged, due to the adoption of the threshold secret sharing mechanism, the original key can be restored as long as a sufficient number of key components are collected, thereby improving the availability and fault tolerance of the system.
[0057] In an optional implementation, selecting an authorized node group in the authentication node trust network based on a consensus algorithm includes: Obtaining the computing power index, online time ratio, and historical credit record of each authentication node in the authentication node trust network, summing the product of the computing power index and the first weight, the product of the online time ratio and the second weight, and the product of the historical credit record and the third weight to obtain the authentication node trust value of each authentication node; Sorting the authentication nodes based on their authentication node trust values, selecting the authentication node with the highest authentication node trust value as the primary authentication node, the primary authentication node generating a pre-prepared message including a view number, a sequence number, and an information digest; The master authentication node sends the pre-preparation message to other authentication nodes in the authentication node trust network, and the other authentication nodes are divided into different trust groups based on their respective authentication node trust values, wherein the authentication nodes whose authentication node trust values are greater than a first preset threshold are divided into a high trust group, the authentication nodes whose authentication node trust values are greater than a second preset threshold and less than the first preset threshold are divided into a medium trust group, and the authentication nodes whose authentication node trust values are less than the second preset threshold are divided into a low trust group; After receiving the pre-prepare message, the authentication node in the high-trust group verifies the continuity of the view number, the uniqueness of the sequence number, and the integrity of the information digest in the pre-prepare message, generates a first prepare message after the verification is passed, and sends the first prepare message to the authentication nodes in the medium-trust group and the low-trust group; The authentication node in the medium trust group receives the pre-prepare message and the first prepare message, verifies the consistency of the pre-prepare message and the first prepare message, generates a second prepare message and sends it; the authentication node in the low trust group receives the pre-prepare message, the first prepare message and the second prepare message, performs a verification operation, generates a third prepare message and sends it; The authentication nodes in the authentication node trust network receive the first preparation message, the second preparation message and the third preparation message, and when the total number of preparation messages received by a certain authentication node exceeds two times the preset number of faulty nodes plus one, the corresponding authentication node generates a confirmation message; Receive the confirmation message sent by each authentication node, and set a weighting coefficient according to the trust value of the authentication node sending the confirmation message, wherein the weighting coefficient is positively correlated with the trust value of the authentication node, weight the confirmation message to obtain a weighted confirmation message, and calculate the total number of the weighted confirmation messages; When the total number of the weighted confirmation messages does not exceed twice the preset number of faulty nodes plus one, the authentication node with the second highest authentication node trust value is selected as the new master authentication node, and the new master authentication node regenerates the pre-prepared message and executes it until a consensus is reached; when the total number of the weighted confirmation messages exceeds twice the preset number of faulty nodes plus one, a consensus is reached, and based on the consensus, the authentication nodes in the high-trust group are selected to construct an authorized node group.
[0058] In a specific implementation, it is first necessary to obtain the computing power index, online time ratio and historical credit record of each authentication node in the network. Assume that there are three authentication nodes A, B and C in the network. The computing power index of node A is 90, the online time ratio is 0.95, and the historical credit record is 0.98; the computing power index of node B is 85, the online time ratio is 0.92, and the historical credit record is 0.95; the computing power index of node C is 75, the online time ratio is 0.88, and the historical credit record is 0.92.
[0059] Next, multiply the computing power index, online time ratio and historical credit record by the corresponding weights respectively, and then add the three products to get the trust value of each authentication node. Assume that the weights of the three indicators are 0.5, 0.3 and 0.2 respectively. Then the trust value of node A is 90×0.5+0.95×0.3+0.98×0.2=45+0.285+0.196=45.481; the trust value of node B is 85×0.5+0.92×0.3+0.95×0.2=42.5+0.276+0.19=42.966; the trust value of node C is 75×0.5+0.88×0.3+0.92×0.2=37.5+0.264+0.184=37.948.
[0060] The authentication nodes are sorted according to the calculated trust values, and the node with the highest trust value is selected as the primary authentication node. In this example, node A has the highest trust value, so node A is selected as the primary authentication node. Primary authentication node A generates a pre-prepared message containing the view number, sequence number, and message digest. Assume that the view number is 1, the sequence number is 100, and the message digest is "datahash".
[0061] The main authentication node A sends the pre-preparation message to other authentication nodes B and C in the network. According to the preset thresholds, the other authentication nodes are divided into different trust groups. Assume that the first preset threshold is 45 and the second preset threshold is 40. Then the B node is divided into the medium trust group and the C node is divided into the low trust group.
[0062] After receiving the pre-prepare message, the nodes in the high-trust group (only the master node A in this example) verify the continuity of the view number, the uniqueness of the sequence number, and the integrity of the information digest in the message. After the verification is passed, the first prepare message is generated and sent to nodes B and C in the medium-trust group and the low-trust group.
[0063] After receiving the pre-prepare message and the first prepare message, node B in the medium trust group verifies the consistency of the two messages. After the verification is successful, a second prepare message is generated and sent to other nodes A and C. After receiving the pre-prepare message, the first prepare message, and the second prepare message, node C in the low trust group verifies them. After the verification is successful, a third prepare message is generated and sent to other nodes A and B.
[0064] All authentication nodes A, B, and C in the network receive the first preparation message, the second preparation message, and the third preparation message. When the total number of preparation messages received by a node exceeds twice the preset number of faulty nodes plus one, the node generates a confirmation message. Assuming that the preset number of faulty nodes is 0, a node generates a confirmation message when it receives 2×0+1=1 preparation messages.
[0065] Receive confirmation messages sent by all nodes and set weighted coefficients according to the trust value of the sending node. The higher the trust value, the greater the weighted coefficient. Multiply the confirmation message by the corresponding weighted coefficient to obtain the weighted confirmation message, and calculate the total number of weighted confirmation messages.
[0066] If the total number of weighted confirmation messages does not exceed two times the preset number of faulty nodes plus one, the node with the second highest trust value is selected as the new primary authentication node, the pre-prepared message is regenerated and the above steps are performed until a consensus is reached. If the total number of weighted confirmation messages exceeds two times the preset number of faulty nodes plus one, a consensus is reached and nodes in the high trust group are selected to form an authorized node group. In this example, if a consensus is reached, node A is selected to form an authorized node group.
[0067] In this embodiment, the consensus algorithm and multiple verification mechanisms are used to effectively reduce the risks of single point failures and malicious attacks, ensuring the stable operation of the system. The weights of different nodes are distinguished by trust values, and high-trust nodes are given priority to participate in the consensus process, thereby improving consensus efficiency and optimizing system performance. By verifying the integrity and consistency of messages, data tampering and forgery are prevented, ensuring the data security of the system.
[0068] In an optional implementation, collecting the authorization signatures of the authorized node group using a threshold signature scheme based on a lattice cipher includes: Get the authentication node information in the authorized node group; Selecting a first dimension parameter, a second dimension parameter and a modulus parameter, determining a lattice password parameter, and determining a Gaussian distribution parameter based on a Gaussian distributed random number; Construct a random matrix according to the first dimension parameter, the second dimension parameter and the modulus parameter, wherein the number of rows of the random matrix corresponds to the first dimension parameter, the number of columns corresponds to the second dimension parameter, and the value range of the elements is determined based on the modulus parameter; Constructing a unit vector according to the first dimension parameter, and combining the random matrix and the unit vector to generate a group public key; Generate a short base matrix and an error vector for each authentication node in the authorized node group based on the Gaussian distribution parameters, wherein the number of rows and the number of columns of the short base matrix correspond to the second dimension parameter, and combine the short base matrix and the error vector to generate a signature private key; Receiving a message to be signed, calculating a hash mapping vector of the message to be signed, and each authentication node in the authorization node group uses its own signature private key to multiply the short base matrix by the hash mapping vector and add the error vector to obtain a respective partial signature; All partial signatures generated by the authorized node group are merged through an iteratively optimized lattice shortest vector algorithm, and the norm of the partial signatures is calculated and reduced during each iteration to finally obtain a merged signature; The norm of the merged signature and the product of the random matrix and the merged signature are calculated. When the norm of the merged signature is less than a preset norm threshold and the product of the random matrix and the merged signature is equal to the unit vector, it is confirmed that the authorization signature of the authorized node group is obtained.
[0069] The first dimension parameter specifically refers to the number of rows used to describe the random matrix, which represents the structural height of the matrix. It determines the vertical size of the random matrix in the group public key and signature algorithm, and has a direct impact on the security of the matrix generation and subsequent operations; the first dimension parameter defines the number of rows in the random matrix and is one of the foundations of matrix construction.
[0070] The second dimension parameter specifically refers to the number of columns used to describe the random matrix, which represents the structural width of the matrix. This parameter directly affects the size of the short base matrix in the signature private key and the performance of the algorithm, and determines the computational complexity and encryption strength of the system; the second dimension parameter defines the number of columns in the random matrix and is an important part of constructing the matrix.
[0071] The modulus parameter is specifically used to determine the value range of the elements in the random matrix, ensuring that each value in the matrix is within the specified range. This parameter controls the size of the matrix elements, thereby affecting the security and anti-attack capabilities of the system; the modulus parameter limits the maximum range of the random matrix elements to ensure that the matrix meets the expected security properties.
[0072] In a specific implementation, first, the information of all authentication nodes in the authorized node group is obtained. This includes the unique identifier of each node and the public key information used for subsequent communication. For example, an authorized node group contains three nodes, and the identifiers are Node_A, Node_B and Node_C.
[0073] Next, determine the parameters of the lattice cipher. Select the first dimension parameter n, the second dimension parameter m, and the modulus parameter q. The choice of these parameters will affect the security and efficiency of the scheme. For example, you can choose n=1024, m=2048, and q=a large prime number, such as 2 to the power of 128. At the same time, based on the Gaussian distributed random number, determine the Gaussian distribution parameter σ for key generation. For example, σ can be set to 6. Then, a random matrix A is constructed. The number of rows of the matrix corresponds to the first dimension parameter n, the number of columns corresponds to the second dimension parameter m, and the value range of the elements is determined based on the modulus parameter q, that is, between 0 and q-1. For example, A is a matrix with 1024 rows and 2048 columns, and each element in it is a random number between 0 and 2 to the power of 128-1.
[0074] Next, construct an n-dimensional unit vector u. Combine the random matrix A and the unit vector u to generate the group public key (A, u). The group public key is made public to all nodes.
[0075] Afterwards, a signature private key is generated for each authentication node in the authorized node group. Based on the Gaussian distribution parameter σ, a short basis matrix S and an error vector e are generated for each node. The number of rows and columns of the short basis matrix S corresponds to the second dimension parameter m, and the dimension of the error vector e is the same as the first dimension parameter n. The short basis matrix S and the error vector e are combined to generate a signature private key (S, e). For example, the private key of Node_A is (S_A, e_A), the private key of Node_B is (S_B, e_B), and the private key of Node_C is (S_C, e_C).
[0076] When a message needs to be signed, the hash mapping vector h of the message to be signed is first calculated. The dimension of this vector is the same as the first dimension parameter n. For example, the hash mapping vector h of the message "Agreement" is a 1024-dimensional vector.
[0077] Each authentication node in the authorized node group signs the hash map vector using its own signature private key. Specifically, each node multiplies its own short basis matrix with the hash map vector h, and then adds its own error vector to obtain its own partial signature z. For example, Node_A calculates z_A=S_A×h+e_A, Node_B calculates z_B=S_B×h+e_B, and Node_C calculates z_C=S_C×h+e_C.
[0078] After collecting the partial signatures of all nodes, the lattice basis shortest vector algorithm with iterative optimization is used to merge these partial signatures. During each iteration, the norm of the partial signature is calculated and reduced, and finally the merged signature z is obtained.
[0079] Finally, calculate the norm ||z|| of the merged signature z and the product A×z of the random matrix A and the merged signature z. When the norm of the merged signature z is less than the preset norm threshold T and the product of the random matrix A and the merged signature z is equal to the unit vector u, it is confirmed that the authorized signature z of the authorized node group is obtained. For example, if ||z|| < T and A×z = u, then z is a valid authorized signature.
[0080] In this embodiment, lattice cryptography technology is adopted, making the signature scheme have the potential to resist quantum computer attacks and having higher security compared with traditional RSA- or ECC-based signature schemes; the threshold signature mechanism can generate a valid authorized signature only when a sufficient number of authorized nodes participate in the signature, avoiding single-point failures and attacks by malicious nodes; the lattice basis shortest vector algorithm with iterative optimization can quickly merge partial signatures to generate the final authorized signature, improving the efficiency of the signature process.
[0081] In an alternative embodiment, accept the visitor's request, read the corresponding authorization credential, obtain the data fingerprint from the evidence record in the blockchain, and obtain the corresponding encrypted data shard and integrity proof tree from the distributed storage network, verify the data integrity; obtain the key component from the authorized node group; execute a secure multi-party computation protocol to reconstruct the key component into a hierarchical access key, use the hierarchical access key to decrypt the encrypted data shard of the corresponding permission level to obtain the decrypted data, and at the same time create an access record, submit the access record to the blockchain, and update the behavior risk score of the visitor, including: Receive the visitor's data access request, extract the visitor identity identifier, target data identifier, and access permission level from the data access request, and query the corresponding authorization credential from the blockchain according to the visitor identity identifier; Verify the threshold signature in the authorization credential, which is generated by the authorized node group using the threshold signature scheme based on lattice cryptography, and compare the access permission level recorded in the authorization credential with the access permission level in the data access request; Obtain the data fingerprint and Bloom filter parameters from the evidence record of the blockchain according to the target data identifier, and construct a Bloom filter structure based on the Bloom filter parameters; Obtain the encrypted data shard and integrity proof tree from the distributed storage network, calculate the data fingerprint of the encrypted data shard, input the data fingerprint into the Bloom filter structure for lookup, and verify the integrity of the encrypted data shard through the integrity proof tree; Sending a key component acquisition request to the authorization node group, wherein the key component acquisition request carries the authorization credential, and receiving the key component returned by the authorization node group; Initiate a secure multi-party computing protocol, use the visitor as the protocol initiator, use the nodes of the authorized node group as protocol participants, the protocol participants input the key components they hold, and use homomorphic encryption to reorganize the key components to obtain a hierarchical access key; Decrypt the encrypted data slice using a key in the hierarchical access key corresponding to the access permission level to obtain decrypted data; Generate an access record, the access record including the visitor identity, the target data identifier, the access permission level, and an access timestamp, and submit the access record to the blockchain; The visitor's access frequency and time interval distribution are calculated based on the access records, and the visitor's behavior risk score is updated in combination with the visitor's historical access records.
[0082] In a specific implementation, first, a data access request from a visitor is received. The request includes a visitor identity (e.g., a hash value of the visitor's digital certificate "8f3b..."), a target data identifier (e.g., a hash value of a data file "e4a2..."), and an access permission level (e.g., read permission or write permission, assuming "read" here).
[0083] Then, the corresponding authorization certificate is queried from the blockchain according to the visitor's identity. Assume that the visitor's authorization certificate is recorded in a block of the blockchain, and the hash value of the block is "b1c4...". The authorization certificate contains a signature generated by the authorization node group using a threshold signature scheme based on lattice cryptography. Verify the threshold signature to ensure the validity of the authorization certificate. At the same time, compare the access permission level recorded in the authorization certificate with the access permission level in the data access request. If they do not match, access is denied. Assuming that the access permission level in the authorization certificate is also "read", the comparison passes.
[0084] Next, the data fingerprint "f7d3..." and Bloom filter parameters are obtained from the blockchain's evidence record according to the target data identifier "e4a2...". Assume that the Bloom filter parameters are (m=1024, k=3). The Bloom filter structure is constructed based on these parameters.
[0085] Then, obtain the encrypted data shard and integrity proof tree from the distributed storage network. Assume that the encrypted data shard is {"c1", "c2", "c3"}, and the root hash value of the integrity proof tree is "a8b9...". Calculate the data fingerprint of the encrypted data shard, assuming it is "f7d3...". Enter the fingerprint into the Bloom filter structure for search. If the search is successful, proceed to the next step; otherwise, deny access. Since the calculated data fingerprint is consistent with the data fingerprint obtained from the blockchain, the search is successful. Next, verify the integrity of the encrypted data shard through the integrity proof tree to ensure that the data has not been tampered with.
[0086] After that, a key component acquisition request is sent to the authorized node group (for example, nodes A, B, and C). The request carries the authorization credential "b1c4...". After the authorized node group verifies the authorization credential, they return the key components they hold. Assume that node A returns the key component "k_A", node B returns "k_B", and node C returns "k_C".
[0087] Next, start the secure multi-party computing protocol. The visitor is the protocol initiator, and the nodes A, B, and C of the authorized node group are the protocol participants. The protocol participants input the key components k_A, k_B, and k_C they hold, and use homomorphic encryption to reorganize these key components to obtain the hierarchical access key. Assume that the reorganized hierarchical access key is K={K_read, K_write}.
[0088] The encrypted data segments {"c1", "c2", "c3"} are decrypted using the key K_read corresponding to the access permission level "read" in the hierarchical access key to obtain the decrypted data. Assume that the decrypted data is "plaintext data".
[0089] Finally, an access record is generated. The record contains the visitor's identity "8f3b...", the target data identifier "e4a2...", the access permission level "read", and the access timestamp "2024-07-27 10:00:00". The access record is submitted to the blockchain.
[0090] Based on the access record and the visitor's historical access record, the visitor's access frequency and time interval distribution are calculated. For example, there were 3 visits in the past hour, and the average time interval was 20 minutes. Combined with this information, the visitor's behavior risk score is updated. For example, the risk score is upgraded from low risk to medium risk.
[0091] In this embodiment, by adopting technologies such as threshold signatures based on lattice cryptography, Bloom filters, integrity proof trees and homomorphic encryption, the security of data access is guaranteed to prevent unauthorized access and data tampering; through a hierarchical access key mechanism, fine-grained control of data access is achieved, and users with different authority levels can only access data within their authorized scope; the Bloom filter can quickly determine whether data exists, thereby improving the efficiency of data access; the secure multi-party computing protocol can complete the reorganization of key components and data decryption while protecting data privacy, avoiding complex key management processes.
[0092] Figure 2 Schematic diagram of the structure of a distributed privacy data storage and access control system driven by blockchain in an embodiment of the present invention. Figure 2 As shown, the system comprises: The first unit is used to receive private data, perform semantic analysis on the private data to obtain a sensitivity score, and perform sharding on the private data based on the sensitivity score to obtain data shards; calculate a data fingerprint value of each data shard, organize the data fingerprint value into a Bloom filter, and construct a hierarchical integrity proof tree based on the Bloom filter; use a bilinear pairing encryption algorithm to encrypt the data shards to obtain encrypted data shards; submit the encrypted data shards and the integrity proof tree to a distributed storage network, and generate a data fingerprint storage record in the blockchain; The second unit is used to receive a data access application, extract visitor behavior characteristics, obtain a behavior risk score based on the visitor behavior characteristics through deep learning, dynamically generate a hierarchical access key according to the behavior risk score, and perform threshold segmentation on the hierarchical access key to obtain a key component; construct an authentication node trust network, select an authorized node group in the authentication node trust network based on a consensus algorithm; distribute key components in the authorized node group; collect authorization signatures of the authorized node group using a threshold signature scheme based on a lattice cipher; generate an authorization certificate containing the authorization signature, and write the authorization certificate into a blockchain; The third unit is used to accept visitor requests, read the corresponding authorization credentials, obtain data fingerprints from the evidence records in the blockchain, and obtain the corresponding encrypted data shards and integrity proof trees from the distributed storage network to verify data integrity; obtain key components from the authorized node group; execute the secure multi-party computing protocol to reorganize the key components to obtain a hierarchical access key, use the hierarchical access key to decrypt the encrypted data shards of the corresponding permission level to obtain decrypted data, and create an access record at the same time, submit the access record to the blockchain, and update the visitor's behavioral risk score.
[0093] According to a third aspect of the embodiments of the present invention, An electronic device is provided, comprising: processor; a memory for storing processor-executable instructions; The processor is configured to call the instructions stored in the memory to execute the aforementioned method.
[0094] A fourth aspect of the embodiments of the present invention is: A computer-readable storage medium is provided, on which computer program instructions are stored. When the computer program instructions are executed by a processor, the aforementioned method is implemented.
[0095] The present invention may be a method, an apparatus, a system and / or a computer program product. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for executing various aspects of the present invention.
[0096] 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 replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A distributed privacy data storage and access control method driven by blockchain, characterized in that: include: receiving private data, performing semantic analysis on the private data to obtain a sensitivity score, and performing sharding processing on the private data based on the sensitivity score to obtain data shards; Calculate the data fingerprint value of each data shard, organize the data fingerprint value into a Bloom filter, and build a hierarchical integrity proof tree based on the Bloom filter; The data shards are encrypted using a bilinear pairing encryption algorithm to obtain encrypted data shards; the encrypted data shards and the integrity proof tree are submitted to a distributed storage network, and a data fingerprint record is generated in the blockchain; Receive a data access application, extract visitor behavior characteristics, obtain a behavior risk score based on the visitor behavior characteristics through deep learning, dynamically generate a hierarchical access key according to the behavior risk score, and perform threshold segmentation on the hierarchical access key to obtain key components; Building an authentication node trust network, and selecting an authorized node group in the authentication node trust network based on a consensus algorithm; Distributing key components among the authorized node group; collecting authorized signatures of the authorized node group using a threshold signature scheme based on lattice cryptography; Generate an authorization certificate containing the authorization signature, and write the authorization certificate into the blockchain; Accept the visitor's request, read the corresponding authorization certificate, obtain the data fingerprint from the evidence record in the blockchain, and obtain the corresponding encrypted data shard and integrity proof tree from the distributed storage network to verify the data integrity; Obtain key components from the authorized node group; execute a secure multi-party computing protocol to reorganize the key components to obtain a hierarchical access key, use the hierarchical access key to decrypt the encrypted data slices corresponding to the permission level to obtain decrypted data, and create an access record at the same time, submit the access record to the blockchain, and update the visitor's behavioral risk score.
2. The method according to claim 1, characterized in that Calculate the data fingerprint value of each data shard, organize the data fingerprint value into a Bloom filter, and build a hierarchical integrity proof tree based on the Bloom filter, including: A secure hash algorithm is used to calculate the data fingerprint value on the data slice, and an XOR operation is performed on the data fingerprint value to generate a verification sequence; Adaptively adjust the size of the Bloom filter according to the number of data fragments and the system security level, select multiple independent hash functions to process the data fingerprint value respectively, obtain multiple mapping positions, update the bits corresponding to the multiple mapping positions in the Bloom filter to valid values, determine the marking position, divide the check sequence into subsequences equal to the number of the marking positions in order, store each subsequence in one-to-one correspondence in one of the marking positions, and form a check information matrix; The Bloom filter is dynamically adjusted to divide into granularities according to the distribution law of data sensitivity to obtain a plurality of data blocks of different sizes, each of which constitutes a leaf node, and a weight coefficient of the corresponding leaf node is calculated according to the number of marked positions contained in each of the data blocks; Perform weighted sorting on the leaf nodes, pair the leaf nodes whose weight coefficients are less than the similar weight threshold according to the preset first node weight threshold to form a node group, calculate the weighted hash connection value of the two leaf nodes in each node group to obtain the parent node, record the weight coefficient of the corresponding leaf node and the number of the mark position in the parent node, repeat the pairing until the root node is generated, and construct a hierarchical integrity proof tree; The nodes of the integrity proof tree are rebalanced according to a preset period. When the difference in weight coefficients of leaf nodes exceeds a preset second node weight threshold, node reorganization is triggered. The weight coefficients are recalculated based on the number of marked positions contained in the reorganized nodes, and the subsequence of the corresponding marked positions in the Bloom filter is updated.
3. The method according to claim 1, characterized in that The encrypted data fragments obtained by encrypting the data fragments using the bilinear pairing encryption algorithm include: Selecting a system security parameter to obtain a prime order value, constructing a first cyclic group and a second cyclic group based on the prime order value, and verifying that the order of the first cyclic group is equal to the order of the second cyclic group; Selecting a first generator in the first cyclic group, generating a system master private key by using random number operation, performing a scalar multiplication operation on the system master private key and the first generator to generate a system public parameter, and selecting a corresponding second generator in the second cyclic group; Constructing a bilinear mapping, mapping the elements of the first cyclic group and the second cyclic group to a target group, and determining the bilinear properties of the target group and the bilinear mapping operation method; Obtain user identity information and current system time, concatenate the user identity information with the current system time, generate a space-time joint identifier, perform a secure hash operation, and map the space-time joint identifier to the first cycle group to obtain a first mapping point; receiving data to be encrypted, slicing the data to be encrypted according to a preset length to obtain a plurality of data slicings, generating a random number for each of the data slicings, and performing a bilinear pairing operation using the first mapping point and the second generator to generate a session key belonging to the target group; Each session key is used to perform a symmetric encryption operation on the corresponding data slice to obtain a ciphertext slice, a scalar multiplication operation is performed on each random number and the system public parameter to generate an encryption auxiliary parameter, and the ciphertext slice is combined with the corresponding encryption auxiliary parameter to form an encrypted data slice.
4. The method according to claim 1, characterized in that: Dynamically generate a hierarchical access key according to the behavior risk score, and perform threshold segmentation on the hierarchical access key to obtain key components including: receiving a behavior risk score, wherein the behavior risk score is a real number between 0 and 1; Multiplying the behavior risk score by a preset maximum number of levels to obtain a product value, and rounding up the product value to obtain a level value of the hierarchical access key; Obtaining a random salt value, concatenating the behavior risk score, the level value, and the random salt value in a preset order to obtain a concatenated value, and calculating the concatenated value using a secure hash function to obtain a hierarchical access key; Generating a polynomial, wherein the highest degree of the polynomial is equal to a preset threshold value minus one, and a constant term of the polynomial is equal to the hierarchical access key; Substituting consecutive integers starting from 1 into the polynomial in sequence to obtain a plurality of function values, and combining the consecutive integers and the corresponding function values to form a plurality of key components; The level value and the behavior risk score are added to the key component to generate a key component with identification information.
5. The method according to claim 1, characterized in that Selecting an authorized node group in the authentication node trust network based on a consensus algorithm includes: Obtaining the computing power index, online time ratio, and historical credit record of each authentication node in the authentication node trust network, summing the product of the computing power index and the first weight, the product of the online time ratio and the second weight, and the product of the historical credit record and the third weight to obtain the authentication node trust value of each authentication node; Sorting the authentication nodes based on their authentication node trust values, selecting the authentication node with the highest authentication node trust value as the primary authentication node, the primary authentication node generating a pre-prepared message including a view number, a sequence number, and an information digest; The master authentication node sends the pre-preparation message to other authentication nodes in the authentication node trust network, and the other authentication nodes are divided into different trust groups based on their respective authentication node trust values, wherein the authentication nodes whose authentication node trust values are greater than a first preset threshold are divided into a high trust group, the authentication nodes whose authentication node trust values are greater than a second preset threshold and less than the first preset threshold are divided into a medium trust group, and the authentication nodes whose authentication node trust values are less than the second preset threshold are divided into a low trust group; After receiving the pre-prepare message, the authentication node in the high-trust group verifies the continuity of the view number, the uniqueness of the sequence number, and the integrity of the information digest in the pre-prepare message, generates a first prepare message after the verification is passed, and sends the first prepare message to the authentication nodes in the medium-trust group and the low-trust group; The authentication node in the medium trust group receives the pre-prepare message and the first prepare message, verifies the consistency of the pre-prepare message and the first prepare message, generates a second prepare message and sends it; the authentication node in the low trust group receives the pre-prepare message, the first prepare message and the second prepare message, performs a verification operation, generates a third prepare message and sends it; The authentication nodes in the authentication node trust network receive the first preparation message, the second preparation message and the third preparation message, and when the total number of preparation messages received by a certain authentication node exceeds two times the preset number of faulty nodes plus one, the corresponding authentication node generates a confirmation message; Receive the confirmation message sent by each authentication node, and set a weighting coefficient according to the trust value of the authentication node sending the confirmation message, wherein the weighting coefficient is positively correlated with the trust value of the authentication node, weight the confirmation message to obtain a weighted confirmation message, and calculate the total number of the weighted confirmation messages; When the total number of the weighted confirmation messages does not exceed twice the preset number of faulty nodes plus one, the authentication node with the second highest authentication node trust value is selected as the new master authentication node, and the new master authentication node regenerates the pre-prepared message and executes it until a consensus is reached; when the total number of the weighted confirmation messages exceeds twice the preset number of faulty nodes plus one, a consensus is reached, and based on the consensus, the authentication nodes in the high-trust group are selected to construct an authorized node group.
6. The method according to claim 1, characterized in that Collecting the authorization signatures of the authorized node group using a threshold signature scheme based on a lattice cipher includes: Get the authentication node information in the authorized node group; Selecting a first dimension parameter, a second dimension parameter and a modulus parameter, determining a lattice password parameter, and determining a Gaussian distribution parameter based on a Gaussian distributed random number; Construct a random matrix according to the first dimension parameter, the second dimension parameter and the modulus parameter, wherein the number of rows of the random matrix corresponds to the first dimension parameter, the number of columns corresponds to the second dimension parameter, and the value range of the elements is determined based on the modulus parameter; Constructing a unit vector according to the first dimension parameter, and combining the random matrix and the unit vector to generate a group public key; Generate a short base matrix and an error vector for each authentication node in the authorized node group based on the Gaussian distribution parameters, wherein the number of rows and the number of columns of the short base matrix correspond to the second dimension parameter, and combine the short base matrix and the error vector to generate a signature private key; Receiving a message to be signed, calculating a hash mapping vector of the message to be signed, and each authentication node in the authorization node group uses its own signature private key to multiply the short base matrix by the hash mapping vector and add the error vector to obtain a respective partial signature; All partial signatures generated by the authorized node group are merged through an iteratively optimized lattice shortest vector algorithm, and the norm of the partial signatures is calculated and reduced during each iteration to finally obtain a merged signature; The norm of the merged signature and the product of the random matrix and the merged signature are calculated. When the norm of the merged signature is less than a preset norm threshold and the product of the random matrix and the merged signature is equal to the unit vector, it is confirmed that the authorization signature of the authorized node group is obtained.
7. The method according to claim 1, characterized in that Accept the visitor's request, read the corresponding authorization certificate, obtain the data fingerprint from the evidence record in the blockchain, and obtain the corresponding encrypted data shard and integrity proof tree from the distributed storage network to verify the data integrity; Obtain key components from the authorization node group; execute the secure multi-party computing protocol to reorganize the key components to obtain a hierarchical access key, use the hierarchical access key to decrypt the encrypted data slices corresponding to the permission level to obtain decrypted data, and create an access record at the same time, submit the access record to the blockchain, and update the visitor's behavior risk score, including: Receive a data access request from a visitor, extract the visitor identity, target data identifier and access permission level from the data access request, and query the corresponding authorization certificate from the blockchain according to the visitor identity; Verify the threshold signature in the authorization certificate, where the threshold signature is generated by the authorization node group using a threshold signature scheme based on a lattice cipher, and compare the access permission level recorded in the authorization certificate with the access permission level in the data access request; Obtaining a data fingerprint and a Bloom filter parameter from the evidence record of the blockchain according to the target data identifier, and constructing a Bloom filter structure based on the Bloom filter parameter; Obtaining an encrypted data shard and an integrity proof tree from a distributed storage network, calculating a data fingerprint of the encrypted data shard, inputting the data fingerprint into the Bloom filter structure for searching, and verifying the integrity of the encrypted data shard through the integrity proof tree; Sending a key component acquisition request to the authorization node group, wherein the key component acquisition request carries the authorization credential, and receiving the key component returned by the authorization node group; Initiate a secure multi-party computing protocol, use the visitor as the protocol initiator, use the nodes of the authorized node group as protocol participants, the protocol participants input the key components they hold, and use homomorphic encryption to reorganize the key components to obtain a hierarchical access key; Decrypt the encrypted data slice using a key in the hierarchical access key corresponding to the access permission level to obtain decrypted data; Generate an access record, the access record including the visitor identity, the target data identifier, the access permission level, and an access timestamp, and submit the access record to the blockchain; The visitor's access frequency and time interval distribution are calculated based on the access records, and the visitor's behavior risk score is updated in combination with the visitor's historical access records.
8. A distributed privacy data storage and access control system driven by blockchain, used to implement the method described in any one of claims 1 to 7, characterized in that: include: The first unit is used to receive private data, perform semantic analysis on the private data to obtain a sensitivity score, and perform sharding processing on the private data based on the sensitivity score to obtain data shards; Calculate the data fingerprint value of each data shard, organize the data fingerprint value into a Bloom filter, and build a hierarchical integrity proof tree based on the Bloom filter; The data shards are encrypted using a bilinear pairing encryption algorithm to obtain encrypted data shards; the encrypted data shards and the integrity proof tree are submitted to a distributed storage network, and a data fingerprint record is generated in the blockchain; The second unit is used to receive a data access application, extract visitor behavior characteristics, obtain a behavior risk score based on the visitor behavior characteristics through deep learning, dynamically generate a hierarchical access key according to the behavior risk score, and perform threshold segmentation on the hierarchical access key to obtain key components; Building an authentication node trust network, and selecting an authorized node group in the authentication node trust network based on a consensus algorithm; Distributing key components among the authorized node group; collecting authorized signatures of the authorized node group using a threshold signature scheme based on lattice cryptography; Generate an authorization certificate containing the authorization signature, and write the authorization certificate into the blockchain; The third unit is used to accept the visitor's request, read the corresponding authorization certificate, obtain the data fingerprint from the evidence record in the blockchain, and obtain the corresponding encrypted data shard and integrity proof tree from the distributed storage network to verify the data integrity; Obtain key components from the authorized node group; execute a secure multi-party computing protocol to reorganize the key components to obtain a hierarchical access key, use the hierarchical access key to decrypt the encrypted data slices corresponding to the permission level to obtain decrypted data, and create an access record at the same time, submit the access record to the blockchain, and update the visitor's behavioral risk score.
9. An electronic device, characterized in that: include: processor; a memory for storing processor-executable instructions; The processor is configured to call the instructions stored in the memory to execute the method described in any one of claims 1 to 7.
10. A computer-readable storage medium having computer program instructions stored thereon, characterized in that: When the computer program instructions are executed by a processor, the method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Image supervision platform and method based on privacy intersection and block chain
CN116842557A
Private data security sharing method based on block chain
CN117692227A
Distributed device identity authentication and access control method and system based on block chain
CN119363318A
Data security sharing method and system
CN119483909A
System and method for decentralized data management and dynamic verification, valuation, and monetization of data queries
US12155781B1
Cited By
Medical image encryption and secure storage method and system based on block chain
CN120110790A
Heterogeneous encrypted multi-modal multimedia message real-time fragmentation transmission method for 5G network
CN120201420A
Distributed video storage and multistage verification system and method based on block chain
CN120378645A
DAG-based hard wallet transaction rapid synchronization method, medium and system
CN120410528A
Semi-distributed secret key management method and system and medium
CN120456015A