Code!

To get the anonymous election code to work as showed, you need at least the following on your system:

First, initialise a database called "vote" in PostgreSQL, using this initialisation script.

Install ModToolkit.pm, the library of cryptographic routines that support the various programs.

Either copy the public key and private key that I used in the examples, or generate your own public/private key pair using rsa-keygen, an RSA key generator.

Install blindsigd, the blind signature daemon, on port 12345 on your local system by inserting the appropriate entry in /etc/inetd.conf and restarting inetd. You may want to change the $libdir and $keyfile settings in blindsigd. Make sure that the public and private keys are in the specified $libdir. You can test the daemon by telnetting to localhost, port 12345.

Run ballot.pl, the program that generates the signed, anonymized ballot. It will install this in the file ballot.txt in the current directory, and will fail to run if the file is already there, so make sure you remove it before testing, if necessary.

Install the cgi-bin programs entervote.cgi and showvote.cgi. You may need to update $libdir and $keyfile in entervote.cgi, as this program needs to have access to the public key (but not to the private key).

Run entervote.cgi to enter your vote, and run showvote.cgi to show the votes already entered in the system.