# Grouping Sensors for the Key Distribution of Implicit Certificates in Wireless Sensor Networks
## 1 Introduction  
According to a report on the Internet of Things (IoT) analytics, the number of connected devices will increase to \(\sim\)27 billion by 2025 [1]. The increasing number of devices needs to be integrated and communicated; thus, network technologies are essential for the connectivity of several devices. Various network technologies are used to connect devices. The wireless sensor network (WSN) is a major network technology. It comprises a group of sensor nodes with tiny shapes and limited power resources. It is used to measure the physical conditions of an environment, and the collected data are forwarded to data storage. Since WSNs can easily deploy a local network at a low cost, they can be employed in many domains for different novel applications [2; 3; 4; 5]. WSN is essential to the IoT evolution, which will become a mainstream part of the Internet in the future [6]. In WSNs, each sensor node collects data from the environment and then delivers them to the base station (BS) by multi-hops via other nodes. As wireless communication in WSN is power consuming, some specific nodes on the multi-hops path are \"data aggregators,\" aggregating data received from children nodes to reduce the data volume and the number of transmissions to the parent node [7]. Notably, communication in WSN is conducted through wireless channels. It is more vulnerable to malicious attacks, such as eavesdropping, camouflage, and modification. Thus, there is a need for a protection mechanism to ensure data security between nodes [8; 9]. As the keys used for encryption and decryption are different in the asymmetric encryption approach, heavy computation is required, which is unsuitable for WSN [10; 11]. The symmetric encryption approach, where encryption and decryption operations use the same key, is more favorable to WSN. However, an efficient key management mechanism to distribute keys to nodes is vital in such an approach. Herein, we propose an implicit security scheme [12] for key distribution as it is easy to implement and requires only linear complexity. This scheme employs a group-based key management framework [13], where, based on the grouping algorithm applied, a WSN is divided into several groups. Then, it generates and delivers correspondent encryption parameters for each group to calculate its key for later encryption and decryption operations. Each group uses a unique key to encrypt data. Designing a good grouping algorithm is vital because the group topology determines the number of encryption and decryption operations needed. Unfortunately, existing key management techniques demand high computation, a large amount of memory, and complex communication rounds. However, the secure aggregation method has good management efficiency in WSNs. In our previous study [14], we proposed an online query scheme (OBEQ) with a tree topology of WSN, which uses aggregators between BS and sensors for communication processes. Further, we developed two intuitive grouping strategies: top-down grouping (TDG) and bottom-up grouping (BUG). In this study, we propose aggregator-based grouping (ABG), a generic design for efficient private key management, which protects sensor node data using a group aggregation scheme. It combines TDG and BUG and executes horizontal and vertical searches separately based on the breadth-first and aggregator-based searches from TDG and BUG, respectively. It is adaptable to the efficiency and security requirements of various sensor node distributions. Furthermore, we developed a group-based key distribution strategy to address the security issues of nodes. Using the proposed ABG, a node executes encryption and decryption operations if and only if it must do either data aggregation or inter-group communication. Thus, the proposed algorithm can minimize unnecessary encryption and decryption operations.