# Towards Secure Searchable Electronic Health Records Using Consortium Blockchain
## 4 Experimental Results  
We compared the security features of our proposed protocol to [9, 10, 42]. The results are presented in this section. The proposed protocol in [10] has presented a blockchain paradigm with a secure search using Ethereum smart contracts and a symmetric searchable encryption, as shown in Table 2. This paradigm also hides the original patient identity to protect privacy, but it does not provide the patient with access control. A blockchain concept with ASE is presented in [9]. This study provides an efficient PEKS scheme based on a blockchain resistance KGA problem with secure data sharing and it ensures the authentication via employing the smart contract. However, this solution does not ensure data privacy and does not provide access control mechanisms. Furthermore, this study [49] presents a system for managing a private blockchain based on personal data that is built on Hyperledger Fabric. The proposed system provides fine-grained access control via an access control policy which ensures that any access token expires after a set period of time and must be refreshed. This system can provide pseudo-anonymity for data owners using public-key cryptography as identitiers. However, this system does not provide secure data sharing because it retrieves the requested data from the resource server using the data pointer without encryption. Moreover, because it does not use searchable encryption techniques, it does not prevent the KGA problem. Finally, while the proposed protocol in [42] is comparable to our proposed protocol, which presents a blockchain scheme for sharing EHR using PEKS and PRE to provide access control, secure searching of data, authentication and preserving patient privacy using pseudo-anonymity, it does not address the KGA issue. The comparison shows that our proposed protocol has more security features than related schemes [9, 10, 42, 49]. It emphasizes the fact that our protocol achieves the maximum desired security properties and is more resistant to KGA than related protocols. The cryptography primitives are implemented in JavaScript on a PC with an Intel CPU Intel(R) Core (TM) i7-7500U and RAM 8 GB running Windows 10. On Windows 10, Ganache framework is used to create a private test blockchain. Using the Solidity programming language, the data are written into smart contracts and embedded in Ethereum. The smart contracts' test framework is truffle 5.0.5 and the compiler of solidity is solc 0.5.16. The Nodejs Webjs package is applied to connect with blockchain smart contracts and evaluate the execution time (time cost) of the transactions. This is due to the inability of solidity to compute the required time to publish smart contracts to the blockchain. Nodejs is a server-side development platform that allows JavaScript to execute. Table 3 shows the specific configurations. Figure 4 shows the front-end of the webpage including the patient's address and adding an EHR button to save data by a doctor. In Figure 5, we show the encryption algorithms' computational time in milliseconds with a different record size similar to the results of [31]. We varied the record size from 16 bits, 64 bits, 128 bits, 256 bits, to 512 bits and we measured the time of encrypting and uploading the record to the blockchain. For each record size, we conducted the experiment five times and next took the average of them. We can see that the greater the record size length the more computational time needed. The record size depends on the patient and their information. \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Properties** & [10] & [9] & [42] & [49] & **Proposed Protocol** \\ \hline Blockchain based & ✓ & ✓ & ✓ & ✓ & ✓ \\ Access control & - & - & ✓ & ✓ & ✓ \\ Secure search & ✓ & ✓ & ✓ & - & ✓ \\ Public key & - & ✓ & ✓ & ✓ & ✓ \\ encryption & - & ✓ & ✓ & ✓ & ✓ \\ Authentication & ✓ & ✓ & ✓ & ✓ & ✓ \\ Privacy preservation & ✓ & - & ✓ & ✓ & ✓ \\ KGA resistance & - & ✓ & - & - & ✓ \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Comparison of security properties.