Score:2

Given a program, obtain a program that can operate on encrypted data

in flag

Suppose I have a program $P$. I would like to obtain an encryption function $e$, a decryption function $d$, and a program $Q$ such that $P(x) = d(Q(e(x)))$ for all inputs $x$. Ideally, the encryption would be asymmetric ($d$ cannot be obtained from $e$).

This would allow making a decentralized computing platform similar to Ethereum, but where contracts can store private data, only accessible by those with the decryption key.

Does something like this exist?

Manish Adhikari avatar
us flag
There are such things called homomorphic encryption schemes. You can check them out.
fgrieu avatar
ng flag
You would need to restrict what $P$ can do. Good luck if it's e.g. a program that outputs if $x$ is prime.
SEJPM avatar
us flag
The requirement in question does look a lot like the correctness property of fully homomorphic encryption.
fgrieu avatar
ng flag
@SEJPM: Yes it _looks_ like a requirement for fully homomorphic encryption. But wouldn't FHE as we know it limit $P$ to be a polynomial function of $x$; and then in a particular finite field? For general-purpose program $P$, zk-SNARK comes to mind, but I'm uncomfortable with these, thus will not attempt an answer.
SEJPM avatar
us flag
@fgrieu without having checked I'm 95% sure that you can formulate arbitrary (arithmetic) circuits with most FHE schemes (in the given field of course) which should allow you to formulate arbitrary computations (using a circuit) and not just polynomials.
fgrieu avatar
ng flag
@SEJPM: at some level of theory, there's no difference between "polynomial .. in a particular finite field" and "arbitrary (arithmetic) circuits.. in the given field". If the field has order $n$ it's easy to make a poly of degree $n-1$ that evaluates to 1 at a specified point, and to 0 at all others; and from that build a poly of degree $n-1$ for any function. So I agree with what you are 95% sure, both in theory, and in practice for small fields. But I have much doubt for practice and large field. If the question gave an idea of what it wants to compute, that would help...
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.