## 4 System Methodology
### Proposed System Workflow
#### 4.2.2 Phase 2: Registration and Key Generation
In our proposed system, each smart meter needs to perform only three operations, namely, timestamp generation (\(T\tau\)), transaction encryption (\(T_{tx}\)), and signature generation (\(T_{sign}\)). The time required to perform these operations are measured in milliseconds (ms). Table 3 lists the individual time of each SM for these operations and Figure 6 illustrates the graphical view; therefore, as per the calculation, the total computational time cost for SM1, SM2, SM3, SM4, and SM5 are 20.59 ms, 8.02 ms, 13.34 ms, 13.52 ms, and 8.96 ms, respectively. ### Informal Security Discussion

#### 5.4.1 Perfect Forward Secrecy (PFS) and Key Replacement Attack

In the proposed system, the key pair is generated using ECC curves, and the strength of these curves is based on the computational difficulty of the ECDLP problem. Moreover, these keys have an ephemeral property that guarantees the auto-refreshing of keys (i.e., new key pair is generated for each session). As a result, PFS is ensured, and the key replacement attack is prevented. #### 5.4.2 Message Integrity, Authentication, and Signature Correctness

To obtain the key pair to conduct a transaction requires the verification of \(SM_{i}\)'s hash ID, which is irreversible; therefore, if the recovered public key does not match the provided one, the signature verification fails, which means that the encrypted transaction content was tampered with or the signature was altered. Consequently, as SC of blockchain checks these criteria before accepting the transaction proposal; thus message integrity, authentication, and signature correctness are ensured. #### 5.4.3 Man-in-the-Middle (MITM), Impersonation, and Replay Attack

Smart meters are registered using their hash ID, which prevents impersonation attacks. Timestamps avoid replay attacks. The public key is derived from point multiplication of the private key by using an efficient elliptic curve which prevents an adversary from discovering the computed private key for a MITM attack. \begin{table}
\begin{tabular}{c c c c c c} \hline \hline
**Cryptography Operations** & **SM1** & **SM2** & **SM3** & **SM4** & **SM5** \\ \hline Timestamp generation (\(T\tau\)) & 0.02 & 0.01 & 0.01 & 0.01 & 0.01 \\ Transaction encryption (\(T_{tx}\)) & 13.18 & 4.38 & 5.83 & 5.79 & 4.01 \\ Signature generation (\(T_{sign}\)) & 7.39 & 3.63 & 7.50 & 7.72 & 4.94 \\ Total time cost for each SM (ms) & 20.59 & 8.023 & 13.34 & 13.52 & 8.96 \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Time cost analysis of each smart meter for half hourly energy consumption records. Figure 6: Time cost analysis of each smart meter for half hourly energy consumption records. #### 5.4.4 Byzantine Fault Tolerance and 51% Attack

The proposed system is designed using PBFT consensus based on the HLF platform, where nodes are pre-selected. PBFT only validates a transaction if it obtains >2f+1 responses, where f is the number of faulty nodes. Therefore, it has low Byzantine fault tolerance and prevents 51% attack. ### Comparative Study

From the summary of the above discussion and based on previous studies and performance analysis, we can outline that the main novelty of this research work is the concept of security without a trusted third party (TTP), which is a potential vulnerability for cryptography-based smart meters. Blockchain provides the most effective security solution in a decentralized way. In our proposed scheme, SC performs all the functionalities of TTP in a secure blockchain environment. In Hyperledger Fabric, Certificate Authority (CA) authenticates the participants, an internal functionality fully handled and secured by blockchain mechanism. It ensures no interference from any outsider such as TTP or trusted anchor. In the proposed system, the smart meters are authenticated via smart contracts (an integrated part of the blockchain), and the transactions from the authenticated smart meters are validated and stored by the blockchain.