Recently, diagnosing diseases using medical images became crucial. As these images are transmitted through the network, they need a high level of protection. If the data in these images are liable for unauthorized usage, this may lead to severe problems. There are different methods for securing images. One of the most efficient techniques for securing medical images is encryption. Confusion and diffusion are the two main steps used in encryption algorithms. This paper presents a new encryption algorithm for encrypting both grey and color medical images. A new image splitting technique based on image blocks introduced. Then, the image blocks scrambled using a zigzag pattern, rotation, and random permutation. Then, a chaotic logistic map generates a key to diffuse the scrambled image. The efficiency of our proposed method in encrypting medical images is evaluated using security analysis and time complexity. The security is tested in entropy, histogram differential attacks, correlation coefficient, PSNR, keyspace, and sensitivity. The achieved results show a high-performance security level reached by successful encryption of both grey and color medical images. A comparison with various encryption methods is performed. The proposed encryption algorithm outperformed the recent existing encryption methods in encrypting medical images.