## 1 Introduction
Communications technology has also heavily benefitted from biologically inspired mechanisms; for example, a BIOlogy-Inspired Self-organized Secure Autonomous Routing Protocol (BIOSARP) [23; 24; 25] has been developed based on an artificial immune system (AIS) that begins by checking the behavior of neighboring nodes and classifying them once the neighbor table of each sensor node is populated with the relevant information. However, before the AIS-based preventive measure is initiated, adversaries have an open opportunity to seize control of the entire deployed network. We have found that BIOSARP is adequate in terms of cost, but is weak in all aspects of providing security. By contrast, Secure Real-Time Load Distribution (SRTLD) is adequate in terms of security but not cost. Thus, by combining the best features of SRTLD and BIOSARP in a novel way, we have developed a secure and cost-efficient solution. This paper proposes an enhanced BIOSARP (E-BIOSARP) and presents a detailed description of its architecture, a thorough analysis, and a comprehensive comparison with other schemes to demonstrate its efficiency. E-BIOSARP incorporates a random key encryption and decryption mechanism [26] into BIOSARP to provide active security measures for WSNs. [PERSON] _et al._[27] presented the initial design of and preliminary results regarding E-BIOSARP. Because of the encryption mechanism used in E-BIOSARP, WSN communication is secured even during the critical learning and initialization phases. An extensive security and performance analysis was conducted to demonstrate the efficiency of E-BIOSARP. The main contributions of this paper are as follows:  
* By incorporating a random key encryption and decryption mechanism [26] into BIOSARP, we propose an enhanced BIOSARP named E-BIOSARP to provide overall network communication security from the very beginning of the establishment of a WSN at a low performance cost. * Our security analysis shows that E-BIOSARP can ensure confidentiality and integrity by encrypting header fields such as the packet sequence ID (_Pkt_ID_), destination ID (_D_ID_), and source ID (_S_ID_) and by transmitting fragmented data instead of applying cryptographic operations to complete packets, as is the case in most security mechanisms. * Our security analysis also shows that E-BIOSARP is resilient against data tampering attacks, selective forwarding, brute-force or exhaustive key search, spoofing, eavesdropping, replaying or altering of routing information, cloning, acknowledgment spoofing, HELLO flood attacks, and Sybil attacks. * We present the implementation of a WSN scenario using E-BIOSARP in network simulator 2 (ns-2) and the population of this scenario with malicious nodes to analyze the behavior and performance of E-BIOSARP. * E-BIOSARP is analytically and experimentally compared in terms of processing time with state-of-the-art security mechanisms, including TinyHash, TinySec with authenticated encryption (TinySec-AE), TinySec with authentication only (TinySec-Auth), exclusion basis systems (EBSs), location-based resilient security with authentication (LBRS-Auth), and SRTLD. * Simulation results show that E-BIOSARP outperforms SRTLD in terms of energy consumption, packet overhead and delivery ratio and also outperforms another state-of-the-art secure routing protocol, the energy-efficient secure path algorithm (ESPA), in terms of energy consumption. This paper is structured as follows: Section 2 discusses recent related works. Section 3 describes the architecture of E-BIOSARP. Section 4 presents a security analysis of E-BIOSARP. Section 5 provides a complexity analysis of E-BIOSARP and other security mechanisms. Section 6 discusses the simulation-based implementation and the experimental results. Section 7 concludes the paper with a summary of our contributions and a brief discussion of future work.