The sensed data from Internet of Things (IoT) devices are important for accurate decision making. Thus, the data integrity, non-repudiation, data confidentiality, data freshness, etc., are necessary requirements in sensor-based IoT networks. Further, the IoT devices are resource constrained in terms of computation and communication capabilities. Hence, striking a balance between network lifetime and data security is of utmost importance. The present work explores the sensor-based IoT-specific security threats like, data modification, selective forwarding and replay attacks. Further, a scheme is proposed based on secret sharing and cryptographic hash functions which detects these attacks by a malicious entity and protects the data from passive listeners too. Extensive simulations were performed to evaluate the efficacy of the scheme, and results show that the proposed scheme outperforms previously explored schemes like SIGN-share, SHAM-share, and PIP algorithm, in terms of sensor processing time, energy consumption during in-node processing and aggregation time. Network lifetime has been further analyzed to show the efficacy of the scheme.