@tushar-br/desktop 1.0.282 → 1.0.284

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/package.json +1 -1
  2. package/staging_area/desktop/rilvox/node_modules/@next/swc-win32-x64-msvc/next-swc.win32-x64-msvc.node +0 -0
  3. package/staging_area/micro projects/CDCT-236340316058.docx +0 -0
  4. package/staging_area/micro projects/CDCT-236340316058.pdf +0 -0
  5. package/staging_area/micro projects/CSDF practicals/Practical 4.docx +0 -0
  6. package/staging_area/micro projects/CSDF practicals/Practical 4.pdf +0 -0
  7. package/staging_area/micro projects/CSDF practicals/Practical-10.docx +0 -0
  8. package/staging_area/micro projects/CSDF practicals/Practical-10.pdf +0 -0
  9. package/staging_area/micro projects/CSDF practicals/Practical-11.docx +0 -0
  10. package/staging_area/micro projects/CSDF practicals/Practical-11.pdf +0 -0
  11. package/staging_area/micro projects/CSDF practicals/Practical-12.docx +0 -0
  12. package/staging_area/micro projects/CSDF practicals/Practical-13.docx +0 -0
  13. package/staging_area/micro projects/CSDF practicals/Practical-5.docx +0 -0
  14. package/staging_area/micro projects/CSDF practicals/Practical-5.pdf +0 -0
  15. package/staging_area/micro projects/CSDF practicals/Practical-6.docx +0 -0
  16. package/staging_area/micro projects/CSDF practicals/Practical-6.pdf +0 -0
  17. package/staging_area/micro projects/CSDF practicals/Practical-7.docx +0 -0
  18. package/staging_area/micro projects/CSDF practicals/Practical-7.pdf +0 -0
  19. package/staging_area/micro projects/CSDF-236340316058.docx +0 -0
  20. package/staging_area/micro projects/CSDF-236340316058.pdf +0 -0
  21. package/staging_area/micro projects/FOB-236340316058.docx +0 -0
  22. package/staging_area/micro projects/FOB-236340316058.pdf +0 -0
  23. package/staging_area/micro projects/FOB-Electronic Voting System using Blockchain/README.md +0 -131
  24. package/staging_area/micro projects/FOB-Electronic Voting System using Blockchain/android-chrome-512x512.png +0 -0
  25. package/staging_area/micro projects/FOB-Electronic Voting System using Blockchain/app.py +0 -100
  26. package/staging_area/micro projects/FOB-Electronic Voting System using Blockchain/blockchain.py +0 -98
  27. package/staging_area/micro projects/FOB-Electronic Voting System using Blockchain/requirements.txt +0 -2
  28. package/staging_area/micro projects/FOB-Electronic Voting System using Blockchain/run_project.bat +0 -29
  29. package/staging_area/micro projects/FOB-Electronic Voting System using Blockchain/static/images/avatar_alice.svg +0 -12
  30. package/staging_area/micro projects/FOB-Electronic Voting System using Blockchain/static/images/avatar_bob.svg +0 -12
  31. package/staging_area/micro projects/FOB-Electronic Voting System using Blockchain/static/images/avatar_charlie.svg +0 -12
  32. package/staging_area/micro projects/FOB-Electronic Voting System using Blockchain/static/images/user_avatar.png +0 -0
  33. package/staging_area/micro projects/FOB-Electronic Voting System using Blockchain/static/style.css +0 -1435
  34. package/staging_area/micro projects/FOB-Electronic Voting System using Blockchain/static/terminal.js +0 -140
  35. package/staging_area/micro projects/FOB-Electronic Voting System using Blockchain/templates/PDF/FOB-236340316058.pdf +0 -0
  36. package/staging_area/micro projects/FOB-Electronic Voting System using Blockchain/templates/already_voted.html +0 -80
  37. package/staging_area/micro projects/FOB-Electronic Voting System using Blockchain/templates/confirmation.html +0 -64
  38. package/staging_area/micro projects/FOB-Electronic Voting System using Blockchain/templates/index.html +0 -241
  39. package/staging_area/micro projects/FOB-Electronic Voting System using Blockchain/templates/vote.html +0 -112
  40. package/staging_area/micro projects/FOB-Electronic Voting System using Blockchain/vercel.json +0 -15
  41. package/staging_area/micro projects/folder.py +0 -27
  42. package/staging_area/micro projects/infographic.png +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tushar-br/desktop",
3
- "version": "1.0.282",
3
+ "version": "1.0.284",
4
4
  "description": "Private Image Cloud Storage & Backup System by Tushar",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -1,131 +0,0 @@
1
- # Electronic Voting System using Blockchain (Academic Project)
2
-
3
- This project is a conceptual demonstration of an Electronic Voting System secured by Blockchain technology. It is designed for academic purposes (Diploma/Final Year Project) to showcase how blockchain principles (immutability, transparency, hashing) can be applied to voting systems.
4
-
5
- **Note:** This is an academic simulation. The blockchain runs locally on a single machine, and the cryptographic functions are implemented in Python for educational clarity.
6
-
7
- ---
8
-
9
- ## 🚀 How to Run
10
-
11
- ### Prerequisites
12
- 1. **Python 3.x** installed on your system.
13
- 2. **Flask** (Python web framework).
14
-
15
- ### Installation Steps
16
- 1. Open your terminal/command prompt.
17
- 2. Install Flask if you haven't already:
18
- ```bash
19
- pip install flask
20
- ```
21
- 3. Navigate to the project folder:
22
- ```bash
23
- cd "path/to/project_folder"
24
- ```
25
- 4. Run the application:
26
- ```bash
27
- python app.py
28
- ```
29
- 5. Open your web browser and go to:
30
- ```
31
- http://127.0.0.1:5000
32
- ```
33
-
34
- ### ⚡ Quick Start (Windows)
35
- Double-click the **`run_project.bat`** file.
36
- - It will automatically open your browser.
37
- - It will start the voting server in the terminal.
38
-
39
- ---
40
-
41
- ## 🌐 GitHub & Vercel Deployment
42
-
43
- This project is ready for GitHub and Vercel.
44
-
45
- ### GitHub Upload
46
- 1. Initialize git: `git init`
47
- 2. Add files: `git add .`
48
- 3. Commit: `git commit -m "Initial commit"`
49
- 4. Push to your repository.
50
-
51
- ### Vercel Deployment (Live Hosting)
52
- 1. Install Vercel CLI or connect your GitHub repo to Vercel.
53
- 2. The project includes `vercel.json` for automatic configuration.
54
- 3. **Important Note for Vercel:**
55
- Attributes like `self.chain = []` are stored in memory. On serverless platforms like Vercel, the memory resets frequently.
56
- * **For the best Academic Demo:** Run it **Locally** (using `run_project.bat`) so you can show the Terminal output with the Blockchain hashes accumulating.
57
- * **For Vercel:** It will work, but the blockchain might reset if the server sleeps. This is expected behavior for serverless demos.
58
-
59
- ---
60
-
61
- ## 📂 Project Structure
62
-
63
- - **`app.py`**: The main Python application (Flask server) connecting the UI and Blockchain.
64
- - **`blockchain.py`**: The core blockchain logic (Block creation, SHA-256 detailed hashing, Chain validation).
65
- - **`templates/`**: Contains HTML files for the user interface.
66
- - **`static/`**: Contains CSS files for styling.
67
-
68
- ---
69
-
70
- ## 🔗 Blockchain Concepts Explained
71
-
72
- ### 1. What is Blockchain?
73
- Start with the simple idea: "A Blockchain is a digital ledger (notebook) that is duplicated and distributed across a network."
74
- In our project, we simulate this ledger. It is a chain of blocks, where each block contains data (a vote).
75
-
76
- ### 2. Why for Voting?
77
- - **Immutability:** Once a block is added, it cannot be changed. This prevents vote tampering.
78
- - **Transparency:** Anyone can inspect the blockchain to verify votes (in a public system).
79
- - **Security:** Hashing ensures that if one block is altered, the entire chain after it becomes invalid.
80
-
81
- ### 3. How it Works in this Project
82
- 1. **Voter Login:** The system accepts a Voter ID.
83
- 2. **Vote Cast:** The user selects a candidate.
84
- 3. **Hashing:** The system creates a "Block" containing:
85
- - **Voter ID Hash:** We hash the ID (SHA-256) so the original identity is hidden but unique.
86
- - **Timestamp:** Exact time of the vote.
87
- - **Candidate Name:** Who received the vote.
88
- - **Previous Hash:** The digital fingerprint of the *previous* block.
89
- 4. **Chaining:** This block is added to the list. Because it contains the "Previous Hash," it is cryptographically linked to the history.
90
-
91
- ---
92
-
93
- ## 📐 System Architecture
94
-
95
- ### Data Flow Components
96
- 1. **Voter (User):** Interacts via the Web Browser.
97
- 2. **HTML UI:** Simple forms for input and display.
98
- 3. **Python Backend:** Receives data, handles logic.
99
- 4. **Blockchain Ledger:** The immutable list of vote blocks.
100
-
101
- ### Diagram (Text-Based)
102
-
103
- ```
104
- [ Voter ]
105
- |
106
- | (Inputs ID & Vote)
107
- v
108
- [ HTML UI (Browser) ]
109
- |
110
- | (HTTP Request - POST)
111
- v
112
- [ Python Backend (Flask) ] ----> [ Voter Validation ]
113
- | |
114
- | (Creates Block) | (Verify ID)
115
- v |
116
- [ Blockchain Simulation ] <-------------+
117
- |
118
- +---> [ Calculate Hash (SHA-256) ]
119
- |
120
- +---> [ Link to Previous Block ]
121
- |
122
- +---> [ Append to Chain ]
123
- |
124
- v
125
- [ Terminal/Console Output ] (Displays Updated Ledger)
126
- ```
127
-
128
- ---
129
-
130
- ## ⚠️ Academic Disclaimer
131
- This system is a **prototype** for educational demonstration only. It lacks advanced security features required for a real-world national election (e.g., distributed consensus, elliptical curve cryptography, biometric authentication, secure network transmission). It is meant to demonstrate the **logic** of blockchain in voting.
@@ -1,100 +0,0 @@
1
- from flask import Flask, render_template, request, redirect, url_for, flash, send_file
2
- from blockchain import Blockchain
3
- import hashlib
4
- import os
5
-
6
- app = Flask(__name__)
7
- app.secret_key = 'academic_demo_key' # Needed for flash messages
8
-
9
- # Initialize Blockchain
10
- blockchain = Blockchain()
11
-
12
- # Hardcoded candidates for the demo with metadata for UI
13
- CANDIDATES = [
14
- {"id": "c1", "name": "Alice Johnson", "party": "Tech Innovation Party", "color": "#3498db"},
15
- {"id": "c2", "name": "Bob Smith", "party": "Green Earth Alliance", "color": "#27ae60"},
16
- {"id": "c3", "name": "Charlie Davis", "party": "Future Vision Party", "color": "#9b59b6"}
17
- ]
18
-
19
- @app.route('/')
20
- def index():
21
- return render_template('index.html')
22
-
23
- @app.route('/login', methods=['POST'])
24
- def login():
25
- voter_id = request.form.get('voter_id')
26
- if not voter_id:
27
- flash("Please enter a valid Voter ID")
28
- return redirect(url_for('index'))
29
-
30
- # 1. Check if voter has already voted (Academic Single Vote Enforcement)
31
- # Note: We check the blockchain directly for the hashed ID
32
- voter_hash = hashlib.sha256(voter_id.encode()).hexdigest()
33
- for block in blockchain.chain:
34
- if block.voter_id == voter_hash:
35
- # Voter found in ledger -> Redirect to Error Page
36
- return redirect(url_for('already_voted'))
37
-
38
- # If new voter, allow access
39
- return redirect(url_for('vote', voter_id=voter_id))
40
-
41
- @app.route('/vote')
42
- def vote():
43
- voter_id = request.args.get('voter_id')
44
-
45
- # Security check: If no ID in URL, go home
46
- if not voter_id:
47
- return redirect(url_for('index'))
48
-
49
- # Security check: Re-verify if this ID has voted (prevent URL jumping)
50
- voter_hash = hashlib.sha256(voter_id.encode()).hexdigest()
51
- for block in blockchain.chain:
52
- if block.voter_id == voter_hash:
53
- return redirect(url_for('already_voted'))
54
-
55
- return render_template('vote.html', voter_id=voter_id, candidates=CANDIDATES)
56
-
57
- @app.route('/submit_vote', methods=['POST'])
58
- def submit_vote():
59
- voter_id = request.form.get('voter_id')
60
- candidate = request.form.get('candidate')
61
-
62
- if not voter_id or not candidate:
63
- flash("Invalid vote submission")
64
- return redirect(url_for('index'))
65
-
66
- # Add vote to blockchain
67
- success, message = blockchain.add_vote(voter_id, candidate)
68
-
69
- if success:
70
- return render_template('confirmation.html', message=message, block_index=blockchain.get_latest_block().index)
71
- else:
72
- # If vote failed (likely duplicate catch), redirect to error page
73
- return redirect(url_for('already_voted'))
74
-
75
- @app.route('/already_voted')
76
- def already_voted():
77
- return render_template('already_voted.html')
78
-
79
- @app.route('/pdf/view')
80
- def view_pdf():
81
- """Serve the PDF file for inline viewing in browser"""
82
- pdf_path = os.path.join(app.root_path, 'templates', 'PDF', 'FOB-236340316058.pdf')
83
- return send_file(pdf_path, mimetype='application/pdf')
84
-
85
- @app.route('/pdf/download')
86
- def download_pdf():
87
- """Serve the PDF file for download"""
88
- pdf_path = os.path.join(app.root_path, 'templates', 'PDF', 'FOB-236340316058.pdf')
89
- return send_file(pdf_path, as_attachment=True, download_name='FOB-236340316058.pdf')
90
-
91
- @app.route('/chain')
92
- def view_chain():
93
- # Helper route to view chain in browser JSON format (used by Terminal UI)
94
- chain_data = [block.to_dict() for block in blockchain.chain]
95
- return {"length": len(chain_data), "chain": chain_data}
96
-
97
- if __name__ == '__main__':
98
- print("Electronic Voting System using Blockchain - Demo Started")
99
- print("Access the UI at: http://127.0.0.1:5000")
100
- app.run(debug=True)
@@ -1,98 +0,0 @@
1
- import hashlib
2
- import time
3
- import json
4
-
5
- class Block:
6
- def __init__(self, index, timestamp, voter_id, candidate, previous_hash):
7
- self.index = index
8
- self.timestamp = timestamp
9
- self.voter_id = voter_id # This will be hashed for privacy in the chain
10
- self.candidate = candidate
11
- self.previous_hash = previous_hash
12
- self.hash = self.calculate_hash()
13
-
14
- def calculate_hash(self):
15
- # Create a string representation of the block (excluding the hash itself)
16
- # Using json.dumps ensures a consistent string format for hashing
17
- block_string = json.dumps({
18
- "index": self.index,
19
- "timestamp": self.timestamp,
20
- "voter_id": self.voter_id,
21
- "candidate": self.candidate,
22
- "previous_hash": self.previous_hash
23
- }, sort_keys=True)
24
-
25
- # Calculate SHA-256 hash
26
- return hashlib.sha256(block_string.encode()).hexdigest()
27
-
28
- def to_dict(self):
29
- return {
30
- "index": self.index,
31
- "timestamp": self.timestamp,
32
- "voter_id": self.voter_id,
33
- "candidate": self.candidate,
34
- "previous_hash": self.previous_hash,
35
- "hash": self.hash
36
- }
37
-
38
- class Blockchain:
39
- def __init__(self):
40
- self.chain = []
41
- self.create_genesis_block()
42
-
43
- def create_genesis_block(self):
44
- # The first block in a blockchain is the Genesis Block
45
- # It has no previous hash (or arbitrary string like "0")
46
- genesis_block = Block(0, time.time(), "GENESIS", "System Initialization", "0")
47
- self.chain.append(genesis_block)
48
- print("Blockchain Initialized with Genesis Block")
49
-
50
- def get_latest_block(self):
51
- return self.chain[-1]
52
-
53
- def add_vote(self, voter_id, candidate):
54
- # 1. Check if voter has already voted (simple check based on hashed ID in chain)
55
- # In a real system, this would be more complex (e.g., separate voter registry)
56
- voter_hash = hashlib.sha256(voter_id.encode()).hexdigest()
57
-
58
- for block in self.chain:
59
- if block.voter_id == voter_hash:
60
- return False, "Error: Voter has already cast a vote."
61
-
62
- # 2. Create new block
63
- previous_block = self.get_latest_block()
64
- new_block = Block(
65
- index=previous_block.index + 1,
66
- timestamp=time.time(),
67
- voter_id=voter_hash, # Store hash of ID for simple anonymity
68
- candidate=candidate,
69
- previous_hash=previous_block.hash
70
- )
71
-
72
- # 3. Add to chain (immutability starts here)
73
- self.chain.append(new_block)
74
-
75
- # 4. Display blockchain contents in terminal (as requested)
76
- self.print_chain()
77
-
78
- return True, "Vote recorded successfully on blockchain"
79
-
80
- def is_chain_valid(self):
81
- for i in range(1, len(self.chain)):
82
- current_block = self.chain[i]
83
- previous_block = self.chain[i-1]
84
-
85
- # Check if current block's hash is valid
86
- if current_block.hash != current_block.calculate_hash():
87
- return False
88
-
89
- # Check if current block points to the correct previous block
90
- if current_block.previous_hash != previous_block.hash:
91
- return False
92
- return True
93
-
94
- def print_chain(self):
95
- print("\n--- Current Blockchain State ---")
96
- for block in self.chain:
97
- print(json.dumps(block.to_dict(), indent=4))
98
- print("--------------------------------\n")
@@ -1,29 +0,0 @@
1
- @echo off
2
- TITLE Electronic Voting System - Blockchain Demo
3
- COLOR 0A
4
- CLS
5
-
6
- ECHO ======================================================
7
- ECHO ELECTRONIC VOTING SYSTEM USING BLOCKCHAIN
8
- ECHO Academic Project - Local Environment
9
- ECHO ======================================================
10
- ECHO.
11
- ECHO [INFO] Starting the Python Backend Server...
12
- ECHO [INFO] Opening User Interface in default browser...
13
- ECHO.
14
-
15
- :: Open the browser immediately (it might take a second to connect while Flask starts)
16
- START "" "http://127.0.0.1:5000"
17
-
18
- :: Check if Python is installed (simple check)
19
- python --version >nul 2>&1
20
- IF %ERRORLEVEL% NEQ 0 (
21
- ECHO [ERROR] Python is not installed or not in PATH.
22
- PAUSE
23
- EXIT /B
24
- )
25
-
26
- :: Run the Flask application
27
- python app.py
28
-
29
- PAUSE
@@ -1,12 +0,0 @@
1
- <!-- Placeholder SVG Avatar Generator -->
2
- <svg width="120" height="120" viewBox="0 0 120 120" xmlns="http://www.w3.org/2000/svg">
3
- <defs>
4
- <linearGradient id="grad1" x1="0%" y1="0%" x2="100%" y2="100%">
5
- <stop offset="0%" style="stop-color:#3498db;stop-opacity:1" />
6
- <stop offset="100%" style="stop-color:#2980b9;stop-opacity:1" />
7
- </linearGradient>
8
- </defs>
9
- <circle cx="60" cy="60" r="60" fill="url(#grad1)"/>
10
- <circle cx="60" cy="45" r="20" fill="#fff" opacity="0.9"/>
11
- <ellipse cx="60" cy="95" rx="30" ry="25" fill="#fff" opacity="0.9"/>
12
- </svg>
@@ -1,12 +0,0 @@
1
- <!-- Placeholder SVG Avatar Generator -->
2
- <svg width="120" height="120" viewBox="0 0 120 120" xmlns="http://www.w3.org/2000/svg">
3
- <defs>
4
- <linearGradient id="grad2" x1="0%" y1="0%" x2="100%" y2="100%">
5
- <stop offset="0%" style="stop-color:#27ae60;stop-opacity:1" />
6
- <stop offset="100%" style="stop-color:#229954;stop-opacity:1" />
7
- </linearGradient>
8
- </defs>
9
- <circle cx="60" cy="60" r="60" fill="url(#grad2)"/>
10
- <circle cx="60" cy="45" r="20" fill="#fff" opacity="0.9"/>
11
- <ellipse cx="60" cy="95" rx="30" ry="25" fill="#fff" opacity="0.9"/>
12
- </svg>
@@ -1,12 +0,0 @@
1
- <!-- Placeholder SVG Avatar Generator -->
2
- <svg width="120" height="120" viewBox="0 0 120 120" xmlns="http://www.w3.org/2000/svg">
3
- <defs>
4
- <linearGradient id="grad3" x1="0%" y1="0%" x2="100%" y2="100%">
5
- <stop offset="0%" style="stop-color:#9b59b6;stop-opacity:1" />
6
- <stop offset="100%" style="stop-color:#8e44ad;stop-opacity:1" />
7
- </linearGradient>
8
- </defs>
9
- <circle cx="60" cy="60" r="60" fill="url(#grad3)"/>
10
- <circle cx="60" cy="45" r="20" fill="#fff" opacity="0.9"/>
11
- <ellipse cx="60" cy="95" rx="30" ry="25" fill="#fff" opacity="0.9"/>
12
- </svg>