GSM Report_2013

41
GSM BASED VOTING MACHINE 2013 CHAPTER 1 1.1 INTRODUCTION In democratic societies, voting is an important tool to collect and reflect people’s opinions. Traditionally, voting is conducted in centralised or distributed places called voting booths. Voters go to voting booths and cast their votes under the supervision of authorised parties. The votes are then counted manually once the election has finished. With the rapid development of computer technology and cryptographic methods, electronic voting systems can be employed that replace the inefficient and most importantly error-prone human component. To increase the efficiency and accuracy of voting procedures, computerised voting systems were developed to help collecting and counting the votes. These include Lever Voting Machines, Punched Cards for Voting, Optical Mark-Sense Scanners and Direct Recording Electronic (DRE) voting systems. For a variety of reasons, voters may be unable to attend voting booths Physically, but need to vote remotely, for example, from home or while travelling abroad. Hence, there is great demand for remote voting procedures that are easy, transparent, and, most importantly, secure. Today, the most common way for remote voting is postal voting, where voters cast their votes by post. However, it lacks proper authentication and involves a time-consuming procedure. Internet voting was introduced to provide more flexibility. Because of the inherited security vulnerabilities of the Internet and computerised systems in general, Internet voting incurred a wide range of criticism. However, to date many pilot projects in different countries and research groups have been carried out. We endeavour to improve mobility and address security problems of remote voting procedures and systems. We present an electronic voting scheme using GSM. With more than one billion users1, the GSM authentication infrastructure is the most widely deployed authentication mechanism by far. 1

Transcript of GSM Report_2013

Page 1: GSM Report_2013

GSM BASED VOTING MACHINE 2013

CHAPTER 1

1.1 INTRODUCTION

In democratic societies, voting is an important tool to collect and reflect people’s opinions. Traditionally, voting is conducted in centralised or distributed places called voting booths. Voters go to voting booths and cast their votes under the supervision of authorised parties. The votes are then counted manually once the election has finished. With the rapid development of computer technology and cryptographic methods, electronic voting systems can be employed that replace the inefficient and most importantly error-prone human component. To increase the efficiency and accuracy of voting procedures, computerised voting systems were developed to help collecting and counting the votes. These include Lever Voting Machines, Punched Cards for Voting, Optical Mark-Sense Scanners and Direct Recording Electronic (DRE) voting systems.

For a variety of reasons, voters may be unable to attend voting boothsPhysically, but need to vote remotely, for example, from home or while travelling abroad. Hence, there is great demand for remote voting procedures that are easy, transparent, and, most importantly, secure. Today, the most common way for remote voting is postal voting, where voters cast their votes by post. However, it lacks proper authentication and involves a time-consuming procedure. Internet voting was introduced to provide more flexibility. Because of the inherited security vulnerabilities of the Internet and computerised systems in general, Internet voting incurred a wide range of criticism. However, to date many pilot projects in different countries and research groups have been carried out. We endeavour to improve mobility and address security problems of remote voting procedures and systems. We present an electronic voting scheme using GSM. With more than one billion users1, the GSM authentication infrastructure is the most widely deployed authentication mechanism by far.

1

Page 2: GSM Report_2013

GSM BASED VOTING MACHINE 2013

1.2 BLOCK DIAGRAM:

Figure 1

2

ATMEGA 32

MICROCONTROLLER

MAX232 IC

GSM

MODULE

12V AC

16X2 LCD

5V DC

SUPPLY

Page 3: GSM Report_2013

GSM BASED VOTING MACHINE 2013

CHAPTER 2 :COMPONENTS

2.1 ATMEGA32 MICROCONTROLLER

The Atmel®AVR®ATmega32 is a low-power CMOS 8-bit microcontroller based on the

AVR enhanced RISC architecture. By executing powerful instructions in a single clock cycle,

the ATmega32 achieves throughputs approaching 1 MIPS per MHz allowing the system

designer to optimize power consumption versus processing speed.

Figure 2

Features:

32Kbytes of In-System Self-programmable Flash program memory

1024Bytes EEPROM

2Kbytes Internal SRAM

Write/Erase Cycles: 10,000 Flash/100,000 EEPROM

32 × 8 General Purpose Working Registers.

3

Page 4: GSM Report_2013

GSM BASED VOTING MACHINE 2013

Two 8-bit Timer/Counters with Separate Prescalers and Compare Modes

One 16-bit Timer/Counter with Separate Prescaler , Compare Mode, and Capture

Mode

Real Time Counter with Separate Oscillator

Four PWM Channels

8-channel, 10-bit ADC

32 Programmable I/O Lines

40-pin PDIP, 44-lead TQFP, and 44-pad QFN/MLF

Operating Voltages

– 2.7V - 5.5V for ATmega32L

– 4.5V - 5.5V for ATmega32

Speed Grades

– 0 - 8MHz for ATmega32L

– 0 - 16MHz for ATmega32

Power Consumption at 1MHz, 3V, 25°C

– Active: 1.1mA

– Idle Mode: 0.35mA

– Power-down Mode: < 1µA

2.2 16X2 ALPHANUMERIC LCD

It can display 16 characters per line and there are 2 such lines. In this LCD each character

is displayed in 5x7 pixel matrix. This LCD has two registers, namely, Command and

Data. The command register stores the command instructions given to the LCD. A

command is an instruction given to LCD to do a predefined task like initializing it,

4

Page 5: GSM Report_2013

GSM BASED VOTING MACHINE 2013

clearing its screen, setting the cursor position, controlling display etc. The data register

stores the data to be displayed on the LCD. The data is the ASCII value of the character

to be displayed on the LCD.

Pin Diagram:

Figure 3

2.3 SIM300 GSM MODULE

Features:

Provides the industry standard serial RS232 interface for easy connection to computers and other devices.

Provides serial TTL interface for easy and direct interface to microcontrollers. Power, RING and Network LEDs for easy debugging. On board 3V Lithium Battery holder with appropriate circuitry for providing backup

for the modules’ internal RTC. Can be used for GSM based Voice communications, Data/Fax, SMS, GPRS and

TCP/IP stack. Can be controlled through standard AT commands. Comes with an on board wire antenna for better reception. Board provides an option for adding an external antenna through an SMA connector. The SIM300 allows an adjustable serial baud rate from 1200 to 115200 bps (9600

default). Modem a low power consumption of 0.25 A during normal operations and around 1

A during transmission.  Operating Voltage: 7 – 15V AC or DC (board has on board rectifier

5

Page 6: GSM Report_2013

GSM BASED VOTING MACHINE 2013

Figure 4

2.4 MAX 232

Figure 5

The MAX232 IC is used to convert the TTL/CMOS logic levels to RS232 logic levels

during serial communication of microcontrollers with PC. The controller operates at TTL

logic level (0-5V) whereas the serial communication in PC works on RS232 standards (-

25 V to + 25V). This makes it difficult to establish a direct link between them to

6

Page 7: GSM Report_2013

GSM BASED VOTING MACHINE 2013

communicate with each other.The intermediate link is provided through MAX232. It is a

dual driver/receiver that includes a capacitive voltage generator to supply RS232 voltage

levels from a single 5V supply. Each receiver converts RS232 inputs to 5V TTL/CMOS

levels. These receivers (R1 & R2) can accept ±30V inputs. The drivers (T1 & T2), also

called transmitters, convert the TTL/CMOS input level into RS232 level. MAX232 needs

four external capacitors whose value ranges from 1µF to 22µF.

2.5 INTELLIGENT UNIVERSAL PROGRAMMER

Figure 6

Universal programmers are used for programming a wide variety of devices without requiring

family-specific modules and are suited to development projects and low volume production

programming. They are PC based and include a universal ZIF socket up to 48-pin accepting

both 300/600 mil DIP devices. Programmers support includes 1-wire E(E)PROM, BI-PROM,

configuration (EE)PROM, CPAL, EEPROM, EPROM, EPLD, flash, flash EPROM, FPGA,

GAL, MACH, microcontrollers, MROM, NV RAM, PAL, PEEL, PLD, PROM and serial

E(E)PROM.

7

Page 8: GSM Report_2013

GSM BASED VOTING MACHINE 2013

2.6 OTHER COMPONENTS

16 Mhz Crystal oscillator

Capacitors: C1,C2=22pF ; C3,C4=100nf

Inductor : L1= micro Henry

Resistor : R1=47K

Potentiometer: RV1=10K

12V, 2A AC Adaptor

5V DC input voltage

8

Page 9: GSM Report_2013

GSM BASED VOTING MACHINE 2013

CHAPTER 3:

PROJECT SETUP AND IMPLEMENTATION

3.1 HARDWARE SETUP:

Circuit Diagram:

Figure 7

9

Page 10: GSM Report_2013

GSM BASED VOTING MACHINE 2013

Figure 8

GSM sim300 module.

Figure 9

10

Page 11: GSM Report_2013

GSM BASED VOTING MACHINE 2013

Figure 10

Figure 11

3.2 SOFTWARE SETUP:

11

Page 12: GSM Report_2013

GSM BASED VOTING MACHINE 2013

3.2.1 ATMEL STUDIO 6:

Atmel® Studio 6 is the integrated development platform (IDP) for developing and debugging

Atmel ARM® Cortex™-M and Atmel AVR® microcontroller- (MCU-) based applications.

The Atmel Studio 6 IDP gives you a seamless and easy-to-use environment to write, build

and debug your applications written in C/C++ or assembly cod.

Atmel Studio 6 is free of charge and is integrated with the Atmel Software Framework (ASF)

—a large library of free source code with 1,600 ARM and AVR project examples. ASF

strengthens the IDP by providing, in the same environment, access to ready-to-use code that

minimizes much of the low-level design required for projects. Use the IDP for our wide

variety of AVR and ARM Cortex-M processor-based MCUs, including our broadened

portfolio of Atmel SAM3 ARM Cortex-M3 and M4 Flash devices.

Figure 12

3.2.2 ALGORITHM FOR PROGRAM CODE:

12 Power ON

Page 13: GSM Report_2013

GSM BASED VOTING MACHINE 2013

CHAPTER 5:

13

LCD is initialized Intro message Displayed

SIM module is initialized

Check Status of initialization

ichecked

IMEI number is displayed

SIM card presence is checked

Searching for network

Shows provider name

Waits for a message from the

voter

Message validation Valid messageNot valid message

Message is sent to the

voter regarding

invalid message

Acknowledgementmes

sage is sent to the

voter

Page 14: GSM Report_2013

GSM BASED VOTING MACHINE 2013

5.1 ADVANTAGES

Democracy : All and only the authorised voters can vote, and each eligible voter can

vote no more than once. Voters can also choose not to vote.

Privacy : All votes remain secret while voting takes place and each individual vote

cannot be linked by any individual or authority to the voter who casts it.

Accuracy : The voting result accurately reflects voters’ choices. In this case, no vote

can be altered, duplicated or eliminated without being detected.

Fairness : No partial result is available before the final result comes out.

Verifiability : where any voter can check that her own vote has been considered in the

tally.

5.2 DISADVANTAGES

Cost of instrument is relatively high.

The SMS transition involves SMS server. This may introduce delay in delivering the

message. If it delivers after polling duration is completed then that vote is not

considered.

CHAPTER 6:

14

Page 15: GSM Report_2013

GSM BASED VOTING MACHINE 2013

CONCLUSION & FUTURE SCOPE

We proposed a GSM mobile voting scheme, where the GSM authentication infrastructure is used to provide voter authentication and improve voter mobility.

Authentication is always a difficult requirement to fulfil for remote voting schemes, most of which apply a public-key based signature scheme for voter authentication. In our scheme, by using the existing GSM authentication infrastructure, the public-key overhead is largely reduced. Our scheme also enhances the security and provides more mobility and convenience to voters.Where the voters’ privacy is protected by applying a blind signature scheme. In this paper, we presented the basic structure and protocol of our GSM based mobile voting system.

However, further work is needed to address the importance we place in the trust on the AC(Authentication Centre), and we are therefore investigating options for enhancing and extending the GSM mobile voting scheme. In future work, we will discuss end-user device (ME) and application security. We will also address how the voters obtain the voting application and solutions to provide the integrity of the voting application running on the ME. The Trusted Platform Module and smart card solutions will be considered.

15

Page 16: GSM Report_2013

GSM BASED VOTING MACHINE 2013

REFERENCE

[1] M. Burmester and E. Magkos. Towards secure and practical e-elections in the new era. In D. Gritzalis, editor, Secure Electronic Voting, pages 63–72. Kluwer Academic Publishers, 2003.[2] D. Chaum. Untraceable electronic mail, return addresses, and digitalpseudonyms. Communications of the ACM, 24(2):84–88, February 1981.[3] D. Chaum. Blind signatures for untraceable payments. In D. Chaum,R. Rivest, and A. Sherman, editors, Advances in Cryptology—Crypto’82, pages 199–203, New York, 1983. Plenum Press[4]www.extremeelectronics.com

APPENDIX A : PROGRAM CODE

#include <avr/io.h>

16

Page 17: GSM Report_2013

GSM BASED VOTING MACHINE 2013

#include <util/delay.h>

#include <avr/eeprom.h>

#include <string.h>

#include "lib/lcd/lcd.h"

#include "lib/sim300/sim300.h"

#include "lib/usart/usart.h"

void Halt();

void Reply(const char *num,uint8_t stat);

int main(void)

{

//Initialize LCD Module

LCDInit(LS_NONE);

//Intro Message

LCDWriteString("GSM Based Voting");

LCDWriteStringXY(0,1,"Minor project");

_delay_ms(1000);

LCDClear();

//Initialize SIM300 module

LCDWriteString("Initializing ...");

int8_t r= SIM300Init();

_delay_ms(1000);

//Check the status of initialization

17

Page 18: GSM Report_2013

GSM BASED VOTING MACHINE 2013

switch(r)

{

case SIM300_OK:

LCDWriteStringXY(0,1,"OK !");

break;

case SIM300_TIMEOUT:

LCDWriteStringXY(0,1,"No response");

Halt();

case SIM300_INVALID_RESPONSE:

LCDWriteStringXY(0,1,"Inv response");

Halt();

case SIM300_FAIL:

LCDWriteStringXY(0,1,"Fail");

Halt();

default:

LCDWriteStringXY(0,1,"Unknown Error");

Halt();

}

_delay_ms(1000);

//Set message format to text

r= SIM300SetTextMode();

LCDClear();

18

Page 19: GSM Report_2013

GSM BASED VOTING MACHINE 2013

LCDWriteString("Set Text Mode ..");

_delay_ms(1000);

//Check the result of above operation

switch(r)

{

case SIM300_OK:

LCDWriteStringXY(0,1,"OK !");

break;

case SIM300_TIMEOUT:

LCDWriteStringXY(0,1,"No response");

Halt();

case SIM300_FAIL:

LCDWriteStringXY(0,1,"Fail");

Halt();

default:

LCDWriteStringXY(0,1,"Unknown Error");

Halt();

}

_delay_ms(1000);

//IMEI No display

LCDClear();

char imei[16];

r=SIM300GetIMEI(imei);

19

Page 20: GSM Report_2013

GSM BASED VOTING MACHINE 2013

if(r==SIM300_TIMEOUT)

{

LCDWriteString("Comm Error !");

Halt();

}

LCDWriteString("Device IMEI:");

LCDWriteStringXY(0,1,imei);

_delay_ms(1000);

//Manufacturer ID

LCDClear();

char man_id[48];

r=SIM300GetManufacturer(man_id);

if(r==SIM300_TIMEOUT)

{

LCDWriteString("Comm Error !");

Halt();

}

LCDWriteString("Manufacturer:");

LCDWriteStringXY(0,1,man_id);

_delay_ms(1000);

//Manufacturer ID

LCDClear();

char model[48];

20

Page 21: GSM Report_2013

GSM BASED VOTING MACHINE 2013

r=SIM300GetModel(model);

if(r==SIM300_TIMEOUT)

{

LCDWriteString("Comm Error !");

Halt();

}

LCDWriteString("Model:");

LCDWriteStringXY(0,1,model);

_delay_ms(1000);

//Check Sim Card Presence

LCDClear();

LCDWriteString("Checking SIMCard");

_delay_ms(1000);

r=SIM300IsSIMInserted();

if (r==SIM300_SIM_NOT_PRESENT)

{

//Sim card is NOT present

LCDWriteStringXY(0,1,"No SIM Card !");

Halt();

}

else if(r==SIM300_TIMEOUT)

{

//Communication Error

21

Page 22: GSM Report_2013

GSM BASED VOTING MACHINE 2013

LCDWriteStringXY(0,1,"Comm Error !");

Halt();

}

else if(r==SIM300_SIM_PRESENT)

{

//Sim card present

LCDWriteStringXY(0,1,"SIM Card Present");

_delay_ms(1000);

}

//Network search

LCDClear();

LCDWriteStringXY(0,0,"SearchingNetwork");

uint8_t nw_found=0;

uint16_t tries=0;

uint8_t x=0;

while(!nw_found)

{

r=SIM300GetNetStat();

if(r==SIM300_NW_SEARCHING)

{

LCDWriteStringXY(0,1,"%0%0%0%0%0%0%0%0%0%0%0%0%0%0%0%0");

LCDWriteStringXY(x,1,"%1");

22

Page 23: GSM Report_2013

GSM BASED VOTING MACHINE 2013

LCDGotoXY(17,1);

x++;

if(x==16) x=0;

_delay_ms(50);

tries++;

if(tries==600)

break;

}

else

break;

}

LCDClear();

if(r==SIM300_NW_REGISTERED_HOME)

{

LCDWriteString("Network Found");

}

else

{

LCDWriteString("Cant Connt to NW!");

Halt();

}

23

Page 24: GSM Report_2013

GSM BASED VOTING MACHINE 2013

_delay_ms(1000);

LCDClear();

//Show Provider Name

char pname[32];

r=SIM300GetProviderName(pname);

if(r==0)

{

LCDWriteString("Comm Error !");

Halt();

}

LCDWriteString(pname);

_delay_ms(1000);

//Voting system

uint16_t votes[4];

votes[0]=eeprom_read_word((const uint16_t *)0);

votes[1]=eeprom_read_word((const uint16_t *)2);

votes[2]=eeprom_read_word((const uint16_t *)4);

votes[3]=eeprom_read_word((const uint16_t *)6);

if(votes[0]==0xFFFF)

{

//No valid data on eeprom, so set all votes to 0

votes[0]=votes[1]=votes[2]=votes[3]=0;

//Clear EEPROM too

24

Page 25: GSM Report_2013

GSM BASED VOTING MACHINE 2013

eeprom_write_word((uint16_t *)0,0);

eeprom_write_word((uint16_t *)2,0);

eeprom_write_word((uint16_t *)4,0);

eeprom_write_word((uint16_t *)6,0);

}

//Wait for MSG

uint8_t id;

char oa[20];//Origin Address ()the number from where the msg came

UFlushBuffer();

while(1)

{

LCDClear();

uint8_t x=0;

LCDWriteStringXY(0,0,"A= B=");

LCDWriteStringXY(0,1,"C= D=");

LCDWriteIntXY(2,0,votes[0],4);

LCDWriteIntXY(9,0,votes[1],4);

LCDWriteIntXY(2,1,votes[2],4);

LCDWriteIntXY(9,1,votes[3],4);

while(SIM300WaitForMsg(&id)!=SIM300_OK)

{

if(x)

{

25

Page 26: GSM Report_2013

GSM BASED VOTING MACHINE 2013

LCDWriteStringXY(15,0,"%3");

x=0;

}

else

{

LCDWriteStringXY(15,0,"%4");

x=1;

}

}

LCDWriteStringXY(15,0,"%2");

_delay_ms(1000);

//Now read the msg

char msg[300];

r=SIM300ReadMsg(id,msg,oa);

if(r==SIM300_OK)

{

if(strcasecmp(msg,"VOTE A")==0)

{

votes[0]++;

eeprom_write_word((uint16_t *)0,votes[0]);

Reply(oa,1);

}

else if(strcasecmp(msg,"VOTE B")==0)

26

Page 27: GSM Report_2013

GSM BASED VOTING MACHINE 2013

{

votes[1]++;

eeprom_write_word((uint16_t *)2,votes[1]);

Reply(oa,1);

}

else if(strcasecmp(msg,"VOTE C")==0)

{

votes[2]++;

eeprom_write_word((uint16_t *)4,votes[2]);

Reply(oa,1);

}

else if(strcasecmp(msg,"VOTE D")==0)

{

votes[3]++;

eeprom_write_word((uint16_t *)6,votes[3]);

Reply(oa,1);

}

else

{

//Invalid Choice

Reply(oa,0);

}

_delay_ms(3000);

27

Page 28: GSM Report_2013

GSM BASED VOTING MACHINE 2013

}

else

{

LCDClear();

LCDWriteString("Err Reading Msg !");

_delay_ms(3000);

}

//Finally delete the msg

if (SIM300DeleteMsg(id)!=SIM300_OK)

{

LCDWriteString("Err Deleting Msg !");

_delay_ms(3000);

}

}

Halt();

}

void Halt()

{

while(1);

}

void Reply(const char *num,uint8_t stat)

{

28

Page 29: GSM Report_2013

GSM BASED VOTING MACHINE 2013

uint8_t ref;

int8_t r;

if(stat)

r=SIM300SendMsg(num,"Your vote has been successfully registered, Thank !

:)",&ref);

else

r=SIM300SendMsg(num,"Invalid vote ! Please send VOTE x, where x can be

A,B,C or D.Thanks!",&ref);

if(r==SIM300_OK)

{

return;

}

else if(r==SIM300_TIMEOUT)

{

LCDClear();

LCDWriteStringXY(0,0,"Can't Send Reply!");

LCDWriteStringXY(0,1,"Time out !");

_delay_ms(3000);

}

else

{

LCDClear();

LCDWriteStringXY(0,0,"Can't Send Reply!");

29

Page 30: GSM Report_2013

GSM BASED VOTING MACHINE 2013

LCDWriteStringXY(0,1,"Fail !");

_delay_ms(3000);

}

}

APPENDIX B:

CREATING A PROJECT IN ATMEL STUDIO 6 IDE

Step 1:

30

Page 31: GSM Report_2013

GSM BASED VOTING MACHINE 2013

Start AVR Studio 6 by using its icon from the Windows® Desktop or the Start Menu.

First screen shown up after the AS6 has started is the Start Page shown below.

.

Step 2:

Create a new project by selecting “New Project” option from the Start Page.AS6 will show

you the New Project Wizard as shown below.

31

Page 32: GSM Report_2013

GSM BASED VOTING MACHINE 2013

From the project template area (Installed Templates) select C as the project template. From

the project type area select “C Executable Project”. After that fill out the project details at the

bottom like project name,its location on your PC etc. Finally Hit Ok.

Step 3:

Next to the project detail window is the Device Selection Window. That let you choose the

target MCU for your project. Here in our project we are using ATmega32 MCU so select that

from the device list.

32

Page 33: GSM Report_2013

GSM BASED VOTING MACHINE 2013

Hence after the “New Project” wizard is completed , we are presented with the AVR Studio 6

main window.

Step 4:

Write the program code in the editor window of Atmel studio 6.

33

Page 34: GSM Report_2013

GSM BASED VOTING MACHINE 2013

Step 5:

Build the project, by selecting Build Solution from the Build menu. You can also use

keyboard shortcut F7 to build the project.

If everything is setup correctly and your source files do not have any syntax error then you

will get the following message.It states the number of projects succeeded and the number of

projects failed. Since we have only one project in our solution we should get something like

shown above.

34

Page 35: GSM Report_2013

GSM BASED VOTING MACHINE 2013

35