  Despite much research on probabilistic key predistribution schemes for
wireless sensor networks over the past decade, few formal analyses exist that
define schemes' resilience to node-capture attacks precisely and under
realistic conditions. In this paper, we analyze the resilience of the
q-composite key predistribution scheme, which mitigates the node capture
vulnerability of the Eschenauer-Gligor scheme in the neighbor discovery phase.
We derive scheme parameters to have a desired level of resiliency, and obtain
optimal parameters that defend against different adversaries as much as
possible. We also show that this scheme can be easily enhanced to achieve the
same "perfect resilience" property as in the random pairwise key
predistribution for attacks launched after neighbor discovery. Despite
considerable attention to this scheme, much prior work explicitly or implicitly
uses an incorrect computation for the probability of link compromise under
node-capture attacks and ignores real-world transmission constraints of sensor
nodes. Moreover, we derive the critical network parameters to ensure
connectivity in both the absence and presence of node-capture attacks. We also
investigate node replication attacks by analyzing the adversary's optimal
strategy.
