Current image encryption methods have many shortcomings for the medical image encryption with high resolution, strong correlation and large storage space, and it is difficult to obtain reliable clinically applicable medical images. Therefore, this paper proposes a medical image encryption algorithm based on a new five-dimensional three-leaf chaotic system and genetic operation. And the dynamic analysis of the phase diagram and bifurcation diagram of the five-dimensional three-leaf chaotic system selected in this paper is carried out, and NIST is used to test the randomness of its chaotic sequence. This algorithm follows the diffusion-scrambling framework, especially using the principle of DNA recombination combined with the five-dimensional three-leaf chaotic system to generate a chaotic matrix that participates in the operation. The bit-level DNA mutation operation is introduced in the diffusion, and the scrambling and diffusion effects have been further improved. Algorithm security and randomness have been enhanced. This paper evaluates the efficiency of this algorithm for medical image encryption in terms of security analysis and time performance. Security analysis is carried out from key space, information entropy, histogram, similarity between decrypted image and original image, PSNR, correlation, sensitivity, noise attack, cropping attack and so on. Perform time efficiency analysis from the perspective of time performance. The comparison between this algorithm and the experimental results obtained by some of the latest medical image encryption algorithms shows that this algorithm is superior to the existing medical image encryption algorithms to a certain extent in terms of security and time efficiency.