Encryption Libraries for Waspmote Sensor Networks

The new Encryption Libraries are designed to add to the Waspmote sensor platform the capabilities necessary to protect the information gathered by the sensors. To do so three cryptography layers are defined:

  • In the first one all the nodes of the network share a common preshared key which is used to encrypt the information using AES 128. This process is carried out by specific hardware integrated in the same 802.15.4/ZigBee radio, allowing the maximum efficiency of the sensor nodes energy consumption. This first security layer ensures no third party devices will be able to even connect to the network (access control).
  • In the second security layer each node uses a point to point encryption scheme with Meshlium -the Gateway of the network-. This way even the intermediate nodes of the network (the ones which forward the information to the destination) will not be able to see the sensor data transmitted. To perform this technique each node interchanges with the Gateway a new encryption key using RSA 1024 (Public/Private keys) what ensures at the same time authentication and integrity. Once the key has been confidentially interchanged the rest of the communication is encrypted by using AES 256 via software as it ensures complete confidentiality and privacy while maintaining the minimum resources of the node in term of computing cicles and energy consumption.
    The "point to point" encryption key is cyclically changed using again RSA encryption in a process know as key renewal.
  • The third security technique is carried out in Meshlium -the Gateway- where HTTPS and SSH connections are used to send the information to the Cloud server located on the Internet.

A fourth optional encryption layer allows each node to encrypt the information using the Public key of the Cloud server. This way the information would keep confidential all the way from the sensor device to the web or data base server on the Internet.

The two main cases of the usage of the Encryption Libraries for Waspmote are:

  • Transmission of sensor data
  • Key initial sharing and key renewal

» Transmission of sensor data:

Information is encrypted in the application layer via software with AES 256 using the key shared exclusively between the origin and the destination. Then the packet is encrypted again in the link layer via hardware with AES 128 so that only trusted packets be forwarded, ensuring access control and improving the usage of resources of the network.

» Key sharing and key renewal:

Prior to start with the software encryption with AES 256 we need to share a key between each node (origin) and the Gateway or the Cloud Server (destination). To do so we encrypt the new key using RSA 1024 using both Public/Private keys. This way, we ensure authentication, confidentiality and message integrity (as we add also a seed along with the key to generate randomness in the packet transmission). Once we get the shared key we will use it to start encrypting the sensor information as seen in the previous diagram as AES it ensures the maximum performance and and minimum message overload.

Common security issues which are solved

This relationship includes:

  • Access control
  • By using AES 128 in the link layer we ensure that only nodes with the shared key can access to the routing capabilities of the sensor network. If a strange node sends a message to the network the message will be discharged in the first hop so no extra communication resources will be used. The AES 128 algorithm is implemented in the same radio using specific hardware, for this reason the information will be automatically discarded and not even send to the microcontroller. This provides an extra layer of security as the main control unit of the node will not be interrupted from performing basic tasks or event not awaken from the sleep mode (what ensures optimum energy usage).
  • Authentication
  • the library implements also RSA with asymmetric key scheme. Each node has a pair of Public/Private keys (1024b) which uses to sign the messages in order to ensure the authenticity of origin and destination. By using the SD card each node may store all the Public keys of the nodes of the network in order to even perform symmetric key renewal by encrypting the new key with the public key of the node destination and with the private key of the origin node.
  • Data Confidentiality (Privacy)
  • By doubling encryption of the messages we ensure that first that only the nodes which form part of the network can see the general routing packets (AES 128 in the link layer) and after that we stablish an encryption tunnel by direct P2P encryption between origin and destination (using AES 256).
  • Data Integrity
  • The new library uses hash algorithms such as MD5 and SHA to create the checksum of the message and to ensure that the final information received correspond with the original sent.
  • Data Freshness (avoiding packet injection)
  • Each packet has an exclusive seed which protects the gateway from receiving several identical packets which could be injected from a third party.
  • Non-repudation
  • By signing the messages with RSA keys we have also the legal proof that the information sent really was sent by an specific sensor node and not by other. Important in the future when all the sensitive sensor information has to be legally approved.

Each node may store thousands of different Public Keys of the nodes of the network in its SD card. So we can stablish a real P2P encryption among any sensor and the Gateway and even between any sensor and any web or data base server directly.

The new Libraries are specifically designed to be used in the Waspmote hardware sensor platform and are distributed along with the Waspmote IDE which is distributed under an open source license.