## 3 Methodology
### Proposed Secure Search Algorithm
Simulation results in Figure 20 provide the illustrations of experimental analysis of number of transactions based on number of nodes and the execution time. Its very clear from the simulations results that the number of transactions up to 250 takes less execution time for the less number of nodes as compared to a greater number of nodes. The result parameters with respect to accuracy (acc) and loss shows that our proposed technique has efficiently learned from both datasets, as illustrated in Figures 18 and 19. The proposed model has accomplished about 94.34 percent acc and 8.89 loss with the IoT dataset, while the IoT-Botnet model obtains 88.38 percent acc and 8.92 loss. The proposed framework and algorithm purpose is not to detect the unusual activities with the system coming from outside. The proposed system detect the unfriendly and unusual behavior of the users through the implemented algorithms which are based on smartcontracts using homomorphic encryption. In order to ensure the security and privacy in proposed framework, each IoT node is assumed to be enrolled with the proposed system model. The process of enrollment is shown in Figure 11. The Figure 12 describes the actual IoT sensor data upload time with consortium blockchain secured storage layer with number of transactions. In the proposed framework the number of transaction depends the number of nodes and the encryption techniques. We have used lightweight encryption system which is called homomorphic encryption and through this the proposed model can transfer more transaction within the required time. In Figures 19-21, we have simulated the block mining time, number of rounds, number of transactions, and the search time for each keyword. It can be easily seen that the time increases as the number of IoT sensor nodes increase. However, in our proposed framework we have used lightweight encryption technique and smartcontracts that take less execution time as well as search time, hence reduce the communication cost. The Figure 22 illustrates the number of transactions sent by each group of nodes. The comparison is carried out on the number of IoT sensor data transfers from the source node to the destination node through the blockchain framework using DL-based smart contracts.The transaction sign ensures non-repudiation in the framework proposed. Table 4 provides the conclusion of our proposed model and the benchmark. Figure 23 shows the nodes impact on transactions number and time of execution. Figure 21: Comparative Analysis of keyword Search Mechanism in proposed and Benchmark Model. \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Models** & **Collusion Attacks** & **DoS** & **DDoS** \\ \hline Medblock & No & No & Yes \\ [PERSON] et al. & Yes & No & No \\ Medchain & Yes & No & No \\ [PERSON] et al. & Yes & No & No \\ Proposed & Yes & Yes & Yes \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Attack Resistance based on Secure search Mechanism. Figure 22: The Accuracy vs. loss for validating the proposed method using IoT dataset. The result parameters with respect to accuracy (acc) and loss shows that our proposed method has efficiently learned from both data sets, as illustrated in Figures 19-22. The proposed model has accomplished about 94.34 percent acc and 8.89 loss using IoT dataset, while the benchmark model obtains 88.38 percent acc and 8.92 loss. The purpose is not to detect these malicious observations but to encode the data into new dimensions. This transformed data are further used in designing an efficient IDS with high system performance. Furthermore, the propose privacy method is evaluated as the smartcontracts based on our proposed model. The hyperparameters are configured by an input layer fed from both datasets and 5 hidden layers, with hidden nodes = 100, 75, 50, 25, and 15, respectively, a Relu activation function, and the output layer includes a Softmax activation function. The system configuration with loss = categorical cross-entropy, optimizer = N, epochs = 20, and batch size = 50.