# Security in Wireless Sensor Networks: A Cryptography Performance Analysis at MAC Layer
## 1 Introduction  
In recent years, the development of hardware technologies has made it possible to create increasingly powerful and miniaturized devices. This technological advance, together with advances in wireless communications, has formed the basis for a successful new technological perspective: Wireless Sensor Networks (WSNs) [1]. The key to the success of WSNs is to be found in their versatility, in the low cost of the sensor nodes and in their highly self-reconfigurable qualities. These peculiarities have projected WSNs into various application scenarios, some of which with stringent reliability requirements such as WSNs for telemedicine and for some military applications or also smart-cities, where security is another important aspect to be taken into account [2]. Researchers are currently investigating how to manage the energy consumption of the sensor nodes more efficiently in order to increase the autonomy of the network. Moreover, how to optimally route communications from the sensor to the user, how to collect, store, and represent data with the minimum memory occupation has also attracted interest in the current literature. In particular, the need for reliable, energy-efficient data collection algorithms is a very widespread requirement as it is the basis for the monitoring and/or control of physical phenomena over a long period of time [3]. A WSN is essentially a network of devices, called sensor nodes, capable of interacting with the surrounding environment and communicating with each other in order to perform a specific task. To this end, there are three main functions that must be accomplished by the sensor nodes:  
* Sensing: the measurement of physical quantities (temperature, humidity, etc. );
* Processing: the processing of the acquired measurements;
* Communication: the communication with other nodes, typically through radio frequency (RF) interfaces. The network nodes are located within the area to be monitored, or in any case in the immediate vicinity. Usually, each node is associated with an object, a person, an animal or a decisive place for the study of the phenomenon to be observed. Typically, there is no fixed infrastructure on which nodes can be supported; for this reason they are called \"ad-hoc\" networks, which can be centralized if all communications are directed to a single node that processes the collected information, or distributed if the nodes have sufficient capacity and intelligence to process the data autonomously. Figure 1 shows an example of WSN where different sensor nodes can communicate in a multi-hop manner towards the sink node (or gateway node) with the purpose of collecting data and typically transmitting them to a server or computer. For this network typology, two aspects are very important: energy and security [4]. This is due to the particularity of sensor nodes that, unlike classic devices of local networks, are limited by battery and resource capacity (elaboration, storage, bandwidth). As a result, new medium access control (MAC) protocols that are aware of the constraints associated with each individual sensor in the network are required [5; 6]. WSNs have a wide range of applications; however, as the sensor network becomes more complex, the security of WSNs becomes even more important. The main security threats are due to the location of sensors in remote areas and their geographic distribution. Unfortunately, traditional safety mechanisms are not usable for sensors, as they introduce high overload. Several researchers have provided different studies on efficient security mechanisms that respect, in fact, the constraints in terms of resources and memory imposed by WSNs [7]. Sensor networks need basic security services, like any other communication system, in order to protect data and resources from any potential attacks. Sensor networks need light encryption to achieve a high level of security. Each sensor should have a balance between cost, performance and level of safety; however, it is very difficult to achieve these goals at the same time.