Mechanisms to secure communications in the IoT