||The security issue in a wireless sensor network (WSN) has been drawing considerable research attention in recent years. Key management, a basic security service, becomes the core design for various security services, such as encryption and authentication. To increase the connectivity of each key in a large-scale WSN and to enlarge its maximum supportable network size, this paper presents a scalable grouping (SG) random key predistribution scheme. The SG scheme divides all nodes into several groups and uses the one-way function to generate group-to-group pairwise keys. To improve resilience against node capture, i.e., to fortify the security strength, the scheme takes on the concept that the link key is composed of some shared keys. For any two nodes with two or more shared keys, the SG scheme uses the exclusive-OR operation to compose the link key -- assuring the link key used to secure a link is nearly unique. Experimental results show that the SG scheme is able to generate better resilience against node capture and higher scalability than existing random key based schemes.