A data integrity verification method based on SGX under a smart grid

By introducing SGX technology into the smart grid, building a trusted channel of Prof-SGX and Verify-SGX, and combining a double-layer index structure with power supply company authentication, the integrity verification problem of smart meter data in cloud storage is solved, achieving efficient and secure data management and fast evidence access.

CN119135410BActive Publication Date: 2025-10-10NORTHEASTERN UNIV AT QINHUANGDAO
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411256181.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-09
Publication Date
2025-10-10
Estimated Expiration
2044-09-09

AI Technical Summary

Technical Problem

Smart meter data in smart grids faces challenges in cloud storage, including insufficient computing power for data integrity verification, high communication overhead, and privacy leaks caused by untrusted third parties. Traditional index structures are not suitable for SGX environments, and evidence management is complex and time-consuming.

Method used

An SGX-based data integrity verification method is adopted, and a trusted channel is built using Prof-SGX and Verify-SGX. The smart meter ID and evidence are stored through a double-layer index structure (Trie-RBT tree). The power company is used as a medium for identity authentication. An efficient data integrity verification process is designed, including encryption, decryption, evidence generation and secondary encryption, and a homomorphic hash function is used to ensure data integrity.

Benefits of technology

It improves the security and efficiency of data verification, reduces communication overhead, achieves fine-grained error localization and rapid evidence access, ensures data privacy, and supports smart grid power applications.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119135410B_ABST
    Figure CN119135410B_ABST
Patent Text Reader

Abstract

The application provides a data integrity verification method based on SGX under a smart grid, and relates to the technical field of network security. The method comprises the following steps: in the data integrity verification model based on SGX, a power supply company applies Prof-SGX and Verify-SGX to a cloud storage server, and establishes a trusted channel with Prof-SGX through remote verification, and a smart meter matches the Prof-SGX that has passed the verification and establishes a trusted channel; the smart meter uploads Prof-SGX after encrypting the meter data; Prof-SGX decrypts the encrypted meter data first, then performs secondary encryption and generates evidence; Verify-SGX performs data integrity verification on the secondary encrypted meter data according to the audit demand provided by the power supply company, and if the verification is passed, the meter data meeting the audit demand is sent to the power supply company, otherwise, the dichotomy is used to locate the error data, so that the power supply company obtains correct meter data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of network security technology, and in particular to a data integrity verification method based on SGX in a smart grid. Background Art

[0002] Smart meters are a key component of smart grid infrastructure. As of 2021, over 110 million smart meters have been installed in the United States. By 2022 alone, the number of smart meters in the United States is expected to surge to 124 million, transmitting 48 petabytes of data. Directly accessing this massive amount of data uploaded by smart meters would pose bandwidth overhead challenges associated with real-time streaming data. With the development of mobile cloud computing, uploading smart meter data to the cloud for storage has become an important solution to this problem. For smart grid organizations, cost considerations necessitate the use of public clouds for storage. However, due to inherent architectural issues within cloud service providers, such as the Byzantine problem, data stored in the cloud may become corrupted or leaked. Cloud providers, driven by their own interests, may not immediately notify customers of data loss events. To address these issues, data integrity verification methods are needed to ensure the secure storage and integrity of smart meter data on cloud platforms.

[0003] Verifying cloud storage data using data integrity verification generally includes the following algorithms:

[0004] (1) KeyGen(k)→(pk,sk): The client generates a key. The user executes the key generation algorithm locally, inputs the security parameter k, and outputs the public key pk and private key sk.

[0005] (2) SigGen(sk,m)→T: The client generates a file tag. The user locally uses the private key sk generated in algorithm (1) to execute the tag generation algorithm on the file to generate the data tag of file m.

[0006] (3) ChalGen (App R )→{chal,R}:The user sets the data range of the power system data required for verification App R As input, it outputs the audit challenge set chal and the data error location expansion range R.

[0007] (4) GenProof(m, T, chal) → P: When data integrity verification is required, the verifier sends the audit challenge set chal to the server. The server generates the corresponding proof P based on the audit challenge set chal and returns the proof P to the verifier.

[0008] (5) VerifyProof(chal, P, R) → *True, False, Local+: The verifier uses the verification algorithm to determine whether the data stored in the cloud is completely stored based on the proof P sent by the cloud server. If incorrect data is found, the verifier first uses the binary search method to find the incorrect challenge index and then checks whether there is any incorrect data leakage based on the expanded range R.

[0009] The above-mentioned traditional data integrity algorithms have the following two problems: On the one hand, for smart meters in smart grid scenarios, they do not meet the computing power required by the traditional data integrity verification process, which integrates signature calculation and verification calculation into one user. On the other hand, although third-party auditors can be introduced to assist in the audit, the communication overhead caused by the audit and whether the third-party auditors themselves are curious about the data will bring certain risks to the overall audit process. Software Guard Extensions (SGX) technology, as an extension of the Intel architecture, can provide applications with a secure memory to protect the applications in memory from the influence of the external environment. As a component with a certain amount of computing power and without the need for additional deployment in the cloud environment, SGX can solve the problem that IoT devices do not have a certain amount of computing power and require a trusted third party.

[0010] With the large-scale deployment of smart meters (SMs) and their ever-increasing data volumes, increasing signature management complexity and storage overhead are inevitable. As data volumes continue to grow, managing and accessing signature evidence becomes increasingly complex and time-consuming. To facilitate faster access to these signature evidences, an efficient indexing structure is necessary. Signers can store newly generated evidence directly in this index for rapid subsequent retrieval. With such large-scale evidence generation, traditional Merkle-tree indexing structures not only provide index retrieval but also authenticate data to ensure it has not been tampered with. However, in an SGX environment, which provides a trusted execution environment, the primary goal of the indexing structure is to ensure efficient and accurate retrieval of signature evidence to meet the requirements for fast access. Using a hash table to store the index would result in reduced accuracy due to numerous hash collisions. Furthermore, dynamic operations on smart meters, such as adding or deleting data, require a relatively flexible indexing structure. However, existing indexing structures only support queries on data blocks and are not suitable for SGX environments. Therefore, a new, scalable indexing structure is needed. Summary of the Invention

[0011] In response to the above-mentioned shortcomings of the existing technology, the present invention proposes an SGX-based data integrity verification method in the smart grid based on the security features of SGX, aiming to ensure the privacy and storage security of data in the smart grid, while further improving the verification efficiency, laying the foundation for the subsequent smart grid to download correct and complete data from the cloud for subsequent power applications.

[0012] The present invention proposes a data integrity verification method based on SGX in a smart grid, comprising:

[0013] Step 1: Build an SGX-based data integrity verification model, including: smart meter SM, cloud storage server CSS, and power supply company ESC;

[0014] Step 2: Initialize the SGX-based data integrity verification model. The power supply company ESC applies for Prof-SGX and Verify-SGX from the cloud storage server CSS. The power supply company ESC and Prof-SGX perform remote verification and establish a trusted channel. The smart meter SM is matched with the Prof-SGX that has been remotely verified by the power supply company ESC. The smart meter SM verifies the matched Prof-SGX and establishes a trusted channel. The Prof-SGX and Verify-SGX are both contained in the cloud storage server CSS.

[0015] Step 3: Use the smart meter to obtain the user's residential meter data and encrypt the meter data. The encrypted meter data is uploaded to Prof-SGX through a trusted channel.

[0016] Step 4: Prof-SGX decrypts the encrypted meter data, then re-encrypts the decrypted meter data and generates evidence;

[0017] Step 5: The power company sends a data integrity verification audit request Req to Verify-SGX k , Verify-SGX according to the audit request Req k Generate a challenge index set and send it to Prof-SGX, which then generates a challenge request and sends it to the cloud storage server CSS. The cloud storage server CSS calculates the data proof Proof1 and sends it to Verify-SGX. Prof-SGX uses the evidence generated in step 4 to calculate Proof0 and sends it to Verify-SGX. Verify-SGX verifies the data integrity of the double-encrypted meter data based on Proof1 and Proof0. If the verification is successful, the meter data that meets the audit requirements will be sent to the power supply company. Otherwise, proceed to step 6.

[0018] Step 6: Use the binary search method to locate erroneous data in the double-encrypted meter data in the cloud storage server CSS. All erroneous meter data is obtained and sent to the power supply company. The power supply company then retrieves the remaining meter data from the cloud storage server CSS that meets audit requirements.

[0019] The smart meter SM is installed in the user's home and is used to obtain the meter data of the user's home and encrypt the meter data before transmitting it to the cloud storage server CSS;

[0020] The cloud storage server CSS is managed by the cloud service provider and is used to receive meter data from the smart meter SM and data requirements from the power supply company ESC, and select meter data that meets the data requirements and transmit it to the power supply company ESC;

[0021] The Prof-SGX is used to generate and store evidence; the Verify-SGX is used to act as a trusted third party in the audit process to check the integrity of the data on the cloud storage server CSS;

[0022] The power supply company ESC is used to send data requirements to the cloud storage server CSS and receive data from the cloud storage server CSS;

[0023] The step 2 further comprises:

[0024] Step 2-1: Initialize the SGX-based data integrity verification model and generate public parameters of the SGX-based data integrity verification model;

[0025] Step 2-1-1: The power supply company ESC generates an additive cyclic group G1 of order q and a multiplicative cyclic group G2 of order q; where q is a large prime number;

[0026] Step 2-1-2: The power supply company ESC sets the bilinear map e and hash function H1 according to the additive cyclic group G1 and the multiplicative cyclic group G2;

[0027] Step 2-1-3: Define the multiplicative group Z modulo q q * , power supply company ESC from Z q * Randomly select ESC's private key sk ESC , and calculate the public key pk of ESC ESC ;

[0028] Step 2-1-4: Add the additive cyclic group G1, the multiplicative cyclic group G2, the bilinear map e, the module q, the generator P, and the public key pk of ESC ESCand hash function H1 as the public parameters of the SGX-based data integrity verification model and are published by the power supply company ESC; the public parameters are recorded as {G1, G2, e, q, P, pk ESC ,H1};

[0029] Step 2-2: The power supply company's ESC applies for Prof-SGX and Verify-SGX from the cloud storage server CSS and establishes a trusted channel with the Prof-SGX. The smart meter SM registers with the power supply company's ESC, matches the Prof-SGX in the cloud storage server CSS, and then verifies the matched Prof-SGX and establishes a trusted channel.

[0030] Step 2-2-1: The power company and Prof-SGX perform remote authentication and establish a trusted channel;

[0031] Step 2-2-2: The smart meter SM registers with the power supply company ESC;

[0032] Step 2-2-3: The smart meter and Prof-SGX perform identity authentication;

[0033] The step 2-2-1 further includes:

[0034] Step 2-2-1-1: The power company ESC sends an authentication request Req to the secure area Enclave in Prof-SGX ESC ;

[0035] Step 2-2-1-2: After receiving the Req ESC After that, generate the REPORT structure Report by calling the EREPORT instruction E , and Report E Sent to the reference enclave in Prof-SGX;

[0036] Step 2-2-1-3: Reference Enclave after receiving Report E Afterwards, bidirectional verification is performed with the secure zone Enclave within the device or computing environment running Prof-SGX;

[0037] The two-way verification includes: the secure zone Enclave authenticates the reference Enclave and the reference Enclave authenticates the secure zone Enclave;

[0038] The process of the secure zone Enclave authenticating the reference Enclave is as follows: the secure zone Enclave sends an authentication request Req to the reference Enclave E, reference Enclave to generate REPORT structure Report by calling EREPORT instruction QE , where Report QE Includes: referencing the identity information and trusted hardware information of the Enclave; obtaining the report key k of the secure area Enclave E And calculate Report QE MAC Tags Build Report QE and its MAC tag And send it to the security zone Enclave; the security zone Enclave receives After that, the EGETKEY instruction is called to obtain the key k reported by the security zone Enclave. E Recalculate the MAC tag of the REPORT structure, recorded as Mac; the secure area Enclave checks the Report QE Is the trusted hardware information in the secure area consistent with the hardware information pre-recorded by the Enclave before authentication? If not, the authentication fails. If consistent, the Mac and the received Separated from Perform a match. If the match succeeds, it proves that the secure enclave recognizes the identity of the reference enclave, and executes step 2-2-1-4. If the match fails, it proves that the secure enclave fails to authenticate the reference enclave.

[0039] The process of authenticating the security zone Enclave by the reference Enclave is as follows: the reference Enclave sends an authentication request Req to the security zone Enclave QE , the secure area Enclave generates the REPORT structure Report by calling the EREPORT instruction E1 , where Report E1 Includes: identity information and trusted hardware information of the secure zone Enclave; obtain the report key k of the referenced Enclave QE And calculate the MAC tag of the REPORT structure Construct a REPORT structure and its MAC tag And send it to the reference Enclave; the reference Enclave receives Then, the EGETKEY instruction is called to obtain the report key k of the referenced Enclave. QE Recalculate the MAC tag of the REPORT structure, recorded as Mac QE; The reference Enclave checks whether the hardware information in the REPORT structure is consistent with the hardware information pre-recorded by the reference Enclave before authentication. If they are inconsistent, the authentication fails. If they are consistent, the Mac QE and received from Separated from Perform a match. If the match succeeds, it proves that the referencing enclave recognizes the identity of the secure enclave, and executes step 2-2-1-4. If the match fails, it proves that the referencing enclave has failed to authenticate the secure enclave.

[0040] Step 2-2-1-4: Quote Enclave to generate remote authentication result Quote, including: quoting Enclave identity information and trusted hardware information, obtaining and using the processor's private key k EPID Generate signature Then generate remote authentication results and their signatures And send it to the power supply company ESC and the safe zone Enclave;

[0041] Step 2-2-1-5: The power supply company ESC receives Separate And use the public key certificate of Intel Certification Service to sign Verify the legitimacy of the signature. If it is legal, then prove the signature. Valid, and confirm the identity of the secure zone by comparing the trusted hardware information of Quote with the hardware information provided by Intel certification service and store the number ID of the secure zone Enclave E ; If it is illegal, re-execute 2-2-1-4;

[0042] The step 2-2-2 further includes:

[0043] Step 2-2-2-1: For any smart meter SM i , SM i From Z q * Randomly select SM i Private key And calculate SM i Public key SM i Send messages over a secure channel between the smart meter and the utility To power companies, including represents the number of the i-th smart meter;

[0044] Step 2-2-2-2: Based on the received message Power companies use BLS signatures to calculate SMi Certificate And save, power supply company ESC build message And send it to the smart meter through a secure channel, and at the same time the power supply company ESC sends the ESC's public key pk to Prof-SGX ESC ;

[0045] The SM i Certificate for:

[0046]

[0047] Among them Sig_sk ESC (·) indicates the use of the private key sk of the power company ESC ESC Message Signature Indicates smart meter SM i The validity period of the certificate;

[0048] Step 2-2-2-3: Smart Meter SM i Store Messages

[0049] The step 2-2-3 further includes:

[0050] Step 2-2-3-1: Prof-SGX from Randomly select the private key sk of Prof-SGX SGX , and calculate the public key pk of Prof-SGX SGX ;

[0051] Step 2-2-3-2: Smart meter gets ID from storage E The Prof-SGX that needs to be authenticated is matched in the smart meter SM i Select from Select a random number And calculate the parameters for key negotiation Smart MeterSM i from Randomly select the challenge value C1 and construct the message The smart meter uses the public key pk of the Prof-SGX SGX Message Encrypt and get ciphertext and sent to the Prof-SGX; where H(·) is a hash function;

[0052] The ciphertext for:

[0053]

[0054] Where En_pk SGX (·) indicates the use of the public key pk of the Prof-SGX SGX The process of performing encryption;

[0055] Step 2-2-3-3: Prof-SGX ciphertext Decrypt and get the message

[0056] Step 2-2-3-4: Prof-SGX judgment message middle The legality of If it is legal, then the certificate Verify the legitimacy of the certificate. If it is legal, Save to Prof-SGX; if the certificate If it is illegal, the smart meter identity authentication fails; Prof-SGX calculates the session key and use the session key Encrypt the message (C1) and convert the encrypted ciphertext Send to smart meter SM i ;

[0057] The session key for:

[0058]

[0059] The ciphertext for:

[0060]

[0061] in Indicates the use of session keys The process of performing encryption;

[0062] Step 2-2-3-5: Smart Meter SM i Received ciphertext Then, calculate the session key And the ciphertext Decrypt the message (C1) and then obtain the challenge value C1, SM i Verify the correctness of C1. If it is correct, it means SM i Has successfully authenticated with Prof-SGX and established a trusted channel; if incorrect, it means SM i Failed to authenticate with Prof-SGX;

[0063] The session key for:

[0064]

[0065] The process of encrypting the meter data in step 3 is: for the smart meter SM i , obtaining the meter data of the user's residence, SM i encrypting the meter data using the session key , obtaining the encrypted meter data and uploading it to the cloud storage server CSS through a trusted channel and matching the Prof-SGX of the smart meter;

[0066] The encrypted meter data is:

[0067]

[0068] Wherein represents the data block generated by SM i at T j ; T j represents the time j; represents the encrypted data block; represents the process of encrypting using the session key ;

[0069] The step 4 further comprises:

[0070] Step 4-1: Prof-SGX decrypts the received using the session key , obtains the data and separates T j and SM i from the data ;

[0071] Step 4-2: obtaining the symmetric key generated by the power supply company for Prof-SGX and using the symmetric key to encrypt separated in step 4-1 twice, obtaining the twice encrypted data

[0072] The twice encrypted data is:

[0073]

[0074] Wherein represents the process of twice encrypting using the symmetric key ; m is the number of Prof-SGX; It is the symmetric key generated by the power company for Prof-SGX numbered m;

[0075] Step 4-3: Use homomorphic hash function f hp Secondary encryption of data Hash the evidence Upload the secondary encrypted data to the cloud storage server CSS for storage, and store the evidence Stored in Prof-SGX;

[0076] Step 4-4: Separate the T j As evidence Tree index, SM i As evidence The smart meter at the source builds and stores the Trie-RBT tree in Prof-SGX. Prof-SGX sends the tree index to Verify-SGX.

[0077] The Trie-RBT tree in Prof-SGX includes two layers of tree structures: a dictionary tree for storing smart meter IDs and a red-black tree RBT for storing evidence;

[0078] The dictionary tree for storing the smart meter ID includes: the root node does not store any characters in the smart meter ID, each node other than the root node stores only one character, and the characters stored in the child nodes of each node are different; for a path from the root node to any node other than the root node, a string consisting of the characters stored in all nodes on the path is used as the string of the node;

[0079] For any smart meter ID to be stored, query whether the first character is stored in the child node of the root node of the dictionary tree. If so, access the child node and use the child node as the query starting point for the next character; otherwise, insert a child node that stores the first character and use it as the query starting point for the next character; query whether the second character is stored in the child node of the query starting point. If so, access the child node and use the child node as the query starting point for the next character; otherwise, insert a child node that stores the second character and use it as the query starting point for the next character. Repeat the above process until the query of the last character in the smart meter ID is completed, and mark the end symbol at the node where the last character is stored. This node is used as the end node, indicating that the characters stored in the path from the root node to the end node constitute a complete smart meter ID.

[0080] The red-black tree RBT for storing evidence is: For any smart meter SM i , SM i The root node of the red-black tree is stored in the dictionary tree. In the end node of j As the tree index of the red-black tree and build a red-black tree according to the natural order of timestamps, when new evidence arrives, the new evidence is directly inserted into the rightmost node of RBT;

[0081] The step 5 further comprises:

[0082] Step 5-1: The power company sends an audit request Req to Verify-SGX k ;

[0083] Step 5-2: Verify-SGX generates a challenge index set CS by randomly extracting several data k , generate a random number for each extracted data block, and use all the generated random numbers to form a random number set V;

[0084] Step 5-3: Verify-SGX according to the audit request Req k Generate challenge index set And send it to Prof-SGX, using the challenge index set and random number set V to generate a challenge request And send it to the cloud storage server CSS;

[0085] Step 5-4: The cloud storage server CSS responds to the challenge request Calculate data proof1 and send it to Verify-SGX;

[0086] The data proof1 is:

[0087]

[0088] Among them CD k is the challenge data; for a given Prof-SGX for computing evidence, that is, Prof-SGX m , CD k [Prof] m In Prof-SGX m CD generated on k Evidence section; CD k [DR] m Indicates CD k [Prof] m The relevant remote data part; Represents the random number generated for the extracted data block;

[0089] Step 5-5: Prof-SGX obtains proof0 by calculating the set of evidence stored in Prof-SGX and sends it to Verify-SGX;

[0090] The proof0 is:

[0091]

[0092] Among them, proof0 is the cumulative multiplication of the elements in the evidence set, that is, The cumulative multiplication of

[0093] Step 5-6: Verify-SGX calculates the homomorphic hash function value f of the data proof proof1 based on the received data proof proof1 hp (proof1), Verify-SGX calculates proof2 based on the received proof0 and verifies f hp (proof1) is equal to proof2. If so, the output result is True, indicating that the meter data is completely stored in the cloud storage server CSS and has not been tampered with. k Select secondary encryption data of cloud storage server CSS Sent to the power supply company for use Decryption to obtain meter data Otherwise, the verification fails and the output result is False, indicating that the meter data in the CSS is corrupted, and step 6 is executed.

[0094] The data proves the homomorphic hash function value f of proof1 hp (proof1) is:

[0095]

[0096] where f hp (·) represents a homomorphic hash function;

[0097] The evidence proof2 is:

[0098]

[0099] The power company uses Decryption to obtain meter data The process is:

[0100]

[0101] in Indicates use Secondary encryption of data The process of decryption;

[0102] The process of using the binary method to locate the wrong data in the cloud storage server CSS after the secondary encryption of the meter data in step 6 is as follows: Verify-SGX uses the binary method to locate the wrong data in the challenge index set CS k Split the challenge index set, and send challenge requests to CSS and Prof-SGX respectively according to the split challenge index set. CSS and Prof-SGX generate proofs based on the challenge requests they receive and return them to Verify-SGX for verification. If the verification passes, it means that there is no erroneous data in the data corresponding to this part of the challenge index set. If the verification fails, the challenge index set containing erroneous data is further split using the binary method, and challenge requests are sent to CSS and Prof-SGX respectively according to the split challenge index set. CSS and Prof-SGX generate proofs based on the challenge requests they receive and return them to Verify-SGX for verification until CS is found. k All the error data in and generate the error challenge set Err k , Verify-SGX uses the error challenge set Err according to the expansion range R k As the center of each element in, generate several extended range verification challenges chal Err And send it to Prof-SGX, Prof-SGX determines the match with chal by querying the Trie-RBT tree Err The corresponding evidence is sent to Verify-SGX, which uses a binary search method to find incorrect meter data and send it to the power company.

[0103] The beneficial effects of adopting the above technical solution are:

[0104] In terms of security, the method of the present invention fully utilizes the security features of SGX, and solves the privacy leakage problem caused by the introduction of untrusted third parties in smart grid scenarios by introducing SGX, while reducing communication overhead to a certain extent.

[0105] When the data integrity verification fails, the method of the present invention designs an error location method based on range expansion, locates all erroneous data in the cloud through dichotomy, and obtains the missed erroneous data information based on the audit expansion scope. On the basis of identifying the errors in the challenge set, the error location is expanded to the custom scope to achieve fine-grained error location.

[0106] In terms of efficiency, the method of the present invention designs a new scalable index structure based on the security characteristics of SGX and the fact that smart meter IDs in smart grids tend to have the same prefix. That is, a two-layer data structure is designed to store the smart meter ID and the evidence corresponding to each moment respectively, which speeds up the access to data evidence and improves the retrieval efficiency to a certain extent.

[0107] Considering the high time cost of remote authentication with SGX, the method of the present invention analyzes the authentication characteristics of SGX itself and combines them with the scenario, introduces the power supply company as an intermediary to perform identity authentication between the smart meter and SGX, and designs the authentication process between the smart meter, SGX, and power supply company, thereby improving the authentication efficiency to a certain extent.

[0108] In summary, the SGX-based data integrity verification method for smart grids proposed in this invention not only ensures the privacy and storage security of data in smart grids, but also further improves the verification efficiency, laying the foundation for subsequent smart grids to download correct and complete data from the cloud for subsequent power applications. BRIEF DESCRIPTION OF THE DRAWINGS

[0109] Figure 1 This is a flow chart of a data integrity verification method based on SGX in a smart grid in this embodiment;

[0110] Figure 2 Schematic diagram of the framework of a data integrity verification method based on SGX in a smart grid in this embodiment.

[0111] Figure 3 This is the process intention of a data integrity verification method based on SGX in a smart grid in this embodiment.

[0112] Figure 4 This is a schematic diagram of the remote authentication process between the power supply company and Prof-SGX in this embodiment.

[0113] Figure 5 Schematic diagram of the registration process between the smart meter and the power supply company in this embodiment.

[0114] Figure 6 Schematic diagram of the smart meter and Prof-SGX authentication process in this embodiment.

[0115] Figure 7 Schematic diagram of the dictionary tree smart meter ID insertion process in this implementation.

[0116] Figure 8 Schematic diagram of Trie-RBT index in this implementation. DETAILED DESCRIPTION

[0117] For ease of understanding of the present application, the specific embodiments of the present invention are further described in detail below in conjunction with the accompanying drawings and embodiments. The following embodiments are used to illustrate the present invention, but are not intended to limit the scope of the present invention. On the contrary, the purpose of providing these embodiments is to make the disclosure of the present application more thoroughly and comprehensively understood.

[0118] The data integrity verification method based on SGX in the smart grid of this embodiment is as follows: Figure 1 As shown, the method includes the following steps:

[0119] Step 1: Build an SGX-based data integrity verification model, including: Smart Meter (SM), Cloud Storage Server (CSS), and Electricity Supply Company (ESC).

[0120] In this embodiment, if Figure 2 As shown in FIG, a data integrity verification method based on SGX in a smart grid mainly involves three entities, so it is necessary to build a data integrity verification model based on SGX, which includes: smart meter SM, cloud storage server CSS, and power supply company ESC.

[0121] The smart meter SM is installed in the user's residence and is used to obtain meter data of the user's residence, and encrypt the meter data and transmit it to the cloud storage server CSS.

[0122] In this embodiment, the smart meter (SM), a representative lightweight device, is installed in a user's residence and provides residential electricity meter data, including energy consumption, fluctuations, maximum and minimum voltages, active and reactive power. The SM is the foundation for integrated analysis and optimization of power information. However, as a lightweight device, the SM has limited data processing capabilities and cannot perform computationally intensive cryptographic tasks.

[0123] The cloud storage server CSS is managed by a cloud service provider, and is used to receive encrypted meter data and data requirements from the power supply company ESC, and select meter data that meets the data requirements to transmit to the power supply company ESC.

[0124] In this embodiment, the cloud storage server CSS is an entity managed by a cloud service provider, which has a large amount of storage space and computing resources and can provide corresponding storage services for receiving meter data from SM and sending the meter data to the power supply company according to data requirements.

[0125] The cloud storage server CSS includes: Prof-SGX and Verify-SGX, wherein the Prof-SGX is used to generate and store evidence; the Verify-SGX is used to act as a trusted third party in the audit process to check the integrity of data on the cloud storage server CSS.

[0126] In this implementation, the cloud storage server CSS includes SGX.A, used to generate evidence during the data integrity verification process, and SGX.B, used to verify the results. SGX.A is the Proof Software Guard Extensions (Prof-SGX) agent responsible for generating and storing evidence. When receiving audit inquiries, it uses the evidence generated by Prof-SGX and the meter data stored in the CSS as evidence for the data audit. SGX.B is the Verify Software Guard Extensions (Verify-SGX) agent, used to act as a trusted third party during the audit process, verifying the integrity of the data on the cloud storage server CSS.

[0127] The power supply company ESC is used to send data requirements to the cloud storage server CSS and receive data from the cloud storage server CSS.

[0128] In this implementation, the power supply company (ESC), as a business demand entity in the model, can retrieve data stored in the cloud platform on demand, enabling it to analyze the data and respond to changes in power demand and supply. For example, if the ESC needs to implement a load forecasting service and requires a month's worth of power data, it can send a data request to the cloud storage server (CSS) to retrieve the data. After receiving the data, it can analyze it and respond to the load forecasting service.

[0129] Step 2: Initialize the SGX-based data integrity verification model. The power supply company ESC applies for Prof-SGX and Verify-SGX from the cloud storage server CSS. The power supply company ESC and Prof-SGX perform remote verification and establish a trusted channel. The smart meter SM is matched with the Prof-SGX successfully verified by the power supply company ESC. The smart meter SM verifies the matched Prof-SGX and establishes a trusted channel. The Prof-SGX and Verify-SGX are both contained in the cloud storage server CSS.

[0130] In this embodiment, if Figure 3As shown in Figure 1, a data integrity verification method based on SGX for smart grids consists of five steps: setup, data upload, data evidence, data verification, and error localization. The setup phase consists of initialization and registration authentication of the SGX-based data integrity verification model. Initialization is the prerequisite for data integrity verification of meter data acquired by smart meters and is responsible for generating the public parameters of the model used for data integrity verification of meter data.

[0131] Step 2-1: Initialize the SGX-based data integrity verification model and generate public parameters of the SGX-based data integrity verification model.

[0132] Step 2-1-1: The power supply company ESC generates an additive cyclic group G1 of order q and a multiplicative cyclic group G2 of order q; where q is a large prime number.

[0133] Step 2-1-2: The power supply company ESC sets the bilinear map e and hash function H1 according to the additive cyclic group G1 and the multiplicative cyclic group G2.

[0134] The bilinear map e is expressed as:

[0135] e:G1×G1→G2 (1)

[0136] The hash function H1 is expressed as:

[0137] H1:*0,1+ * →G1 (2)

[0138] Step 2-1-3: Define the multiplicative group Z modulo q q * , power supply company ESC from Z q * Randomly select ESC's private key sk ESC , and calculate the public key pk of ESC ESC .

[0139] In this embodiment, the power supply company ESC randomly selects sk ESC As the private key of ESC, The elements in are all elements in the integer set {1,2,…,q-1} that are coprime to q.

[0140] The public key of the ESC is:

[0141] pk ESC =sk ESC ·P (3)

[0142] Where P is the generator of G1.

[0143] Step 2-1-4: Add the additive cyclic group G1, the multiplicative cyclic group G2, the bilinear map e, the module q, the generator P, and the public key pk of ESC ESC and hash function H1 as the public parameters of the SGX-based data integrity verification model and are published by the power supply company ESC; the public parameters are recorded as {G1, G2, e, q, P, pk ESC ,H1}.

[0144] Step 2-2: The power supply company ESC applies for Prof-SGX and Verify-SGX from the cloud storage server CSS and establishes a trusted channel with Prof-SGX. The smart meter SM registers with the power supply company ESC, matches the Prof-SGX in the cloud storage server CSS, and then verifies with the successfully matched Prof-SGX and establishes a trusted channel.

[0145] In this embodiment, the power supply company ESC and Prof-SGX perform remote authentication to establish a trusted channel. The user authenticates and builds a trusted channel through the Prof-SGX that has been remotely authenticated by the power supply company. At the same time, for each Prof-SGX, the power supply company generates a symmetric key for the Prof-SGX. The symmetric key is transmitted to Prof-SGX through a secure channel, and a hash function H() is generated and disclosed to the smart meter, where H: H represents the real set Hash function on .

[0146] Step 2-2-1: The power company performs remote authentication with Prof-SGX in the cloud storage server CSS and establishes a trusted channel.

[0147] In this embodiment, if Figure 4 As shown, the process of remote authentication between the power supply company and Prof-SGX is as follows:

[0148] Step 2-2-1-1: The power company ESC sends an authentication request Req to the secure area Enclave in Prof-SGX ESC .

[0149] Step 2-2-1-2: After receiving the Req ESC After that, generate the REPORT structure Report by calling the EREPORT instruction E , and Report E Sent to the reference enclave in Prof-SGX.

[0150] In the embodiment, when the EREPORT instruction is executed, a REPORT structure is generated, which includes algorithm information and trusted hardware information related to the Enclave itself. Quoting Enclave (QE) is a structure in Prof-SGX, which is a special Enclave provided by Intel officially, and is an identity-recognized special Enclave.

[0151] Step 2-2-1-3: Quoting Enclave receives the Report E and performs mutual authentication with the Enclave in the Prof-SGX running device or computing environment.

[0152] In the embodiment, as shown in Figure 4 , the QE performs mutual authentication with the Enclave in the platform, i.e., the local authentication part, wherein the platform in which the QE and the Enclave perform mutual authentication is the Prof-SGX running device or computing environment.

[0153] The mutual authentication includes: the Enclave authenticates the identity of the Quoting Enclave and the Quoting Enclave authenticates the identity of the Enclave.

[0154] The process that the Enclave authenticates the identity of the Quoting Enclave includes: the Enclave sends an identity authentication request Req E to the Quoting Enclave, the Quoting Enclave generates a REPORT structure Report QE by calling the EREPORT instruction, wherein Report QE includes: identity information and trusted hardware information of the Quoting Enclave; the Enclave obtains a report key k E of the Enclave and calculates a MAC tag QE of Report , constructs Report QE and the MAC tag and sends them to the Enclave; after receiving , the Enclave recalculates the MAC tag of the REPORT structure according to the report key k E of the Enclave by calling the EGETKEY instruction, and records it as Mac; the Enclave checks whether the trusted hardware information in Report QE is consistent with the hardware information recorded by the Enclave before authentication, if not, the authentication fails, if yes, the Enclave compares Mac with the received separated from the received The matching is performed, if the matching is successful, it proves that the enclave Enclave approves the identity of the referencing enclave, and step 2-2-1-4 is performed; if the matching fails, it proves that the enclave Enclave fails to verify the identity of the referencing enclave.

[0155] In the embodiment, the enclave Enclave checks the hardware information in the REPORT structure, which must be consistent with the hardware information recorded by the enclave Enclave in advance before authentication, to ensure that the QE runs in a trusted SGX environment. The QE verifies the identity of the enclave Enclave in the same way, thereby completing the mutual authentication within the platform.

[0156] The process of the referencing enclave Enclave verifying the identity of the enclave Enclave is that the referencing enclave Enclave sends an identity authentication request Req QE to the enclave Enclave, and the enclave Enclave generates a REPORT structure Report E1 by calling the EREPORT instruction, wherein the Report E1 includes the identity information and trusted hardware information of the enclave Enclave; the report key k QE of the referencing enclave Enclave is obtained and the MAC tag of the REPORT structure is calculated The REPORT structure and the MAC tag thereof are constructed and sent to the referencing enclave Enclave; after receiving , the referencing enclave Enclave recalculates the MAC tag of the REPORT structure according to the report key k QE of the referencing enclave Enclave by calling the EGETKEY instruction, denoted as Mac QE ; the referencing enclave Enclave checks whether the hardware information in the REPORT structure is consistent with the hardware information recorded by the referencing enclave Enclave in advance before authentication, if not, the authentication fails, if yes, Mac QE and the separated from the received are matched, if the matching is successful, it proves that the referencing enclave Enclave approves the identity of the enclave Enclave, and step 2-2-1-4 is performed; if the matching fails, it proves that the referencing enclave Enclave fails to verify the identity of the enclave Enclave.

[0157] Step 2-2-1-4: The referencing enclave Enclave generates a remote authentication result Quote, including the identity information and trusted hardware information of the referencing enclave Enclave, and obtains and utilizes the private key kEPID Generate signature Then generate remote authentication results and their signatures And send it to the power supply company ESC and the safe area Enclave.

[0158] In this embodiment, when QE needs to generate a remote authentication result Quote, QE will use k EPID Signature is done inside the processor. EPID The actual value of k is not exposed. When the Enclave system is running, that is, when the secure area Enclave is executing its code and processing data, only QE can access k EPID .

[0159] Step 2-2-1-5: The power supply company ESC receives Separate And use the public key certificate of Intel Certification Service to sign Verify the legitimacy of the signature. If it is legal, then prove the signature. Valid, and confirm the identity of the secure zone by comparing the trusted hardware information of Quote with the hardware information provided by Intel certification service and store the number ID of the secure zone Enclave E ; If it is illegal, execute 2-2-1-4 again.

[0160] In this embodiment, the power supply company ESC receives Then, the signature is verified by the public key certificate of Intel Attestation Service (IAS) If it is legal, then the signature is verified. Valid, and confirm the identity of the secure zone by comparing the trusted hardware information of Quote with the hardware information provided by IAS and store the ID of the secure zone Enclave E If the hardware information is consistent, the identity of the security zone can be confirmed; if it is illegal, re-execute 2-2-1-4; the Intel Attestation Service mentioned here is a remote authentication service provided by Intel.

[0161] Step 2-2-2: The smart meter SM registers with the power supply company ESC.

[0162] In this embodiment, if Figure 5 As shown, the registration process for smart meters and power supply companies is as follows:

[0163] Step 2-2-2-1: For any smart meter SM i , SM i From Zq * Randomly select SM i Private key And calculate SM i Public key SM i Send messages over a secure channel between the smart meter and the utility To power companies, including Represents the number of the i-th smart meter.

[0164] The SM i The public key is:

[0165]

[0166] In this embodiment, the secure channel between the smart meter and the power company does not involve Prof-SGX, but is a secure channel constructed by the power company through an internal dedicated line.

[0167] Step 2-2-2-2: Based on the received message Power companies use BLS signatures to calculate SM i Certificate And save, power supply company ESC build message And send it to the smart meter through a secure channel, and at the same time the power supply company ESC sends the ESC's public key pk to Prof-SGX ESC .

[0168] The SM i Certificate for:

[0169]

[0170] Among them Sig_sk ESC (·) indicates the use of the private key sk of the power company ESC ESC Message Signature Indicates smart meter SM i Number; Indicates smart meter SM i The validity period of the certificate.

[0171] In this embodiment, the power company uses the BLS signature to sign the smart meter SM i The detailed calculation process of the certificate is shown in Table 1.

[0172] Table 1 Program code of certificate generation algorithm

[0173]

[0174] In this embodiment, the power supply company ESC sends the public key pk to Prof-SGX ESC For subsequent verification of the certificate.

[0175] Step 2-2-2-3: Smart Meter SM i Store Messages

[0176] Step 2-2-3: The smart meter performs identity authentication with Prof-SGX.

[0177] In this embodiment, if Figure 6 As shown in the figure, the specific steps for identity authentication between the smart meter and Prof-SGX are as follows:

[0178] Step 2-2-3-1: Prof-SGX from Randomly select the private key sk of Prof-SGX SGX , and calculate the public key pk of Prof-SGX SGX .

[0179] The public key of Prof-SGX is:

[0180] pk SGX =sk SGX ·P (6)

[0181] Step 2-2-3-2: Smart meter gets ID from storage E The Prof-SGX that needs to be authenticated is matched in the smart meter SM i Select from Select a random number And calculate the parameters for key negotiation Smart MeterSM i from Randomly select the challenge value C1 and construct the message The smart meter uses the public key pk of the Prof-SGX SGX Message Encrypt and get ciphertext And sent to the Prof-SGX; where H(·) is a hash function.

[0182] The ciphertext for:

[0183]

[0184] Where En_pk SGX (·) indicates the use of the public key pk of the Prof-SGX SGX The encryption process.

[0185] In this embodiment, the smart meter uses the stored ID E Matching the SGX that needs to be authenticated refers to matching one from multiple Prof-SGXs. The number of Prof-SGXs is not the same as the number of smart meters, and is obtained by modeling the cost and performance requirements of the power supply company.

[0186] Step 2-2-3-3: Prof-SGX ciphertext Decrypt and get the message

[0187] Step 2-2-3-4: Prof-SGX judgment message middle The legality of If it is legal, then the certificate Verify the legitimacy of the certificate. If it is legal, Save to Prof-SGX; if the certificate If it is illegal, the smart meter identity authentication fails; Prof-SGX calculates the session key and use the session key Encrypt the message (C1) and convert the encrypted ciphertext Send to smart meter SM i .

[0188] The session key for:

[0189]

[0190] The ciphertext for:

[0191]

[0192] in Indicates the use of session keys The encryption process.

[0193] In this embodiment, the process of judging the validity of the certificate is shown in Table 2. If the certificate verification passes, The dictionary tree in Prof-SGX is used for storage to facilitate subsequent searches for smart meters.

[0194] Table 2 Program code of certificate verification algorithm

[0195]

[0196] Step 2-2-3-5: Smart Meter SM i Received ciphertext Then, calculate the session key And the ciphertext Decrypt the message (C1) and then obtain the challenge value C1, SM i Verify the correctness of C1. If it is correct, it means SM i Has successfully authenticated with Prof-SGX and established a trusted channel; if incorrect, it means SM i Failed to authenticate with Prof-SGX.

[0197] The session key for:

[0198]

[0199] In this embodiment, establishing a trusted channel means: remote authentication between the power supply company and Prof-SGX, registering the smart meter with the power supply company, and finally completing authentication between the smart meter and Prof-SGX, thereby establishing a trusted channel between the smart meter and Prof-SGX.

[0200] Step 3: Use the smart meter to obtain the meter data of the user's residence and encrypt the meter data. Upload the encrypted meter data to Prof-SGX verified by the smart meter through a trusted channel.

[0201] The process of encrypting the meter data is as follows: i , obtain the user's residential electricity meter data, SM i Utilizing session keys The meter data is encrypted, and the encrypted meter data is uploaded to the Prof-SGX that successfully matches the smart meter in the cloud storage server CSS through a trusted channel.

[0202] The encrypted meter data is:

[0203]

[0204] in Indicates SM i In T j The data block generated at the moment; T j represents time j; Represents the encrypted data block; Indicates the use of session keys The encryption process.

[0205] Step 4: Prof-SGX decrypts the encrypted meter data, then re-encrypts the decrypted meter data and generates evidence.

[0206] In this embodiment, the received data is first decrypted in Prof-SGX, and then encrypted again using the symmetric key generated by the power company for Prof-SGX The data is encrypted again, and the data is processed using a homomorphic hash function and used as evidence for subsequent verification, and finally the evidence is stored in the constructed data structure, and the encrypted data is stored in the CSS. In this step, it is mainly composed of two parts: processing the data to obtain the subsequent verification evidence, and storing the evidence and storing the evidence in the Trie-RBT. Where m is the number of Prof-SGX; is the symmetric key generated by the power company for Prof-SGX numbered m.

[0207] Step 4-1: Prof-SGX uses the session key to decrypt the received , obtaining data and separating T j and SM i from data .

[0208] Step 4-2: Obtain the symmetric key generated by the power company for Prof-SGX and use the symmetric key to encrypt again separated in step 4-1, obtaining second encryption data

[0209] The second encryption data is:

[0210]

[0211] Where represents the process of encrypting again using the symmetric key ; m is the number of Prof-SGX; is the symmetric key generated by the power company for Prof-SGX numbered m.

[0212] Step 4-3: Use the homomorphic hash function f hp to hash the second encryption data to obtain evidence Upload the second encryption data to the cloud storage server CSS for storage, and store the evidence in Prof-SGX.

[0213] The homomorphic hash function f hp is:

[0214] fhp (d) = g d mod N (13)

[0215] in g is the selected base; N is a large prime number; mod is the modular operation;

[0216] In this embodiment, the homomorphic hash function f hp Used to process the double-encrypted data. mod is a modular operation, which is used to ensure the security and effectiveness of this hash operation. At the same time, this hash function has the property of additive homomorphism, that is, for any two double-encrypted data d1 and d2, their hash values ​​satisfy the following properties:

[0217]

[0218] In this embodiment, when the data When it reaches Prof-SGX, it uses the session key negotiated between Prof-SGX and the smart meter. Encrypted data Decrypt and get the data and separate T j and SM i ,use Encrypt the data twice to obtain the secondary encrypted data Use a homomorphic hash function f hp Re-encrypted data Hash to get evidence After the data is hashed, Upload to CSS for storage. To meet the requirements of subsequent integrity verification, evidence Will be securely stored in Prof-SGX.

[0219] Step 4-4: Separate the T j As evidence Tree index, SM i As evidence The smart meter at the source builds and stores the Trie-RBT tree in Prof-SGX, and Prof-SGX sends the tree index to Verify-SGX.

[0220] In this embodiment, according to the data T obtained by splitting j , SM i , T j As evidence Tree index, SM i As evidence of hashing The source of the smart meter, construct Trie-RBT, to facilitate the search of the meter ID in the dictionary tree, and Insert it into the red-black tree in the corresponding end node, finally store the structure Trie-RBT, and send the tree index to Verify-SGX.

[0221] The Trie-RBT tree in Prof-SGX includes two layers of tree structures: a dictionary tree for storing smart meter IDs and a red-black tree RBT for storing evidence;

[0222] The dictionary tree for storing the smart meter ID includes: the root node does not store any characters in the smart meter ID, each node other than the root node stores only one character, and the characters stored in the child nodes of each node are different; for a path from the root node to any node other than the root node, a string consisting of the characters stored in all nodes on the path is used as the string of the node;

[0223] For any smart meter ID to be stored, query whether the first character is stored in the child node of the root node of the dictionary tree. If so, access the child node and use the child node as the query starting point for the next character; otherwise, insert a child node that stores the first character and use it as the query starting point for the next character; query whether the second character is stored in the child node of the query starting point. If so, access the child node and use the child node as the query starting point for the next character; otherwise, insert a child node that stores the second character and use it as the query starting point for the next character. Repeat the above process until the query of the last character in the smart meter ID is completed, and mark the end symbol at the node where the last character is stored. Use this node as the end node, indicating that the characters stored in the path from the root node to the end node constitute a complete smart meter ID.

[0224] In this embodiment, the Trie-RBT stored in Prof-SGX has a two-layer structure. The first layer records the smart meter The second layer stores red-black tree RBT i For the first level records For the dictionary tree, it has the following structural properties: (1) its root node does not store any characters in the smart meter ID and only serves as a search entry. Except for the root node, each node only stores one character;

[0225] (2) The string formed on the path from the root node to a certain node is the string corresponding to the node;

[0226] (3) The characters stored in the child nodes of each node are different.

[0227] In this embodiment, when the smart meter and its data evidence are stored in Prof-SGX for the first time, the smart meter ID needs to be inserted into the dictionary tree first. After the smart meter ID is inserted, the end symbol is marked at the last inserted node, indicating that the node from the root node to this node is a complete smart meter ID, such as Figure 7 As shown, when it is necessary to insert the smart meter ID = '4035893', first check whether there is '4' in the child node of the root node of the dictionary tree. If not, insert a node that stores '4'. If yes, access the '4' node; then, check whether the '4' node has a child node '0'. If not, insert a node that stores '0', and so on; finally, insert all the characters in the string that needs to be inserted in '4035893', mark the end symbol at the last node, indicating that the ID of a complete smart meter is from the root node to this point, and use the leaf node of the smart meter in the dictionary tree as the end node, that is, the node with the last inserted character 3 is the end node of the smart meter. In the process of data integrity verification, when it is necessary to verify the Prof-SGX m The challenge data CD generated on k When querying the evidence part, it is first necessary to query the smart meter ID in the dictionary tree to determine whether the SM exists; when a smart meter wants to exit later, the corresponding smart meter ID in the dictionary tree is deleted.

[0228] The red-black tree RBT for storing evidence is: For any smart meter SM i , SM i The root node of the red-black tree is stored in the dictionary tree. In the end node of j As the tree index of the red-black tree and according to the natural order of timestamps to build a red-black tree, when new evidence arrives, the new evidence is directly inserted into the rightmost node of RBT.

[0229] In the second-level storage structure RBT, Figure 8 As shown in the figure, the nodes represented by the solid line are black nodes, and the nodes represented by the dotted line are red nodes. Since the evidence stored under each smart meter needs to be stored and searched as quickly as possible, the red-black tree RBT, as a self-balancing binary search tree, can achieve the shortest overall search path. In addition, the root of the red-black tree is stored in the end node of the corresponding smart meter ID in the dictionary tree. For each node in the red-black tree, the evidence must be stored and searched as quickly as possible. associated with, and its timestamp T j is considered as a tree index. When a search is needed on evidence, a challenge request Req k Covered time range TD kAll timestamps in the Req k Furthermore, for the case where data from the SM is continuously increasing, the RBT only needs to support the "insert" operation. Due to the natural order of timestamps, when a new evidence arrives, it can be directly inserted into the rightmost node of the RBT.

[0230] Step 5: The power company sends a data integrity verification audit request Req to Verify-SGX k , Verify-SGX according to the audit request Req k Generate a challenge index set and send it to Prof-SGX, which then generates a challenge request and sends it to the cloud storage server CSS. The cloud storage server CSS calculates the data proof proof1 and sends it to Verify-SGX. Prof-SGX uses the evidence generated in step 4 to calculate proof proof0 and sends it to Verify-SGX. Verify-SGX verifies the data integrity of the double-encrypted meter data based on data proof proof1 and proof proof0. If the verification is successful, the meter data that meets the audit requirements will be sent to the power supply company. Otherwise, execute step 6.

[0231] In this embodiment, the power supply company sends an audit request Req for data integrity verification to the cloud storage server CSS. k ,Verify-SGX on Data Generation Challenge Index CS k , respectively verify the data proof proof1 generated by the cloud storage server and the proof proof0 generated by Prof-SGX, and return the verification results and meter data to the power supply company. The specific steps are as follows:

[0232] In this implementation, the power supply company generates the data based on its actual needs. For example, if the power supply company carries out load forecasting services and needs data from the past month, then Req k Represents the entire dataset for the past month.

[0233] Step 5-1: The power company sends an audit request Req to Verify-SGX k ;

[0234] Step 5-2: Verify-SGX generates a challenge index set CS by randomly extracting several data k , generate a random number for each extracted data block, and use all the generated random numbers to form a random number set V.

[0235] The random number set V is:

[0236]

[0237] where (T j , SM i ) denotes the index of the extracted data block, also denotes the index of , and also denotes the index of ; denotes the random number generated for the extracted data block.

[0238] Step 5-3: Verify-SGX generates a challenge index set CS k and sends it to Prof-SGX, which generates a challenge request using the challenge index set CS and the random number set V and sends it to the cloud storage server CSS.

[0239] In this embodiment, the evidence of the data in the challenge index set CS k is stored in different Prof-SGX respectively.

[0240] Step 5-4: The cloud storage server CSS calculates the data proof proof1 according to the challenge request and sends it to Verify-SGX.

[0241] The data proof proof1 is:

[0242]

[0243] where CD k is the challenge data; for a given Prof-SGX used to calculate the evidence, i.e. Prof-SGX m , CD k [Prof] m denotes the evidence part of CD m generated on Prof-SGX k ; CD k [DR] m denotes the remote data part related to CD k [Prof] m .

[0244] In this embodiment, when the CSS receives the challenge request , it calculates the proof proof1 of the data stored in the cloud and sends it to Verify-SGX.

[0245] Step 5-5: Prof-SGX calculates the set of evidence stored in Prof-SGX and sends the resulting proof proof0 to Verify-SGX;

[0246] ​The proof0 is:

[0247]

[0248] Among them, proof0 is the cumulative multiplication of the elements in the evidence set, that is, The cumulative multiplication of .

[0249] Step 5-6: Verify-SGX calculates the homomorphic hash function value f of the data proof proof1 based on the received data proof proof1 hp (proof1), Verify-SGX calculates proof2 based on the received proof0 and verifies f hp (proof1) is equal to proof2. If they are equal, the output result is True, indicating that the meter data is completely stored in the cloud storage server CSS and has not been tampered with. k Select the secondary encryption data of the cloud storage server CSS Sent to the power supply company for use Decryption to obtain meter data Otherwise, the verification fails and the output result is False, indicating that the meter data in the CSS is corrupted, and step 6 is executed.

[0250] The data proves the homomorphic hash function value f of proof1 hp (proof1) is:

[0251]

[0252] where f hp (·) represents a homomorphic hash function.

[0253] The evidence proof2 is:

[0254]

[0255] The power company uses Decryption to obtain meter data The process is:

[0256]

[0257] in Indicates use Secondary encryption of data The process of decryption.

[0258] In this embodiment, since f hp With homomorphic properties, we can get the equation: f hp(proof1) = proof2. If the equation holds, the output result is True, indicating that the data is completely stored in the CSS and has not been tampered with. The audit request Req k The corresponding data set is sent to the power company and used Decrypted Otherwise, the verification fails and the output result is False, indicating that the data is corrupted in the CSS. Go to step 6.

[0259] Table 3 Program code of integrity verification algorithm

[0260]

[0261] Step 6: Use the binary search method to locate erroneous data in the double-encrypted meter data in the cloud storage server CSS, obtain all erroneous meter data, and send it to the power supply company. The power supply company obtains meter data that meets audit requirements except for all erroneous meter data from the cloud storage server CSS.

[0262] The process of using the binary method to locate the wrong data of the meter data after the secondary encryption in the cloud storage server CSS is as follows: Verify-SGX uses the binary method to locate the wrong data of the challenge index set CS k Split the challenge index set, and send challenge requests to CSS and Prof-SGX respectively according to the split challenge index set. CSS and Prof-SGX generate proofs based on the challenge requests they receive and return them to Verify-SGX for verification. If the verification passes, it means that there is no erroneous data in the data corresponding to this part of the challenge index set. If the verification fails, the challenge index set containing erroneous data is further split using the binary method, and challenge requests are sent to CSS and Prof-SGX respectively according to the split challenge index set. CSS and Prof-SGX generate proofs based on the challenge requests they receive and return them to Verify-SGX for verification until CS is found. k All the error data in and generate the error challenge set Err k , Verify-SGX uses the error challenge set Err according to the expansion range R k As the center of each element in, generate several extended range verification challenges chal Err And send it to Prof-SGX, Prof-SGX determines the match with chal by querying the Trie-RBT tree Err The corresponding evidence is sent to Verify-SGX, which uses a binary search method to find incorrect meter data and send it to the power company.

[0263] In the embodiment, when Verify-SGX outputs False in the data verification stage, it indicates that the data stored in CSS is damaged, and the power supply company needs to know the damage of the data to determine the availability of the data stored in the cloud. First, Verify-SGX splits the challenge index set CS k by dichotomy, and sends challenge requests to CSS and Prof-SGX respectively. Second, Prof-SGX generates corresponding challenges according to the re-sent challenge set and submits them to Verify-SGX for verification. If the audit cannot pass the verification according to the re-sent challenge set, it indicates that there is error data in the set. The set with error data is further split by dichotomy until the exact index number of the error data is located, and all error data in CS k is found. k Then, Verify-SGX generates an extended range verification challenge chal k centered on each element in the error challenge set Err Err , where the extended range R is given by the power supply bureau in advance, generally 100, representing 100 data block distances, and sends the set of extended range verification challenges chal Err to Prof-SGX. Finally, Prof-SGX sends the corresponding evidence of the challenge chal Err to Verify-SGX, and Verify-SGX finally determines which data is incorrect according to the dichotomy and sends the result to ESC. The power supply company obtains the data blocks with correct audit verification from CSS.

[0264] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, but not to limit them. Although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that they can modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacement to some or all of the technical features. Such modifications or replacements do not change the essence of the corresponding technical solutions out of the scope defined by the claims of the present application.

Claims

1. A data integrity verification method based on SGX in smart grid, characterized by: The method comprises the following steps: Step 1: Build an SGX-based data integrity verification model, including: smart meter SM, cloud storage server CSS, and power supply company ESC; Step 2: Initialize the SGX-based data integrity verification model. The power supply company ESC applies for Prof-SGX and Verify-SGX from the cloud storage server CSS. The power supply company ESC and Prof-SGX perform remote verification and establish a trusted channel. The smart meter SM is matched with the Prof-SGX that has been remotely verified by the power supply company ESC. The smart meter SM verifies the matched Prof-SGX and establishes a trusted channel. The Prof-SGX and Verify-SGX are both contained in the cloud storage server CSS. The Prof-SGX is used to generate and store evidence; the Verify-SGX is used to act as a trusted third party in the audit process to check the integrity of the data on the cloud storage server CSS; Step 3: Use the smart meter to obtain the user's residential meter data and encrypt the meter data. The encrypted meter data is uploaded to Prof-SGX through a trusted channel. Step 4: Prof-SGX decrypts the encrypted meter data, then re-encrypts the decrypted meter data and generates evidence; Step 5: The power company sends an audit request for data integrity verification to Verify-SGX ,Verify-SGX based on audit requests Generate a challenge index set and send it to Prof-SGX, then generate a challenge request and send it to the cloud storage server CSS, which calculates the data proof Send it to Verify-SGX, which computes the proof using the evidence generated in step 4 Sent to Verify-SGX, Verify-SGX proves based on data and proof Perform data integrity verification on the secondary encrypted meter data. If the verification is successful, the meter data that meets the audit requirements will be sent to the power supply company. Otherwise, proceed to step 6. Step 6: Use the binary search method to locate erroneous data in the double-encrypted meter data in the cloud storage server CSS, obtain all erroneous meter data, and send it to the power supply company. The power supply company obtains meter data that meets audit requirements except for all erroneous meter data from the cloud storage server CSS.

2. According to the SGX-based data integrity verification method in a smart grid, the method is characterized in that: The smart meter SM is installed in the user's home and is used to obtain the meter data of the user's home and transmit the encrypted meter data to the cloud storage server CSS; The cloud storage server CSS is managed by the cloud service provider and is used to receive meter data from the smart meter SM and data requirements from the power supply company ESC, and select meter data that meets the data requirements and transmit it to the power supply company ESC; The power supply company ESC is used to send data requirements to the cloud storage server CSS and receive data from the cloud storage server CSS.

3. The data integrity verification method based on SGX in a smart grid according to claim 2 is characterized in that: The step 2 further comprises: Step 2-1: Initialize the SGX-based data integrity verification model and generate public parameters of the SGX-based data integrity verification model; Step 2-1-1: The power company ESC generates an additive cyclic group of order q and a multiplicative cyclic group of order q ; where q is a large prime number; Step 2-1-2: The power supply company ESC follows the addition cycle group and the multiplicative cyclic group Set bilinear map and hash functions ; Step 2-1-3: Define the multiplicative group modulo q , the power supply company ESC from Randomly select the private key of ESC , and calculate the public key of ESC ; Step 2-1-4: Add the additive cyclic group , multiplicative cyclic group , bilinear mapping , module q, generator 、ESC's public key and hash functions As a public parameter of the SGX-based data integrity verification model and published by the power supply company ESC; the public parameter is recorded as ; Step 2-2: The power supply company's ESC applies for Prof-SGX and Verify-SGX from the cloud storage server CSS and establishes a trusted channel with the Prof-SGX. The smart meter SM registers with the power supply company's ESC, matches the Prof-SGX in the cloud storage server CSS, and then verifies the matched Prof-SGX and establishes a trusted channel. Step 2-2-1: The power company and Prof-SGX perform remote authentication and establish a trusted channel; Step 2-2-2: The smart meter SM registers with the power supply company ESC; Step 2-2-3: The smart meter performs identity authentication with Prof-SGX.

4. The data integrity verification method based on SGX in a smart grid according to claim 3 is characterized in that: The step 2-2-1 further includes: Step 2-2-1-1: The power company's ESC sends an authentication request to the secure enclave in Prof-SGX ; Step 2-2-1-2: The Enclave receives Then, generate the REPORT structure by calling the EREPORT instruction , and Sent to the reference enclave in Prof-SGX; Step 2-2-1-3: Quote Enclave upon receiving Afterwards, bidirectional verification is performed with the secure zone Enclave within the device or computing environment running Prof-SGX; The two-way verification includes: the secure zone Enclave authenticates the reference Enclave and the reference Enclave authenticates the secure zone Enclave; The process of the secure zone Enclave authenticating the reference Enclave is as follows: the secure zone Enclave sends an identity authentication request to the reference Enclave , reference Enclave generates REPORT structure by calling EREPORT instruction ,in Includes: referencing the identity information and trusted hardware information of the Enclave; obtaining the report key of the secure area Enclave and calculate MAC Tags , build and its MAC tag And send it to the security zone Enclave; the security zone Enclave receives Then, call the EGETKEY instruction to get the key from the Enclave. Recalculate the MAC tag of the REPORT structure, recorded as ;Safe zone Enclave check Is the trusted hardware information in the security zone consistent with the hardware information pre-recorded by the Enclave before authentication? If not, the authentication fails. If consistent, and received from Separated from Perform a match. If the match succeeds, it proves that the secure enclave recognizes the identity of the reference enclave, and executes step 2-2-1-4. If the match fails, it proves that the secure enclave fails to authenticate the reference enclave. The process of authenticating the security zone Enclave by the reference Enclave is as follows: the reference Enclave sends an identity authentication request to the security zone Enclave , the secure area Enclave generates a REPORT structure by calling the EREPORT instruction ,in Includes: identity information and trusted hardware information of the secure zone Enclave; obtain the report key of the reference Enclave And calculate the MAC tag of the REPORT structure , build the REPORT structure and its MAC tag And send it to the reference Enclave; the reference Enclave receives Then, the EGETKEY instruction is called to obtain the report key of the referenced enclave. Recalculate the MAC tag of the REPORT structure, recorded as ; The reference Enclave checks whether the hardware information in the REPORT structure is consistent with the hardware information pre-recorded by the reference Enclave before authentication. If they are inconsistent, the authentication fails. If they are consistent, and received from Separated from Perform a match. If the match succeeds, it proves that the referencing enclave recognizes the identity of the secure enclave, and executes step 2-2-1-4. If the match fails, it proves that the referencing enclave has failed to authenticate the secure enclave. Step 2-2-1-4: Reference Enclave to generate remote authentication results , including: referencing the Enclave's identity information and trusted hardware information, obtaining and utilizing the processor's private key Generate signature , and then generate remote authentication results and their signatures And send it to the power supply company ESC and the safe zone Enclave; Step 2-2-1-5: The power supply company ESC receives Separate , and sign it using the public key certificate of Intel Certification Service Verify the legitimacy of the signature. If it is legal, then prove the signature. Valid and compared The trusted hardware information and the hardware information provided by Intel authentication service are used to confirm the identity of the security zone and store the number of the security zone Enclave. ; If it is illegal, execute 2-2-1-4 again.

5. The data integrity verification method based on SGX in a smart grid according to claim 4 is characterized in that: The step 2-2-2 further includes: Step 2-2-2-1: For any smart meter , from Random selection Private key , and calculate Public key , Send messages over a secure channel between the smart meter and the utility To power companies, including Indicates the The serial number of the smart meter; Step 2-2-2-2: Based on the received message , the power company uses BLS signature calculation Certificate And save, power supply company ESC build message And send it to the smart meter through a secure channel, and the power supply company ESC sends the ESC's public key to Prof-SGX ; described Certificate for: (5); in Indicates using the private key of the power supply company's ESC Message Signature Smart meter The validity period of the certificate; Step 2-2-2-3: Smart Meter Store Messages .

6. The data integrity verification method based on SGX in a smart grid according to claim 5, characterized in that: The step 2-2-3 further includes: Step 2-2-3-1: Prof-SGX from Randomly select the private key of Prof-SGX , and calculate the public key of Prof-SGX ; Step 2-2-3-2: The smart meter reads the stored Match the Prof-SGX that needs to be authenticated. For this Prof-SGX, the smart meter Select from Select a random number And calculate the parameters for key negotiation Smart meters from Randomly select challenge value , and construct the message , the smart meter uses the public key of Prof-SGX Message Encrypt and get ciphertext And sent to the Prof-SGX; is a hash function; The ciphertext for: (7); in Indicates the use of the Prof-SGX public key The process of performing encryption; Step 2-2-3-3: Prof-SGX ciphertext Decrypt and get the message ; Step 2-2-3-4: Prof-SGX judgment message middle The legality of If it is legal, then the certificate Verify the legitimacy of the certificate. If it is legal, Save to Prof-SGX; if the certificate If it is illegal, the smart meter identity authentication fails; Prof-SGX calculates the session key , and use the session key Message Encryption is performed and the encrypted ciphertext is Send to smart meter ; The session key for: (8); The ciphertext for: (9); in Indicates the use of session keys The process of performing encryption; Step 2-2-3-5: Smart Meter Received ciphertext Then, calculate the session key , and the ciphertext Decrypt the message , and then obtain the challenge value , verify If correct, it means Has successfully authenticated with Prof-SGX and established a trusted channel; if incorrect, it means Failed to authenticate with Prof-SGX; The session key for: (10)。 7. The data integrity verification method based on SGX in a smart grid according to claim 6 is characterized in that: The process of encrypting the meter data in step 3 is as follows: , obtain the electricity meter data of the user's residence, Utilizing session keys Encrypt the meter data and upload it to the Prof-SGX that successfully matches the smart meter in the cloud storage server CSS through a trusted channel. The encrypted meter data is: (11); in express exist Data blocks generated at each moment; express time; Represents the encrypted data block; Indicates the use of session keys The encryption process.

8. The data integrity verification method based on SGX in a smart grid according to claim 7, characterized in that: The step 4 further comprises: Step 4-1: Prof-SGX Utilization Session Key For receiving Decrypt and get the data and from the data Separate 、 and ; Step 4-2: Obtain the symmetric key generated by the power company for Prof-SGX , and using symmetric keys For the separated Perform secondary encryption to obtain secondary encrypted data ; The secondary encrypted data for: (12); in Indicates the use of symmetric keys The process of performing secondary encryption; is the number of Prof-SGX; The power supply company is numbered The symmetric key generated by Prof-SGX; Step 4-3: Use a homomorphic hash function Secondary encryption of data Hash the evidence , upload the secondary encrypted data to the cloud storage server CSS for storage, and store the evidence Stored in Prof-SGX; Step 4-4: Separate the As evidence The tree index of As evidence The smart meter at the source builds and stores the Trie-RBT tree in Prof-SGX. Prof-SGX sends the tree index to Verify-SGX. The Trie-RBT tree in Prof-SGX includes two layers of tree structures: a dictionary tree for storing smart meter IDs and a tree for storing evidence. Red-black tree RBT; The dictionary tree for storing the smart meter ID includes: the root node does not store any characters in the smart meter ID, each node other than the root node stores only one character, and the characters stored in the child nodes of each node are different; for a path from the root node to any node other than the root node, a string consisting of the characters stored in all nodes on the path is used as the string of the node; For any smart meter ID to be stored, query whether the first character is stored in the child node of the root node of the dictionary tree. If so, access the child node and use the child node as the query starting point for the next character; otherwise, insert a child node that stores the first character and use it as the query starting point for the next character; query whether the second character is stored in the child node of the query starting point. If so, access the child node and use the child node as the query starting point for the next character; otherwise, insert a child node that stores the second character and use it as the query starting point for the next character. Repeat the above process until the query of the last character in the smart meter ID is completed, and mark the end symbol at the node where the last character is stored. This node is used as the end node, indicating that the characters stored in the path from the root node to the end node constitute a complete smart meter ID. The red-black tree RBT for storing evidence is: For any smart meter ,Will The root node of the red-black tree is stored in the dictionary tree. In the end node of As the tree index of the red-black tree and according to the natural order of timestamps to build a red-black tree, when new evidence arrives, the new evidence is directly inserted into the rightmost node of RBT.

9. The data integrity verification method based on SGX in a smart grid according to claim 8, characterized in that: The step 5 further comprises: Step 5-1: The power company sends an audit request to Verify-SGX ; Step 5-2: Verify-SGX generates a challenge index set by randomly extracting several data , generate a random number for each extracted data block, and use all the generated random numbers to form a random number set ; Step 5-3: Verify-SGX based on audit request Generate challenge index set And send it to Prof-SGX, using the challenge index set and a set of random numbers Generate a challenge request And send it to the cloud storage server CSS; Step 5-4: The cloud storage server CSS responds to the challenge request Calculation data proof And send it to Verify-SGX; The data proves for: (16); in is the challenge data; for a given Prof-SGX for computing evidence, that is, , Indicates Generated above the evidence part; Represents The relevant remote data part; Represents the random number generated for the extracted data block; Step 5-5: Prof-SGX is proven by computing the set of evidence stored in Prof-SGX And send it to Verify-SGX; The said proof for: (17); in is the cumulative product of the elements in the evidence set, that is The cumulative multiplication of Step 5-6: Verify-SGX proves based on the received data Calculation data proof The homomorphic hash function value of , Verify-SGX receives the proof Computational evidence ,verify and Are they equal? ​​If they are equal, the output result is True, indicating that the meter data is completely stored in the cloud storage server CSS and has not been tampered with. Select secondary encryption data of cloud storage server CSS Sent to the power supply company for use Decryption to obtain meter data Otherwise, the verification fails and the output result is False, indicating that the meter data in the CSS is corrupted, and step 6 is executed. The data proves The homomorphic hash function value of for: (18); in represents a homomorphic hash function; The evidence for: (19); The power company uses Decryption to obtain meter data The process is: (20); in Indicates use Secondary encryption of data The process of decryption.

10. The data integrity verification method based on SGX in a smart grid according to claim 9, characterized in that: The process of using the binary method to locate the wrong data in the secondary encrypted meter data in the cloud storage server CSS in step 6 is as follows: Verify-SGX uses the binary method to locate the challenge index set Split the challenge index set, and send challenge requests to CSS and Prof-SGX respectively according to the split challenge index set. CSS and Prof-SGX generate proofs based on the challenge requests they receive and return them to Verify-SGX for verification. If the verification passes, it means that there is no erroneous data in the data corresponding to the split challenge index set. If the verification fails, the challenge index set containing erroneous data is further split using the binary search method, and challenge requests are sent to CSS and Prof-SGX respectively according to the split challenge index set. CSS and Prof-SGX generate proofs based on the challenge requests they receive and return them to Verify-SGX for verification until a corrected challenge index set is found. All the wrong data in and generate the wrong challenge set , Verify-SGX uses the error challenge set according to the expansion range R As the center of each element in, generate several extended scope verification challenges And send it to Prof-SGX, Prof-SGX determines the The corresponding evidence is sent to Verify-SGX, which uses a binary search method to find incorrect meter data and send it to the power company.

Citation Information

Patent Citations

  • Integrity auditing method for smart power grid data

    CN113609533A

  • techniques for SGX enclave remote authentication

    DE102018101307A1