## 3 Methodology
### Proposed Secure Search Algorithm
Its functions is to connect the local network of hospitals. The framework is based on four novel algorithms. Each algorithm function is implemented in smart contract. These algorithms are explained in the next section. In the suggested framework, layer three is also known as an overlay network. In other words, we refer to it as a cross domain network of blockchain. Homomorphic encryption and its working is represented through Figure 8. In order to search keywords securely, as well as anonymously, we have used the application of a novel approach called homomorphic encryption. Two main functions are used in the process of cryptography, i.e., encryption and decryption. We have justified that our proposed model is more secure through experimental analysis presented under the results section. #### Proposed Algorithms

The proposed algorithms are explained through psudocode and it explains the working of the smartcontracts for the proposed system. The working of blockchain and its working for admin module in a blockchain network is shown in Algorithm 1. The user requests an enrollment certificate through the admin nodes. The admin has full rights to the access control policies, which includes write, read, update, and removal of participants. The admin node can delete a user from the blockchain list in case of revoking the access control policies. When a participant's request for accessing the EHR or PHR smart contracts inside the blockchain is triggered, the security smartcontracts is triggered and checks for the eligibility. If the participant has enough valid attributes, then access is granted, otherwise, it is denied. The DL techniques monitor the behavior. The proposed policies monitor the activities of the user and if it is found to be malicious, then admin remove it from the system. Table 1 lists all acronyms used in the algorithm. The systematic execution of the patient module is shown in Algorithm 3. Algorithm 3 is based on a secure keyword search as shown through code. This procedure for the patient node uses its identification to the blockchain network. Our proposed Algorithm 3 is based on secure access control. If a participant requests to access a session or update a record, Algorithm 2 validates the attributes of the requester. Moreover, these attributes comprised of name, ID, social security number, location, address, gender, age, organization, marital status, and other important attributes. The proposed algorithm provides a more secure privacy and access to the users records. However, Algorithm 3 is more based on fine-grained access control. In other words, this algorithm provides a secure key for each request and each record individually. The proposed approach leads to granular access control and privacy methods. Therefore, our proposed system provides more validity and security. Figure 10 illustrates the implementation and working of proposed smart contracts. The access control policies are implemented through smart contracts. The working of each smart contract is clearly mentioned and explained through pictorial view in Figure 10.

Figure 10: Trapdoor Generation Time using Homomorphic encryption based keyword search. Figure 9: Keyword Search based Framework for EHR System. ## 5 Experimental Results and Discussion

This section is comprised of experimental setup, simulations results, and discussions as below:

### Experimental Setup

Authentication methods for users differ widely from those for computers [29], which can perform gigabytes of computations within a twinkle of an eye that humans cannot. For instance, the cryptographic protocols such as homomorphic encryption shall lose viability if used for authenticating humans, for that matter, the methods. In the proposed framework, the blockchain architecture was developed using Hyperledger Fabric version 1.1.2 and Solidity (version 6.0). The deep-learning architecture was designed using the Python library Keras. The system was configured according to the hardware and software requirement of blockchain.