Data integrity verification method based on SGX under smart power grid

The SGX-based data integrity verification method addresses bandwidth and security challenges in smart grids by establishing a trusted channel and using a scalable index structure, ensuring secure and efficient data retrieval and verification.

CN119135410AActive Publication Date: 2024-12-13NORTHEASTERN UNIV AT QINHUANGDAO
View PDF 2 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

Smart grid systems face challenges in managing the bandwidth overhead and data integrity of massive smart meter data due to limited computing power in IoT devices and the risks associated with untrusted third-party auditors, while existing index structures are inefficient and inflexible for dynamic operations in the SGX environment.

Method used

A data integrity verification method using SGX (Software Guard Extensions) is implemented, involving Prof-SGX and Verify-SGX to establish a trusted channel, encrypt and verify data integrity, and utilize a scalable Trie-RBT index structure for efficient retrieval of smart meter data, with a two-layer data structure for smart meter IDs and evidence.

Benefits of technology

Ensures privacy and storage security, reduces communication overhead, and improves verification efficiency by leveraging SGX's security features and designing a scalable index structure for fast data access and error location.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119135410A_ABST
    Figure CN119135410A_ABST
Patent Text Reader

Abstract

The invention provides an SGX-based data integrity verification method under a smart power grid, and relates to the technical field of network security. The method comprises the following steps: in an SGX-based data integrity verification model, a power supply company applies for Prof-SGX and Verify-SGX from a cloud storage server, and establishes a trusted channel with the Prof-SGX through remote verification, and an intelligent electric meter is matched with the successfully verified Prof-SGX and establishes a trusted channel; the intelligent electric meter encrypts electric meter data and then uploads the electric meter data to the Prof-SGX; the Prof-SGX firstly decrypts the encrypted ammeter data, then carries out secondary encryption and generates evidence; and the Verify-SGX performs data integrity verification on the secondarily encrypted ammeter data according to the auditing demand provided by the power supply company, and sends the ammeter data meeting the auditing demand to the power supply company if the verification is passed, otherwise, the wrong data is positioned by adopting a dichotomy method, so that the power supply company obtains the correct ammeter 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 device in smart grid infrastructure. As of 2021, more than 110 million smart meters have been installed in the United States. In 2022 alone, the number of smart meters in the United States will surge to 124 million, and the amount of data transmitted will reach 48PB. If the smart grid directly obtains the data uploaded by massive smart meters, it will face the bandwidth overhead problem caused by the real-time transmission of streaming data. With the development of mobile cloud computing, uploading smart meter data to the cloud for storage has become an important way to solve this problem. For smart grid organizations, it is necessary to use public clouds for storage due to cost considerations. However, due to the inherent architectural problems of cloud service providers, such as the Byzantine problem, the data stored in the cloud may be damaged or leaked, and the cloud will not immediately inform customers of data loss events due to its own interests. Based on the above problems, in order to achieve the secure storage of smart meter data on the cloud platform and verify the integrity of its data, it is necessary to introduce data integrity verification methods to ensure the security of cloud data.

[0003] Using data integrity verification to verify cloud storage data 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 label. The user locally uses the private key sk generated in algorithm (1) to execute the label generation algorithm on the file to generate a data label for 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, the output is the audit challenge set chal and the data error location extension scope 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 evidence P based on the audit challenge set chal and returns the evidence 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 evidence P sent by the cloud server. If wrong data is found, the wrong challenge index is first found based on the binary search method, and then the extended range R is used to query whether there is any wrong data leakage.

[0009] The above traditional data integrity algorithms have the following two problems: On the one hand, for smart meters in smart grid scenarios, the computing power required by users to integrate signature calculation and verification calculation in the traditional data integrity verification process is not met; 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 a secure memory for applications to protect the applications in the memory from the influence of the external environment. As a component with certain computing power and no need for additional deployment in the cloud environment, SGX can solve the problem that IoT devices do not have certain computing power and need a trusted third party.

[0010] For large-scale smart meters (SMs) and their growing data volume, increasing the difficulty of signature management and storage overhead is inevitable. As the amount of data continues to increase, managing and accessing signature evidence becomes more complex and time-consuming. In order to access these signature evidences faster, an efficient index structure needs to be established. For newly generated evidence, the signer can store it directly in the index for subsequent quick retrieval. Faced with such large-scale evidence generation, the traditional Merkle-tree index structure can authenticate the data while providing index retrieval to ensure that the data has not been tampered with. However, in the SGX environment, SGX itself provides a trusted execution environment. The primary goal of the index structure is to ensure that signature evidence can be retrieved efficiently and accurately to meet the needs of fast access. If a hash table is used to store the index, the accuracy will be reduced due to a large number of hash conflicts. At the same time, for dynamic operations of smart meters, such as adding or deleting, this requires the index structure to be relatively flexible, but the existing index structure can only support queries on data block structures and is not suitable for the SGX environment. Therefore, it is necessary to design a new index structure with scalability. Summary of the invention

[0011] In view of the above-mentioned deficiencies in the prior art, the present invention proposes a data integrity verification method based on SGX in a smart grid based on the security characteristics of SGX, aiming to ensure the privacy security 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 a data integrity verification model based on SGX, 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 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 included in the cloud storage server CSS.

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

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

[0017] Step 5: The power company sends an audit request for data integrity verification to Verify-SGX k , Verify-SGX according to the audit request Req k 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. 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 the 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.

[0018] Step 6: Use the binary search method to locate the erroneous data in the meter data after the secondary encryption in the cloud storage server CSS, obtain all the erroneous meter data and send them to the power supply company. The power supply company obtains the meter data that meets the audit requirements except all the erroneous meter data from the cloud storage server CSS.

[0019] The smart meter SM is installed in the user's residence, and is used to obtain the meter data of the user's residence, and encrypt the meter data and transmit 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 to transmit 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 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 the hash function H1 according to the addition cycle group G1 and the multiplication cycle 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 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, and the smart meter SM matches the Prof-SGX in the cloud storage server CSS, and then verifies with the successfully matched Prof-SGX and establishes a trusted channel.

[0030] Step 2-2-1: The power supply 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 supply 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 request, the security zone Enclave ESC After that, the REPORT structure is generated 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 After that, two-way verification is performed with the secure zone Enclave in 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 zone Enclave E And calculate Report QE MAC Tags Build Report QE and its MAC tag And send it to the secure zone Enclave; the secure zone Enclave receives After that, the EGETKEY instruction is called to obtain the report key k of the secure area Enclave. E Recalculate the MAC tag of the REPORT structure, recorded as Mac; the secure area Enclave checks the Report QE The trusted hardware information in the secure zone Enclave is consistent with the hardware information pre-recorded before authentication. If not, authentication fails. If consistent, the Mac and the received Separated from Perform a match. If the match is successful, it proves that the secure zone Enclave recognizes the identity of the referenced Enclave, and executes step 2-2-1-4. If the match fails, it proves that the secure zone Enclave fails to authenticate the referenced 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 a 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, denoted 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 reference enclave recognizes the identity of the secure zone enclave, and executes step 2-2-1-4. If the match fails, it proves that the reference enclave fails to authenticate the secure zone 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 the remote authentication result and its signature And send it to the power supply company ESC and the safe area 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 legitimate, The security zone is valid and the identity of the security zone is confirmed by comparing the trusted hardware information of Quote with the hardware information provided by Intel certification service and storing the ID of the security 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 , S.M. i From Z q * Randomly select SM i Private key And calculate SM i The public key SM i Send messages over a secure channel between the smart meter and the utility company To power companies, including represents the serial 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. At the same time, the power supply company ESC sends the ESC 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 supply company ESC ESC About the message Signature Smart Meter SM i The validity period of the certificate;

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

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

[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 from the stored ID 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 a challenge value C1 and construct a message The smart meter uses the public key pk of the Prof-SGX SGX About the message Encrypt and get the 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 If the certificate is If it is legal, Save to Prof-SGX; if the certificate If it is illegal, the smart meter 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 MeterSM 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 The authentication with Prof-SGX has been successful and a trusted channel has been established; if incorrect, it means that 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 as follows: i , obtain the user's residential meter data, SM i Using Session Keys Encrypt the meter data, obtain the encrypted 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;

[0066] The encrypted electric meter data is:

[0067]

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

[0069] The step 4 further comprises:

[0070] Step 4-1: Prof-SGX Utilization Session Key For receiving Decrypt and get the data And from the data Separate T j and SM i ;

[0071] Step 4-2: Obtain the symmetric key generated by the power company for Prof-SGX And use symmetric key For the separated Perform secondary encryption to obtain secondary encrypted data

[0072] The secondary encrypted data for:

[0073]

[0074] in Indicates the use of symmetric keys The process of secondary encryption; m is the number of Prof-SGX; It is the symmetric key generated by the power supply 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, and Prof-SGX sends the tree index to Verify-SGX;

[0077] The Trie-RBT tree in the Prof-SGX includes two layers of tree structures, namely: 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 except 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 except the root node, a character string composed of characters stored in all nodes on the path is used as the character 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, and use the 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;

[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 construct 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 sent 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 proof proof1 is:

[0087]

[0088] 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 Representation and 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 proof proof0 is:

[0091]

[0092] Where 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 the secondary encryption data of the cloud storage server CSS Sent to the power supply company for use Decryption to get meter data Otherwise, the verification fails and the output result is False, indicating that the meter data has been damaged in the CSS, 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 proof2 is:

[0098]

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

[0100]

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

[0102] The process of using the binary search method to locate the wrong data in the meter data after double encryption in the cloud storage server CSS described in step 6 is as follows: Verify-SGX uses the binary search method to locate the wrong data in the challenge index set CS k The challenge index set is split, and challenge requests are sent to CSS and Prof-SGX respectively according to the split challenge index set. CSS and Prof-SGX generate proofs according to 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 by binary search, and challenge requests are sent to CSS and Prof-SGX respectively according to the split challenge index set. CSS and Prof-SGX generate proofs according to 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 the , generate several extended range verification challenge chal Err And send it to Prof-SGX, Prof-SGX determines the corresponding 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 sends it to the power supply company.

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

[0104] In terms of security, the method of the present invention makes full use of the security features of SGX, and solves the privacy leakage problem caused by the introduction of untrusted third parties in the smart grid scenario 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 scope expansion. All erroneous data in the cloud are located through dichotomy, and the missed error data information is obtained 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 characteristic that the smart meter IDs in the smart grid are prone to have the same prefix. That is, a two-layer data structure is designed to respectively store the smart meter ID and the evidence corresponding to each moment, thereby speeding up the access to data evidence and improving the retrieval efficiency to a certain extent.

[0107] Considering that the time overhead of remote authentication with SGX is relatively large, the method of the present invention analyzes the authentication characteristics of SGX itself and combines the scenarios, introduces the power supply company as a medium to perform identity authentication between the smart meter and SGX, designs the authentication process between the smart meter, SGX and the power supply company, and improves the authentication efficiency to a certain extent.

[0108] In summary, the SGX-based data integrity verification method under the smart grid proposed in the present invention not only ensures the privacy security and storage security of data under the smart grid, but also further improves the verification efficiency, laying the foundation for the subsequent smart grid 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 implementation mode;

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

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

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

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

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

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

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

[0117] In order to facilitate the 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 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 comprises the following steps:

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

[0120] In this embodiment, if Figure 2 As shown, 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 the 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, as a representative of lightweight devices, is an entity installed in the user's home and is used to provide the user's home meter data, which includes: energy consumption, fluctuation, maximum voltage, minimum voltage, active power and reactive power, etc. SM is the basis for integrated analysis and optimization of power information. However, as a lightweight device, SM has limited data processing capabilities and cannot perform high-computation cryptographic related work.

[0123] The cloud storage server CSS is managed by the cloud service provider, and is used to receive the encrypted meter data and data requirements from the power supply company ESC, and select the 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, 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 embodiment, the cloud storage server CSS contains SGX.A for evidence generation and SGX.B for verification results in the data integrity verification process. Among them, SGX.A is the evidence SGX (Proof Software Guard Extensions, Prof-SGX), which is responsible for generating and storing evidence. When receiving inquiries during the audit process, the evidence generated by Prof-SGX and the meter data stored in CSS are used together as evidence for data audit; SGX.B is the verification SGX (Verify Software Guard Extensions, Verify-SGX), which 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.

[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 extract data stored in the cloud platform on demand, so that it can analyze the corresponding data and respond to changes in power demand and supply. For example, if the power supply company ESC needs to carry out load forecasting services and needs power data for the past month, it will send a data request to the cloud storage server CSS to extract power data for one month, and after obtaining the data, it will perform data analysis to 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 is verified with the matched Prof-SGX and a trusted channel is established. The Prof-SGX and Verify-SGX are both included in the cloud storage server CSS.

[0130] In this embodiment, if Figure 3As shown in FIG, a data integrity verification method based on SGX in a smart grid mainly includes five steps: setting stage, data upload, data evidence, data verification, and error location. The setting stage is divided into initialization and registration authentication of the data integrity verification model based on SGX. Initialization is the premise for data integrity verification of the meter data obtained by the smart meter, and is responsible for generating the public parameters of the model used to verify the data integrity of the 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 the 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 the elements in the integer set {1,2,…,q-1} that are coprime with 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, and the smart meter SM 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 implementation, the power supply company ESC and Prof-SGX perform remote authentication to establish a trusted channel, and 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 The hash function on .

[0146] Step 2-2-1: The power supply 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 supply 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 request, the security zone Enclave ESC After that, the REPORT structure is generated by calling the EREPORT instruction E , and Report E Sent to the reference enclave in Prof-SGX.

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

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

[0152] In this embodiment, if Figure 4 As shown, QE and the secure zone Enclave perform two-way verification within the platform, that is, the local authentication part, wherein the platform on which QE and the secure zone Enclave perform two-way verification is a device or computing environment running Prof-SGX.

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

[0154] 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 zone Enclave E And calculate Report QE MAC Tags Build Report QE and its MAC tag And send it to the secure zone Enclave; the secure zone Enclave receives After that, the EGETKEY instruction is called to obtain the report key k of the secure area Enclave. E Recalculate the MAC tag of the REPORT structure, recorded as Mac; the secure area Enclave checks the Report QE The trusted hardware information in the secure zone Enclave is consistent with the hardware information pre-recorded before authentication. If not, authentication fails. If consistent, the Mac and the received Separated from A match is performed. If the match is successful, it proves that the secure zone Enclave recognizes the identity of the referenced Enclave, and step 2-2-1-4 is executed; if the match fails, it proves that the secure zone Enclave fails to authenticate the referenced Enclave.

[0155] In this implementation, the secure zone Enclave checks the hardware information in the REPORT structure, which must be consistent with the hardware information pre-recorded by the secure zone Enclave before authentication to ensure that the QE runs in a trusted SGX environment. The QE verifies the identity of the secure zone Enclave in the same way, thereby completing the two-way authentication within the platform.

[0156] 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 a 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, denoted 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 A match is performed. If the match is successful, it proves that the reference Enclave recognizes the identity of the secure zone Enclave, and step 2-2-1-4 is executed; if the match fails, it proves that the reference Enclave fails to authenticate the secure zone Enclave.

[0157] 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 kEPID Generate signature Then generate the remote authentication result and its signature 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 performed. The signature operation is completed 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 legitimate, The security zone is valid and the identity of the security zone is confirmed by comparing the trusted hardware information of Quote with the hardware information provided by Intel certification service and storing the ID of the security 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 legitimate, then the signature is verified. The security zone is valid and the identity of the security zone is confirmed by comparing the trusted hardware information of Quote with the hardware information provided by IAS and storing the ID of the security 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 above is a remote authentication service provided by Intel.

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

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

[0163] Step 2-2-2-1: For any smart meter SM i , S.M. i From Zq * Randomly select SM i Private key And calculate SM i The public key SM i Send messages over a secure channel between the smart meter and the utility company 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 supply company does not involve Prof-SGX, and 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. At the same time, the power supply company ESC sends the ESC 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 supply company ESC ESC About the message Signature Smart Meter SM i Serial number; 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 calculation 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 Storing Messages

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

[0177] In this embodiment, if Figure 6 As shown, 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 from the stored ID 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 a challenge value C1 and construct a message The smart meter uses the public key pk of the Prof-SGX SGX About the message Encrypt and get the 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, which 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 If the certificate is If it is legal, Save to Prof-SGX; if the certificate If it is illegal, the smart meter 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 MeterSM 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 implementation, the process of judging the legitimacy 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 The authentication with Prof-SGX has been successful and a trusted channel has been established; if incorrect, it means that SM i Failed to authenticate with Prof-SGX.

[0197] The session key for:

[0198]

[0199] In this embodiment, building a trusted channel means: remote authentication is performed between the power supply company and Prof-SGX, the smart meter is registered with the power supply company, and finally the authentication between the smart meter and Prof-SGX is completed, thereby building 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, and 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 meter data, SM i Using 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 electric meter data is:

[0203]

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

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

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

[0207] Step 4-1: Prof-SGX Utilization Session Key For receiving Decrypt and get the data And from the data Separate T j and SM i .

[0208] Step 4-2: Obtain the symmetric key generated by the power company for Prof-SGX And use symmetric key For the separated Perform secondary encryption to obtain secondary encrypted data

[0209] The secondary encrypted data for:

[0210]

[0211] in Indicates the use of symmetric keys The process of secondary encryption; m is the number of Prof-SGX; It is the symmetric key generated by the power supply company for Prof-SGX numbered m.

[0212] 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.

[0213] The homomorphic hash function f hp for:

[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 data after double encryption. mod is a modular operation, which is used to ensure the security and effectiveness of this hash operation. At the same time, the 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 second 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 subsequent integrity verification requirements, the 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 The split T j , SM i , T j As evidence Tree index, SM i As evidence of hashing The smart meter from the source, constructs Trie-RBT, which is convenient for searching the meter ID in the dictionary tree and storing the evidence 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 the Prof-SGX includes two layers of tree structures, namely: 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 except 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 except the root node, a character string composed of characters stored in all nodes on the path is used as the character 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, visit 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, visit 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, and use the 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 the 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 implementation, 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. After the smart meter ID is inserted, an end symbol is marked at the last inserted node, indicating that the smart meter ID 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 nodes 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', and mark the end symbol at the last node, indicating that the root node to this point is a complete smart meter ID, and the leaf node of the smart meter in the dictionary tree is used as the end node, that is, the node with the last inserted character 3 is represented as 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 in 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 soon as possible. associated with, and its timestamp T j is considered a tree index. When a search is needed on evidence, a challenge request Req k Time range covered TD kAll timestamps in the Req k In addition, for the case where data from SM is increasing, RBT only needs to support the "insert" operation. Due to the natural order of timestamps, when new evidence arrives, it can be directly inserted into the rightmost node of RBT.

[0230] Step 5: The power company sends an audit request for data integrity verification to Verify-SGX k , Verify-SGX according to the audit request Req k 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. 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 the 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 for 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 verified 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 ) indicates the index of the extracted data block, and also indicates The index also indicates The index of Represents the random number generated for the extracted data block.

[0238] Step 5-3: Verify-SGX according to the audit request Req k Generate Challenge Index Set And sent 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.

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

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

[0241] The data proof proof1 is:

[0242]

[0243] CD k is the challenge data; for a given Prof-SGX used as computational evidence, that is, Prof-SGX m , CD k ,Prof. m In Prof-SGX m CD generated on k Evidence section; CD k ,DR- m Representation and CD k ,Prof. m The relevant remote data section.

[0244] In this embodiment, when the CSS receives the challenge request When , proof1 of the data stored in the cloud is calculated and sent to Verify-SGX.

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

[0246] The proof proof0 is:

[0247]

[0248] Where 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 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 the secondary encryption data of the cloud storage server CSS Sent to the power supply company for use Decryption to get meter data Otherwise, the verification fails and the output result is False, indicating that the meter data has been damaged in the CSS, 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 proof2 is:

[0254]

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

[0256]

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

[0258] In this embodiment, since f hp With homomorphic properties, we can get the equation: 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 them to the power supply company. The power supply company obtains meter data that meets audit requirements except all erroneous meter data from the cloud storage server CSS.

[0262] The process of using the binary search method to locate the erroneous data of the meter data after the secondary encryption in the cloud storage server CSS is as follows: Verify-SGX uses the binary search method to locate the erroneous data of the challenge index set CS k The challenge index set is split, and challenge requests are sent to CSS and Prof-SGX respectively according to the split challenge index set. CSS and Prof-SGX generate proofs according to 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 by binary search, and challenge requests are sent to CSS and Prof-SGX respectively according to the split challenge index set. CSS and Prof-SGX generate proofs according to 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 the , generate several extended range verification challenge chal Err And send it to Prof-SGX, Prof-SGX determines the corresponding 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 sends it to the power supply company.

[0263] In this embodiment, when Verify-SGX outputs False in the data verification phase, it indicates that the data stored in the CSS is damaged. From the perspective of the power supply company, it needs to know the damage of the data to determine the availability of the data stored in the cloud. First, Verify-SGX challenges the index set CS. k Perform binary splitting and resend challenge requests to CSS and Prof-SGX respectively. Secondly, Prof-SGX generates corresponding challenges based on the resent challenge set and submits them to Verify-SGX for verification. If the audit performed based on the resent challenge set fails to pass the verification, it means that there is erroneous data in the set; and continue to divide the set with erroneous data into two according to the binary splitting method until the exact index number of the erroneous data is located, and all CS k The error data in the set forms the error challenge set Err k Then, Verify-SGX uses the error challenge set Err according to the expansion range R. k Each element in the chal is used as the center to generate the extended range verification challenge Err , where the extended range R is given in advance by the power supply bureau, usually 100, indicating the distance of 100 data blocks, and the extended range verification challenge chal Err Finally, Prof-SGX will challenge chal Err The corresponding evidence is sent to Verify-SGX, which ultimately determines which data is incorrect based on the binary search method and sends the result to ESC. The power supply company obtains the data blocks that have been audited and verified to be correct from CSS.

[0264] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some or all of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope defined by the claims of the present invention.

Claims

1. A data integrity verification method based on SGX in smart grid, It is characterized in that The method comprises the following steps: Step 1: Build a data integrity verification model based on SGX, 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 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 included in the cloud storage server CSS. Step 3: Use the smart meter to obtain the meter data of the user's residence and encrypt the meter data, and upload the encrypted meter data to Prof-SGX verified by the smart meter through a trusted channel; Step 4: Prof-SGX decrypts the encrypted meter data, and then re-encrypts the decrypted meter data to generate evidence; Step 5: The power company sends an audit request for data integrity verification to Verify-SGX k , Verify-SGX according to the audit request Req k 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 1 Send it to Verify-SGX, Prof-SGX uses the evidence generated in step 4 to calculate the proof 0 Send it to Verify-SGX, which proves the proof based on the data 1 and proof 0 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 them to the power supply company. The power supply company obtains meter data that meets audit requirements except all erroneous meter data from the cloud storage server CSS.

2. According to the SGX-based data integrity verification method in a smart grid according to claim 1, It is characterized in that The smart meter SM is installed in the user's residence, and is used to obtain the meter data of the user's residence, and encrypt the meter data and transmit it 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 to transmit to the power supply company ESC; 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; 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. According to the SGX-based data integrity verification method in a smart grid according to claim 2, It 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 supply company ESC generates an additive cyclic group G of order q 1 and a multiplicative cyclic group G of order q 2 ; where q is a large prime number; Step 2-1-2: The power supply company ESC follows the addition cycle group G 1 and the multiplicative cyclic group G 2 Set the bilinear map e and hash function H 1 ; 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 ; Step 2-1-4: Add the additive cyclic group G 1 , multiplicative cyclic group G 2 , bilinear mapping e, module q, generator P, public key pk of ESC ESC and the hash function H 1 As a public parameter of the SGX-based data integrity verification model and released by the power supply company ESC; the public parameter is recorded as {G 1 ,G 2 ,e,q,P,pk ESC ,H 1 }; 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, and the smart meter SM matches the Prof-SGX in the cloud storage server CSS, and then verifies with the successfully matched Prof-SGX and establishes a trusted channel. Step 2-2-1: The power supply 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. According to the SGX-based data integrity verification method in a smart grid according to claim 3, It is characterized in that The step 2-2-1 further includes: Step 2-2-1-1: The power supply company ESC sends an authentication request Req to the secure area Enclave in Prof-SGX ESC ; Step 2-2-1-2: After receiving the request, the security zone Enclave ESC After that, the REPORT structure is generated by calling the EREPORT instruction E , and Report E Sent to the reference enclave in Prof-SGX; Step 2-2-1-3: Reference Enclave after receiving Report E After that, two-way verification is performed with the secure zone Enclave in 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 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 zone Enclave E And calculate Report QE MAC Tags Build Report QE and its MAC tag And send it to the secure zone Enclave; the secure zone Enclave receives After that, the EGETKEY instruction is called to obtain the report key k of the secure area Enclave. E Recalculate the MAC tag of the REPORT structure, recorded as Mac; the secure area Enclave checks the Report QE The trusted hardware information in the secure zone Enclave is consistent with the hardware information pre-recorded before authentication. If not, authentication fails. If consistent, the Mac and the received Separated from Perform a match. If the match is successful, it proves that the secure zone Enclave recognizes the identity of the referenced Enclave, and executes step 2-2-1-4. If the match fails, it proves that the secure zone Enclave fails to authenticate the referenced Enclave. 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 a 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 After that, the EGETKEY instruction is called to obtain the report key k of the referenced enclave. QE Recalculate the MAC tag of the REPORT structure, denoted 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 reference enclave recognizes the identity of the secure zone enclave, and executes step 2-2-1-4. If the match fails, it proves that the reference enclave fails to authenticate the secure zone enclave. 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 the remote authentication result and its signature And send it to the power supply company ESC and the safe area Enclave; 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 legitimate, The security zone is valid and the identity of the security zone is confirmed by comparing the trusted hardware information of Quote with the hardware information provided by Intel certification service and storing the ID of the security zone Enclave. E ; If it is illegal, execute 2-2-1-4 again.

5. According to the SGX-based data integrity verification method in a smart grid according to claim 4, It is characterized in that The step 2-2-2 further includes: Step 2-2-2-1: For any smart meter SM i , S.M. i From Z q * Randomly select SM i Private key And calculate SM i The public key SM i Send messages over a secure channel between the smart meter and the utility company To power companies, including represents the serial number of the i-th smart meter; 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. At the same time, the power supply company ESC sends the ESC public key pk to Prof-SGX. ESC ; The SM i Certificate for: Among them Sig_sk ESC (·) indicates the use of the private key sk of the power supply company ESC ESC About the message Signature Smart Meter SM i The validity period of the certificate; Step 2-2-2-3: Smart Meter SM i Storing Messages 6. According to the SGX-based data integrity verification method in a smart grid according to claim 5, It is characterized in that The step 2-2-3 further includes: 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 ; Step 2-2-3-2: Smart meter from the stored ID 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 A challenge value C is randomly selected 1 , and construct the message The smart meter uses the public key pk of the Prof-SGX SGX About the message Encrypt and get the ciphertext and sent to the Prof-SGX; where H(·) is a hash function; The ciphertext for: Where En_pk SGX (·) indicates the use of the public key pk of the Prof-SGX SGX 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 If the certificate is If it is legal, Save to Prof-SGX; if the certificate If it is illegal, the smart meter authentication fails; Prof-SGX calculates the session key and use the session key For messages (C 1 ) to encrypt the encrypted ciphertext Send to Smart Meter SM i ; The session key for: The ciphertext for: in Indicates the use of session keys The process of performing encryption; Step 2-2-3-5: Smart Meter SM i Received ciphertext Then, calculate the session key And the ciphertext Decrypt the message (C 1 ), and then obtain the challenge value C 1 , S.M. i Verification C 1 If it is correct, it means that SM i The authentication with Prof-SGX has been successful and a trusted channel has been established; if incorrect, it means that SM i Failed to authenticate with Prof-SGX; The session key for:

7. According to the SGX-based data integrity verification method in a smart grid according to claim 6, It is characterized in that The process of encrypting the meter data in step 3 is as follows: i , obtain the user's residential meter data, SM i Using Session Keys Encrypt the meter data, obtain the encrypted 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 electric meter data is: in Indicates SM i In T j The data blocks generated at the moment; T j represents the j moment; Represents the encrypted data block; Indicates the use of session keys The encryption process.

8. According to the SGX-based data integrity verification method in a smart grid according to claim 7, It is 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 T j and SM i ; Step 4-2: Obtain the symmetric key generated by the power company for Prof-SGX And use symmetric key For the separated Perform secondary encryption to obtain secondary encrypted data The secondary encrypted data for: in Indicates the use of symmetric keys The process of secondary encryption; m is the number of Prof-SGX; It is the symmetric key generated by the power supply company for Prof-SGX numbered m; 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; 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; The Trie-RBT tree in the Prof-SGX includes two layers of tree structures, namely: a dictionary tree for storing smart meter IDs and a red-black tree RBT for storing evidence; 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 except 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 except the root node, a character string composed of characters stored in all nodes on the path is used as the character 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, and use the 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; 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.

9. According to the SGX-based data integrity verification method in a smart grid according to claim 8, It is characterized in that The step 5 further comprises: Step 5-1: The power company sends an audit request Req to Verify-SGX k ; 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; Step 5-3: Verify-SGX according to the audit request Req k Generate Challenge Index Set And sent 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; Step 5-4: The cloud storage server CSS responds to the challenge request Calculation data proof 1 And send it to Verify-SGX; The data proves 1 for: 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 Representation and CD k [Prof] m The relevant remote data part; Represents the random number generated for the extracted data block; Step 5-5: Prof-SGX obtains the proof by calculating the set of evidence stored in Prof-SGX 0 And send it to Verify-SGX; The proof 0 for: Where proof 0 is the cumulative multiplication of the elements in the evidence set, that is The cumulative multiplication of Step 5-6: Verify-SGX proves the proof based on the received data 1 Calculation data proof 1 The homomorphic hash function value f hp (proof 1 ), Verify-SGX receives the proof 0 Computational proof 2 , verify f hp (proof 1 ) and proof 2 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. k Select the secondary encryption data of the cloud storage server CSS Sent to the power supply company for use Decryption to get meter data Otherwise, the verification fails and the output result is False, indicating that the meter data has been damaged in the CSS, and step 6 is executed; The data proves 1 The homomorphic hash function value f hp (proof 1 )for: where f hp (·) represents a homomorphic hash function; The evidence 2 for: The power company uses Decryption to get meter data The process is: in Indicates the use Secondary encryption of data The process of decryption.

10. According to the SGX-based data integrity verification method in a smart grid according to claim 9, It is characterized in that The process of using the binary search method to locate the wrong data in the meter data after double encryption in the cloud storage server CSS described in step 6 is as follows: Verify-SGX uses the binary search method to locate the wrong data in the challenge index set CS k The challenge index set is split, and challenge requests are sent to CSS and Prof-SGX respectively according to the split challenge index set. CSS and Prof-SGX generate proofs according to 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 by binary search, and challenge requests are sent to CSS and Prof-SGX respectively according to the split challenge index set. CSS and Prof-SGX generate proofs according to 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 the , generate several extended range verification challenge chal Err And send it to Prof-SGX, Prof-SGX determines the corresponding 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 sends it to the power supply company.

Citation Information

Patent Citations

  • Integrity auditing method for smart power grid data

    CN113609533A

  • techniques for SGX enclave remote authentication

    DE102018101307A1