# Is it possible to send a file that cannot be opened or copied by the reciever, but only by a pre made program?

I couldn't think of a better question to ask, but I will explain more here.

I want to be able to send a Word document to a server that will work with the document data. Are there any good ways to do that without the owner of the server to be able to read the content of the document him/herself? I only want a pre-made program on the server to be able to access the content. Eventually, when the program on the server is finished with modifying the document, it will get sent back to me. Are there any ways to make sure the document disappears from the server, and don't get copied from the server?

I may be waay of regarding what's really possible to do with cryptography here. I am a beginner, and am trying to learn more.

• There is no cryptographic solution "to make sure the document disappears from the server, and don't get copied from the server". The only option I see for this is a trusted server; e.g, an HSM.
– fgrieu
Sep 15 at 20:19

The answer to this is "yes in theory, probably not in practice".

A Fully Homomorphic Encryption (FHE) scheme is a traditional encryption scheme with an additional "evaluation" algorithm. This means that, given a ciphertext $$\mathsf{Enc}_{pk}(m)$$, you can (for any circuit $$C$$) compute:

$$\mathsf{Eval}_{pk}(C,\mathsf{Enc}_{pk}(m))$$

to get an encryption of $$C(m)$$. Note that $$\mathsf{Eval}$$ is a publicly computable function, but you are operating on encrypted data the whole time, e.g. this notion seems to be (precisely) what you want.

The issue with FHE is mainly of efficiency. The programs evaluated with FHE are generally represented as circuits (rather than arbitrary turing machines). This means that the control flow of the program is fixed, so for an if statement you have to evaluate both branches of the computation.

For certain standard constructs (say HashMaps), this limitation means that I don't think anyone really knows how to implement them with FHE (without taking a massive efficiency hit). Depending on the precise program you want to evaluate this may be prohibitive.

There are definitely applications where FHE is currently feasible (mostly in computing statistics of encrypted data), but to evaluate the feasibility of what you want we would need to know a better description of precisely what you want to do, and for general-purpose computing the answer tends to be "it is infeasible" currently.

• Thanks for the detailed reply! I will read more into FHE. To be more precise on what i want: I want to send a word document to a server. Then I want the server to convert that document to a PDF file with a program made by me. I want this conversion to happen without/with the least possibility that the owner of the server can copy, read or crack the data on the word file. The word file is only supposed to be seen and owned by me. Sep 16 at 16:47
• I do not know in detail how a word document to pdf conversion occurs, but it is unlikely to be able to be done efficiently via FHE. If you write the program as a boolean circuit, you can attempt to use the FHEW/TFHE cryptosystem. If you write the program as an arithmetic circuit, you can attempt to use BGV/GSW/CKKS. There are a number of implementations of these you could look into (for example HElib, or SEAL), but I would overall be pessimistic.
– Mark
Sep 16 at 16:51
• Okay. Again, thanks :) Sep 16 at 17:50