The ability of the current global healthcare system to continue providing high‐quality medical care has been questioned. By using delay‐tolerant networks (DTNs) in healthcare management, people that spend a lot of time treating illnesses are exposed to more people while also putting their lives in danger. Unsupervised approach‐based node localization and secure routing in DTNs are developed in the proposed method. The proposed adaptive density‐based localization algorithm is constructed in two modules. The entire network is clustered depending on density utilizing density‐based spatial clustering of applications with noise (DBSCAN). An RSA‐based location estimation algorithm is employed to identify the unlocalized node within each cluster. After finding the location of each node, routing mechanism is carried out. An adaptive spray and wait routing strategy is utilized in the proposed method. When a node only has one copy of a message, the spray and wait, routing mechanism moves the relay node while it waits for the destination to be countered. Then modified DNA encryption algorithm is applied for secure data transmission. It is used for encrypting the information before storing it in the network. The trusted center will generate the private key needed for encrypting the data based on the sensitivity level of the information. This proposed algorithm is tested with several metrics which attain better performance, like 94% localization accuracy, 6% localization error, average residual energy of 93%, 5.7 Mbps throughput, 18% encryption time, and 14% decryption time. Thus, the techniques used in the proposed approach are the best choice for node localization, energy efficiency, and secure data transmission in DTN.