Introduction: Due to its self-configurability, ease of maintenance, and scalability capabilities, WSNs (Wireless Sensor Networks) have intrigued plenty of interest in a variety of fields. To move data within the network, WSNs are set up with more nodes. The security of SNs (sensing nodes), which are vulnerable to malevolent attackers since they are network nodes, is a crucial element of an IoT (Internet of Things)-based WSN. This study's primary objective is to provide safe routing and mutual authentication with IoT-based WSNs. Methods: The basic GWO algorithm's imbalances between explorations and mining, lack of population heterogeneity, and early convergences are all issues that this paper addresses by selecting energy-efficient CHs (cluster Heads) using EECIGWO algorithm, an upgraded version of the GWO, is used. Mean distances within clusters, well-spaced residual energies, and equilibrium of CHs are all factors that influence the choices of CHs. The average intra-cluster distances, sink distances, residual energies, and CHs balances are some of the criteria used to choose CHs. Results and Discussion: The proposed EECHIGWO-based clustering protocol's average throughput, dead node counts, energy consumption, and operation round counts have all been evaluated. Additionally, mutual authentication between the nodes is provided through SSS (Shamir Secret Sharing) mechanism. PDR (Packet Delivery Ratio) analysis is used to assess how well the EECHIGWO-IOT-WSNs are performing. Conclusion: The suggested proposed approach is assessed against existing methods like HHH-SS (Hybrid Harris Hawk and Salp Swarm), ESR (Energy-efficient and Secure Routing) protocol, and LWTS (Light Weight Trust Sensing) approaches in terms of AEED (Average End-to-End Delay), network overheads, and PLR (Packet Loss Ratio).