Sure! Here’s the updated version of your README where the plaintext effect has been removed after the "Project Structure" section:
This is a secure and privacy-preserving e-voting platform implemented in Python. The system supports end-to-end encryption, digital signatures, HMAC verification, and SSL-secured communication between a client and server.
- ✅ Voter registration with password hashing (PBKDF2)
- ✅ Voter authentication with secure salted hash verification
- ✅ Encrypted vote submission (AES-GCM)
- ✅ Vote integrity and authenticity via HMAC and digital signatures
- ✅ Ephemeral key exchange (hybrid encryption model)
- ✅ Secure TLS (SSL) communication between client and server
- ✅ Candidate listing and result tallying
- ✅ Thread-safe multi-client server with SQLite backend
- Python 3
sqlite3– Databasessl,socket,threading– Secure networkingpycryptodome– Cryptographic operations (AES, RSA, HMAC, PBKDF2)- Custom
CryptoManagerclass for all crypto operations
.
├── client.py # Client-side script with CLI menu
├── server.py # Server-side script with all endpoints
├── crypto_utils.py # Handles all encryption, hashing, signing
├── candidates.json # List of candidates for each position
├── certs/
│ ├── server.crt # Server certificate
│ └── server.key # Server private key
├── voters.db # SQLite DB for voters and votes
└── README.md
- Python 3.7+
pip install pycryptodomeIf you don't already have server.crt and server.key, generate a self-signed certificate:
mkdir certs
openssl req -new -x509 -days 365 -nodes -out certs/server.crt -keyout certs/server.keypython server.pyThe server starts on localhost:5000 with SSL.
python client.pyClient menu options:
- Register as a new voter
- Login using Aadhaar and password
- View available candidates
- Cast a vote
- View election results
| Mechanism | Description |
|---|---|
| Password Hashing | PBKDF2 with salt and 1,000,000 iterations |
| Vote Encryption | AES-GCM (128/256-bit), key derived via ephemeral key exchange |
| Integrity Check | HMAC (SHA-256) of ciphertext using PBKDF2-derived key |
| Authenticity | Digital signature using voter's private key |
| Transport Security | TLS with X.509 certs |
Votes are end-to-end encrypted, tamper-evident, and authentic. No plaintext votes are stored or transmitted.
The server aggregates votes per candidate per position and ensures each voter can only vote once per position.
Sample response:
{
"President": {
"Alice": 3,
"Bob": 2
},
"Treasurer": {
"Carol": 4,
"Dave": 1
}
}- Aadhaar is used as a unique voter ID (could be replaced with student ID, email, etc.)
- All communication is secured with TLS
- Private keys are only stored locally on the client
This system is intended for educational, academic, and small-scale organizational purposes. Do not use for government or large-scale elections without thorough auditing and enhancements.
Developed by [Your Name].
Crypto implementation powered by PyCryptodome.
- ✅ Admin dashboard for election management
- ✅ QR-code login
- ✅ Blockchain backend for auditability
- ✅ Vote receipt/token for voter verification
- ✅ Encrypted vote backup/recovery