This study focuses on evaluating the data routing protocol in the Internet of Things (IoT). The evaluation is conducted using the Whale Optimization Algorithm (WOA), enhanced by the advanced Blowfish encryption algorithm. In this study, Cipher Block Chaining (CBC) is employed to improve the typical Blowfish technique. Furthermore, several key factors, including the rate of energy consumption, trust, distance, and delay, are considered to ensure the effectiveness of data routing. To demonstrate the feasibility of the proposed approach, four other schemes are utilized in a comparative study. These schemes are particle swarm optimization (PSO), secure routing protocol ( SARP),Genetic algorithm (GA), QoS-based Cross Multi-sink Routing protocol (QCM2R). The results clearly demonstrate the feasibility of the proposed approach when compared to the aforementioned schemes, with the lowest energy consumption, distance, and delay recorded as 0.44325 Joule, 0.43257 meters, and 1.35 x 10 -9 seconds, respectively. Additionally, the trust level is the highest at 0.71255, and the throughput reaches its peak at 2.30 Megabytes/ms when the data size is 7 KB. In terms of security dimension, the proposed improved Blowfish encryption technique is compared with Advanced Encryption Standard (AES), Rivest-Shamir-Adleman (RSA) and typical Blow fish algorithm (BFA) encryption techniques to assess its security robustness against Chosen-Ciphertext Attack (CCA) and Chosen-Plaintext Attack (CPA) with varying the size of data bits from 5KB, 7 KB and 10KB. The obtained results show that the proposed improved blow fish approach outperforms three aforementioned schemes with the smallest similarity between unique text and hacked text under CCA and CPA. Furthermore, the least time of decryption occurs with the proposed approach compared to other three schemes.