Title: Secure Electronic Voting System
1Secure Electronic Voting System
- SD 1103
- Semester 2 Presentation
- Adam Diemert
- Akshay Raj
- Yu Chen
- Advisor Dr. Katti
2Introduction
- The electronic voting system provides a secure,
easy way to vote between two options. This can
be used for voting for or against legislative
bills or for deciding between two candidates. - The difficulty is providing a secure system that
allows for voters to maintain privacy. - The security comes from encryption, and the
privacy comes from the method used to encrypt and
decrypt the votes.
3Requirements-Hardware
- We were given basic hardware requirements for the
project. - The voter has to be able to vote on one module.
- The vote will be counted on another module.
4Requirements
- The vote needs to be public and verifiable.
- The results will be displayed on the bulletin
board and digital signatures will be displayed to
ensure authorization. - The El Gamal encryption scheme will be used.
- The votes will be counted without being
individually decrypted for privacy. - The encryption will use small numbers, and if
time allows, large numbers will be attempted.
5Transceiver
- We need a transceiver to send messages from one
breadboardd to another breadboard, store it, and
send signal back to the first breadboard. We
choose the MRF49XA transceiver from Microchip. - low-cost-2.82
- two-way, short range wireless applications
- can be used in the 433, 868, and 915 MHz
frequency bands
6Pin Diagram Transceiver
7MICROCONTROLLER TO MRF49XA INTERFACE
8APPLICATION CIRCUIT
9Very small chip
1016-Lead Plastic Thin Shrink Small Outline (ST)
4.4 mm Body TSSOP
11Problems
- Because the chip is surface mount, we cannot put
it in our breadboard. We needed to find a way to
use it in our breadboard. We found some options.
Two methods to problems
- 1. just order a breakout board built on
digi-key.com from Jeff. - 2.we build a breakout board by ourselves.
12Our first option
- Thinking about the price and convenience, we
decide to build the adaptor by ourselves.
13Top of the board
14Back of the board
15Front of the board
16Problems again
- Other parts are all very small, even smaller than
chip itself. For example, capacitors and
inductors with small values. It is almost
impossible to solder them to our final PCB if we
want to do it by ourselves.
Solution
- We had to choose the other way we mentioned
before, which is that we directly order a
breakout board that every components were
soldered. Then we found MRF49XA PICtail/PICtail
Plus Daughter Board
17MRF49XA PICtail/PICtail Plus Daughter Board
18RF Transceiver daughter board
Wire Antenna
Power Disconnect/ Current Measurement Headers
24AA02E48 EUI Node Identity Serial EEPROM
MRF49XA Sub-GHz Transceiver
PICtail and PICtail Plus Connectors
19Datasheet of MRF49XA PICtail/PICtail Plus
Daughter Board
20Components used in Hardware
- Two LCDs of 16X4 characters.
- Two 3X4 Keypads
- Two Microcontroller (18F4620)
- Crystal oscillators 20 MHz
21Design Module
22Circuit Diagram for LCD and Keypad Interface
23Pin Diagram for RF board
24Circuit schematic on multisim
25PCB Layout
26Software
- The software has several routines that are used
for the encryption. - The vote counting code is to be put on one of the
modules. - The voting code is to be put on the other module.
- There are supporting routines that do things such
as - Retrieve entries from the keypad
- LCD and transceiver drivers
- Calculations such as finding numbers that will
work in the encryption
27Voting Code
- The voting code works in this order
- Calculate the correct x for the encryption
(discussed later) - Ask user to input the vote and one other number
for the encryption - Calculate encryption numbers r and t
- Send r and t to the other module
- Wait for a response confirming reception of vote
- Ask whether more voters are waiting to vote
- Repeat process if there are more voters
28Voting Counting Code
- This code works as follows
- Calculate x for encryption as in the other
routine - Receive r and t from other module
- Multiply r and t by other votes previously
captured - See if there are more votes (variable set while
receiving r. If r ends up being re, then
there are no more votes. - Calculate decryption of product of votes
- Calculate the number of votes that correspond to
the number from decryption - Set variables and output results to the users
29El Gamal Basics
- Choose p, which is a prime number
- Choose g, which is an integer
- Choose x, which in our case is chosen using the
Extended Euclidean Algorithm - Calculate h, which is gx mod p
- User choose vote and k, a random encryption
number - Encrypt rgk mod p, thkgvote mod p
- Vote can be either 1 for yes or -1 for no.
30El Gamal Basics
- When all the votes are collected, multiply rs
and ts. - r1r2r3rn, t1t2t3tn
- This gives a sum of votes in the exponent because
multiplying like bases causes an addition in
exponents. - Decrypt this product of votes to receive M, which
is g(net number of votes)
31Extended Euclidean Algorithm
- The Extended Euclidean Algorithm is used to
calculate an acceptable value of x. - This is needed because El Gamal encryption uses g
and g inverse, but needs to use only integer
numbers. - If we choose g6, then mathematically, g
inverse1/6. The Extended Euclidean Algorithm
calculates an acceptable integer inverse of g.
The integer is the inverse for the encryption. - The algorithm gives g inverse3, if we choose
g6.
32Extended Euclidean Algorithm-MATLAB
- function xexteucalg(x,y)
- a0x xg
- b0y yp for el gamal
- t00
- t1
- s01
- s0
- rmod(a0,b0) ra0-qb0 is the remainder
- q(a0-r)/b0 need only result with no
remainder - while rgt0
- tempt0-qt
- t0t
- ttemp
- temps0-qs
- s0s
- stemp
- a0b0
- b0r
- rmod(a0,b0) ra0-qb0 is the
remainder
33Decryption
- We decrypt the product of votes to get g(net
number of votes) as described above. - If our answer comes out as x, or g-1, we have to
compare to see if that is a correct answer. This
can be checked. x1 mod p corresponds to one no
vote. - If x3, and the result comes out as 3, we know
there was a net of one no vote because p is
always larger than x. - If we get 10 from the decryption, we check with
x3 mod p. x3, so x327, mod p10. We know this
corresponds to 3 no votes.
34Testing and Evaluation-Software
- I tested my code by running the algorithms in
MATLAB. - I found many errors this way, and I discovered
that the encryption and decryption do not work if
integers are not used, prompting questions that
led to the Extended Euclidean Algorithm. - There were some problems with this method of
testing. - MATLAB rounds to 15 significant digits, which
really limits the capabilities of the algorithm.
35Testing and Evaluation-Software
- I wrote the code in C, and then I went through
the flowcharts and updated them. - I made sure everything flowed logically in the
code. - I compiled the code, and finally had success
after much troubleshooting. The code will
definitely have errors, but without anything to
test it on, I cannot find any more. - There are some warnings about the pointers used
in the transceiver code, but I tried fixing the
syntax, and nothing helped.
36Problems Encountered-Software
- I encountered many problems with the software,
which have been mentioned previously. - Needing integers for encryption and decryption to
work - MATLAB rounding errors
- Nothing to test code on
- Inadequate understanding of the algorithms
- Most of these have been fixed, but some are
unresolved. - My routines do not work well in MATLAB because of
the rounding/cutoff of numbers. - I still have nothing to test the C code on.
37Problems Encountered-Hard/Software
- We came across an issue with the LCD in the
breadboard. - The LCD will not write characters.
- We thought the pins were mixed up, but switching
pins did not help. - The issue is still unresolved.
38Problems Encountered-Hardware
- The values of the inductors and capacitors in the
application circuit were very small.
39Problems Encountered-Transceiver
- We had quite a few problems with the transceiver.
- Mentioned previously, we tried to build our own
adaptor to put the chip on a breadboard, but that
failed because of the small size. - We didnt know how to write driver and
initializer code. - We finally ordered the application circuit, but
we did that too late.
40Lessons Learned-Transceiver
- We learned to ask around to see if there is a
simpler transceiver that others know how to use. - We learned to look for an application circuit
early and use that rather than take the long way. - The application circuit came with driver code,
which saved a ton of time.
41BUDGET
Item Per unit Cost Quantity Cost ()
PIC 18F4620 7.94 3 23.82
LCD 16X4 23.82 2 47.64
LM7805 0.6 3 1.2
Keypad 6.95 2 13.9
20 MHz crystal 1.7 2 2.14
RF Transceiver 1.99 2 3.98
Daughter Board For MRF49XA 39.99 2 79.98
Total 172.66
42Software Future Work
- There is much work that could be done to improve
the software algorithms for this project. - Error checking code
- The transceiver code can be refined to work more
efficiently. - There may also be a need to use larger variable
types or break the large numbers into smaller
pieces to implement the larger encryption.
43Software Future Work
- To be effective, the encryption needs to use
larger numbers. The article that this idea came
from stated that a 200-300 digit prime number was
needed to make the algorithm secure. - The rest of the requirements also need to be
implemented. - This includes digital signatures, which was one
of our requirements as well - Other requirements for the secure voting system
are verifiability, robustness, and authorization.
44Software Future Work
- There are many ways this code could be made
better. - One suggestion we received during our
demonstration was to change our encryption
numbers periodically and keep track of how many
votes were recorded during certain time periods. - This scheme could be implemented, and it would
take a lot of work. It would be interesting. - To take into consideration there would need to
be a threshold number of votes before the numbers
could change to ensure privacy.
45Hardware Future Work
- Can redesign all the hardware
- Use a simpler transceiver such as the Xbee, which
other groups have used successfully - Include serial port interface on the PCB for
downloading code directly to PIC without removing
from PCB
46Hardware Future Work
- Redesign PCB to be smaller
- Enclose in box
- Add batteries and switches to each module
- Many of these were supposed to be done this
semester.
47Summary
- We have software algorithms that work
- There is nothing to test the C code on
- Hardware does not work at all, though the circuit
should be correct - We did not implement digital signatures