To expand on homomorphic encryption. Yes, this is possible, yes functioning systems work for this, no it’s entirely not practical at the moment for real world use. There are a few technical issues that are hard to manage, but basically it comes down to the only encryption methods we know that allow for this (with no data leakage under all circumstances) are too bloated and slow. Multiple orders of magnitude slower. Minute length processes will be days kind of slow.
The main way homomorphic encryption works at the moment is via a concept called bootstrapping which currently is most performant using noise-based encryption. Essentially, this works by embedding your data, bit by bit, into really big numbers that meet some sort of mathematical property based on group theory or some other branches of mathematics (I’m doing this off the top of my head, forgive this handwave). The private key allows you to use this property to factorise out the data and the noise.
The main issue here is that (a) the noise part might be kbs in size per byte of data. All your operations are slower because of this, (b) it all works because of this idea of bootstrapping. Without going into details (ask, and I can provide), every certain number of operations you need to perform a normal reencryption plus a decryption whilst using the encrypted values (i.e., at the kbs/b scale). These two things make it really slow.
Source: I had to do a uni paper on this, researched it in depth for a couple of months.
Tl;dr – works in theory, impractically slow in practice, if you’re interested in the maths and find the other sources daunting (I did), I’ll see if I can do a simpler version