Cloud computing is a very popular computing model, which grants a manageable infrastructure for various kinds of functions, like storage of data, application realization and presenting, and delivery of information. The concept is therefore very dynamically advancing in all kinds of organisations, including, in particular, the health care sector. However, effective analysis and extraction of information is a challenging issue that must find adequate solutions as soon as possible, since the medical scenarios are heavily dependent on such computing aspects as data security, computing standards and compliance, governance, and so on. In order to contribute to the resolution of the issues, associated with these aspects, this paper proposes a privacy-preserving algorithm for both data sanitization and restoration processes. Even though a high number of researchers contributed to the enhancement of the restoration process, the joint sanitization and restoration process still faces some problems, such as high cost. To attain better results with a possibly low cost, this paper proposes a hybrid algorithm, referred to as GlowWorm Swarm Employed Bee (GWOSEB) for realization of both data sanitization and data restoration process. The proposed GWOSEB algorithm is compared as to its performance with some of the existing approaches, such as the conventional Glowworm Swarm Optimization (GSO), FireFly (FF), Particle Swarm Optimization (PSO), Artificial Bee Colony (ABC), Genetic Algorithm (GA), and Genetically Modified Glowworm Swarm (GMGW), in terms of analysis involving the best, worst, mean, median and standard deviation values, sanitization and restoration effectiveness, convergence analysis, and sensitivity analysis of the generated optimal key. The comparison shows the supremacy of the developed approach.