Package viff
[hide private]
[frames] | no frames]

Package viff

source code

Virtual Ideal Functionality Framework.

VIFF is a Python framework for writing multi-party computations (MPC) in an easy, efficient, and secure way.


VIFF allows you to write a program which will interact with other programs in order to execute a joint computation. This is called a multi-party computation, MPC for short.

The programs will implement what we call a virtual ideal functionality (IF). The idea is that the behavior of the programs should be indistinguishable from the behavior of programs interacting with a so-called ideal functionality. An ideal functionality is a player that cannot be corrupted, also known as a trusted third party (TTP).

Interacting with an IF is easy: all players give their inputs to the IF, which computes the results. The results are then distributed to the correct players. The inputs and the results are sent over secure channels, and since the IF cannot be corrupted, this ideal protocol must be secure.

In the real world there is no IF, but VIFF allows you to implement a virtual ideal functionality. The behavior of a bunch of programs using VIFF is indistinguishable from program running in the ideal world. It is indistinguishable in the sense that everything that can happen in the real world protocol could happen in the ideal world too. And since no attacks can occur in the ideal world, no attacks can occur in the real world as well. Such a multi-party computation (MPC) is called a secure multi-party computation (SMPC).

Security Assumptions

Please note that like all cryptographic systems, VIFF is only secure as long as certain assumptions are fulfilled. These assumptions include:

The precise assumptions for each protocol will eventually be included in the documentation for the corresponding method, but this has not yet been done.


VIFF consists of several modules. The passive and active modules contain the PassiveRuntime and ActiveRuntime classes in which the main functionality is implemented. The runtime module contain the Share class and other infrastructure for the two runtime classes. The field module contains implementations of finite fields --- these are the values inside the shares. Other modules provide support functions.


The main functionality in VIFF is implemented in the PassiveRuntime class. This class offers methods to do addition, multiplication, etc. These methods operate on Share instances.

Shares hold either field.GF or GF256 elements and are created from the shamir_share or prss_share Runtime methods. Shares overload the standard arithmetic operators, so you can write a + b - c * d with four shares, and it will be translated correctly into the appropriate method calls on the Runtime instance associated with the shares.

A field element contain the concrete value on which we do calculations. This is just a normal Python (long) integer. The value is wrapped in an object that will keep track of doing modulo reductions as appropriate.

So in a nutshell, VIFF has these layers:

Getting into VIFF

As explained above, the main functionality in VIFF is the PassiveRuntime class, so please start there. Also, be sure to checkout the example applications distributed in the apps directory.

Author: VIFF Development Team

See Also:

Version: 0.7.1

License: GNU LGPL

Submodules [hide private]

Functions [hide private]
Get the full release number.
source code
Function Details [hide private]


source code 

Get the full release number.

If Mercurial is available, "hg identify" will be used to determine the state of the repository and a string of the form ``x.y-hash`` is returned where ``hash`` is the changeset ID or tag. If the tag is the same as ``__version__``, then ``__version__`` is simply returned.