Wireless Ad-Hoc network has a set of nodes which designed with wireless transceivers. These nodes communicate with each other by accessing the common channel. In the ad-hoc network, security is one of the main challenges. Due to the behavior of malicious nodes, the security of the network is compromised. So, the major objective of this paper is to improve the security of the network by combining both malicious node detection and cryptography techniques. In this paper, an optimized fuzzy system is presented for the detection of malicious nodes which are malfunctioning in the routing path between source and destination. To optimize the performance of the fuzzy system, Particle Swarm Optimization (PSO) algorithm is presented. After the detection of malicious nodes, each normal behavior node in the network is authenticated by the Certificate Authority (CA). Then the authenticated nodes transmit the data packets to the destination with the Elliptic Curve Cryptography (ECC) algorithm. Simulation results show that the performance of the optimized fuzzy system is improved than that of the conventional fuzzy system for malicious node detection in terms of delivery ratio, detection time and energy efficiency