Measuring security in IoT communications