# An Asymmetric Encryption-Based Key Distribution Method for Wireless Sensor Networks
## 3 The Key Management Scheme for Cluster-Based WSNs
### Static Sensors Subscheme for Hierarchical WSNs  
#### 3.3.1 Mutual Authentication and Key Distribution Process  
In our clustered architecture network, the CH plays an important role in the process of key management. The key problem here is understanding how to distribute the key among the sensor nodes under many restrictions. We assume that all sensors are static and present the operations of handshake, key distribution, authentication, and key update. The handshake is destined to establish a symmetric key shared by sensors and BS. The operation of handshake includes three steps:  
1. **Generation of the \(SK_{i}\):** The \(CH_{i}\) generates a random symmetric key \(SK_{i}\) and a challenge \(R\). Next, the \(CH_{i}\) encrypts \(SK_{i}\), \(R\), and \(ID\_CHi\) with \(PUK\), and we find \[\text{Cipher1}=E(PUK,\,SK_{i}\|R\|ID\_CHi\|timestamp)\] (1) The 2-byte timestamp is used to resist replay attacks. \(CH_{i}\) sends Cipher1 to the base station using traditional routing. Here, the \(PUK\) is used for authentication and preserving the confidentiality of the session key \(SK_{i}\).
2. **Establishment of \(SK_{i}\):** After receiving and decrypting the message, the base station finds \(SK_{i}\), and \(R\) uses its \(PVK\) and builds a global table of all session keys of different clusters. This table is used to identify the cluster and its cluster head on the network. Meanwhile, if \(ID\_Chii\) can be found in the database of legal CHs, the identity of the \(CH_{i}\) can be authenticated using BS.
3. **Completion of the handshake:** The base station encrypts \(R\) with the established session key \(SK_{i}\). and finds \[\text{Cipher2}=E(SK_{i},\,R)\] (2) Next, the base station sends Cipher2 to \(CH_{i}\), and \(CH_{i}\) decrypts it. When the challenge \(R\) is correctly received, a session key is successfully established between BS and \(CH_{i}\). Otherwise, \(CH_{i}\) will reinitiate the handshake. Considering the resource consumption caused by the computational complexity, the message authentication code (MAC) is not added to the key distribution process.  
Through the above steps, the mutual authentication between the base station and \(CH_{i}\) is completed. After that step, each sensor in the cluster needs to achieve the session key \(SK_{i}\) generated using \(CH_{i}\). Thus, sensor node \(S_{i}\) builds a message encrypted using the \(PUK\), which is denoted as follows:  
\[\text{Cipher3}=E(PUK,\,ID\_CHi\|ID\_si\|timestamp\|SK\_si\|R) \tag{3}\]  
where \(SK\_si\) is a symmetric key generated using sensor \(S_{i}\). For sensor \(S_{i}\), the Cipher3 is used to apply for the session key and identity authentication at the same time.  
When the BS receives Cipher3, it picks out the corresponding session key \(SK\_si\) according to \(ID\_CHi\). At the same time, if the \(ID\_si\) can be found in the list of legal sensor nodes, the authentication of \(S_{i}\) is also accomplished.  
To secure the session key, the base station encrypts \(SK_{i}\) with the session key \(SK_{\_}si\) and builds the Cipher4 as follows:  
\[\text{Cipher4}=E(SK\_si,SK_{\_}i\|R). \tag{4}\]  
Next, the Cipher4 is sent to \(S_{\_}i\), and \(S_{\_}i\) will decrypt it using the symmetric key \(SK\_{\_}si\). Finally, all sensors in the same cluster have the same session key \(SK_{\_}i\) as its cluster head. Through the above key distribution subscheme, the confidentiality of traffic between the cluster head and the sensor is guaranteed. Moreover, mutual authentication between the BS and \(S_{\_}i\) is successfully performed. The detailed key distribution process is depicted in Figure 2.  
The specific implementation process of our proposed asymmetric encryption-based key distribution method in the static scenario is shown in Figures 3 and 4. In phase I, CH\({}_{1}\) and BS complete the two-way authentication and distribution of the session key \(SK_{\_}1\) at the same time. In phase 2, the secure distribution of the session key between sensor \(S_{\_}1\) and BS is realized.