Nowadays, the Internet of Things is able to provide more advanced services to people, which connects a variety of devices, systems and applications. However, it covers a variety of devices, protocols and applications, which makes it much more complex. In the main application areas, wireless sensornetworks with a frequent but short communication character, it requires an efficient and flexible protocol to protect the information. To protect the traffic of the Internet of Things is the focal point of this research work. Although many protocols for the Internet have been put forward, it is still not enough to meet the increasingly complex requirements from applications.
Many of them are not efficient enough to adapt the device diversity and timely communication environment. This paper is trying to address this problem, by proposing a peer-to-peer security protocol to satisfy this varied environment. Secure communication is implemented on an open sourced platform for the Internet of Things. Its less handshake in future sessions and dynamic security level adjustment feature satisfies the realistic demand on this platform. Finally, with a comparison test, the result shows that the proposed protocol is efficient to meet the specific goals and applicable for the Internet of Things applications.