The Underwater Sensor Network (UWSN) comprises sensor nodes with sensing, data processing, and communication capabilities. Due to the limitation of underwater radio wave propagation, nodes rely on acoustic signals to communicate. The data gathered by these nodes is transmitted to coordinating nodes or ground stations for additional processing and analysis. The characteristics of UWSN with underwater channels make them vulnerable to malicious attacks. UWSN communication networks are particularly susceptible to malicious attacks owing to high bit error rates, significant propagation delay variations, and low bandwidth. Moreover, because of the challenging and erratic underwater conditions, limited bandwidth, slow data transmission speed, and power constraints of underwater sensor nodes establishing secure communication in UWSN presents a significant challenge. To address the issues mentioned above, we have introduced the Multipath Malicious Avoidance Routing Protocol (M2ARP) and Foldable Matrix based Padding Rail Fence Encryption Scheme (FM-PRFES) methods to enhance secure communication in UWSNs. The proposed FM-PRFES method encrypts the input data to prevent unauthorized access during transmission within the network. Subsequently, the proposed Energy Efficiency Node Selection (EENS) method is used to identify the significant nodes in the network. Additionally, the Cuckoo Search Optimization (CSO) method is utilized to select the Cluster Head (CH) for data transmission. Subsequently, M2ARP is employed to analyze various routes and avoid adversarial nodes in the network. As a result, the proposed experimental analysis yields more efficient results regarding security, Packet Delivery Ratio (PDR), and throughput performance than traditional approaches.