Block chain private data access control method based on secure multi-party computing
By adopting secure multi-party computing and asymmetric encryption technology on the blockchain, private data is decomposed into key fragments for decentralization and decryption, the problems of data leakage and single point of failure in public chain scenarios are solved, and efficient private data protection and decentralized access control.
Patent Information
- Application Number
- CN202411377588.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-30
- Publication Date
- 2025-01-07
AI Technical Summary
The existing blockchain data access control methods have the risk of data leakage and single point of failure in public chain scenarios, and cannot achieve fully decentralized private data protection.
Adopt blockchain private data access control method based on secure multi-party computing, and use the secret sharing technology of threshold signatures and asymmetric encryption technology to decompose the asymmetric encryption key of private data into key fragments, and generate secrets through irreversible encryption operations. The text is stored in the public chain, and the private data is only decrypted and restored when the threshold number of secret key fragments are gathered to ensure that the data is tampered with and decentralized storage.
It realizes the finest-grained data isolation, completely decentralized data access control, lowers the construction threshold for public chain access nodes, and defends against attacks such as forgery of user identity and access requests, and is suitable for a variety of application scenarios.
Smart Images

Figure CN119272303A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of blockchain application, and specifically relates to a blockchain private data access control method based on secure multi-party computing. Background Art
[0002] SMPC (Secure Multi-Party Computation) is a collection of cutting-edge distributed encryption computing technologies. It belongs to a specific field of multi-party computing (MPC) and aims to allow participants to conduct collaborative computing without exposing private inputs. It uses cryptographic technology to achieve this goal.
[0003] In SMPC, participants collaborate to perform computations, but each participant only knows their own inputs and not the inputs of other participants. By using encryption and security protocols, SMPC allows participants to jointly compute results without sharing private inputs. In this way, even if malicious participants try to infer the inputs of other participants by analyzing the computation process, they cannot obtain any useful information.
[0004] SMPC provides high privacy protection and security, but because it involves complex encryption algorithms and communication protocols, the computational efficiency may be low and requires more computing and communication resources. Therefore, in practical applications, it is necessary to balance security and efficiency and select the appropriate SMPC solution according to the specific situation.
[0005] TSS (Threshold Signature Scheme) is a threshold signature scheme, which is a cryptographic technology that allows multiple parties to collaborate to generate a signature without the need to store the private key in a single entity. Unlike traditional signature schemes, the threshold signature scheme divides the private key into multiple parts and distributes them to different parties. Only when a certain threshold condition is reached can a valid signature be generated.
[0006] In the threshold signature scheme, participants can share parts of the private key and use them to calculate the signature without having to store the complete private key in one place. Only when a sufficient number of participants cooperate to reach a predetermined threshold value can a valid signature be generated, which can improve security and reduce the risk of single point failure.
[0007] The threshold signature scheme usually includes the following steps (see Figure 1 ):
[0008] Private key generation: Generate a private key and split it into multiple parts and distribute them to different parties.
[0009] Signature generation: The parties cooperate to use their parts of the private keys to calculate the signature. Only when the threshold conditions are met can a valid signature be generated.
[0010] Signature Verification: Verify whether the generated signature is valid.
[0011] The main properties of the threshold signature scheme are:
[0012] The complete private key will not be accessible to any one participant.
[0013] The public key is calculated again by the private key calculated by a threshold number of participants.
[0014] It takes m participants (m≤n, m is the number of threshold conditions, n is the total number of participants) to generate a signature corresponding to the complete private key.
[0015] Threshold signature schemes are widely used in distributed systems and secure multi-party computation, especially in scenarios that require high security and decentralization, such as multi-party signatures, key management, secure multi-party computation in blockchain technology, etc. It provides an effective way to protect private keys and ensure the security and reliability of signatures when multiple parties cooperate.
[0016] The RSA encryption algorithm is an asymmetric encryption algorithm that uses public and private keys for encryption and decryption. The specific process of generating RSA public and private keys is as follows:
[0017] 1. Choose two large prime numbers p and q:
[0018] Choose two distinct prime numbers p and q that are large enough.
[0019] 2. Calculate the product n:
[0020] Calculate n=p*q.
[0021] 3. Calculate the value of Euler function φ(n):
[0022] Calculate φ(n)=(p-1)(q-1).
[0023] 4. Select the public key exponent e:
[0024] Choose an integer e that is relatively prime to φ(n) (usually 65537).
[0025] 5. Calculate the private key d:
[0026] Calculate an integer d that satisfies (d*e) mod φ(n) = 1. d is usually calculated by an extended Euclidean algorithm.
[0027] 6. Generate public and private keys:
[0028] The public key is (n,e);
[0029] The private key is (n,d).
[0030] 7. Final public and private keys:
[0031] The public key (n,e) can be distributed to other parties who need to encrypt data;
[0032] The private key (n, d) can only be used confidentially by the recipient of the data.
[0033] The public-private key pair generated in this way can be used for RSA encryption and decryption. The sender uses the receiver's public key to encrypt, and the receiver uses his own private key to decrypt. The security of the RSA algorithm is based on the large integer factorization problem, that is, it is very difficult to infer d from known n and e, because n needs to be decomposed into its prime factors p and q, which is a very time-consuming operation under current computing power.
[0034] Private data usually refers to sensitive or confidential information owned by an individual, organization or entity, which is usually only visible to the owner or members of a limited organization. The blockchain open source framework Hyperledger Fabric comes with private data isolation technology.
[0035] Hyperledger Fabric is an open source enterprise-level distributed ledger technology (DLT) platform. It aims to provide a customizable, modular, secure, and high-performance blockchain framework for building enterprise-level blockchain applications. It achieves the isolation of public data in the blockchain by pre-demarcating information channels and specifying the organizations that can be accessed by the channels, and allows the definition of organizational subsets on the channels so that subsets of organizations can endorse, submit, or query unique private data without creating separate channels, while achieving the isolation of private data of external members of the subset.
[0036] The following is an application scenario of private data with organization as the isolation granularity, so as to understand the actual application scenario of private data:
[0037] Assume that there are five organizations in a channel, engaging in agricultural product trade:
[0038] 1. The farmer sells his goods abroad;
[0039] 2. Distributors ship goods abroad;
[0040] 3. The shipper is responsible for the transportation of goods between the parties;
[0041] 4.Wholesalers purchase goods from distributors;
[0042] 5. Retailers purchase goods from shippers and wholesalers.
[0043] The following situations may occur during the trading process:
[0044] (1) Distributors may wish to make private deals with farmers and shippers in order to keep the terms of the deals confidential from wholesalers and retailers (so as not to reveal the markups they charge).
[0045] (2) A distributor may also wish to establish a separate private data relationship with a wholesaler because it charges lower prices than retailers.
[0046] (3) Wholesalers may also want to establish private data relationships with retailers and shippers.
[0047] Rather than creating various small channels for each special relationship, it is better to define multiple private data sets (PDCs) to share private data in the following situations (see Figure 2 ):
[0048] PDC1: Distributors, farmers, and shippers;
[0049] PDC2: Distributors and wholesalers;
[0050] PDC3: Wholesalers, retailers and shippers.
[0051] The isolation of private data such as transaction quotations in the trading process is achieved by establishing the above three private data sets.
[0052] It is not difficult to find from the above examples that the use of private data isolation with organization as the isolation granularity allows members to distinguish data by organizational role identity. However, in actual usage scenarios, there are situations such as different distribution areas, distributors provide inconsistent quotations to wholesalers in different regions, or wholesalers have different cooperation models with different retailers, resulting in different quotations, or there is a cooperation model where distributors directly supply retailers. Therefore, application scenarios with organization as the isolation granularity are not sufficient to meet actual business needs, and more fine-grained isolation scenarios are required for implementation.
[0053] After reading and analyzing the existing literature, it is found that in the existing literature, many parties have proposed a variety of blockchain data access control or privacy protection schemes. Among them, document 1 (CN111127206A) proposes a blockchain data access control method based on smart contracts, which controls access rights by comparing the information of the organization that initiates the access request with the content in the transaction information that needs to be accessed, and uses the hash value of the transaction and the organization identification. There is a security risk of data leakage caused by forged requests in this scheme, which is not conducive to use in public chain scenarios containing malicious nodes. Document 2 (CN117040761A) proposes a privacy protection system and method based on blockchain and secure multi-party computing, which uses IPFS (Interplanetary File System, a distributed file storage and sharing system) to store private data, uses a secure multi-party computing center to encrypt private data to obtain a verification hash value, and finally stores the encrypted information and the verification hash value in the blockchain. When the data needs to be queried and verified, the private data is taken out from IPFS, and the corresponding encrypted information is taken out from the blockchain, and the authenticity of the private data is verified by the secure multi-party computing center and the verification hash value. This solution only uses the immutability of blockchain technology to ensure that private data cannot be tampered with, but private data is still stored in IPFS, which cannot guarantee that private data cannot be leaked. At the same time, the centralized data query verification center and secure multi-party computing center make the system have potential single point failures. Document 3 (CN113645020A) proposes a privacy protection method for alliance chains based on secure multi-party computing, which uses commitment and zero-knowledge proof technology to hide user identity information and prove the legitimacy of the user identity to the alliance chain at the same time, so as to realize anonymous transactions of users on the alliance chain. In addition, secret sharing, commitment, homomorphic encryption and other technologies are used to hide the user's sensitive data. At the same time, without exposing the real data, users can use sensitive data to participate in multi-party computing tasks. In this way, the privacy protection of alliance chain user transaction data is realized, and the user identity is untraceable and verifiable. Although this solution uses relatively complete cryptographic technologies such as zero-knowledge proof and homomorphic encryption, which protects the user's identity and privacy data to the greatest extent, the implementation of this solution is relatively complex, so the application scenario cannot be completely decentralized, that is, a certain central node is required to ensure the implementation of complex operations, so it can only be used in the alliance chain scenario. Therefore, this solution also has potential single point failures and cannot be used in the public chain scenario. Summary of the invention
[0054] The purpose of the present invention is to address the deficiencies of the prior art and propose a blockchain private data access control method based on secure multi-party computing.
[0055] In order to achieve the above purpose, the present invention mainly utilizes the secret sharing technology of threshold signature and combines it with asymmetric encryption technology to realize the decomposition of the asymmetric encryption key of private data into key fragments and distribute them to multiple members with access rights to the private data after the fragments are confused. The private data itself generates asymmetric encrypted ciphertext and irreversible encrypted ciphertext through asymmetric encryption and irreversible encryption operations respectively and stores them in the public chain to ensure that the data content cannot be tampered with. When it is necessary to access private data, through the threshold constraint method, the decryption member needs to gather the key fragments that meet the threshold number to start the recovery process of private data, and will try to recover the key pair through multi-party secure computing. The key pair is used to try to decrypt the asymmetric encrypted ciphertext of the private data, and the irreversible encryption operation result of the decrypted content is compared with the irreversible encrypted ciphertext stored on the public chain. If the match is successful, the decrypted content, that is, the original private data, is returned to the decryption member, and the private data reading process ends. If the results are inconsistent, it is considered that there is no right to access.
[0056] The scheme of the present invention realizes private data isolation with key fragments as the granularity by restoring secret key decryption through private key fragments, realizes the finest-grained data isolation, and can be fully applied to various types of application scenarios; at the same time, the basic condition for decryption of the scheme is to reach a threshold number of key fragments, so the scheme can achieve complete decentralization, that is, it can be completely independent of the user system and run independently, and the algorithm only focuses on whether the decryption party can provide a sufficient number of key fragments and verify the legitimacy of the key fragments, that is, those who hold a sufficient number of legal keys can access the content without considering the identity of the key holder, so that the scheme can be used in public chain scenarios; and the implementation method of the scheme is mostly based on basic encryption algorithms and basic mathematical logic operations, consumes less computing resources, and is relatively simple to implement independently. While ensuring complete decentralization, the algorithm can be deployed to various low-computing-power edge devices, so that the blockchain ledger that uses the algorithm for private data protection can be applied to more nodes, reducing the construction threshold of public chain access nodes.
[0057] The specific technical solution adopted by the present invention is as follows:
[0058] A blockchain private data access control method based on secure multi-party computing includes the following steps:
[0059] Step 1: Generate the key pair and confuse the key fragments;
[0060] Step 2: Encrypted storage of private data and information distribution and destruction;
[0061] Step 3: Secret key recovery verification and private data access.
[0062] Step 1 of the present invention, as the origin step of the solution, should be triggered by a specific event; and before starting, the RSA algorithm needs to be implemented by itself, and modified on the basis of the original algorithm to adapt to the overall algorithm process. The key points of the modification are as follows:
[0063] (1) When selecting the public key exponent e, the modified RSA algorithm must follow the public key exponent standard value e=65537 recommended by the International Organization for Standardization to ensure security while ensuring the computational efficiency of the encryption and decryption process.
[0064] (2) The modified RSA algorithm needs to have an overloaded nature when implemented, that is, the same method can have different parameter inputs and give different output results. When choosing different overloaded methods, the system will call the corresponding method based on the different input parameters.
[0065] (3) The modified RSA algorithm overloading method I is only used in the key pair generation and key fragment obfuscation steps. The modified RSA algorithm overloading method II2 is only used in the key recovery verification and private data access steps. For details, see below.
[0066] To further illustrate, the step 1 specifically includes:
[0067] Step 11: When the algorithm input receives the private data pd to be processed, the minimum threshold value m for accessing the private data (the domain of m should satisfy 0<m≤n, but for the sake of system fault tolerance and security, 1<m<n is recommended), and the number of users n with access rights to the private data (i.e., the user addresses that can access the private data, which can be determined by the number of addresses), the modified RSA algorithm overloading method I is executed, and the prime numbers p, q and the secret key pairs A and B are obtained, and the generation of the secret key pair is completed;
[0068] Step 12: Fragment the prime numbers p and q temporarily stored in step 11 to obtain n secret key fragments kf.
[0069] To further illustrate, the algorithm for fragment obfuscation in step 12 is as follows:
[0070] Step 121: Using the known minimum threshold value m, construct a polynomial F(x) of the highest degree t=m-1:
[0071] F(x)=u+a1x+a2x 2 +…+a t x t =u+∑a t x t ;
[0072] In the formula, the polynomial coefficients a1, a2, …, a in F(x) are tThey are all randomly generated by the system. The constant u is the input value of the fragment confusion algorithm, that is, the prime number p or q generated in step 11;
[0073] Get the polynomials corresponding to p and q, denoted as F p (x) and F q (x);
[0074] F p (x) = p + a1x + a2x 2 +…+a t x t =p+∑a t x t ,
[0075] F q (x) = q + a1x + a2x 2 +…+a t x t =q+∑a t x t ;
[0076] Step 122: Using the known number of users n, randomly generate two random arrays Array1[x p1 ,...,x pn ] and Array2[x q1 ,...,x qn ];
[0077] Step 123: Substitute the values of the above two arrays into the polynomial F p (x) and F q (x) to get the polynomial result array Array3[F p (x p1 ),...,F p (x pn )] and Array4[F q (x q1 ),...,F q (x qn )];
[0078] Step 124: The data of the above four arrays are taken out according to the same array index. For example, when the index is 1, the data taken out is as follows: x p1 ,x q1 ,F p (x p1 ),F q (x q1); at the same time, a reversible data obfuscation algorithm is used to process each group of data taken out (by transforming the data, it is difficult to restore the data to the original data while maintaining its practicality, thereby protecting data privacy. Common solutions are content replacement or adding noise data); here, it is assumed that each group of data processed by the reversible data obfuscation algorithm is kf1,…,kf n ;
[0079] At this point, the main process of the fragment confusion algorithm ends.
[0080] Further explanation, the RSA algorithm overloading method I in step 11 is specifically as follows: when no parameters are passed in, it is a normal RSA algorithm process, that is, randomly generate sufficiently large and different prime numbers p and q and generate a pair of secret keys A and B according to the process; the difference is that the prime numbers p and q need to be temporarily stored at this time (the value will not be leaked to the outside, and the temporary storage behavior will not be perceived by external users, but will be used again in the fragment obfuscation later). This method is only used in the steps of generating a secret key pair and obfuscating secret key fragments.
[0081] Further explanation: Step 2 is a joint step of Step 1 and can be started after Step 11 is completed, and specifically includes:
[0082] Step 21: Randomly select any key from the key pair A and B, encrypt the private data pd, and obtain the ciphertext S1.
[0083] Step 22: Encrypt the private data pd using an irreversible encryption algorithm to obtain ciphertext S2; the irreversible encryption algorithm here can be selected at will (MD5, SHA are both acceptable), and the ciphertext S2 is subsequently only used for comparison and verification.
[0084] Step 23: Store the ciphertext S1 and ciphertext S2 in the blockchain. The block also needs to store necessary information such as the block time and the minimum threshold value m. If in actual application, there is a situation where the encryption algorithm used in step 21 or 22 is upgraded (such as using an irreversible encryption algorithm with a higher security factor to encrypt private data information in step 22, or using other asymmetric encryption algorithms to replace the above RSA algorithm in step 11), it is recommended to use the version number to mark the currently used encryption algorithm combination and store it separately, and record the version number in the block as well. In the subsequent step three, the corresponding reverse algorithm can be selected according to the version number for processing to prevent the situation where the encryption algorithm in the system is updated and iterated, causing the private data written before the update to be inaccessible.
[0085] Step 24: After the block storage operation is completed, the block number corresponding to the private data is obtained; at this time, the block number together with the secret key fragment kf generated in step 12 is distributed to each user address with access rights to the private data. At this time, each user will only receive one kf and cannot know the kf content of other users. In addition, the kf obtained through the data obfuscation algorithm cannot simply reverse the original data content, which effectively prevents the malicious behavior of potential semi-malicious nodes in the public chain (that is, the nodes abide by the contract rules of the public chain, but will test the loopholes in the contract rules themselves based on legal data acquisition).
[0086] Step 25: After the distribution is completed, all data contents generated in the above process, including p, q, F(x), Array1,…Array4, kf1,…,kf n , A, and B are displayed and destroyed to ensure the security of data and processes; that is, the algorithm as a whole will only output a block number and give each user address a unique key fragment kf, and all other data will not be leaked.
[0087] At this point, the steps of encrypted storage of private data and information distribution and destruction are completed. The overall flow chart combining step 1 and step 2 is shown in Figure 5 .
[0088] Further explanation, step 3 is the verification and access step, which needs to be executed only when the input end receives the following information completely: ① request information to access private data in a specified block; ② provide the number of key fragments kf1,…,kf that meet the minimum threshold value m of the block m .
[0089] Further explanation: the process of step three includes:
[0090] Step 31: First, perform the reverse data obfuscation algorithm on each key fragment, that is, restore the key fragment kf to the original data format x p ,x q ,F p (x p ),F q (x q ); Here, the i-th secret key fragment is kf i , the restored data combination is x pi ,x qi ,F p (x pi ),F q (x qi ), let the data set composed of all m data combinations be Φ;
[0091] Due to the existence of the data obfuscation algorithm, malicious nodes usually cannot directly forge private key fragments that can pass the reverse data obfuscation algorithm. If they directly perform random forgery, garbled characters will appear when restoring the data. If the data cannot be restored to the original data style, the node is considered to be maliciously accessing private data and the access request will be rejected.
[0092] Step 32: For different prime number subscripts p and q, calculate the Lagrangian basis function l of each data combination in Φ pi (x), l qi (x) and the Lagrangian difference polynomial L p (x), L q (x), where L p (x), L q The constant terms in (x) are denoted as p', q';
[0093] If the key fragments provided by the decryption party are all the key fragments distributed when this block was generated, then the calculated L p (x), L q (x) is the polynomial F constructed in step 12 p (x), F q (x), and p', q' correspond to the prime numbers p, q, so far the original prime numbers p, q have been obtained; if there is any illegal secret key fragment (the illegal behavior explained here is usually to use the secret key fragment of other blockchains as input, then step 31 will be able to be restored normally, and then enter step 32), the process can still be completed normally, but the two polynomials and two constant terms obtained are meaningless and will be reflected in the subsequent private key recovery and verification links.
[0094] Step 33: Start executing the modified RSA algorithm overloading method II, taking the two constant items p' and q' obtained in step 32 as input items, and obtain a pair of secret key pairs C and D;
[0095] If the key fragments provided by the decryption party are all the key fragments distributed when this block was generated, then the key pairs C and D generated at this time will be the same as A and B, otherwise it will be a brand new key pair; at this time, the key recovery operation has been completed, but due to security reasons, the previous key pairs A and B have been destroyed. At this time, the system cannot intuitively confirm whether the key has been restored by comparing the key content.
[0096] Step 34: Use secret keys C and D to asymmetrically decrypt the ciphertext S1 in the block to obtain plaintext data d1 and d2;
[0097] Since the encryption of pd by any of the secret keys A and B is selected in step 21, in order to restore pd, it is necessary to use C and D to decrypt it once. If the private key fragments provided by the decryption party are all private key fragments distributed when this block is generated, then at this time, there must be one of d1 and d2 that is consistent with the content of pd, otherwise there is no match, that is, the meaningless data mentioned above. However, for security reasons, the previous private data pd has been destroyed, and at this time the system cannot intuitively confirm whether the private data has been restored by comparing the data content.
[0098] Step 35: Encrypt the plaintext data d1 and d2 using an irreversible encryption algorithm (the irreversible encryption algorithm selected here should be consistent with that in step 22), obtain ciphertext S3 and ciphertext S4, and compare ciphertext S3 and ciphertext S4 with ciphertext S2. If there is a match, it proves that the plaintext data d before the encryption of the match is the private data pd, that is, the verification passes. At this time, the plaintext data d is returned to the decryption party to complete the private data access; otherwise, it is considered that the node maliciously accesses the private data and the access request is rejected;
[0099] This concludes the steps of key recovery verification and private data access. The overall flow chart of step 3 is shown in Figure 6 .
[0100] In the above steps, the Lagrange basis function polynomial (general formula) is:
[0101]
[0102] The Lagrange difference polynomial (general formula) is:
[0103]
[0104] Further explanation, the RSA algorithm overloading method II in step 33 is specifically: allowing the specified prime numbers p and q to be passed in, and then skipping the original RSA prime number selection process (i.e., RSA algorithm step 1 in the background introduction), directly executing the subsequent process, and finally generating a pair of secret keys A and B. This method is only used in the secret key recovery verification and private data access steps.
[0105] Advantages of the present invention:
[0106] 1. The present invention proposes a blockchain private data access control method based on secure multi-party computing, which enables the most fine-grained data isolation.
[0107] 2. The technical solution of the present invention gets rid of the centralized usage restrictions and realizes application in a completely decentralized scenario.
[0108] 3. The technical solution of the present invention uses the key fragment as the design mode of the decryption core, so that it can defend against a series of similar penetration attacks centered on forging user identity or forging access requests.
[0109] 4. The technical solution of the present invention is implemented through basic encryption algorithms and basic mathematical logic operations, which reduces the construction threshold of public chain access nodes.
[0110] 5. The technical solution of the present invention designs the operation process of generating a key pair and confusing key fragments, which includes:
[0111] (1) The RSA algorithm is re-implemented and modified. While ensuring that the main architecture of the RSA algorithm remains unchanged, it is overloaded to enable it to provide the function of providing prime numbers to generate secret keys.
[0112] (2) A fragment obfuscation algorithm was designed with the construction of polynomials, random array generation and reversible data obfuscation algorithm as the core.
[0113] 6. The technical solution of the present invention designs the operation process of encrypted storage of private data and information distribution and destruction, which includes:
[0114] (1) The blockchain number storing the private data ciphertext and related information, together with the key fragment, is sent to the user address to ensure that each user address can only receive one key fragment.
[0115] (2) After data distribution is completed, the relevant data will be displayed and destroyed to ensure data security.
[0116] 7. The technical solution of the present invention designs the operation process of key recovery verification and private data access, which includes:
[0117] (1) Recover the data pattern of the key fragments through the reverse data obfuscation algorithm.
[0118] (2) Substitute the corresponding data in the data combination into the Lagrange basis function and the Lagrange difference polynomial for calculation, restore the polynomial generated in the encryption process, and obtain the prime number combination used to generate the secret key.
[0119] (3) Use the modified RSA algorithm and prime number combination to restore the asymmetric encryption key pair.
[0120] (4) Use the secret key pair to decrypt the private data ciphertext 1 stored in the block.
[0121] (5) The decrypted result is irreversibly encrypted again and compared with the private data ciphertext 2 stored in the block to determine the original content of the private data. BRIEF DESCRIPTION OF THE DRAWINGS
[0122] Figure 1 Schematic diagram of the threshold signature scheme.
[0123] Figure 2 An example diagram of sharing private data for private data application scenarios with organization as the isolation granularity.
[0124] Figure 3 Schematic diagram of the fragment obfuscation algorithm flow.
[0125] Figure 4 FIG. 1 is a flow chart of step 1 in an embodiment of the present invention.
[0126] Figure 5 The figure is a flow chart of step one and step two in one embodiment of the present invention.
[0127] Figure 6 Schematic diagram of the process of step three in one embodiment of the present invention. DETAILED DESCRIPTION
[0128] The present invention is further described below in conjunction with the accompanying drawings.
[0129] Embodiment: A blockchain private data access control method based on secure multi-party computing comprises the following steps:
[0130] Step 1: Generate a key pair and confuse key fragments; including:
[0131] Step 11: When the algorithm input receives the private data pd to be processed, the minimum threshold value m for accessing the private data (the domain of m should satisfy 0<m≤n, but for the sake of system fault tolerance and security, 1<m<n is recommended), and the number of users n with access rights to the private data (i.e., the user addresses that can access the private data, which can be determined by the number of addresses), the modified RSA algorithm overloading method I is executed, and the prime numbers p, q and the secret key pairs A and B are obtained, and the generation of the secret key pair is completed;
[0132] Step 12: Fragment the prime numbers p and q temporarily stored in step 11 to obtain n secret key fragments kf.
[0133] Step 2: Encrypted storage of private data and information distribution and destruction; including:
[0134] Step 21: Randomly select any key from the key pair A and B, encrypt the private data pd, and obtain the ciphertext S1.
[0135] Step 22: Encrypt the private data pd using an irreversible encryption algorithm to obtain ciphertext S2;
[0136] Step 23: The ciphertext S1 and ciphertext S2 are stored in the blockchain. The block also needs to store necessary information such as the block time and the minimum threshold value m;
[0137] Step 24: After the block storage operation is completed, the block number corresponding to the private data is obtained; at this time, the block number together with the secret key fragment kf generated in step 12 is distributed to each user address with access rights to the private data. At this time, each user will only receive one kf and cannot know the kf content of other users. In addition, the kf of the data obfuscation algorithm cannot simply reverse the original data content, which effectively prevents the malicious behavior of potential semi-malicious nodes in the public chain;
[0138] Step 25: After the distribution is completed, all data contents generated in the above process, including p, q, F(x), Array1,…Array4, kf1,…,kf n , A, and B are displayed and destroyed to ensure the security of data and processes.
[0139] Step 3: Secret key recovery verification and private data access; including:
[0140] Step 31: First, perform the reverse data obfuscation algorithm on each key fragment, that is, restore the key fragment kf to the original data format x p ,x q ,F p (x p ),F q (x q ); Here, the i-th secret key fragment is kf i , the restored data combination is x pi ,x qi ,F p (x pi ),F q (x qi ), let the data set composed of all m data combinations be Φ;
[0141] Step 32: For different prime number subscripts p and q, calculate the Lagrangian basis function l of each data combination in Φ pi (x), l qi (x) and the Lagrangian difference polynomial L p (x), L q (x), where L p (x), L q The constant terms in (x) are denoted as p', q';
[0142] If the key fragments provided by the decryption party are all the key fragments distributed when this block was generated, then the calculated L p (x), L q(x) is the polynomial F constructed in step 12 p (x), F q (x), and p', q' correspond to the prime numbers p, q. So far, the original prime numbers p, q have been obtained. If any of the secret key fragments are illegal, the process can still be completed normally, but the two polynomials and two constant terms obtained are meaningless and will be reflected in the subsequent private key recovery and verification links.
[0143] Step 33: Start executing the modified RSA algorithm overloading method II, taking the two constant items p' and q' obtained in step 32 as input items, and obtain a pair of secret key pairs C and D;
[0144] If the key fragments provided by the decryption party are all the key fragments distributed when this block was generated, then the key pair C and D generated at this time will be the same as A and B. Otherwise, it will be a brand new key pair.
[0145] Step 34: Use secret keys C and D to asymmetrically decrypt the ciphertext S1 in the block to obtain plaintext data d1 and d2;
[0146] Step 35: Use an irreversible encryption algorithm to encrypt the plaintext data d1 and d2 to obtain ciphertext S3 and ciphertext S4, and compare the ciphertext S3 and ciphertext S4 with the ciphertext S2. If there is a match, it proves that the plaintext data d before the encryption of the match is the private data pd, that is, the verification passes. At this time, the plaintext data d is returned to the decryption party to complete the private data access; otherwise, it is considered that the node maliciously accesses the private data and the access request is rejected.
[0147] This embodiment further illustrates that the algorithm for fragment obfuscation in step 12 is as follows:
[0148] Step 121: Using the known minimum threshold value m, construct a polynomial F(x) of the highest degree t=m-1:
[0149] F(x)=u+a1x+a2x 2 +…+a t x t =u+∑a t x t ;
[0150] In the formula, the polynomial coefficients a1, a2, …, a in F(x) are t They are all randomly generated by the system. The constant u is the input value of the fragment confusion algorithm, that is, the prime number p or q generated in step 11;
[0151] Get the polynomials corresponding to p and q, respectively denoted as F p (x) and F q (x);
[0152] Step 122: Using the known number of users n, randomly generate two random arrays of length n and with different elements and
[0153] Step 123: Substitute the values of the above two arrays into the polynomial F p (x) and F q (x) to get the polynomial result array Array3[F p (x p1 ),...,F p (x pn )]and
[0154] Step 124: The data of the above four arrays are taken out according to the same array index. For example, when the index is 1, the data taken out is as follows: x p1 ,x q1 ,F p (x p1 ),F q (x q1 ); At the same time, the reversible data obfuscation algorithm is used to process each group of data taken out; Here, it is assumed that each group of data processed by the reversible data obfuscation algorithm is kf1,…,kf n .
[0155] This embodiment further illustrates that the RSA algorithm overloading method I in step 11 is specifically as follows: when no parameters are passed in, it is a normal RSA algorithm process, that is, sufficiently large and different prime numbers p and q are randomly generated and a pair of secret keys A and B are generated according to the process; the difference is that the prime numbers p and q need to be temporarily stored at this time.
[0156] This embodiment further illustrates that the RSA algorithm overloading method II in step 33 is specifically: allowing the specified prime numbers p and q to be passed in, and then skipping the original RSA prime number selection process (i.e., RSA algorithm step 1 in the background introduction), and directly executing the subsequent process, and finally generating a pair of secret keys A and B.
[0157] The main implementation method of the above embodiment is to use smart contracts as a carrier to implement the process in the scheme, and by publishing contracts, the contracts are deployed to various access nodes in the public chain, so that the public chain has the ability to publicly store private data. That is, private data coexists in the public blockchain like other data, and all public chain participants can prove the authenticity of the private data, but access to the plaintext content of private data requires verification by the contract. The following will take the communication room smart security system combined with the blockchain capability platform as an example to show how to use the technical solution of the above embodiment to control access to private data.
[0158] The communication room smart security system is a comprehensive system for managing the security of the communication room. The blockchain capability platform is a capability base responsible for providing various types of blockchain capabilities to the application platform. The main module that uses blockchain capabilities is the password access strategy module of the room system. The following is a brief introduction to the module background to facilitate understanding of the deployment details of the solution:
[0159] Due to the construction of the computer room and other work, there are frequent and large numbers of construction workers who temporarily enter the computer room. At this time, it is cumbersome to frequently modify the personnel registration information of the computer room access control equipment, so the access control password is used to release such personnel. However, due to security process considerations, the computer room system will not provide a permanent password for the release of temporary personnel, but a temporary password with a time limit. However, considering that there will be night construction, it is more labor-intensive to arrange system managers to provide passwords to construction personnel at night. Sending the password to the construction personnel too early will have certain security risks. The time of sending the password should be infinitely close to the time when the construction personnel visit the computer room. It is best to send the temporary password after the computer room personnel have arrived at the computer room access control.
[0160] Therefore, using the blockchain capability based on the technical solution of the above embodiment, when there is a need to enter the computer room for construction, the computer room system will directly generate a temporary password corresponding to the computer room access control, and the effective period of the password will be managed by the computer room system. After the temporary password is generated, the computer room system stores the temporary password as private data on the block through the open interface of the blockchain platform, and inputs the number of key fragments to be generated and the threshold value for viewing the password. The key fragments will be redistributed through the computer room system, usually to construction personnel and corresponding computer room managers, and the computer room system will save the corresponding block number and retain a copy of the key fragment.
[0161] When construction workers arrive at the computer room, they will be divided into two modes: direct authorization and system proxy to obtain a temporary password.
[0162] In the direct authorization mode, the construction personnel input the key fragments into the computer room system mobile client, and the system will notify the computer room manager. After the manager confirms the personnel information, he will also provide the key fragments to the computer room system. The system completes the collection of key fragments at this time and starts the private data recovery process by calling the open interface of the blockchain platform. This solution is suitable for situations where there are computer room managers on duty.
[0163] In the system proxy mode, the construction personnel input the key fragments into the computer room system mobile client. At this time, the system will verify the identity of the construction personnel and require the construction personnel to perform live face recognition and other authentication operations on the client. After a series of verifications such as face recognition are passed, the system will transfer the key fragments it retains and the key fragments provided by the construction personnel to the open interface of the blockchain platform to start the private data recovery process. This solution is suitable for unattended computer rooms.
[0164] The smart contract deployed in the blockchain platform will restore the private data according to the established process after the interface is called. After successful verification and recovery, the private data, that is, the temporary password, will be returned to the computer room system. The computer room system will then return the data to the construction personnel to realize access control.
[0165] It is not difficult to see from the above application examples that there is no entity concept of users in the blockchain capability platform and smart contracts. The platform and the contract are only responsible for the key fragments. Any penetration attack by forging user identities is invalid for the platform and the contract.
[0166] In particular, in the above application examples, all private key fragments are sent to the computer room system for distribution. This operation is based on the particularity of the application scenario. The contract does not constrain the user addresses that can access private data to be different in the input items of step 1. If all secret key fragments need to be sent to the same address, only n consistent user addresses need to be passed in the interface. Although such centralized distribution of secret key fragments will cause a certain security degradation, using certain encryption transmission methods during the transmission process can effectively prevent data leakage.
[0167] At the same time, for the use restriction of the threshold value m, the definition domain of m explained in step 1 should satisfy 0<m≤n, but for the sake of system fault tolerance and security considerations, it is recommended to be 1<m<n. The situation in this embodiment is m=2, n=3. In some usage scenarios, m=n or m=1 is required. For example, private data that is more important and involves information from multiple parties usually requires all participants to be present when decrypting, that is, to provide full private key fragments (m=n). From the perspective of technical implementation, this situation can also be implemented in this solution, but there will be serious single point failures in actual operation, so it is not recommended.
[0168] In some cases where private data is stored by a single party, such as the construction workers in this example needing a temporary password, this is essentially a scenario where a single party accesses private data. However, for the sake of system security, it is recommended to add some centralized systems to the scenario where m=1 to act as holders of other private key fragments, thereby improving the security of access to private data by creating threshold scenarios.
[0169] Obviously, the above embodiments are only examples for clearly explaining the present invention, and are not intended to limit the implementation of the present invention. For ordinary technicians in the relevant technical field, other different forms of changes or modifications can be made based on the above description; it is not necessary and impossible to list all the implementation methods here; and the obvious changes or modifications derived from them are still within the protection scope of the present invention.
Claims
1. A blockchain private data access control method based on secure multi-party computing, characterized by: The following steps are involved: Step 1: Generate the key pair and confuse the key fragments; Step 2: Encrypted storage of private data and information distribution and destruction; Step 3: Secret key recovery verification and private data access.
2. The blockchain private data access control method based on secure multi-party computing according to claim 1 is characterized in that: The step 1 specifically includes: Step 11: When the algorithm input receives the private data pd to be processed, the minimum threshold value m for accessing the private data, and the number of users n with access rights to the private data, the modified RSA algorithm overloading method I is executed, and the prime numbers p, q and the secret key pair A, B are obtained, and the generation of the secret key pair is completed; Step 12: Fragment the prime numbers p and q temporarily stored in step 11 to obtain n secret key fragments kf.
3. The blockchain private data access control method based on secure multi-party computing according to claim 2 is characterized in that: The algorithm for fragment obfuscation in step 12 is as follows: Step 121: Using the known minimum threshold value m, construct a polynomial F(x) of the highest degree t=m-1: F(x)=u+a1x+a2x 2 +…+a t x t =u+∑a t x t ; In the formula, the polynomial coefficients a1, a2, …, a in F(x) are t They are all randomly generated by the system. The constant u is the input value of the fragment confusion algorithm, that is, the prime number p or q generated in step 11; Get the polynomials corresponding to p and q, respectively denoted as F p (x) and F q (x); Step 122: Using the known number of users n, randomly generate two random arrays of length n and with different elements and Step 123: Substitute the values of the above two arrays into the polynomial F p (x) and F q (x) to get the polynomial result array and Step 124: The data of the above four arrays are taken out according to the same array index. For example, when the index is 1, the data taken out is as follows: x p1 ,x q1 ,F p (x p1 ),F q (x q1 ); At the same time, the reversible data obfuscation algorithm is used to process each group of data taken out; Here, it is assumed that each group of data processed by the reversible data obfuscation algorithm is kf1,…,kf n .
4. The blockchain private data access control method based on secure multi-party computing according to claim 2 is characterized in that: The RSA algorithm overloading method I in step 11 is specifically as follows: when no parameters are passed in, it is a normal RSA algorithm process, that is, sufficiently large and different prime numbers p and q are randomly generated and a pair of secret keys A and B are generated according to the process; the difference is that the prime numbers p and q need to be temporarily stored at this time.
5. The method for controlling access to private data in blockchain based on secure multi-party computing according to claim 3 is characterized in that: The step 2 is executed after step 11 is completed, and specifically includes: Step 21: Randomly select any key from the key pair A and B, encrypt the private data pd, and obtain the ciphertext S1; Step 22: Encrypt the private data pd using an irreversible encryption algorithm to obtain ciphertext S2; Step 23: Store the ciphertext S1 and ciphertext S2 in the blockchain. The block also needs to store the block time and the minimum threshold value m. Step 24: After the block storage operation is completed, the block number corresponding to the private data is obtained; at this time, the block number together with the secret key fragment kf generated in step 12 is distributed to each user address with access rights to the private data. At this time, each user will only receive one copy of kf and cannot know the kf content of other users; Step 25: After the distribution is completed, all data content generated in the above process needs to be explicitly destroyed to ensure the security of data and processes.
6. The blockchain private data access control method based on secure multi-party computing according to claim 5 is characterized in that: Step 3 is the verification and access step, which needs to be executed only when the input end receives the following information: ① request information for accessing private data in a specified block; ② providing the number of key fragments kf1,…,kf that meet the minimum threshold value m of the block. m .
7. The blockchain private data access control method based on secure multi-party computing according to claim 6 is characterized in that: The process of step three includes: Step 31: First, perform the reverse data obfuscation algorithm on each key fragment, that is, restore the key fragment kf to the original data format x p ,x q ,F p (x p ),F q (x q ); Here, the i-th secret key fragment is kf i , the restored data combination is x pi ,x qi ,F p (x pi ),F q (x qi ), let the data set consisting of all m data combinations be Φ; Step 32: For different prime number subscripts p and q, calculate the Lagrangian basis function l of each data combination in Φ pi (x), l qi (x) and the Lagrangian difference polynomial L p (x), L q (x), where L p (x), L q The constant terms in (x) are denoted as p', q'; If the key fragments provided by the decryption party are all the key fragments distributed when this block was generated, then the calculated L p (x), L q (x) is the polynomial F constructed in step 12 p (x), F q (x), and p', q' correspond to the prime numbers p, q. So far, the original prime numbers p, q have been obtained. If any of the secret key fragments are illegal, the process is still completed normally, but the two polynomials and two constant terms obtained are meaningless and will be reflected in the subsequent private key recovery and verification process. Step 33: Start executing the modified RSA algorithm overloading method II, taking the two constant items p' and q' obtained in step 32 as input items, and obtain a pair of secret key pairs C and D; If the key fragments provided by the decryption party are all the key fragments distributed when this block was generated, then the key pair C and D generated at this time will be the same as A and B. Otherwise, it will be a brand new key pair. Step 34: Use secret keys C and D to asymmetrically decrypt the ciphertext S1 in the block to obtain plaintext data d1 and d2; Step 35: Use an irreversible encryption algorithm to encrypt the plaintext data d1 and d2 to obtain ciphertext S3 and ciphertext S4, and compare the ciphertext S3 and ciphertext S4 with the ciphertext S2. If there is a match, it proves that the plaintext data d before the encryption of the match is the private data pd, that is, the verification passes. At this time, the plaintext data d is returned to the decryption party to complete the private data access; otherwise, it is considered that the node maliciously accesses the private data and the access request is rejected.
8. The method for controlling access to private data in blockchain based on secure multi-party computing according to claim 7 is characterized in that: The RSA algorithm overloading method II in step 33 is specifically as follows: allowing the specified prime numbers p and q to be passed in, and then skipping the original RSA prime number selection process, directly executing the subsequent process, and finally generating a pair of secret keys A and B.
Citation Information
Patent Citations
Blockchain data access control method and device based on smart contract
CN111127206A
Alliance chain privacy protection method based on secure multi-party computing
CN113645020A
Secure multi-party computing privacy protection system and method based on block chain
CN117040761A