Secure Voting System – OTP & Email Verified, Encrypted, One-Vote-Per-User
Verify identity via OTP to registered email, cast a single encrypted vote, and view live results. Built for colleges, organizations, and internal polls with clear audit trails.
- ✓OTP 2FA + email verification on login
- ✓AES-encrypted ballots, SHA-256 password hashing
- ✓Real-time counting, duplicate detection, admin dashboard
1. Introduction
The Secure Voting System Using OTP and Email Verification is a Python-based solution for transparent and authenticated online voting. Registered users verify identity via a one-time password sent to their email, preventing impersonation and duplicate votes. Each ballot is encrypted and stored securely, and results are visualized in real time—ideal for colleges, organizations, or internal company polls.
2. Existing System vs Proposed System
- Weak or no user authentication.
- Risk of duplicate/impersonated votes.
- No secure link between identity and ballot validation.
- Email verification + OTP-based login.
- One-vote-per-user enforcement.
- AES-encrypted ballots; SHA-256 password hashing.
- Live counting & dashboards for admins.
- Deployable for institutional/organizational polls.
3. Working
- User Registration: Name, email, unique voter ID captured.
- Login & Verification: System generates a unique 6-digit OTP and emails it to the voter.
- OTP Validation: Correct OTP grants portal access.
- Voting: Voter selects a candidate and submits the ballot once.
- Encryption & Storage: Ballot encrypted with AES and stored in SQLite.
- Result Declaration: Real-time counts, final results on poll close.
4. Technology Stack
- Language: Python
- Libraries: smtplib, random, sqlite3, hashlib, Flask/Tkinter, re
- Security: OTP-based 2FA, SHA-256 password hashing, AES for vote encryption
- Backend: SQLite3 (voters, OTPs, ballots, results)
- Frontend: Flask web UI or Tkinter desktop UI
- Optional: Email confirmations, advanced admin analytics
5. Modules
Unique voter IDs.
- Input validation
- Duplicate prevention
SMTP mailer.
- 6-digit OTP
- Expiry & retry limits
Authorize voters.
- OTP verify
- Session + CSRF
One-time ballot.
- Candidate list
- Duplicate checks
Ballot security.
- AES at rest
- Key rotation*
Live dashboard.
- Counts & charts
- CSV/PDF exports*
6. Advantages
- Strong identity checks via OTP + Email.
- Strict one-vote-per-user enforcement.
- Encrypted ballots and transparent counts.
- Automated flow that cuts manual errors.
- Scales for institutions and corporate polls.
7. Applications
- College & university elections.
- Corporate/NGO decision polls.
- Community/association voting.
- Small-scale organizational ballots.
- Secure participation in online surveys.
Python Integration Sketch (Flask + SMTP + AES)
# OTP send (SMTP)
def send_otp(email):
otp = f"{random.randint(0, 999999):06d}"
save_otp(email, otp, ttl=300) # store hashed OTP with expiry
smtp_send(email, "Your Voting OTP", f"OTP: {otp}")
# Login verify
def verify_login(email, otp_input):
if check_otp(email, otp_input): # timing-safe compare + expiry
session["voter"] = email
return True
return False
# Cast vote (single submission)
def cast_vote(voter_email, candidate_id, ballot_key):
assert not has_voted(voter_email)
payload = json.dumps({"c": candidate_id, "ts": time.time()}).encode()
enc = aes_encrypt(payload, key=ballot_key) # store encrypted ballot
db.insert("ballots", voter=voter_email, data=enc)
mark_voted(voter_email)
# Count results (decrypt or tally on write)
def count_results():
return db.query("SELECT candidate_id, COUNT(*) FROM ballots_view GROUP BY candidate_id")
What You Get
| Item | Included | Notes |
|---|---|---|
| Python Source Code | ✅ | Flask/Tkinter + SQLite |
| OTP + Email Verification | ✅ | SMTP with expiry/rate-limit |
| AES Ballot Encryption | ✅ | Key management basics |
| One-Vote Enforcement | ✅ | Duplicate detection |
| Results Dashboard | ✅ | Live counts & exports |
| Demo Video | ✅ | Setup & working walkthrough |
| Report & PPT | ✅ | College-format templates |
| Support | ✅ | Installation + viva Q&A (1 month) |
FAQs — Secure Voting System
Need a tamper-resistant voting project?
Get the Secure Voting System with code, demo, docs, and support.
WhatsApp Us Now
