# A Secure Blockchain-Based Authentication and Key Agreement Scheme for 3 GPP 5G Networks
## 6 Performance Evaluation
### Computational Overheads  
#### 6.1.1 Theoretical and Experimental Delays  
A smaller computational delay means the protocol can run faster, so it is always preferred. In this subsection, computation overheads are evaluated through simulation experiments. All simulations are conducted on a computer with Intel(r) Core(tm) i5-3210M CPU @ 2.5 GHz CPU and 16 GB of RAMs. The Charm Crypto v0.5 with Python 3.7.5 is used to create and run the simulation. Charm Crypto [34] is a Python wrapper of Pairing-Based Cryptography (PBC) libraries. It allows the easy prototyping of cryptographic functions based on elliptic curve cryptosystems. Among all the selected protocols, each of them uses various cryptographic functions, and each of them has a unique key size requirement. To holistically and equally evaluate their performance at the same security level, we conformed to the recommendation from NIST [35] to use 256-bit equivalent key strength throughout the simulations. Hence, for all elliptic curve cryptography (ECC)-based operations, secp256k1 was chosen as the default elliptic curve. For HMAC operations, HMACSHA256 was selected. We ran each cryptographic function 2000 times to measure its average time. Moreover, to evaluate the data access delays incurred in blockchains, we followed the specifications in Section 4.2 to create a blockchain prototype. This blockchain had many 1-megabyte-sized blocks. Every block was stored as one file, and all transactions in the blockchain were indexed using Python Dictionary. To compare the performance difference between blockchain and traditional database, we also built another centralized database with MariaDB v10.4.14. Finally, Table 4 shows the experimental time of execution for the different functions. Then, all this information is combined with the theoretical computational times in Table 5 to find the experimental computational overheads shown in Figure 5. \begin{table}
\begin{tabular}{c c c} \hline \hline
**Notation** & **Description** & **Time (ms)** \\ \hline \(T_{ECDSA.sign}\) & ECDSA Sign & 0.7286 \\ \hline \(T_{ECDSA.ver}\) & ECDSA Verify & 1.3442 \\ \hline \(T_{ECIES.enc}\) & ECIES Encryption & 2.0572 \\ \hline \(T_{ECIES.dec}\) & ECIES Decryption & 0.7851 \\ \hline \(T_{HMAC}\) & KDF/HMAC Calculation & 0.0495 \\ \hline \(T_{HMAC.ver}\) & HMAC Verification & 0.0281 \\ \hline \(T_{ECDH.gen}\) & ECDH Key Generation (1 Exp) & 0.6945 \\ \hline \(T_{ECDH.CK}\) & ECDH Common Key & 0.7099 \\ \hline \(T_{hash}\) & SHA256 Calculation Time (Hash Time) & 0.0206 \\ \hline \(T_{sym.enc}\) & Symmetric Encryption & 0.0925 \\ \hline \(T_{var}\) & XOR Operation & 0.0084 \\ \hline \(T_{BC.read}\) & Blockchain Transaction Read & 0.2914 \\ \hline \(T_{BC.write}\) & Blockchain Transaction Write & 0.0434 \\ \hline \(T_{DB.read}\) & Centralized Database Read & 0.4956 \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Experimental time for different functions. \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Protocol** & **Entity** & **Authentication Computational Overhead** & **Execution Time (ms)** \\ \hline \multirow{3}{*}{5 GSBA} & UE & \(T_{ECIES.enc}+T_{ECDH.gen}+T_{hash}+T_{HMAC}+T_{HMAC.ver}\) & 2.8499 \\ \cline{2-4}  & CN & \(T_{ECIES.dec}+T_{ECDH.gen}+T_{hash}+T_{HMAC}+T_{HMAC.ver}+T_{BC.read}+T_{BC.write}\) & 1.9126 \\ \cline{2-4}  & Both & \(T_{ECDH.CK}\) & 0.7099 \\ \hline \multirow{3}{*}{5G-AKA} & UE & \(T_{ECIES.enc}+2T_{sym.enc}+T_{xor}+2T_{HMAC}\) & 2.3496 \\ \cline{2-4}  & CN & \(T_{ECIES.dec}+2T_{sym.enc}+T_{xor}+2T_{HMAC}+2T_{hash}+T_{DB.read}\) & 1.6143 \\ \cline{2-4}  & UE & \(T_{ECIES.enc}+4T_{HMAC}+T_{HMAC.ver}+T_{ECDH.gen}+T_{ECDH.CK}\) & 3.6877 \\ \cline{2-4}  & CN & \(T_{ECIES.dec}+2T_{HMAC.ver}+3T_{HMAC}+T_{ECDH.gen}+T_{ECDH.CK}+T_{DB.read}\) & 2.8898 \\ \hline \multirow{3}{*}{BB-AKA 5G} & UE & \(T_{ECDSA.sign}+2T_{ECDSA.ver}+T_{ECDH.gen}\) & 4.1115 \\ \cline{2-4}  & CN & \(3T_{ECDSA.sign}+2T_{ECDSA.ver}+T_{ECDH.gen}+T_{BC.read}+T_{BC.write}\) & 5.9035 \\ \cline{1-1} \cline{2-4}  & Both & \(T_{ECDH.CK}+T_{hash}\) & 0.7305 \\ \hline \end{tabular}
\end{table}