# A Novel Security Methodology for Smart Grids: A Case Study of Microcomputer-Based Encryption for PMU Devices

Authors: Metin Varan; Akif Akgul; Fatih Kurugollu; Ahmet Sansli; Kim Smith
Journal: Complexity
 (2021)

---

## Abstract

Coordination of a power system with the phasor measurement devices (PMUs) in real time on the load and generation sides is carried out within the context of smart grid studies. Power systems equipped with information systems in a smart grid pace with external security threats. Developing a smart grid which can resist against cyber threats is considered indispensable for the uninterrupted operation. In this study, a two-way secure communication methodology underpinned by a chaos-based encryption algorithm for PMU devices is proposed. The proposed system uses the IEEE-14 busbar system on which the optimum PMU placement has been installed. The proposed hyperchaotic system-based encryption method is applied as a new security methodology among PMU devices. The success of results is evaluated by the completeness of data exchange, durations, the complexity of encryption-decryption processes, and strength of cryptography using a microcomputer-based implementation. The results show that the proposed microcomputer-based encryption algorithms can be directly embedded as encryption hardware units into PMU and PDC devices which have very fast signal processing capabilities taking into considerations the acceptable delay time for power system protection and measuring applications and quality metering applications which is 2 ms and 10 ms, respectively. While proposed algorithms can be used in TCP or UDP over IP-based IEEE C37.118, IEC 61850, and IEC 61850-90-5 communication frameworks, they can also be embedded into electronic cards, smartcards, or smart tokens which are utilized for authentication among smart grid components.


---

## Body

## 1. Introduction

A smart grid is defined as the provision of conventional electric power grids with modern information technologies. For smart grids, the most fundamental goal can be explained as the achievement of economic and clean energy generation on a global scale [1, 2]. Conventional power grids are currently being equipped with intelligent devices and systems which, in general, are data-collecting devices, distribution controller units, data manager, electric market monitoring systems, remote terminal units, circuit breakers, human-machine interface equipment, network management tools and routers, network concentrators, phasor measuring units, smart meters, and protection relays [3]. These devices function in risky decision-making operations such as energy cutoff, commissioning, and load shedding which play crucial roles in fulfilling the desired operations as well as monitoring and measuring activities in the grid. The installation of such devices makes power systems vulnerable to external cyber threats. If the two-way communication is blocked due to a cyberattack, there may be unforeseeable damages in the grid. Therefore, developing security tools which are resistant to cyber threats is indispensable. Having the grid resistant to cyber threats is a strategic precaution to prevent unforeseeable damages in the event that two-way communication is blocked.The security concept in the smart grid should be regarded within a wide range as to the grids consisting of various types of communication systems such as GSM networks, fiber optic lines, WiMAX, RS-232 and RS-485, cable lines, radio frequency lines, and power system communication lines [4]. The development of high-security hardware and computing infrastructure to ensure that all these hardware and systems work reliably is a matter of working separately within smart grid operations.By using various and these complex infrastructures, the synchrophasor technology is used to monitor and control the real-time power system condition by using synchrophasor measurements across large geographical areas in real time with very low latency. These measurements are driven by IEEE C37.118 and IEC 61850 synchrophasor communication frameworks whose security is crucial as any incorrect information can cause severe damage to physical equipment. However, nearly all these communication frameworks have no built-in security mechanism, and they have restricted communication to only the local network. Among these communication frameworks, we consider that IEC 61850 is a complete communication system that addresses modeling of power system components, abstracting of services, and communication protocols [5], but only IEC 61850-90-5 communication framework uses the built-in encryption algorithm and periodic refreshing of secret keys which can easily detect unauthorized modifications [6]. On the contrary, IEC 61850-90-5 communication framework has three times larger packet size due to metadata and carrying complete decoding information in each packet compared to IEEE C37.118.1 and IEEE C37.118.2 frameworks.Today, various state-of-the-art methodologies have started to be used for enhancing the security level of power grids. One of the important applications in grid security is to connect each grid component under a software-defined network (SDN) in which its configuration is specified according to power system component vulnerabilities to cyberattacks [7]. The symmetrical and asymmetric encryption-based privacy and authentication methods are also currently used among PLC and RTU units in grid automation systems [8]. Another security application in the grid is based on the control of grid components, especially controlling the data package of PMUs, with regard to damaging data by external or internal attacks or malfunction reasons by using the Kalman filter method [9]. Protection against cyberattacks is also achieved by using secure VPN technology [10]. All these methods fulfil quite complex and tightly linked rules to meet the specified security goals. Doing all this requires high computational cost, high memory, and power consumption. This prevents the spread of these security systems and causes them to remain in a limited number of devices and regions. In this context, chaotic stream ciphers can be considered as an alternative for block ciphers with regard to both low complexity and low resource consumption [11].The issues of chaos and chaotic systems are the most complex dynamic behavior known in nonlinear systems. They are a field of science that help explain nonlinear systems. Chaos-based engineering applications have emerged and have resulted in significant improvements in control [12, 13], communication [14], artificial intelligence [15, 16], and genetic algorithm [17] areas in the recent years. They have also been used as a random number generator [18–20] in cyber security applications such as encryption [21–23] and data hiding [24].In this work, a novel microcomputer with a hyperchaotic system encryption method is proposed to allow PMU devices to communicate with each other in a secure way in the smart grid. According to our best knowledge, this is the first use of microcomputer-based encryption in a smart grid environment. The proposed security methodology is based on a cryptographic engine ensuring a secure communication layer for PMU and phasor data concentrator (PDC) components. For this purpose, application server software, which communicates with IEEE C37.118.1 compliant PMU devices via the Wireshark platform in real time, is also developed. The results are evaluated by the completeness of data exchange, encryption-decryption durations, and strength of cryptography. The results show that very fast and complex encryption capabilities of the proposed microcomputer-based encryption method can be easily used for ensuring secure communication among smart grid components which have very narrow time intervals such as PMUs.This paper is organized as follows: in Section2, methodologies for modern power system analysis are introduced. In Section 3, a novel security methodology for smart grids is given. In Section 4, the nonlinear system used in the proposed method and its dynamical analysis are presented. Section 5 is devoted to random number generator design, and its statistical tests are presented in Section 6. The details of the PMU data encryption application and its security analysis are also provided in this section. Finally, the paper is concluded in Section 7.


## 2. Methodologies for Modern Power System Analysis

The coordination and reliability of the power system depend on establishing a harmony between power and information infrastructure to create a real-time two-way communication network in the generation, transmission, and distribution of electricity. Two-way communication technologies, control systems, and computer processing are key for smart grids. Advanced sensors, meters, programmable relays, and automated feeder switches are some of modern pieces of equipment used in smart grids. Healthy operation of the power system depends on measurements of operational data at substations continuously. Within this context, it can be said that PMUs are widely acknowledged as one of the most promising developments in the field of real-time monitoring of power systems. The ability of PMUs to calculate synchronized phasors for voltages and currents instantaneously and more accurately has encouraged their consistent proliferation in power system networks all over the world.


### 2.1. Phasor Calculations and Principles of Phasor Measurement Units

#### 2.1.1. Phasor Calculations

Phasor calculations of a power bus within a pure sinusoidal signal are given as(1)xt=Xmcosωt+φ,where ω and φ are the resemble frequency of the signal in radians per second and phase angle in radians, respectively, while Xm is the peak amplitude of the signal. Figure 1 represents all parts of a pure sinusoidal signal.Figure 1
A sinusoid (a) and its representation as a phasor (b). The phase angle of the phasor is arbitrary as it depends on the choice of the axist=0.
(a)(b)Phasor representation is only possible for a pure sinusoidal signal. In practice, a waveform is often corrupted with other signals of different frequencies. Extracting a single frequency component of the signal, Fourier transform is used. For sampled data extraction, discrete (DFT) or fast transform (FFT) is used [25]. A xt sinusoid signal with frequency kf0 representation into Fourier series is shown as follows:(2)xt=akcos2πkf0t+bksin2πkf0t=ak2+bk2cos2πkf0t+φwhereφ=arctan−bkak.Here, the Fourier series coefficientsak and bk measure the amount of cos2πkf0t and sin2πkf0t present in the function xt. Phasor representation of the signal becomes as(3)Xk=12ak2+bk2ejφ.The complex form of equation (3) is constituted as follows:(4)Xk=12ak−jbk.Using the relationship of the Fourier series coefficients with DFT, the phasor representation of thekth harmonic component is given by(5)Xk=122N∑n=0N−1xnΔTe−j2kn/N,(6)Xk=2N∑n=0N−1xnΔTcos2πknN−jsin2πknN,xnΔT=xnandθ=2πN,where N is the number of samples in the data window, n is the sample number, xn is the input sample, and θ refers to the sample angle. Then, equation (6) becomes as follows:(7)Xk=2N∑n=0N−1xncosknθ−jsinknθ.Sin and cosine parts ofxn are separated, respectively, as Xkc and Xks in the form of(8)Xk=Xkc−jXks,Xkc=2N∑n=0N−1xncosknθ,Xks=2N∑n=0N−1xnsinknθ.Finally,Xk is used to represent the phasor in most of the phasor computations. In phasor calculation process, it is necessary to update the phasor estimation with newer data. This is the simplest way for continuous phasor calculation and known as the nonrecursive phasor update method.(9)XN+r=2N∑n=0N−1xn+1+rcosnθ−jsinnθ.In equation (9), r = −1, 1, 2, 3, …; when r = −1, x0 sample is present on the right-hand side, but when r = 0, there is no x0 sample even if the total number of samples, i.e., N, remains the same.As seen in Figure2, phasor 1 is calculated with samples n = 0, …, N− 1, while phasor 2 is calculated with samples n = 1, 2, …, N. θ is the angle between successive samples based on the period of the fundamental frequency. Here, n is the sample number, and N is the number of samples in the data window. The phasor calculations are performed fresh for each window without using any data from the earlier estimates; this algorithm is the simplest way and known as a “nonrecursive algorithm.”(10)XN+r=XN+r−1+2N∑n=0N−1xN+r−xrcosnθ−jsinnθ.Figure 2
Nonrecursive update of phasor estimates withN sample windows.
(a)(b)In equation (10), r = 0, 1, 2, 3; when r represents the present state, (r− 1) represents the past state. As seen in equation (10), recursive estimation current output, XN+r, depends on the previous output, XN+r−1, and the current input, xN+r. Recursive phasor estimation is faster compared to nonrecursive phasor estimation as phasor calculation is not performed in each step. If the sine wave is not continuous, there is a small error in phasor updating. Then, in case of recursive phasor estimation, this small error is accumulated resulting in much larger error over time.


#### 2.1.2. Principles of Phasor Measurement Units

PMUs which are equipped with global positioning system (GPS) receivers take highly precise measurements of voltages and currents within defined timestamps. Here, the GPS receivers coordinate the synchronization of several current and voltage measurements [26]. PMUs use recursive algorithm for calculating symmetrical components of voltage and current such as symmetrical component distance relay (SCDR) [27].The GPS [28] is a system of 36 satellites to produce time signals at the Earth’s surface. 24 satellites are used each time for generating time signals. A GPS receiver measures distance using the travel time of radio signals. One microsecond precision is a suitable range of measuring power frequency voltages and currents [27].Since the introduction of PMUs to power systems, power system designers have been looking for using the ability of PMUs in order to observe the system in a better way. Today, gathering and merging information of PMUs are the best fault detection method in power transmission lines [28]. The processing data of PMUs are used to improve stability coordination [29], power system state estimation [30], remedial action schemes [31], and disturbance monitoring [32]. On the contrary, linearization mainly occurs when the state vector, as well as the PMU measurements, is expressed in rectangular coordinates.


#### 2.1.3. IEEE-14 Bus Model and PMU Placement Algorithm

It can be stated that the most important condition of increasing reliability and stability of a power system depends on establishing a continuous and accurate measurement system. Kirchhoff’s current and voltage laws are based on the fundamental principle that electrical quantities are phasors. Similarly, it is possible to assume that the electrical signal is moving at the speed of light and that the instantaneous voltage and current value of the system are possible by combining all voltage and current phasor measurements taken with an accurate timer. PMU devices, which are customized as phasor measuring devices in power systems, can detect the voltage and current phasor information of the grid. The optimum placement of PMU devices should be considered due to the fact that a great economic cost is required for the installation of PMUs at every busbar in a power system [33, 34]. Instead of installing PMUs to every busbar of the power system, the busbars with high dynamics and intense variability of conditions are chosen for installation. In this context, firstly, the placement of PMU devices on the IEEE-14 bus system has been established by the depth-first search method [35–38]. In this study, an IEEE-14 busbar system is used, and the optimum PMU placement is installed on the studied busbar system. Then, a microcomputer with a hyperchaotic system encryption method is proposed as a new security methodology among PMU devices.The open-source PSAT power flow analysis tool is used for the placement of the secure communication-based PMUs in the most suitable number of the IEEE-14 busbar system. According to the depth-first search method, the number of PMU devices that are placed is 6, and the most suitable busbars for PMU placement are busbars1,4,6,8,10,and14, respectively. Figure 3 shows the placement of PMUs on the IEEE-14 busbar power system.Figure 3
IEEE-14 busbar PMU built-in model with depth-first search algorithm.Thanks to the use of these devices, it is determined that 16 current phasors can be measured on the studied power system which consists of 14 busbars and 20 lines. The list of measurable phasor lines of the PMU-installed power system is given in Table1, respectively.Table 1
Measurable phasor lines of the PMU-installed IEEE-14 busbar system.
1-2 line4-5 line6-11 line9-10 line1-5 line4-7 line6-12 line9-14 line2-4 line4-9 line6-13 line10-11 line3-4 line5-6 line7-8 line13-14 lineSimilarly, another kind of IEEE test system can be used for case studies. In such a test scenario, the most important difference would be to determine the number of PMUs that would allow full monitoring of the system and to define appropriate PMU and PDC data exchange procedures within the IEEE C37.118.1 protocol [39]. For example, in the case of IEEE-39, IEEE-118, and IEEE-300 were used as a test system, only a different data exchange scenario would be created over the placement of 14, 39, and 73 PMU devices, respectively, which would provide full monitoring of the studied test system using some optimal placement algorithms [40]. Figure 4 shows the structure of the data packet of an IEEE C37.118.1 compliant PMU device. The data packet structure includes the device ID, the GPS timestamp, the second fraction, user-defined flag commands to send the packet within the communication protocol standards, the phasor data, the rate of data, and a 16-bit CRC data integrity controller. The phasor data consist of frequency (f), voltage magnitude (m_V), voltage phase angle (δ_V), current magnitude (m_I), and current phase angle (δ_I) of the busbar.Figure 4
IEEE C37.118.1 compliant PMU package definition.


## 2.1. Phasor Calculations and Principles of Phasor Measurement Units

### 2.1.1. Phasor Calculations

Phasor calculations of a power bus within a pure sinusoidal signal are given as(1)xt=Xmcosωt+φ,where ω and φ are the resemble frequency of the signal in radians per second and phase angle in radians, respectively, while Xm is the peak amplitude of the signal. Figure 1 represents all parts of a pure sinusoidal signal.Figure 1
A sinusoid (a) and its representation as a phasor (b). The phase angle of the phasor is arbitrary as it depends on the choice of the axist=0.
(a)(b)Phasor representation is only possible for a pure sinusoidal signal. In practice, a waveform is often corrupted with other signals of different frequencies. Extracting a single frequency component of the signal, Fourier transform is used. For sampled data extraction, discrete (DFT) or fast transform (FFT) is used [25]. A xt sinusoid signal with frequency kf0 representation into Fourier series is shown as follows:(2)xt=akcos2πkf0t+bksin2πkf0t=ak2+bk2cos2πkf0t+φwhereφ=arctan−bkak.Here, the Fourier series coefficientsak and bk measure the amount of cos2πkf0t and sin2πkf0t present in the function xt. Phasor representation of the signal becomes as(3)Xk=12ak2+bk2ejφ.The complex form of equation (3) is constituted as follows:(4)Xk=12ak−jbk.Using the relationship of the Fourier series coefficients with DFT, the phasor representation of thekth harmonic component is given by(5)Xk=122N∑n=0N−1xnΔTe−j2kn/N,(6)Xk=2N∑n=0N−1xnΔTcos2πknN−jsin2πknN,xnΔT=xnandθ=2πN,where N is the number of samples in the data window, n is the sample number, xn is the input sample, and θ refers to the sample angle. Then, equation (6) becomes as follows:(7)Xk=2N∑n=0N−1xncosknθ−jsinknθ.Sin and cosine parts ofxn are separated, respectively, as Xkc and Xks in the form of(8)Xk=Xkc−jXks,Xkc=2N∑n=0N−1xncosknθ,Xks=2N∑n=0N−1xnsinknθ.Finally,Xk is used to represent the phasor in most of the phasor computations. In phasor calculation process, it is necessary to update the phasor estimation with newer data. This is the simplest way for continuous phasor calculation and known as the nonrecursive phasor update method.(9)XN+r=2N∑n=0N−1xn+1+rcosnθ−jsinnθ.In equation (9), r = −1, 1, 2, 3, …; when r = −1, x0 sample is present on the right-hand side, but when r = 0, there is no x0 sample even if the total number of samples, i.e., N, remains the same.As seen in Figure2, phasor 1 is calculated with samples n = 0, …, N− 1, while phasor 2 is calculated with samples n = 1, 2, …, N. θ is the angle between successive samples based on the period of the fundamental frequency. Here, n is the sample number, and N is the number of samples in the data window. The phasor calculations are performed fresh for each window without using any data from the earlier estimates; this algorithm is the simplest way and known as a “nonrecursive algorithm.”(10)XN+r=XN+r−1+2N∑n=0N−1xN+r−xrcosnθ−jsinnθ.Figure 2
Nonrecursive update of phasor estimates withN sample windows.
(a)(b)In equation (10), r = 0, 1, 2, 3; when r represents the present state, (r− 1) represents the past state. As seen in equation (10), recursive estimation current output, XN+r, depends on the previous output, XN+r−1, and the current input, xN+r. Recursive phasor estimation is faster compared to nonrecursive phasor estimation as phasor calculation is not performed in each step. If the sine wave is not continuous, there is a small error in phasor updating. Then, in case of recursive phasor estimation, this small error is accumulated resulting in much larger error over time.


### 2.1.2. Principles of Phasor Measurement Units

PMUs which are equipped with global positioning system (GPS) receivers take highly precise measurements of voltages and currents within defined timestamps. Here, the GPS receivers coordinate the synchronization of several current and voltage measurements [26]. PMUs use recursive algorithm for calculating symmetrical components of voltage and current such as symmetrical component distance relay (SCDR) [27].The GPS [28] is a system of 36 satellites to produce time signals at the Earth’s surface. 24 satellites are used each time for generating time signals. A GPS receiver measures distance using the travel time of radio signals. One microsecond precision is a suitable range of measuring power frequency voltages and currents [27].Since the introduction of PMUs to power systems, power system designers have been looking for using the ability of PMUs in order to observe the system in a better way. Today, gathering and merging information of PMUs are the best fault detection method in power transmission lines [28]. The processing data of PMUs are used to improve stability coordination [29], power system state estimation [30], remedial action schemes [31], and disturbance monitoring [32]. On the contrary, linearization mainly occurs when the state vector, as well as the PMU measurements, is expressed in rectangular coordinates.


### 2.1.3. IEEE-14 Bus Model and PMU Placement Algorithm

It can be stated that the most important condition of increasing reliability and stability of a power system depends on establishing a continuous and accurate measurement system. Kirchhoff’s current and voltage laws are based on the fundamental principle that electrical quantities are phasors. Similarly, it is possible to assume that the electrical signal is moving at the speed of light and that the instantaneous voltage and current value of the system are possible by combining all voltage and current phasor measurements taken with an accurate timer. PMU devices, which are customized as phasor measuring devices in power systems, can detect the voltage and current phasor information of the grid. The optimum placement of PMU devices should be considered due to the fact that a great economic cost is required for the installation of PMUs at every busbar in a power system [33, 34]. Instead of installing PMUs to every busbar of the power system, the busbars with high dynamics and intense variability of conditions are chosen for installation. In this context, firstly, the placement of PMU devices on the IEEE-14 bus system has been established by the depth-first search method [35–38]. In this study, an IEEE-14 busbar system is used, and the optimum PMU placement is installed on the studied busbar system. Then, a microcomputer with a hyperchaotic system encryption method is proposed as a new security methodology among PMU devices.The open-source PSAT power flow analysis tool is used for the placement of the secure communication-based PMUs in the most suitable number of the IEEE-14 busbar system. According to the depth-first search method, the number of PMU devices that are placed is 6, and the most suitable busbars for PMU placement are busbars1,4,6,8,10,and14, respectively. Figure 3 shows the placement of PMUs on the IEEE-14 busbar power system.Figure 3
IEEE-14 busbar PMU built-in model with depth-first search algorithm.Thanks to the use of these devices, it is determined that 16 current phasors can be measured on the studied power system which consists of 14 busbars and 20 lines. The list of measurable phasor lines of the PMU-installed power system is given in Table1, respectively.Table 1
Measurable phasor lines of the PMU-installed IEEE-14 busbar system.
1-2 line4-5 line6-11 line9-10 line1-5 line4-7 line6-12 line9-14 line2-4 line4-9 line6-13 line10-11 line3-4 line5-6 line7-8 line13-14 lineSimilarly, another kind of IEEE test system can be used for case studies. In such a test scenario, the most important difference would be to determine the number of PMUs that would allow full monitoring of the system and to define appropriate PMU and PDC data exchange procedures within the IEEE C37.118.1 protocol [39]. For example, in the case of IEEE-39, IEEE-118, and IEEE-300 were used as a test system, only a different data exchange scenario would be created over the placement of 14, 39, and 73 PMU devices, respectively, which would provide full monitoring of the studied test system using some optimal placement algorithms [40]. Figure 4 shows the structure of the data packet of an IEEE C37.118.1 compliant PMU device. The data packet structure includes the device ID, the GPS timestamp, the second fraction, user-defined flag commands to send the packet within the communication protocol standards, the phasor data, the rate of data, and a 16-bit CRC data integrity controller. The phasor data consist of frequency (f), voltage magnitude (m_V), voltage phase angle (δ_V), current magnitude (m_I), and current phase angle (δ_I) of the busbar.Figure 4
IEEE C37.118.1 compliant PMU package definition.


## 2.1.1. Phasor Calculations

Phasor calculations of a power bus within a pure sinusoidal signal are given as(1)xt=Xmcosωt+φ,where ω and φ are the resemble frequency of the signal in radians per second and phase angle in radians, respectively, while Xm is the peak amplitude of the signal. Figure 1 represents all parts of a pure sinusoidal signal.Figure 1
A sinusoid (a) and its representation as a phasor (b). The phase angle of the phasor is arbitrary as it depends on the choice of the axist=0.
(a)(b)Phasor representation is only possible for a pure sinusoidal signal. In practice, a waveform is often corrupted with other signals of different frequencies. Extracting a single frequency component of the signal, Fourier transform is used. For sampled data extraction, discrete (DFT) or fast transform (FFT) is used [25]. A xt sinusoid signal with frequency kf0 representation into Fourier series is shown as follows:(2)xt=akcos2πkf0t+bksin2πkf0t=ak2+bk2cos2πkf0t+φwhereφ=arctan−bkak.Here, the Fourier series coefficientsak and bk measure the amount of cos2πkf0t and sin2πkf0t present in the function xt. Phasor representation of the signal becomes as(3)Xk=12ak2+bk2ejφ.The complex form of equation (3) is constituted as follows:(4)Xk=12ak−jbk.Using the relationship of the Fourier series coefficients with DFT, the phasor representation of thekth harmonic component is given by(5)Xk=122N∑n=0N−1xnΔTe−j2kn/N,(6)Xk=2N∑n=0N−1xnΔTcos2πknN−jsin2πknN,xnΔT=xnandθ=2πN,where N is the number of samples in the data window, n is the sample number, xn is the input sample, and θ refers to the sample angle. Then, equation (6) becomes as follows:(7)Xk=2N∑n=0N−1xncosknθ−jsinknθ.Sin and cosine parts ofxn are separated, respectively, as Xkc and Xks in the form of(8)Xk=Xkc−jXks,Xkc=2N∑n=0N−1xncosknθ,Xks=2N∑n=0N−1xnsinknθ.Finally,Xk is used to represent the phasor in most of the phasor computations. In phasor calculation process, it is necessary to update the phasor estimation with newer data. This is the simplest way for continuous phasor calculation and known as the nonrecursive phasor update method.(9)XN+r=2N∑n=0N−1xn+1+rcosnθ−jsinnθ.In equation (9), r = −1, 1, 2, 3, …; when r = −1, x0 sample is present on the right-hand side, but when r = 0, there is no x0 sample even if the total number of samples, i.e., N, remains the same.As seen in Figure2, phasor 1 is calculated with samples n = 0, …, N− 1, while phasor 2 is calculated with samples n = 1, 2, …, N. θ is the angle between successive samples based on the period of the fundamental frequency. Here, n is the sample number, and N is the number of samples in the data window. The phasor calculations are performed fresh for each window without using any data from the earlier estimates; this algorithm is the simplest way and known as a “nonrecursive algorithm.”(10)XN+r=XN+r−1+2N∑n=0N−1xN+r−xrcosnθ−jsinnθ.Figure 2
Nonrecursive update of phasor estimates withN sample windows.
(a)(b)In equation (10), r = 0, 1, 2, 3; when r represents the present state, (r− 1) represents the past state. As seen in equation (10), recursive estimation current output, XN+r, depends on the previous output, XN+r−1, and the current input, xN+r. Recursive phasor estimation is faster compared to nonrecursive phasor estimation as phasor calculation is not performed in each step. If the sine wave is not continuous, there is a small error in phasor updating. Then, in case of recursive phasor estimation, this small error is accumulated resulting in much larger error over time.


## 2.1.2. Principles of Phasor Measurement Units

PMUs which are equipped with global positioning system (GPS) receivers take highly precise measurements of voltages and currents within defined timestamps. Here, the GPS receivers coordinate the synchronization of several current and voltage measurements [26]. PMUs use recursive algorithm for calculating symmetrical components of voltage and current such as symmetrical component distance relay (SCDR) [27].The GPS [28] is a system of 36 satellites to produce time signals at the Earth’s surface. 24 satellites are used each time for generating time signals. A GPS receiver measures distance using the travel time of radio signals. One microsecond precision is a suitable range of measuring power frequency voltages and currents [27].Since the introduction of PMUs to power systems, power system designers have been looking for using the ability of PMUs in order to observe the system in a better way. Today, gathering and merging information of PMUs are the best fault detection method in power transmission lines [28]. The processing data of PMUs are used to improve stability coordination [29], power system state estimation [30], remedial action schemes [31], and disturbance monitoring [32]. On the contrary, linearization mainly occurs when the state vector, as well as the PMU measurements, is expressed in rectangular coordinates.


## 2.1.3. IEEE-14 Bus Model and PMU Placement Algorithm

It can be stated that the most important condition of increasing reliability and stability of a power system depends on establishing a continuous and accurate measurement system. Kirchhoff’s current and voltage laws are based on the fundamental principle that electrical quantities are phasors. Similarly, it is possible to assume that the electrical signal is moving at the speed of light and that the instantaneous voltage and current value of the system are possible by combining all voltage and current phasor measurements taken with an accurate timer. PMU devices, which are customized as phasor measuring devices in power systems, can detect the voltage and current phasor information of the grid. The optimum placement of PMU devices should be considered due to the fact that a great economic cost is required for the installation of PMUs at every busbar in a power system [33, 34]. Instead of installing PMUs to every busbar of the power system, the busbars with high dynamics and intense variability of conditions are chosen for installation. In this context, firstly, the placement of PMU devices on the IEEE-14 bus system has been established by the depth-first search method [35–38]. In this study, an IEEE-14 busbar system is used, and the optimum PMU placement is installed on the studied busbar system. Then, a microcomputer with a hyperchaotic system encryption method is proposed as a new security methodology among PMU devices.The open-source PSAT power flow analysis tool is used for the placement of the secure communication-based PMUs in the most suitable number of the IEEE-14 busbar system. According to the depth-first search method, the number of PMU devices that are placed is 6, and the most suitable busbars for PMU placement are busbars1,4,6,8,10,and14, respectively. Figure 3 shows the placement of PMUs on the IEEE-14 busbar power system.Figure 3
IEEE-14 busbar PMU built-in model with depth-first search algorithm.Thanks to the use of these devices, it is determined that 16 current phasors can be measured on the studied power system which consists of 14 busbars and 20 lines. The list of measurable phasor lines of the PMU-installed power system is given in Table1, respectively.Table 1
Measurable phasor lines of the PMU-installed IEEE-14 busbar system.
1-2 line4-5 line6-11 line9-10 line1-5 line4-7 line6-12 line9-14 line2-4 line4-9 line6-13 line10-11 line3-4 line5-6 line7-8 line13-14 lineSimilarly, another kind of IEEE test system can be used for case studies. In such a test scenario, the most important difference would be to determine the number of PMUs that would allow full monitoring of the system and to define appropriate PMU and PDC data exchange procedures within the IEEE C37.118.1 protocol [39]. For example, in the case of IEEE-39, IEEE-118, and IEEE-300 were used as a test system, only a different data exchange scenario would be created over the placement of 14, 39, and 73 PMU devices, respectively, which would provide full monitoring of the studied test system using some optimal placement algorithms [40]. Figure 4 shows the structure of the data packet of an IEEE C37.118.1 compliant PMU device. The data packet structure includes the device ID, the GPS timestamp, the second fraction, user-defined flag commands to send the packet within the communication protocol standards, the phasor data, the rate of data, and a 16-bit CRC data integrity controller. The phasor data consist of frequency (f), voltage magnitude (m_V), voltage phase angle (δ_V), current magnitude (m_I), and current phase angle (δ_I) of the busbar.Figure 4
IEEE C37.118.1 compliant PMU package definition.


## 3. A Novel Security Methodology for Smart Grids

Getting a correct phasor calculation in the studied IEEE-14 busbar system depends on appropriate placing of PMU devices with adequate numbers. A correct phasor calculation also depends on an effective and proper data communication of PMU devices with each other. In this study, instead of acquiring durations and package latencies for the completion of one full phasor calculation, we have, especially, focused on a stream-based communication which is used for revealing encryption success of data communication among one PMU to PDC devices. Here, the built-in PMU devices at the IEEE-14 busbar system communicate by using the IEEE C37.118.1 synchronous phasor communication protocol with TCP/IP support. The PDC unit which is responsible for collecting all PMUs’ data in the grid uses the IEEE C37.118.1 protocol. In this study, the Wireshark platform is only responsible for interfacing data repository of PMU devices via a predetermined IP and socket address. A client-based application at PMU sides and server-based application software at the PDC side handle together the microcomputer-based hyperchaotic encryption processes of captured PMU data.As seen in Figure5, the Rasp3 unit operates as one of the PMU devices that encrypts the digital phasor packet data in harmony with the IEEE C37.118.1 protocol using the chaos encryption engine. While connecting remained PMU units on the IEEE-14 bus system except for Rasp3, the PDC server performs microcomputer-based encryption by gathering data using the Wireshark platform. The encryption and decryption processes are performed by the client and server using the proposed microcomputer-based cryptographic engine.Figure 5
Overall PMU-based chaotic cryptography scheme.As seen in Figure6, studied real-time data acquisition of PMU devices is acquired by the IEEE C37.118.1 compliant Wireshark platform. The application server manages both PMU and PDC sides with a chaotic cryptographic engine.Figure 6
Studied IEEE C37.118.1 frames captured by Wireshark network protocol analyzer software.PDC server is responsible for determining appropriate initial conditions for the chaotic system and other parameters for secure communication. The communication is carried out with sessions in which 1 Mbit random numbers generated by the chaotic system are used in the stream cipher. To facilitate this secure communication, PDC, first, generates random numbers using the 5D hyperchaotic system and tests them against NIST-800-22 statistical tests for randomness. Then, it sends these parameters to the PMU as a part of cryptographic key. PMU uses the parameters to generate the same sequence using the same chaotic system. Then, PMU data are encrypted with a stream cipher by means of the tested random numbers.


## 4. The Used Nonlinear System and Its Dynamical Analysis

In this study, a 5D hyperchaotic Lorenz system is used [41–43]. The 5D hyperchaotic system and its dynamical analysis are given in this section. Equilibrium points, Lyapunov, and bifurcation analysis are examined for dynamical analysis. Also, phase portraits are shown in Section 5. The 5D hyperchaotic Lorenz system is set as follows:(11)x˙=−σx−y+w,y˙=rx−y−xz−w,z˙=−βz+xy,u˙=−xz+pw,w˙=qy,where w is the fifth state variable and q is a positive real parameter. 5D system (11) has three positive, one negative, and one zero Lyapunov exponents.The equilibria of five-dimensional hyperchaotic Lorenz system (11) can be found by assuming x˙=0, y˙=0, z˙=0, u˙=0, and w˙=0 and solving the following equation:(12)−σx−y+w=0rx−y−xz−w=0−βz+xy=0−xz+pw=0qy=0..Thus, this system has only zero equilibrium point:E00,0,0,0,0. The Jacobian matrix of the linearized system of the hyperchaotic system at the only equilibrium E0 is(13)J=−σσ010r−100−100−β00000p00q000.We study the dynamics around the original equilibrium pointE0 when the critical bifurcation values of parameters are taken as p = 2 and q = 8. So, the characteristic equation of the system becomes as follows:(14)λ−pλ+83λ3+11λ2+q−270λ+10q=0.By using wolf algorithm [44], Lyapunov exponents of the 5D hyperchaotic system are calculated as 0.4580,0.3371,0.0415,0.0000,and12.5046.For the values ofp > 0 and q < 2970, the only equilibrium E0 is an unstable saddle-node point due to the presence of eigenvalues with positive real parts.The bifurcation diagrams are also inspected to identify the chaos in the simulations. The visualization of dynamic behaviors and solutions of the 5D hyperchaotic system are gathered by using MATLAB ODE45 solver, and the phase portraits of the hyperchaotic system are depicted in Figure7 which shows the bifurcation diagrams in terms of p parameter varying between −7.5 and 2.5 values by keeping the other parameters fixed. The initial states of the 5D hyperchaotic Lorenz system are determined as x0=0,y0=−0.01,z0=9,u0=1, and w0=0. For a step size of 0.005, the chaos appears in two regions where parameter p is less than −1.5 and it is greater than 1.Figure 7
Bifurcation diagram forp parameter varying between −8 and 3.In Figures8(a) and 8(b), it is also revealed that the system falls into a hyperchaotic situation as it can be seen that it has distinct features in its Lyapunov exponents. In this context, bifurcation and Lyapunov exponent diagrams confirm each other.Figure 8
The Lyapunov exponents of the 5D hyperchaotic system forp parameter varying between (a)−8 and 3 and (b)−1.5 and 2.5.
(a)(b)


## 5. Random Number Generator Design and Its Statistical Test

### 5.1. RNG Design with a 5D Hyperchaotic System

Many chaotic systems are used to generate pseudo-random numbers as a source of entropy because they are complex and very sensitive to the initial conditions. In this section, an RNG design is proposed for PMU data encryption which is implemented in Raspberry 3.A 5D hyperchaotic system developed in the proposed RNG design is given in equation (11), where σ,r,β,p,andq are the parameters and x,y,z,u,andw are the state variables. To visualize dynamic behaviors and solutions of the proposed 5D hyperchaotic system, the differential equations given in equation (11) are worked out using the MATLAB ODE45 function. The obtained phase portraits of the 5D hyperchaotic system are depicted in Figure 9 for x,y,z and x,y,w. For this experiment, the parameters are set to σ=10,r=28,β=8/3,p=2, and q = 8 as well as the initial state is chosen as 0,−0.01,9,1,0.Figure 9
The phase portraits of the 5D hyperchaotic system forx, y, z (a) and x, y, w (b).
(a)(b)RNG design steps using the proposed 5D hyperchaotic system are given in Algorithm1. As it can be seen in the algorithm, for RNG design, parameters and initial values of the hyperchaotic system are needed. Any change in these parameters and initial values results in different random numbers. Therefore, initial conditions are crucial in RNG. Next, the time step (Δh) is determined in order to discretize the hyperchaotic time series using the Runga–Kutta-4 (RK4) method. The floating number outputs (x,y,z,u, and w) are converted to 32-bit binary numbers [45]. The last 16 bits of these binary numbers which must pass NIST-800-22 randomness test are used to generate 1 Mbit random numbers which are then used in one communication session. For this aim, 1 Mbit is extracted from the last 16 bits of each output and tested. If these numbers do not pass the test, then the last 8 bits of each output are considered for the test.Algorithm 1: Random number generation algorithm pseudo-code
Input: parameters and initial condition of chaotic systemsOutput: random numbers tested statistically(1)
Accepting system parameters and initial condition of the 5D Lorenz hyperchaotic system(2)
Determination of the value ofΔh(3)
Sampling with determinationΔh value for RK4(4)
WHILE (maximum 1 MBit data) DO(5)
Solving the 5D hyperchaotic system using RK4 algorithm(6)
Obtaining time series as float numbers (x, y, z, u, and w)(7)
Convert float numbers to 32-bit least binary numbers(8)
Select LSB-8-bit least binary numbers from RNG from y and u phases(9)
Select LSB-16-bit least binary numbers from RNG from z and w phases(10)
END WHILE(11)
Apply NIST-800-22 tests for each minimum 1 MBit data(12)
IF (test results==pass) THEN(13)
Successful results(14)
Ready tested random numbers for RNG applications(15)
ELSE(16)
Go to Step 4(17)
END IF(18)
EXITTo prove the randomness of the generated number series, NIST-800-22 tests are employed. NIST-800-22 has 16 different tests such as runs, discrete Fourier transform, and linear complexity test. These tests need a minimum of 1 MBit binary numbers. For successful results, theP value must be greater than 0.001 for all NIST-800-22 tests [46]. NIST-800-22 is applied to the random numbers generated in Step 11.


### 5.2. Statistical Tests

The NIST-800-22 test results of obtained random numbers fromy,z,u, and w are shown in Table 2. The random numbers obtained from y,z,u, and w successfully passed all the tests, but the random numbers from w are only used for PMU data encryption.Table 2
RNG NIST-800-22 test results fory,z,u, and w outputs.
Statistical testsy (8)z (16)u (8)w (16)Frequency (Monobit) test0.21420.97120.29740.0945Block frequency test0.75450.70000.05810.4610Cumulative sum test0.38290.48860.38970.1016Runs test0.60750.99040.86110.8342Longest run test0.48540.92750.92250.4248Binary matrix rank test0.77280.18760.55290.2004Discrete Fourier transform test0.13230.94140.41400.0289Nonoverlapping templates’ test0.39730.01680.02020.0533Overlapping templates’ test0.59820.89570.58300.7414Maurer’s universal statistical test0.24570.79030.39240.7780Approximate entropy test0.72470.94300.90080.6912Random excursion test0.29530.69380.88430.4569Random excursion variant test0.68880.65220.60500.3386Serial test-10.69930.91870.04640.8103Serial test-20.24230.45100.01290.9127Linear complexity test0.97280.20360.66660.6098ENT is another randomness test that has five different tests, which define the randomness of bit sequences, proposed by Walker [47]. The tests include arithmetic mean, entropy, correlation, chi-square, and Monte Carlo pi estimation [48]. The average values of the ENT test results of the random numbers from y8,z16,u8, and w16 are shown in Table 3 in which successful results can be seen for all tests.Table 3
ENT test results fory,z,u, and w outputs.
Statistical testsy (8)-the last 8 bitsz (16)-the last 16 bitsu (8)w (16)Ideal resultsResultsArithmetic mean127.3353127.1994127.322127.3249127.5SuccessfulEntropy7.99857.99857.99857.99858SuccessfulCorrelation−0.00517250.00311840.0030067−0.000614940.0SuccessfulChi-square253.6648265.2769262.594252.6899190–300SuccessfulMonte Carlo3.13963.1493.13833.13523.14159SuccessfulError = −0.00062338Error = 0.0023713Error = −0.0010512Error = −0.0020291(Pi)The proposed microcomputer with a hyperchaotic system method is compared with some studies in the literature in Table4. When the results in the table are considered, it is seen that the numbers obtained provide randomness for ENT tests. The proposed method produces good results in general. Stoyanov et al. had the best results in the arithmetic mean test because the ideal result is 127.5, but the entropy test result is not good according to other methods except from [50]. Entropy, correlation, and Monte Carlo test results are the best in [51] with 7.9999,0.000108, and 3.14062, respectively [49, 50]. In the proposed method, test results are suitable and acceptable for cryptographic applications because the random numbers passed all tests.Table 4
Comparing the ENT test results of the proposed method with different works.
Arithmetic meanEntropyCorrelationChi-squareMonte Carloy (8)127.33537.9985−0.0051725253.66483.1396Error = −0.00062338)z (16)127.19947.99850.0031184265.27693.149Error = 0,0023713u (8)127.3227.99850.0030067262.5943.1383Error = −0,0010512w (16)127.32497.9985−0.00061494252.68993.1352Error = −0,0020291Stoyanov and Kordov [49]127.50137.9975−0.000147—3.140569Error = 0.03Seetharam and Rhee [50]122.8857.7133−0.058927—3.088126Error = 1.70Akhshani et al. [51]127.77147.99990.000108255.193.14062Error = 0.031


## 5.1. RNG Design with a 5D Hyperchaotic System

Many chaotic systems are used to generate pseudo-random numbers as a source of entropy because they are complex and very sensitive to the initial conditions. In this section, an RNG design is proposed for PMU data encryption which is implemented in Raspberry 3.A 5D hyperchaotic system developed in the proposed RNG design is given in equation (11), where σ,r,β,p,andq are the parameters and x,y,z,u,andw are the state variables. To visualize dynamic behaviors and solutions of the proposed 5D hyperchaotic system, the differential equations given in equation (11) are worked out using the MATLAB ODE45 function. The obtained phase portraits of the 5D hyperchaotic system are depicted in Figure 9 for x,y,z and x,y,w. For this experiment, the parameters are set to σ=10,r=28,β=8/3,p=2, and q = 8 as well as the initial state is chosen as 0,−0.01,9,1,0.Figure 9
The phase portraits of the 5D hyperchaotic system forx, y, z (a) and x, y, w (b).
(a)(b)RNG design steps using the proposed 5D hyperchaotic system are given in Algorithm1. As it can be seen in the algorithm, for RNG design, parameters and initial values of the hyperchaotic system are needed. Any change in these parameters and initial values results in different random numbers. Therefore, initial conditions are crucial in RNG. Next, the time step (Δh) is determined in order to discretize the hyperchaotic time series using the Runga–Kutta-4 (RK4) method. The floating number outputs (x,y,z,u, and w) are converted to 32-bit binary numbers [45]. The last 16 bits of these binary numbers which must pass NIST-800-22 randomness test are used to generate 1 Mbit random numbers which are then used in one communication session. For this aim, 1 Mbit is extracted from the last 16 bits of each output and tested. If these numbers do not pass the test, then the last 8 bits of each output are considered for the test.Algorithm 1: Random number generation algorithm pseudo-code
Input: parameters and initial condition of chaotic systemsOutput: random numbers tested statistically(1)
Accepting system parameters and initial condition of the 5D Lorenz hyperchaotic system(2)
Determination of the value ofΔh(3)
Sampling with determinationΔh value for RK4(4)
WHILE (maximum 1 MBit data) DO(5)
Solving the 5D hyperchaotic system using RK4 algorithm(6)
Obtaining time series as float numbers (x, y, z, u, and w)(7)
Convert float numbers to 32-bit least binary numbers(8)
Select LSB-8-bit least binary numbers from RNG from y and u phases(9)
Select LSB-16-bit least binary numbers from RNG from z and w phases(10)
END WHILE(11)
Apply NIST-800-22 tests for each minimum 1 MBit data(12)
IF (test results==pass) THEN(13)
Successful results(14)
Ready tested random numbers for RNG applications(15)
ELSE(16)
Go to Step 4(17)
END IF(18)
EXITTo prove the randomness of the generated number series, NIST-800-22 tests are employed. NIST-800-22 has 16 different tests such as runs, discrete Fourier transform, and linear complexity test. These tests need a minimum of 1 MBit binary numbers. For successful results, theP value must be greater than 0.001 for all NIST-800-22 tests [46]. NIST-800-22 is applied to the random numbers generated in Step 11.


## 5.2. Statistical Tests

The NIST-800-22 test results of obtained random numbers fromy,z,u, and w are shown in Table 2. The random numbers obtained from y,z,u, and w successfully passed all the tests, but the random numbers from w are only used for PMU data encryption.Table 2
RNG NIST-800-22 test results fory,z,u, and w outputs.
Statistical testsy (8)z (16)u (8)w (16)Frequency (Monobit) test0.21420.97120.29740.0945Block frequency test0.75450.70000.05810.4610Cumulative sum test0.38290.48860.38970.1016Runs test0.60750.99040.86110.8342Longest run test0.48540.92750.92250.4248Binary matrix rank test0.77280.18760.55290.2004Discrete Fourier transform test0.13230.94140.41400.0289Nonoverlapping templates’ test0.39730.01680.02020.0533Overlapping templates’ test0.59820.89570.58300.7414Maurer’s universal statistical test0.24570.79030.39240.7780Approximate entropy test0.72470.94300.90080.6912Random excursion test0.29530.69380.88430.4569Random excursion variant test0.68880.65220.60500.3386Serial test-10.69930.91870.04640.8103Serial test-20.24230.45100.01290.9127Linear complexity test0.97280.20360.66660.6098ENT is another randomness test that has five different tests, which define the randomness of bit sequences, proposed by Walker [47]. The tests include arithmetic mean, entropy, correlation, chi-square, and Monte Carlo pi estimation [48]. The average values of the ENT test results of the random numbers from y8,z16,u8, and w16 are shown in Table 3 in which successful results can be seen for all tests.Table 3
ENT test results fory,z,u, and w outputs.
Statistical testsy (8)-the last 8 bitsz (16)-the last 16 bitsu (8)w (16)Ideal resultsResultsArithmetic mean127.3353127.1994127.322127.3249127.5SuccessfulEntropy7.99857.99857.99857.99858SuccessfulCorrelation−0.00517250.00311840.0030067−0.000614940.0SuccessfulChi-square253.6648265.2769262.594252.6899190–300SuccessfulMonte Carlo3.13963.1493.13833.13523.14159SuccessfulError = −0.00062338Error = 0.0023713Error = −0.0010512Error = −0.0020291(Pi)The proposed microcomputer with a hyperchaotic system method is compared with some studies in the literature in Table4. When the results in the table are considered, it is seen that the numbers obtained provide randomness for ENT tests. The proposed method produces good results in general. Stoyanov et al. had the best results in the arithmetic mean test because the ideal result is 127.5, but the entropy test result is not good according to other methods except from [50]. Entropy, correlation, and Monte Carlo test results are the best in [51] with 7.9999,0.000108, and 3.14062, respectively [49, 50]. In the proposed method, test results are suitable and acceptable for cryptographic applications because the random numbers passed all tests.Table 4
Comparing the ENT test results of the proposed method with different works.
Arithmetic meanEntropyCorrelationChi-squareMonte Carloy (8)127.33537.9985−0.0051725253.66483.1396Error = −0.00062338)z (16)127.19947.99850.0031184265.27693.149Error = 0,0023713u (8)127.3227.99850.0030067262.5943.1383Error = −0,0010512w (16)127.32497.9985−0.00061494252.68993.1352Error = −0,0020291Stoyanov and Kordov [49]127.50137.9975−0.000147—3.140569Error = 0.03Seetharam and Rhee [50]122.8857.7133−0.058927—3.088126Error = 1.70Akhshani et al. [51]127.77147.99990.000108255.193.14062Error = 0.031


## 6. PMU Data Encryption Application and Its Security Analysis

### 6.1. PMU Data Encryption Application with the 5D Hyperchaotic System

Mobile random number generators (RNGs) are important for real-time stream cipher-based applications. Nowadays, some RNGs are implemented by using high-cost hardware such as FPGA and computers. In this work, a low-cost RNG is designed by means of 64-bit quad-core ARM Cortex-A53 microprocessor-based “Raspberry Pi 3” (1.2 GHz, 4 cores, 1 GB RAM) microcomputer.In this section, the PMU data encryption and decryption system using the RNG designed with the 5D hyperchaotic system and that passed all the NIST-800-22 tests is presented. The block diagram of the encryption processes is given in Figure10. One PMU generates 108 byte data. Within the application server, digital chaos keys are created and ready for use in packet encryption. The encrypted packets generated by the encryption are sent back to the application server via the Ethernet port of Raspberry Pi.Figure 10
Microcomputer with a hyperchaotic system encryption process.An example of PMU data consisting of 108 characters is as follows. Also, original and encrypted PMU data input/output ports in Raspberry Pi 3 are given in Figure11.Figure 11
PMU data input/output ports in Raspberry Pi 3.aa01003600f14893334f003d70a4080047c3659cbfc8e73947c3631cbfc8e52b47c365574027a0d447c368643f065a850000000042a9In the encryption application, the PMU data are converted to a binary format. In Figure12, some bits of binary 864-bit original PMU data series, produced from the Raspberry Pi 3 output, on the oscilloscope screen are given. The binary PMU data are encrypted with the tested RNG which obtained the 5D Lorenz hyperchaotic system using a stream cipher scheme based on XOR.Figure 12
Original PMU data.Some bits of encrypted binary 864-bit PMU data are shown Figure12. The size of the encrypted data is the same as 864 bits because the encryption process is done bit by bit.Also, PMU data consisting of all encrypted characters are as follows. Some of them are shown in Figure13 as binary data.Figure 13
Encrypted PMU data.cdb9940e7acc83304a7b45eb40617c53409cb959ff461539f8fba898b9eadf7a048fd1d14b1be5b995b0576e407edf6eea721f14b40fIn the decryption process, the same random numbers used in the encryption are needed. The parameters and initial values of the hyperchaotic system are very important. If the same random numbers cannot be obtained, it will cause different values, and true PMU data decryption will be impossible. After true random numbers and use of XOR, the decrypted PMU data can be taken.


### 6.2. Security Analyses and Performance Assessment

#### 6.2.1. Histogram Analysis

In the histogram analysis, rates of 1s and 0s in the original and encrypted data are evaluated. There are 864 bits of data as 1s and 0s in PMU data. If the difference between 1s and 0s is very little or nothing, the result of encryption is quite successful. Histogram distribution (number of 1s and 0s) of PMU data is given in Figure14 for original and encrypted data. The number of 0s is 690, and the number of 1s is 174 in the original PMU data. Encrypted PMU data bit series contains 425 0s and 439 1s. The difference between bits decreased from 516 to 14 after the encryption.Figure 14
Histogram distribution of PMU data.


#### 6.2.2. Key Length Analysis

In encryption applications, the length of the key also determines the security level. The numbers of differential equations, initial values, and system parameters make key lengths longer. For one-variable nonlinear system, the length of the key can be1014 values. Chaotic system (11) in this paper has 5 (x,y,z,u, and w) 1070 and 5 (σ,r,β,p, and q) 1070 different values, thus 10140 key length in total. The encrypted PMU data with the proposed chaotic system (11) will be highly secure because of the enormous key length. The decryption of PMU data only with this long key reveals the security level of the proposed system.


#### 6.2.3. Key Sensitivity Analysis

Chaotic systems have very complicated and sensitive dynamic features, so they have come into prominence also in security applications such as cryptology and data hiding. The same parameters are needed for the decryption in many applications, and thus, the chaotic system and all of its properties must be clearly known such as initial conditions and parameters. The true results cannot be obtained in a small mistake. It will lead to different results because of this problem.


#### 6.2.4. Encryption-Decryption Times and Memory Usage

Besides little encryption-decryption time, memory usage, and usability in real-time applications, another significant criterion is speed. We used 64-bit quad-core ARM Cortex-A53 microprocessor-based “Raspberry Pi 3” which has 1.2 GHz, 4 cores, and 1 GB RAM microcomputer board in this work and compared some stream cipher algorithms with our chaos-based method. Table5 details the encryption, decryption times and memory usage. Salsa20 algorithm spends the most time for encryption and decryption. Encryption time is 311 ms, while decryption time is 314 ms. Also, considering the size of memory it occupies, one can conclude that it is quite disadvantageous for real-time applications.Table 5
The encryption-decryption time and memory usage comparison of encryption algorithms.
Stream cipher algorithmsEncryption time (ms)Decryption time (ms)Memory usage (byte)Chaos0.0970.113408RC484.3856396Trivium3030.574448Salsa20311314201116Pycube39.3405767Trivium method produces good results in terms of time criteria, but memory usage is not good according to Pycube algorithm. In the microcomputer-based technique, on the contrary, encryption-decryption times and memory usage are very good according to other methods. Encryption time is 0.097 ms, while decryption time is 0.113 ms. Memory usage is 408 bytes in our method. These results are very suitable for real-time applications, especially in smart grids.


## 6.1. PMU Data Encryption Application with the 5D Hyperchaotic System

Mobile random number generators (RNGs) are important for real-time stream cipher-based applications. Nowadays, some RNGs are implemented by using high-cost hardware such as FPGA and computers. In this work, a low-cost RNG is designed by means of 64-bit quad-core ARM Cortex-A53 microprocessor-based “Raspberry Pi 3” (1.2 GHz, 4 cores, 1 GB RAM) microcomputer.In this section, the PMU data encryption and decryption system using the RNG designed with the 5D hyperchaotic system and that passed all the NIST-800-22 tests is presented. The block diagram of the encryption processes is given in Figure10. One PMU generates 108 byte data. Within the application server, digital chaos keys are created and ready for use in packet encryption. The encrypted packets generated by the encryption are sent back to the application server via the Ethernet port of Raspberry Pi.Figure 10
Microcomputer with a hyperchaotic system encryption process.An example of PMU data consisting of 108 characters is as follows. Also, original and encrypted PMU data input/output ports in Raspberry Pi 3 are given in Figure11.Figure 11
PMU data input/output ports in Raspberry Pi 3.aa01003600f14893334f003d70a4080047c3659cbfc8e73947c3631cbfc8e52b47c365574027a0d447c368643f065a850000000042a9In the encryption application, the PMU data are converted to a binary format. In Figure12, some bits of binary 864-bit original PMU data series, produced from the Raspberry Pi 3 output, on the oscilloscope screen are given. The binary PMU data are encrypted with the tested RNG which obtained the 5D Lorenz hyperchaotic system using a stream cipher scheme based on XOR.Figure 12
Original PMU data.Some bits of encrypted binary 864-bit PMU data are shown Figure12. The size of the encrypted data is the same as 864 bits because the encryption process is done bit by bit.Also, PMU data consisting of all encrypted characters are as follows. Some of them are shown in Figure13 as binary data.Figure 13
Encrypted PMU data.cdb9940e7acc83304a7b45eb40617c53409cb959ff461539f8fba898b9eadf7a048fd1d14b1be5b995b0576e407edf6eea721f14b40fIn the decryption process, the same random numbers used in the encryption are needed. The parameters and initial values of the hyperchaotic system are very important. If the same random numbers cannot be obtained, it will cause different values, and true PMU data decryption will be impossible. After true random numbers and use of XOR, the decrypted PMU data can be taken.


## 6.2. Security Analyses and Performance Assessment

### 6.2.1. Histogram Analysis

In the histogram analysis, rates of 1s and 0s in the original and encrypted data are evaluated. There are 864 bits of data as 1s and 0s in PMU data. If the difference between 1s and 0s is very little or nothing, the result of encryption is quite successful. Histogram distribution (number of 1s and 0s) of PMU data is given in Figure14 for original and encrypted data. The number of 0s is 690, and the number of 1s is 174 in the original PMU data. Encrypted PMU data bit series contains 425 0s and 439 1s. The difference between bits decreased from 516 to 14 after the encryption.Figure 14
Histogram distribution of PMU data.


### 6.2.2. Key Length Analysis

In encryption applications, the length of the key also determines the security level. The numbers of differential equations, initial values, and system parameters make key lengths longer. For one-variable nonlinear system, the length of the key can be1014 values. Chaotic system (11) in this paper has 5 (x,y,z,u, and w) 1070 and 5 (σ,r,β,p, and q) 1070 different values, thus 10140 key length in total. The encrypted PMU data with the proposed chaotic system (11) will be highly secure because of the enormous key length. The decryption of PMU data only with this long key reveals the security level of the proposed system.


### 6.2.3. Key Sensitivity Analysis

Chaotic systems have very complicated and sensitive dynamic features, so they have come into prominence also in security applications such as cryptology and data hiding. The same parameters are needed for the decryption in many applications, and thus, the chaotic system and all of its properties must be clearly known such as initial conditions and parameters. The true results cannot be obtained in a small mistake. It will lead to different results because of this problem.


### 6.2.4. Encryption-Decryption Times and Memory Usage

Besides little encryption-decryption time, memory usage, and usability in real-time applications, another significant criterion is speed. We used 64-bit quad-core ARM Cortex-A53 microprocessor-based “Raspberry Pi 3” which has 1.2 GHz, 4 cores, and 1 GB RAM microcomputer board in this work and compared some stream cipher algorithms with our chaos-based method. Table5 details the encryption, decryption times and memory usage. Salsa20 algorithm spends the most time for encryption and decryption. Encryption time is 311 ms, while decryption time is 314 ms. Also, considering the size of memory it occupies, one can conclude that it is quite disadvantageous for real-time applications.Table 5
The encryption-decryption time and memory usage comparison of encryption algorithms.
Stream cipher algorithmsEncryption time (ms)Decryption time (ms)Memory usage (byte)Chaos0.0970.113408RC484.3856396Trivium3030.574448Salsa20311314201116Pycube39.3405767Trivium method produces good results in terms of time criteria, but memory usage is not good according to Pycube algorithm. In the microcomputer-based technique, on the contrary, encryption-decryption times and memory usage are very good according to other methods. Encryption time is 0.097 ms, while decryption time is 0.113 ms. Memory usage is 408 bytes in our method. These results are very suitable for real-time applications, especially in smart grids.


## 6.2.1. Histogram Analysis

In the histogram analysis, rates of 1s and 0s in the original and encrypted data are evaluated. There are 864 bits of data as 1s and 0s in PMU data. If the difference between 1s and 0s is very little or nothing, the result of encryption is quite successful. Histogram distribution (number of 1s and 0s) of PMU data is given in Figure14 for original and encrypted data. The number of 0s is 690, and the number of 1s is 174 in the original PMU data. Encrypted PMU data bit series contains 425 0s and 439 1s. The difference between bits decreased from 516 to 14 after the encryption.Figure 14
Histogram distribution of PMU data.


## 6.2.2. Key Length Analysis

In encryption applications, the length of the key also determines the security level. The numbers of differential equations, initial values, and system parameters make key lengths longer. For one-variable nonlinear system, the length of the key can be1014 values. Chaotic system (11) in this paper has 5 (x,y,z,u, and w) 1070 and 5 (σ,r,β,p, and q) 1070 different values, thus 10140 key length in total. The encrypted PMU data with the proposed chaotic system (11) will be highly secure because of the enormous key length. The decryption of PMU data only with this long key reveals the security level of the proposed system.


## 6.2.3. Key Sensitivity Analysis

Chaotic systems have very complicated and sensitive dynamic features, so they have come into prominence also in security applications such as cryptology and data hiding. The same parameters are needed for the decryption in many applications, and thus, the chaotic system and all of its properties must be clearly known such as initial conditions and parameters. The true results cannot be obtained in a small mistake. It will lead to different results because of this problem.


## 6.2.4. Encryption-Decryption Times and Memory Usage

Besides little encryption-decryption time, memory usage, and usability in real-time applications, another significant criterion is speed. We used 64-bit quad-core ARM Cortex-A53 microprocessor-based “Raspberry Pi 3” which has 1.2 GHz, 4 cores, and 1 GB RAM microcomputer board in this work and compared some stream cipher algorithms with our chaos-based method. Table5 details the encryption, decryption times and memory usage. Salsa20 algorithm spends the most time for encryption and decryption. Encryption time is 311 ms, while decryption time is 314 ms. Also, considering the size of memory it occupies, one can conclude that it is quite disadvantageous for real-time applications.Table 5
The encryption-decryption time and memory usage comparison of encryption algorithms.
Stream cipher algorithmsEncryption time (ms)Decryption time (ms)Memory usage (byte)Chaos0.0970.113408RC484.3856396Trivium3030.574448Salsa20311314201116Pycube39.3405767Trivium method produces good results in terms of time criteria, but memory usage is not good according to Pycube algorithm. In the microcomputer-based technique, on the contrary, encryption-decryption times and memory usage are very good according to other methods. Encryption time is 0.097 ms, while decryption time is 0.113 ms. Memory usage is 408 bytes in our method. These results are very suitable for real-time applications, especially in smart grids.


## 7. Conclusion

In this study, it is the first time in the literature using a microcomputer with a hyperchaotic system encryption algorithm for allowing PMU devices used in the smart grid to make secure two-way communication. The proposed security methodology is realized into a cryptographic engine ensuring a secure communication layer between PMU and PDC components via developed application server software. The application server communicates with IEEE C37.118.1 compliant PMU devices via the Wireshark platform in real time. The results are evaluated by the completeness of accurate data exchange among PMU packages, total time durations of different encryption algorithms, the complexity of encryption-decryption processes by using sensitivity and histogram analyses, and, finally, strength of cryptography with NIST tests.The results show the measured delays of encryption and decryption durations are 0.21 ms in total, the proposed microcomputer-based encryption algorithms can provide a shorter delay while performing encryption and can be directly embedded as encryption hardware units into the encrypted protocol of IEC 61850-90-5 compliant PMU and PDC devices which obligated to acceptable delay time below 3 ms for power system protection and measuring functioning. While proposed algorithms can be used in TCP or UDP over IP-based IEEE C37.118, IEC 61850, and IEC 61850-90-5 communication frameworks, they can also be embedded into electronic cards, smartcards, or smart tokens which are utilized for authentication among smart grid components.



---

*Source: 2798534-2021-09-18.xml*