Implementation of a Re-Encryption Mix-Net
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
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
-fPICflag on CMakeLists. Specifically on the
-fPICto the existing flags on
In order to avoid libff outputting profiling info change the variables
libff/common/profiling.cppbefore 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
libffpy. While not a complete wrapper, it can be
used independently by anyone that needs the features provided by
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.
Student: Vitalis Salis
Organization: Open Technologies Alliance - GFOSS