Reminds me of my work with CryptDB. A framework to run SQL queries over encrypted data: https://github.com/CryptDB/cryptdb
One important fact about homomorphic and other encryption schemes you can calculate on: It leaks information! E.g., if enc(x) + enc(y) = enc(z), you gain the knowledge that x + y = z. With enough data, it’s easy to obtain the unencrypted data without the secret(s).