# Energy-Aware Security Adaptation for Low-Power IoT Applications
## 1 Introduction  
The ongoing evolution of the global communications infrastructure promises to provide support for pervasive wireless communications, which are employed by a myriad of applications, among which are mobile applications employing all kinds of sensing and actuation devices. In addition, diverse communication technologies will contribute to enabling new areas for the application of the IoT paradigm. Among such areas, we will encounter, for sure, the need to support strong security guarantees, while at the same time, guaranteeing appropriate lifetimes for the constrained and battery-powered devices employed. In this context, we may consider that security and energy will require a joint management, in order for many IoT applications to be viable. One class of IoT communication environments fitting this scenario is that of the Low-Power and Wide-Area Networks (LPWAN) [1], and in this context, the challenge is to address the support that these protocol classes offer to industrial applications with critical security and energy management requirements [2]. In this context, the Long-Range Wide-Area Network (LoRaWAN) open standard is a popular and effective LPWAN protocol. Figure 1 illustrates the general LoRaWAN communications architecture [3]. From the point of view of security, the employment of wireless communications between LoRaWAN sensing devices and gateways is particularly critical [4]. End-to-end security in this context is thus critical, in order to secure end-to-end communications against external threats. Our proposal in this article is in line with this concern, as we discuss later. On the other hand, critical applications call for the usage of appropriate energy management mechanisms, since many LoRaWAN sensing platforms are powered by batteries, and thus, a careful control of how much energy is expended to support security mechanisms is important, so as not to compromise the effective lifetime of the device in the context of the application at hand. The LoRaWAN security scheme is composed of two levels of protection: at the network and application layers. Each uses one AES symmetric encryption key, which is obtained from the same primary key. The primary key is preconfigured and shared with each node by the network server, which is responsible for its generation during the setup phase. The network key is used to encrypt and to guarantee integrity for communications in the LoRaWAN infrastructure, while the application key ensures the confidentiality of the payload in the context of the application. Devices in a LoRaWAN infrastructure may belong to three categories, namely A, B and C. For type A sensors, the device is responsible for initiating communications with the server, using dedicated uplink and downlink communication windows. This behavior allows the device to hibernate and to reduce energy consumption, and in consequence, this is the most efficient class regarding energy usage. Class B is similar to class A; however, in this case, the devices are synchronized with the server to schedule downlink communication windows, making it more costly in terms of battery usage. In Class C, a permanent open channel for bidirectional communication is maintained with the server, making it possible to receive a message at any time. We can thus observe that this configuration makes Class C devices the most expensive in terms of energy consumption. Our focus in this article lies in the proposal of an architecture and algorithms to support the adaptation logic required for the dynamic management of security and energy in tandem, in the context of radio-frequency communications in an LPWAN network, as per the requirements and motivations previously discussed. In particular, the goal is to protect the application against external threats, with energy being dynamically managed to promote acceptable lifetime for the constrained devices employed.