After reading: Yup. It makes sense, so long as your resulting model is run against similarly encrypted data, the same patterns will be there for the ML to identify.
Which is, of course, one of the issues with homomorphic encryption.
After reading: Yup. It makes sense, so long as your resulting model is run against similarly encrypted data, the same patterns will be there for the ML to identify.
Which is, of course, one of the issues with homomorphic encryption.
[1] https://eprint.iacr.org/2016/421.pdf
[2] https://eprint.iacr.org/2011/277.pdf
[3] https://juliacomputing.github.io/ToyFHE.jl/dev/man/backgroun...
[4] https://juliacomputing.github.io/ToyFHE.jl/dev/man/ckks/
The person you're responding to is correct. It's an explicit design goal that a fully homomorphic encryption system would not expose any distinguishable oracle about the underlying data. Otherwise there would be no point to it whatsoever, because you'd just be performing the same computations on the data dramatically less efficiently and without any benefit.
This follows the general imperative of cryptography, which is that the outputs of cryptographically secure primitives (hash functions, pseudorandom generators, pseudorandom permutations, etc) should be computationally indistinguishable from random up to 2^n queries, for some large n (such as 128).
Look for penguin image in ECB mode. Encryption without randomness reveals the patterns! That image is highly educational and makes you think.
Also, something can be statistically random and still have patterns (see PRNGs, which are statically random (you can't identify the next value from previous values), but there's still a pattern if you know the algorithm and seed).
I'll admit, the promise of homomorphic encryption is pretty amazing, but this particular combination of data and ML seems like a fairly obvious way to leak data. I believe there's a reason that homomorphic encryption has not been broadly accepted as an allowed standard.
EDIT: So, I think I'm missing a practical example. I have a model which I want to train on data homomorphically encrypted with key X, and that model is a very simple "is this a cat". I'm given a whole set of data encrypted with key X that's tagged with "cat" and "not a cat".
Once the model is trained, I can run this on any data encrypted with key X and find out if the data contains a cat (with some degree of accuracy). I have no way of telling information outside the tags provided on the training data, but it still gives me, a person without the encryption key, the ability to identify any feature that's tagged in the training set on any un-tagged production set.
Having seen a large quantity of ML training sets, the tag sets are rarely so limited. There's also often "elephant", "ball", and "dog" tags, even if I'm only being asked to train on cats.
I get that a lack of broad acceptance is a hard thing to source, but do you have one?
It leads to block cipher standards, AES standards, and so on.
I think it's not unreasonable to say that if it should ever appear as a recommended cipher by NIST, then it can be considered to be broadly accepted.
I think you're missing the fact that the predictions come back encrypted, so you don't learn anything unless you know the key. Also, in this particular example the model was trained on unencrypted data, but as discussed below, you can do either.
Large quantities of small finite sets are anathema to encryption.
I am not sure whether this is achievable practically though.
Well, yes... Practical homomorphic encryption is cutting-edge research, and standards bodies like NIST aren't going to deal with an area like this until it's much closer to "solved" (by which I mean much more efficient, with more practical applications, widely used and scrutinized schemes, etc.)
Intuitively it may or may not make sense to people, but a proof would also clarify whether there are any caveats, limitations or other particuliarities.
What is the domain and what is the codomain? If f and C commute, then x in X is just your "data" and both the domain and codomain.
Edit:
> the top voted comment
Ah, I see that the top comment says that you use a pre-trained model. Intuitively that I think makes sense. Bot how about training the model itself?
Now the way you do machine learning here is by translating your model to use the instructions offered by HE. You've effectively recompiled the model to a new architecture.
If you'd like to read more about machine learning with homomorphic encryption, we published a paper on our CHET compiler [1]. I also talk about this space on a high level in this MSR podcast episode [2].
[1]: https://www.cs.utexas.edu/~roshan/CHET.pdf [2]: https://www.microsoft.com/en-us/research/blog/he-compilers-f...
So, since the arithmetic is secure (otherwise it wouldn't be HE), and the entire runtime pattern is fixed up front and made of nothing but arithmetic, there's no way to leak anything.
If the whole logic can be expressed as a pure function without conditionals then it would fully fit into HE.
But what if we want conditionals?
Comparison operators like (a < b), (a > b), etc go out of the question immediately as they would allow to guess the values by a simple binary search.
Equality operation (a == b) seems plausible from the security standpoint as it would not reveal the encrypted value. But there is a challenge in performing that operation because both of its arguments may be encrypted with different randomization. To overcome this, probably some neat trick could be performed but... this is the question of the future.
EDIT: Here is an idea. Some FHE engines have pre-encoded values for some magic numbers like 0, 1 and -1.
What if the equality operation p(a, b) = (a == b) is performed like this:
p(a, b) = (a + (b * -1)) == 0
Does anyone have an intuition regarding the feasibility of the proposed trick in something like Microsoft SEAL? Do both left and right parts of the comparison would have the canonicalized randomness making the equality operation possible?
P.S. On a side note, the sheer existence of an equivalence operation in FHE scheme would decimate its security by allowing to plant bruteforce attacks with a lower guesswork. Not a catastrophe by any means, and some systems would prefer that as a small price to pay for having conditionals in a program.
But instead let's say you have some register which gets rotated/xor'd in some way based on the relationship of a to b.
I don't think you can do branching logic though.
> I don't think you can do branching logic though.
You can. If we would be able to introduce a special equality operator, let's call it SEQ that works like so:
SEQ(a, b) = 1 when a == b; SEQ(a, b) = 0 when a != b
Then we would be able to do conditionals by discarding the result of unmatched branch by multiplying it by 0.
Thanks to the fact that all HE calculations are pure, no observable side effects would be produced.
For example, here is a simple program with a conditional statement:
P(x) = x == 10 ? 42 : sin(x)
This is how it may look in HE domain:
P(x) = SEQ(x, 10) * 42 + (1 - SEQ(x, 10)) * sin(x)
No branching is involved here but the result is equivalent to a program with branching. Eureka!
Once again, thank you for the fruitful suggestions.
EDIT: by the way, it paves the way for implementing > and < operators as well due to the fact that operator result remains in encrypted domain. This is a serious wow moment.
Otherwise it would be trivial to analyze and eventually crack the scheme. This is especially true for homomorphic encryption where an attacker can employ math operations to solve equations in order to reveal as much data as he/she humanly can.