ibarrond / Pyfhel

PYthon For Homomorphic Encryption Libraries, perform encrypted computations such as sum, mult, scalar product or matrix multiplication in Python, with NumPy compatibility. Uses SEAL/PALISADE as backends, implemented using Cython.
https://pyfhel.readthedocs.io/
Apache License 2.0
486 stars 78 forks source link

Support for Java? #138

Closed macknight closed 2 years ago

macknight commented 2 years ago

I see this repo's backend(seal, palisade) mainly is composed of C++ code. So why isn't this repo be written in Java? What's the considerations for coding languages?

BR

AlexanderViand commented 2 years ago

Most advanaced cryptographic software is written in languages like C / C++ or modern alternatives like Go or Rust because they perform lots of numerical computations requiring low-level optimizations. Java just isn't efficient enough for these applications.

If you're asking why Pyfhel isn't written in Java: It's because Python is a much, much more accessible language/ecosystem and there's huge demand for exposing C/C++ FHE libraries in Python but, afaik, virtually none to do so for Java.

ibarrond commented 2 years ago

Python is, as of today, the default language for Data Science and one of the top languages for the newcomer software developers, with a much flatter learning curve compared to Java. As such, writing Pyfhel in Python aims to:

I'll finally add that the most used Python interpreter (CPython) is written in C, and thus there is already a natural relation between Python & C++, strengthened by tools/metalanguages like Cython/pybind11/CFFI/ctypes. Instead, Java runs in the JVM and uses completely different compiler toolchains.