In wireless sensor networks, sensor nodes are typically distributed in harsh environments for continuous monitoring and data collection. All sensor nodes send the collected data directly or through other sensor nodes to the base station. Due to the nature and range of applications of these networks, maintaining security has always been one of the most critical challenges in wireless sensor networks. Key management is one of the methods used to maintain security in wireless sensor networks. In this paper, a hierarchical key management method for wireless sensor networks is presented. In the proposed method, first, the network is zoned, then the connection between the network nodes is established through two keys within the zone and between zones. The zone key is the shared key between the zone members and the zone manager. For intra-zone communication, a lightweight authentication operation is performed between zone members and the zone manager. If the authentication operation is successful, the key generation process is performed within the zone. The inter-zone key is shared between both of the manager nodes and is used for inter-zone communication. The performance of the proposed method is compared with the Zhang et al. ( 2016); the EDAK (Athmani et al., 2019), DKMS (Yousefpoor & Barati, 2020), SSEKMS (Kumar et al., 2021), and ADPK (Ahlawat & Dave, 2021) methods show the proposed method's better performance.