Workshop on Electronic voting

Fall 2008.

Lecturer: Amnon Ta-Shma

T.A.: Tomer Levinboim, levinboim dot tomer at gmail dot com

When and where:  Tuesdays, 10:10-12:00. Kaplun 324.

Guidelines for writing the design

Background: Links to some US newspaper articles and other sources of information.





    Assigning projects.


    Design presentations I


    Design Presentations II


    Final submission



Prêt à Vote

נעמה בר-מנחם

נאור גואטה

טל גלעדי

אופיר חן

Technical report

Wiki page

Threshold encryption

דניאל מוטיל

Torben Pedersen: A threshold cryptosystem without a trusted party

Paillier homomorphic encryption.

אורן בר

אינה כץ

The original paper

ZK module

יובל ריקובר

אמיר מוגרבי

Okaloosa distance balloting pliot

טל אברהם

רונן שור

שני גרידי



Article in Popular Machanics

The version of Prêt à Vote we use: Ballots are created on the spot by the booth. Ballots have two columns as usual. The first column is randomly shifted. The second column lower entry contains the encrypted value of each entry + ZKP. The encryption is done with the public threshold key (the secret key is not known to the booth). The booth is randomly checked and then has to prove validity of the ballot and the ballot is discarded. Tallying is immediate. If ElGamal is used, the homomorphism is multiplicative, so additive values are raised to the exponent, and after threshold decryption one does brute force search on the result.

Technical references:

FAQ from past year (answers by Oded Schwartz and Ben Riva):


Should we describe the ZKP needed in our project?




What is the coverage of the design (e.g. how many pages are expected?)


The design should be such that it is clear to us (and to you) what you are going to do. It should be only a few pages long, but it should contain, for each part of your project:

- A description of the interface (UI and/or software interface, whichever is relevant).
- A short explanation of which algorithm(s) you use. If you choose from a few options explain your choice.
- What are the algorithm's main building blocks, functions and data-structures and how they interact.


How do we know for sure on which elements one may trust (e.g, maybe the public board show a copy of your vote, then later changes it to something else)?


Actually you don't. You should write in your design a short section describing the trust issue (i.e, what one has to trust so that we know the system works properly).


How do we do a non-interactive ZKP?


The method we use is called Fiat-Shamir heuristic (or method) because it is not proven (see link above). In their paper they presented a signature protocol which uses it, and on the way, they present the novel idea of using hash function instead of a challenge. That is why this paper is cited in every paper which use this method (even though it doesn't generally talk about Non-Interactive-ZKP).


Which hash should we use in practice for the non-interactive ZK signature?


I don't think it really matters which hash you use. I basically like MD5 (Pseudocode and nice info at http://en.wikipedia.org/wiki/MD5). Also, you can google "md5 implementation" and find it implemented in any language.

SHA-1 is also good (again, wiki is a good start http://en.wikipedia.org/wiki/SHA-1).

Moreover, There are many implementations of other methods like in


You just need to choose and google a little.


Is there an example of a practical use of the Fiat-Shamir paper?


There are few follow up papers which mention some theoretic problems in this method

(like - http://www.mit.edu/~tauman/fiatshamirshort.pdf), but for specific uses

(mainly signatures or voting protocols) it is common to use it (like CGF97).


How can we generate a large prime with the respective generator?


Corrected answer:

Finding general large primes and generators is not an easy task, but, finding a specific kinds is an easier problem.

Usually we use p = 2q + 1 as our primes (where p,q are primes), and then we can find a generator by:

while 1

choose a random number x

if x^2 != 1 (mod p) and x^q != 1 (mod p)

return x

See, for example, slides 5-6 at:



We have problems finding libraries which support large numbers on the one hand, and UI on the other hand, and can be easily compiled together.


A few suggestions:
For Java: IIRC Java has it's own, built-in BigNumber library.

For C/C++ programs, you may want to use the GMP library.

Unfortunately, it doesn't compile all that well with MSVC (it is possible, but really it's a lot easier to use on linux/unix systems).

To make the UI programming easier, You may use a web-based solution: the UI is programmed in PHP. PHP has modules for GMP and MySQL databases, and it's very easy to learn (especially if you already know C or Java). The only glaring omission is secure random number generation.

If you run the webserver on linux, you can bypass that by reading from

/dev/random or /dev/urandom.  You can see an example server at

where there is also a link to the source code. Other suggestions are Crypto++ and MIRACL. You may also search for “big integers” on google.