Our Application Program Interface (API): there are only a few things to it... (Step 3 is the trickiest.)

You are only a few steps away from running secret and verifiable elections over the Internet. You'll be surprised at how easy an election is to set up and to vote in!

When you run an election you, of course, only want people associated with your organisation to vote and you want to make sure they only vote once. Well, authenticating the voters we leave to you but making sure they only vote once we do for you. Don't worry, as you are running a website, extranet or intranet where users already log in we will make things as easy as possible for you by using that for voting as well. You don't have to do any extensive programming and you definitely do not have to give us your database of passwords, the EasiestElection system is much more clever than that.

In short you start an election by doing the following. Step 1, define your election. Use our system to set up the races (contended positions or issues) and candidates in your election. Step 2, download a Java applet and store it on your server. Step 3, put a few lines of code on your system. Step 4, the election opens and closes automatically. Step 5, count the votes. Step 6, announce the winner(s).

Step 1: Define your election

Using our election creation tool whilst logged in to your control panel you can easily select the races (contended positions) in your election and the candidates (options) associated with these. You select a starting date and time for the election and when you are finished you click the [Lock] link to create the Java applet that your voters will use.

Step 2: The java applet

When the java applet is created you have to show this to your voters. Simply download this applet from our server and put the it in the same web folder as the .html document or script that is displayed to your voters and place the following code in the HTML:

<APPLET CODE="EasiestElection.class" WIDTH=500 HEIGHT=400 ALT="You must have Java Applets available in your browser to vote.">You must have Java Applets available in your browser to vote.</APPLET>

Step 3: The code

This step is definitely the trickiest but it is completely necessary because we want to authenticate the voters in whatever method you already use.

First you must make it possible for the applet to submit the vote that it helps the voter to create. The following form you must put within the <body> element of the page that shows the voting applet.

<form action="easiestelection_submit_vote.php" method="post" name="easiestelection_form"><input type="hidden" name="vote" value=""></form>

In the next step you will create or install a script on your web server, in this exemple the script is named easiestelection_submit_vote.php and if you name it differently or use a different scripting language you must change this.

For the vote to be accepted into the database by our server, you must sign it using your API key (remember to keep your API key secret!) and this can only be done in a server-side script. Here is a PHP script which you can name easiestelection_submit_vote.php to make it work with the form code above.

/* These values you must set yourself! */
$ee_api_key = "ABC123";
$ee_voter_id = 1;

/* These you probably don't have to change */
$ee_server_url = "http://vote.easiestelection.com/submit.php";
$ee_vote = $_POST["vote"];
$ee_hash = sha1($ee_voter_id . $ee_vote . $ee_api_key);
$ee_submission = "voter=$ee_voter_id"
              . "&vote=$ee_vote"
              . "&hash=$ee_hash";







Step 4: Election time

Make sure you only show the page containing the applet to your voters when the election is open. Otherwise the voter will get an error message saying that the election has not yet started or has closed when she tries to cast her vote. Provided that you do this the election is now running and voters are able to cast their votes.

Step 5: Count the votes

When the election has closed you can go to the election control panel and initiate the decryption and tallying process. The election is then decrypted (this process anonymises the votes so that no-one can tell how individual voters have voted) and the result is displayed.

Step 6: Announce the winner(s)

It's now your job to let the voters know who has won. If you want you can simply ask them to have a look at vote.easiestelection.com where the result is automatically published.


    • Please note that EasiestElection.com is still in a non-functional beta mode. Check back regularly to track our progress.
  • The Easiest Election

    • EasiestElection helps campanies, organisations, online communities and anyone else to run secret, verifiable elections over the Internet. We provide an API which allows you to run the election on your website whilst benefiting from the security of the EasyElection system. In most cases you only need to add a few lines of code to get going!