# A Secure and Scalable Authentication and Communication Protocol for Smart Grids
## 5 Results
### Performance Analysis
#### 5.1.1 Time Analysis Based on Each Cryptographic Operation  
Table 2 presents a detailed analysis of the time required for each cryptographic operation involved in the protocol, illustrating performance metrics across three platforms: the server, a Core-i7 desktop client, and an ESP-8266 embedded client. This evaluation assesses the protocol's responsiveness and its effectiveness across diverse hardware configurations.  
The authentication process is divided into two phases: signing, performed on the server, and verification, carried out by the clients. The signing operation is highly efficient on the server, requiring only 0.019 ms, while the verification process is more computationally demanding. The Core-i7 client requires 1.247 ms for verification, whereas the ESP-8266 embedded client takes 4.070 ms to complete the same task.  
In addition, local key derivation, which involves elliptic curve computations and hash functions, reveals significant differences in performance depending on the device. The server completes this task in 1.268 ms, the Core-i7 client in 2.597 ms, and the ESP-8266 in 4.601 ms. These differences highlight the additional processing overhead associated with embedded environments that possess limited computational resources.  
HMAC operations exhibit impressive efficiency across all platforms. The generation phase requires 0.006 ms on the server, 0.009 ms on the Core-i7 client, and 0.040 ms on the ESP-8266. Verification times are also minimal, with 0.008 ms on the server, 0.011 ms on the Core-i7 client, and 0.400 ms on the ESP-8266.  
AES operations further highlight the protocol's adaptability and speed, making it ideal for both high-performance and resource-constrained devices. Encryption times are 0.002 ms (for encrypting \(k_{sym}\), \(r_{i}\), T, and ID\({}_{S}\) to generate \(y_{C_{i}}\) as shown in Figure 3) on the server, 0.003 ms (for encrypting \(\text{Cert}_{C_{i}}\) and \(r_{i}\) to generate \(m_{C_{i}}^{r}\) as shown in Figure 3) on the Core-i7 client, and 0.158 ms on the ESP-8266 client. Decryption times are similarly efficient at 0.002 ms on the server, 0.005 ms on the Core-i7 client, and 0.138 ms on the ESP-8266. While processes like authentication verification and local key derivation take more time, especially on the ESP-8266. However, the overall performance of the protocol remains efficient.  
\begin{table}
\begin{tabular}{c c c c} \hline \hline \multirow{2}{*}{**Protocol Steps**} & \multirow{2}{*}{**Server**} & \multicolumn{2}{c}{**Client**} \\ \cline{3-4}  & & **Core-i7** & **ESP-8266** \\ \cline{2-4}  & & **Time (ms)** & \\ \hline Authentication (Signing) & 0.019 & 0.021 & 1.979 \\ Authentication (Verification) & 0.066 & 1.247 & 4.070 \\ Local Key Derivation & 1.268 & 2.597 & 4.601 \\ HMAC Generation & 0.006 & 0.009 & 0.040 \\ HMAC Verification & 0.008 & 0.011 & 0.400 \\ AES Encryption & 0.002 & 0.003 & 0.158 \\ AES Decryption & 0.002 & 0.005 & 0.138 \\ \hline \hline \end{tabular}
\end{table}
Table 2: Time utilized by each cryptographic operation involved in the protocol on both server and client.