To achieve security in wireless sensor networks (WSNs), it is important to be able to encrypt messages sent among sensor nodes by using shared keys between them. Due to resource constraints, achieving such key agreement in WSNs is nontrivial. Previous research indicates that key management schemes using deployment knowledge can significantly improve the performance of WSNs. Nevertheless, in these schemes, resilient local connectivity and resilient global connectivity become unstable when deployment error changes. To resolve the above problem, in this project, a one-way associated key management model is proposed. In this model, the key pool consists of two layers: 1) the global layer and 2) the local layer. According to different deployment errors, the number of keys allocated from the global key pool and local key pools can be dynamically adjusted, thereby improving the stability of networks’ performance. In multiphase sensor networks, analysis and simulation indicate that our scheme has better adaptability in applications where deployment error changes as compared with related schemes.