This module implements the re-encryption mix-net presented by Fauzi et al. in their paper: "A Shuffle Argument Secure in the Generic Model".
The motivation behind this implementation is to replace the mix-net used by the e-voting application, Zeus in favor of a faster one. However it can be used by anyone that needs a mix-net implementation. That is, apart from e-voting, the mix-net can be used for other tasks such as surveys and the collection of data from various IoT (Internet of Things) devices.
The implementation was based on an existing prototype of the same re-encryption mix-net.
The module requires Python 2.7.
- Install libsnark following the instructions on its GitHub page.
- Install libff following the instructions on its GitHub page.
- Install package dependencies
sudo apt-get install python python-pip
- Install Cython
pip install cython
We faced some issues while installing libff and libsnark on Ubuntu 16.04 LTS. If the installation process doesn't work try the following:
- Install libsnark on
/usr/
with
make install PREFIX=/usr
after compiling it.
- After installing libff, inside the cloned repo copy the third party libraries to the local includes.
cp -R depends /usr/local/include/
-
Add to the libff library (before compiling it) the
-fPIC
flag on CMakeLists. Specifically on theCMakeLists.txt
file add-fPIC
to the existing flags onCMAKE_CXX_FLAGS
andCMAKE_EXE_LINKER_FLAGS
. -
In order to avoid libff outputting profiling info change the variables
inhibit_profiling_info
andinhibit_profiling_counters
totrue
onlibff/common/profiling.cpp
before compiling the library.
Inside the libffpy folder run:
python setup.py install
On the root directory run:
python setup.py install
The mix-net proposed by Fauzi et al requires elliptic curve computations. A suitable library that provides support for elliptic curve computations is libff.
Since libff is implemented in C++ we used Cython to create a wrapper
for some of the features of libff. The Cython wrapper can be found in
the folder libffpy
. While not a complete wrapper, it can be
used independently by anyone that needs the features provided by
libff.
The curve we used is bn128 and libff implements the ate pairing for its bilinear pairing computations.
The mix-net is implemented using Python. It requires a working installation of libffpy.
-
Elliptic Curve Multiplications: The real bottleneck of the prototype is its performance. The prototype's performance was much slower than other implementations in C++. After some specific metrics we identified that the issue was that the multiplications on the elliptic curve elements were slow. The library implementing those multiplications was bplib.
-
bplip vs libff: Since the bottleneck were the multiplications on the elliptic curve, we looked at replacements for bplib. One such replacement is libff. bplib uses libraries provided by OpenSSL for its elliptic curve computations. We defined specific metrics and compared the underlying C code of bplib with libff. The results showed that libff was indeed faster than OpenSSL, so we moved forward with the implementation of libffpy.
-
CRS (Common Reference String): In order for the mix-net to be truly decentralized and anonymous there needs to be a mechanism to create the CRS anonymously.
-
Integration with Zeus
There exists a demo in the file demo.py
of the root directory
that shows the basic workflow of the mix-net module.
This project was developed as part of the Google Summer of Code program.
Student: Vitalis Salis
Mentors:
- Dimitris Mitropoulos
- Georgios Tsoukalas
- Panos Louridas
Organization: Open Technologies Alliance - GFOSS