Key predistribution has been claimed to be the only viable approach for establishing shared keys between neighboring sensors after deployment for a typical sensor network. However, none of the proposed key predistribution schemes simultaneously achieves good performance in terms of scalability in network size, key-sharing probability between neighboring sensors, memory overhead for keying information storage, and resilience against node capture attacks. In this paper, we propose SBK, an in situ selfconfiguring framework for bootstrapping keys in large-scale sensor networks. SBK is fundamentally different from all key predistribution schemes. It does not require keying information1 predeployment. In SBK, sensors differentiate their roles as either service nodes or worker nodes after deployment. Service sensors construct key spaces and distribute keying information in order for worker sensors to bootstrap pairwise keys. An improved scheme iSBK is also proposed to speed up the bootstrappi...