TFHE: Fast Fully Homomorphic Encryption over the Torus
tfhe.github.io
tfhe.github.io
A cryptosystem that supports arbitrary computation on ciphertexts is known as fully homomorphic encryption (FHE).
Given people trust institutions, and institutions trust other institutions that trust math, from people who write the code - you have the math and the code, my question would be, which institutions can we help to get priority for trusting this?
While I am not an FHE or FE developer, as a probable end architect for solutions that will use it, the question of what makes this trustworthy is key.
You create a program, which after all is just a set of simple instructions. If you can do homomorphic add, mul and mod you have everything you need, and I believe you can work with just a few bit operations.
So you make a homomorphically encrypted program that has an encryptor en decryptor routine, themselves encrypted (and can thus safely contain a private key), and that program then does the operations requested, which does indeed get you an encrypted result.
Then you ask the encrypted program to please decrypt the answer. It can validate that question however it wants (implementing privacy policies seems like it would be a good way to do that here), and if it agrees, it decrypts the answer. There's all sorts of schemas you can build into this to do replay protection.
For the truly paranoid such a program can be created with a random encryption key that is then deleted as soon as the program is created. Then there is no trust of anyone at all. You could implement bitcoin, or a totally secure root of trust of for example the dns root zone on the internet. The only problem is that changing the program becomes impossible for anyone, which may be a good thing.
And you keep homomorphic guarantees: No need for trust. No need for trusting the CPU your homomorphic program executes on, or it's memory. NO information, not the code, not the temporary values, not the memory, not the stack ever, at any time in the program's execution, exists unencrypted.
(paraphrasing a paper that pointed out that implementing bitcoin-like systems with homomorphic encryption is very easy indeed, which is a similar problem)
* needing certain policies to be met for decryption is the field of attribute-based encryption.
* only being able to evaluate certain functions of a ciphertext to decrypted plaintext is the field of functional encryption.
* the general holy grail you're describing is program obfuscation - a secure black box that evaluates an arbitrary circuit on an input. unfortunately there are strong impossibility results in program obfuscation, though there's some theoretical progress towards weaker obfuscation or much more limited types of circuits, involving extremely inefficient mathematical wizardry that's regularly being badly broken by cryptanalysis.
in summary, you've confused FHE with program obfuscation, and the decryptor routine you describe is just bootstrapping.
Even for FHE adoption, it would be horrible if a lot if trust went into it and one popular method or implementation messed it up, ruining its reputation.
Has it been done?
CONSTANT NOT COPY NAND OR AND XOR XNOR NOR ANDNY ANDYN ORNY ORYN MUX
... so pure, combinational logic operators. You can build up some serious functions with these, yes.I don't think so, but not sure.
Any control flow program, on a set of inputs for which it terminates[0], can be, but it's not true that any control flow program, with unspecified inputs, can be, even with variables for the inputs, since the shape of the multiplication as well as the value of elements in the matrices may depend on the inputs (also, whether it's even a terminating program can obviously depend on the inputs.)
[0] and any program which always terminates can also be, though the general form may be more complex than is necessary for some inputs.
Would it perhaps be possible to create a weaker form of homomorphic encryption that could branch? It would not be strong enough for the most serious security use cases (authentication, financial, etc.) but would perhaps be usable for cases where you just want to protect data confidentiality e.g. processing PII. The processor could probably infer the structure of the running program but not necessarily its data if appropriate constant-time comparisons and other constructions were used.
Ergo, you can model anything CPUs do as a matrix.
If you wouldn't mind reviewing https://news.ycombinator.com/newsguidelines.html and sticking to the rules when posting here, we'd be grateful.
Non-terminating programs are modelled as infinitely-sized matrixes, which are obviously not computable; but neither are non-terminating programs computable in the real sense.
I built one off the same infrastructure called hideCPU. If you can create AND/XOR/NAND/etc gates _and_ feed-back output into your input, you can create a CPU.
https://github.com/mmastrac/oblivious-cpu
My goal was more to build some open prior art in the space rather than actually build a viable FHE CPU, but there's no reason why you couldn't implement one of these on top of the FHE system.
To answer some statements about FHE computing that come up over and over:
- Yes, you can loop + perform control flow in a FHE-based computer
- Yes, you can recurse in a FHE-based computer as long as you have enough emulated RAM/stack
- Yes, you can store state in a FHE computer
- No, you cannot determine if a FHE computer has reached a certain state (or halted) from the outside without decrypting the system (or at least a state bit)
- Yes, you can emulate RAM in a FHE computer
- Yes, you can emulate a HDD (well, rotating storage) in a certain FHE computer constructions
How does your implementation compare?
I am sure I had a stat for the longest path from input to output, but I'm a few years swapped out on this project.
Note that adding pipelining to a CPU drastically reduces the longest path. ShapeCPU is not pipelined at all which probably means there's a bunch of low-hanging fruit.
Because we use chisel to write CPU and we also made LLVM backend for our original CPU, your idea is not so difficult although it may be very slow. Our original CPU is about 4K gates. The most difficult point is building memory because it is most slow part. We used TFHE's LHE mode for it and this is one of the novel points of our work.
(We didn't know about Shape CPU but it seems to be similar to FURISC, which is published and using libScarab.https://eprint.iacr.org/2015/699)
Encrypted termination conditions were definitely in that implementation. The memory mux too.
By the way, I feel sad for there is no publication of ShapeCPU. I guess that this is one of the causes of FURISC paper is lacking reference for ShapeCPU.
Lots of prior art in that implementation!
Using FHE one could implement a distributed storage system, with replication, conflict resolution, error correction and so on, without ever revealing the plaintext to the storage and compute provider.
If the homomorphic encryption scheme allows for arbitrary functions to be computed, it could work for particular functions of statistical model fitting (perhaps appallingly slowly).
The output model will be encoded as cyphertext.
It would be possible to evaluate the fitted cyphertext model on new features to make predictions, also output as cyphertext.
> the library can evaluate a net-list of binary gates homomorphically at a rate of about 76 gates per second per core, without decrypting its input. It suffices to provide the sequence of gates, as well as ciphertexts of the input bits. And the library computes ciphertexts of the output bits.
AFAIK, Homomorphic Encryption which supports floating point arithmetic is not known. Fixed point one is known, CKKS. https://github.com/snucrypto/HEAAN