# Secure Voting Website Using Ethereum and Smart Contracts
## 5 Analysis and Discussion  
One of the most promising applications of blockchain technology is in the field of voting. The decentralization and transparency provided by blockchain can potentially eliminate the issues of fraud and manipulation that plague traditional voting systems. Firstly, the cryptographic functions used in blockchain technology make it practically impossible to tamper with the data stored in the blocks. For example, the SHA-256 algorithm used in Bitcoin has a 256-bit output, meaning that the chances of finding two inputs that hash to the same output are approximately 1 in \(2^{256}\), a minimal probability. This makes it very difficult for anyone to alter the data in the blockchain without being detected. The SHA-256 hash function takes an input message and produces a fixed-size output hash value of 256 bits. The AES-256 encryption algorithm takes a plaintext message and a secret key and produces a ciphertext message of the same length [26]. We can represent the process of hashing the message M as follows:  
\[\text{H(M)}=\text{SHA-256(M)}\]  
Let's assume the input message M is \"Voter A votes for candidate A\". We can compute the SHA-256 hash of M as follows:  
H(\"Voter A votes for candidate A\") = SHA-256(\"Voter A votes for candidate A\") = 6789470e0b030e13d1 ebf3 eacbc7a887 ed721c9b3d41c279f54b49e8 eb63e99  
The resulting hash value is a 256-bit hexadecimal number. Next, we can represent the process of encrypting the message M using the AES-256 encryption algorithm as follows:  
\[\text{C}=\text{AES-256(M, K)}\]  
C is the ciphertext, M is the plaintext message, and K is the secret key. Let's assume that the private key is \"secret123\". We can encrypt the plaintext message \"Voter A votes for candidate A\" using AES-256 as follows:  
C = AES-256(\"Voter A votes for candidate A\", \"secret123\")  
= \"qLwmc7 rsiM2 QtYzKbL4x4 cXcdjuvKj+CvcgPuz49 ec8=\"  
The resulting ciphertext is a base64-encoded string of the same length as the plaintext message. By using both hashing and encryption techniques in a smart contract, we can ensure that the voting data is secure and tamper-proof on the blockchain. The efficiency of a blockchain-based voting system is determined by its ability to ensure fast and secure voting with minimal errors or delays. Additionally, the system's decentralization ensures that votes are recorded and verified by a network of nodes rather than a central authority. This results in a more transparent and trustworthy voting process with higher accuracy and efficiency [27]. The main reason the blockchain-based voting system is preferable to the traditional approach is its efficiency. We have analyzed the efficiency of blockchain and conventional \begin{table}
\begin{tabular}{l l l l l l l} \hline \hline
**Ref.** & **Framework** & **Anonymity** & **Affordability** & **Accuracy** & **Accessibility** & **Scalability** \\ \hline
[7] & Ethereum & Yes & No & No & Yes & Yes \\ \hline
[6] & Multichain & Yes & No & No & Yes & Yes \\ \hline
[5] & Bitcoin & Yes & Yes & No & Yes & No \\ \hline
[2] & Ethereum & Yes & No & No & Yes & No \\ \hline
[4] & Bitcoin & Yes & Yes & No & Yes & No \\ \hline Proposed work & Ethereum & Yes & Yes & Yes & Yes & Yes \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Comparison of Blockchain-Based Voting Systems. systems through tests and sample data. To test the proposed blockchain-based voting system, 1000 votes(V) were chosen to be cast, of which 800 were successful in an hour. \[\text{R}=\text{V}/\text{E}=800/1000=0.8=80\]  
The system's efficiency is calculated as the ratio of the votes cast to the total time taken T, multiplied by the number of candidates C:  
\[\text{Efficiency}=(\text{V}/\text{T})\times\text{C}\]  
Substituting the given values:  
\[\text{Efficiency}=(800/60)\times 5=66.67\text{ votes per minute per candidate}\]  
This means that, on average, each candidate received about 13.2 votes per minute.