Future sensor networks require energy and bandwidth efficient designs to support the growing number of nodes. The security aspect is often neglected due to the extra computational burden imposed on the sensor nodes. In this article, we propose a secret key generation method for wireless sensor networks by using the physical layer features. This key generation method is based on the superposition property of wireless channels. The proposed method exploits the multiple access property of the wireless channel with simultaneous transmissions as in the analog function computation technique to solve the latency and scarce bandwidth problems of highly populated dense networks. All nodes use the same time and frequency block to provide scalability that is linearly proportional to the number of nodes. The proposed method also benefits from the network density to provide security against eavesdroppers that aim to sniff the secret key from the channel. The security of the proposed method against eavesdroppers is analytically studied. Moreover, their application in multiple layers is investigated. The presented results have shown that there is a tradeoff between the total power consumption and total used bandwidth for secret key generation. Lastly, the error probability of the generated keys due to thermal noise and channel estimation error is investigated with computer simulations and compared with broadcasting-based benchmark model.