# Smart Grid Security: A PUF-Based Authentication and Key Agreement Protocol
## 6 Cost Analysis  
To set up our experiments and obtain practical results, we designed a simulation of a smart home network, as shown in Figure 4. This simulation included crucial components like a microcontroller, photoresistor sensor, humidity sensor, temperature sensor, and a relay for controlling AC power. To perform cryptographic operations on each smart meter client, we employed an Arduino UNO board. This board is equipped with an ATmega328P microcontroller boasting 32-kB flash memory, 2-kB SRAM, and operates at a clock speed of 16 MHz. It is worth mentioning that we verified the reliability of physical unclonable functions (PUF) in a similar microcontroller, as stated in [40]. In our evaluation, we examined the power-up values of SRAM in 20 microcontrollers, collected 100 times at room temperature. This assessment aimed to determine the quality of these values for implementing an SRAM PUF. The results were promising: the mean bias across all devices (indicating uniformity) stood at 48.38%, a figure remarkably close to the ideal 50%. Moreover, the intra-distance between different acquisitions (which measures reliability) was 97.58%, indicating strong consistency. Additionally, the inter-distance between distinct devices (indicative of uniqueness) was 38.62%, aligning well with findings  
Figure 3: Security validation of PPSG using Scyther tool. in similar microcontroller studies documented in the existing literature. These results affirm the robustness of our experimental setup and validate the viability of our approach. Using this setup, we achieved timings of approximately 21 ms for elliptic curve cryptography (\(T_{ECC}\)), 26 ms for double elliptic curve cryptography (\(T_{2 ECC}\)), 6 ms for symmetric encryption (\(T_{SE}\)), 3 ms for SHA-256 hashing (\(T_{h}\)), and 3.7 ms for error syndrome calculation (\(T_{Es}\)). It is worth mentioning that SHA-256 might be replaced by SHA-3 based on system performance requirements or if SHA-256 is deemed insecure. We also considered the time of a PUF invocation (\(T_{PUFn}\)) as equal to \(T_{h}\). This equivalence was established under the assumption of utilizing a key management module capable of generating multiple keys from a single root key. To ensure cryptographic separation between these derived keys, a secure key derivation function (KDF) utilizing cryptographic primitives like SHA-256 is employed. In a comparable research effort, functions \(FE.GEN\) and \(FE.REC\) utilize fuzzy extractors and helper data, among other algorithms. According to the information outlined in [23], the times for \(T_{FE.REC}\) and \(T_{FE.GEN}\) can be estimated as \(30\times T_{PUF}\) and \(10\times T_{PUF}\), respectively. [PERSON] et al. estimated the computational complexity of their protocol ([16] Section 5.2.1, Table 4) and claimed the computational complexity of the \(SM\) and the \(NAN\) are same and equal to \(2.T_{em}+4.T_{H}\). Based on this claim, they have shown that their protocol outperforms related protocols, e.g., [11; 41]. However, after comparing [PERSON] et al. 's protocol computational cost with PPSG, we understood that they underestimated the protocol's complexity. By summing up all the ECC point-multiplication in the \(SM\) side, we come up with \(3T_{em}+T_{2 em}\) which is 150% more than the reported value by [PERSON] et al. ([16], Section 5.2.1, Table 4), which was \(2T_{em}\). The same argument can be expressed for the \(NAN\) gateway's computations. On the other hand, in PPSG, the \(SM\)'s computations costs \(3.T_{em}+4.T_{H}+2T_{PUF}\) and the \(NAN\) gateway's computations costs \(3.T_{em}+4.T_{H}\). Table 3 displays a cost comparison between PPSG and other protocols discussed in Section 2. To compare communication overhead, we examined the bit lengths of various components: a timestamp, an identifier, a random number, a hash value, and an ECC point, which were set at 32, 64, 128, 160, and 320 bits, respectively. It is important to note that we used SHA-256 but truncated its output to 160 bits to address recent security vulnerabilities in SHA-1 [42].