            
An example implementation of an e-voting system using Paillier's homomorphic encryption. To ensure that the malleability property of the Paillier system is not abused to provides false votes a Zero Knowledge Interactive Proof (ZKIP) is utilized. The ZKIP agent (BB_and_EM.py) is currently running on the same remote server as the MySQL DB. This system is cross platform by utilizing Python and GTK. ###Features: ####Admin mode:
- Authentication as an an administrator to the MySQL backend utilizes SHA256 passwords
- Add/Delete Candidates for Election
- Add/Edit/Delete/Find voters
- Calculate election results
- About Menu
- Demo version administrator credential user: evoting_admin pass: testTEST0192)!(@
####Polling Station mode:
- Connection to MySQL database backend is encrypted (email franck6@rpi.edu for requisite ca.pem, ca.key, and ca.cert files)
- Connection between polling station and Election Registrar (EM) that engages in ZKIP is encrypted with TLS.
- Votes are encrypted utilizing the Paillier's homomorphic public key system so that identical votes are indistinguishable from each other.
- Utilizes
- Double click EVoting-CSCI6320-FDE.msi
- Will install to C:\Program Files(x86)\EVoting-CSCI6320-FDE
- Copy ca.pem, ca.key, ca.cert to C:\Program Files(x86)\EVoting-CSCI6320-FDE\
- To use in admin mode right click “main.exe” and choose “Run as Administrator”
- To use as a polling station, run “main.exe” in user mode.
- Clone git repo
- Copy ca.pem, ca.key, ca.cert into crypto_evoting
- To run in admin mode: sudo python3 main.py
- To run in polling station mode: python3 main.py
- TODO
- Install Python 3.4
- NOTE: will not compile with Python 3.5
- Add python install directory to PATH
- C:> PATH=$PATH;<Python 3.4 install dir>
- Install PyGI AIO 3.18
- Select GTK, Pango, and Glade as install options.
- For a dev environment, selecting "DevHelp" is recommended
- Select GTK, Pango, and Glade as install options.
- Install cx_Freeze, phe, pycrypto from python pip
- python -m pip install cx_Freeze
- python -m pop install phe
- Read about phe and it's pallier implementation https://python-paillier.readthedocs.io/en/stable/
- Install MySQL python connector
- Clone repo
- To run from python source ("dev environment")
- python BB_and_EM.py
- This runs the ZKP agent in the background, can also change IP address to 159.203.140.245
- python main.py
- python BB_and_EM.py
- To build
- python setup.py build
- exe will be in build/ folder
- To build installer (msi)
- python setup.py bdist_msi Note: .msi will be in bdist*/
Linux:
- Install dependencies
- Install MySQL connector
- Install phe, cx_Freeze, pycrypto (python3 -m pip install ...)
- To run from source
- python3 BB_and_EM.py &
- This runs the ZKP agent in the background, can also change IP address to 159.203.140.245
- python3 main.py
- python3 BB_and_EM.py &
- To build (TODO)
- python3 setup.py build
- To run from source
- Installer (TODO write setup.py for linux)
Mac:
- ?
setup.sql
CREATE DATABASE evoting;
USE evoting;
CREATE TABLE registered_voters (voter_id BIGINT, first_name CHAR(60) NOT NULL, middle_name CHAR(60) NOT NULL, last_name CHAR(60) NOT NULL, suffix CHAR(4), address VARCHAR(80) NOT NULL, birth DATE NOT NULL, ssn VARCHAR(11), has_voted BOOL, PRIMARY KEY (voter_id));
CREATE TABLE candidates (pres_name VARCHAR(100) NOT NULL, vp_name VARCHAR(100) NOT NULL, party VARCHAR(60) NOT NULL, c_id TINYINT AUTO_INCREMENT NOT NULL, PRIMARY KEY (c_id));
CREATE TABLE votes (voter_id BIGINT NOT NULL, ctxt VARCHAR(1400) NOT NULL, c_id TINYINT NOT NULL, PRIMARY KEY (voter_id, c_id));
CREATE TABLE private_key (lambda VARCHAR(1400), mu VARCHAR(1400));
CREATE USER evoting_admin;
GRANT INSERT, DELETE, SELECT, UPDATE on evoting.candidates TO evoting_admin;
GRANT INSERT, DELETE, SELECT, UPDATE on evoting.registered_votersTO evoting_admin;
GRANT SELECT ON evoting.votes TO evoting_admin;
CREATE USER read_candidates;
GRANT SELECT ON evoting.candidates TO ‘read_candidates’;
GRANT INSERT ON evoting.votes TO ‘read_candidates’;
GRANT SELECT (voter_id, first_name, middle_name, last_name, suffix, has_voted) ON evoting.registered_voters TO ‘read_candidates’;
GRANT SELECT ON private_key TO 'evoting_admin';
GRANT SELECT (ctxt, c_id) ON votes TO 'evoting_admin'