The world is moving along with the technical advancement where smart home and smart cities are creating smart lifestyle and Internet of things (IoT) is being one of the most popular technologies in this decade. IoT is making life better by connecting devices and producing billions of data. But for the heterogeneous connectivity, smaller size, memory, storage and less security measurement, it is easy to hack and manipulate the IoT devices. To have a safe and secured connection, it is a must to ensure the data security in IoT too. This research proposes a novel method to secure the IoT devices using blockchain technology.