Applications for healthcare execute computations that support various patient diagnostics and save private user data on cloud servers. User data is being held at ransom as a result of increasing cyberattacks on medical systems. Additionally, unreliable external parties who sell private data for profit can access mathematical calculations on data stored in the cloud. In this research, we suggest an efficient Homomorphic medical image encryption algorithm protecting medical plaintext data against unauthorised access via homomorphic encryption. To increase the security level Paillier's encryption scheme (PES) is utilized to select the optimal key. Homomorphic encryption is a method of authentication which helps one to perform observes of the encrypted information through decrypting it. Secret sharing splits up computations among a number of edge virtual nodes and hides all arithmetic operations, preventing unreliable cloud servers from figuring out what was done with the encrypted patient data. Cloud computing resources help virtual edge nodes perform computationally difficult mathematical operations and lower latency in device-edge node data transmission. During the experimental study, different factors including execution time, encryption time, and decryption time are used to evaluate the performance of the suggested approach. The proposed technique's execution time is 2% faster than the currently used HE method and 4% faster than the ECC algorithm.