The Internet of things (IoT) is a network of physical objects, devices, vehicles, buildings, and other items embedded with electronics, software, sensors, and network connectivity that enable these objects to collect and exchange data. When IoT is augmented with sensors and actuators, it can communicate through direct integration of the physical world into computer-based systems, resulting in improved efficiency, accuracy, and economic benefit. This paper offers a new algorithm to hide secret message text from objects or sensors in any media, such as images, text, audio, and video. It uses hidden secret messages in digital images, sending this ‘stego image’ across networks to the server, where the stego image is saved. The hidden secret message in the image is implemented in three steps. In the first step, a watershed filter is applied on a colour image of any size or format. In the second step, a random secret key is generated. Finally, in the third step, the secret message (text) is converted to binary bits, where one bit is hidden in each pixel in the watershed image in least significant bit (LSB) using a secret key and then is saved on the server. The secret key is a random matrix to locate each hidden bit.