The rapid increase in the number of connected things across the globe has been brought about by the deployment of the Internet of things (IoTs) at home, in organizations and industries. The innovation of smart things has been envisioned through various protocols, but the most prevalent protocols are publish-subscribe protocols such as Message Queue Telemetry Transport (MQTT) and Advanced Message Queuing Protocol (AMQP). One of the major concerns in the adoption of such protocols for the IoTs is the lack of security mechanisms as the existing security protocols cannot be adapted due to their large overhead of computations, storage and communications. To address this issue, we propose a lightweight protocol using Elliptic Curve Cryptography (ECC) for IoT security. We present analytical and simulation results, and compare the results to the existing protocols of traditional Internet.