This paper proposes an agent-based intrusion detection system for mobile ad hoc networks (MANETs) using a triangular encryption technique for secure data validation. The proposed system, referred to as 'idect', randomly triggers agents from nodes to identify malicious nodes through monitored activities and encrypted information comparison. Simulation results demonstrate the system's effectiveness in detecting malicious behavior under varying parameters such as node mobility and the percentage of malicious nodes.