Have you heard of the concept of "homomorphic encryption"? It allows someone to perform computations on encrypted pieces of data, without actually ever having access to the raw data itself.
I have no idea how realistic or how "possible" this technology is for in the near future, but this seems to be a great match for technologies like these.