Block chain data trusted sharing system, shared data verification method, equipment and medium
Through the blockchain data trusted sharing system, homomorphic encryption and zero-knowledge proof technology, the problems of inefficiency and security threats in traditional data sharing are solved, and efficient and secure data sharing and verification are achieved.
Patent Information
- Application Number
- CN202411371505.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-29
- Publication Date
- 2025-01-10
AI Technical Summary
Relying on manual auditing and supervision in traditional data sharing scenarios leads to inefficiency and security threats, and data faces the risk of hacker intrusion and information leakage during the sharing process.
Adopt blockchain data trusted sharing system, and encrypt and verify data through key generation modules, encryption modules, evidence generation modules, sharing modules, statistics modules and verification modules, and use homomorphic encryption algorithms and zero-knowledge proof technology to ensure that Data privacy and security.
It realizes data privacy protection, improves sharing efficiency, reduces human resource consumption, enhances the credibility and transparency of data sharing, and avoids the risk of data leakage.
Smart Images

Figure CN119299088A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of blockchain and privacy computing technology, and in particular to a blockchain data trusted sharing system, a shared data verification method, a device and a medium. Background Art
[0002] In traditional data sharing scenarios, trusted third parties are usually relied upon to implement auditing and supervision of multi-party data. However, this approach faces some challenges in terms of efficiency. The auditing and supervision process increases the complexity of data sharing and leads to a significant increase in time costs.
[0003] In the traditional framework, these processes often rely on manual operations, requiring professional auditors and regulators to invest a lot of time and energy in data verification and supervision, which significantly increases the consumption of human resources. At the same time, data may also be subject to threats such as hacker intrusion and information leakage during the sharing process. These risks constitute potential security challenges in the data sharing process. Summary of the invention
[0004] The purpose of the present invention is to overcome the defects of the above-mentioned prior art and provide a blockchain data trusted sharing system, shared data verification method, device and medium that are verifiable and statistical, have high data privacy protection security and high sharing efficiency.
[0005] The purpose of the present invention can be achieved by the following technical solutions:
[0006] According to a first aspect of the present invention, a blockchain data trusted sharing system is provided, comprising:
[0007] The key generation module is used by the regulatory agency to generate system parameters and public-private key pairs, and publish the system parameters and public keys on the blockchain platform;
[0008] The encryption module is used to encrypt the plaintext data to be shared using a homomorphic encryption algorithm according to the system parameters, and to form a binary shared ciphertext with the obtained encrypted value c of the shared data and the corresponding decryption parameter c';
[0009] The evidence generation module is used to calculate the evidence required for ciphertext verification using zero-knowledge proof technology;
[0010] The sharing module is used to upload the shared ciphertext output by the encryption module and the evidence output by the evidence generation module to the blockchain platform;
[0011] The statistical module is used to perform statistical operations on shared ciphertexts on the blockchain platform according to requirements;
[0012] The verification module is used to read the encrypted value c of the evidence and shared data from the blockchain platform, and use the encrypted value c of the shared data as the commitment of the zero-knowledge proof, and perform zero-knowledge proof verification on the shared ciphertext in combination with the commitment and evidence.
[0013] Preferably, the regulatory agency generates system parameters and a public-private key pair, specifically by: selecting two large prime numbers p and q, calculating n=pg, λ=lcm(p-1,q-1), where lcm() is the least common multiple; randomly selecting an integer is the multiplicative group of natural numbers less than or equal to the square of n, and gcd(n,L(e λ mod n 2 ))=1, where gcd() is the greatest common divisor, L(x)=(x-1) / n; randomly select an integer k <n 2 , calculate f = e k mod n 2 , and f satisfies gcd(n,L(f λ mod n 2 ))=1; randomly select an integer s<n, calculate h=f s mod n 2 , use the generated h as the public key and s as the private key; the system parameters include n, g and f.
[0014] Preferably, the data plaintext to be shared is encrypted using a homomorphic encryption algorithm according to the system parameters, and the encrypted value c of the obtained shared data and the corresponding decryption parameter c' are combined into a binary shared ciphertext, specifically: c=g is calculated according to the system parameters m h r mod n 2 , c′=f r mod n 2 , where m is the plaintext data to be shared, r is the random number for data encryption, and the encrypted value c of the shared data and the corresponding decryption parameter c' form a binary shared ciphertext (c, c').
[0015] Preferably, the statistical module performs statistical operations on the shared ciphertext on the blockchain chain according to the additive homomorphic characteristics of the homomorphic encryption algorithm in the encryption module, specifically:
[0016] En(m1,r1,h,n,g,f)×En(m2,r2,h,n,g,f)=(c1c2,c1′c2′)
[0017]
[0018] The subscripts 1 and 2 correspond to related information of two different data plaintexts that need to be shared.
[0019] Preferably, in the evidence generation module, if m∈[b,b′] is to be verified, evidence required for verifying m≥b and m≤b′ is generated respectively, and the specific evidence generation process includes:
[0020] 1) For the evidence to verify m ≥ b, calculate E = g m-b+1 h r mod n 2 ; For the evidence to verify m≤b′, calculate E=g b′-m+1 h -r mod n 2 ;
[0021] 2) Introduce security parameters l, j, t and T, and randomly select integers α≠0, β∈[0,2 T+j ], let k = α 2 x+β>2 l+j+t+T , randomly select integers r1, r2 and r3, satisfying r1,r2,r3∈[-2 j n 2 +1,2 j n 2 -1] and -rα 2 -r1α-r2∈[-2 j n 2 +1,2 j n 2 -1], calculate
[0022]
[0023]
[0024] The calculated k, E1, E2, and E3 are used as evidence for verifying the ciphertext zero-knowledge proof.
[0025] Preferably, in the verification module,
[0026] Read the shared data encrypted value c on the blockchain as a zero-knowledge proof commitment, then for verification m∈[b,b′], the verification calculation is:
[0027] To verify that m≥b, calculate E=g m-b+1 h r mod n 2 =cg 1-b ;
[0028] To verify that m≤b′, calculate E=g b′-m+1 h -r mod n 2 =c -1 g 1+b′ .
[0029] Combined with the evidence on the blockchain, the shared ciphertext is verified by zero-knowledge proof, where the zero-knowledge proof protocol is:
[0030]
[0031] Among them, PK{x:F(x)} represents a zero-knowledge proof that knowing x makes F(x) true.
[0032] Preferably, the system further comprises a review module, which interacts with the blockchain platform and is used for reviewing the shared ciphertext after decryption by the private key held by the regulatory agency, specifically:
[0033] c″=c / c′ s =g m mod n 2
[0034] m=L(c″) / L(g)mod n
[0035] Among them, L(x)=(x-1) / n.
[0036] According to a second aspect of the present invention, a method for verifying shared data using the blockchain data trusted sharing system is provided, the method comprising:
[0037] The regulatory agency generates system parameters and public-private key pairs through the key generation module, and publishes the system parameters and public keys on the blockchain platform for subsequent data providers to query when encrypting or generating evidence. The regulatory agency also stores the private key for subsequent audits and inspections to crack the ciphertext on the blockchain.
[0038] The data provider uses the homomorphic encryption algorithm to encrypt the plaintext data to be shared through the encryption module according to the system parameters, and composes the encrypted value c of the shared data and the corresponding decryption parameter c' into a binary shared ciphertext, which is then uploaded to the blockchain platform through the sharing module;
[0039] The data provider uses zero-knowledge proof technology to calculate the evidence required for ciphertext verification through the evidence generation module and uploads it to the blockchain platform through the sharing module;
[0040] The encrypted value c of the evidence and shared data is read from the blockchain platform through the verification module, and the encrypted value c of the shared data is used as the commitment of the zero-knowledge proof. The shared ciphertext is verified by combining the commitment and the evidence, and the verification result is stored. The blockchain platform determines whether statistical data is needed according to the needs. If statistics are needed, the ciphertext of the data on the blockchain is counted as the commitment through the statistical module. Otherwise, the ciphertext of the data on the blockchain is directly read as the commitment.
[0041] According to a third aspect of the present invention, there is provided an electronic device, comprising a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the program, any one of the methods described above is implemented.
[0042] According to a fourth aspect of the present invention, there is provided a computer-readable storage medium having a computer program stored thereon, wherein when the program is executed by a processor, any one of the methods described above is implemented.
[0043] Compared with the prior art, the present invention has the following beneficial effects:
[0044] (1) Data privacy protection: This invention introduces privacy computing technology. By integrating the homomorphic encryption algorithm and the commitment scheme in zero-knowledge proof, the encrypted ciphertext not only has security and privacy, but also satisfies additive homomorphism and can be used as a commitment in zero-knowledge proof. The ciphertext can be directly combined with evidence to verify the range of zero-knowledge proof without decryption, thus ensuring the privacy security of data during data verification in multi-party data sharing scenarios and avoiding the risk of data leakage.
[0045] (2) Ciphertext statistics and verification function: The ciphertext data in the system not only satisfies additive homomorphism, but also can be used as a commitment for zero-knowledge proof, supporting statistical operations and verification of encrypted ciphertext data, ensuring the legitimacy and feasibility of the data while protecting the privacy and security of the data.
[0046] (3) Improve sharing efficiency: Blockchain smart contracts automate the statistical integration and verification calculations of data, reducing the need for manual operations and improving the efficiency of data sharing and auditing.
[0047] (4) Facilitate third-party supervision: The private key held by the regulatory agency can decrypt and review the ciphertext on the blockchain, providing a flexible means of supervision while maintaining data security.
[0048] (5) Scalability: The system design allows multi-party participation and is suitable for data sharing scenarios of different scales and types, with good scalability.
[0049] (6) Enhance the credibility of data sharing: Using blockchain as the underlying platform for data sharing, once the data is shared on the chain, it has the characteristics of being tamper-proof and traceable, which enhances the transparency and credibility of data sharing.
[0050] (7) Reduce human resource consumption: Automated data processing reduces dependence on professional auditors and regulators, and reduces human resource consumption. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] Figure 1 This is a schematic diagram of the architecture of the blockchain data trusted sharing system in the embodiment;
[0052] Figure 2 It is a data sharing flow chart of the blockchain data trusted sharing system in the embodiment;
[0053] Figure 3 This is a data statistics verification flow chart of the blockchain data trusted sharing system in the embodiment. DETAILED DESCRIPTION
[0054] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0055] Example
[0056] Blockchain is a decentralized, open, transparent, traceable, and multi-party jointly maintained distributed database. As a new distributed architecture and computing paradigm, it can achieve efficient and reliable data sharing. Combined with privacy computing technology, the shared data on the chain is encrypted and protected to protect the privacy and security of multi-party data. At the same time, smart contracts on the chain can be used to automatically verify the ciphertext data, verifying the legitimacy and feasibility of the data while protecting privacy, which is of great significance to further promote data sharing among multiple parties.
[0057] This embodiment is based on blockchain and privacy computing technology, and proposes a blockchain data trusted sharing system that meets the needs of data sharing and statistical verification while ensuring that data privacy is not leaked. Figure 1 As shown, including:
[0058] The key generation module is used by the regulatory agency to generate system parameters and public-private key pairs, and publish the system parameters and public keys on the blockchain platform;
[0059] The encryption module is used to encrypt the plaintext data to be shared using a homomorphic encryption algorithm according to the system parameters, and to form a binary shared ciphertext with the obtained encrypted value c of the shared data and the corresponding decryption parameter c';
[0060] The evidence generation module is used to calculate the evidence required for ciphertext verification using zero-knowledge proof technology;
[0061] The sharing module is used to upload the shared ciphertext output by the encryption module and the evidence output by the evidence generation module to the blockchain platform;
[0062] The statistical module is used to perform statistical operations on shared ciphertexts on the blockchain platform according to requirements;
[0063] The verification module is used to read the evidence and the encrypted value c of the shared data from the blockchain platform, and use the encrypted value c of the shared data as the commitment of the zero-knowledge proof, and perform zero-knowledge proof verification on the shared ciphertext in combination with the commitment and the evidence;
[0064] The review module interacts with the blockchain platform and is used to decrypt the shared ciphertext with the private key held by the regulatory agency for review.
[0065] Data is shared by multiple parties on the blockchain platform, which is open, transparent, traceable and easy to audit. At the same time, the blockchain smart contract has a built-in privacy computing algorithm with statistical calculation and ciphertext verification functions, which can verify the legitimacy and feasibility of the uploaded data ciphertext that does not disclose data privacy, and realize efficient and reliable data sharing.
[0066] Next, each module of the system in this embodiment is introduced in detail.
[0067] (1) Key Generation Module
[0068] The regulatory agency generates system parameters and a public-private key pair and sends the system parameters and public key p k Published on the blockchain platform for use by member banks and financing companies.
[0069] The regulator first selects two large prime numbers p and q and calculates
[0070] n=pq
[0071] λ=lcm(p-1,q-1)
[0072] Where lcm() is the least common multiple.
[0073] Randomly select an integer e such that is the multiplicative group of natural numbers less than or equal to the square of n, and gcd(n,L(e λ mod n 2 ))=1, where L(x)=(x-1) / n.
[0074] Randomly select an integer k such that k satisfies k <n 2 ,calculate
[0075] f=e k mod n 2
[0076] And f satisfies gcd(n,L(f λ mod n 2 ))=1.
[0077] Randomly select an integer s, s satisfies s<n, calculate
[0078] h=f s mod n 2
[0079] Use the generated h as the public key p k , s as the private key s k .
[0080] The regulatory agency publishes the public key h and system parameters n, g, and f to the blockchain platform for query by data providers in subsequent modules when encrypting and generating evidence. At the same time, the private key s is kept by itself and not disclosed to the outside for use in subsequent audits and inspections to crack the ciphertext on the chain.
[0081] (2) Encryption module
[0082] Existing homomorphic encryption algorithms cannot verify the scope in the ciphertext state, and the committed ciphertext of zero-knowledge proof cannot be decrypted, which is not conducive to regulatory review. In view of the system's ciphertext statistics and verification requirements, it is necessary to design a privacy computing algorithm that simultaneously meets the additive homomorphism of homomorphic encryption and the ciphertext verification of zero-knowledge proof.
[0083] As a semi-homomorphic encryption algorithm, the Paillier encryption algorithm has the characteristics of high efficiency and complete security proof.
[0084] Through in-depth research on the Paillier homomorphic encryption algorithm and the FO commitment in zero-knowledge proof, it can be seen that the ciphertexts of the two algorithms have similar forms:
[0085] Paillier homomorphic encryption algorithm:
[0086] c=g m r n mod n 2
[0087] The FO promises:
[0088] E(m,r)=g m h r mod n
[0089] Therefore, based on the Paillier encryption algorithm, the present invention combines FO commitment to carry out expansion and innovation, and proposes an improved Paillier encryption algorithm based on FO commitment. It directly uses the computable homomorphic encryption ciphertext value as the FO commitment, supports the verification of zero-knowledge proof, and is used in the encryption module of the system.
[0090] The specific encryption implementation process is as follows:
[0091] The data provider calculates based on system parameters
[0092] c=g m h r mod n 2
[0093] c′=f r mod n 2
[0094] Among them, m is the plaintext data to be shared, r is the random number for data encryption, and the encrypted value c of the shared data and the corresponding decryption parameter c' are combined into a binary shared ciphertext (c, c') and uploaded to the blockchain platform through the sharing module.
[0095] (3) Evidence Generation Module
[0096] The introduction of zero-knowledge proof technology based on FO commitment requires corresponding evidence and commitment when verifying ciphertext. The commitment is the ciphertext data shared on the chain, and the evidence requires the data provider to calculate the verification requirements and upload it to the blockchain platform for verification.
[0097] Zero-knowledge proof allows the prover to convince the verifier of the authenticity of an assertion without directly displaying any substantive data, thereby efficiently maintaining the privacy security of the prover.
[0098] As one of the commitment schemes for zero-knowledge proof, FO commitment has the following form:
[0099] Assume that n is a large composite number, h is an element in the cyclic group generated by g, and log g hUnknown.
[0100] Select a random number r and calculate the commitment
[0101] E(m,r)=g m h r mod n
[0102] Alice sends the commitment to Bob, if Alice does not know log g h, then Alice cannot find m1≠m2 so that E(m1,r1)=E(m2,r2), and Bob cannot obtain the data of m from this commitment.
[0103] The commitment has the following characteristics:
[0104] (1) Hiding: The commitment value does not reveal any data about the message m, that is, the message x cannot be calculated from the commitment value.
[0105] (2) Binding: There is no malicious message that is not equal to the original message m that makes the verification pass, that is, the only message that satisfies the commitment is x.
[0106] Specifically, this system has the function of verifying the range of ciphertext data, that is, verifying m∈[b,b′]. The corresponding calculation evidence process is as follows:
[0107] To verify m∈[b,b′], the evidence required to verify m≥b and m≤b′ is generated respectively. The specific evidence generation process includes:
[0108] 1) For the evidence to verify m ≥ b, calculate E = g m-b+1 h r mod n 2 ; For the evidence to verify m≤b′, calculate E=g b′-m+1 h -r mod n 2 ;
[0109] 2) Introduce security parameters l, j, t and T, and randomly select integers α≠0, β∈[0,2 T+j ], let k = α 2 x+β>2 l+j+t+T , randomly select integers r1, r2 and r3, satisfying r1,r2,r3∈[-2 j n 2 +1,2 j n 2 -1] and -rα 2 -r1α-r2∈[-2 j n 2 +1,2 j n 2 -1], calculate
[0110]
[0111] The calculated k, E1, E2, and E3 are used as evidence for verifying the ciphertext zero-knowledge proof.
[0112] (4) Shared Modules
[0113] The data provider uploads the shared ciphertext output by the encryption module and the evidence output by the evidence generation module to the blockchain platform through the blockchain smart contract for data sharing. Once the data is uploaded to the chain, it can be traced and cannot be tampered with, ensuring the credibility of data statistical verification.
[0114] (5) Statistics module
[0115] Since the encryption algorithm used in the encryption module satisfies additive homomorphism, that is,
[0116] En(m1,r1,h,n,g,f)×En(m2,r2,h,n,g,f)=(c1c2,c1′c2′)
[0117]
[0118] Therefore, the shared ciphertext on the blockchain can be used for ciphertext statistical operations.
[0119] The blockchain platform contains a smart contract with ciphertext statistical calculation functions. When integrating data, this smart contract can be directly called for integration to prepare for subsequent verification and review work.
[0120] (6) Verification Module
[0121] 1) Call the smart contract with ciphertext verification function in the blockchain platform to read the on-chain evidence and the encrypted value c of the shared data, and use the encrypted value c of the shared data as a zero-knowledge proof commitment. For the verification m∈[b,b′], the verification calculation is:
[0122] To verify that m≥b, calculate E=g m-b+1 h r mod n 2 =cg 1-b ;
[0123] To verify that m≤b′, calculate E=g b′-m+1 h -r mod n 2 =c -1 g 1+b′ .
[0124] Combined with the evidence on the blockchain, the shared ciphertext is verified by zero-knowledge proof, where the zero-knowledge proof protocol is:
[0125]
[0126] Among them, PK{x:F(x)} represents a zero-knowledge proof that knowing x makes F(x) true.
[0127] If the verification is true, it means that the verification is successful and the shared data meets the legality and feasibility requirements. If it is false, the verification fails and the shared data does not meet the corresponding requirements.
[0128] (7) Review module:
[0129] Since the regulatory agency holds the private key, it can use the review contract to decrypt the shared ciphertext on the chain for review. The decryption process is as follows:
[0130] c″=c / c′ s =g m mod n2
[0131] m=L(c″) / L(g)mod n
[0132] Among them, L(x)=(x-1) / n.
[0133] This embodiment also provides a shared data verification method for a blockchain data trusted sharing system, the method comprising:
[0134] The regulatory agency generates system parameters and public-private key pairs through the key generation module, and publishes the system parameters and public keys on the blockchain platform for subsequent data providers to query when encrypting or generating evidence. The regulatory agency also stores the private key for subsequent audits and inspections to crack the ciphertext on the blockchain.
[0135] The data provider uses the homomorphic encryption algorithm to encrypt the plaintext data to be shared through the encryption module according to the system parameters, and composes the encrypted value c of the shared data and the corresponding decryption parameter c' into a binary shared ciphertext, which is then uploaded to the blockchain platform through the sharing module;
[0136] The data provider uses zero-knowledge proof technology to calculate the evidence required for ciphertext verification through the evidence generation module and uploads it to the blockchain platform through the sharing module;
[0137] The verification module reads the evidence and the encrypted value c of the shared data from the blockchain platform, and uses the encrypted value c of the shared data as the commitment of the zero-knowledge proof. The shared ciphertext is verified by combining the commitment and evidence, and the verification result is stored.
[0138] like Figure 2 As shown, the data sharing process is as follows:
[0139] 1) The regulatory agency generates system parameters and public-private key pairs through the key generation module, and publishes the system parameters and public keys on the blockchain platform;
[0140] 2) The blockchain platform stores system parameters and public keys;
[0141] 3) The data provider reads the key on the blockchain platform, encrypts the plaintext data to be shared through the encryption module, and outputs the encrypted value of the shared data;
[0142] 4) The data provider uploads the encrypted value of the shared data to the blockchain platform through the sharing module through the blockchain smart contract for data sharing;
[0143] 5) The blockchain platform stores the ciphertext.
[0144] like Figure 3 As shown in the figure, the data statistical verification process is as follows:
[0145] 1) The data provider generates evidence and publishes it to the blockchain platform;
[0146] 2) The blockchain platform determines whether statistical data is needed based on demand. If statistics are needed, the ciphertext of the data on the blockchain is counted as a commitment. Otherwise, the ciphertext of the data on the blockchain is directly read as a commitment.
[0147] 3) The blockchain platform calls the blockchain smart contract through the verification module, reads the evidence and commitments on the blockchain, performs ciphertext verification, and stores the verification results.
[0148] This embodiment performs automated statistics and verification calculations on ciphertext data based on smart contracts on the blockchain, verifies the legitimacy and feasibility of the data while protecting privacy, and is of great significance for further promoting data sharing among multiple parties.
[0149] The electronic device of the present invention includes a central processing unit (CPU), which can perform various appropriate actions and processes according to computer program instructions stored in a read-only memory (ROM) or loaded from a storage unit into a random access memory (RAM). In the RAM, various programs and data required for device operation can also be stored. The CPU, ROM and RAM are connected to each other via a bus. An input / output (I / O) interface is also connected to the bus.
[0150] Multiple components in the device are connected to the I / O interface, including: input units, such as keyboards, mice, etc.; output units, such as various types of displays, speakers, etc.; storage units, such as disks, optical disks, etc.; and communication units, such as network cards, modems, wireless communication transceivers, etc. The communication unit allows the device to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunication networks.
[0151] The processing unit performs the various methods and processes described above. For example, in some embodiments, the method can be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit. In some embodiments, part or all of the computer program can be loaded and / or installed on the device via a ROM and / or a communication unit. When the computer program is loaded into RAM and executed by the CPU, one or more steps of the method described above can be performed. Alternatively, in other embodiments, the CPU can be configured to perform the method in any other appropriate manner (e.g., by means of firmware).
[0152] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chip systems (SOCs), load programmable logic devices (CPLDs), and the like.
[0153] The program code for implementing the method of the present invention can be written in any combination of one or more programming languages. These program codes can be provided to a processor or controller of a general-purpose computer, a special-purpose computer or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code can be executed entirely on the machine, partially on the machine, partially on the machine as a stand-alone software package and partially on a remote machine, or entirely on a remote machine or server.
[0154] In the context of the present invention, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0155] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed by the present invention, and these modifications or replacements should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.
Claims
1. A blockchain data trusted sharing system, characterized in that: include: The key generation module is used by the regulatory agency to generate system parameters and public-private key pairs, and publish the system parameters and public keys on the blockchain platform; The encryption module is used to encrypt the plaintext data to be shared using a homomorphic encryption algorithm according to the system parameters, and to form a binary shared ciphertext with the obtained encrypted value c of the shared data and the corresponding decryption parameter c'; The evidence generation module is used to calculate the evidence required for ciphertext verification using zero-knowledge proof technology; The sharing module is used to upload the shared ciphertext output by the encryption module and the evidence output by the evidence generation module to the blockchain platform; The statistical module is used to perform statistical operations on shared ciphertexts on the blockchain platform according to requirements; The verification module is used to read the evidence and the encrypted value c of the shared data from the blockchain platform, and use the encrypted value c of the shared data as the commitment of the zero-knowledge proof, and perform zero-knowledge proof verification on the shared ciphertext in combination with the commitment and the evidence.
2. A blockchain data trusted sharing system according to claim 1, characterized in that: The regulatory agency generates system parameters and a public-private key pair by: selecting two large prime numbers p and q, calculating n=pq, λ=lcm(p-1,q-1), where lcm( ) is the least common multiple; randomly selecting an integer is the multiplicative group of natural numbers less than or equal to the square of n, and gcd(n,L(e λ mod n 2 ))=1, where gcd() is the greatest common divisor, L(x)=(x-1) / n; randomly select an integer k <n 2 , calculate f = e k mod n 2 , and f satisfies gcd(n,L(f λ mod n 2 ))=1; randomly select an integer s<n, calculate h=f s mod n 2 , use the generated h as the public key and s as the private key; the system parameters include n, g and f.
3. A blockchain data trusted sharing system according to claim 2, characterized in that: The data plaintext to be shared is encrypted using a homomorphic encryption algorithm according to the system parameters, and the encrypted value c of the shared data and the corresponding decryption parameter c' are combined into a binary shared ciphertext, specifically: c=g is calculated according to the system parameters m h r mod n 2 , c′=f r mod n 2 , where m is the plaintext data to be shared, r is the random number for data encryption, and the encrypted value c of the shared data and the corresponding decryption parameter c' form a binary shared ciphertext (c, c').
4. A blockchain data trusted sharing system according to claim 3, characterized in that: The statistical module performs statistical operations on the shared ciphertext on the blockchain chain according to the additive homomorphic characteristics of the homomorphic encryption algorithm in the encryption module, specifically: En(m1,r1,h,n,g,f)×En(m2,r2,h,n,g,f)=(c1c2,c1′c2′) The subscripts 1 and 2 correspond to related information of two different data plaintexts that need to be shared.
5. A blockchain data trusted sharing system according to claim 3, characterized in that: In the evidence generation module, if m∈[b,b′] is to be verified, the evidence required to verify m≥b and m≤b′ is generated respectively. The specific evidence generation process includes: 1) For the evidence to verify m ≥ b, calculate E = g m-b+1 h r mod n 2 ; For the evidence to verify m≤b′, calculate E=g b′-m+1 h -r mod n 2 ; 2) Introduce security parameters l, j, t and T, and randomly select integers α≠0, β∈[0,2 T+j ], let k = α 2 x+β>2 l+j+t+T , randomly select integers r1, r2 and r3, satisfying r1,r2,r3∈[-2 j n 2 +1,2 j n 2 -1] and -rα 2 -r1α-r2∈[-2 j n 2 +1,2 j n 2 -1], calculate The calculated k, E1, E2, and E3 are used as evidence for verifying the ciphertext zero-knowledge proof.
6. A blockchain data trusted sharing system according to claim 5, characterized in that: In the verification module, the shared data encrypted value c on the blockchain is read as the commitment of the zero-knowledge proof. Then, for the verification m∈[b,b′], the verification calculation is: To verify that m≥b, calculate E=g m-b+1 h r modn 2 =cg 1-b ; To verify that m≤b′, calculate E=g b′-m+1 h -r modn 2 =c -1 g 1+b′ . Combined with the evidence on the blockchain, the shared ciphertext is verified by zero-knowledge proof, where the zero-knowledge proof protocol is: Among them, PK{x:F(x)} represents a zero-knowledge proof that knowing x makes F(x) true.
7. A blockchain data trusted sharing system according to claim 3, characterized in that: The system also includes a review module that interacts with the blockchain platform and is used to review the shared ciphertext after decryption using the private key held by the regulatory agency, specifically: c″=c / c ′s =g m mod n 2 m=L(c″) / L(g)mod n Among them, L(x)=(x-1) / n.
8. A shared data verification method for the blockchain data trusted sharing system according to claim 1, characterized in that: The method comprises: The regulatory agency generates system parameters and public-private key pairs through the key generation module, and publishes the system parameters and public keys on the blockchain platform for subsequent data providers to query when encrypting or generating evidence. The regulatory agency also stores the private key for subsequent audits and inspections to crack the ciphertext on the blockchain. The data provider uses the homomorphic encryption algorithm to encrypt the plaintext data to be shared through the encryption module according to the system parameters, and composes the encrypted value c of the shared data and the corresponding decryption parameter c' into a binary shared ciphertext, which is then uploaded to the blockchain platform through the sharing module; The data provider uses zero-knowledge proof technology to calculate the evidence required for ciphertext verification through the evidence generation module and uploads it to the blockchain platform through the sharing module; The encrypted value c of the evidence and shared data is read from the blockchain platform through the verification module, and the encrypted value c of the shared data is used as the commitment of the zero-knowledge proof. The shared ciphertext is verified by combining the commitment and the evidence, and the verification result is stored. The blockchain platform determines whether statistical data is needed according to the needs. If statistics are needed, the ciphertext of the data on the blockchain is counted as the commitment through the statistical module. Otherwise, the ciphertext of the data on the blockchain is directly read as the commitment.
9. An electronic device comprising a memory and a processor, wherein a computer program is stored in the memory, wherein: When the processor executes the program, the method according to claim 8 is implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to claim 8 is implemented.