# Key Management Scheme Based on Route Planning of Mobile Sink in Wireless Sensor Networks
## 4 Simulation and Evaluation
### Safety Analysis
#### 4.4.2 Resilience  
In the proposed scheme, each sensor node is preloaded a pair of public and private keys before deployment. The session key between the member node and cluster head is established on the basis of the cluster key which is encrypted with the public key of the node in the cluster during the broadcast of the cluster key, and only the corresponding private key of the member node can decrypt and get the cluster key, then they can establish the session keys. The private key of a member node will be used during the process of session key establishment. The method of a pair of scalars on an elliptic curve is adopted in the process of cluster key transmission, and the private keys of the cluster head and MS are also involved in the process. Considering the decryption difficulty for the elliptic curve discrete logarithm and the random large integer \(k\), the probability of disclosing the cluster key by calculation will be decreased when the public key \(P\) and the basis point \(G\) on the elliptic curve are captured by an adversary. The cluster head and the MS establish a session key with the improved ECDH algorithm, which ensures the forward security of the network, and the forward security means the leakage of any current private key will not affect the keys established before. The session key between the cluster head and MS is established with the random large integer \(R\), public key, private key and the basis point \(G\), so the session keys established already will not be leaked due to the randomness of the large integer \(R\), even if the private key is decrypted. Any existing key management schemes cannot absolutely assure the security of a sensor network. This article presents a key management scheme based on dynamic clustering and the optimal route choice of the MS, in which the network topology structure and the session keys will be regularly updated. New nodes will be allowed to participate in clustering and establish a session key after their verification by a preset digital signature. The member nodes only need to establish a session key with their cluster heads, and do not need to communicate with any neighbor nodes. This will reduce the influence on them from the link capture of adjacent nodes. In addition, the nodes between clusters will not exchange any information each other, and this could avoid interference from neighboring clusters as well. This can guarantee a limit to the danger that the private key of the nodes in the cluster is leaked within its own link or cluster. In order to impede the goal that an adversary wants to decrypt the session key through long-term monitoring and analyzing data in the network, this scheme adopts the dynamic keys updating policy of \"one time one key\". That means the keys update instant in each round of clustering. After the MS completes the traversal for all cluster heads, the base station will launch a new round of clustering, and all keys will be re-established after clustering. This can avoid the use of the same key for data transmission for a long time, and reduce the backward security threat where a pseudo node obtains other nodes' communication keys and associated information according to the known key's information:. Therefore, we can summarize the security advantages of the scheme proposed in this article as follows:  
1. The analysis of confidential performance: the session keys between the sensor nodes and the cluster heads are established by the cluster key, which is transmitted through a pair of elliptic curve scalars, since cracking the problem of a discrete logarithm on the elliptic curve is a well-known difficult problem, it can ensure the confidentiality of transmissions. 2. The analysis of forward safety performance of the whole network: the session keys between the cluster heads and the MS are established by the random large integer \(R\), public key, private key and the basis point \(G\) all together.