In this article, we consider an eavesdropping attack on a multihop, underwater acoustic sensor network that consists of M + 1 underwater sensors which report their sensed data via orthogonal frequency division multiplexing (OFDM) scheme to a sink node on the water surface. Furthermore, due to the presence of a passive malicious node in nearby vicinity, the multihop underwater acoustic (UWA) channel between a sensor node and the sink node is prone to eavesdropping attack on each hop. Therefore, the problem at hand is to do (helper/relay) node selection (for data forwarding onto the next hop) as well as power allocation (across the OFDM subcarriers) in a way that the secrecy rate is maximized at each hop. To this end, this problem of node selection and power allocation (NSPA) is formulated as a mixed binary‐integer optimization program, which is then optimally solved via decomposition approach, and by exploiting duality theory along with the Karush‐Kuhn‐Tucker conditions. We also provide a computationally efficient, suboptimal solution to the NSPA problem, where we reformulate it as a mixed‐integer linear program and solve it via decomposition and geometric approach. Moreover, when the UWA channel is multipath (and not just line‐of‐sight), we investigate an additional, machine learning‐based approach to solve the NSPA problem. Finally, we compute the computational complexity of all the three proposed schemes (optimal, suboptimal, and learning‐based), and do extensive simulations to compare their performance against each other and against the baseline schemes (which allocate equal power to all the subcarriers and do depth‐based node selection). In a nutshell, this work proposes various (optimal and suboptimal) methods for providing information‐theoretic security at the physical layer of the protocol stack through resource allocation.