# Analysis of Cryptographic Algorithms to Improve Cybersecurity in the Industrial Electrical Sector
## 4 Digital Security Methodologies outside Those Proposed by IEC62351
### Security for GOOSE and R-GOOSE via ChaCha20 and Poly1305, Proposed Method  
Although IEC62351-1 specifies that GOOSE and SV algorithms should not use encryption algorithms, the rise of substation digitization and the use of GOOSE and SV for other power applications, such as electromobility, makes it increasingly necessary to have robust encryption algorithms to prevent third parties from obtaining relevant information and at the same time, these algorithms do not affect communication performance.  
To send GOOSE frames, the first scenario was carried out, which consists of two laptops that emulate the behavior of a protection IED and a breaker IED, connected through a switch, therefore, both computers are on the same LAN. The structured cabling used is category 6. This can be seen in Figure 8.  
In the case of sending R-GOOSE frames, because these must be sent between IEDs that are on different networks, the LAN switch was changed to a router, maintaining the laptops and the structured cabling from the previous scenario. This can be seen in Figure 9.  
The technical specifications of the scenarios were as follows:  
* Virtual machine on laptops with AMD Ryzen 5 (5600X) processor, with a single vCPU running at 3.7 GHz, 512 MB of RAM with Ubuntu 22 Linux distribution.
* OSI model data link layer switch (2) with eight GigabitEthernet ports (10/100/1000 Mbps).
* OSI model network layer router (3) with two GigabitEthernet ports (10/100/1000 Mbps).
* Structured cabling category 6.  
The languages, software, and codes used to conduct the tests were as follows:  
* The C programming language was leveraged to implement algorithms enabling encryption with ChaCha20, MAC generation using Poly1305, and in the development of an AEAD algorithm that integrated both functionalities.
* To examine the calculation time of the algorithms, the Python time library was used.
* To examine the GOOSE frame fortified with ChaCha20 and Poly1305 as digital security measures, the S-GoSV software was employed. This software utilizes network interface libraries to meticulously construct and transmit the GOOSE message across the network, ensuring all requisite fields are adequately included [5].  
Figure 8: Test scenario for sending GOOSE frames.  
Figure 9: Test scenario for sending R-GOOSE frames.  
* The Wireshark software was used to visualize the reception of GOOSE and R-GOOSE frames by the laptop emulating the local and remote behavior of the IED broker.
* To carry out the encryption and creation of the Poly1305 MAC TAG for GOOSE and R-GOOSE, the codes from the repository [28] were used, since their operation was proven by testing the examples of RFC 8439.  
All the tests carried out are listed below, both for the first scenario (sending and receiving GOOSE frames) and for the second scenario (sending and receiving R-GOOSE frames):  
1. Calculation of generation times and transmission delay over the network with digital security measures (Poly1305 versus HMAC-SHA256).
2. Calculation of encryption and decryption times to guarantee the confidentiality of the APDU of the GOOSE message. (ChaCha20 versus AES128-GCM).
3. Calculation of generation times, AEAD verification, communication delay, and end-to-end delay with AEAD digital security (ChaCha20/Poly1305 versus AES128/HMAC-SHA256).  
Concerning point 3, the R-GOOSE frame could not be contrasted with other research work, as no articles were found with relevant information.  
The presented scenarios include simplified equipment that would typically be found at the bay and process levels of the IEC61850 standard [29].