Asymmetric Confidentiality in Blockchain Embedded Smart Grids in Galois Field

Economic growth requires a sharp increase in the utilization of energy. Since the initial mechanical era, financial development has been driven by industrialization, transportation, and, most important of all, electrification, majorly achieved by petroleum product ignition. This way of development has had malicious and abusive aftershocks on the environment since the beginning. Smart grids are an idea to slightly diminish the burden on our Mother Nature, but this idea is getting tainted by the anticipation of ferocious technophiles who may try to get the grid down using quantum computers in the coming years. Thus, security becomes one of the major concerns for the smart grid. In this paper, we propose a quantum-resistant framework for associating smart grids and blockchain embedded with a permutation-substitution-based public-key cryptosystem in Galois Field to prevent unauthorized access and perform encryption of the private information of the user and consumption statistics. Permutation and substitution are performed to increase the diffusion and confusion of the data. Expenditures are quantified from the dissipation particulars, and the payment of electricity bill is performed using our blockchain wallet. The prediction model of consumption data is generated availing stochastic gradient descent. The performance analysis of the proposed cryptosystem is predicted after a simulation of the smart grid.


INTRODUCTION
In the last few decades, economic growth has demanded an exponential rise in energy consumption, be it industrialization, transportation, or merely electrification of households. The economy is thriving at the expense of fossil product-based energy frameworks, which indeed have been facing up to some difficulties, viz., fossil combustion consequences, climate contamination, and energy overuse (Liwen et al., 2012). Lately, many organizations have been working together to recompute the utilization of power sources and mitigate the energy extremity (Greenstone et al., 2019). The entire global framework relies on electricity apparatus built traditionally; this is resulting in exceeding ineffectiveness. Currently, in the existing electricity grid structure, resources are utilized blindly to meet the societal requirements (Kunmin et al., 2008). The extravagant use of resources and energy leads to the excessive release of carbon dioxide into the atmosphere, which is the major cause of global temperature rise. The worldwide carbon dioxide expulsion in the impending years is contemplated to outstretch at many gigatons. Almost half of the pollutants come from the electricity domain through the ignition of non-renewable energy sources like coal, oil, and petroleum gas to create the required energy. Consuming these exhaustible resources brings about the creation of carbon dioxide, the essential warmthcatching, ozone-harming substance answerable for an unnatural weather change, notwithstanding other nitrogen and sulfur oxides liable for different natural effects (Adkins et al., 2010). The consequences of the current energy strategy in environmental contamination are self-evident (Aklin et al., 2017). Resulting from the immense utilization of energy, which applies a genuine effect on the presence of humankind and annihilates the recovery flow and surpasses the decontamination capacity of nature, numerous ecological issues have happened (Allcott and Rogers, 2014). Usage of non-restorable, life-suffocating sources makes the presently available electricity arrangement the worst choice. However, these electrical corporations could be made authentic and acceptable. A little commitment can be made for the assurance of the climate by disposing of the conventional power matrices and changing to futuristic frameworks. The Smart Grid can be visualized as a design or system for a modernized, extraordinary, and forefront step of our electrical power structure (Kai et al., 2008). A completely working Smart Grid will include sensors all through the transmission and conveyance network to gather information. A thorough arrangement of Smart Grid with renewables would be a major step to address environmental crashes (Hassan et al., 2021). The worldwide organizations are now coordinating together to develop a grid that is efficient and productive. Controlling authorities are effectively teaming up on inventive ways to deal with the making of Smart Grid (DayoAlowolodu et al., 2018). Furthermore, research shows that private buyers will pay more to reduce the half-life span of ozone-depleting substances (Biermann, 2003). Smart Grid is a desideratum for the diminution of environmental catastrophes. It will likewise require clear norms for interconnection measurements. This seems like a great idea, but security issues will always remain a major challenge. The rival countries or organizations would try to get the grid of each other down using several attacks. Especially in the presence of high-tech resources, breaking traditional cryptographic algorithms becomes fairly easy (Banerjee and Patel, 2016;Banerjee, 2019;Banerjee et al., 2020;Banerjee et al., 2021). Blockchain might be able to help us in this context. Electricity units or monetary transactions can be performed in the blockchain environment. Consumers can buy extra units of electricity or sell surplus units to potential buyers. Grids connected with this blockchain would be used to transfer the bought units to the legitimate consumer. This would enable equity in the distribution of electricity in urban as well as rural areas and reduce wastage, which would further increase cost-effectiveness. The consumers can perform monetary transactions using cryptocurrency as simulated by us in this paper, but the confidentiality and privacy of the personal information of the consumer along with transaction still remains an issue. Therefore, a security framework is the need of the hour that would protect the grid from getting compromised. In this paper, we propose an asymmetric cryptographic framework implanted with blockchain, simulated on OpenDSS, that would proficiently transmit the electricity consumption statistics and private information of the consumer over a network and would incorporate financial transactions among the consumers and providers of our hypothetical smart grid.

ENERGY PROJECTION
To get an idea about the energy consumption of an average household, we performed a prediction analysis on the overall electricity consumption data, acquired from the Indian Institute of Technology, Bombay (Smart Energy Informatics, 2018), and equipment-wise electricity consumption, borrowed from 1 . Prediction is performed to understand the rate at which resource depletion is transpiring. Forecasts dependent on the current datasets are performed utilizing stochastic gradient descent AI-based meta-calculation (Johnson and Zhang, 2013) 2 . Stochastic gradient descent helps in consolidating different weak classifiers into a solitary solid classifier (Mahdavi et al., 2012). Stochastic gradient descent works by putting more weight on hardto-group occasions and less on those "generally dealt with well" (Mahdavi et al., 2012) by using logistic regression. Figure 1 demonstrates the prediction of energy consumption data. Figure 1 shows the electricity consumption in a common household. This model is generated to understand the rate at which energy consumption and resource depletion is occurring because of the traditional grids; this helps us in understanding the importance of smart grids. Here we have computed the energy utilization of the individual units. Stochastic gradient descent is utilized to perform predictions dependent on the current dataset. Cutting edge energy framework is moving towards environmentally friendly power which will produce energy from photovoltaic boards, cell-based power modules, FIGURE 1 | Energy consumption.
1 https://www.e-education.psu.edu/egee102/node/1915 2 https://www.indigoadvisorygroup.com/blog/2017/3/6/global-energy-utilitiesBlockchain-pilots-and-use-cases Frontiers in Blockchain | www.frontiersin.org December 2021 | Volume 4 | Article 770074 2 hydroelectric force, wind turbines, and other sources. Global organizations should deal with renewable energy and will require smart matrices for better and proficient transmission. Smart grids can react to dynamic changes in energy supply, which help normalize the changes. Despite having such countless favorable circumstances of smart matrices, there are still difficulties in its transformation with regards to the protection and security of clients and their information. For protection and security, blockchain is a potential idea. Blockchain can be utilized as a public record to follow the exchanges in the smart grid by utilizing virtual currency. Blockchain can likewise be utilized to share consumption information and track the carbon impression. Blockchain, as an innovation, guarantees the protected exchange of virtual cash and utilization information. Blockchain is not restricted to get an exchange of digital money; it can likewise be utilized to keep the record of energy utilization as well.

BLOCKCHAIN MODEL
Blockchain is an explicit type of database (Banerjee et al., 2020). It varies from a characteristic database in the way it stores information in a decentralized manner. Blockchains store data in blocks that are then chained together (Banerjee et al., 2020). As new data comes in, it is entered into a new block (Cui et al., 2020). Once the block is filled with data, it is chained onto the previous block, which makes the data chained together in a chronological fashion. Dissimilar types of information can be stored on a blockchain, but the most common use so far has been as a ledger for transactions. However, this is not the only place where blockchain can show its capabilities (Zhaofeng et al., 2020). Smart technology is another broad area where blockchain may thrive. The smart grid alludes to a high-level correspondence and data foundation that empowers enhancement in energy creation and transmission. The attributes of smart matrices include the entire energy management framework, from generators or energy providers to end-customers (Sikeridis et al., 2020). Savvy frameworks incorporate the capacity to empower dynamic client cooperation and encourage renewable energy alternatives. A viewpoint perspective on the smart lattice shows one grid performing tremendously well in different areas (Zoican et al., 2018). These areas can be power administration, beginning from energy creation and finishing with the client. Nonetheless, these areas are combined with the assistance of sensors and IoT devices that include numerous parts of information. Safeguarding the framework while providing flexibility and effectiveness becomes one of the major tasks of the smart grid (Dong et al., 2014). Kabalci et al. (2019) have proposed the Energy Internet, correspondingly known as the Internet of Energy (IoE). It has been bestowed by incorporating a smart lattice fixture with Internet innovation. Conversely, with the brilliant lattice, the energy internet is a rejoinder for energy kindred proceedings by obliging with IoT, progressed data and correspondence innovations, power framework parts, and other energy establishments (Agung and Handayani, 2020). The point of this creative methodology is to guarantee the association of energy anyplace whenever required. Power is distributed between the production entities and the consumption entities (Vishwakarma and Das, 2020). Entities like wind power plants, solar power plants, fossil fuel-based power plants, and similar factories are producers. Conversely, entities like homes, universities, gas stations, shopping malls, etc., are consumers. Connecting these entities in a secure blockchain fashion provides efficiency, confidentiality, and transparency in the smart grid. To secure the data of the above-mentioned organizations in a blockchain-based smart grid, we propose a permutation-substitution-based framework. Statistics gathering is conducted using sensors, IoT devices, and paraphernalia. Then, confidentiality is provided using the proposed approach, and authentication is bestowed using hashing algorithms. Finally, the data is shared on the blockchain. This would increase protection against quantum computing attacks. The model starts from data collection and then progresses to sharing the data on the blockchain framework. The data is collected using IoT devices. Filtering and cleaning of the collected data are performed. Later, the consumption data is encrypted. To provide authentication, the hash value is computed and appended with the data. Then, it is shared on the blockchain framework. We devised a security framework for the securitization of smart grids. In the proposed flow, the consumption data is calculated using gamma function Γ(Z). It helps in modeling scenarios with uncertainty and continuous changes. Then, Gaussian integral is used to calculate the consumption data C d over a particular time duration t. To generate a key pair from the pseudorandom generator, we used the extended Euclidean algorithm for Galois Field GF (n m).
Rn is the public key generated by the pseudorandom generator. It is used in the encryption process. Subsequently, pr is the private key, and it is computed using Rn in field n of Galois Field. Pr is used in the decryption process. The following flow chart (Figure 2) demonstrates the securitization of smart grids using blockchain.
In the following equations, P d is personal data, T u is type of usage, R n is random number generated, S is the hexadecimal number from substitution box; x is power consumption, z is auxiliary power consumed by the meter or sensor, etc., and k is the power wastage rate due to the deterioration of the panel or grid with passing time.
After calculating the consumption data, padding is performed between consumption data, personal data, and type of consumption. Personal data is padded on the most significant side of the consumption data. The type of consumption is padded on the least significant side of the same.
Thereafter, XOR operation was performed between the resulting padded data and pseudo-random number generated from the random number generator.
The least significant half of the XORed data is stored as an integer in i, and the most significant half of the same is stored in j.   Subsequently, we perform the substitution operation using the advanced encryption standard substitution table. The substitution table consists of 16 rows, namely, R 0 . . . R F and 16 columns, namely, C 0 . . . C F . The row number and column number are fetched from the values of i and j, and the hexadecimal value of the corresponding row and column is stored in Z.

Z S[i] j
After substituting the bits, we perform permutation by considering n as the total number of bits and r as the number of 1s in the total bits. Thereafter, we perform left circular shift nP r times on the least significant half and right circular shift nP r times on the most significant half.  Hashing operation is performed on the resulting block of bits.

T H(Q)
The hash value is appended to the swapped bit, resulting in the intermediate ciphertext. Later, the intermediate ciphertext or bitstream is converted to hexadecimal blocks of data. This hexadecimal data is shared over blockchain.

SMART GRID SECULARIZATION
Smart grid simulation is performed using OpenDSS and Anaconda-Jupyter. In OpenDSS, we have taken phase lines and buses to simulate the electric grid. The following lines show the phases, buses, line code, and length of the phase line. The phase line connectivity of the grid is demonstrated in Figure 3. Selecting a particular phase line is highlighted in Figure 4. Figure 5 demonstrates a potential difference or voltage difference between the two nodes of a particular phase line. Figure 6 demonstrates the current flowing between the two nodes of a particular phase line. Figure 7 demonstrates power consumption between the two nodes of a particular phase line. Figure 8-10 show the overall phase current, voltage, and power flow of pseudorandom lines.
The first 3D graph ( Figure 11A) is of power, voltage, and current. The second graph is of power factor, frequency, and energy. The third graph is of energy, current, and time. Time taken was from 6 to 18 months. The figure shows the encryption results of the consumption data. The graphs are generated using Numpy and Matplotlib in Python, Jupyter-Anaconda. The encryption is also performed using Python in Jupyter-Anaconda.
As demonstrated in Figure 11, plaintext and key sensitivity are checked to predict the diffusion and confusion in the ciphertext as compared to the plaintext. We can observe that almost 90% of the plaintext is jumbled, denoting high diffusion and confusion. Therefore, the security provided is of acceptable range. After calculating the power consumption, we created our blockchain cryptocurrency wallet in Anaconda-Python for electricity bill payment. The upcoming screencaps show transactions of bill amounts on blockchain. The sender uses his public-private key pair to send the money to the wallet of the receiver's. Implementation is done using Python in Jupyter-Anaconda.
We are generating wallets by providing our ID. The ID is used to compute private and public addresses which are then stored in .txt format. After that, we perform the transaction using coins. Both the public key and private key of the sender are used for debiting the coins from the wallet of the sender. The public key of the receiver is needed to credit the amount in their wallet. The following screenshot (Figure 13) demonstrates the transaction for bill payment.
After the payment is completed, we check the transactions to see if the coin has been successfully credited to the wallet of the receiver. The following figure (Figure 14) highlights the accomplished transaction.

RESULTS
Information entropy has a magnitude in the range (0 1). When the metadata entropy of a system is 1, it suggests that the system has no predictability at all. When the information entropy is zero, the system is free of unpredictability and imperfection. The valuation of information entropy can be exploited to represent the outcome of plaintext and ciphertext exclusivity. The higher the evidence entropy, the more secure the data (Banerjee and Patel, 2016). Following is the mechanism for predicting information entropy: When there is no pixel association, the entropy is 8 because each pixel has 24 potential values. However, because the digital image cannot be fully random, the actual information entropy is less than 8. The information entropy of photographs depicting data is usually between 3 and 4. The information entropy of the abovementioned 3D graphical picture ( Figure 10) is determined. Table 1 shows the entropy values of the original grayscale image, ciphertext, and decrypted image.
It has been observed in the image that the entropy of the grayscale and decryption figures before encryption is about 3.3, indicating that there is a strong correlation between the various elements of the graph, but the information entropy of the ciphertext is very close to the extreme value of 8, indicating that the encrypted images are close to random distribution, and the security is higher, hence assuring the security of the proposed double-crossover scheme.
The implementation of the two algorithms is performed in Python, Anaconda Jupyter Notebook. Time complexity and avalanche effect are noted. PQB is post-quantum blockchain, which is our work. QKD is quantum key distribution approach of Yin et al. (2020), and QC is quantum cryptography approach of DayoAlowolodu et al. (2018).
Another parameter selected for performance measurement is complexity of block addition and encryption. Blockchain is simulated using Hyperledger fabric in ubuntu. The results achieved are as follows: PQB is our approach, whereas QKD (Yin et al., 2020) and QC (DayoAlowolodu et al., 2018) are existing approaches ( Table 2).
The third parameter is avalanche effect ( Table 3). It is a measure of sensitivity or bit flip ratio. Whenever we changed one bit of the plaintext, almost 90% of bits changed. This ensures high sensitivity. This means that, even if we change just one bit of the plaintext, the entire ciphertext changes. It becomes almost impossible for the attacker or intruder to find a pattern between different ciphertexts.
The results clearly show that the proposed approach provides appropriate sensitivity in polynomial time in the given context. Hence, we can assume that, for the given dataset, the asymmetric approach performs quite well.

CONCLUSION
Smart grids are necessary to restrict the carbon footprint in the coming years. However, implementing smart grids leaves the privacy of the consumers at the mercy of attackers. Hence, the secularization of the smart grid against several attacks is the need of the era. Our security framework embedded with blockchain does the task in the given context. We encrypt the consumer data and the consumption data using our approach. The strength analysis is done using the statistical plaintext sensitivity test and key sensitivity test. Almost 90% avalanche effect is observed in the generated ciphertext. Therefore, it is concluded that the permutation-substitution-based blockchain embedded public key cryptographic approach in Galois Field is providing the