This project is a prototype built for demonstration purposes.
- Contains hardcoded configurations (e.g., database path)
- Uses local TCP communication without encryption
- Not production-ready
- Intended to demonstrate Shamir Secret Sharing in a voting system
Future improvements include security enhancements, database abstraction, and deployment-ready architecture.
A small local demo of a privacy-preserving voting system that uses a 2-of-3 Shamir Secret Sharing scheme to split votes into shares stored on three tally servers. Includes a Tkinter-based Voter GUI and Admin GUI, plus simple local TCP services for registrar and tally servers.
- Python 3.8 or newer (3.10+ recommended)
- No external pip packages required — uses Python standard library modules (tkinter, sqlite3, socket, threading, json, secrets, hashlib, etc.)
voter_gui.py— Voter-facing Tkinter GUIadmin_gui.py— Admin console GUIvoting_coordinator.py— Orchestrates splitting votes & contacting serversregistrar.py— Registrar service (token issuance/validation)tally_server.py— Tally server (stores shares)database.py— SQLite database wrapper and schemashamir_secret_sharing.py— Shamir sharing & reconstructionmain.py/start.py— Two startup options (multi-process vs threaded)DOCUMENTATION.txt— Detailed project documentation
Option 1: Threaded servers + GUI (recommended for local testing and packaging):
python .\start.pyRuns registrar and tally servers in background threads within the same process using ThreadedVotingSystem.
Ideal for local testing and packaging as a single Windows EXE.
Option 2: Multi-process launcher (opens servers in separate consoles):
python .\main.pyStarts each server in a separate console window using subprocess. Useful for Windows development when
you want to see individual server logs.
Option 3: Run components individually for debugging:
python .\registrar.py
python .\tally_server.py 1
python .\admin_gui.py
python .\voter_gui.py- Database: SQLite file
voting_system.dbis created in the working directory on first run. - Default admin:
username=admin,password=admin123(created on first run; password stored as PBKDF2 hash). - Default candidates: Three default candidates are seeded on first run.
- Field constraints: Voter names, candidate names, and usernames are limited to 16 characters.
- Password hashing: Admin passwords are stored using PBKDF2-SHA256 with automatic migration of any existing plaintext passwords.
- GUI styling: Both voter and admin GUIs use a custom professional blue color palette.
- No external dependencies: Project uses only Python standard library modules.
- Optional libraries: See
requirements.txtfor optional password hashing libraries (bcrypt, argon2-cffi) if stronger hashing is desired.
- This is a prototype/demo project. NOT production ready.
- For production, implement: TLS encryption, mutual authentication, stronger credential schemes, and encrypted database fields.
- Currently all servers run on localhost with no network authentication.
- This is a student/demo project. To contribute, add unit tests for
shamir_secret_sharing.py,database.py, andvoting_coordinator.py.