This paper proposes a new classification model distinguishing four classes of attacks in Wireless Sensor Networks (WSNs) namely: attacks based on the protocol stack, on the capability of the attacker, on the attack impacts and on the attack target. Then, it presents and classifies the most known attacks in WSNs based the proposed model. Simulations implemented under the NS3 simulator prove that the network lifetime can decrease by more than 45% in the presence of attacks. Afterwards, it discusses the main security methods and protocols of management and distribution of encryption keys used to ward off different types of attacks. Obtained results confirm that these security methods must be adapted to the specific characteristics of WSNs to achieve the intended objectives.