  Due to hostile environment and wireless communication channel, security
mechanisms are essential for wireless sensor networks (WSNs). Existence of a
pair of shared key is a prerequisite for many of these security mechanisms; a
task that key management system addresses. Recently, an energy efficient method
based on public key cryptography (PKC) was proposed. We analyze this protocol
and show that it is vulnerable to denial of service (DOS) attacks and adversary
can exhaust memory and battery of nodes. Then, we analyze this protocol and
show that using a more knowledgeable BS this vulnerability can be solved very
efficiently. Based on this observation we propose a modified version of the
protocol that achieves immediate authentication and can prevent DOS attacks. We
show that the improved protocol achieves immediate authentication at the
expense of 1.82 mj extra energy consumption while retaining other desirable
characteristics of the basic method.
