Plaintext integrity and confidentiality protection method based on electric power data homomorphic ciphertext
Through the homomorphic encryption scheme CKKS, the ciphertext is generated and random operations are performed, which solves the problem that data providers lose control and data users cannot verify the integrity of the explicit text, and realizes data control and security protection in power data sharing.
Patent Information
- Application Number
- CN202510609391.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-13
- Publication Date
- 2025-08-15
AI Technical Summary
In existing power data sharing based on homomorphic encryption, data providers lose control over the data, and data users cannot verify the integrity and confidentiality of the document in the ciphertext state, resulting in the risk of data being unauthorized to be converted or tampered with.
Using the homomorphic encryption scheme CKKS, the data provider generates ciphertext and sends it to the data user for analysis. The data user operates on the ciphertext to ensure that the data provider cannot obtain plaintext information, and protects data integrity and confidentiality through randomness and homomorphic addition operations. After decryption, the data user verifies the integrity of the explicit text with the data provider.
This enables data providers to maintain control after sharing data, and data users can conduct data analysis and verify the integrity and confidentiality of the analysis results, ensuring data security and legality.
Smart Images

Figure CN120498628A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of data processing, and in particular relates to a method for protecting plaintext integrity and confidentiality based on homomorphic ciphertext of power data. Background Art
[0002] Sharing electricity data is a key initiative to promote energy transformation and achieve the "dual carbon" goals. By breaking down industry barriers and integrating data from the entire power supply chain, including power generation, transmission, and consumption, it can provide precise support for intelligent grid dispatch and optimize the efficiency of energy resource allocation.
[0003] Power data sharing based on homomorphic encryption technology offers a revolutionary solution to the conflict between data security and efficient utilization in the energy sector. This technology allows data to be calculated and analyzed while being fully encrypted, protecting user privacy and sensitive grid information while fully unlocking the value of data.
[0004] Existing electricity data sharing based on homomorphic encryption suffers from two core flaws: loss of control over data sovereignty and a lack of plaintext integrity verification. After sharing encrypted data, data providers are unable to restrict its scope of use or track its flow, posing the risk of unauthorized data diversion or even abuse. Furthermore, data users can only verify the correctness of the computational logic but cannot confirm whether the original plaintext corresponding to the ciphertext has been tampered with (e.g., falsified electricity usage records), casting doubt on the credibility of the analysis results. These two issues restrict its in-depth application in sensitive electricity scenarios (such as demand response and cross-agency collaboration). Summary of the Invention
[0005] In response to the above-mentioned deficiencies in the prior art, the present invention provides a method for protecting the integrity and confidentiality of plaintext data based on homomorphic ciphertext of power data, which solves the problem that data providers lose control of data once they share data and that data users are unable to protect the integrity and confidentiality of plaintext data in the ciphertext state.
[0006] To achieve the above objectives, the present invention adopts a technical solution: a method for protecting the integrity and confidentiality of plaintext based on homomorphic ciphertext of power data, comprising the following steps:
[0007] Setup: The data provider initializes the system and runs CKKS.Setup(1 λ )Generate system parameters, among which CKKS.Setup(1 λ ) represents the process of generating parameters in the homomorphic encryption scheme CKKS;
[0008] Request: Based on the target power data set that the data user specifies and needs to obtain from the data provider, the data provider runs CKKS.Setup.Enc(pk,m) to generate ciphertext and sends the ciphertext to the data user. CKKS.Setup.Enc represents the encryption operation of the homomorphic encryption scheme CKKS, pk represents the public key, and m represents the plaintext.
[0009] Data analysis: Data users perform power data analysis on the ciphertext set and obtain the analysis results of the power data in the form of ciphertext;
[0010] Confidentiality and integrity protection: Data users operate on the ciphertext of power data analysis results, ensuring that data providers cannot obtain the plaintext information of the power data analysis results after decryption. At the same time, data users can use the decrypted plaintext to determine whether the data provider has modified the plaintext, thus achieving confidentiality and integrity protection of the power data analysis results.
[0011] Decryption: The data provider runs CKKS.Dec(c i ) obtains the plaintext of the power data analysis results and returns the results to the data user, where CKKS.Dec() represents the decryption operation of the homomorphic encryption scheme CKKS, c i Represents homomorphic ciphertext;
[0012] Verification: Data users verify the data integrity of the received power data analysis results to achieve plaintext integrity protection based on homomorphic ciphertext.
[0013] The beneficial effects of the present invention are as follows: by sharing data encrypted using a homomorphic encryption scheme with data users, data providers can, on the one hand, enable data users to perform arbitrary data analysis using the homomorphic encryption scheme; on the other hand, homomorphic encryption technology allows data providers to maintain control over the data. Data users can perform various data analysis tasks, such as training artificial intelligence models, on homomorphic ciphertext data. The training models and other data analysis results remain in ciphertext, and data users must contact the data provider to decrypt the ciphertext, thereby ensuring that the data provider maintains control over the shared data.
[0014] Furthermore, confidentiality and integrity protection are performed, specifically:
[0015] Based on the power data analysis results, all ciphertexts are arranged into v columns, where v is the number that satisfies and v|k, and let r = k / v, k represents the number of ciphertexts of the power data analysis results, and r represents the number of rows in which the ciphertexts of the power data analysis results are arranged;
[0016] Based on the permutation results, the ciphertext E l (Vj ) is calculated, where E l (V j ) represents the sum of the plaintext and the corresponding ciphertext in the jth column;
[0017] Random selection number r i , and in r i After being recorded, calculate the ciphertext c i , i∈{1,2,...,k}, ensuring that the data provider cannot obtain the plaintext information after decryption, where r i Represents a random number;
[0018] The ciphertext c i Randomly scramble, the data user will randomly scramble the ciphertext c i and E l (V j ) is sent to the data provider to determine whether the data provider has modified the plaintext through the decrypted plaintext, wherein the data user records the correspondence between the original ciphertext and the scrambled ciphertext to ensure the confidentiality and integrity of the power data analysis results.
[0019] The beneficial effects of the above further scheme are: by adding randomness to the power data analysis results, the data user makes it impossible for the data provider to obtain the plaintext data after decryption, that is, the confidentiality of the power data analysis results is protected; through the addition operation of the homomorphic encryption scheme, the data user calculates the ciphertext E of the sum of the plaintext data by column l (V j ), and the calculated ciphertext E l (V j ) and other ciphertext c i Sent to the data provider for decryption; data users obtain V according to the decryption of the data provider j With g i , then by comparing V j and Implement integrity detection of plaintext data.
[0020] Furthermore, the ciphertext E l (V j ) is calculated as follows:
[0021]
[0022] Among them, E l (V j ) represents the plaintext and ciphertext of the jth column of the power data analysis results, V j The sum of the jth column of the power data analysis results, g w,j It represents the plaintext at row w and column j, where v represents the number of columns and w represents the row number.
[0023] Furthermore, the ciphertext c i The calculation is as follows:
[0024] c i =CKKS.Add(E l (g i ),r i )
[0025] Among them, CKKS.Add() represents the homomorphic addition operation of the homomorphic encryption scheme CKKS, E l (g i ) represents the ciphertext of the i-th power data analysis result, g i represents the i-th plaintext of the power data analysis result, and i represents the ciphertext label of the power data analysis result.
[0026] Furthermore, decryption is performed as follows:
[0027] The data provider runs CKKS.Dec(c i ) obtain the plain text of the power data analysis results and decrypt the results g i +r i and V j Return to the data user, where i∈{1,2,...,k}, j∈{1,2,...,v}, V j The sum of the jth column of the power data analysis results, g i The i-th plaintext representing the power data analysis result, r i represents a random number, i represents the ciphertext label of the power data analysis result, k represents the number of ciphertexts of the power data analysis result, and v represents the number of columns.
[0028] The beneficial effect of the above further solution is that the data provider decrypts the ciphertext of the power data analysis result sent by the data user. i The random number r i Protection, data providers cannot obtain analysis results i , that is, the confidentiality protection of plaintext data is achieved.
[0029] Furthermore, verification is performed, which is specifically as follows:
[0030] According to the correspondence between the recorded original ciphertext and the scrambled ciphertext, the plaintext order is restored to obtain g i +r i and V j , where i∈{1,2,...,k}, j∈{1,2,...,v}, V j represents the sum of the jth column of the power data analysis results, g iThe i-th plaintext representing the power data analysis result, r i represents a random number, k represents the number of ciphertexts of the power data analysis result, i represents the ciphertext label of the power data analysis result, j represents the column label, and v represents the number of columns;
[0031] Using the following formula, subtract the random number r i , to obtain the decrypted power data analysis result g i ':
[0032] g′ i = g i - r i , i ∈ {1, 2,..., k};
[0033] Arrange the decrypted power data analysis result g′ i , 1 < i < k, into r rows and v columns, and calculate V through the following formula j' , 1 < j' < v, where V j' represents the sum of the plaintexts in the j'-th column of the decrypted power data analysis result:
[0034]
[0035] where, w represents the row number, and g w,j represents the plaintext data in the w-th row and j-th column;
[0036] Based on V j' , calculate the error V dec_j , when V dec_j satisfies |V dec_j | ≤ β, the data user confirms that the integrity check of the power data analysis result passes, where β represents the threshold of the allowed error.
[0037] The beneficial effect of the above further solution is that the data user performs an integrity check on the data decrypted by the data provider, ensuring that the data sent to the data provider has not been tampered with, and guaranteeing the rights and interests of the data user for the data analysis result
[0038] Furthermore, the calculation of the error V dec_j is as follows:
[0039] V dec_j = V j - V j '. Brief Description of the Drawings
[0040] Figure 1 is the flowchart of the method of the present invention.
[0041] Figure 2 is the system architecture diagram of the present invention.
[0042] Figure 3 This is a workflow diagram of the plaintext integrity and confidentiality protection method based on homomorphic ciphertext when sharing power data, taking model training as an example. DETAILED DESCRIPTION
[0043] The specific embodiments of the present invention are described below to facilitate understanding of the present invention by those skilled in the art. However, it should be clear that the present invention is not limited to the scope of the specific embodiments. For those skilled in the art, as long as various changes are within the spirit and scope of the present invention as defined and determined by the appended claims, these changes are obvious, and all inventions and creations utilizing the concepts of the present invention are protected.
[0044] Example
[0045] This invention provides a method for protecting the integrity and confidentiality of plaintext based on homomorphic ciphertext for power data. The basic concept is that data providers share data encrypted using a homomorphic encryption scheme with data users, allowing them to perform arbitrary data analysis using the scheme. Furthermore, homomorphic encryption technology allows data providers to maintain control over the data. Data users can perform various data analysis tasks, such as training artificial intelligence models, on homomorphic ciphertext data. The resulting models and other data analysis results remain in ciphertext, requiring the data user to contact the data provider to decrypt the ciphertext, thereby ensuring the data provider's control over the shared data.
[0046] Data users use the designed CIC (confidentiality and integrity check) method to ensure the confidentiality and integrity of the model during decryption.
[0047] The present invention involves two parties: data providers and data users. Their respective roles are as follows:
[0048] Data Providers: Data providers provide data services to data users for a fee. Specifically, data providers collect, store, and aggregate data into private data that cannot be directly shared with third parties. Data providers provide data to data users while protecting the privacy of the data.
[0049] Data users purchase data from data providers to perform various data analysis tasks. Specifically, data users communicate their data needs to data providers, obtain the data, and then use the purchased data to perform data analysis tasks such as artificial intelligence model training locally.
[0050] In this embodiment, the above data may be power data.
[0051] like Figure 1-Figure 3As shown, the present invention provides a method for protecting the integrity and confidentiality of plaintext based on homomorphic ciphertext of power data, and its implementation method is as follows:
[0052] Setup: The data provider initializes the system and runs CKKS.Setup(1 λ )Generate system parameters, among which CKKS.Setup(1 λ ) represents the process of generating parameters in the homomorphic encryption scheme CKKS.
[0053] Request: Based on the target power data set that the data user specifies and needs to obtain from the data provider, the data provider runs CKKS.Setup.Enc(pk,m) to generate ciphertext and sends the ciphertext to the data user. CKKS.Setup.Enc represents the encryption operation of the homomorphic encryption scheme CKKS, pk represents the public key, and m represents the plaintext.
[0054] In this embodiment, the data user specifies that he needs to obtain the target data set {m i}, where i∈{1,2,...,k}, and k represents the number of data. The data provider runs CKKS.Setup.Enc(pk,m i ) Generate ciphertext E l (m i ). Then the data provider will send all the ciphertext E l (m i ),i∈{1,2,...,k} is sent to the data user.
[0055] Data analysis: Data users perform power data analysis on the ciphertext set and obtain the power data analysis results in the form of ciphertext;
[0056] In this embodiment, the data user in the ciphertext set E l (m i ), i∈{1,2,...,k}, perform data analysis, such as training an artificial intelligence model, and then obtain the data analysis results E in the form of ciphertext i (g i ), i∈{1,2,...,k}.
[0057] Confidentiality and integrity protection: Data users operate on the ciphertext of the power data analysis results to ensure that the data provider cannot obtain the plaintext information of the power data analysis results after decryption. At the same time, data users can determine whether the data provider has modified the plaintext through the decrypted plaintext, thus achieving confidentiality and integrity protection of the power data analysis results.
[0058] Based on the power data analysis results, data users use the CIC method to ensure the confidentiality and integrity of the power data analysis results;
[0059] In this embodiment, after obtaining the data analysis result E i (g i ), i∈{1,2,...,k}, the data user uses the CIC method to ensure the confidentiality and integrity of the data analysis results, which is as follows:
[0060] Based on the power data analysis results, all ciphertexts are arranged into v columns, where v is the number that satisfies The smallest integer of sum v|k, and let r = k / v, k represents the number of ciphertexts of the power data analysis results, and r represents the number of rows of the ciphertexts of the power data analysis results, as follows:
[0061]
[0062] Among them, E l (g (r,v) ) represents the data analysis results in ciphertext form, E l (V j ) represents the ciphertext of the sum of the plaintexts in the jth column of the permutation analysis results, 1<j<v;
[0063] Based on the permutation results, the ciphertext E l (V j ) is calculated, where E l (V j ) represents the sum of the plaintext and the corresponding ciphertext of the jth column:
[0064]
[0065] Among them, E l (V j ) represents the plaintext and ciphertext of the jth column of the power data analysis results, V j The sum of the jth column of the power data analysis results, g w,j Represents the plaintext at row w and column j, where v represents the number of columns and w represents the row number.
[0066] Random selection number r i , and in r i After being recorded, calculate the ciphertext c i =CKKS.Add(E l (g i ),r i ), i∈{1,2,...,k}, ensuring that the data provider cannot obtain the plaintext information after decryption, where r irepresents a random number, i represents the ciphertext number of the power data analysis result, CKKS.Add() represents the homomorphic addition operation of the homomorphic encryption scheme CKKS, E l (g i ) represents the ciphertext of the i-th power data analysis result, g i The i-th plaintext representing the power data analysis result;
[0067] The ciphertext c i Randomly scramble, the data user will randomly scramble the ciphertext c i and E l (V j ) is sent to the data provider to determine whether the data provider has modified the plaintext through the decrypted plaintext, wherein the data user records the correspondence between the original ciphertext and the scrambled ciphertext to ensure the confidentiality and integrity of the power data analysis results.
[0068] The data provider runs CKKS.Dec(c i ) obtains the plaintext of the power data analysis results and returns the decrypted results to the data user, where CKKS.Dec() represents the decryption operation of the homomorphic encryption scheme CKKS, c i Represents homomorphic ciphertext, which is specifically:
[0069] The data provider runs CKKS.Dec(c i ) obtain the plain text of the power data analysis results and send the results g i +r i and V j Return to the data user, where i∈{1,2,...,k}, j∈{1,2,...,v}, V j The sum of the jth column of the power data analysis results, g i The i-th plaintext representing the power data analysis result, r i represents the i-th random number, i represents the ciphertext label of the power data analysis result, k represents the number of ciphertexts of the power data analysis result, and v represents the number of columns.
[0070] Verification: Data users verify the integrity of power data analysis results during decryption and transmission to implement plaintext integrity protection based on homomorphic ciphertext. Specifically:
[0071] According to the correspondence between the recorded original ciphertext and the scrambled ciphertext, the plaintext order is restored to obtain g i +r i and V j , where i∈{1,2,...,k}, j∈{1,2,...,v}, V j The sum of the columns representing the power data analysis results, gi represents the power data analysis result, r i represents a random number, k represents the number of ciphertexts of the power data analysis result, i represents the ciphertext label of the power data analysis result, j represents the column label, and v represents the number of columns;
[0072] Using the following formula, subtract the random number r i , to obtain the decrypted power data analysis result g′ i :
[0073] g′ i = g i - r i , i ∈ {1, 2,..., k};
[0074] Arrange the decrypted power data analysis result g′ i , where 1 < i < k, into r rows and v columns, and calculate V through the following formula j' , where 1 < j' < v, where, where, V j' represents the sum of the plaintexts in the j'-th column of the decrypted power data analysis result, where 1 < j' < v:
[0075]
[0076] That is,
[0077] where, V v represents the sum of the plaintexts in the v-th column, w represents the row number, w in the formula is an intermediate variable representing the row change during summation, g w,j represents the plaintext data in the w-th row and j-th column, V j' represents the sum of the plaintexts in the j'-th column of the decrypted power data analysis result, r represents the number of rows for arranging the ciphertexts of the power data analysis result, and j' ∈ {1, 2,..., v}.
[0078] Based on V′ j , calculate V dec_j = V j - V′ j , when V dec_j satisfies |V dec_j | ≤ β, the data user confirms that the integrity check of the power data analysis result passes.
[0079] In this embodiment, in the above process, the setting and request phases encrypt the data according to the method of homomorphic encryption, the analysis of power data is performed on homomorphic ciphertexts, and the power data analysis result in ciphertext form is obtained. The decryption process also decrypts the data through the technology of homomorphic encryption.
[0080] In summary, the data provider initializes the system and generates system parameters; the data user specifies the target power data set to be obtained from the data provider, and the data provider generates ciphertext and sends it to the data user; the data user performs power data analysis on the ciphertext set and obtains the analysis results of the power data in the form of ciphertext; the data user operates on the ciphertext of the power data analysis results to ensure that the data provider cannot obtain or tamper with the power data analysis results during the decryption process; the data user sends the ciphertext of the power data analysis results to the data provider; the data provider decrypts the received ciphertext to obtain the plaintext and returns the result to the data user; the data user verifies the data integrity of the plaintext of the power data analysis results. Based on the above design, the data provider achieves the goal of retaining control after data sharing, and the data user achieves the goal of protecting the integrity and confidentiality of the data analysis results.
Claims
1. A method for protecting the integrity and confidentiality of plaintext based on homomorphic ciphertext of power data, characterized in that: The following steps are involved: Setup: The data provider initializes the system and runs CKKS.Setup(1 λ )Generate system parameters, among which CKKS.Setup(1 λ ) represents the process of generating parameters in the homomorphic encryption scheme CKKS; Request: Based on the target power data set that the data user specifies and needs to obtain from the data provider, the data provider runs CKKS.Setup.Enc(pk,m) to generate ciphertext and sends the ciphertext to the data user. CKKS.Setup.Enc represents the encryption operation of the homomorphic encryption scheme CKKS, pk represents the public key, and m represents the plaintext. Data analysis: Data users perform power data analysis on the ciphertext set and obtain the analysis results of the power data in the form of ciphertext; Confidentiality and integrity protection: Data users operate on the ciphertext of power data analysis results, ensuring that data providers cannot obtain the plaintext information of the power data analysis results after decryption. At the same time, data users can use the decrypted plaintext to determine whether the data provider has modified the plaintext, thus achieving confidentiality and integrity protection of the power data analysis results. Decryption: The data provider runs CKKS.Dec(c i ) obtains the plaintext of the power data analysis results and returns the results to the data user, where CKKS.Dec() represents the decryption operation of the homomorphic encryption scheme CKKS, c i Represents homomorphic ciphertext; Verification: Data users verify the data integrity of the received power data analysis results to achieve plaintext integrity protection based on homomorphic ciphertext.
2. The method for protecting plaintext integrity and confidentiality based on homomorphic ciphertext of power data according to claim 1 is characterized in that: Confidentiality and integrity protection are performed, specifically: Based on the power data analysis results, all ciphertexts are arranged into v columns, where v is the number that satisfies and v|k, and let r = k / v, k represents the number of ciphertexts of the power data analysis results, and r represents the number of rows in which the ciphertexts of the power data analysis results are arranged; Based on the permutation results, the ciphertext E l (V j ) is calculated, where E l (V j ) represents the sum of the plaintext and the corresponding ciphertext in the jth column; Random selection number r i , and in r i After being recorded, calculate the ciphertext c i , i∈{1,2,...,k}, ensuring that the data provider cannot obtain the plaintext information after decryption, where r i Represents a random number; The ciphertext c i Randomly scramble, the data user will randomly scramble the ciphertext c i and E l (V j ) is sent to the data provider to determine whether the data provider has modified the plaintext through the decrypted plaintext, wherein the data user records the correspondence between the original ciphertext and the scrambled ciphertext to ensure the confidentiality and integrity of the power data analysis results.
3. The method for protecting plaintext integrity and confidentiality based on homomorphic ciphertext of power data according to claim 2 is characterized in that: The ciphertext E l (V j ) is calculated as follows: Among them, E l (V j ) represents the plaintext and ciphertext of the jth column of the power data analysis results, V j The sum of the jth column of the power data analysis results, g w,j Represents the plaintext at row w and column j, where v represents the number of columns and w represents the row number.
4. The method for protecting plaintext integrity and confidentiality based on homomorphic ciphertext of power data according to claim 2 is characterized in that: The ciphertext c i The calculation is as follows: c i =CKKS.Add(E l (g i ),r i ) Among them, CKKS.Add() represents the homomorphic addition operation of the homomorphic encryption scheme CKKS, E l (g i ) represents the ciphertext of the i-th power data analysis result, g i represents the i-th plaintext of the power data analysis result, and i represents the ciphertext label of the power data analysis result.
5. The method for protecting plaintext integrity and confidentiality based on homomorphic ciphertext of power data according to claim 1 is characterized in that: To decrypt, the specific steps are: The data provider runs CKKS.Dec(c i ) obtain the plain text of the power data analysis results and decrypt the results g i +r i and V j Return to the data user, where i∈{1,2,...,k}, j∈{1,2,...,v}, V j The sum of the jth column of the power data analysis results, g i The i-th plaintext representing the power data analysis result, r i represents a random number, i represents the ciphertext label of the power data analysis result, k represents the number of ciphertexts of the power data analysis result, and v represents the number of columns.
6. The method for protecting plaintext integrity and confidentiality based on homomorphic ciphertext of power data according to claim 1, characterized in that: Verify, specifically: According to the correspondence between the recorded original ciphertext and the scrambled ciphertext, the plaintext order is restored to obtain g i +r i and V j , where i∈{1,2,...,k}, j∈{1,2,...,v}, V j represents the sum of the jth column of the power data analysis results, g i The i-th plaintext representing the power data analysis result, r i represents a random number, k represents the number of ciphertexts of the power data analysis results, i represents the ciphertext number of the power data analysis results, j represents the column number, and v represents the number of columns; Using the following formula, subtract the random number r i , get the decrypted power data analysis result g i ': g' i =g i -r i ,i∈{1,2,...,k}; The decrypted power data analysis result g' i , 1 < i < k, are arranged in r rows and v columns, and V is calculated through the following formula j' , 1 < j' < v, where V j' represents the sum of the plaintexts in the j'-th column of the decrypted power data analysis result: Among them, w represents the line number, g w,j represents the plaintext data at row w and column j, where v represents the number of columns; Based on V j' , calculate the error V dec_j , when V dec_j Satisfaction|V dec_j When |≤β, the data user confirms that the integrity check of the power data analysis result has passed, where β represents the threshold of the allowable error.
7. The method for protecting plaintext integrity and confidentiality based on homomorphic ciphertext of power data according to claim 6, characterized in that: The error V dec_j The calculation is as follows: V dec_j =V j -V j '。