{'fraction_non_alphanumeric': 0.03762376237623762, 'fraction_numerical': 0.008751197700415202, 'mean_word_length': 4.695161877046199, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 5, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Privacy Preserving and Collusion Resistant Energy Sharing

Energy has been increasingly generated or collected by different entities on the power grid (e.g., universities, hospitals and householdes) via solar panels, wind turbines or local generators in the past decade. With local energy, such electricity consumers can be considered as"microgrids"which can simulataneously generate and consume energy. Some microgrids may have excessive energy that can be shared to other power consumers on the grid. To this end, all the entities have to share their local private information (e.g., their local demand, local supply and power quality data) to each other or a third-party to find and implement the optimal energy sharing solution. However, such process is constrained by privacy concerns raised by the microgrids. In this paper, we propose a privacy preserving scheme for all the microgrids which can securely implement their energy sharing against both semi-honest and colluding adversaries. The proposed approach includes two secure communication protocols that can ensure quantified privacy leakage and handle collusions.


INTRODUCTION
Energy has been increasingly generated or collected by different entities on the power grid (e.g., universities, hospitals and householdes) via solar panels, wind turbines or local generators in the past decade. With local energy, such electricity consumers can be considered as "microgrids" which can simulataneously generate and consume energy [20,1]. More recently, the research on cooperation among entities on the power grid (e.g., microgrids) has attracted great interests in both industry and academia [20]. For instance, microgrids can share their local energy to improve the efficiency and resilience of power supply [6].
Specifically, microgrids can transmit their excessive energy to the microgrids close to them. In the cooperation, all the participating microgrids jointly seek an energy transmission assignment that minimizes the global energy loss during transmission. However, to this end, all the microgrids should disclose their local information (e.g., local supply, local demand, and power quality for transmission) to each other or a third party. Then, the data recipient (which is a microgrid or a third party) formulates an optimization problem by denoting the amount of energy transmitted from M i to M j as x ij and determining the objective function as well as the constraints.
Disclosing such local information to each other or a third party would compromise the corresponding microgrid's local information. To tackle the privacy concerns, the proposed approach in [6] efficiently transforms the shares of the optimization problem to a privacy-complaint format and enables any party to solve the problem. However, the algorithms in [6] pursue high efficiency but cannot quantify the privacy leakage in the protocol. In this paper, we extend the transformation and optimal solution reconstruction to two secure communication protocols in which privacy leakage can be quantified and bounded. In the meanwhile, we give formal security/privacy analysis for the protocols and identify that our proposed secure communication protocols can prevent additional information leakage against the potential collusion among microgrids while executing the protocols. Finally, we present some experimental results to demonstrate the effectiveness and efficiency of our approach.

RELATED WORK
In smart grid infrastructure, privacy concerns were recently raised in the fine-grained smart meter readings, which is frequently reported to the utility [21,7,3]. To prevent information leakage in smart metering, three different categories of privacy preserving schemes were proposed in the past few years. The first category of techniques built cryptographic protocols to directly aggregate or analyze such meter readings without sharing the raw data. For instance, Rottondi et al. [19] proposed a privacy preserving infrastructure based on cryptographic primitives to enable utilities and data consumers to collect and aggregate metering data. The second category of techniques obfuscate the meter readings to prevent adversaries from learning the status of the appliances at different times. For instance, Hong et al. [7] defined a privacy notion to quantitatively bound the information leakage in smart meter readings, and proposed streaming algorithms for converting the readings with guaranteed output utility. Finally, the third category of techniques utilize renewable energy sources like batteries to hide the actual load of different households, which can be found in [17], [22], etc. Furthermore, energy sharing problem among microgrids [20,24] has been recently studied -locally generated energy can be shared among homes due to the mismatch between generation harvesting and consumption time in microgrids. Zhu et al. [24] developed an energy sharing approach to determine which homes should share energy, and when to minimize system-wide efficiency loss. Zhu et al. [25] also proposed a secure energy routing approach to renewable energy sharing against security attacks such as spoofed routing signaling and fabricated routing messages. Also, some game theoretical models [20,16,2] were proposed to mitigate the risks of self-interested behaviors in the energy sharing/exchange. So far, Hong et al. [6] is the only work that resolves the privacy issues in energy sharing/exchange. The proposed scheme can provide some ad-hoc privacy guarantee based on matrix multiplication. Instead, we extend the approach in [6] to ensure provable security.

PRELIMINARIES
In this section, we briefly summarize the problem formulation, transformation and solution reconstruction in [6]. Note that the formulations of three optimization problems in [6] are similar, which can be securely transformed and solved using the same secure communication problem. Thus, we only focus on the basic formulation.

Problem Formulation
Given n microgrids M 1 , . . . , M i , the demand and supply of M i at time t is denoted as D i (t) and S i (t), respectively. Then, given x ij as the amount of energy transmitted from M i to M j , the optimization (LP) problem to minimize the overall energy delivery loss in the sharing is formulated as follows.
where θ ij represents the energy loss rate for transmission between M i and M j , which is determined by the distance between them on the power transmission network and the power quality data, such as voltage and current. D i (t), S i (t) and θ ij are privately held by microgrid M i . The general form of Equation 1 can be derived as below:

Transformation
The above LP problem is heterogeneously partitioned into n shares -global constraints are co-held by all the parties (vertically partitioned [10,12,5]) while each constraint belongs to only one party (horizontally partitioned [8,13,11]). To ensure privacy protection in solving and realizing the above problem, a transformation-based approach [6] was proposed: where each party M i locally post-multiplies its shares (i.e., A i , B i and c i T ) in the LP problem by an n × n random nonnegative monomial matrix Q i [10] which is privately generated by itself, and variables in the new problem ∀ y Note that the righthand side values b 0 , b 1 , . . . , b n are also transformed to random numbers in [6], and we still keep such transformation. Thus, we will focus on the security/privacy improvement on the transformation in Equation 3.

Reconstruction
In [6], after solving the transformed problem to obtain the optimal solution ∀ y i * , the solver (any party or an external party, e.g., the cloud) distributes the solution shares to the corresponding parties. Then, the optimal solution of the original problem ∀i ∈ [1, n], x i * can be locally reconstructed as: 9,10]. The solver and other parties cannot learn the details of x i * , A i , B i since Q i is unknown to them.

EXTENDED TRANSFORMATION
With the transformation in [6], each party's share of problem cannot be learnt by other untrusted parties, even if the transformed shares are disclosed to them. However, the informa-tion leakage in the communication protocol cannot be quantified. We now extend it to a more secured transformation based on Homomorphic cryptosystem (e.g., Paillier [18]). 1

Overview
The basic idea of the extended transformation is described as follows. For any party M i 's shares in the LP problem A i , B i and c i T , we let all the parties jointly transform such shares (via Homomorphic Encryption) in sequence -while transforming M i 's shares, party M j locally generates a new random nonnegative monomial matrix ∀j ∈ [1, n], Q ij , and postmultiplies it to each of the three transformed shares (by the previous party). In case that j = i holds, M i post-multiplies its own shares by its own matrix Q ii . Similarly, all the parties jointly reconstruct every share of the optimal solution y by pre-multiplying their matrices in a reverse order (also via Homomorphic Encryption).

Extended Secure Transformation
Without loss of generality, we let an external party P (e.g., the cloud) solve the transformed problem. In the extended secure transformation protocol, P generates the public/private key pair (pk, sk), and distributes the public key pk to M 1 , . . . , M n . Since the transformation for A i , B i and c i T are identical [6], we can take A i as an example to illustrate our secure transformation protocol in Algorithm 1. Mi randomly generates Qii

3:
Mi encrypts AiQii with pk to generate E = Enc pk (AiQii), and sends E to the next party Mj in Line 4 4: for ∀j ∈ [1, n], j = i, Mj do

6:
Mj updates E with Qij (Line 7-9: E ab denotes the entry at row a and column b in E, and (Qij) kb denotes the entry at row k and column b in Qij) 7: for each row a of E and each column b of Qij do 8: end for 10: Mj sends the updated E to the next party 11: end for 12: the last party sends E to the solver P

13:
P decrypts E to obtain: AiQii n j=1,j =i Qij 14: end for After decrypting all the ciphertexts, solver P can forumate a new LP problem with the transformed shares: 1 Homomorphic cryptosystem is a semantically-secure public key encryption with an additional property to generate the ciphertext of an arithemetic operation between two plaintexts by other operations between their individual ciphertexts. For instance, two encryptions E(A) and E(B), there exists operations *, such that E(A * B) = E(A) * E(B) where * is either addition or mutiplication (in some abelian group).
Then, P can solve the new LP problem and distribute the solution share y i * to M i , which securely reconstructs its solution share in the original problem with all the other parties.

Secure Reconstruction
Following the proof in [6,10], the optimal solution in the original problem ∀i ∈ [1, n], x i * can be reconstructed as below: As a result, all the parties M 1 , . . . , M n should jointly reconstruct each solution share. Then, we present the secure communication protocol for the optimal solution reconstruction in Algorithm 2. Mi generates a public/private key pair (pki, ski) and sends the public key pki to all the other parties M1, . . . , Mn

3:
Mi encrypts yi * with pki to generate Y = Enc pk ( yi * ), and sends Y to the next party Mj in Line 4 4: for ∀j ∈ [n, 1], j = i, Mj do

5:
Mj updates Y with Qij (Line 6-8: Ya denotes the ath entry in Y ) 6: for each row a of Qij do Mj sends the updated Y to the next party 10: end for 11: the last party sends Y to Mi

13:
Mi reconstructs its share in the original optimal solution xi * = Qii n j=1,j =i Qij yi * (pre-multiplying by Qii) 14: end for Finally, in the optimal energy sharing, each party M i can locally route the energy amount x * ij ∈ x i * to the recipient M j (note that x ij = 0 if i = j holds).

Privacy Preservation and Collusion Resistance
Privacy. We now analyze the privacy leakage of the two protocols. For both extended secure transformation and secure reconstruction, there is no privacy leakage while executing the protocol under the definition of secure multiparty computation [23,4] (all the messages received by all the parties can be simulated in polynomial time by repeating the protocols). Therefore, private inputs (e.g., demand, supply, and power quality of each party) can be protected.
On the other hand, the information leakage in the outputs can be quantified: • The solver only learns the transformed optimization problem (the obfuscated shares of each party and the corresponding optimal solution).
• Each party only knows its share in the optimal solution, e.g., how much energy transmitted from itself to the energy recipient in the global optimal sharing.
Handling Collusions. The two protocols can also effectively handle potential collusions while solving the problem. None of those parties knows the actual overall transformation (aka. a combination of transformations), since each of {∀i, ∀j, Q ij } is privately generated as a random nonnegative monomial matrix by M j (for transforming M i 's shares). As a consequence, the solution reconstruction cannot be completed if any party M j is absent (missing ∀i, M ij ). Therefore, any number of microgrids (less than n) cannot collude with each other to infer private information from other honest microgrids while executing the protocol. The collusion resistant feature provided by the two protocols is equivalent to a trusted-third party.

EXPERIMENTS
We have evaluated the performance of our revised secure transformation protocol and secure reconstruction protocol using two different key length (512-bit and 1024-bit) and varying number of parties (from 20 to 500). The computational costs of two protocols are plotted in Figure 1. To significantly improve the security/privacy (provable), the protocols take longer time compare to [6], and such computational costs are still tolerable with an polynomial increasing trend as the number of parties increase. In addition, we present the communication overheads of the two protocols per party in Table 1. As the number of parties increase, the average bandwidth consumption (size of the transmitted messages) of the extended secure communication protocol and secure reconstruction protocol also grow polynomially. Therefore, the two protocols can be implemented in most of the current networking environment.

CONCLUSION AND FUTURE WORK
In this paper, we have extended the secure transformation and solution reconstruction in [6] to ensure provable security for securely solving the energy sharing optimization problem and implementing the optimal solution on the power transmission  network. Novel secure communication protocols were proposed for all the parties to jointly transform their individual shares of the optimization problem, and jointly reconstruct their own shares in the optimal solution of the original problem. In the meanwhile, collusions can be handled with the secure communication protocols. In case that some parties disclose information to each other so as to learn other parties' private information, they cannot learn the actual transformation and reconstruction as long as at least one party is not colluding with them.
In the future, we will investigate other privacy preserving cooperative models among entities with local energy (viz. microgrids) on the power grid. For instance, global and local load balancing can be manipulated and further optimized via the cooperation among microgrids (e.g., scheduling [14,15]). We intend to propose a privacy preserving cooperative model for them to jointly improving the global and local performance of the power generation, supply, storage and consumption.