## 3 Proposed Methods
### Formation of Key Encryption for Plain Text  
In every round of transmission, the novel key for encryption is generated for every sensor node. Here, we use a one-time pad for the encryption and decryption process. In the sensor network, three sensor node types are employed, namely stage 0, stage 1, and stage 2 sensor nodes. The nodes of stage 1 and stage 2 are employed without manual support. The node distribution for stage 1 and stage 2 remains constant. The total number of sensor nodes in stage 1 is 10-20% and for stage 2 is 20-30%. The initial key globally represented as K0 for stage 0, stage 1, and stage 2 has been preloaded. Moreover, a separate secret key has been allotted through the destination node that is held by every node. Individual identity (ID) has been given for every node as well as the operation of pseudo-random value f, which is preloaded. The destination node is presumed to be secure as well as trusted. Although a minimal bound of time interval Tmin has been assumed, this remains essential by the opposite phase to negotiate with the node. The cluster heads initiate localizing self-organization through the transmission of a hello message <IDC|NC|MAC(K0, IDG|NG)> by the stage 1 node, where IDC is the group leader's ID and NC denotes the nonce. The initial verified hello message by the Medium Access  
Figure 3: Schematic illustration of a black-hole attack using REQR and REPR packets. A–D, F denotes nodes, Solid arrows denotes REQR and dotted arrows denotes REPR.  
Control (MAC) is accepted through every node (say, node X). The transmitter as its parent locates the destination as X. <IDX|IDC|NC|MAC (K0, IDX|IDC|NC)> is sent to the destination as the response message. The <IDX|IDC|NX|MAC(K0, IDX|IDC|NX)> message is transmitted as the hello message, which is updated. By the MAC layer, the message which is given as a response has been accepted by the cluster head, and node X is allotted as their child node. These functions are carried out recurrently. The termination of the hello message transmission is made when the hello message is received by the sensor node. The transmission is halted when the neighbor cluster's head broadcasts the message sooner. Every cluster head has its identity as ID, which is reported to every other cluster head. This ends the process of localizing self-organization. When this process ends, the cluster head, which acts as a base, has coordinated with the nodes through the design of the tree. Every cluster head comprises the collected data, namely (a) the ID of the neighbor's one-hop, and (b) the ID of the neighbor's cluster head. In other sensor nodes, the data accumulated comprises (a) the ID of the parent node, (b) the ID of the child node, and (c) the ID of the cluster head. At first, the secret key of the cluster head f K0 (ID) is derived on its own. The cluster head of the neighbor will derive f K0 (ID), the private key, where ID is the ID of the neighboring cluster head. After secret key derivation, the generation of a shared key for the inter-cluster by the cluster head of the neighbor takes place. We assume the cluster heads to be X0 and Y0. The generation of the shared key KXY is given here. If X0 ID \(\geq\) Y0 ID, the pair-wise shared key KXY = fK IDX has been generated by node X0. Node Y0 computes KXY as KXY = f K IDX independently. Finally, the time has elapsed, and every node can reject the destination node (K0, f) along with the secret key of the nodes. The message sent by the cluster head is ID|IDR|MAC (K0, ID|IDR) for their single-hop nearest clusters, and a random identity is given as IDR. The message authentication of the MAC is validated through the nearest clusters. Intra-cluster key-sharing has taken place among the nearest cluster key f K IDR. Therefore, the intra-cluster key-sharing is only for the nearest cluster head.