The recent research in wireless sensor networks has led to a number of security schemes. The main requirement in wireless sensor networks is not only security but energy efficient security due to limited resources. We propose an energy efficient key management protocol fully developed in TinyOS and tested in Avrora emulator. In this paper, we divide the sensor network into levels and sectors thus solving problem of localization as well. On the basis of leveling and sectoring, we propose a distributed pair wise key establishment protocol that establishes keys only among those nodes which satisfy specific criteria on the basis of level and sector. Hence energy is not wasted in establishing pair wise key with all the neighbors. Moreover nodes have to store fewer keys. The two salient features about this protocol is that firstly it did not uses any central authority for key distribution and secondly, it provides significant resistance to node compromise attacks.