Skip to content

Latest commit

 

History

History
58 lines (43 loc) · 2.67 KB

README.md

File metadata and controls

58 lines (43 loc) · 2.67 KB

Internet_Voting

Code Base Explanation:

Main files are
Webserver.java : The code at voter end
S1.java
S2.java : Counting Server

Database File are
Our database is in the form of a Hashmap.
VoterData.java : Creates a Hashmap between Strings and Class objects. The class contains all information of the voter such as VoterId, password, salt, email address etc.
CandidateData.java : Creates a Hashmap between Strings and Strings. The class contains all information of the Candidate. Currently they are just Candidate name and their corresponding unique id
VoterCheck.java : Creates a Hashmap between Strings and Class objects. This class contains a boolean checklist for voter. This is used by S1 to avoid duplicate votes or multiple votes by same voter.

Other Files
Login.java : Contains the code base for 2-factor authentication.
DHClient.java and DHServer.java : Diffie Hellman Key Exchange.
EmailUtil.java and TLSEmail.java : To send emails for OTP.
EncryptionDecryptionAES.java : AES Encryption and Decryption
MyFrameX.java : For GUI pop ups using java swing on voter's end.
Results.txt : Keeps the count of the votes against each candidate
secrets.txt : List of the secret of voters who have voted. Published in web.

How to compile and Run

Please remember to change the IP Addresses according to your conveniences, if implemented in different machines. Else run the following 3 files in 3 different terminal tabs.

Please compile using the following
javac -cp ".:/path/mail.jar:/path/activation.jar:/path/javax.mail.jar;" Webserver.java
javac -cp ".:/path/mail.jar:/path/activation.jar:/path/javax.mail.jar;" S1.java
javac S2.java

Run the program using
java -cp ".:/path/mail.jar:/path/activation.jar:/path/javax.mail.jar;" Webserver
java -cp ".:/path/mail.jar:/path/activation.jar:/path/javax.mail.jar;" S1
java S2

S2 -> S1 -> Webserver //order to run the files

//Installing Apache Server and hosting the secrets to web

  1. sudo apt-get update
  2. sudo apt upgrade
  3. sudo apt-get install apache2
  4. sudo service apache2 restart
  5. sudo gpasswd -a "$USER" www-data
  6. sudo chown -R "$USER":www-data /var/www
  7. Repeat Step 4
  8. sudo ufw app list
  9. sudo ufw allow in "Apache Full" (or) sudo ufw allow in "Apache"
  10. Place the index.html and secrets.txt within /var/www/html/
  11. Change the link in "publish" of S2 \\More to be seen on how to make the website accessible to other clients