The document presents a novel key management protocol for hierarchical wireless sensor networks (WSNs) utilizing hexagonal topology and AVL trees, aimed at enhancing security while minimizing energy consumption. It outlines dynamic protocols for inserting and removing sensor nodes to address vulnerabilities related to node mobility and compromise, emphasizing resource constraints in sensor design. The proposed scheme ensures real-time security updates and efficiency improvements against common attacks experienced in WSNs.