The enabling devices and sensors of the Internet of Things (IoT) are characterized by devices with limited resources, where the computation and the energy consumption should be optimized. Application fields such as healthcare or multimedia content bring up security and privacy issues. Therefore, data security is critical. However, to obtain it, high computing resources are required. To avoid it, in this work, we propose a lightweight method to protect data transmissions in sensor devices. We present the GS3 method, it is based on a procedure set by Generating the data block, Shuffling, Scrambling, and applying Substitution boxes on the data. Our experimental results will show that GS3 introduces a minimal overhead, of just two bytes corresponding to the Cyclic Redundant Control 16 (CRC16) integrity control in the length of the messages concerning the original data. According to the execution time with respect of other encryption-based methods, even a 50% less than Chacha20 algorithm, as fewer steps and simpler computation procedures are required. Therefore, GS3 is a good choice to be used in resource-constrained IoT devices in which data integrity and security are required, taking into account the data freshness.