The Secure Voting System Using OTP and Email Verification

Secure Voting System using OTP & Email Verification (Python) | Tour2Tech
Home / Projects / Secure Voting (OTP + Email)
LIMITED OFFER
Get up to β‚Ή1,000 OFF
Use coupon MYProject when you book via WhatsApp/Call. We don’t sell online.
Python β€’ Flask/Tkinter β€’ SMTP β€’ AES β€’ SQLite

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
Delivery in 3–5 days β€’ Pan-India support
*Demo video placeholder. Replace with your link.
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
Existing System
  • Weak or no user authentication.
  • Risk of duplicate/impersonated votes.
  • No secure link between identity and ballot validation.
Proposed System
  • 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
  1. User Registration: Name, email, unique voter ID captured.
  2. Login & Verification: System generates a unique 6-digit OTP and emails it to the voter.
  3. OTP Validation: Correct OTP grants portal access.
  4. Voting: Voter selects a candidate and submits the ballot once.
  5. Encryption & Storage: Ballot encrypted with AES and stored in SQLite.
  6. 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
User Registration

Unique voter IDs.

  • Input validation
  • Duplicate prevention
OTP & Email

SMTP mailer.

  • 6-digit OTP
  • Expiry & retry limits
Authentication

Authorize voters.

  • OTP verify
  • Session + CSRF
Voting

One-time ballot.

  • Candidate list
  • Duplicate checks
Encryption

Ballot security.

  • AES at rest
  • Key rotation*
Results & Admin

Live dashboard.

  • Counts & charts
  • CSV/PDF exports*
*Optional based on institute requirements.
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")
              
Delivery includes OTP flow with expiry/rate-limit, SHA-256 password hashing, AES-encrypted ballots, CSRF/session hardening, SQLite schema, Flask/Tkinter UI, and result charts.
What You Get
ItemIncludedNotes
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

No. Ballots are encrypted and stored separately from voter identities. Admins see aggregate counts and audit logs, not voter-to-choice mapping.

OTPs have short expiry and limited retries. Users can request resend after a cooldown; admins can whitelist domains to improve deliverability.

Yes, for OTP email delivery and remote dashboards. The system runs locally otherwise; ballots and results are stored in SQLite.

Need a tamper-resistant voting project?

Get the Secure Voting System with code, demo, docs, and support.

WhatsApp Us Now

Leave a Comment

Shopping Cart
Scroll to Top