Block chain and homomorphic encryption-based power data privacy protection method and system

By combining blockchain and homomorphic encryption technology, power data is encrypted and decrypted, centralization and privacy issues in traditional power data transactions are solved, and decentralized, safe and efficient power data transactions are achieved.

CN119293845APending Publication Date: 2025-01-10STATE GRID HEBEI ELECTRIC POWER CO LTD +2
View PDF 0 Cites 5 Cited by

Patent Information

Application Number
CN202411351145.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-26
Publication Date
2025-01-10

AI Technical Summary

Technical Problem

Traditional power data transactions have centralized problems, resulting in security risks and privacy leakage, and it is difficult to ensure the integrity and privacy of data, especially during the transaction process.

Method used

Combining blockchain and homomorphic encryption technology, power data is encrypted through Paillier homomorphic encryption, and the ciphertext hash value is uploaded to the blockchain, digitally sign the ciphertext, key segmentation, and data demanders conduct it. After verification of data source and integrity, collaborative decryption is obtained and clear text is obtained.

Benefits of technology

Decentralized power data transactions have been realized, which improves the privacy and security of transactions, reduces the risk of user privacy leakage, enhances the security of keys, improves the encryption and decryption efficiency and data processing speed, and ensures the data transactions. Real-time and traceability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119293845A_ABST
    Figure CN119293845A_ABST
Patent Text Reader

Abstract

The invention discloses a blockchain and homomorphic encryption-based power data privacy protection method and system, and belongs to the technical field of power data privacy protection, and the method comprises the steps that a data provider encrypts power data by using Paillier homomorphic encryption, uploads a ciphertext hash value to a blockchain, carries out the digital signature of a ciphertext, divides a key, and carries out the encryption of the key; enabling each data demander to receive the ciphertext, the signature and the key fragment; and the data demander performs cooperative decryption after performing data source and integrity verification to obtain a plaintext. Through distributed storage of a key sharing scheme, the security of the key is remarkably improved, single-point faults are avoided, the fault tolerance of the whole system is improved, and the flexibility of data transaction is optimized; for a mass data transaction process, the encryption and decryption efficiency is improved, the data processing speed and performance are improved, the real-time performance of data transaction is ensured, the resource consumption is reduced, and the user experience is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of power data privacy protection, and in particular to a method and system for power data privacy protection based on blockchain and homomorphic encryption. Background Art

[0002] With the acceleration of the digital revolution of smart grids, the collection, storage and analysis of power data have become an important part of the development of the power industry. The value of power data has become increasingly prominent. It is particularly important to break the data island and release the intrinsic value of data. However, domestic power data trading is in the development stage, and there are still many problems to be solved in the transaction process. Data, as a digital asset, has the characteristics of replicability and immediate use. Power data involves user privacy and is a major issue of people's livelihood, which makes power data trading difficult. Therefore, power data privacy protection is particularly important. However, traditional power data trading still has certain centralization problems. All power data must go through third-party intermediaries, which causes certain security risks and increases the risk of data leakage and abuse. In addition, it is necessary to ensure the integrity and privacy of power data in transactions, and avoid data tampering or information errors caused by attacks.

[0003] However, as an emerging distributed ledger, blockchain naturally has the characteristics of openness, transparency, decentralization, immutability and traceability, which helps to protect the privacy of energy data transactions and improve transaction efficiency. As an asymmetric encryption method, homomorphic encryption technology has a homomorphic nature, that is, the operation of ciphertext is equivalent to the operation of plaintext, realizing the "calculable invisibility" of data. Combining blockchain with homomorphic encryption technology and giving play to the corresponding advantages can make up for the problems existing in energy data transactions, complete privacy protection in the process of power data transactions, and realize decentralized energy data transactions. Therefore, this application intends to combine blockchain and homomorphic encryption technology to design a new power data privacy protection technology. Summary of the invention

[0004] In order to solve the above problems, the purpose of the present invention is to provide a blockchain and homomorphic encryption power data privacy protection technology, which can enhance the privacy of individual users in the aggregation scheme while achieving fault tolerance, and improve transaction efficiency while ensuring the secure execution of transactions.

[0005] In order to achieve the above technical objectives, the present application provides a method for protecting power data privacy based on blockchain and homomorphic encryption, which is characterized by comprising the following steps:

[0006] The data provider uses Paillier homomorphic encryption to encrypt the power data, uploads the ciphertext hash value to the blockchain, digitally signs the ciphertext, and splits the key so that each data demander receives the ciphertext, signature, and key fragments. The DSA algorithm is used to generate a public-private key pair for signing, and the ciphertext is signed by the private key of the public-private key pair for signing; and the private key is split by Shamir key according to the public-private key pair generated by the data provider for encrypting data, to obtain several private key fragments;

[0007] After the data demander verifies the data source and integrity, they conduct collaborative decryption to obtain the plaintext.

[0008] Preferably, in the process of encrypting power data using Paillier homomorphic encryption, the data provider generates a public-private key pair for encrypting data, and encrypts the original data using the public key to obtain a ciphertext, wherein the public key of the public-private key pair is pk d =(n, g), the private key is sk d =(λ,μ),

[0009]

[0010] In the formula, p and q are two randomly generated large prime numbers, lcm(,) is the function for finding the least common multiple, g is a random positive integer and The L(x) function is defined as n represents an integer obtained by multiplying two large prime numbers p and q, x represents an arbitrary number, Represents modulo n 2 The multiplicative group of all 2 And with n 2 A set of coprime integers. mod represents the modulo operation, which is to calculate the remainder after dividing two numbers.

[0011] Preferably, in the process of digitally signing the ciphertext, a public-private key pair (pk s ,sk s ), using the private key sk s Sign the ciphertext S with sigS = sig(sk s , S).

[0012] Preferably, in the process of verifying the origin of data, the origin of data is verified by verifying the validity of the signature, wherein the verification process of the validity is expressed as:

[0013]

[0014] Where q is a prime number of N bits, p is a number of L bits and p-1 is a multiple of q, ω represents the value calculated by the inverse element of s, which is used for signature authentication, u1 represents the value calculated by ω and the ciphertext hash value H(S), u2 represents the value calculated by ω and r, both u1 and u2 are used to check the validity of the signature, y represents a part of the digital signature public key, H(S) represents the hash value of the ciphertext, s, r represent parts of the signature respectively, and S represents the ciphertext after homomorphic encryption.

[0015] Preferably, in the process of data integrity verification, after the data origin verification is passed, the data integrity verification is completed by verifying whether the hash value of the ciphertext data is consistent with the storage value on the chain. If inconsistency is found during the verification, it means that the data has been tampered with by an attacker or lost during data transmission. The data demander sends an abnormal warning to the data sender and re-acquires the data packet. If the comparison is successful, it means that the data has not been tampered with during transmission.

[0016] Preferably, in the process of cooperative decryption, any k receivers cooperate in decryption and take out (x 1, , f(x1)), (x 2, , f(x2)),…,(x k ,f(x k )),get:

[0017]

[0018] Using matrix multiplication it can be expressed as:

[0019]

[0020] From the above formula, we can find a0, a1, a2, ..., a k-1 , reconstruct the polynomial f(x) = a0+a1x+a2x 2 +…+a k-1 x k -1 , and substitute x=0 to recover the key sk d =a0.

[0021] Preferably, in the process of obtaining the plaintext, the ciphertext is decrypted by using the recovered private key to obtain the plaintext, which is expressed as:

[0022]

[0023] Preferably, in the process of Paillier homomorphic encryption and decryption, when the private key is in hand, CRT is used to The modular exponentiation operation is transformed into and This improves the efficiency of encryption and decryption.

[0024] The present invention discloses a blockchain and homomorphic encryption power data privacy protection system, which is used to implement the above-mentioned power data privacy protection method, including:

[0025] The encryption module is used to provide encryption functions for the data provider, so that the data provider encrypts the power data using Paillier homomorphic encryption, uploads the ciphertext hash value to the blockchain, digitally signs the ciphertext, and splits the key, so that each data demander receives the ciphertext, signature, and key fragments, wherein the public-private key pair for signing is generated using the DSA algorithm, and the ciphertext is signed by the private key of the public-private key pair for signing; and the private key is split by Shamir key according to the public-private key pair generated by the data provider for encrypting data, to obtain a number of private key fragments;

[0026] The decryption module is used to provide decryption function for multiple data demanders. After each data demander verifies the data source and integrity, multiple data demanders cooperate to decrypt and obtain plaintext.

[0027] Preferably, the encryption module is further used to encrypt the original data using the public key according to the public-private key pair generated by the data provider for encrypting data, thereby obtaining the ciphertext, wherein the public key of the public-private key pair is pk d =(n, g), the private key is sk d =(λ,μ),

[0028]

[0029] In the formula, p and q are two randomly generated large prime numbers, lcm(,) is the function for finding the least common multiple, g is a random positive integer and The L(x) function is defined as n represents an integer obtained by multiplying two large prime numbers p and q, x represents an arbitrary number, Represents modulo n 2 The multiplicative group of all 2 And with n 2 A set of coprime integers. mod represents the modulo operation, which is to calculate the remainder after dividing two numbers.

[0030] The present invention discloses the following technical effects:

[0031] The present invention adopts the blockchain method so that the nodes joining the blockchain can unconditionally trust each other and achieve the purpose of decentralization;

[0032] The present invention implements an identity privacy protection mechanism, protects the real identities of both parties to the transaction through a pseudonym algorithm, reduces the risk of user privacy leakage, and thus improves the privacy and security of the transaction;

[0033] The present invention significantly improves the security of keys through distributed storage of key sharing scheme, avoids single point failure, and even if the key of a participant is stolen, the data cannot be decrypted alone, thereby improving the fault tolerance of the entire system and optimizing the flexibility of data transactions;

[0034] The present invention aims at a large amount of data transaction process, improves the encryption and decryption efficiency, improves the speed and performance of data processing, ensures the real-time nature of data transactions, reduces resource consumption, and improves user experience;

[0035] The transaction data Hash value of the present invention is stored on the blockchain. The characteristics of the blockchain make the transaction data impossible to be tampered with, and the traceability of data transactions is guaranteed through digital signature technology. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only 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.

[0037] Figure 1 This is a blockchain and homomorphic encryption power data privacy protection framework diagram described in the present invention;

[0038] Figure 2 It is the energy data privacy protection function based on blockchain and homomorphic encryption described in the present invention;

[0039] Figure 3 This is a flowchart of power data privacy protection using blockchain and homomorphic encryption as described in the present invention. DETAILED DESCRIPTION

[0040] To make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments. The components of the embodiments of the present application generally described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.

[0041] like Figure 1-3As shown in the figure, the existing privacy protection methods for power data transactions have the following main shortcomings:

[0042] 1) Traditional power data transactions use a third-party centralized platform. The third-party intermediary will have all the transaction data. In this case, the credibility of the third-party intermediary must be guaranteed. Once the third-party intermediary has malicious operations, it may leak transaction data or cause private buying and selling of transaction data, which will cause irreversible damage.

[0043] 2) Traditional power data transactions focus on the privacy protection of power data, but often do not pay enough attention to the privacy protection of the identity information of both parties to the transaction, which may lead to a series of potential security and privacy issues, especially when sensitive data and important business transactions are involved. Therefore, it is urgent to find a method that can protect data from being leaked and protect the identity information of both parties to the transaction.

[0044] 3) The traditional power data trading model may adopt a single key management method, that is, the keys of the entire system are stored in one place. This method has the risk of single point failure. Once the location where the key is stored is attacked or fails, the security of the entire system will be seriously threatened. How to improve the fault tolerance of the entire system is also one of the problems currently faced.

[0045] 4) In power data trading, since a large amount of data needs to be processed and the real-time requirements are high, the security and privacy of the data are required to be high. Therefore, in order to improve the efficiency and security of power data trading, it is necessary to adopt efficient encryption and decryption algorithms and technical means, which is also one of the issues that should be focused on at present.

[0046] In order to solve the above problems in the prior art, the present invention proposes a data privacy protection technology based on blockchain and homomorphic encryption. The participants involved are mainly data providers and data demanders. Each participant must protect his or her true identity when conducting data transactions. At the same time, the data provider must ensure that the transaction data is sent in ciphertext form, and upload the ciphertext hash value to the blockchain, digitally sign the ciphertext, and split the key. Each data demander can only receive the ciphertext, signature, and key fragments. The data demander verifies the data source and integrity, and cooperates in decryption to obtain the plaintext.

[0047] Blockchain: In a narrow sense, blockchain is a data structure that links data blocks in chronological order and uses cryptography to ensure that it cannot be tampered with or forged. In a broad sense, blockchain technology uses a chain data structure as the underlying storage and verification data, adopts a consensus mechanism to achieve consistency, ensures the security of data transmission and access based on cryptography, and uses smart contracts to program and operate data. It is an emerging distributed infrastructure and computing paradigm.

[0048] Homomorphic encryption: Homomorphic encryption is a cryptographic technique based on the computational complexity theory of mathematical problems. The data that has been homomorphically encrypted is processed to obtain an output, and the decrypted output is the same as the output obtained by processing the original unencrypted data in the same way.

[0049] Key sharing: is a method of distributing, storing, and recovering secret keys (or other secret information): the key manager splits the secret key into a series of interrelated secret information (called subkeys), and then distributes the subkeys to each member of a group; so that after each member of a certain group (authorized set) takes out their subkeys, they can use the established method to recover the secret key, while other groups (unauthorized sets) cannot recover the key. Key sharing is also called key sharing, secret sharing, or secret sharing. Using key sharing in information systems in real environments can prevent the loss, damage, and enemy attacks of system keys, reduce the responsibility of key holders (individuals or servers), and reduce the success rate of adversaries in deciphering keys.

[0050] Digital signature: A digital signature is a string of numbers that can only be generated by the sender of the information and cannot be forged by others. This string of numbers is also a valid proof of the authenticity of the information sent by the sender.

[0051] The present invention discloses a data privacy protection technology based on blockchain and homomorphic encryption, which specifically includes the following contents:

[0052] 1. Peer-to-peer data transactions based on blockchain:

[0053] Data trading based on blockchain is a decentralized peer-to-peer data trading method. The system model mainly includes data providers, data demanders and blockchain decentralized trading platforms. Data providers mainly provide data and obtain additional value through transactions to break data silos. They need to ensure the protection of personal identities during transactions while ensuring the integrity and availability of data. Data demanders are the party that wants to obtain data. By mining the potential value of data, the data can be maximized. Blockchain decentralized trading platforms use blockchain technology to achieve the immutability and traceability of data and transactions. They do not save transaction data, but only save data hash values.

[0054] In the data transaction process, data providers and data demanders use random functions and hash algorithms to generate pseudonyms based on their real identities, protect the real identities of both parties, and register with the blockchain to become legal transaction users. Data providers upload data index information to facilitate data demanders to determine whether the data is what they need. If it meets their needs, the data demander submits a transaction request and purchases the data.

[0055] 2. Data privacy protection based on homomorphic encryption:

[0056] 1) Homomorphic encryption of power data:

[0057] The data provider uses Paillier homomorphic encryption to encrypt the power data. First, the data provider generates a public-private key pair for encrypting data, as shown in formula (1):

[0058]

[0059] Among them, p and q are two randomly generated large prime numbers, lcm(,) is the least common multiple function, g is a random positive integer and The L(x) function is defined as n represents an integer obtained by multiplying two large prime numbers p and q, x represents an arbitrary number, Represents modulo n 2 The multiplicative group of all 2 And with n 2 A set of coprime integers. mod represents the modulo operation, which is to calculate the remainder after dividing two numbers.

[0060] At this point, the public and private key pair of the Paillier homomorphic encryption algorithm is obtained, and the public key is Pk d =(n, g), the private key is sk d =(λ,μ). Then, the original data is encrypted using the public key pkd to obtain the ciphertext, as shown in formula (2):

[0061] S=g M r n (mod n 2 ) (2)

[0062] Wherein, M represents original data, S represents ciphertext, r is a random number, and r<n.

[0063] 2) Digital Signature:

[0064] The data provider uses the DSA algorithm to generate a public-private key pair (pk s ,sk s ), using the private key sk s Sign the ciphertext S with sigS = sig(sk s , S).

[0065] First, choose a hash function SHA-256, then choose a key length L=2048 and a prime length N. Choose a prime number q of length N bits; N must be less than or equal to the length of the hash output. Choose a number p of length L bits such that p-1 is a multiple of q. Find a number g such that g≡2(p-1) / q (mod p). Once the parameters (p, q, g) are generated, the public and private keys can be calculated. First, a random x is selected where 0<x<q. Next, y is calculated, where y≡g x (mod p). Get the public key pk s =(p, q, g, y) and private key sk s =x. Use the generated public and private keys to sign the ciphertext, as shown in formula (3):

[0066]

[0067] Among them, k is a random number, and 0<k<q, S refers to the ciphertext after homomorphic encryption, H(S) is the process of obtaining the hash value of the ciphertext, and the digital signature sigS=(r, s) is obtained. The obtained hash value Hashs=H(S) is uploaded to the blockchain network.

[0068] 3) Shamir key splitting:

[0069] Shamir key sharing is a (k, n) threshold key sharing scheme based on the Lagrange interpolation formula.

[0070] To avoid a single key management method, similarly, to avoid attackers who try to obtain data packets during transmission, even if they obtain the data packets, they cannot decrypt the plaintext, and the private key sk d Perform Shamir key splitting to obtain n private key fragments, namely sk d1 ,sk d2 ...sk dn , each data recipient only receives the private key fragment sk di , the complete private key is not saved. The following scheme is the specific process of key splitting:

[0071] First, let a0 = sk d , randomly select k-1 random numbers a0, a1, a2, ..., a k-1 , construct the following polynomial:

[0072] f(x)=a0+a1x+a2x 2 +…+a k-1 x k-1 (4)

[0073] Secondly, take any n numbers x1, x2, ..., x k-1 , x k Substituting into the polynomials respectively, we get f(x1), f(x2), ..., f(x n ). Finally, sk d1 =(x 1, , f(x1)), sk d2=(x 2, , f(x2)),…,sk dn =(x n ,f(x n )) are sent to n participants respectively.

[0074] The ciphertext S, signature sigS, private key fragment sk di Sent to the data demander, data packet C = (S, sigS, sk di ).

[0075] 4) Message Verification:

[0076] a) Data origin verification:

[0077] After receiving the data packet C, the data demander verifies whether the ciphertext is sent by the data provider, that is, verifies the validity of the signature. As shown in formula (5):

[0078]

[0079] Where ω represents the value calculated by the inverse element of s, which is used for signature authentication, u1 represents the value calculated by ω and the ciphertext hash value H(S), u2 represents the value calculated by ω and r, both u1 and u2 are used to check the validity of the signature, y represents a part of the digital signature public key, and H(S) represents the hash value of the ciphertext;

[0080] If v=r, the signature validity verification is passed, which means that the data packet comes from the data provider and the data origin verification is completed.

[0081] b) Data integrity verification:

[0082] After the data identity verification is passed, the data integrity is verified. The hash value of the ciphertext data is verified to be consistent with the stored value on the chain. If inconsistency is found during the verification, it means that the data has been tampered with by the attacker or lost during the data transmission process. The data demander sends an abnormal warning to the data sender and re-acquires the data packet; if the comparison is successful, it means that the data has not been tampered with during the transmission process, and the data integrity verification is completed.

[0083] 5) Collaborative decryption:

[0084] The data demander uses the homomorphic encryption property to operate on the ciphertext to verify whether the data meets their needs and prevent the sender from providing false data. Multiple data demanders work together to recover the key and decrypt the plaintext.

[0085] Any k receivers cooperate to decrypt and extract (x 1, , f(x1)), (x 2, , f(x2)),…,(x k ,f(xk )), we get formula (6):

[0086]

[0087] Using matrix multiplication, it can be expressed as formula (7):

[0088]

[0089] From the above formula, we can find a0, a1, a2, ..., a k-1 , reconstruct the polynomial f(x) = a0+a1x+a2x 2 +…+a k-1 x k-1 , and substitute x=0 to recover the key sk d =a0. Use the recovered private key to decrypt the ciphertext, as shown in formula (8):

[0090]

[0091] In the Paillier cryptosystem, the main overhead of encryption and decryption is Modular exponential operation is performed under the following conditions. In the case of having a private key, use CRT to The modular exponentiation operation is transformed into and This improves the efficiency of encryption and decryption.

[0092] 3. Implementation of power data privacy protection based on blockchain and homomorphic encryption:

[0093] According to the construction of the data privacy protection model in the first part, the corresponding smart contract and the corresponding Python algorithm are written to realize the automatic execution of data transactions and their privacy protection. The power data privacy protection framework of blockchain and homomorphic encryption is shown in the figure below: Figure 1 shown.

[0094] 3.1. Privacy protection solution based on blockchain and homomorphic encryption:

[0095] The privacy protection scheme based on blockchain and homomorphic encryption is mainly divided into the following four core functions: identity protection, data privacy protection, integrity and origin protection, and data decryption.

[0096] Identity protection: Identity protection means ensuring that the real identities of data providers and data demanders are not disclosed. For data providers and data demanders, pseudonyms are generated using pseudonyms algorithms, which can be used as their identity identifiers on the blockchain without exposing their real identity information. The generated pseudonyms are mapped with the real identity information, and the pseudonyms are registered on the blockchain as legitimate transaction users. The registration process should be completed by the contract creator to ensure the credibility and security of the registration process. During the transaction process, both parties involved in the transaction can use their pseudonyms registered on the blockchain for identity authentication without directly exposing their real identity information, ensuring that the real identities of both parties to the transaction are not disclosed.

[0097] Data privacy protection: The data provider encrypts the power data through the homomorphic encryption method optimized by the Chinese remainder theorem to ensure that the plain text is not leaked during the data transmission and storage process. The data provider takes the hash value of the encrypted data and then uploads the hash value to the blockchain to ensure the subsequent verification of whether the data has been tampered with during the transmission process. The data provider digitally signs the encrypted data to verify the source of the message and ensure the integrity and credibility of the data. The data provider also splits the encrypted private key and sends the encrypted data, digital signature and private key fragments to the data demander.

[0098] Integrity and origin protection: Data integrity and origin verification refers to the verification by the data demander after receiving the data packet whether the data is sent by the data provider and whether the data has been tampered with during the transmission process. First, the data demander obtains the Hash value of the data uploaded by the data provider by querying the blockchain, recalculates the Hash value based on the received ciphertext, and compares the two Hash values ​​to see if they are consistent. If they are consistent, it means that the data has not been tampered with during the transmission process. The data demander compares the decrypted digital signature. If the signature verification is successful, it means that the data was sent by the data provider.

[0099] Data decryption: Data demanders can only receive the corresponding decryption private key fragments. After receiving the private key fragments, each data demander is responsible for saving and merging the private key fragments with other data demanders to restore the complete private key. The received ciphertext data is decrypted based on the complete private key to obtain the plaintext data.

[0100] 3.2. A blockchain and homomorphic encryption process for protecting power data privacy

[0101] 1) Each user who participates in energy data transactions generates a pseudonym and registers it with the blockchain. First, a random factor is generated and combined with the real identity, and the pseudonym pd is obtained through hash function calculation. i, to protect the real identity of users participating in transactions. Users call the registerUser() function to register and become legal transaction users.

[0102] 2) The data provider sets the key size key_size = 2048 to ensure security, and then generates a Paillier public-private key pair (pk d ,sk d ), use the public key to encrypt the plaintext. Since the Paillier algorithm is based on the existence of the composite order remainder assumption and has good compatibility with integers, the data is enlarged before encryption and then encrypted, and the data is reduced by the same multiple when decrypted.

[0103] 3) The data provider performs a hash algorithm on the encrypted data, uploads the hash value to the blockchain, and then generates a public-private key pair (pk s ,sk s ), also set key_size = 2048, use DSA algorithm private key sk s Sign the ciphertext hash value to obtain the signature sigS, and the data provider will use the Paillier algorithm private key sk d The key is split to obtain n private key fragments sk d1 ,sk d2 …sk dn . The ciphertext S, signature sigS, private key fragment sk di Sent to the data requester.

[0104] 4) After receiving the data packet, the data demander first decrypts the signature to verify whether the data is sent by the data demander. At the same time, the hash value of the data transmission is obtained. By comparing it with the hash value in the blockchain, it is verified whether the data is lost or tampered with during the transmission process. If there is an error, the data provider is required to retransmit the data packet.

[0105] 5) After the data demander completes the data integrity and data source verification, multiple data demanders work together to restore the Paillier private key sk d , decrypt the plaintext. Similarly, reduce the data to a multiple of the original size during decryption.

[0106] The present invention designs a data privacy protection scheme based on the Paillier homomorphic encryption algorithm and key sharing. By adding a flexible aggregation threshold, the privacy of individual users in the aggregation scheme is enhanced while achieving fault tolerance. The distributed energy data transaction information protection scheme designed by the present invention based on blockchain ensures the safe execution of transactions while improving transaction efficiency.

[0107] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0108] In the description of the present invention, it should be understood that the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of the present invention, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.

[0109] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.

Claims

1. A method for protecting power data privacy based on blockchain and homomorphic encryption, characterized in that: The following steps are involved: The data provider uses Paillier homomorphic encryption to encrypt the power data, uploads the ciphertext hash value to the blockchain, digitally signs the ciphertext, and splits the key so that each data demander receives the ciphertext, signature, and key fragments. Use the DSA algorithm to generate a public-private key pair for signing, and use the private key of the public-private key pair for signing to encrypt the ciphertext. Signature; and according to the public and private key pair generated by the data provider for encrypting data, the private key is split by Shamir key to obtain To several private key fragments ; After the data demander verifies the data source and integrity, it performs cooperative decryption to obtain the plaintext.

2. According to the method for protecting power data privacy using blockchain and homomorphic encryption as described in claim 1, it is characterized by: In the process of encrypting power data using Paillier homomorphic encryption, the data provider generates a public-private key pair for encrypting data, and encrypts the original data using the public key to obtain ciphertext, where the public key of the public-private key pair is pk d =(n,g), the private key is sk d =(λ,μ), In the formula, p and q are two randomly generated large prime numbers, lcm(,) is the function for finding the least common multiple, g is a random positive integer and The L(x) function is defined as n represents an integer obtained by multiplying two large prime numbers p and q, x represents an arbitrary number, Represents modulo n 2 The multiplicative group of all 2 And with n 2 A set of coprime integers. mod represents the modulo operation, which is to calculate the remainder after dividing two numbers.

3. According to the method for protecting power data privacy using blockchain and homomorphic encryption as described in claim 2, it is characterized by: In the process of digitally signing the ciphertext, the DSA algorithm is used to generate a public-private key pair (pk s ,sk s ), using the private key sk s Sign the ciphertext S with sigS = sig(sk s ,S).

4. According to the method for protecting power data privacy using blockchain and homomorphic encryption as described in claim 3, it is characterized by: In the process of data origin verification, the data origin is verified by verifying the validity of the signature, where the validity verification process is expressed as: Where q is a prime number of N bits, p is a number of L bits and p-1 is a multiple of q, ω represents the value calculated by the inverse element of s, which is used for signature authentication, u1 represents the value calculated by ω and the ciphertext hash value H(S), u2 represents the value calculated by ω and r, both u1 and u2 are used to check the validity of the signature, y represents a part of the digital signature public key, H(S) represents the hash value of the ciphertext, s and r represent parts of the signature respectively, and S represents the ciphertext after homomorphic encryption.

5. According to claim 4, a method for protecting power data privacy using blockchain and homomorphic encryption is characterized in that: In the process of data integrity verification, after the data origin verification is passed, the data integrity verification is completed by checking whether the hash value of the ciphertext data is consistent with the storage value on the chain. If inconsistency is found during the verification, it means that the data has been tampered with by the attacker or lost during the data transmission process. The data demander sends an abnormal warning to the data sender and re-acquires the data packet; if the comparison is successful, it means that the data has not been tampered with during the transmission process.

6. According to claim 5, a method for protecting power data privacy using blockchain and homomorphic encryption is characterized in that: In the process of cooperative decryption, any k receivers cooperate to decrypt and take out (x 1, ,f(x1)),(x2,,f(x2)),…,(x k ,f(x k )),get: Using matrix multiplication it can be expressed as: From the above formula, we can find a0,a1,a2,…,a k-1 , reconstruct the polynomial f(x) = a0+a1x+a2x 2 +…+a k-1 x k-1 , and substitute x=0 to recover the key sk d =a0.

7. According to claim 6, a method for protecting power data privacy using blockchain and homomorphic encryption, characterized in that: In the process of obtaining the plaintext, the ciphertext is decrypted by using the recovered private key to obtain the plaintext, which is expressed as:

8. According to claim 7, a method for protecting power data privacy using blockchain and homomorphic encryption is characterized in that: In the process of Paillier homomorphic encryption and decryption, when you have the private key, use CRT to convert Z n2 The modular exponential operation under Z is converted to P2 and Z q2 This improves the efficiency of encryption and decryption.

9. A blockchain and homomorphic encryption power data privacy protection system, characterized in that: include: The encryption module is used to provide encryption functions for the data provider, so that the data provider uses Paillier homomorphic encryption to encrypt the power data, upload the ciphertext hash value to the blockchain, digitally sign the ciphertext, and split the key so that each data demander receives the ciphertext, signature, and key fragments. Generate a signature using the DSA algorithm The ciphertext is signed by the private key of the public-private key pair used for signing; and the ciphertext is signed by the private key of the public-private key pair used for signing. The public and private key pair for encrypting data is used to perform Shamir key splitting on the private key to obtain several private key fragments. ; The decryption module is used to provide decryption function for multiple data demanders. After each data demander verifies the data source and integrity, multiple data demanders cooperate to decrypt and obtain plaintext.

10. According to claim 9, a blockchain and homomorphic encryption power data privacy protection system is characterized in that: The encryption module is also used to encrypt the original data using the public key according to the public-private key pair generated by the data provider to obtain the ciphertext, wherein the public key of the public-private key pair is pk d =(n,g), the private key is sk d =(λ,μ), In the formula, p and q are two randomly generated large prime numbers, lcm(,) is the function for finding the least common multiple, g is a random positive integer and The L(x) function is defined as n represents an integer obtained by multiplying two large prime numbers p and q, x represents an arbitrary number, Represents modulo n 2 The multiplicative group of all 2 And with n 2 A set of coprime integers. mod represents the modulo operation, which is to calculate the remainder after dividing two numbers.

Citation Information

Cited By

  • Multi-link data security verification method based on homomorphic encryption and asymmetric encryption

    CN120034390A

  • Multi-link data security verification method based on homomorphic encryption and asymmetric encryption

    CN120034390B

  • Intelligent electric meter data protection method based on homomorphic encryption algorithm

    CN120185793A

  • Communication security data right confirmation method based on dynamic key negotiation and key fragmentation

    CN120498685A

  • Block chain privacy protection method and system based on dynamic threshold homomorphic encryption

    CN120639272A