You are on page 1of 48

A.

K CHOUDHURY SCHOOL OF INFORMATION TECHN OLOGY

UNIVERSITY OF CALCUTTA
92, A.P.C ROAD, KOLKATA-700009,
INDIA

AprojectReporton

WirelessBodyAreaNetworking

Submittedby:

ROLLNo.:

SUBHRADEEPMITRA

91/MCA/120001

ANKITADUTTA

91/MCA/120017

UNDERTHESUPERVISIONOF
Dr.RituparnaChaki
Professor,
A.K.ChoudhurySchoolof
InformationTechnology
UNIVERSITYOFCALCUTTA
th

Aprojectreportsubmittedinpartialfulfilmentofthe6 Semesterexaminationforthedegree
ofMasterofComputerApplication.

A.K CHOUDHURY SCHOOL OF INFORMATION TECHN OLOGY

UNIVERSITY OF CALCUTTA
92, A.P.C ROAD, KOLKATA-700009,
INDIA

CERTIFICATE
ThisistocertifythattheprojectsynopsisentitledWIRELESSBODYAREA

NETWORKhasbeenpreparedbySUBHRADEEPMITRAandANKITADUTTA,

undermysupervision,andbeacceptedinpartialfulfilmentoftherequirementsforthedegree
ofMasterofComputerApplicationsinthefacultyofInformationTechnology,Universityof
Calcutta.

Dr.AmlanChakrabarti
CoOrdinator,
A.K.ChoudhurySchoolof
InformationTechnology,
UniversityofCalcutta.

Dr.RituparnaChaki
Professor,
A.KChoudhurySchoolof
InformationTechnology,
UniversityofCalcutta.

ExternalExaminer.

ACKNOWLEDGEMENTS
Wewouldliketoexpressourheartiestgratitudetoallwhohavedirectlyandindirectlyextendedvaluable
guidance and advice during the preparation of this project, which will be the continuous flow of
inspirationtocarryontheprojectuptocompletion.

OursincerethankgoestoDr.RituparnaChakiunderwhoseguidancewedidthisproject.Helendus
withvaluableinsightandsuggestionstoincreasethevalueofourprojectgreatly.Wearealsothankfulto
Dr.AmlanChakrabarti,CoOrdinator,A.K.ChoudhurySchoolofInformationTechnology,University
ofCalcutta,forthehelpextendedbyhim.

And last but not the least; We thank the department A.K. Choudhury School of Information
Technologyasawholewhichgaveusanopportunitytoundertakethisproject,whichinturngaveusa
touchofreallifeprojectimplementation.

PLACE:A.K.ChoudhurySchoolofInformationTechnology,UniversityofCalcutta
DATE:

SUBHRADEEPMITRA

CONTENTS

Topic

ANKITADUTTA

Page No.

1. Introduction
1.1Wireless Body Area Network
1.2Wireless Sensor Networking
1.3. Security Challenges in Wireless Sensor Networking
1.4. Solutions for Security Issues
1.5. Project Goal

07
07
07
07
08
08

2. Background of Sensor Network Technology

09

3. Description of Work Done


3.1. Definition
3.2. Challenges:
3.3. security Issues and Requirements
3.4. Security Threats in different Layers
3.5. Possible solutions

16
16
16
17
18
20

4. Performance Analysis
4.1. Tate Memory Analysis
4.2. Weil Memory Analysis
4.3. Tate Pairing Run Time Analysis
4.4. Weil Pairing Run Time Analysis

26
26
27
28
29

5. Comparative Chart

30

6. Conclusion

31

7. Future Works

32

8. Appendix
8.1. Source Code for Tate Pairing
8.2. Source Code for Weil Pairing

33
33
41

9. References

48

LISTOFFIGURES
Topic

Page No.

1.1.

Shift and Progression in emphasis

12

3.1.

Identity Based Encryption

21

4.1. Tate Memory Analysis


4.2. Weil Memory Analysis
4.3. Tate Pairing Run Time Analysis
4.4. Weil Pairing Run Time Analysis

26
27
28
29

ABSTRACT
Wireless Body Area Network (WBAN) allows the integration of intelligent, miniaturized, low-power
sensor nodes in, on, or around a human body to monitor body functions and the surrounding environment.
It has great potential to revolutionize the future of healthcare technology and has attracted a number of
researchers both from the academic and industry in the past few years. WBANs support a wide
range of medical and Consumer Electronics (CE) applications. For example, WBANs provide remote
health monitoring of patients for a long period of time without any restriction on his/her normal
activities. Different nodes such as Electrocardiogram (ECG), Electromyography (EMG), and
Electroencephalography (EEG) are deployed on the human body to collect the physiological
parameters and forward them to a remote medical server for further analysis. Generally WBAN
consists of in-body and on-body area networks. An in-body area network allows communication
between invasive/implanted devices and a base station. An on-body area network, on the other hand,
allows communication between non-invasive/wearable devices and a base station. A secure WBAN
should include confidentiality and privacy, integrity and authentication, key establishment and trust
set-up, secure group management and data aggregation. However, the integration of a high-level
security mechanism in a low-power and resource-constrained sensor node increases the
computational, communication and management costs. In WBANs, both security and system
performance are equally important, and thus, designing a low-power and secure WBAN system is a
fundamental challenge to the designers. In this paper, we present a brief discussion on the major
security requirements and threats in WBANs at the Physical, Medium Access Control (MAC),
Network, and Transport layers. We start from reviewing the basic concepts of identity-based
encryption and signature schemes, and subsequently review some important identity-based
cryptographic schemes based on the bilinear pairing, a computational primitive widely used to build
up various identity-based cryptographic schemes in the current literature. Finally, we discuss how feasible
and under what conditions identity-based cryptography may be used in current and future environments
and we compare the two types of pairing(weil pairing and tate pairing).We also implement the two types
of pairing in java language and simulate it in Matlab

1. INTRODUCTION

1.1. Wireless Body Area Networking


Recent technological advances in wireless networking, microelectronics integration and miniaturization,
sensors, and the Internet allow us to fundamentally modernize and change the way health care services
are deployed and delivered. Focus on prevention and early detection of disease or optimal maintenance of
chronic conditions promise to augment existing health care systems that are mostly structured and
optimized for reacting to crisis and managing illness rather than wellness [1].

1.2. Wireless Sensor Networking


With the advent of low-power embedded systems and wireless networking, new possibilities emerged for
distributed sensing applications. These technologies led to the implementation of wireless sensor
networks, allowing easily configured, adaptable sensors to be placed almost anywhere, and their
observations similarly transported over large distances via wireless networks.
Wireless sensor networks consist of distributed, wirelessly enabled embedded devices capable of
employing a variety of electronic sensors. Each node in a wireless sensor network is equipped with one or
more sensors in addition to a microcontroller, wireless transceiver, and energy source. The
microcontroller functions with the electronic sensors as well as the transceiver to form an efficient system
for relaying small amounts of important data with minimal power consumption.

1.3. Security Challenges in Wireless Sensor Networking


Sensor networks pose unique security challenges because of their inherent limitations in communication
and computing. The deployment nature of sensor networks makes them more vulnerable to various
attacks. Sensor networks are deployed in applications where they have physical interactions with the
environment, people and other objects making them more vulnerable to security threats. We envision that
sensor networks would be deployed in mission critical applications like battlefield, security of key land
marks, building and bridges, measuring traffic flow, habitat monitoring and farming. Inherent limitations
of sensor networks can be categorized as node and network limitations. The privacy and security issues in
sensor networks raises rich research questions. Dense deployment of sensor networks in an unattended
environment makes sensor nodes vulnerable to potential attacks. Attackers can capture the sensor nodes
and compromise the network to accept malicious nodes as legitimate nodes. Once within the network,
attackers can rage variety of attacks. We expect the invention of Elliptic Curve Cryptography and bilinear
mapping will help to improving performance in low power resources.

1.4. Solutions for Security Issues


Hardware and software improvements will address these issues at some extent but complete secure sensor
networks require deployment of countermeasures such as secure key management, secure routing and
light weight encryption techniques. This paper provides an overview of security issues known so far in
wireless sensor networks. For these security issues two protocols Weil Pairing and Tate Pairing has been
established to provide better security. These two protocols uses the Supersingular Elliptic curve and
Bilinear Pairing.

1.5. Project Goal


We will implement the two protocols Tate Pairing and Weil Pairing, analysis their performance with
respect to time and memory consumption. Performance can be measured in different aspects but in this
project these two are of main concern. After performance analysis we have to implement the better one
and then use it for the security purpose. We will show that wireless sensors networks are indeed a viable
emerging technology available to engineers for a wide range of applications. We will document our
process from start to finish, enumerating the requirements for building a functional wireless sensor
network security and all supporting architecture.

2. Background of Sensor Network Technology


Researchers see WSNs as an exciting emerging domain of deeply networked systems of low-power
wireless motes with a tiny amount of CPU and memory, and large federated networks for high-resolution
sensing of the environment. Sensors in a WSN have a variety of purposes, functions, and capabilities.
The field is now advancing under the push of recent technological advances and the pull of a myriad of
potential applications. The radar networks used in air traffic control, the national electrical power grid,
and nationwide weather stations deployed over a regular topographic mesh are all examples of earlydeployment sensor networks; all of these systems, however, use specialized computers and
communication protocols and consequently, are very expensive. Much less expen-sive WSNs are now
being planned for novel applications in physical security, health care, and commerce. Sensor networking
is a multidisciplinary area that involves, among others, radio and networking, signal processing, artificial
intelligence, data-base management, systems architectures for operator-friendly infrastructure administration, resource optimization, power management algorithms, and platform technology (hardware and
software, such as operating systems). The applica-tions, networking principles, and protocols for these
systems are just beginning to be developed. The near-ubiquity of the Internet, the advancements in wireless and wireline communications technologies, the network build-out (particularly in the wireless case),
the developments in IT (such as high-power processors, large random-access memory chips, digital signal
processing, and grid computing), coupled with recent engineering advances, are in the aggregate opening
the door to a new generation of low-cost sensors and actuators that are capable of achieving high-grade
spatial and temporal resolution.
The technology for sensing and control includes electric and magnetic field sen-sors; radio-wave
frequency sensors; optical-, electrooptic-, and infrared sensors; radars; lasers; location/navigation sensors;
seismic and pressure-wave sensors; environmental parameter sensors (e.g., wind, humidity, heat); and
biochemical national securityoriented sensors. Todays sensors can be described as smart inexpensive
devices equipped with multiple onboard sensing elements; they are low-cost low-power untethered
multifunctional nodes that are logically homed to a central sink node. Sensor devices, or wireless nodes
(WNs), are also (sometimes) called motes. A stated commercial goal is to develop complete microelectromechanical systems (MEMSs)based sensor systems at a volume of 1 mm 3. Sensors are internetworked
via a series of multihop short-distance low-power wire-less links (particularly within a defined sensor
field); they typically utilize the Internet or some other network for long-haul delivery of information to a
point (or points) of final data aggregation and analysis. In general, within the sensor field, WSNs employ
contention-oriented random-access channel sharing and transmis-sion techniques that are now
incorporated in the IEEE 802 family of standards; indeed, these techniques were originally developed in
the late 1960s and 1970s expressly for wireless (not cabled) environments and for large sets of dispersed
nodes with limited channel-management intelligence. However, other channel-management techniques
are also available.
Sensors are typically deployed in a high-density manner and in large quantities: A WSN consists of
densely distributed nodes that support sensing, signal processing, embedded computing, and connectivity;
sensors are logically linked by self-organizing means (sensors that are deployed in short-hop point-topoint masterslave pair arrangements are also of interest). WNs typically transmit infor-mation to
collecting (monitoring) stations that aggregate some or all of the infor-mation. WSNs have unique
characteristics, such as, but not limited to, power constraints and limited battery life for the WNs,

redundant data acquisition, low duty cycle, and, many-to-one flows. Consequently, new design
methodologies are needed across a set of disciplines including, but not limited to, information trans-port,
network and operational management, confidentiality, integrity, availability, and, in-network/local
processing . In some cases it is challenging to collect (extract) data from WNs because connectivity to and
from the WNs may be inter-mittent due to a low-battery status (e.g., if these are dependent on sunlight to
recharge) or other WN malfunction. 3 Furthermore, a lightweight protocol stack is desired. Often, a very
large number of client units (say 64k or more) need to be supported by the system and by the addressing
apparatus.
Sensors span several orders of magnitude in physical size; they (or, at least some of their components)
range from nanoscopic-scale devices to mesoscopic-scale devices at one end, and from microscopic-scale
devices to macroscopic-scale devices at the other end. Nanoscopic (also known as nanoscale) refers to
objects or devices on the order of 1 to 100 nm in diameter; mesoscopic scale refers to objects between
100 and 10,000 nm in diameter; the microscopic scale ranges from 10 to 1000 mm, and the macroscopic
scale is at the millimeter-to-meter range. At the low end of the scale, one finds, among others, biological
sensors, small pas-sive microsensors (such as Smart Dust 4), and lab-on-a-chip assemblies. At the other
end of the scale one finds platforms such as, but not limited to, identity tags, toll collection devices,
controllable weather data collection sensors, bioterror-ism sensors, radars, and undersea submarine traffic
sensors based on sonars.5 Some refer to the latest generation of sensors, especially the miniaturized
sensors that are directly embedded in some physical infrastructure, as microsensors. A sensor network
supports any type of generic sensor; more narrowly, networked micro-sensors are a subset of the general
family of sensor networks. Microsensors with onboard processing and wireless interfaces can be utilized
to study and monitor a variety of phenomena and environments at close proximity.
Sensors can be simple point elements or can be multipoint detection arrays. Typically, nodes are equipped
with one or more application-specific sensors and with on-node signal processing capabilities for
extraction and manipulation (pre-processing) of physical environment information. Embedded network
sensing refers to the synergistic incorporation of microsensors in structures or environments; embedded
sensing enables spatially and temporally dense monitoring of the system under consideration (e.g., an
environment, a building, a battlefield). Sensors may be passive and/or be self-powered; farther down the
power-consumption chain, some sensors may require relatively low power from a battery or line feed. At
the high end of the power-consumption chain, some sensors may require very high power feeds (e.g., for
radars).
Sensors facilitate the instrumenting and controlling of factories, offices, homes, vehicles, cities, and the
ambiance, especially as commercial off-the-shelf technol-ogy becomes available. With sensor network
technology (specifically, with embedded networked sensing), ships, aircraft, and buildings can selfdetect structural faults (e.g., fatigue-induced cracks). Places of public assembly can be instrumented to
detect airborne agents such as toxins and to trace the source of the contamination should any be present
(this can also be done for ground and underground situations). Earthquake-oriented sensors in buildings
can locate poten-tial survivors and can help assess structural damage; tsunami-alerting sensors are useful
for nations with extensive coastlines. Sensors also find extensive applicability on the battlefield for
reconnaissance and surveillance.
We emphasize the emergence of open standards in support of WSNs; standardization drives
commercialization of the technology. New things gener-ally start out as advanced research projects
10

pursued at government and/or academic labs. Typically, pure and/or applied research goes on for a
number of years. At this early stage, specialized, one-of-a-kind, complex, and noninterworking
prototypes, pilots, or deployments are common. Eventually, however, if a new thing is to become a
ubiquitous technology, commercial-level open standards, chipsets, and products are needed, which must
meet commercial service- and operational-level agreements in terms of reliability, cost, usability,
durability, and simplicity. Following is a sample classification of research topics by frequency of
publication based on a fair-sized sample of recent scientific WSN articles.
Deployment

9.70%

Target tracking

7.27%

Localization

6.06%

Data gathering

6.06%

Routing and aggregation

5.76%

Security

5.76%

MAC protocols

4.85%

Querying and databases

4.24%

Time synchronization

3.64%

Applications

3.33%

Robust routing

3.33%

Lifetime optimization

3.33%

Hardware

2.73%

Transport layer

2.73%

Distributed algorithms

2.73%

Resource-aware routing

2.42%

Storage

2.42%

Middleware and task allocation

2.42%

Calibration

2.12%

characteristics

2.12%

Network monitoring

2.12%

Geographic routing

1.82%

Compression

1.82%

Taxonomy

1.52%
11

Capacity

1.52%

Link-layer techniques

1.21%

Topology control

1.21%

Mobile nodes

1.21%

Detection and estimation

1.21%

Diffuse phenomena

0.91%

Programming

0.91%

Power control

0.61%

Software

0.61%

Autonomic routing

0.30%

To appreciate the importance and criticality of simplicity-fostering standards in making a technology a


pervasive reality, one need only study the progression of late-1960s wireless random-access systems to
the present-day LANs and WLAN/2.5G/3G systems; or the early-1970s ARPAnet to the present-day
Internet; or the mid-1970s Voice Over Packet to the current Voice Over IP tech-nology or the late-1980s
video compression to the current MPEG-2 and MPEG-4 digital video transmission revolution. See Figure
1.1 for a pictorial representation of the shift in technical empha-sis over time.

Indeed, at this juncture, sensor networking is becoming a burgeoning field; there is currently extensive
interest in this discipline not only from academia and govern-ment, but also from developers,
manufacturers, startup companies, investors, and original equipment manufacturers (OEMs). According
to industry observers, the wireless sensor market is now poised to take off commercially. Current market
reports indicate that more than half a billion nodes are expected to ship for wireless sensor applications by
2010, for a market worth more than $7 billion As an example, advanced radio-frequency integrated
circuits (RFICs) are now available for $3 or less, and smart sensor integrated circuits have become

12

commonplace. In the next few years, advances in the areas of sensor design and materials that have taken
place in the recent past will lead, almost assuredly, to significant reductions in the size, weight, power
consumption, and cost of sensors and sensor arrays; these advances will also affect an increase in their
spatial and temporal resolution, along with improved measuring accuracy.
Implementations of WSNs have to address a set of technical challenges; how-ever, the move toward
standardization will, in due course, minimize a number of these challenges by addressing the issues once
and then result in off-the-shelf chip-sets and components. A current research and development (R&D)
challenge is to develop low-power communication with low-cost on-node processing and self-organizing
connectivity/protocols; another critical challenge is the need for extended temporal operation of the
sensing node despite a (typically) limited power supply (and/or battery life). In particular, the architecture
of the radio, including the use of low-power circuitry, must be properly selected. In practical terms this
implies low power consumption for transmission over low-bandwidth channels and low-powerconsumption logic to preprocess and/or compress data. Energy-efficient wireless communications
systems are being sought and are typical of WSNs. Low power consumption is a key factor in ensuring
long operating hori-zons for non-power-fed systems (some systems can indeed be power-fed and/or rely
on other power sources). Power efficiency in WSNs is generally accomplished in three ways:
Low-duty-cycle operation.
Local/in-network processing to reduce data volume (and hence transmission time).
Multihop networking reduces the requirement for long-range transmission since signal path loss is an
inverse exponent with range or distance. Each node in the sensor network can act as a repeater, thereby
reducing the link range coverage required and, in turn, the transmission power.
Conventional wireless networks are generally designed with link ranges on the order of tens, hundreds, or
thousands of miles. The reduced link range and the com-pressed data payload in WSNs result in
characteristic link budgets that differ from those of conventional systems. However, the power
restrictions, along with the desire for low node cost, give rise to what developers call profound design
challenges. Cooperative signal processing between nodes in proximity may enhance sensitivity and
specificity to environmental event detection. New CMOS (complementary metal-oxide semiconductor)
chipsets optimized for WSNs are the key to commercialization success and are, in fact, being developed.

We taxonomize (commercial) sensor networks and systems into two categories:


Category 1 WSNs (C1WSNs): almost invariably mesh-based systems with multihop radio connectivity
among or between WNs, utilizing dynamic routing in both the wireless and wireline portions of the
network. Military-theater systems typically belong to this category.
Category 2 WSNs (C2WSNs): point-to-point or multipoint-to-point (star-based) systems generally with
single-hop radio connectivity to WNs, utilizing static routing over the wireless network; typically, there
13

will be only one route from the WNs to the companion terrestrial or wireline forwarding node (WNs are
pendent nodes). Residential control systems typically belong to this category.
C1WSNs support highly distributed high-node-count applications (e.g., environ-mental monitoring,
national security systems); C2WSNs typically support con-fined short-range spaces such as a home, a
factory, a building, or the human body. C1WSNs are different in scope and/or reach from evolving
wireless C2WSN technology for short-range low-data-rate wireless applications such as RFID (radiofrequency identification) systems, light switches, fire and smoke detectors, thermostats, and, home
appliances. C1WSNs tend to deal with large-scale multipoint-to-point systems with massive data flows,
whereas C2WSNs tend to focus on short-range point-to-point, source-to-sink applications with uniquely
defined transaction-based data flows.
For a number of years, vendors have made use of proprietary technology for collecting performance data
from devices. In the early 2000s, sensor device sup-pliers were researching ways of introducing
standardization. WNs typically trans-mit small volumes of simple data (e.g., Is the temperature at the set
level or lower?). For within-building applications, designers ruled out Wi-Fi (wireless fidelity, IEEE
802.11b) standards for sensors as being too complex and supporting more bandwidth than is actually
needed for typical sensors. Infrared systems require line of sight, which is not always achievable;
Bluetooth (IEEE 802.15.1) technology was at first considered a possibility, but it was soon deemed too
com-plex and expensive. This opened the door for a new standard IEEE 802.15.4 along with ZigBee
(more specifically, ZigBee comprises the software layers above the newly adopted IEEE 802.15.4
standard and supports a plethora of applications). C2WSNs have lower layers of the communication
protocol stack (Physical and Media Access Control), which are comparable to that of a personal area
network (PAN), defined in the recently developed IEEE 802.15 standard: hence, the utiliza-tion of these
IEEE standards for C2WSNs. IEEE 802.15.4 operates in the 2.4-GHz industrial, scientific, and medical
(ISM) radio band and supports data transmission at rates up to 250 kbps at ranges from 30 to 200 ft.
ZigBee/IEEE 802.15.4 is designed to complement wireless technologies such as Bluetooth, Wi-Fi, and
ultra-wideband (UWB), and is targeted at commercial point-to-point sensing applica-tions where cabled
connections are not possible and where ultralow power and low cost are requirements.
With the emergence of the ZigBee/IEEE 802.15.4 standard, systems are expected to transition to
standards-based approaches, allowing sensors to transfer information in a standardized manner. C2WSNs
(and C1WSN, for that matter) that operate outside a building and over a broad geographic area may make
use of any number of other standardized radio technologies. The (low-data-rate) C2WSN market is
expected to grow significantly in the near future: The volume of low-data-rate wireless devices is forecast
to be three times the size of Wi-Fi by the turn of the decade, due to the expected deployment of the
systems based on the ZigBee/IEEE 802.15.4 standard (industry observers expect the number of ZigBeecompliant nodes to increase from less than 1 million in 2005 to 100 million in 2008). A discussion of both
categories of technology, C1WSNs and C2WSNs, is provided in this book, but the reader should keep in
mind that the technical issues affecting these two areas are, to a large degree, different.
There is also considerable research in the area of mobile ad hoc networks (MANETs). WSNs are similar
to MANETs in some ways; for example, both involve multihop communications. However, the
applications and technical requirements for the two systems are significantly different in several respects :
The typical mode of communication in WSN is from multiple data sources to a data recipient or sink
(somewhat like a reverse multicast) rather than communication between a pair of nodes. In other words,
14

sensor nodes use primarily multicast or broadcast communication, whereas most MANETs are based on
point-to-point communications. In most scenarios (applications) the sensors themselves are not mobile
(although the sensed phenomena may be); this implies that the dynamics in the two types of networks are
different. Because the data being collected by multiple sensors are based on common phenomena, there is
potentially a degree of redundancy in the data being communicated by the various sources in WSNs; this
is not generally the case in MANETs.
Because the data being collected by multiple sensors are based on common phenomena, there is
potentially some dependency on traffic event generation in WSNs, such that some typical random-access
protocol models may be inadequate at the queueing-analysis level; this is generally not the case in
MANETs.
A critical resource constraint in WSNs is energy; this is not always the case in MANETs, where the
communicating devices handled by human users can be replaced or recharged relatively often. The scale
of WSNs (especially, C1WSNs) and the necessity for unattended operation for periods reaching weeks or
months implies that energy resources have to be managed very judiciously. This, in turn, precludes highdata-rate transmission.
The number of sensor nodes in a sensor network can be several orders of magnitude higher than the nodes
in a MANET.
For these reasons the plethora of routing protocols that have been proposed for MANETs are not suitable
for WSNs, and alternative approaches are required [1.48]. Note that MANETs per se are not discussed
further in this book.
Others also study wireless mesh networks (WMNs) (for an exten-sive tutorial). Wi-Fi-based WMNs are
being applied as hot zones, which cover a broad area such as a downtown city district. Although WMNs
have many of the same networking characteristics as WSNs, their application can, in principle, be more
general. Also, a fairly large fraction of the commercial WSNs of the near future are expected to be of the
C1WSN category, which does not (obligatorily) require or entail meshing. Like WSNs, WMNs can use
off-the-shelf radio technology such as Wi-Fi, WiMax (worldwide interoperability for microwave access),
and cellular 3G. As an observation, the topic of network mobility (NEMO) is unrelated to WSNs in
general terms. NEMO is concerned with managing the mobility of an entire network, which changes, as a
unit, its point of attachment to the Internet and thus its reach-ability in the topology. The mobile network
includes one or more mobile routers which connect it to the global Internet. A mobile network is assumed
to be a leaf network, i.e., it will not carry transit traffic. As should be clear by now, the focus of this book
is on WSNs; hence, we do not spend any time covering WMNs.

15

3. Description of Work Done


3.1. Definition:
A body area network (BAN), also referred to as a wireless body area network (WBAN) or a body sensor
network (BSN), is a wireless network of wearable computing devices. In particular, the network consists
of several miniaturized body sensor units (BSUs) together with a single body central unit (BCU). The
development of WBAN technology started around 1995 around the idea of using wireless personal area
network (WPAN) technologies to implement communications on, near, and around the human body.
About six years later, the term "BAN" came to refer systems where communication is entirely within, on,
and in the immediate proximity of a human body. A WBAN system can use WPAN wireless technologies
as gateways to reach longer ranges.
3.2. Challenges:
Sensor nodes are Low energy devices - The sensors used in WBAN would have to be low on complexity,
small in form factor, light in weight, power efficient, easy to use and reconfigurable. Further, the storage
devices need to facilitate remote storage and viewing of patient data as well as access to external
processing and analysis tools via the Internet.
Security threats - The sensors should ensure the key security requirements such that, Data confidentiality,
Data integrity, Data authentication, Data freshness, Secure localization, Availability, Secure management.
Data consistency - Data residing on multiple mobile devices and wireless patient notes need to be
collected and analysed in a seamless fashion. Within body area networks, vital patient datasets may be
fragmented over a number of nodes and across a number of networked PCs or Laptops. If a medical
practitioners mobile device does not contain all known information then the quality of patient care may
degrade.
Interference - The wireless link used for body sensors should reduce the interference and increase the
coexistence of sensor node devices with other network devices available in the environment. This is
especially important for large scale implementation of WBAN systems.
Cost - Today's consumers expect low cost health monitoring solutions which provide high functionality.
WBAN implementations will need to be cost optimized to be appealing alternatives to health conscious
consumers.
Consistent performance - The performance of the WBAN should be consistent. Sensor measurements
should be accurate and calibrated, even when the WBAN is switched off and switched on again. The
wireless links should be robust and work under various user environments

16

3.3. security Issues and Recuirements:


A WBAN is a special type of network which shares some characteristics with traditional WSNs but
differs in many others such as strict security and low-power consumption. It is mandatory to understand
the type of WBAN applications before the integration of a suitable security mechanism. The key security
requirements in WBANs are discussed below.
Data Confidentiality: Data confidentiality is considered to be the most important issue in WBANs. It is
required to protect the data from disclosure. WBANs should not leak patients vital information to
external or neighbouring networks. In medical applications, the nodes collect and forward sensitive data
to the coordinator. An adversary can eavesdrop on the communication, and can overhear the critical
information. This eavesdropping may cause severe damage to the patient since the adversary can use the
acquired data for many illegal purposes. The standard approach to protect the data secure is to encrypt it
with a secure key that can only be decrypted by the intended receivers. The use of symmetric key
encryption is the most reliable for WBANs since public-key cryptography is too costly for the energyconstraint sensor nodes.
Data Integrity: Keeping the data confidential does not protect it from external modifications. An
adversary can always alter the data by adding some fragments or by manipulating the data within a
packet. This packet can later be forwarded to the coordinator. Lack of data integrity mechanism is
sometimes very dangerous especially in case of life-critical events (when emergency data is altered). Data
loss can also occur due to bad communication environment.
Data Authentication: It confirms the identity of the original source node. Apart from modifying the data
packets, the adversary can also change a packet stream by integrating fabricated packets. The coordinator
must have the capability to verify the original source of data. Data authentication can be achieved using a
Message Authentication Code (MAC) (to differentiate it from Medium Access Control (MAC), the
Message Authentication Code (MAC) is represented by bold letters) that is generally computed from the
shared secret key.
Data Freshness: The adversary may sometimes capture data in transit and replay them later using the old
key in order to confuse the coordinator. Data freshness implies that the data is fresh and that no one can
replay old messages. There are two types of data freshness: weak freshness, which guarantees partial data
frames ordering but does not guarantee delay, and strong freshness, which guarantees data frames
ordering as well as delay.
Secure Localization: Most WBAN applications require accurate estimation of the patients location. Lack
of smart tracking mechanisms allow an attacker to send incorrect reports about the patients location
either by reporting false signal strengths or by using replaying signals.
Availability: Availability implies efficient availability of patients information to the physician. The
adversary may target the availability of WBAN by capturing or disabling a particular node, which may
sometimes result in loss of life. One of the best ways is to switch the operation of a node that has been
attacked to another node in the network.

17

Secure Management: Secure management is required at the coordinator to provide key distribution to the
nodes for encryption and decryption operation. In case of association and disassociation, the coordinator
adds or removes the nodes in a secure manner.

3.4. Security Threats in different Layers:


These attacks are conducted in different ways, i.e., Denial of Service (DoS) attacks, privacy violation, and
physical attacks. Due to restrictions on the power consumption of the sensor nodes, protection against
these types of attacks is a challenging task. A powerful sensor can easily jam a sensor node and can
prevent it from collecting patients data on regular basis.

Attacks on WBAN can be classified into three main categories:


Attacks on secrecy and authentication where an adversary performs
eavesdropping, packet
replay attacks, or spoofing of packets
Attacks on service integrity, where the network is forced to accept false information
Attacks on network availability (DoS attacks), where the attacker tries to reduce the networks
capacity.

18

In the following section, we briefly present most important DoS attacks at physical, data link, network,
and transport layers. A brief summary of these attacks is given in Table 1:

Layers

DoS Attacks

Defenese

Physical

Jamming

Spread-spectrum,
priority
messages, lower duty cycle,
region mapping,

Tampering

Tamper-proof, hiding
Link

Network

Collision

Error correcting code

Unfairness

Small frames

Exhaustion

Rate limitation

Spoofing

Encryption

Selective Forwarding

Transport

Egress filtering, authorization


monitoring

Sybil

Authorization,
redundancy

Flooding

Client Puzzles

De-synchronization

Authentication

monitoring,

Physical Layer:
Main responsibilities of physical layer include frequency selection and generation, signal detection,
modulation, and encryption. Since the medium is radio-based, jamming the network is always possible.
The most common attacks are jamming and tampering. Jamming refers to interference with the radio
frequencies of the nodes. The jamming source can be powerful enough to disrupt the entire network.
Tampering refers to the physical attacks on the sensor nodes. However, nodes in WBAN are deployed in
close proximity to the human body, and this reduces the chances of physical tampering.

19

Data Link Layer Attacks:


This layer is responsible for multiplexing, frame detection, channel access, and reliability. Attacks on this
layer include creating collision, unfairness in allocation, and resource exhaustion. Collision occurs when
two or more nodes attempt to transmit at the same time. An adversary may strategically create extra
collisions by sending repeated messages on the channel. Unfairness degrades the network performance by
interrupting the MAC priority schemes. Exhaustion of battery resources may occur when a selfsacrificing node always keeps the channel busy.

Network Layer Attacks:


The nodes in WBAN are not required to route the packets to other nodes. Routing is possible when
multiple WBANs communicate with each other through their coordinators. Possible attacks are spoofing,
selective forwarding, sybil, and hello flood. In spoofing, the attacker targets the routing information and
alters it to disrupt the network. In selective forwarding, the attacker forwards selective messages and
drops the others. In sybil, the attacker represents more than one identity in the network. The hello flood
attacks are used to fool the network

Transport Layer Attacks:


The attacks on the transport layer are flooding and de-synchronisation. In flooding, the attacker
repeatedly places requests for connection until the required resources are exhausted or reach a maximum
limit. In de-synchronisation, the attacker forges messages between nodes causing them to request the
transmission of missing frames.

3.5. Possible solutions:


3.5.1. Using IBE Scheme
Identity Based Encryption:
In IBE scheme, the sender Alice can use the receiver's identifier information which is
represented by any string, such as email or IP address to encrypt a message. The receiver Bob, having
obtained a private key associated with his identifier information from the trusted third party called the
Private Key Generator (PKG)", can decrypt the ciphertext.

20

Receiver

Fig 3.1 Identity-Based Encryption


IBE scheme have 4 steps:
SETUP: The PKG creates its master (private) and public key pair, which we denote by skPKG and
pkPKG respectively. (Note that pkPKG is given to all the interested parties and remains as a constant
system parameter for a long period.)
PRIVATE KEY EXTRACTION: The receiver Bob authenticates himself to the PKG and obtains a
private key skIDBob associated with his identity IDBob.
ENCRYPTION: Using Bob's identity ID Bob and the PKG's pkPKG, the sender Alice encrypts her plain
text message M and obtains a ciphertext C
DECRYPTION: Upon receiving the ciphertext C from Alice, Bob
skIDBob to recover the plaintext M.

decrypts it using his private key

3.5.2. Using Elliptic Curve:


The capabilities of Wireless Sensor Network (WSN) are unveiling with each passing day. Extensive use
of WSNs is giving rise to different types of threats. To defend against the threats proper security schemes
are required. Limited area, power and memory of WSNs implement strict constraints on the selection of
cryptographic techniques. Elliptic Curve Cryptography (ECC) is the best candidate due to its smaller key
size. High security despite of smaller key size results in area and power efficient crypto systems. This
paper describes the hardware implementation of Elliptic Curve based asymmetric cryptosystem for
wireless sensor networks. The field used for elliptic curve is defined over prime number. ECC scheme is
secure against passive attacks under the discrete logarithm assumption. The main cost of the algorithm
for the case of ECC is just one point multiplication therefore it is much low cost algorithm and suitable
for low power resource constraint sensor nodes. ECC processors can be designed in such a way to qualify
for lightweight applications suitable for wireless sensor networks.

21

3.5.3. Using Bilinear Pairing:


Definition: The admissible bilinear pairing is defined over two groups of the same prime order
q denoted by G and F. We will use an additive notation to describe the operation in G while we
will use a multiplicative notation for the operation in F. In practice, the group G is implemented
using a group of points on certain elliptic curves, each of which has a small MOV exponent , and
the group F will be implemented using a subgroup of the multiplicative group of a finite field. The
admissible bilinear map, denoted by : G * G F, has the following properties.

Bilinear: (aR1,bR2)=(R1,R2)ab,where R1,R2

G and a,b

Zq*

Non-Degenerate: does not send all pairs of points in G * G to the identity in F. (Hence, if R is a
generator of G then (R;R) is a generator of F.)
Computable: For all R1;R2

G, the map (R1;R2) is eficiently computable.

Properties:

Diffie-Hellman Problem: Given( G, q, , P, aP, cP) where a,b and c are choosen at random from Z q*
compute (P,P)abc. The BDH assumption means that the above problem is computationally intractable.
Decision Diffie-Hellman Problem: The Decision Diffie Hellman Problem is easy in G 1 because c =
ab(mod q) iff, (G, cG) = (aG, bG)

Types of Bilinear Pairing:

Weil Pairing:

Definition: In mathematics, the Weil pairing is a pairing on the points of order dividing n of an elliptic
curve E, taking values in nth roots of unity. More generally there is a similar weil pairing between points
of order n of an abelian variety and its dual.

22

23

Tate Pairing:

Tate pairing is essentially a bilinear map from G1 * G2 G3 where


G1 =

S[q], G2 =T[q] and G3 is the multiplicative group of GF(p2)

Tate pairing is evaluated in two steps:1. Computation of Miller fuction


2. Lucas sequence approach

24

Stages of ID based Tate pairing:1. Setup


2. Extract(Registration)
3. Encrypt
4. Decrypt
1. Setup:PKG generates a prime p, the elliptic curve E/GF(p) with order n= #E/GF(p)
Generate a torsion group of prime order q such that q|n
PKG selects a random master secret key s in range 0<s<q

2. Extract(Registration):Alice submits her identity (its may be IP address or alice@gmail.com) to PKG


PKG convert its to a string ID belongs to {0,1}* and maps it to an element x of GF(p) through H1(ID)
x is used to find a point (Q_ida) on the torsion group S[q]
PKG computes a point S_ida belongs to S[q] as S_ida=[s]Q_ida
PKG sends the alice (p, q, P, Q, Q_ida, S_ida)

3. Encrypt:Alice computes Q_idb of Bob knowing public parameters p,q,P,Q and Bobs identity.
Alice selects a random no r in range 0<r<q
Computes C1=[r]P and C2 = m.e(Q_idb, (q))r
4. Decrypt:Bob receives the ciphertext (C1, C2 )
Computes m`= C2 * e(S_ida, (C1 )-1
Check if m=m` or not

25

4. Performance Analysis:
4.1. Tate Memory Analysis

Fig 4.1 Tate Memory Analysis

26

4.2. Weil Memory Analysis

Fig 4.2 Weil Memory Analysis

27

4.3. Tate Pairing Run Time Analysis

Fig 4.3 Tate Pairing Run Time Analysis

28

4.4. Weil Pairing Run Time Analysis

Fig 4.3Weil Pairing Run Time Analysis

29

5. Comparative Chart

Subject

Tate

Weil

Memory requirements

According to the performance


analysis Tate pairing requires less
memory

According to the performance


analysis Weil pairing requires
more memory

Complexity

Tate pairing uses only one


bilinear pairing and thus have
less run time.

Weil pairing requires two bilinear


pairing and two hash functions
and thus requires more than
twice of the Tate pairing run
time.

Security

Tate Pairing uses supersingular


Elliptic curve and torsion groups
and thereby providing larger
security.

Weil Pairing uses elliptic curve


and directly uses random number
generations and thus is less
secure.

30

6. Conclusion

Wireless Sensor networks have become promising future to many applications. In the absence of adequate
security, deployment of sensor networks is vulnerable to variety of attacks. Sensor nodes limitations and
nature of wireless communication poses unique security challenges. Current research in sensor network
security is mostly built on a trusted environment [12]; however there are several research challenges
remain unanswered before we can trust on sensor networks. In this paper we have discussed threat models
and unique security issues faced by wireless sensor networks. On the basis of our observation we
motivate the need of a security framework to provide countermeasures against attacks in wireless sensor
networks.

31

7. Future Works

In future this work can be applied to a huge number of medical applications, and will develop a new way
of medical science, speedup the diagnosis process.

Role of smart phone : Despite all the advances in medical diagnostics, two-thirds of the world's
population has no access to imaging technologies. Worse, about half of the imaging equipment
sent to developing countries goes unused because local technicians aren't trained to operate it or
lack spare parts, according to the World Health Organization. But thanks to the proliferation of
cellular and other wireless networks, researchers are stepping up efforts to deliver crucial medical
services from afar. The University of California Bioengineering professor, says that by reducing a
complex electromagnetic imaging machine to a portable electromagnetic scanner that can work in
tandem with a regular cell phone and a computer, he has essentially replicated a $10,000 piece of
equipment for just hundreds of dollars. The mobile scanner plugs into the phone, which beams
the data to the computer, generating an image that can be transmitted to a doctor or hospital far
away.

Android Platform: Due to the invention of smart phone we can implement these features in
android platform.

32

8. Appendix:
8.1. Source code for Tate Pairing
/*
* To change this license header, choose License Headers in Project
Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
import java.math.BigInteger;
import java.util.Random;
import java.util.Scanner;
import java.security.spec.*;
import it.unisa.dia.gas.jpbc.*;
import it.unisa.dia.gas.*;
import it.unisa.dia.gas.plaf.jpbc.field.curve.CurveField;
import it.unisa.dia.gas.plaf.jpbc.pairing.PairingFactory;
import it.unisa.dia.gas.plaf.jpbc.pairing.a.TypeACurveGenerator;
import it.unisa.dia.gas.plaf.jpbc.pairing.a.TypeAPairing;
import java.security.SecureRandom;
import
it.unisa.dia.gas.plaf.jpbc.pairing.a.TypeATateAffineMillerPairingMap;
import java.util.HashSet;

class TatePKG
{
//fields
public static BigInteger p;
public static BigInteger q;
private static BigInteger s;
final static int k = 2;
public static HashSet<BigInteger> group;
public static HashSet<BigInteger> torGroup;
33

//methods
static void initializer()
{
initialization();
}
static void initialization()
{
Random rand = new Random();
// initializing prime numner p and generate a group of order p
p = BigInteger.probablePrime(504, rand);
BigInteger e = BigInteger.probablePrime(10, rand);
group = new HashSet<BigInteger>();
BigInteger elem = BigInteger.ONE.modPow(e,p);
for(int i=2; !group.contains(elem); i++)
{
for (int e1 = 1; e1 <= e.intValue();e1++)
{
group.add(elem);
elem =
BigInteger.valueOf(i).modPow(BigInteger.valueOf(e1),p);
}
}
// initializing prime number q and generate the torsion group
of order q
q = BigInteger.probablePrime(160, rand);
e = BigInteger.probablePrime(10, rand);
torGroup = new HashSet<BigInteger>();

34

elem = BigInteger.ONE.modPow(e,q);
for(int i=2; !torGroup.contains(elem); i++)
{
for (int e1 = 1; e1 <= e.intValue();e1++)
{
torGroup.add(elem);
elem =
BigInteger.valueOf(i).modPow(BigInteger.valueOf(e1),q);
}
}
// initializing master key s
do {
s = new BigInteger(q.bitLength(), rand);
} while (s.compareTo(q) >= 0);
}
static BigInteger getPublicKey(String id)
{
int hcd = id.hashCode();
BigInteger Q = BigInteger.valueOf(hcd);
int i=2;
while (!group.contains(Q))
{
Q.divide(BigInteger.valueOf(i-1));
Q.multiply(BigInteger.valueOf(i));
i++;
}
BigInteger Qid = Q;
return Qid;
}
static BigInteger getPrivateKey(BigInteger Qid)
{
35

BigInteger Did = s.multiply(Qid);


if(!torGroup.contains(Did)) {
System.out.println("private key exists in the tortion
group");
}
System.out.println(Did);
return Did;
}
}

public class TSensor {


private static TypeATateAffineMillerPairingMap
TypeATateAffineMillerPairingMap(TypeAPairing tap) {
throw new UnsupportedOperationException("Not supported yet.");
//To change body of generated methods, choose Tools | Templates.
}
/**
* @param args the command line arguments
*/
BigInteger message;
BigInteger cipher[];
public String ID;
public BigInteger publicKey;
private BigInteger privateKey;
TSensor()
{
Scanner scn = new Scanner(System.in);
String sensName = this.toString();
System.out.println("Enter the sub ID :- ");
int subID = scn.nextInt();

36

ID = sensName+subID;
System.out.println(ID);
publicKey = TatePKG.getPublicKey(ID);
privateKey = TatePKG.getPrivateKey(publicKey);
message = BigInteger.ZERO;
cipher = new BigInteger[2];
cipher[0]=null;
cipher[1]=null;
}
public void senderSide(TSensor recvr)
{
this.message = getMessage();
Random rand = new Random();
BigInteger r = BigInteger.probablePrime(6,rand);
BigInteger p = TatePKG.p;
cipher = encrypt(this.message, r, p, recvr.publicKey);
sendMessage(recvr, cipher);
}
public BigInteger getMessage()
{
Scanner scn = new Scanner(System.in);
System.out.println("Enter the readings (message) :- ");
return scn.nextBigInteger();
}
public BigInteger[] encrypt(BigInteger m, BigInteger r, BigInteger
p, BigInteger Qid)
{
BigInteger C1 = r.multiply(p);
BigInteger rQid = r.multiply(Qid);
Element elem = pairingResult(rQid,TatePKG.q);
BigInteger C2 = m.multiply(elem.toBigInteger());
37

BigInteger[] c = {C1,C2};
return c;
}
public static Element pairingResult (BigInteger bi1, BigInteger
bi2){
SecureRandom rand = new SecureRandom();
int rbits = 160;
int qbits = 512;
// initialize the initial parameters' lengths in bit
CurveGenerator crvGen = new TypeACurveGenerator(rbits,
qbits);
//crvgen is used to generate the elliptic curve over which
the Weil Pairing will take place
CurveParameters params = crvGen.generate();
// generate the curve parameters
System.out.println(params);
PairingFactory.getInstance().setUsePBCWhenPossible(true);
// make PairingFactory instace which will help to generate
the parameters and the pairing environments
Pairing pairing = PairingFactory.getPairing(params, rand);
// first creating the initial pairing to access and create
object of the Element interaces
TypeAPairing tap = new TypeAPairing(params);
//generate the bilinear pairing object
TypeATateAffineMillerPairingMap tatep =
TypeATateAffineMillerPairingMap(tap);

38

//generate the Tate Pairing object


Element in11 = pairing.getG1().newElement(bi1);
Element in12 = pairing.getG1().newElement(bi1);
Element in1[] = {in11,in12};
Element in21 = pairing.getG1().newElement(bi2);
Element in22 = pairing.getG1().newElement(bi2);
Element in2[] = {in21,in22};
//create two arrays of elements
Element out = tatep.pairing(in1, in2);
//get the resulting element from the pairing
return out;
//return the resulting element
}
public void sendMessage(TSensor s2, BigInteger[] c)
{
s2.cipher = this.cipher;
s2.receiverSide();
}
public void receiverSide()
{
decrypt(this.cipher);
}
public void decrypt(BigInteger[] c)
{
BigInteger C1 = c[0];
BigInteger C2 = c[1];
Element elem = pairingResult(this.privateKey,C1);
this.message = C2.xor(elem.toBigInteger());

39

}
public static void main(String[] args)
{
TatePKG.initializer();
//initialize the Public Key Generator PKG
TSensor sens1 = new TSensor();
// create the sensor which will act as the sender
TSensor sens2 = new TSensor();
// create the sensor which will act as the receiver
sens1.senderSide(sens2);
// start the communication by calling the senderSide()
method
}
}

40

8.2. Source code for Weil Pairing


/*
* To change this license header, choose License Headers in Project
Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
import it.unisa.dia.gas.jpbc.CurveGenerator;
import it.unisa.dia.gas.jpbc.CurveParameters;
import it.unisa.dia.gas.jpbc.Element;
import it.unisa.dia.gas.jpbc.Pairing;
import it.unisa.dia.gas.plaf.jpbc.pairing.PairingFactory;
import it.unisa.dia.gas.plaf.jpbc.pairing.a.TypeACurveGenerator;
import it.unisa.dia.gas.plaf.jpbc.pairing.a.TypeAPairing;
import java.math.BigInteger;
import java.security.SecureRandom;
import java.util.Random;
import java.util.Scanner;
class PKG
{
//fields
public static BigInteger P;
private static BigInteger s;
public static BigInteger Ppkg;

static void initializer()


{
initialization();
}
private static void initialization()

41

{
Random rand = new Random();
P = BigInteger.probablePrime(4,rand);
s = BigInteger.probablePrime(10,rand);
String str =

""+s+P;

int i = Integer.parseInt(str);
Ppkg = BigInteger.valueOf(i);
}
static BigInteger getPublicKey(String id)
{
int hcd = id.hashCode();
BigInteger Qid = BigInteger.valueOf(hcd);
return Qid;
}
static BigInteger getPrivateKey(BigInteger Qid)
{
String str = ""+s+Qid;
BigInteger Did = new BigInteger(str);
System.out.println(Did);
return Did;
}
}

public class WSensor{


BigInteger message;
BigInteger cipher[];
public String ID;
public BigInteger publicKey;
private BigInteger privateKey;
42

WSensor()
{
Scanner scn = new Scanner(System.in);
String sensName = this.toString();
System.out.println("Enter the sub ID :- ");
int subID = scn.nextInt();
ID = sensName+subID;
System.out.println(ID);
publicKey = PKG.getPublicKey(ID);
privateKey = PKG.getPrivateKey(publicKey);
message = BigInteger.ZERO;
cipher = new BigInteger[2];
cipher[0]=null;
cipher[1]=null;
}
/**
*
* @param recvr
*/
public void senderSide(WSensor recvr)
{
this.message = getMessage();
Random rand = new Random();
BigInteger r = BigInteger.probablePrime(6,rand);
BigInteger p = PKG.P;
cipher = encrypt(this.message, r, p, recvr.publicKey);
sendMessage(recvr, cipher);
}
/**
*
43

* @param m
* @param r
* @param p
* @param Qid
* @return
*/
public BigInteger[] encrypt(BigInteger m, BigInteger r, BigInteger
p, BigInteger Qid)
{
BigInteger U = r.and(p);
BigInteger rQid = r.and(Qid);
Element elem = pairingResult(rQid,PKG.Ppkg);
BigInteger V = elem.toBigInteger().xor(message);
BigInteger[] c = {U,V};
return c;
}
/**
*
*/
public void receiverSide()
{
decrypt(this.cipher);
}
/**
*
* @param c
*/
public void decrypt(BigInteger[] c)
{
BigInteger U = c[0];
BigInteger V = c[1];
Element elem = pairingResult(U, this.privateKey);
this.message = V.xor(elem.toBigInteger());
44

}
/**
*
* @return
*/
public BigInteger getMessage()
{
Scanner scn = new Scanner(System.in);
System.out.println("Enter the readings (message) :- ");
return scn.nextBigInteger();
}
/**
*
* @param s2
* @param c
*/
public void sendMessage(WSensor s2, BigInteger[] c)
{
s2.cipher = this.cipher;
s2.receiverSide();
}
/**
*
* @param bi1
* @param bi2
* @return
*/
public static Element pairingResult (BigInteger bi1,
BigInteger bi2){
SecureRandom rand = new SecureRandom();
int rbits = 160;
45

int qbits = 512;


// initialize the initial parameters' lengths in bit
CurveGenerator crvGen = new TypeACurveGenerator(rbits,
qbits);
//crvgen is used to generate the elliptic curve over which
the Weil Pairing will take place
CurveParameters params = crvGen.generate();
// generate the curve parameters
System.out.println(params);
PairingFactory.getInstance().setUsePBCWhenPossible(true);
// make PairingFactory instace which will help to generate
the parameters and the pairing environments
Pairing pairing = PairingFactory.getPairing(params, rand);
// first creating the initial pairing to access and create
object of the Element interaces
TypeAPairing tap = new TypeAPairing(params);
//generate the necessary parameters
Element in1 = pairing.getG1().newElement(bi1);
Element in2 = pairing.getG1().newElement(bi2);
//two elements ar created of the given value
Element out = tap.pairing(in1, in2);
//get the resulting element from the pairing
return out;
//return the resulting element
}

46

public static void main(String args[]){


PKG.initializer();
//initialize the Public Key Generator PKG
WSensor sens1 = new WSensor();
// create the sensor which will act as the sender
WSensor sens2 = new WSensor();
// create the sensor which will act as the receiver
sens1.senderSide(sens2);
// start the communication by calling the senderSide()
method
}
}

47

9. References
[1] L. Eschenauer and V. Gligor, A key-management scheme for distributed sensor networks, Proceedings
of the 9th ACM conference on Computer and Communication Security 2002, Washington DC, USA
[2] C.P. Fleeger, Security in computing, 3rd edition, Prentice-Hall Inc. NJ. 2003
[3] J. Undercoffer, S. Avancha, A. Joshi, and J. Pinkston, Security for sensor networks, 2002 CADIP
Research Symposium.
[4] C. Karlof and D. Wagner, Secure routing in wireless sensor networks: Attacks and Countermeasures,
Elseviers Ad Hoc Networks Journal, Special Issue on Sensor Network Applications and Protocols, Vol. 1,
No. 2-3, pp. 293-315, 2003.
[5] Y.W. Law and P. J.M Havinga, How to secure sensor network, Proceeding of the 2005 International
Conference on Sensor Networks and Information Processing, 5-8 Dec. 2005 pp. 89-95
[6] D. Wagner, Resilient aggregation in sensor networks, In Proceedings of the 2nd ACM workshop on
Security of ad hoc and sensor networks. ACM Press, 2004, pp. 78-87.
[7] D. Ganesan, A. Cerpa, Y. Yu, and D. Estrin, Networking issues in wireless sensor networks, Journal of
Parallel and Distributed Computing (JPDC), Special issue on Frontiers in Distributed Sensor Networks.
Vol. 64, 2004.
[8] L.V. Hoesel and P. Havinga, A Lightweight Medium Access Protocol (LMAC) for wireless sensor
networks: reducing preamble transmissions and transceiver state switches, in the proceedings of INSS,
June 2004.
[9] C. karlof, N. Shastry and D. Wagner, TinySec: A link layer security architecture for wireless sensor
networks, SenSys04, November 3-5 2004, Baltimore, Maryland, USA
[10] H. Chan, A. Perrig, Security and privacy in sensor networks, IEEE Journal of Computing, Vol. 36,
Issue 10, Oct. 2003, pp. 103-105
[11] F. Stajano,Security for Ubiquitous Computing, John Wiley and Sons, NY 2002, ISBN:0-470-844930
[12] E. Shi, and A. Perrig, Designing secure sensor networks, Journal of IEEE Wireless Communications,
Vol. 11, Issue 6, Dec. 2004 pgs 38-43.
[13] N. Hu, Randy R. K. Smith and P. G. Bradford, Security for Fixed Sensor Networks, Proceedings of
the 42nd annual Southeast regional conference, ACM Press, 2004, NY, USA
[14] R. Anderson, H. Chan, and A. Perrig, Key infection: smart trust for smart dust, 12th IEEE
International Conference on Network Protocols. Oct 5-8 2004, Berlin, Germany
[15] A. Perrig, J Stankovic, D. Wagner, Security in wireless sensor network, Communication of the ACM,
Vol.47, No. 6, 2004

48

You might also like