Cloud The Internet of Things (IoT) is a dynamic global network framework based on standardized protocols, where interconnected objects like sensors, radio-frequency identification (RFID) devices, and machines connect to the Internet. However, IoT encounters challenges related to resource utilization, energy constraints, memory limitations, and security concerns. This paper proposes an efficient keystream generator that integrates the Salsa20 and ChaCha20 algorithms to tackle these issues. Additionally, it emphasizes securing data exchanged between IoT sensors (such as Arduino IDE, Pulse Heart Rate, and Body Temperature sensors) and a cloud-based backend (with Google Firebase as a real-time database) by encrypting the information using the proposed keystream generator. The results show that the keys produced by the proposed keystream generator are less complex and successfully pass the five standard benchmark tests.