The healthcare industry has advanced its digitalization and use of electronic medical records during the past ten years (EMRs). The EHR system gives the information's proprietor authority over their data and allows them to communicate it to certain individuals. It is challenging for data to maintain security and diagnostic processes because of the enormous volume of data in the medical field. This research presents a novel blockchain-based encryption system using deep learning (BcEs-DLM) for secure medical data management. The concept that is being described encompasses many phases of activities, including safe data management via blockchain, encryption, and optimal key generation. It provides individuals with the ability to manage data accessibility, granting read/write access to hospital authorities, and triggering precautionary agreements. Our recommended approach offers a reliable methodology for generating secure encryption keys and effectively safeguarding sensitive medical data using the block cipher technique. By following this method, you can ensure that patient information remains confidential and protected from unauthorized access. The detection process is performed using medical record sharing. In this paper, we achieved a 97 percent accuracy after training our deep learning model. Additionally, every node of this system is registered and updated on the blockchain