Fully Homomorphic Encryption (FHE) Evaluator

I wrote an FHE evaluator which you can find at https://github.com/ciphron/fhe. This software runs programs written in SCDL (see the link for compiling imperative languages to SCDL) on encrypted data. It allows you to generate a public and private key, encrypt the inputs of an SCDL program to produce a ciphertext file and evaluate the SCDL program homomorphically with a chosen ciphertext file. The FHE evaluator uses HElib in the backend, which is an implementation of the BGV scheme. When you generate a keypair, you must choose a security parameter and a maximum circuit depth to support. The former corresponds to the security strength (in bits) e.g: 128 bits. The latter comes into play because the current version of HElib does not implement bootstrapping and therefore, only circuits of bounded depth can be evaluated. The program allows you to check the depth of a circuit described in an SCDL file. Using the evaluator, you will quickly see that FHE is presently by no means practical. However you will be able to run small simple programs on encrypted data. I must point out that my implementation does not exploit the full power of the HElib library insofar as vectors are not encrypted, only single bits. This means the ciphertexts are far less compact than they could be. I hope to add vector support at a later stage. Also, the implementation probably has bugs which need to be ironed out. Email me with details if you find any. Hopefully, this program will be useful to someone for experimentation or research use.