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 CodeFlask/Tkinter + SQLite
OTP + Email VerificationSMTP with expiry/rate-limit
AES Ballot EncryptionKey management basics
One-Vote EnforcementDuplicate detection
Results DashboardLive counts & exports
Demo VideoSetup & working walkthrough
Report & PPTCollege-format templates
SupportInstallation + 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
Open chat
Need help in Admission?
Hello! 👋 Welcome to Tour2Tech Academy!

We’re here to help you succeed in your engineering journey with:

🌟 Final Year Projects
🎯 College Admission Consultancy
📚 Career Guidance and Skill-Building Courses

How can we assist you today? Whether you need help with a project, are looking for career guidance, or want to know more about our services, we’re just a message away! 😊