Being one of the main technologies for Internet of Things (IoT), wireless sensor network is absolutely critical and plays an increasingly important role in the development of Internet of Things. Wireless sensor network is mobile network composed of sensor nodes with limited resources, like computation capability, energy, memory storage, and communication capability. Its characteristic results in that the security of wireless sensor network faces a great challenge. Hence, the security of wireless sensor network is an important issue for the development of IoT and shall be focused on. In this paper, a novel authentication scheme is proposed for wireless sensor networks based on theory of quadratic residues. It is making the use of master key to achieve simple symmetric cryptographic primitives and authentication operation and reach the aims of great resistance against the attacks and low energy consumption. Then the proposed scheme is compared with other network-wide key management schemes, obtaining better results in the aspects of security, efficiency, and scalability.