A method and device for protecting blockchain privacy data
By initializing system parameters and generating random public-private key pairs in a trusted data center in blockchain technology, combined with smart contract verification, the risk of privacy data leakage is solved and the protection strength and security of blockchain privacy data are improved.
Patent Information
- Application Number
- CN202110697894.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-06-23
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2041-06-23
AI Technical Summary
There is a risk of leakage in the protection of private data in blockchain technology. Especially in the process of data storage, communication and transmission, it is difficult to take timely and effective measures. Existing technology cannot effectively prevent the leakage of private data.
By initializing system parameters in the trusted data center, generating part of the user's private key, and using random parameters to generate a new public-private key pair, combined with smart contract verification of signature messages and ring signature evidence, the security of private data is ensured.
It improves the protection intensity of private data in the blockchain, reduces the correlation between user identity and blockchain data storage address, and ensures the security and unforgeability of private data.
Smart Images

Figure CN113360943B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of blockchain technology, and in particular to a method and device for protecting blockchain privacy data, an electronic device, and a storage medium. Background Art
[0002] Blockchain technology, also known as distributed ledger technology, is a technology in which several node devices jointly participate in bookkeeping, storage and maintenance of a complete distributed database.
[0003] For the node devices of the blockchain, it is necessary to store and maintain the blockchain data stored on it. Due to the open and transparent nature of the blockchain, more encryption calculations are required for privacy data to protect it.
[0004] Compared with traditional privacy data protection, since the data on the blockchain cannot be deleted or tampered with, when users find that certain addresses or private data have been leaked, they cannot take effective rescue measures in time. Therefore, the privacy protection issue of data storage using blockchain technology is particularly important. Important information in the blockchain requires special processing to prevent privacy leaks.
[0005] Existing cloud service SaaS systems and blockchain application systems may have the risk of privacy data leakage during data storage, communication and transmission. Summary of the invention
[0006] The present invention provides a method and device for protecting blockchain privacy data, an electronic device and a storage medium, which are used to solve the defects in the prior art and improve the protection of privacy data in the blockchain.
[0007] The present invention provides a method for protecting blockchain privacy data, which is used in a trusted data center;
[0008] The method comprises:
[0009] Initialize system parameters of the trusted data center;
[0010] The trusted data center receives the user's application for joining, stores the user's identity, generates a partial private key of the user based on the initialized system parameters, and sends the partial private key to the user;
[0011] The random parameter generated by the user is used as a secret value, and a new public-private key pair is generated based on the secret value and part of the private key and sent to the trusted data center, so that the trusted data center initiates a certificate storage transaction including a signed message;
[0012] The signature message of the trusted data center is verified through a smart contract. If passed, the signature message and private key are published, and the user's identity signature for the smart contract through the private key is received.
[0013] According to an embodiment of the present invention, a method for protecting blockchain privacy data is provided, the method further comprising:
[0014] Send the identity information, random parameters, identity identifier and identity signature submitted by the user participating in the smart contract to the trusted data center for identity signature verification; wherein the identity signature includes a signed message;
[0015] If the verification is successful, the trusted data center signs the signature message, generates a ring signature evidence and returns it to the user;
[0016] Receive the ring signature evidence and identity signature sent to the smart contract by the user participating in the smart contract, trigger the smart contract to verify the ring signature evidence and the identity signature, and store the evidence after the verification is passed, otherwise refuse to store the evidence.
[0017] According to a method for protecting blockchain privacy data provided by an embodiment of the present invention, system parameters of a trusted data center are initialized, including:
[0018] Let G1 and G2 be cyclic additive and cyclic multiplicative groups of order prime number q, P be the generator of G1, and construct a bilinear mapping e:G1×G1→G2;
[0019] Choose two hash functions with higher security as the function for calculating the hash value H2:{0,1} * →G1;
[0020] The trusted data center selects the initial private key as The initial public key is P0=sP, and the set of signer numbers L is represented by L={ID i |i=1,2,…,n}, the system parameters of the generated trusted data center are Params={G1,G2,H1,H2,P,P0,q,e}.
[0021] According to a method for protecting blockchain privacy data provided by an embodiment of the present invention, the trusted data center generates a partial private key of a user based on initialized system parameters, and sends the partial private key to the user; comprising:
[0022] The trusted data center obtains the user's partial private key D according to the initial private key and the hash function. i =sH2(ID i ), Q i =H2(ID i );
[0023] The partial private key (Q i ,D i ) is sent to the user.
[0024] According to a method for protecting blockchain privacy data provided by an embodiment of the present invention, the user generates a random parameter as a secret value, and generates a new public-private key pair based on the secret value and sends it to a trusted data center, including:
[0025] The user chooses a random parameter x i As the secret value, where Z q * represents the set of prime numbers;
[0026] Generating a new public-private key pair based on the secret value includes:
[0027] Private key: S i =x i D i =x i Q i ;
[0028] Public key: (x i ,y i )=(x i Q i ,x i P0), where (i=1,2,…,n);
[0029] The new public-private key pair is sent to the trusted data center.
[0030] According to a method for protecting blockchain privacy data provided by an embodiment of the present invention, the trusted data center signs the signature message, generates a ring signature evidence and returns it to the user, including:
[0031] The trusted data center determines the identity of each user, the user's signature result for the target signature message, and the weighted private key based on the randomly selected first prime number and the private key of each user;
[0032] Determine a partial weighted private key according to the first prime number, the signature result of the user on the target signature message, and the private key of the user;
[0033] Encrypt according to the randomly selected second prime number, the hash function, the weighted private key, the partial weighted private key, the private key, and the user signature on the ring to obtain the encrypted private key;
[0034] The ring signature is determined based on the signature information, the weighted private key, the encrypted private key and the identity of each user, and the ring signature evidence is generated based on the signed message and the ring signature and returned to the user.
[0035] According to an embodiment of the present invention, a method for protecting blockchain privacy data is provided, which triggers the smart contract to verify the ring signature evidence and the identity signature, and stores the evidence after the verification is passed, otherwise the evidence is refused, including:
[0036] The verifier that triggers the smart contract verifies the legitimacy of the public key through the first equation;
[0037] If the first equation is established, verify whether the second equation is established;
[0038] If the second equation holds true, the signature is valid and the evidence is stored; otherwise, it is invalid and the evidence is rejected;
[0039] The first equation includes: e(X i ,P0)=e(Q i ,Y i )
[0040] Among them, X i is the private key of user i, P0 is the public key of user i, Q i is the partial private key of user i, Y i Sign the ring user of user i;
[0041] The second equation is:
[0042] Among them, e is a bilinear map, m is a signature message, and U i is the identity of user i;
[0043] h i Identify user i with identity U i The signature result of message m, h i =H1(m||L||U i );
[0044] L={ID i |i=1,2,…,n}, represents the set of signer numbers;
[0045] P is the generator of the cyclic additive group of order prime number q, and V is the weighted private key.
[0046] The embodiment of the present invention further provides a blockchain privacy data protection device, which is arranged in a trusted data center; the device comprises:
[0047] Parameter setting module, used to initialize system parameters of the trusted data center;
[0048] A first processing module is used to receive a user's joining application through a trusted data center, store the user's identity, generate a partial private key of the user based on initialized system parameters through the trusted data center, and send the partial private key to the user;
[0049] A second processing module is used to use the random parameter generated by the user as a secret value, and generate a new public-private key pair based on the secret value and a part of the private key, and send the new public-private key pair to the trusted data center, so that the trusted data center initiates a certificate storage transaction including a signed message;
[0050] The signature module is used to verify the signature message of the trusted data center through the smart contract. If passed, it publishes the signature message and private key, and receives the identity signature of the user on the smart contract through the private key.
[0051] According to an embodiment of the present invention, a device for protecting blockchain privacy data is provided, the device further comprising:
[0052] An identity signature verification module, used to send the identity information, random parameters, identity identifier and identity signature submitted by the user participating in the smart contract to the trusted data center for identity signature verification; wherein the identity signature includes a signed message;
[0053] A signature evidence generation module, used for, if the verification is successful, the trusted data center to sign the signature message, generate a ring signature evidence and return it to the user;
[0054] The signature verification module is used to receive the ring signature evidence and the identity signature sent to the smart contract by the user participating in the smart contract, trigger the smart contract to verify the ring signature evidence and the identity signature, and store the evidence after the verification is passed, otherwise the evidence is rejected.
[0055] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps of the method for protecting blockchain privacy data as described in any one of the above are implemented.
[0056] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of any of the above-described methods for protecting blockchain privacy data.
[0057] The method and device for protecting the privacy data of the blockchain provided by the present invention do not directly generate a private key according to the user's application, but first generate a part of the private key, generate a random parameter as a secret value, and generate a new public-private key pair based on the secret value and the part of the private key and send it to the trusted data center. The signature message of the trusted data center is verified through a smart contract. If passed, the signature message and the private key are published, and the identity signature of the user for the smart contract through the private key is received. Since the random parameters are random, the generated public and private keys will also add random factors, thereby improving the protection of the privacy data in the blockchain.
[0058] In addition, the trusted data center signs the signed message, generates a ring signature evidence and returns it to the user, receives the ring signature evidence and identity signature sent to the smart contract by the users participating in the smart contract, triggers the smart contract to verify the ring signature evidence and identity signature, and stores the evidence after the verification. Due to the introduction of random parameters, the correlation between the user identity and the data storage address of the blockchain can be reduced, ensuring the security of private data. BRIEF DESCRIPTION OF THE DRAWINGS
[0059] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0060] Figure 1 This is one of the flow charts of the method for protecting blockchain privacy data provided by the present invention;
[0061] Figure 2 This is the second flow chart of the method for protecting blockchain privacy data provided by the present invention;
[0062] Figure 3 This is the third flow chart of the method for protecting blockchain privacy data provided by the present invention;
[0063] Figure 4 It is a structural schematic diagram of the blockchain privacy data protection device provided by the present invention;
[0064] Figure 5 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0065] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0066] The embodiment of the present invention discloses a method for protecting blockchain privacy data. Figure 1 ,include:
[0067] Step 101: Initialize system parameters of the trusted data center.
[0068] Specifically, step 101 includes the following steps 111 to 113:
[0069] Step 111: Assume G1 and G2 are cyclic additive groups and cyclic multiplicative groups of order prime number q, P is the generator of G1, and construct a bilinear mapping e:G1×G1→G2.
[0070] Step 112: Select two hash functions with higher security as the functions for calculating the hash value. H2:{0,1} * →G1.
[0071] Step 113: The trusted data center selects an initial private key as The initial public key is P0=sP, and the set of signer numbers L is represented by L={ID i |i=1,2,…,n}, the system parameters of the generated trusted data center are Params={G1,G2,H1,H2,P,P0,q,e}.
[0072] Step 102: The trusted data center receives the user's application for joining, stores the user's identity, generates a partial private key of the user based on the initialized system parameters, and sends the partial private key to the user.
[0073] Specifically, step 102 includes:
[0074] Step 121: The trusted data center obtains the user's partial private key D according to the initial private key and the hash function. i =sH2(ID i ), Q i =H2(ID i ).
[0075] Step 122: Send the partial private key (Q i ,D i) is sent to the user.
[0076] In this embodiment, after receiving the user's joining application, the trusted data center generates a partial private key and returns it to the user, so that the user generates a public-private key pair based on the partial private key.
[0077] Step 103: Use the random parameter generated by the user as a secret value, and generate a new public-private key pair based on the secret value and part of the private key, and send it to the trusted data center, so that the trusted data center initiates an evidence transaction including a signed message.
[0078] Specifically, step 103 includes the following steps 131 to 133:
[0079] Step 131: Determine the random parameter x according to the user's selection instruction. i As the secret value, where Z q * Represents the set of prime numbers.
[0080] Step 132, generating a new public-private key pair based on the secret value, comprises:
[0081] Private key: S i =x i D i =x i Q i ;
[0082] Public key: (x i ,y i )=(x i Q i ,x i P0), where (i=1,2,…,n);
[0083] Among them, (Q i , D i ) is the partial private key, P0 is the initial public key, and s is the initial private key.
[0084] Step 133: Send the new public-private key pair to the trusted data center.
[0085] Through steps 131 to 133, by adding random parameters to generate a public-private key pair, the computational difficulty can be increased to prevent privacy leakage.
[0086] Step 104: Verify the signature message of the trusted data center through the smart contract. If passed, publish the signature message and private key, and receive the user's identity signature on the smart contract through the private key.
[0087] The method for protecting the privacy data of the blockchain provided by the embodiment of the present invention does not directly generate a private key according to the user's application, but first generates a partial private key, generates a random parameter as a secret value, and generates a new public-private key pair based on the secret value and the partial private key and sends it to the trusted data center. The signature message of the trusted data center is verified through a smart contract. If passed, the signature message and the private key are published, and the identity signature of the user for the smart contract through the private key is received. Since the random parameters are random, the generated public and private keys will also add random factors, thereby improving the protection of the privacy data in the blockchain.
[0088] Furthermore, after step 104, the user who is a participant of the trusted data center platform provides a key certificate, and the users of the platform participants can achieve identity authentication. Figure 2 , the blockchain privacy data protection method disclosed in the embodiment of the present invention also includes:
[0089] Step 201: send the identity information, random parameters, identity identifier and identity signature submitted by the user participating in the smart contract to the trusted data center for identity signature verification.
[0090] Among them, the identity signature includes: signed message.
[0091] Step 202: If the verification is successful, the trusted data center signs the signature message, generates a ring signature evidence and returns it to the user.
[0092] Specifically, step 202 includes:
[0093] Step 221: The trusted data center determines the identity of each user, the user's signature result h for the target signature message, and the weighted private key based on the randomly selected first prime number and the private key of each user.
[0094] Step 222: Determine a partial weighted private key T according to the first prime number, the user's signature result h on the target signature message, and the user's private key.
[0095] Step 223: The second prime number randomly selected, the hash function H2, the weighted private key V, the partial weighted private key T, the private key X k 、User signature Y on the ring k Encrypt and obtain the encrypted private key t.
[0096] Specifically, select the second prime number r∈{0,1} * , calculate the partial weighted private key T = (h k +r k )Q k , the encrypted private key t=H2(T,V,X k ,Y k,r), r is kept confidential.
[0097] Step 224: Determine the ring signature based on the signature information, the weighted private key, the encrypted private key, and the identity of each user, and generate the ring signature evidence based on the signed message and the ring signature and return it to the user.
[0098] The ring signature is σ=(m,U1,U2,…,U n ,V,t), the ring signature evidence is (m,σ m ).
[0099] Step 203: Receive the ring signature evidence and identity signature sent to the smart contract by the user participating in the smart contract, trigger the smart contract to verify the ring signature evidence and the identity signature, and store the evidence after the verification is passed, otherwise refuse to store the evidence.
[0100] Specifically, step 203 includes:
[0101] Step 231: The verifier that triggers the smart contract verifies the legitimacy of the public key through the first equation.
[0102] Step 232: If the first equation is established, verify whether the second equation is established.
[0103] Step 233: If the second equation is established, the signature is valid and the evidence is stored; otherwise, it is invalid and the evidence is rejected.
[0104] The first equation includes the following equation (1):
[0105] e(X i ,P0)=e(Q i ,Y i ) (1)
[0106] Among them, X i is the private key of user i, P0 is the public key of user i, Q i is the partial private key of user i, Y i Sign the ring user of user i;
[0107] The second equation includes the following equation (2):
[0108]
[0109] Among them, e is a bilinear map, m is a signature message, and U i is the identity of user i;
[0110] h i Identify user i with identity U i The signature result of message m, h i =H1(m||L||Ui );
[0111] L={ID i |i=1,2,…,n}, represents the set of signer numbers;
[0112] P is the generator of the cyclic additive group of order prime number q, and V is the weighted private key.
[0113] The method for protecting blockchain privacy data provided by the embodiment of the present invention signs the signature message through a trusted data center, generates ring signature evidence and returns it to the user, receives the ring signature evidence and identity signature sent to the smart contract by the user participating in the smart contract, triggers the smart contract to verify the ring signature evidence and identity signature, and stores the evidence after the verification. Due to the introduction of random parameters, the correlation between the user identity and the data storage address of the blockchain can be reduced, thereby ensuring the security of privacy data.
[0114] In order to further illustrate the technical solution of the embodiment of the present invention, the embodiment of the present invention also discloses a method for protecting blockchain privacy data, see Figure 3 ,include:
[0115] Step 301: Initialize system parameters of the trusted data center.
[0116] Let G1 and G2 be cyclic additive and cyclic multiplicative groups of order prime number q, P be the generator of G1, and construct a bilinear mapping e:G1×G1→G2;
[0117] Choose two hash functions with higher security as the function for calculating the hash value H2:{0,1} * →G1;
[0118] The trusted data center selects the initial private key as The initial public key is P0=sP, and the set of signer numbers L is represented by L={ID i |i=1,2,…,n}, the system parameters of the generated trusted data center are Params={G1,G2,H1,H2,P,P0,q,e}.
[0119] Step 302: The trusted data computing center extracts part of the private key.
[0120] The trusted data computing center obtains the user ID i Part of the private key D i =sH2(ID i ), Q i =H2(ID i ), and transmit part of the private key (Q i ,D i)Sent to user ID i .
[0121] Step 303: Generate secret parameters.
[0122] User ID i choose as a secret value.
[0123] Step 304: Key distribution.
[0124] User ID i Calculate the private key S i =x i D i =x i Q i .
[0125] Step 305: Generate a public key.
[0126] User ID i Calculate its public key (x i ,y i )=(x i Q i ,x i P0), where (i=1,2,…,n).
[0127] Step 306: Generate an identity signature.
[0128] Let the signature information be m and the actual signer be ID i :
[0129] ①Trusted computing user ID i choose Calculate the identity U i =r i X i (If U i If there are the same ones, reselect r i ), h i =H1(m||L||U i )(where i=1,2,…,n and i≠k).
[0130] Where L is the set of signer IDs, expressed as L = {ID i |i=1,2,…,n}.
[0131] ②When the trusted computing user ID k With ID i If the identity of the same, the trusted computing user ID k choose Computing Identity (If U k with Ui If they are the same, reselect r k ), User ID k The signature result h of the target signature message k =H1(m||L||U k ), weighted private key V = (h k +r k )S k .
[0132] ③Select r∈{0,1} * , calculate the partial weighted private key T = (h k +r k )Q k , the encrypted private key t=H2(T,V,X k ,Y k ,r), r is kept confidential.
[0133] Among them, h k User ID k The signing result of the target signature message;
[0134] ④ Generate identity signature σ=(m,U1,U2,…,U n ,V,t).
[0135] Step 307: The smart contract verifies the ring signature evidence and the identity signature.
[0136] ① The verifier calculates the first equation e(X i ,P0)=e(Q i ,Y i ) Verify the legitimacy of the public key. If the equation holds, calculate h i =H1(m||L||U i )(i=1,2,…,n).
[0137] ②Verify whether the second equation is true or not. If it is true, the signature is valid, otherwise it is invalid.
[0138] The second equation is:
[0139] e is a bilinear map, m is a signature message, U i is the identity of user i;
[0140] Step 308: Authentic signer identity verification.
[0141] If the real secret signer is willing to prove his identity and reveal the secret information (T, X k ,Y k ,r) to the signature verifier, who verifies the equation t=H2(T,V,X k ,Yk ,r),e(Y k ,T)=e(P,V) is true, if both are true, the verification is successful, and the signature verifier determines that the identity of the secret signer is the same as the public key (X k ,Y k ) corresponding to the user ID k .
[0142] In this method, ID k The private key S k =x k Q k , without knowing x k and s case, user ID i Unable to obtain signer ID k The private key S k , so ID i Signer ID cannot be forged k A valid signature.
[0143] The method of this embodiment has the following characteristics:
[0144] (1) Unforgeability
[0145] This method needs to ensure that no one except the real signer and the proxy signer can forge the key to generate a valid signature. In the block generation and verification stage, the master node is responsible for generating new blocks. The generated new blocks contain the signature of the master node itself. Each node needs to verify the signature before it can be linked to the blockchain. The remaining nodes in the network other than the master node cannot generate blocks. Except for the legal blocks generated by the master node and verified by the secondary node, any new blocks are invalid blocks, and the Merkle tree is used to ensure that the data in the newly generated blocks will not be tampered with, which ensures the unforgeability of the newly generated blocks. When each node verifies the transaction, it also needs to verify whether the input and output of the user signature on the verifiable ring are equal. Only after the verification is passed can it be linked to the blockchain, which ensures the unforgeability of the evidence data.
[0146] (2) Correctness
[0147] For the signature verification phase, the verifier ID j By judging formula (1) e(X j ,P0)=e(Q j ,Y j ) For all j=1,2,…,n, the validity of the public key is verified in turn. The equation is obviously established. Continue to calculate h j =H1(m||L||U j ).
[0148] Next, the Validator ID jIn the signature verification phase, it is necessary to verify whether both sides of formula (2) are equal. If they are equal, the verification is successful.
[0149] The proof process is as follows:
[0150]
[0151]
[0152] The above equation is true, indicating that the verification is successful, proving that the signature is valid and correct, and the correctness of the signature algorithm is proven.
[0153] Next, according to the real ring signature authentication algorithm, the real signer ID i (T,T1,V,X k ,Y k ,r) disclosed to the signature verifier ID j , signature verifier ID j First verify the equation e(T,Q k )=e(t1Q k ,Q k )≠1. If yes, the verification process can be continued. From the construction process, we can know that the signature verifier ID j The verification process is as follows (4):
[0154] e(T,X k )=e(t1Q k ,X k )=e(t1X k ,Q k )=e(T1,Q k ) (4)
[0155] The above verification shows that the equation is true. At the same time, the equation t=H2(T1,V,X k ,Y k ,r) is also true, both are satisfied at the same time, so the verification passes and the correctness of the verification algorithm is proved.
[0156] (3) Security
[0157] When the system parameters of the ring signature scheme need to be updated, the member nodes in the ring can verify the signature before the update based on the system parameters in effect at that time. For system parameters, since the secret parameters and private keys are randomly selected, there is no correlation between the two before and after the update. An attacker cannot forge the key before the update based on the key at the current stage. Even if an attacker holds the key before the update, he cannot join the signature ring, and he cannot forge the current correct ring signature value.
[0158] In the initial stage of this scheme, the confidentiality, authenticity and integrity of data can be achieved through the transmission of keys in secure channels. The user's public key, private key and signature verification key are transmitted through secure channels. The channel's secret key can be established through a key exchange protocol, so the use and storage of keys are safe. The SHA256 encryption algorithm is used to encrypt data, and the calculated intermediate values are stored in the data server during the processing. The mathematical problem of SHA256 has not been solved, and the encryption process in the scheme is safe, that is, the storage of ciphertext in the scheme is safe. Therefore, the proposed scheme can ensure the safe storage of data.
[0159] (4) Anonymity
[0160] The data published on the blockchain by users of the trusted computing center is the identification applied for from the trusted data center, that is, the signature value of the user's identity. The data exchange between the nodes of the blockchain uses a fixed and mathematically difficult signature algorithm. The signature scheme meets the requirements of concealment, so the system will not leak the user's private identity information. When the signing user applies to use the blockchain to store data, the algorithm of verifiable ring signature is used to hide the registered user who actually signed. The user can only see the storage record but does not know the source and detailed information of the real address. Based on the untraceability and anonymity of the ring signature, the relationship between the identity of the signing user and the signing account is completely hidden, and the user's real identity information and all transaction records are further hidden. Therefore, the privacy data protection algorithm has good anonymity.
[0161] The following is a description of a blockchain privacy data protection device provided by an embodiment of the present invention. The blockchain privacy data protection device described below and the blockchain privacy data protection method described above can refer to each other.
[0162] The embodiment of the present invention discloses a device for protecting blockchain privacy data, see Figure 4 ,include:
[0163] Parameter setting module 401, used to initialize system parameters of the trusted data center;
[0164] The first processing module 402 is used to receive a user's joining application through the trusted data center, store the user's identity, generate a partial private key of the user based on the initialized system parameters through the trusted data center, and send the partial private key to the user;
[0165] The second processing module 403 is used to use the random parameter generated by the user as a secret value, and generate a new public-private key pair based on the secret value and a part of the private key, and send it to the trusted data center, so that the trusted data center initiates a proof transaction including a signed message;
[0166] The signature module 404 is used to verify the signature message of the trusted data center through the smart contract. If passed, the signature message and private key are published, and the user's identity signature for the smart contract is received through the private key.
[0167] Optionally, the device further comprises:
[0168] An identity signature verification module, used to send the identity information, random parameters, identity identifier and identity signature submitted by the user participating in the smart contract to the trusted data center for identity signature verification; wherein the identity signature includes a signed message;
[0169] A signature evidence generation module, used for, if the verification is successful, the trusted data center to sign the signature message, generate a ring signature evidence and return it to the user;
[0170] The signature verification module is used to receive the ring signature evidence and the identity signature sent to the smart contract by the user participating in the smart contract, trigger the smart contract to verify the ring signature evidence and the identity signature, and store the evidence after the verification is passed, otherwise the evidence is rejected.
[0171] Optionally, the parameter setting module 401 is specifically used to:
[0172] Let G1 and G2 be cyclic additive and cyclic multiplicative groups of order prime number q, P be the generator of G1, and construct a bilinear mapping e:G1×G1→G2;
[0173] Choose two hash functions with higher security as the function for calculating the hash value H2:{0,1} * →G1;
[0174] The trusted data center selects the initial private key as The initial public key is P0=sP, and the set of signer numbers L is represented by L={ID i |i=1,2,…,n}, the system parameters of the generated trusted data center are Params={G1,G2,H1,H2,P,P0,q,e}.
[0175] Optionally, the first processing module 402 is specifically configured to:
[0176] The trusted data center obtains the user's partial private key D according to the initial private key and the hash function. i =sH2(ID i ), Q i =H2(ID i );
[0177] The partial private key (Q i ,Di ) is sent to the user.
[0178] Optionally, the second processing module 403 is specifically configured to:
[0179] The random parameter x is determined by the user's selection instruction. i As the secret value, where Z q * represents the set of prime numbers;
[0180] Generating a new public-private key pair based on the secret value includes:
[0181] Private key: S i =x i D i =x i Q i ;
[0182] Public key: (x i ,y i )=(x i Q i ,x i P0), where (i=1,2,…,n);
[0183] The new public-private key pair is sent to the trusted data center.
[0184] Optionally, the signature evidence generation module is specifically used to:
[0185] Determine, by the trusted data center, the identity of each user, the user's signature result for the target signature message, and the weighted private key based on the randomly selected first prime number and the private key of each user;
[0186] Determine a partial weighted private key according to the first prime number, the signature result of the user on the target signature message, and the private key of the user;
[0187] Encrypt according to the randomly selected second prime number, the hash function, the weighted private key, the partial weighted private key, the private key, and the user signature on the ring to obtain the encrypted private key;
[0188] The ring signature is determined based on the signature information, the weighted private key, the encrypted private key and the identity of each user, and the ring signature evidence is generated based on the signed message and the ring signature and returned to the user.
[0189] Optionally, the signature verification module is specifically used to:
[0190] The verifier that triggers the smart contract verifies the legitimacy of the public key through the first equation;
[0191] If the first equation is established, verify whether the second equation is established;
[0192] If the second equation holds true, the signature is valid and the evidence is stored; otherwise, it is invalid and the evidence is rejected;
[0193] The first equation includes: e(X i ,P0)=e(Q i ,Y i )
[0194] Among them, X i is the private key of user i, P0 is the public key of user i, Q i is the partial private key of user i, Y i Sign the ring user of user i;
[0195] The second equation is:
[0196] Among them, e is a bilinear map, m is a signature message, and U i is the identity of user i;
[0197] h i Identify user i with identity U i The signature result of message m, h i =H1(m||L||U i );
[0198] L={ID i |i=1,2,…,n}, represents the set of signer numbers;
[0199] P is the generator of the cyclic additive group of order prime number q, and V is the weighted private key.
[0200] The device for protecting privacy data in blockchain provided by the embodiment of the present invention does not directly generate a private key according to the user's application, but first generates a partial private key, generates a random parameter as a secret value, and generates a new public-private key pair based on the secret value and the partial private key, which is sent to a trusted data center, and verifies the signature message of the trusted data center through a smart contract. If passed, the signature message and the private key are published, and the identity signature of the user for the smart contract through the private key is received. Since the random parameters are random, the generated public and private keys will also have random factors added to them, thereby improving the protection of privacy data in the blockchain.
[0201] Figure 5 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 5As shown, the electronic device may include: a processor 510, a communication interface 520, a memory 530 and a communication bus 540, wherein the processor 510, the communication interface 520 and the memory 530 communicate with each other through the communication bus 540. The processor 510 may call the logic instructions in the memory 530 to execute the blockchain privacy data protection method, and the method includes:
[0202] Initialize system parameters of the trusted data center;
[0203] The trusted data center receives the user's application for joining, stores the user's identity, generates a partial private key of the user based on the initialized system parameters, and sends the partial private key to the user;
[0204] The random parameter generated by the user is used as a secret value, and a new public-private key pair is generated based on the secret value and part of the private key and sent to the trusted data center, so that the trusted data center initiates a certificate storage transaction including a signed message;
[0205] The signature message of the trusted data center is verified through a smart contract. If passed, the signature message and private key are published, and the user's identity signature for the smart contract through the private key is received.
[0206] In addition, the logic instructions in the above-mentioned memory 530 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.
[0207] On the other hand, the present invention further provides a computer program product, the computer program product comprising a computer program stored on a non-transitory computer-readable storage medium, the computer program comprising program instructions, and when the program instructions are executed by a computer, the computer can execute the blockchain privacy data protection method provided by the above methods, the method comprising:
[0208] Initialize system parameters of the trusted data center;
[0209] The trusted data center receives the user's application for joining, stores the user's identity, generates a partial private key of the user based on the initialized system parameters, and sends the partial private key to the user;
[0210] The random parameter generated by the user is used as a secret value, and a new public-private key pair is generated based on the secret value and part of the private key and sent to the trusted data center, so that the trusted data center initiates a certificate storage transaction including a signed message;
[0211] The signature message of the trusted data center is verified through a smart contract. If passed, the signature message and private key are published, and the user's identity signature for the smart contract through the private key is received.
[0212] In another aspect, the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, which is implemented when the computer program is executed by a processor to perform the above-mentioned blockchain privacy data protection method, the method comprising:
[0213] Initialize system parameters of the trusted data center;
[0214] The trusted data center receives the user's application for joining, stores the user's identity, generates a partial private key of the user based on the initialized system parameters, and sends the partial private key to the user;
[0215] The random parameter generated by the user is used as a secret value, and a new public-private key pair is generated based on the secret value and part of the private key and sent to the trusted data center, so that the trusted data center initiates a certificate storage transaction including a signed message;
[0216] The signature message of the trusted data center is verified through a smart contract. If passed, the signature message and private key are published, and the user's identity signature for the smart contract through the private key is received.
[0217] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0218] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0219] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for protecting blockchain privacy data, characterized in that: Used in trusted data centers; The method comprises: Initialize system parameters of the trusted data center; The trusted data center receives the user's application for joining, stores the user's identity, generates a partial private key of the user based on the initialized system parameters, and sends the partial private key to the user; The random parameter generated by the user is used as a secret value, and a new public-private key pair is generated based on the secret value and part of the private key and sent to the trusted data center, so that the trusted data center initiates a certificate storage transaction including a signed message; Verify the signature message of the trusted data center through the smart contract. If successful, publish the signature message and private key, and receive the identity signature of the user on the smart contract through the private key; The method further comprises: Sending the random parameters, identity identifiers and identity signatures submitted by users participating in the smart contract to the trusted data center for identity signature verification; wherein the identity signature includes a signed message; If the verification is successful, the trusted data center signs the signature message, generates a ring signature evidence and returns it to the user; Receive the ring signature evidence and identity signature sent to the smart contract by the user participating in the smart contract, trigger the smart contract to verify the ring signature evidence and the identity signature, and store the evidence after the verification is passed, otherwise refuse to store the evidence; The trusted data center signs the signed message and generates a ring signature evidence and returns it to the user, including: The trusted data center determines the identity of each user, the user's signature result for the target signature message, and the weighted private key based on the randomly selected first prime number and the private key of each user; Determine a partial weighted private key according to the first prime number, the signature result of the user on the target signature message, and the private key of the user; Encrypt according to the randomly selected second prime number, the hash function, the weighted private key, the partial weighted private key, the private key, and the user signature on the ring to obtain the encrypted private key; Determine the ring signature based on the signature information, the weighted private key, the encrypted private key, and the identity of each user, and generate the ring signature evidence based on the signed message and the ring signature and return it to the user; Among them, the weighted private key is ; The partially weighted private key is ; The encrypted private key is ; Among them, h k User ID k The signature result of the target signature message, r k is the first prime number, S k User ID k The private key, Q k User ID k H2 is one of the highly secure hash functions, T is a partial weighted private key, V is a weighted private key, ID k For the current user, X k is the private key, Y k Signature for the user on the ring, r is the second prime number.
2. The method for protecting blockchain privacy data according to claim 1, characterized in that: Initialize the system parameters of the trusted data center, including: set up , Is a prime number The cyclic additive group and cyclic multiplicative group of , for Generators of , construct a bilinear map ; Choose two highly secure hash functions as the functions for calculating hash values ; represents the set of prime numbers; The trusted data center selects the initial private key as , the initial public key is , the set of signer numbers Expressed as , the system parameters for generating a trusted data center are , where ID i is the signer's ID, and n is the number of signers.
3. The method for protecting blockchain privacy data according to claim 2, characterized in that: The trusted data center generates a partial private key of the user based on the initialized system parameters, and sends the partial private key to the user, including: The trusted data center obtains the user's partial private key based on the initial private key and the hash function. , ; The part of the private key is transmitted through a secure channel Sent to the user.
4. The method for protecting blockchain privacy data according to claim 3 is characterized in that: The random parameter generated by the user is used as a secret value, and a new public-private key pair is generated based on the secret value and sent to a trusted data center, including: The random parameter x is determined by the user's selection instruction. i As the secret value, where , represents the set of prime numbers; Generating a new public-private key pair based on the secret value includes: Private Key: ;D i and Q i User ID i Part of the private key; Public Key: ,in, ; The new public-private key pair is sent to the trusted data center.
5. The method for protecting blockchain privacy data according to claim 2, characterized in that: Trigger the smart contract to verify the ring signature evidence and the identity signature, and store the evidence after the verification is passed, otherwise refuse to store the evidence, including: The verifier that triggers the smart contract verifies the legitimacy of the public key through the first equation; If the first equation is established, verify whether the second equation is established; If the second equation holds true, the signature is valid and the evidence is stored; otherwise, it is invalid and the evidence is rejected; Among them, the first equation includes: ; Among them, X i is the private key of user i, P0 is the initial public key of user i, Q i is the partial private key of user i, Y i Sign the ring user of user i; The second equation is: ; Among them, e is a bilinear map, m is a signature message, and U i is the identity of user i; h i Identify user i with identity U i The signature result of message m, h i =H1(m||L||U i ); H1 is a highly secure hash function; , represents the set of signer numbers; P is the generator of the cyclic additive group of order prime number q, and V is the weighted private key.
6. A device for protecting blockchain privacy data, characterized in that: The device comprises: Parameter setting module, used to initialize system parameters of the trusted data center; A first processing module is used to receive a user's joining application through a trusted data center, store the user's identity, generate a partial private key of the user based on initialized system parameters through the trusted data center, and send the partial private key to the user; A second processing module is used to use the random parameter generated by the user as a secret value, and generate a new public-private key pair based on the secret value and a part of the private key, and send the new public-private key pair to the trusted data center, so that the trusted data center initiates a certificate storage transaction including a signed message; The signature module is used to verify the signature message of the trusted data center through the smart contract. If passed, the signature message and private key are published, and the user's identity signature for the smart contract is received through the private key. The device also includes: An identity signature verification module, used to send the random parameters, identity identifiers and identity signatures submitted by users participating in the smart contract to the trusted data center for identity signature verification; wherein the identity signature includes a signed message; A signature evidence generation module, used for, if the verification is successful, the trusted data center to sign the signature message, generate a ring signature evidence and return it to the user; The signature verification module is used to receive the ring signature evidence and the identity signature sent to the smart contract by the user participating in the smart contract, trigger the smart contract to verify the ring signature evidence and the identity signature, and store the evidence after the verification is passed, otherwise the evidence is rejected; The signature evidence generation module is specifically used to: The trusted data center determines the identity of each user, the user's signature result for the target signature message, and the weighted private key based on the randomly selected first prime number and the private key of each user; Determine a partial weighted private key according to the first prime number, the signature result of the user on the target signature message, and the private key of the user; Encrypt according to the randomly selected second prime number, the hash function, the weighted private key, the partial weighted private key, the private key, and the user signature on the ring to obtain the encrypted private key; Determine the ring signature based on the signature information, the weighted private key, the encrypted private key, and the identity of each user, and generate the ring signature evidence based on the signed message and the ring signature and return it to the user; Among them, the weighted private key is ; The partially weighted private key is ; The encrypted private key is ; Among them, h k User ID k The signature result of the target signature message, r k is the first prime number, S k User ID k The private key, Q k User ID k H2 is one of the highly secure hash functions, T is a partial weighted private key, V is a weighted private key, ID k For the current user, X k is the private key, Y k Signature for the user on the ring, r is the second prime number.
7. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the steps of the blockchain privacy data protection method as described in any one of claims 1 to 5 are implemented.
8. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method for protecting blockchain privacy data as described in any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
Digital signature method and system based on SM2-based identity base
CN108809658A
Motorcade establishment and management method and system based on block chain and PKI authentication mechanism
CN109687976A
Editable, linkable and non-repudiation ring signature method
CN110071812A
Heterogeneous ring signature method
CN112383403A
Blockchain anti-signature traceable certificateless blind signature generation method
CN112532394A
