0% found this document useful (0 votes)
6 views

Blockchain Based voting system

The document presents a project titled 'Blockchain Based Voting System' by Abhishek Kumar as part of his M.C.A in Data Science. It outlines the project's objectives to create a secure, transparent, and tamper-proof voting process using blockchain technology, addressing issues like voter fraud and manipulation in traditional voting methods. The document includes acknowledgments, declarations, system design, requirements analysis, algorithms used, and milestones for project completion.

Uploaded by

abhishekji9651
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

Blockchain Based voting system

The document presents a project titled 'Blockchain Based Voting System' by Abhishek Kumar as part of his M.C.A in Data Science. It outlines the project's objectives to create a secure, transparent, and tamper-proof voting process using blockchain technology, addressing issues like voter fraud and manipulation in traditional voting methods. The document includes acknowledgments, declarations, system design, requirements analysis, algorithms used, and milestones for project completion.

Uploaded by

abhishekji9651
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 49

BLOCKCHAIN BASED VOTING SYSTEM

Research/Development Based
Project Phase Two

M.C.A(Data Science)
II Semester
SUBMITTED BY

ABHISHEK KUMAR
Batch Year:-2021-2026
Enrollment No:-U2144045
Under the Supervision of:- Dr.FARHA

Centre of Computer Education & Training


Institute of Professional Studies
University of Allahabad, Prayagraj
Uttar Pradesh
ACKNOWLEDGEMENT
I would like to take this opportunity to express my gratitude to everyone who has supported me in
completing this project. The completion of this project is no doubt a product of invaluable support
and the contribution of number of people.
I would like to express sincere gratitude to Professor Ashish Khare, the Co-ordinator of the
Centre of Computer Education and Training at the University of Allahabad.
Foremost, I would like to thank my project supervisor Dr. Farha (Centre of Computer Education
and Training, Institute of Professional Studies, University of Allahabad) and also thanks my project
in-charges Dr. Sarika Yadav and Ms. Sunita Tripathi and Entire CCET staff for continuous help
and valuable suggestions and providing encouraging environment, without which project and this
documentation would not have been possible.
I am also grateful to my family and friends for their constant support and motivation, which has
kept me going throughout the project. Their belief in me and my abilities has been a source of
inspiration and encouragement.

Date:- 05-05-25 ABHISHEK KUMAR

Place:IPS,CCET,UoA,Prayagraj (Enrollment No:-U2144045 )

(i)
DECLARATION

I hereby declare that the project titled "BLOCKCHAIN BASED VOTING SYSTEM" is
an original work undertaken by me as part of M.C.A (Data Science) at Centre Of
Computer Education and Training. The project has not been submitted for any other
degree or diploma at any other Institution. I further declare that all the sources of
information, data, and references used in this report have been duly acknowledged, and
any contributions from others have been clearly identified.

Date:- 0 5 -05-25 ABHISHEK KUMAR


Place: IPS, CCET, UoA, Prayagraj (Enrollment No:-U2144045)

(ii)
CERTIFICATE
This is to certify that the project titled "BLOCKCHAIN BASED VOTING SYSTEM" has
been completed by Abhishek Kumar(Enrollment No:U2144045), as part of the
requirements for the M.C.A(Data Science) at Center Of Computer Education and
Training.
The project presents proper care and shown most sincerity in completion of this project.
I certify that his work in this project as per the guidelines. This project is original and
is never submitted somewhere else for this same purpose.

Date:- 0 5 -05-25 Dr. FARHA


Place:-IPS, CCET, UoA, Prayagraj (Project Supervisor)

(iii)
Table Of Contents

Sr. No. Contents Page No.


Acknowledgement (i)
Declaration (ii)
Certificate (iii)
Synopsis (iv)
1. Introduction 1-3
1.1 Problem Definition
1.2 Motivations
2. Objective 4
3. Requirement Analysis And Specifications 5-8
3.1 Functional Requirement
3.2 Non-Functional Requirements
3.3 Technical Requirements
3.4 Software & Hardware Requirements
4. System Design 9-10
4.1 DFD(Data Flow Diagram)
5. Algorithm Used 11-12
6. Development & Testing 13-14
7. Project Codes 15-19
8. Screenshot of App 20
9. Conclusion 21
10. Future Scope 22
11. Milestones 23
12. Meetings With The Supervisor 24
13. Bibliography & References 25
14. Plagiarism Report 26
SYNOPSIS
Table Of Content

1. INTRODUCTION ................................................................................................... 1-3


1.1 Problem Definition
1.2 Motivation
2. OBJECTIVES............................................................................................................. 4
3. REQUIREMENTS ANALYSIS AND SPECIFICATION ...................................... 5-8
3.1 Functional Requirement
3.2 Non-Functional Requirements
3.3 Technical Requirements
3.4 Software & Hardware Requirements
4. SYSTEM DESIGN................................................................................................... 9-10
4.1 DFD (Data Flow Diagram)
5. ALGORITHM USED ............................................................................................. 11-12
6. DEVELOPMENT & TESTING .............................................................................. 13-14
6.1 Development Phase
6.2 Testing Phase
7. MILESTONE ............................................................................................................... 15

8. MEETING WITH SUPERVISOR ............................................................................... 16


1. INTRODUCTION

Project Title: Blockchain Based Voting System


Category: Blockchain Technology
In today’s Elections are an important part of democracy, allowing people to choose their
leaders and make decisions. However, traditional voting methods, like paper ballots and
electronic machines, have many problems. Blockchain is a decentralized technology that
stores information in a way that cannot be easily altered. Each vote in a blockchain
voting system is recorded as a block in a digital ledger, which is visible to all authorized
participants. This prevents any manipulation or fraud, ensuring that every vote is counted
correctly. Unlike paper-based or electronic voting machines, blockchain allows real-time
verification while maintaining voter privacy.
The This project aims of a blockchain based voting system is to create a secure,
transparent, and tamper- proof election process. Traditional voting methods, such as
paper ballots and electronic voting machines, often face issues like voter fraud,
miscounting, and manipulation. This project aims to solve these problems by using
blockchain technology to ensure fairness and trust in elections.

1
1.1 PROBLEM DEFINITION

The problem of traditional voting systems, whether paper-based or electronic, face several
major challenges that affect the fairness and security of elections. These challenges include
vote tampering, lack of transparency, voter fraud, and long processing times. In many cases,
election results can be manipulated by altering vote counts, hacking electronic voting
machines, or preventing certain voters from casting their votes. Additionally, manual vote
counting is slow and prone to errors, leading to delays and disputes in announcing results . This
system Electronic voting machines and online voting systems can be hacked, allowing attackers
to change vote counts or steal voter information. Protecting election data from cyber threats is
becoming more difficult, especially as technology advances. Many people worry that
unauthorized individuals or foreign entities could influence elections by hacking into voting
systems.
.

Key Challenges:
1. Voter Privacy vs. Transparency: Balancing the transparency of blockchain with
the need to keep individual votes anonymous.
2. Scalability: Handling a large number of voters and transactions without performance
issues.
3. Voter Authentication: Ensuring that only eligible voters can vote and preventing
duplicate voting.
4. Security: Protecting the system from cyber-attacks, including Sybil attacks and
denial-of-service (DoS) attacks.
5. Trust and Adoption: Gaining public trust and encouraging widespread adoption of
a new digital voting method.

2
1.2 MOTIVATION

The main motivation behind creating a blockchain-based e-voting system is to improve the
way elections are conducted by making them more secure, transparent, and trustworthy.
Traditional voting methods often face issues like vote tampering, hacking, fraud, and lack
of public trust. These problems can lead to unfair results and make people lose confidence
in the voting process.
The motivation behind this project is Blockchain technology offers a powerful solution to
these issues. It records each vote in a way that cannot be changed or deleted, ensuring that
every vote is counted fairly. This builds trust among voters, as they know their votes are
safe and secure. The use of smart contracts also helps to automate the process, making it
faster and free from human errors.

3
2. OBJECTIVES

The objective of a blockchain-based voting system is to provide a secure, transparent, and


tamper-proof platform for conducting elections. It ensures voter authenticity, prevents
fraud, and allows real-time vote tracking with immutable records .

4
1. REQUIREMENT ANALYSIS AND SPECIFICATION

1.1 Functional Requirements

1. Voter Login: Registered users can log in using their credentials.


2. Vote Recording on Blockchain: Votes are stored in a blockchain structure to ensure
transparency and immutability.
3. Vote Counting: Votes can be retrieved in real-time for administrative viewing.
4. Admin Login: Admin session is securely managed and restricted to authorized access.

5
1.2 Non-Functional Requirements

1. Performance:- The system should load quickly and provide a smooth, the
blockchain should synchronize across nodes in real-time.

2. Transparency:- Every transaction (vote) must be traceable on the blockchain.

3. Interoperability:- The system should support integration with, Ethereum


blockchain, MetaMask wallet, Future options like IPFS, Hyperledger, or biometric
APIs.

4. Usability:- The user interface should be intuitive and easy to navigate for users of
all ensuring a seamless experience.

5. Reliability:- The system should be highly available and resilient, with minimal
downtime to ensure a consistent user experience.

6. Security and Privacy:- Implement measures to protect user data and ensure
compliance with data protection regulations.

7. Maintainability:- Code should be modular and well-documented for easy updates


or fixes.

8. Interoperability:- The ability to work seamlessly with other software and hardware
platforms.

9. Cost-Effectiveness:- The system should be affordable to ensure widespread


adoption.

10. Accessibility:- The design must consider users with varying abilities and provide
features that enhance usability for all.

6
1.3 Technical Requirements

 Python: For Blockchain Technology.


 Web Framework: Flask for building the web application.
 Libraries:
 Flask: Web framework to build the backend.
 json: To store or transfer data in a readable format.
 HTML/CSS: To design the user interface (registration, voting, results pages).

 Hashlib: To apply SHA-256 hashing to blocks in the blockchain.

 Uuid: To generate unique IDs (for voters).

7
1.4 SOFTWARE & HARDWARE REQUIREMENTS

Hardware Required
Processor : Intel Core i5 or higher
Camera : Resolution minimum 720p

RAM : 16GB or higher

Storage : 512GB HDD OR SSD

Operating System : Windows 10

Software Required

Backend : Python,Flask.

Frotend :HTML,CSS.
Graphics/3D design : Blender, Unity.
IDE : Visual Studio Code.
Browser : Chrome, Mozilla, Edge, Brave

8
2. SYSTEM DESIGN

2.1 Data Flow Diagram

LEVEL 0

9
LEVEL-1

Complete Virtual Styling Data Flow Diagram

10
3. ALGORITHMS USED

Algorithms Used in blockchain based voting system:

The In a blockchain-based voting system, the primary algorithm used isn't just a single
standard algorithm like in encryption or sorting, but rather a collection of mechanisms that
together simulate blockchain behavior for secure, transparent, and tamper-proof voting.
Below is a detailed breakdown of the algorithms employed:

1. Hashing Algorithm
 Purpose: To ensure data integrity and link blocks.
 Implementation: Typically, SHA-256 (Secure Hash Algorithm 256-bit)
 Process:
o Each block contains a hash of the previous block.
o This links blocks together, forming a chain.
o If any vote is tampered with, the hashes break, making it detectable.

2. Block Creation Algorithm


 Purpose: Add a new vote as a block in the blockchain.
 Process:
o Collect vote details (voter ID, party, time).
o Hash the previous block.
o Add new block with current data + previous hash.

3. Consensus Algorithm
 Purpose: In real blockchains (like Ethereum), consensus algorithms like Proof of Work
or Proof of Stake ensure that everyone agrees on the current state of the blockchain.

11
 Process: It’s a centralized system, so you don’t use PoW
the admin/server is trusted to add blocks.
.

4. Voter Authentication Algorithm


 Purpose: To ensure only registered voters can log in and vote.
 Process: Password should be hashed to improve security.

5. Double Voting Check Algorithm

 Purpose: Prevent a voter from voting more than once.

6. Vote Counting Algorithm

 Purpose: Tally votes for each candidate or party.

12
4. DEVELOPMENT & TESTING

Development Phase

The development phase likely involved planning a Flask-based web application with a
custom blockchain for vote recording, implementing backend logic, and designing user
interfaces.

1. Environment Setup:
 Configured an HTML structure with CSS for a responsive layout, including
sidebars for cloth/glasses selection and a central camera container.
 Voter registration form Store hashed password Login with session
management.

2. Core Functionality Implementation:


 Registration & Login: Login with session management.
 Vote Casting: Used Submit vote, verify if voter has already voted Add vote as a
new block
 User Interaction: Added event listeners for selecting preloaded items, uploading
custom shirts/glasses, adjusting glasses scale via a slider, and controlling the
camera (start/stop/remove).

3. Admin Dashboard:
 Login as admin.
 View blockchain (all votes).
 See vote counts per election type.

4. Election Selection:
 Record vote type in blockchain

13
Testing Phase

1. Unit Testing:
 Registration/login.
 Voting process.
 Double voting prevention.

2. Integration Testing:
 Registration + Login Integration after registering, can the user log in
successfully.
 Only logged-in users should be able to vote.

3. Usability Testing:
 An users easily find “Register,” “Login,” “Vote,” and “Admin Panel.
 This ensures the system is easy and intuitive for real user.

4. Performance Testing:
 Measured frame rates and latency on different devices (e.g., laptops, desktops)
to ensure real-time performance.
 Identified and fixed issues test how the system performs under different load.
5. Bug Fixing and Refinement:
 Resolved and add background images or CSS polish.
 After testing, fix bugs and polish the system.

14
5. MILESTONE

Sr. No. Project Activity Estimated Start Estimated End


Date Date
1. Project Allotment 20/01/2025 22/01/2025

2. Synopsis Creation 22/01/2025 23/01/2025

3. Implementation Start 25/01/2025 03/03/2025

4. Studied about how to 13/02/2025 15/02/2025


use model in flask
for frontend
5. Implementation of the 16/02/2025 26/02/2025
backend technologies

6. Testing each and every 18/02/2025 01/03/2025


module of the project

15
6. MEETING WITH THE SUPERVISOR

Date Of Mode Comments by Signature of the


Meeting. the supervisor supervisor
22/01/2025 Offline Detailed description
about the project and
technology used in the
project
23/01/2025 Offline Discuss of Synopsis

16
PROJECT REPORT
1. INTRODUCTION

Project Title: Blockchain Based Voting System


Category: Blockchain Technology
In today’s Elections are an important part of democracy, allowing people to choose their
leaders and make decisions. However, traditional voting methods, like paper ballots and
electronic machines, have many problems. Blockchain is a decentralized technology that
stores information in a way that cannot be easily altered. Each vote in a blockchain
voting system is recorded as a block in a digital ledger, which is visible to all authorized
participants. This prevents any manipulation or fraud, ensuring that every vote is counted
correctly. Unlike paper-based or electronic voting machines, blockchain allows real-time
verification while maintaining voter privacy.
The This project aims of a blockchain based voting system is to create a secure,
transparent, and tamper- proof election process. Traditional voting methods, such as
paper ballots and electronic voting machines, often face issues like voter fraud,
miscounting, and manipulation. This project aims to solve these problems by using
blockchain technology to ensure fairness and trust in elections.

1
1.1 PROBLEM DEFINITION

The problem of traditional voting systems, whether paper-based or electronic, face several
major challenges that affect the fairness and security of elections. These challenges include
vote tampering, lack of transparency, voter fraud, and long processing times. In many cases,
election results can be manipulated by altering vote counts, hacking electronic voting
machines, or preventing certain voters from casting their votes. Additionally, manual vote
counting is slow and prone to errors, leading to delays and disputes in announcing results . This
system Electronic voting machines and online voting systems can be hacked, allowing attackers
to change vote counts or steal voter information. Protecting election data from cyber threats is
becoming more difficult, especially as technology advances. Many people worry that
unauthorized individuals or foreign entities could influence elections by hacking into voting
systems.
.

Key Challenges:
1. Voter Privacy vs. Transparency: Balancing the transparency of blockchain
with the need to keep individual votes anonymous.
2. Scalability: Handling a large number of voters and transactions without
performance issues.
3. Voter Authentication: Ensuring that only eligible voters can vote and
preventing duplicate voting.
4. Security: Protecting the system from cyber-attacks, including Sybil attacks and
denial-of-service (DoS) attacks.
5. Trust and Adoption: Gaining public trust and encouraging widespread
adoption of a new digital voting method.

2
1.2 MOTIVATION

The main motivation behind creating a blockchain-based e-voting system is to improve the
way elections are conducted by making them more secure, transparent, and trustworthy.
Traditional voting methods often face issues like vote tampering, hacking, fraud, and lack
of public trust. These problems can lead to unfair results and make people lose confidence
in the voting process.
The motivation behind this project is Blockchain technology offers a powerful solution to
these issues. It records each vote in a way that cannot be changed or deleted, ensuring that
every vote is counted fairly. This builds trust among voters, as they know their votes are
safe and secure. The use of smart contracts also helps to automate the process, making it
faster and free from human errors.

3
2. OBJECTIVES

The objective of a blockchain-based voting system is to provide a secure, transparent, and


tamper-proof platform for conducting elections. It ensures voter authenticity, prevents
fraud, and allows real-time vote tracking with immutable records .

4
1. REQUIREMENT ANALYSIS AND SPECIFICATION

1.1 Functional Requirements

1. Voter Login: Registered users can log in using their credentials.


2. Vote Recording on Blockchain: Votes are stored in a blockchain structure to ensure
transparency and immutability.
3. Vote Counting: Votes can be retrieved in real-time for administrative viewing.
4. Admin Login: Admin session is securely managed and restricted to authorized access.

5
1.2 Non-Functional Requirements

1. Performance:- The system should load quickly and provide a smooth, the blockchain

should synchronize across nodes in real-time.

2. Transparency:- Every transaction (vote) must be traceable on the blockchain.

3. Interoperability:- The system should support integration with, Ethereum blockchain,


MetaMask wallet, Future options like IPFS, Hyperledger, or biometric APIs.

4. Usability:- The user interface should be intuitive and easy to navigate for users of all
ensuring a seamless experience.

5. Reliability:- The system should be highly available and resilient, with minimal
downtime to ensure a consistent user experience.

6. Security and Privacy:- Implement measures to protect user data and ensure
compliance with data protection regulations.

7. Maintainability:- Code should be modular and well-documented for easy updates or


fixes.

8. Interoperability:- The ability to work seamlessly with other software and hardware
platforms.

9. Cost-Effectiveness:- The system should be affordable to ensure widespread adoption.

10. Accessibility:- The design must consider users with varying abilities and provide
features that enhance usability for all.

6
10.1Technical Requirements

 Python: For Blockchain Technology.


 Web Framework: Flask for building the web application.
 Libraries:
 Flask: Web framework to build the backend.
 json: To store or transfer data in a readable format.
 HTML/CSS: To design the user interface (registration, voting, results pages).

 Hashlib: To apply SHA-256 hashing to blocks in the blockchain.

 Uuid: To generate unique IDs (for voters).

7
10.2SOFTWARE & HARDWARE REQUIREMENTS

Hardware Required
Processor : Intel Core i5 or higher
Camera : Resolution minimum 720p

RAM : 16GB or higher

Storage : 512GB HDD OR SSD

Operating System : Windows 10

Software Required

Backend : Python,Flask.

Frotend :HTML,CSS.
Graphics/3D design : Blender, Unity.
IDE : Visual Studio Code.
Browser : Chrome, Mozilla, Edge, Brave

8
11. SYSTEM DESIGN

11.1 Data Flow Diagram

LEVEL 0

9
LEVEL-1

Complete Virtual Styling Data Flow Diagram

10
12. ALGORITHMS USED

Algorithms Used in blockchain based voting system:

The In a blockchain-based voting system, the primary algorithm used isn't just a single
standard algorithm like in encryption or sorting, but rather a collection of mechanisms that
together simulate blockchain behavior for secure, transparent, and tamper-proof voting.
Below is a detailed breakdown of the algorithms employed.

1. Hashing Algorithm
 Purpose: To ensure data integrity and link blocks.
 Implementation: Typically, SHA-256 (Secure Hash Algorithm 256-bit)
 Process:
o Each block contains a hash of the previous block.
o This links blocks together, forming a chain.
o If any vote is tampered with, the hashes break, making it detectable.

2. Block Creation Algorithm


Purpose: Add a new vote as a block in the blockchain.
Process:
 Collect vote details (voter ID, party, time).
 Hash the previous block.
 Add new block with current data + previous hash.

3. Consensus Algorithm
Purpose: In real blockchains (like Ethereum), consensus algorithms like Proof of Work
or Proof of Stake ensure that everyone agrees on the current state of the blockchain.

11
 Process: It’s a centralized system, so you don’t use PoW
the admin/server is trusted to add blocks.
.

4. Voter Authentication Algorithm


a. Purpose: To ensure only registered voters can log in and vote.
b. Process: Password should be hashed to improve security.

5. Double Voting Check Algorithm

a. Purpose: Prevent a voter from voting more than once.

6. Vote Counting Algorithm

 Purpose: Tally votes for each candidate or party.

12
13. DEVELOPMENT & TESTING

Development Phase

The development phase likely involved planning a Flask-based web application with a
custom blockchain for vote recording, implementing backend logic, and designing user
interfaces.

1. Environment Setup:
 Configured an HTML structure with CSS for a responsive layout, including
sidebars for cloth/glasses selection and a central camera container.
 Voter registration form Store hashed password Login with session
management.

2. Core Functionality Implementation:


a. Registration & Login: Login with session management.
b. Vote Casting: Used Submit vote, verify if voter has already voted Add vote as a
new block
c. User Interaction: Added event listeners for selecting preloaded items, uploading
custom shirts/glasses, adjusting glasses scale via a slider, and controlling the
camera (start/stop/remove).

3. Admin Dashboard:
a. Login as admin.
b. View blockchain (all votes).
c. See vote counts per election type.

4. Election Selection: Record vote type in blockchain.

13
Testing Phase

1. Unit Testing:
 Registration/login.
 Voting process.
 Double voting prevention.

2. Integration Testing:
 Registration + Login Integration after registering, can the user log in
successfully.
 Only logged-in users should be able to vote.

3. Usability Testing:
 An users easily find “Register,” “Login,” “Vote,” and “Admin Panel.
 This ensures the system is easy and intuitive for real user.

4. Performance Testing:
 Measured frame rates and latency on different devices (e.g., laptops, desktops)
to ensure real-time performance.
 Identified and fixed issues test how the system performs under different load.
5. Bug Fixing and Refinement:
 Resolved and add background images or CSS polish.
 After testing, fix bugs and polish the system.

14
5. PROJECT CODE

Index.html
<!DOCTYPE html>
<html>
<head>
<title>Blockchain Voting</title>
<link rel="stylesheet" href="{{ url_for('static', filename='style.css') }}">
<style>
body {
background-image: url('https://www.livelaw.in/h-upload/2022/11/01/750x450_441859-election-
commission-of-india-eci-and-sc-2.jpg');
background-size: 900px 650px;
background-position: center;
background-attachment: fixed;
background-repeat: no-repeat;
margin: 0;
padding: 0;
font-family: Arial, sans-serif;
min-height: 100vh;
}

.vote-box {
background-color: rgba(255, 255, 255, 0.9);
max-width: 600px;
margin: 50px auto;
padding: 30px;
border-radius: 10px;
box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);

15
h2 {
color: #333;
margin-top: 0;
}

a{
color: #0066cc;
text-decoration: none;
}

a:hover {
text-decoration: underline;
}
form {
margin: 20px 0;
}
select, input[type="submit"] {
padding: 10px;
width: 100%;
margin: 5px 0;
border-radius: 5px;
border: 1px solid #ddd;
}
input[type="submit"] {
background-color: #4CAF50;
color: white;
border: none;
cursor: pointer;
font-weight: bold;
} </div>
</body>
</html>

16
styles.css
body {
font-family: Arial, sans-serif;
background-color: #f0f2f5;
padding: 40px;
}.vote-box {
background-color: #fff;
padding: 30px;
border-radius: 12px;
box-shadow: 0 4px 8px rgba(0,0,0,0.1);
max-width: 450px;
margin: auto;
text-align: center;
}h2 {
color: #333;
}form {
margin-top: 20px;
Input[type="text"], select {
padding: 8px;
width: 90%;
margin-bottom: 20px;
border-radius: 6px;
border: 1px solid #ccc;
input[type="submit"] {
background-color: #007bff;
color: white;
padding: 10px 25px;
border: none;
border-radius: 6px;
cursor: pointer;
input[type="submit"]:hover {
background-color: #0056b3;
}

ul {
list-style-type: none;
padding: 0;
margin-top: 20px;
}

li {
background-color: #e9ecef;
margin: 5px 0;
padding: 8px;
border-radius: 6px;
}

17
App.py
from flask import Flask, render_template, request, redirect,
session, url_for
from blockchain import Blockchain

app = Flask(__name__)
app.secret_key = 'voting-secret-key' # Required for session
handling

blockchain = Blockchain()

# Sample data
POLITICAL_PARTIES = ["BJP", "INC", "AAP", "BSP",
"SP","NIRDALIY PARTY","NOTA"]
VOTER_IDS = ["ABHI01212","ZSO1000", "ZSO1001",
"ZSO1002",
"ZSO1003","ZSO1004","ZSO1005","ZSO1006","ZSO1007
","ZSO1008","ZSO1009","ZSO1010","ZSO1011","ZSO10
12","ZSO1013"]

@app.route('/')
def home():
if 'voter_id' in session:
return redirect('/vote')
return redirect('/login')

@app.route('/login', methods=['GET', 'POST'])


def login():
error = None
if request.method == 'POST':
voter_id = request.form['voter_id']
if voter_id in VOTER_IDS:
session['voter_id'] = voter_id
return redirect('/vote')

18
else:
error = "Invalid Voter ID. Please try again."
return render_template('login.html', error=error)

@app.route('/vote', methods=['GET', 'POST'])


def vote():
if 'voter_id' not in session:
return redirect('/login')

voter_id = session['voter_id']
message = None

if request.method == 'POST':
party = request.form['party']
if blockchain.has_voted(voter_id):
message = " You have already voted."
else:
blockchain.add_vote(voter_id, party)
blockchain.create_block(previous_hash="dummy_h
ash")
message = f" Vote for {party} submitted
successfully."

vote_counts = blockchain.get_vote_counts()
return render_template('index.html',
voter_id=voter_id,
parties=POLITICAL_PARTIES,
vote_counts=vote_counts,
message=message)

@app.route('/logout')
def logout():
session.pop('voter_id', None)
return redirect('/login')

if __name__ == '__main__':
app.run(debug=True)

19
7. CONCLUSION

The blockchain-based e-voting system provides a modern, secure, and transparent way to
conduct elections. By using blockchain technology, each vote is recorded as a block in a
chain that cannot be easily changed or tampered with. This ensures that the voting process
is fair, trustworthy, and protected from fraud. With features like voter authentication,
tamper-proof vote recording, and real- time result display, this system improves the overall
reliability of elections. Developed using Python and Flask, it is a lightweight and user-
friendly solution suitable for schools, colleges, organizations, or even larger communities.
This project proves that blockchain can be effectively used not just in finance, but also in
strengthening digital democracy. This project aligns with the goal blockchain-based e-
voting system is a secure and transparent solution for modern elections. By recording each
vote on a blockchain, it prevents fraud and ensures that results are accurate and tamper-
proof. The system uses Python and Flask, making it simple, lightweight, and user-friendly.
With features like voter authentication and real-time result tracking, it is ideal for schools,
colleges, and organizations. This project shows that blockchain can greatly improve the
fairness and trust in digital voting processes.

21
8. FUTURE SCOPE

The blockchain-based e-voting system has strong potential for future improvements. It can
be expanded to handle large-scale elections at the national or state level. Voter verification
can be made more secure by integrating biometric systems, Aadhar authentication, or face
recognition. The system can also use smart contracts on public blockchains like Ethereum
to make the process fully automated and decentralized. A mobile app version can be
developed to allow secure remote voting, increasing voter participation. With better data
visualization and stronger security features, this system can become a trusted and widely
used solution for digital voting in schools, colleges, organizations, and government
elections.

22
9. MILESTONES

Estimated Start Estimated End


Sr. No Project activity
Date Date

Project Allotment 20/01/2025 22/01/2025


1.
Synopsis Creation 22/01/2025 23/01/2025
2.
Implementation Start 25/01/2025 03/03/2025
3.
Studied about how to use model in flask 13/02/2025 15/02/2025
4. for frontend
Implementation of the backend 16/02/2025 26/02/2025
5. technologies
Testing each and every module of the 18/02/2025 01/03/2025
6. project

23
10. MEETINGS WITH THE SUPERVISOR

Date of the Signature of the


Mode Comments by the supervisor
meet supervisor
22/01/2025 Offline Detailed description about the project
and technology used in the project

23/01/2025 Offline Discuss of Synopsis

24
11. BIBLIOGRAPHY AND REFERENCES

1. Blockchain based voting systemSystem based on ML Algorithms Md. Zahurul


Haque, Department of CSE, Manarat International University, Dhaka,
Bangladesh. [email protected].
2. A Micu, A.E. Geru, Captina, A. and Muntean (2021). The Impact of Artificial
Intelligence Use on the Blockchain based in Romania. Amfiteatru Economic,
23(56), pp. 137-154.
3. Qin Xu and Jun Wang. | 23 January 2022 | A Social-aware and Mobile Blockchain
based. Hindawi Computational Intelligence and Neuroscience Volume 2022, Article ID
9501246, 8 pages.

25
12. PLAGIARISM REPORT

26

You might also like