Abstract
<title>Abstract</title> <p>The Internet of Bio-Nano Things (IoBNT) enables implantable nano-devices to exchange information through diffusion-based molecular communication (MC-VD), supporting applications in personalized medicine. However, the open nature of molecular diffusion makes such systems vulnerable to physical layer attacks, particularly eavesdropping and molecule injection. Existing studies typically consider these attacks separately and often rely on idealized diffusion models that neglect physiological effects, such as blood flow and enzymatic degradation. In addition, machine learning approaches for joint attack detection in MC remain largely unexplored. This study presents a physical-layer security (PLS) framework for MC-VD operating in an advection–diffusion–reaction (ADR) environment under both eavesdropping and molecule injection attacks. A closed-form channel impulse response was derived for the ADR channel, and a distance-based secrecy criterion was established. The analysis shows that a positive secrecy capacity can be achieved only when the eavesdropper is located farther from the transmitter than the legitimate receiver. To detect attacks, a machine learning framework based on 27 statistical and channel-related features was developed using 6,000 balanced feature windows. The results show that Gradient Boosting achieves a macro-AUC of 0.893, outperforming conventional threshold-based detection methods by 41.5%, with F1-scores of 0.761 and 0.791 for eavesdropping and injection attacks, respectively. A lightweight LSTM model requiring approximately 12KB of memory achieved an AUC of 0.787, making it suitable for resource-constrained nano-devices. The proposed framework demonstrates that machine learning can provide effective and practical physical layer security for future IoBNT systems.</p>