# Grouping Sensors for the Key Distribution of Implicit Certificates in Wireless Sensor Networks
## 4 Results
The second case pertains to data aggregation: upon receiving the data, the aggregator node decrypts the data, performs aggregation with other data to reduce packet size, and encrypts the aggregated result for further transmission. In this case, if the data aggregator and connecting nodes are the same, the number of encryption and decryption operations required to transmit the data to the base station will be reduced. This is the primary concept behind the proposed algorithm that performs grouping based on the aggregator nodes. In this study, we used a three-depth tree structure network as an instance (Figure 10). The maximum number of groups was nine. The sensor nodes were grouped using TDG, BUG, and ABG. The most significant results determined by different grouping algorithms are the number of encryption and decryption. Generally, most nodes perform encryption for sensed data only once and send them to BS or relay the encrypted data to BS without decryption, except for the following boundary and aggregator nodes. These two nodes decrypt and then encrypt received data using the group key(s) and neighboring group key, respectively. The boundary node is responsible for inter-group connections. If the sensed data go through \(b\) boundary nodes before reaching the aggregator, there would be \(b\) encryption and \(b\!-\!1\) decryption executed in the boundary nodes. Before executing the aggregation function, the aggregator decrypts all received data from its child nodes and executes encryption once. Table 2 lists the grouping results from the experiment under the same conditions. \begin{table}
\begin{tabular}{c c c c c c c} \hline \hline \multirow{2}{*}{**Group Id**} & \multicolumn{2}{c}{**TDG**} & \multicolumn{2}{c}{**BUG**} & \multicolumn{2}{c}{**ABG**} \\ \cline{2-7}  & **Encryption** & **Decryption** & **Encryption** & **Decryption** & **Encryption** & **Decryption** \\ \hline
1 & 5 & 7 & 2 & 9 & 5 & 17 \\ \hline
2 & 8 & 11 & 2 & 0 & 5 & 1 \\ \hline
3 & 3 & 0 & 8 & 10 & 3 & 0 \\ \hline
4 & 9 & 10 & 1 & 0 & 5 & 0 \\ \hline
5 & 3 & 2 & 9 & 10 & 2 & 1 \\ \hline
6 & 10 & 5 & 3 & 2 & 1 & 5 \\ \hline
7 & 5 & 0 & 10 & 5 & 4 & 2 \\ \hline
8 & 3 & 2 & 3 & 2 & 6 & 3 \\ \hline
9 & & & 5 & 0 & 5 & 0 \\ \hline Total & 46 & 37 & 43 & 38 & 36 & 26 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Grouping results. We used the saved percentage, which compares control and experimental methods (Equation (7)), as criteria to evaluate the performance of the algorithms. \[\text{Saved percentage}=\frac{N_{\text{Experimental}}-N_{\text{Control}}}{N_{ \text{Control}}} \tag{7}\]  
where \(N_{\text{Experimental}}\) indicates the number of encryption and decryption operations using ABG algorithm. \(N_{\text{Control}}\) represents the number of encryption and decryption operations using TDG algorithm or BUG algorithm. We evaluated the three network grouping algorithms under different network scales, including the number of sensor nodes and group size. The number of sensor nodes was auto-increased in increments of 100 until 1000 nodes were reached. The maximum number of group members was set to 10, 15, 20, and 25 (Figure 11). When the node grouping method was constrained by a maximum of 10 nodes of a group, ABG could reduce the number of encryptions and decryptions by 16% and 18% compared with those of TDG and BUG, respectively. The maximum number of upward group adjustments was 25. ABG could also reduce the number of encryptions and decryptions required for TDG and BUG by 22% and 28%, respectively. When more aggregation nodes also served as boundary nodes simultaneously, the number of encryption and decryption decreased further. Thus, if a network allows severe nodes of group members, ABG would have better computation performance than TDG and BUG. When a maximum of 50 group members were considered, ABG could reduce the encryption and decryption by 35% and 36% compared with those of TDG and BUG, respectively.