## 4 Implementation and Evaluation
### Experimental Results
Furthermore, to compare the Trust-CH algorithm with existing works, most of the previous work revolved around Trust regarding CH selection without using any of the cryptographic algorithms. Thus, on the security side, we  
Figure 10: Analysis of the influence of the number of attacks on the Trust-CH network lifetime. Figure 9: The Trust-CH network lifetime analysis. are going to compare the Trust-CH to the FlexCrypt algorithm [26]. One of the weaknesses of the FlexCrypt algorithm is its absolute dependence on the state of the WSN node without paying attention to the importance of the data transmitted by this node. Therefore, the concept of trust provides a typical solution for data security without paying attention to the state of the WSN node while extending the lifetime of the network. Furthermore, to compare the Trust-CH algorithm with the current works, we chose the Flex-Crypt and TMFOGA algorithms. Figures 11 and 12 show these comparisons in two separate figures due to the technical difference in both algorithms. Each of them has its own settings. Figure 11 shows a comparison of Trust-CH and FlexCrypt algorithms for a variety of WSN node initial power. Since the FlexCrypt algorithm is also used in the Trust-CH algorithm when the trust level of each node is less than 50%. The network lifetime level is close between the two algorithms when the initial power value of the nodes is low. As the initial power level of WSN nodes increases, the level of Trust-CH increases and the impact becomes larger, thus widening the difference in network lifetime. This is due to the use of Speck-128 in Trust-CH, which is more light and less complex compared to FlexenTech [13] used in FlexCrypt. Moreover, the dependence of CH filtering on the level of Absolute-Trust gave lower CH candidacy compared to the total number of nodes. When the WSN nodes' initial power is 1.5 J, the network lifetime difference between the Trust-CH and the FlexCrypt algorithms is 40%, in favor of the Trust-CH algorithm. As for comparing the Trust-CH algorithm with the existing works using Trust-model in selecting the appropriate CH, we have canceled the encryption part of the algorithm, to remove the energy consumed in those operations. Next, we compared it with the TMFOGA algorithm [39]. We also adjusted the simulation time by increasing it to 400 s to allow the nodes to reach zero energy. Moreover, we reduced the initial energy of the WSN nodes. Since after deleting the encryption processes, the power consumption becomes much less and therefore we need more simulation time. Figure 12 shows a comparison between the Trust-CH and the TMFOGA for a different set of WSN nodes' initial power. It can be seen from Figure 12 that increasing the initial power of the nodes increases the lifetime of the network systematically since trust is adopted as a major part of the CH selection factors. Moreover, we also note that TMFOGA increases network lifetime in a semi-regular manner as well. The difference in network lifetime between the two algorithms increases the initial power of the WSN nodes increases. On one hand, the Trust-CH algorithm is quick to choose the appropriate CH and on the other hand, the complexity of CH selection in the TMFOGA remains constant. TMFOGA uses a Genetic Algorithm and a variety of factors for each CH selection. Therefore, the Genetic Algorithm needs a data set to investigate and the TMFOGA algorithm naturally consumes more time and energy, while the Trust-CH algorithm is easier and faster to choose CH. The difference in network lifetime between the two algorithms (Trust-CH and TMFOGA) when the WSN nodes' initial power is 1 J is 42% in favor of the Trust-CH algorithm.