hop by hop message authentication chapter 1
Message authentication plays a key role in thwarting unauthorized and corrupted messages
from being forwarded in networks to save the precious sensor energy. For this reason, many
authentication schemes have been proposed in literature to provide message authenticity and
integrity verification for wireless sensor networks [WSNs]. These schemes can largely be divided
into two categories public-key based approaches and symmetric-key based approaches.
The symmetric-key based approach requires complex key management, lacks of
scalability, and is not resilient to large numbers of node compromise attacks since the message
sender and the receiver have to share a secret key. The shared key is used by the sender to generate
a message authentication code [MAC] for each transmitted message. However, for this method,
the authenticity and integrity of the message can only be verified by the node with the shared secret
key, which is generally shared by a group of sensor nodes. An intruder can compromise the key
by capturing a single sensor node. In addition, this method does not work in multicast networks.
To solve the scalability problem, a secret polynomial based message authentication scheme
was introduced in. The idea of this scheme is similar to a threshold secret sharing, where the
threshold is determined by the degree of the polynomial. This approach offers information-
theoretic security of the shared secret key when the number of messages transmitted is less than
the threshold. The intermediate nodes verify the authenticity of the message through a polynomial
evaluation. However, when the number of messages transmitted is larger than the threshold, the
polynomial can be fully recovered and the system is completely broken.
An alternative solution was proposed in to thwart the intruder from recovering the
polynomial by computing the coefficients of the polynomial. The idea is to add a random noise,
also called a perturbation factor, to the polynomial so that the coefficients of the polynomial cannot
be easily solved. However, a recent study shows that the random noise can be completely removed
from the polynomial using error-correcting code techniques.
For the public-key based approach, each message is transmitted along with the digital
signature of the message generated using the sender’s private key. Every intermediate forwarder
and the final receiver can authenticate the message using the sender’s public key. One of the
limitations of the public-key based scheme is the high computational overhead. The recent
progress on elliptic curve cryptography [ECC] shows that the public-key schemes can be more
advantageous in terms of computational complexity, memory usage, and security resilience, since
public-key based approaches have a simple and clean key management.
The unconditionally secure and efficient source anonymous message authentication [SAMA]
scheme based on the optimal modified, ElGamal signature [MES] scheme on elliptic curves. This
MES scheme is secure against adaptive chosen-message attacks in the random oracle model. The
intermediate nodes to authenticate the message so that all corrupted message can be detected and
dropped to conserve the sensor power. While achieving compromise-resiliency, flexible-time
authentication and source identity protection, our scheme does not have the threshold problem.
Both theoretical analysis and simulation results demonstrate that our proposed scheme is more
efficient than the polynomial-based algorithms under comparable security levels. The major
contributions of this paper are the following:
1) To develop a source anonymous message authentication code (SAMAC) on elliptic curves that
can provide unconditional source anonymity.
2) To offer an efficient hop-by-hop message authentication mechanism for WSNs without the
threshold limitation.
3) To the devise network implementation criteria on source node privacy protection in WSNs.
4) To propose an efficient key management framework to ensure isolation of the compromised
nodes.
5) To provide extensive results under windows platform using java on multiple security levels.
This is the first scheme that provides hop-by-hop node authentication without the threshold
limitation, and has performance better than the symmetric-key based schemes. The distributed
nature of our algorithm makes the scheme suitable for decentralized networks. So to provide the
Authentication java is used.
hop by hop chapter 2
2.1 STATISTICAL EN-ROUTE FILTERING
In a large-scale sensor network individual sensors are subject to security compromises. A
compromised node can inject into the network large quantities of bogus sensing reports which, if
undetected, would be forwarded to the data collection point (i.e. the sink). Such attacks by
compromised sensors can cause not only false alarms but also the depletion of the finite amount
of energy in a battery powered network. In this paper we present a Statistical En-route Filtering
(SEF) mechanism that can detect and drop such false reports. SEF requires that each sensing report
be validated by multiple keyed message authentication codes (MACs), each generated by a node
that detects the same event. As the report is forwarded, each node along the way verifies the
correctness of the MACs probabilistically and drops those with invalid MACs at earliest points.
The sink further filters out remaining false reports that escape the en-route filtering. SEF exploits
the network scale to determine the truthfulness of each report through collective decision-making
by multiple detecting nodes and collective false-report-detection by multiple forwarding nodes.
To serve applications that work in an adverse or even hostile environment, such as
battlefield surveillance and forest fire monitoring, a sensor network must not only report each
relevant event promptly, but also reject false reports injected by attackers. In addition to causing
false alarms that can waste real-world response effort, false reports can drain out the finite amount
of energy resource in a battery-powered network. A few recent research efforts have proposed
mechanisms to provide node and message authentication for sensor networks to prevent false
report injection by an outside attacker. However these proposed security mechanisms are rendered
ineffective when any single node is compromised.
In a large-scale sensor network, detecting and purging bogus reports injected by
compromised nodes is a great research challenge. Once a node is compromised, all the security
information stored in that node becomes accessible to the attacker. The compromised node can
successfully authenticate bogus reports to a neighbor, which has no way to differentiate such false
reports from legitimate ones. Although in theory one could apply public-key based authentication
mechanism to sensor networks and revoke the key of any compromised node, in reality the
computation and storage constraints of small sensor nodes make mechanisms based on asymmetric
cryptography, such as the one described in infeasible.
A Statistical En-route Filtering mechanism [SEF], exploits the sheer scale and dense
deployment of large sensor networks. To prevent any single compromised node from breaking
down the entire system, SEF carefully limits the amount of security information assigned to any
single node, and relies on the collective decisions of multiple sensors for false report detection.
When a sensing target (henceforth called “stimulus” or “event”) occurs in the field, multiple
surrounding sensors collectively generate a legitimate report that carries multiple message
authentication codes (MACs). A report with an inadequate number of MACs will not be delivered.
As a sensing report is forwarded towards the sink over multiple hops, each forwarding node
verifies the correctness of the MACs carried in the report with certain probability. Once an
incorrect MAC is detected, the report is dropped. The probability of detecting incorrect MACs
increases with the number of hops the report travels. Depending on the path length, there is a non-
zero probability that some reports with incorrect MACs may escape en-route filtering and be
delivered to the sink. In any case the sink will further verify the correctness of each MAC carried
in each report and reject false ones.
The contribution of this paper is two-fold. First, propose a key assignment method designed
for en-route detection of false reports in the presence of compromised nodes. Second in this
mechanisms for collective data report generation, en-route report filtering, sink verification that
addresses false sensing report detection problems in the presence of compromised sensors. The
results shows that SEF is able to detect and drop 80 to 90% injected reports by a compromised
node within 10 forwarding hops, thus reducing energy consumption by 50% or more in many
cases.
2.2 SECURITY ARGUMENTS FOR DIGITAL SIGNATURES
Since the appearance of public-key cryptography in the seminal Diffie-Hellman paper,
many new schemes have been proposed and many have been broken. Thus, the simple fact that a
cryptographic algorithm withstands cryptanalytic attacks for several years is often considered as a
kind of validation procedure. Much more convincing line of research has tried to provide provable
security for cryptographic protocols. Unfortunately, in many cases, provable security is at the cost
of a considerable loss in terms of efficiency. Another way to achieve some kind of provable
security is to identify concrete cryptographic objects such as hash functions with ideal random
objects and to use arguments from relativized complexity theory. The model underlying this
approach is often called the random oracle model. To use the word “arguments" for security results
proved in this model. As usual, these arguments are relative to well established hard algorithmic
problems such as factorization or the discrete algorithm. In this paper we over security arguments
for a large class of knew signature schemes. Moreover, we give for the first time an argument for
a very slight variation of the well known ElGamal signature scheme. In spite of the existential
forgery of the original scheme, we prove that our variant resists existential forgeries even against
an adaptively chosen-message attack. This is provided that the discrete logarithm problem is hard
to solve.
Next, in study the security of blind signatures this is the most important ingredient for
anonymity in on-line electronic cash systems. Define an appropriate notion of security related to
the setting of electronic cash. In this schemes for which one can provide security arguments.
Since the beginning of public-key cryptography with the Di_e-Hellman paper, many new
schemes have been proposed and many have been broken. Thus, the simple fact that a
cryptographic algorithm withstands cryptanalytic attacks for several years is often considered as a
kind of validation procedure. In this approach, cryptanalysis is viewed as a heuristic measure of
the strength of a new proposal.
A completely different paradigm is provided by the concept of provable" security. A
significant line of research has tried to provide proofs in the asymptotic framework of complexity
theory. Stated in a more accurate way, this approach proposes computational reductions to well
established problems, such as factorization, RSA, the discrete logarithm problem or any NP-
complete problem. Of course, these are not absolute proofs since cryptography ultimately relies
on the existence of one-way functions and the P versus NP question. Moreover, in many cases,
provable security is at the cost of an important loss in terms of efficiency.
Recently, the scope of these methods has been considerably widened by using a model
where concrete cryptographic objects, such as hash functions, are identified with ideal random
objects, the so-called random oracle model" formalized by Bellare and Rogaway. In this model,
DES is viewed as a random permutation and SHA [36] as a random function with the appropriate
range.
Using this model, other security arguments large class of digital signatures. Moreover, to
give, for the first time, an argument for a very slight variation of the well-known El Gamal
signature scheme. In spite of the existential forgery of the original scheme, to prove that our variant
resists existential forgeries even against an adaptively chosen-message attack will provided that
the discrete logarithm problem is hard to solve. Furthermore, the study the security of blind
signatures, especially for their application in electronic cash systems. To first define adequate
security notions for blind signatures, and then we propose the first schemes for which security
arguments can be given.
The random oracle model explains why such a theoretical model can help in proving the
validity of the design of a cryptographic scheme. Then recall the definition of a signature scheme
together with the various attacks and forgeries that we consider. Also, present the notion of blind
signatures and its use for anonymity (and even revokable anonymity) in electronic cash schemes.
Next, consider the attacks that are relevant in the context of digital payments.
2.3 SYMMETRIC-KEY AND PUBLIC-KEY
While symmetric-key schemes are efficient in processing time for sensor networks, they
generally require complicated key management, which may introduce large memory and
communication overhead. On the contrary, public key based schemes have simple and clean key
management, but cost more computational time. The recent progress of elliptic curve cryptography
(ECC) implementation on sensors motivates us to design a public-key scheme and compare its
performance with the symmetric-key counterparts, builds the user access control on commercial
sensor devices as a case study to show that the public-key scheme can be more advantageous in
terms of the memory usage, message complexity, and security resilience. Meanwhile, our work
also provides insights in integrating and designing public-key based security protocols for sensor
networks.
A main challenge of large scale sensor networks is the deployment of a practical and robust
security mechanism to mitigate the security risks exposed to the unattended and resource
constrained sensor devices. Motivated by the fact of insufficient hardware resources, a great deal
of research has focused on the symmetric cryptography based solutions for light-weight
computation. These symmetric-key schemes, however, require complicated key management that
may cause large memory and communication overhead. This drawback has not yet been
investigated by experimental work so it is not clear how these schemes perform in a realistic
system.
Recent progress in implementation of elliptic curve cryptography [ECC] on sensors proves
public key cryptography [PKC] is now feasible for resource constrained sensors. Given the
efficient low-layer primitive in place, the high-layer PKC based security scheme design in sensor
networks, however, is not straightforward due to the special hardware characteristics and
requirements of sensor networks. Therefore the performance of PKC based security schemes is
still not well investigated. This paper compares the symmetric cryptography and PKC based
schemes through an experimental study on an important sensor network security problem: user
access control. Our results suggest the PKC based user access control scheme be more
advantageous in terms of the memory usage, message complexity, and security resilience.
Sensor data access control becomes an important security component as the in-network
data storage applications have been proposed for the sensor platforms with cheap and large storage
capacity. To protect the data, sensors have to authenticate the user, and control the access to their
data. Existing access control scheme on the Internet is not feasible for sensor networks due to the
limited power, memory and communication bandwidth. In addition, access control in sensor
networks differs from the conventional schemes in that it is not enough to simply deny
unauthorized accesses to the data. An unauthorized user should not be allowed to use the network
since the network bandwidth is very limited and, more importantly, the battery power of each node
may be depleted after malicious users flood messages to the network. Our access control scheme
proposed in this paper is composed of three components. First, the sensors in proximity need to
exchange pair wise keys for secure communications. Second, the user needs to get authenticated
by the local sensors either for local sensor data access or for remote sensor data access. Third, the
local sensors also need to help the user and the remote sensor build a pair wise key to achieve end-
to-end security.
2.4 LIGHTWEIGHT AND COMPROMISE-RESILIENT MESSAGE
Numerous authentication schemes have been proposed in the past for protecting
communication authenticity and integrity in wireless sensor networks. Most of them however have
following limitations: high computation or communication overhead, no resilience to a large
number of node compromises, delayed authentication, lack of scalability, etc. To address these
issues, a novel message authentication approach which adopts a perturbed polynomial-based
technique to simultaneously accomplish the goals of lightweight, resilience to a large number of
node compromises, immediate authentication, scalability, and non-repudiation. Extensive analysis
and experiments have also been conducted to evaluate the scheme in terms of security properties
and system overhead.
When a sensor network is deployed in an unattended or hostile environment, the adversary
may capture and reprogram sensor nodes, or inject their own sensor nodes into the network and
induce the network to accept them as legitimate nodes. Once in control of a few sensor nodes, the
adversary can mount various attacks from inside the network.
One common type of attack is targeted at message authenticity and integrity. For example,
if the sender and the receiver are not within the transmission range of each other, an intruder on
the path connecting them can modify pass by messages or inject false messages. It appears to be a
solution that the sender and the receiver share a secret key, and the shared key is used by the sender
to generate message authentication code [MAC] for any outgoing message, and by the receivers
to verify the authenticity and integrity of any incoming message. If a message is tampered en route,
it will be detected by the receiver. This method however is not effective due to the following
reasons: First of all, it cannot authenticate messages that are multicast because, if one of the
receivers is compromised, the intruder can use the secret key held by the compromised receiver to
fake MACs for messages modified or injected by it itself to cheat other receivers. Secondly, the
method only allows end-to-end message authentication while en-route forwarding nodes cannot
authenticate pass by messages as a result, the intruder may launch denial-of service attacks by
repeatedly modifying messages or injecting false messages to deplete the communication
resources of intermediate forwarding nodes.
To thwart the above attacks, each message should be verifiable by both its final receivers
and its intermediate forwarders. This may be simply implemented on top of the public key
infrastructure; specifically, each message is sent along with a digital signature generated by the
sender using its private key, and every intermediate forwarder or final receiver can authenticate
the message using the public key of the sender. However, this approach may incur high overhead
in terms of computational cost and network bandwidth consumption. To mitigate the overhead,
researchers have proposed low-cost schemes that use symmetric keys and hash functions. In these
schemes, however, each symmetric authentication key is shared by a set of sensor nodes, and the
keys can be captured by the intruder as sensor nodes are compromised. Therefore, these schemes
are not resilient to large number of node compromises. Utilizing a one-way key chain and delayed
disclosure of keys, the TESLA schemes and its variants can achieve message authenticity in the
presence of a large number of node compromises. However, these schemes require
synchronization among nodes. They introduce delay in message authentication and the delay
increases as the network scales up. Moreover, they repel the adoption of asynchronous
communication.
To propose a new message authentication approach to address the aforementioned
limitations. Our approach has following features lightweight in terms of computation,
communication and storage overhead resilience to a large number of sensor node compromises
immediate authentication (therefore supporting both synchronous and asynchronous
communication) scalability and non-repudiation. These features are attained by applying a number
of novel techniques, Firstly, to adopt polynomials for message authentication, which provides
higher adaptability than existing authentication techniques based on multiple MACs, and at the
same time, keeps the advantage of immediate authentication held by those techniques. Secondly,
messages are authenticated and verified via evaluating polynomials, which incurs lower overhead
than existing asymmetric cryptography-based authentication techniques such as digital signature.
Thirdly, independent and random factors are employed to perturb polynomial shares (of a system-
wide secret polynomial) that preloaded to individual nodes, which significantly increases the
complexity for the intruder to break the secret polynomial, and therefore renders the proposed
approach to be resilient to node compromises. To the best of our knowledge, the proposed
approach is the first one that applies the aforementioned, techniques in message authentication for
sensor networks, and also the first one that can achieve simultaneously the features of compromise-
resiliency, flexible-time authentication, efficiency and non-repudiation without employing public
key cryptography.
2.5 EFFICIENT AUTHENTICATION AND SIGNING
Multicast stream authentication and signing is an important and challenging problem.
Applications include the continuous authentication of radio and TV Internet broadcasts, and
authenticated data distribution by satellite. The main challenges are fourfold. First, authenticity
must be guaranteed even when only the sender of the data is trusted. Second, the scheme needs to
scale to potentially millions of receivers. Third, streamed media distribution can have high packet
loss. Finally, the system needs to be efficient to support fast packet rates.
To propose two efficient schemes, TESLA and EMSS, for secure lossy multicast streams.
TESLA, short for Timed Efficient Stream Loss-tolerant Authentication, offers sender
authentication, strong loss robustness, high scalability, and minimal overhead, at the cost of loose
initial time synchronization and slightly delayed authentication. EMSS, short for Efficient Multi-
chained Stream Signature, provides non repudiation of origin, high loss resistance, and low
overhead, at the cost of slightly delayed verification.
As the online population continues to expand, the Internet is increasingly used to distribute
streamed media, such as streamed radio and video. By expect this trend to continue. To enable
wide spread and trusted streamed media dissemination, one must first provide sufficient security
guarantees. A most prominent security risk from a user point of view is data authenticity. The user
needs assurance that the data stream originated from the purported sender. Otherwise, a malicious
ISP could replace parts of the stream with its own material. For example, an adversary might alter
stock quotes that are distributed through IP multicast. In that scenario, the receiver needs strong
sender and data authentication.
The problem of continuous stream authentication is solved for the case of one sender and
one receiver via standard mechanisms, e.g.. The sender and receiver agree on a secret key which
is used in conjunction with a message authenticating code (MAC) to ensure authenticity of each
packet. In case of multiple receivers, however, the problem becomes much harder to solve, because
a symmetric approach would allow anyone holding a key (that is, any receiver) to forge packets.
Alternatively, the sender can use digital signatures to sign every packet with its private key. This
solution provides adequate authentication, but digital signatures are prohibitively inefficient.
Real-time data streams are lossy, which makes the security problem even harder. With
many receivers, we typically have a high variance among the bandwidth of the receivers, with high
packet loss for the receivers with relatively low bandwidth. Nevertheless, we want to assure data
authenticity even in the presence of this high packet loss.
A number of schemes for solving this problem (i.e. authenticating the data and sender in a
setting where only the sender is trusted) have been suggested in the past few years, but none of
these schemes is completely satisfactory.
There are two very different solutions to the problem of authenticating data streams
efficiently in a lossy environment. The first solution, called TESLA (for Timed Efficient Stream
Loss-tolerant Authentication), uses only symmetric cryptographic primitives such as
pseudorandom functions (PRFs) and message authentication codes (MACs), and is based on timed
release of keys by the sender. More specifically, the scheme is based on the following idea: The
sender commits to a random key k without revealing it and transmits it to the receivers. The sender
then attaches a message authenticating code to the next packet Pi and uses the key k as the MAC
key. In a later packet Pi+1, the sender de commits to k, which allows the receivers to verify the
commitment and the MAC of packet Pi. If both verifications are correct, and if it is guaranteed
that packet Pi+1 was not sent before packet Pi was received, then a receiver knows that the packet
Pi is authentic. To start this scheme, the sender uses a regular signature scheme to sign the initial
commitment. All subsequent packets are authenticated
through chaining. Our first scheme, TESLA, has the following properties:
Low computation overhead
The authentication involves typically only one MAC function and one hash function
computation per packet, for both sender and receiver.
Low per-packet communication overhead
. Overhead can be as low as 10 bytes per packet.Arbitrary packet loss tolerated. Every
packet which is received in time can be authenticated.
Unidirectional data flow.
Data only flows from the sender to the receiver. No acknowledgments or other messages
are necessary after connection setup. This implies that the sender’s stream authentication overhead
is independent on the number of receivers, so our scheme is very scalable. No sender-side
buffering. Every packet is sent as soon as it is ready.
High guarantee of authenticity
The system provides strong authenticity. By strong authenticity we mean that the receiver
has a high assurance of authenticity, as long as our timing and cryptographic assumptions are
enforced. Freshness of data. Every receiver knows an upper bound on the propagation time of the
packet.
2.6. AN INTERLEAVED HOP-BY-HOP AUTHENTICATION
Sensor networks are often deployed in unattended environments, thus leaving these
networks vulnerable to false data injection attacks in which an adversary injects false data into the
network with the goal of deceiving the base station or depleting the resources of the relaying nodes.
Standard authentication mechanisms cannot prevent this attack if the adversary has compromised
one or a small number of sensor nodes. In this paper, we present an interleaved hop-by-hop
authentication scheme that guarantees that the base station will detect any injected false data
packets when no more than a certain number t nodes are compromised. Further, our scheme
provides an upper bound B for the number of hops that a false data packet could be forwarded
before it is detected and dropped, given that there are up to t colluding compromised nodes. We
show that in the worst case B is O(t2). We also propose a variant of this scheme which guarantees
B = 0 and works for a small t. Through performance analysis, we show that our scheme is efficient
with respect to the security it provides, and it also allows a tradeoff between security and
performance.
Consider a military application of sensor networks for reconnaissance of the opposing
forces; want to monitor the activities of the opposing forces, e.g., tank movements, ship arrivals
or departures, and other relevant events. To achieve this goal, we can deploy a cluster of sensor
nodes around each area. We can then deploy a base station in a secure location to control the
sensors and collect data reported by the sensors. To facilitate data collection in such a network,
sensor nodes on a path from an area of interest to the base station can relay the data to the base
station.
The unattended nature of the deployed sensor network lends itself to several attacks by the
adversary, including physical destruction of sensor nodes, security attacks on the routing and data
link protocols, and resource consumption attacks launched to deplete the limited energy resources
of the sensor nodes.
Unattended sensor node deployment also makes another attack easier: an adversary may
compromise several sensor nodes, and then use the compromised nodes to inject false data into the
network. This attack falls in the category of insider attacks. Standard authentication mechanisms
are not sufficient to prevent such insider attacks, since the adversary knows all the keying material
possessed by the compromised nodes. We note that this attack can be launched against many sensor
network applications, though we have only given a military scenario.
By present a scheme for addressing this form of attack, which we call a false data injection
attack. Our scheme enables the base station to verify the authenticity of a report that it has received
as long as the number of compromised sensor nodes does not exceed a certain threshold. Further,
our scheme attempts to filter out false data packets injected into the network by compromised
nodes before they reach the base station, thus saving the energy for relaying them.
hop by hop chapter3
OVERVIEW OF PROPOSED SYSTEM
3.1 PROBLEM ANALYSIS
The symmetric-key based approach requires complex key management, lacks of
scalability, and is not resilient to large numbers of node compromise attacks since the message
sender and the receiver have to share a secret key. The shared key is used by the sender to generate
a message authentication code (MAC) for each transmitted message nodes. An intruder can
compromise the key by capturing a single sensor node. To solve the scalability problem, a secret
polynomial based message authentication scheme was introduced.
3.2 PROPOSED SYSTEM
An unconditionally secure and efficient source anonymous message authentication
(SAMA) scheme based on the optimal modified ElGamal signature (MES) scheme on elliptic
curves. This MES scheme is secure against adaptive chosen-message attacks in the random oracle
model. Our scheme enables the intermediate nodes to authenticate the message so that all
corrupted message can be detected and dropped to conserve the sensor power. While achieving
compromise-resiliency, flexible-time authentication and source identity protection, our scheme
does not have the threshold problem. Both theoretical analysis and simulation results demonstrate
that our proposed scheme is more efficient than the polynomial-based algorithms under
comparable security levels.
connecting nodes coding in java
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.sql.*;
import java.util.*;
import java.net.*;
import java.io.*;
import javax.swing.border.*;
import com.birosoft.liquid.LiquidLookAndFeel;
import javax.swing.table.*;
public class connectnodes extends JFrame
{
// Variables declaration
private JLabel jLabel1;
private JLabel jLabel2;
private JLabel jLabel3;
private JLabel jLabel4,jLabel5;
private JTextField jTextField1;
private JComboBox jComboBox1;
private JComboBox jComboBox2;
private JTextField jTextField2;
private JTextField jTextField5;
JScrollPane jsp;
private JButton jButton1;
private JButton jButton2;
private JButton jButton3;
private JButton jButton4,jButton5;
private JButton jButton7;
private JPanel contentPane;
private JPanel panel;
public Runtime r;
int n;
int i=0;
int portno;
String nodename = "",node,des;
String sysname = "";
ResultSet rs;
Connection cs;
Statement st;
Font font = new Font("TimesRoman",Font.PLAIN,20);
public Vector totalpeer;
// End of variables declaration
JTable jta;
RouterTable rt;
Object header[]={"System Name","Process","Monitoring Result"};
public connectnodes()
{
super();
initializeComponent();
this.setVisible(true);
}
public void initializeComponent()
{
jLabel1 = new JLabel();
jLabel2 = new JLabel();
jLabel3 = new JLabel();
jLabel4 = new JLabel();
jLabel5 = new JLabel();
panel=new JPanel();
jTextField1 = new JTextField();
jTextField2 = new JTextField();
jTextField5 = new JTextField();
jButton1 = new JButton();
jButton2 = new JButton();
jButton3 = new JButton();
jButton4 = new JButton();
jButton5 = new JButton();
jButton7 = new JButton();
jta=new JTable();
rt=new RouterTable();
rt.setColumnIdentifiers(header);
jta.setModel(rt);
jsp=new JScrollPane(jta);
jComboBox1 = new JComboBox();
jComboBox2 = new JComboBox();
jComboBox1.addItem("select");
jComboBox2.addItem("select");
contentPane = (JPanel)this.getContentPane();
jLabel2.setText("User Name");
jLabel3.setText("System");
jLabel4.setText("Neighbour");
jButton1.setText("Submit");
jButton1.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e)
{
jButton1_actionPerformed(e);
}
});
jButton2.setText("Clear");
jButton2.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e)
{
jTextField1.setText("");
jTextField2.setText("");
jComboBox1.setSelectedItem("Select");
jComboBox2.setSelectedItem("Select");
}
});
jButton3.setText("Cancel");
jButton3.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e)
{
dispose();
}
});
jButton5.setText("Link");
jButton5.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e)
{
jButton5_actionPerformed(e);
}
});
jButton7.setText("GroupKey");
jButton7.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e)
{
try
{
String key=JOptionPane.showInputDialog("Enter the Group Key");
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
cs=DriverManager.getConnection("jdbc:odbc:evaluate","sa","");
st=cs.createStatement();
String query5 = "update nodeinformation set key='"+key+"'";
st.executeUpdate(query5);
}
catch(Exception e1)
{
}
}
});
//
// contentPane
//
contentPane.setLayout(null);
panel.setLayout(null);
addComponent(contentPane,panel, -5,-5,550,400);
addComponent(panel, jLabel2, 65,100,100,25);
addComponent(panel, jLabel3, 65,150,100,25);
addComponent(panel, jLabel4, 65,200,150,25);
addComponent(panel, jTextField1, 204,100,100,25);
addComponent(panel, jComboBox1, 204,150,100,25);
addComponent(panel,jComboBox2, 203,200,100,25);
addComponent(panel,jLabel1, 325,100,100,25);
addComponent(panel, jButton1, 25,50,100,25);
addComponent(panel, jButton2, 325,50,100,25);
addComponent(panel, jButton3, 125,50,100,25);
addComponent(panel, jButton5, 225,50,100,25);
addComponent(panel, jLabel5, 65,50,100,25);
addComponent(panel, jButton7, 425,50,100,25);
addComponent(panel, jsp, 25,230,500,100);
this.setTitle("Node details");
this.setLocation(new Point(100, 100));
this.setSize(new Dimension(550, 500));
this.setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
this.setResizable(false);
}
private void addComponent(Container container,Component c,int x,int y,int width,int height)
{
c.setBounds(x,y,width,height);
container.add(c);
}
private void jButton1_actionPerformed(ActionEvent e)
{
nodename = jTextField1.getText();
if(!nodename.equals(""))
{
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
cs=DriverManager.getConnection("jdbc:odbc:evaluate","sa","");
st=cs.createStatement();
rs= st.executeQuery("select * from NodeInformation where NodeName LIKE '"+nodename+"'
"); //OR SystemName LIKE '"+sysname+"'
if(rs.next())
{
JOptionPane.showMessageDialog(this,"The given Data already Exists");
i--;
}
else
{ String query = "insert into NodeInformation values('"+nodename+"','0','','ON','','')";
st.execute(query);
jTextField1.setText("");
jComboBox1.addItem(nodename);
jComboBox2.addItem(nodename);
}
}
catch(Exception ee)
{
JOptionPane.showMessageDialog(this,"Specify the Correct PortNo");
System.out.println("Connectivity Error");
ee.printStackTrace();
i--;
}
}
else
{
JOptionPane.showMessageDialog(this,"Specify correct details");
}
}
private void jButton5_actionPerformed(ActionEvent e)
{
try
{
node = (String)jComboBox1.getSelectedItem();
des = (String)jComboBox2.getSelectedItem();
System.out.println(""+node);
System.out.println(""+des);
if(node.equals("Select")||des.equals("Select"))
{
JOptionPane.showMessageDialog(this,"Specify the Nodes");
}
else if (node.equals(des))
{
JOptionPane.showMessageDialog(this,"Specify a Valid Neighbour");
}
else
{
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
cs=DriverManager.getConnection("jdbc:odbc:evaluate","sa","");
st=cs.createStatement();
rs= st.executeQuery("select * from Connection where NodeName LIKE '"+node+"' AND
Neighbour LIKE '"+des+"'"); //OR SystemName LIKE '"+sysname+"'
System.out.println("1");
if(rs.next())
{
JOptionPane.showMessageDialog(this,"The given Data already Exists");
}
else
{
String query = "insert into Connection values('"+node+"','"+des+"','1','0')";
st.executeUpdate(query);
query = "insert into Connection values('"+des+"','"+node+"','1','0')";
st.executeUpdate(query);
}
}
catch(SQLException ee)
{
JOptionPane.showMessageDialog(this,"Connectivity Error");
System.out.println("Connectivity Error");
ee.printStackTrace();
}
}
}
catch (Exception e3)
{
JOptionPane.showMessageDialog(this,"Exception");
e3.printStackTrace();
}
}
public Vector connect()
{
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
cs=DriverManager.getConnection("jdbc:odbc:evaluate","sa","");
st=cs.createStatement();
ResultSet rs=st.executeQuery("select NodeName from NodeInformation");
totalpeer = new Vector();
totalpeer.add("Select");
while(rs.next())
{
totalpeer.addElement(rs.getString(1).trim());
System.out.println(""+totalpeer);
}
// for(int i1=0;i1 jComboBox1.addItem(totalpeer);
jComboBox2.addItem(totalpeer);
}
catch (Exception ex)
{
ex.printStackTrace();
}
return totalpeer;
}
public void adddat(Vector dat)
{
rt.addRow(dat);
}
class RouterTable extends DefaultTableModel
{
RouterTable()
{
}
}
}

Hop by hop message authentication chapter 1

  • 1.
    hop by hopmessage authentication chapter 1 Message authentication plays a key role in thwarting unauthorized and corrupted messages from being forwarded in networks to save the precious sensor energy. For this reason, many authentication schemes have been proposed in literature to provide message authenticity and integrity verification for wireless sensor networks [WSNs]. These schemes can largely be divided into two categories public-key based approaches and symmetric-key based approaches. The symmetric-key based approach requires complex key management, lacks of scalability, and is not resilient to large numbers of node compromise attacks since the message sender and the receiver have to share a secret key. The shared key is used by the sender to generate a message authentication code [MAC] for each transmitted message. However, for this method, the authenticity and integrity of the message can only be verified by the node with the shared secret key, which is generally shared by a group of sensor nodes. An intruder can compromise the key by capturing a single sensor node. In addition, this method does not work in multicast networks. To solve the scalability problem, a secret polynomial based message authentication scheme was introduced in. The idea of this scheme is similar to a threshold secret sharing, where the threshold is determined by the degree of the polynomial. This approach offers information- theoretic security of the shared secret key when the number of messages transmitted is less than the threshold. The intermediate nodes verify the authenticity of the message through a polynomial evaluation. However, when the number of messages transmitted is larger than the threshold, the polynomial can be fully recovered and the system is completely broken. An alternative solution was proposed in to thwart the intruder from recovering the polynomial by computing the coefficients of the polynomial. The idea is to add a random noise, also called a perturbation factor, to the polynomial so that the coefficients of the polynomial cannot be easily solved. However, a recent study shows that the random noise can be completely removed from the polynomial using error-correcting code techniques. For the public-key based approach, each message is transmitted along with the digital signature of the message generated using the sender’s private key. Every intermediate forwarder
  • 2.
    and the finalreceiver can authenticate the message using the sender’s public key. One of the limitations of the public-key based scheme is the high computational overhead. The recent progress on elliptic curve cryptography [ECC] shows that the public-key schemes can be more advantageous in terms of computational complexity, memory usage, and security resilience, since public-key based approaches have a simple and clean key management. The unconditionally secure and efficient source anonymous message authentication [SAMA] scheme based on the optimal modified, ElGamal signature [MES] scheme on elliptic curves. This MES scheme is secure against adaptive chosen-message attacks in the random oracle model. The intermediate nodes to authenticate the message so that all corrupted message can be detected and dropped to conserve the sensor power. While achieving compromise-resiliency, flexible-time authentication and source identity protection, our scheme does not have the threshold problem. Both theoretical analysis and simulation results demonstrate that our proposed scheme is more efficient than the polynomial-based algorithms under comparable security levels. The major contributions of this paper are the following: 1) To develop a source anonymous message authentication code (SAMAC) on elliptic curves that can provide unconditional source anonymity. 2) To offer an efficient hop-by-hop message authentication mechanism for WSNs without the threshold limitation. 3) To the devise network implementation criteria on source node privacy protection in WSNs. 4) To propose an efficient key management framework to ensure isolation of the compromised nodes. 5) To provide extensive results under windows platform using java on multiple security levels.
  • 3.
    This is thefirst scheme that provides hop-by-hop node authentication without the threshold limitation, and has performance better than the symmetric-key based schemes. The distributed nature of our algorithm makes the scheme suitable for decentralized networks. So to provide the Authentication java is used. hop by hop chapter 2 2.1 STATISTICAL EN-ROUTE FILTERING In a large-scale sensor network individual sensors are subject to security compromises. A compromised node can inject into the network large quantities of bogus sensing reports which, if undetected, would be forwarded to the data collection point (i.e. the sink). Such attacks by compromised sensors can cause not only false alarms but also the depletion of the finite amount of energy in a battery powered network. In this paper we present a Statistical En-route Filtering (SEF) mechanism that can detect and drop such false reports. SEF requires that each sensing report be validated by multiple keyed message authentication codes (MACs), each generated by a node that detects the same event. As the report is forwarded, each node along the way verifies the correctness of the MACs probabilistically and drops those with invalid MACs at earliest points. The sink further filters out remaining false reports that escape the en-route filtering. SEF exploits the network scale to determine the truthfulness of each report through collective decision-making by multiple detecting nodes and collective false-report-detection by multiple forwarding nodes. To serve applications that work in an adverse or even hostile environment, such as battlefield surveillance and forest fire monitoring, a sensor network must not only report each relevant event promptly, but also reject false reports injected by attackers. In addition to causing false alarms that can waste real-world response effort, false reports can drain out the finite amount of energy resource in a battery-powered network. A few recent research efforts have proposed mechanisms to provide node and message authentication for sensor networks to prevent false report injection by an outside attacker. However these proposed security mechanisms are rendered ineffective when any single node is compromised.
  • 4.
    In a large-scalesensor network, detecting and purging bogus reports injected by compromised nodes is a great research challenge. Once a node is compromised, all the security information stored in that node becomes accessible to the attacker. The compromised node can successfully authenticate bogus reports to a neighbor, which has no way to differentiate such false reports from legitimate ones. Although in theory one could apply public-key based authentication mechanism to sensor networks and revoke the key of any compromised node, in reality the computation and storage constraints of small sensor nodes make mechanisms based on asymmetric cryptography, such as the one described in infeasible. A Statistical En-route Filtering mechanism [SEF], exploits the sheer scale and dense deployment of large sensor networks. To prevent any single compromised node from breaking down the entire system, SEF carefully limits the amount of security information assigned to any single node, and relies on the collective decisions of multiple sensors for false report detection. When a sensing target (henceforth called “stimulus” or “event”) occurs in the field, multiple surrounding sensors collectively generate a legitimate report that carries multiple message authentication codes (MACs). A report with an inadequate number of MACs will not be delivered. As a sensing report is forwarded towards the sink over multiple hops, each forwarding node verifies the correctness of the MACs carried in the report with certain probability. Once an incorrect MAC is detected, the report is dropped. The probability of detecting incorrect MACs increases with the number of hops the report travels. Depending on the path length, there is a non- zero probability that some reports with incorrect MACs may escape en-route filtering and be delivered to the sink. In any case the sink will further verify the correctness of each MAC carried in each report and reject false ones. The contribution of this paper is two-fold. First, propose a key assignment method designed for en-route detection of false reports in the presence of compromised nodes. Second in this mechanisms for collective data report generation, en-route report filtering, sink verification that addresses false sensing report detection problems in the presence of compromised sensors. The results shows that SEF is able to detect and drop 80 to 90% injected reports by a compromised node within 10 forwarding hops, thus reducing energy consumption by 50% or more in many cases.
  • 5.
    2.2 SECURITY ARGUMENTSFOR DIGITAL SIGNATURES Since the appearance of public-key cryptography in the seminal Diffie-Hellman paper, many new schemes have been proposed and many have been broken. Thus, the simple fact that a cryptographic algorithm withstands cryptanalytic attacks for several years is often considered as a kind of validation procedure. Much more convincing line of research has tried to provide provable security for cryptographic protocols. Unfortunately, in many cases, provable security is at the cost of a considerable loss in terms of efficiency. Another way to achieve some kind of provable security is to identify concrete cryptographic objects such as hash functions with ideal random objects and to use arguments from relativized complexity theory. The model underlying this approach is often called the random oracle model. To use the word “arguments" for security results proved in this model. As usual, these arguments are relative to well established hard algorithmic problems such as factorization or the discrete algorithm. In this paper we over security arguments for a large class of knew signature schemes. Moreover, we give for the first time an argument for a very slight variation of the well known ElGamal signature scheme. In spite of the existential forgery of the original scheme, we prove that our variant resists existential forgeries even against an adaptively chosen-message attack. This is provided that the discrete logarithm problem is hard to solve. Next, in study the security of blind signatures this is the most important ingredient for anonymity in on-line electronic cash systems. Define an appropriate notion of security related to the setting of electronic cash. In this schemes for which one can provide security arguments. Since the beginning of public-key cryptography with the Di_e-Hellman paper, many new schemes have been proposed and many have been broken. Thus, the simple fact that a cryptographic algorithm withstands cryptanalytic attacks for several years is often considered as a kind of validation procedure. In this approach, cryptanalysis is viewed as a heuristic measure of the strength of a new proposal.
  • 6.
    A completely differentparadigm is provided by the concept of provable" security. A significant line of research has tried to provide proofs in the asymptotic framework of complexity theory. Stated in a more accurate way, this approach proposes computational reductions to well established problems, such as factorization, RSA, the discrete logarithm problem or any NP- complete problem. Of course, these are not absolute proofs since cryptography ultimately relies on the existence of one-way functions and the P versus NP question. Moreover, in many cases, provable security is at the cost of an important loss in terms of efficiency. Recently, the scope of these methods has been considerably widened by using a model where concrete cryptographic objects, such as hash functions, are identified with ideal random objects, the so-called random oracle model" formalized by Bellare and Rogaway. In this model, DES is viewed as a random permutation and SHA [36] as a random function with the appropriate range. Using this model, other security arguments large class of digital signatures. Moreover, to give, for the first time, an argument for a very slight variation of the well-known El Gamal signature scheme. In spite of the existential forgery of the original scheme, to prove that our variant resists existential forgeries even against an adaptively chosen-message attack will provided that the discrete logarithm problem is hard to solve. Furthermore, the study the security of blind signatures, especially for their application in electronic cash systems. To first define adequate security notions for blind signatures, and then we propose the first schemes for which security arguments can be given. The random oracle model explains why such a theoretical model can help in proving the validity of the design of a cryptographic scheme. Then recall the definition of a signature scheme together with the various attacks and forgeries that we consider. Also, present the notion of blind signatures and its use for anonymity (and even revokable anonymity) in electronic cash schemes. Next, consider the attacks that are relevant in the context of digital payments. 2.3 SYMMETRIC-KEY AND PUBLIC-KEY
  • 7.
    While symmetric-key schemesare efficient in processing time for sensor networks, they generally require complicated key management, which may introduce large memory and communication overhead. On the contrary, public key based schemes have simple and clean key management, but cost more computational time. The recent progress of elliptic curve cryptography (ECC) implementation on sensors motivates us to design a public-key scheme and compare its performance with the symmetric-key counterparts, builds the user access control on commercial sensor devices as a case study to show that the public-key scheme can be more advantageous in terms of the memory usage, message complexity, and security resilience. Meanwhile, our work also provides insights in integrating and designing public-key based security protocols for sensor networks. A main challenge of large scale sensor networks is the deployment of a practical and robust security mechanism to mitigate the security risks exposed to the unattended and resource constrained sensor devices. Motivated by the fact of insufficient hardware resources, a great deal of research has focused on the symmetric cryptography based solutions for light-weight computation. These symmetric-key schemes, however, require complicated key management that may cause large memory and communication overhead. This drawback has not yet been investigated by experimental work so it is not clear how these schemes perform in a realistic system. Recent progress in implementation of elliptic curve cryptography [ECC] on sensors proves public key cryptography [PKC] is now feasible for resource constrained sensors. Given the efficient low-layer primitive in place, the high-layer PKC based security scheme design in sensor networks, however, is not straightforward due to the special hardware characteristics and requirements of sensor networks. Therefore the performance of PKC based security schemes is still not well investigated. This paper compares the symmetric cryptography and PKC based schemes through an experimental study on an important sensor network security problem: user access control. Our results suggest the PKC based user access control scheme be more advantageous in terms of the memory usage, message complexity, and security resilience.
  • 8.
    Sensor data accesscontrol becomes an important security component as the in-network data storage applications have been proposed for the sensor platforms with cheap and large storage capacity. To protect the data, sensors have to authenticate the user, and control the access to their data. Existing access control scheme on the Internet is not feasible for sensor networks due to the limited power, memory and communication bandwidth. In addition, access control in sensor networks differs from the conventional schemes in that it is not enough to simply deny unauthorized accesses to the data. An unauthorized user should not be allowed to use the network since the network bandwidth is very limited and, more importantly, the battery power of each node may be depleted after malicious users flood messages to the network. Our access control scheme proposed in this paper is composed of three components. First, the sensors in proximity need to exchange pair wise keys for secure communications. Second, the user needs to get authenticated by the local sensors either for local sensor data access or for remote sensor data access. Third, the local sensors also need to help the user and the remote sensor build a pair wise key to achieve end- to-end security. 2.4 LIGHTWEIGHT AND COMPROMISE-RESILIENT MESSAGE Numerous authentication schemes have been proposed in the past for protecting communication authenticity and integrity in wireless sensor networks. Most of them however have following limitations: high computation or communication overhead, no resilience to a large number of node compromises, delayed authentication, lack of scalability, etc. To address these issues, a novel message authentication approach which adopts a perturbed polynomial-based technique to simultaneously accomplish the goals of lightweight, resilience to a large number of node compromises, immediate authentication, scalability, and non-repudiation. Extensive analysis
  • 9.
    and experiments havealso been conducted to evaluate the scheme in terms of security properties and system overhead. When a sensor network is deployed in an unattended or hostile environment, the adversary may capture and reprogram sensor nodes, or inject their own sensor nodes into the network and induce the network to accept them as legitimate nodes. Once in control of a few sensor nodes, the adversary can mount various attacks from inside the network. One common type of attack is targeted at message authenticity and integrity. For example, if the sender and the receiver are not within the transmission range of each other, an intruder on the path connecting them can modify pass by messages or inject false messages. It appears to be a solution that the sender and the receiver share a secret key, and the shared key is used by the sender to generate message authentication code [MAC] for any outgoing message, and by the receivers to verify the authenticity and integrity of any incoming message. If a message is tampered en route, it will be detected by the receiver. This method however is not effective due to the following reasons: First of all, it cannot authenticate messages that are multicast because, if one of the receivers is compromised, the intruder can use the secret key held by the compromised receiver to fake MACs for messages modified or injected by it itself to cheat other receivers. Secondly, the method only allows end-to-end message authentication while en-route forwarding nodes cannot authenticate pass by messages as a result, the intruder may launch denial-of service attacks by repeatedly modifying messages or injecting false messages to deplete the communication resources of intermediate forwarding nodes. To thwart the above attacks, each message should be verifiable by both its final receivers and its intermediate forwarders. This may be simply implemented on top of the public key infrastructure; specifically, each message is sent along with a digital signature generated by the sender using its private key, and every intermediate forwarder or final receiver can authenticate the message using the public key of the sender. However, this approach may incur high overhead in terms of computational cost and network bandwidth consumption. To mitigate the overhead, researchers have proposed low-cost schemes that use symmetric keys and hash functions. In these schemes, however, each symmetric authentication key is shared by a set of sensor nodes, and the
  • 10.
    keys can becaptured by the intruder as sensor nodes are compromised. Therefore, these schemes are not resilient to large number of node compromises. Utilizing a one-way key chain and delayed disclosure of keys, the TESLA schemes and its variants can achieve message authenticity in the presence of a large number of node compromises. However, these schemes require synchronization among nodes. They introduce delay in message authentication and the delay increases as the network scales up. Moreover, they repel the adoption of asynchronous communication. To propose a new message authentication approach to address the aforementioned limitations. Our approach has following features lightweight in terms of computation, communication and storage overhead resilience to a large number of sensor node compromises immediate authentication (therefore supporting both synchronous and asynchronous communication) scalability and non-repudiation. These features are attained by applying a number of novel techniques, Firstly, to adopt polynomials for message authentication, which provides higher adaptability than existing authentication techniques based on multiple MACs, and at the same time, keeps the advantage of immediate authentication held by those techniques. Secondly, messages are authenticated and verified via evaluating polynomials, which incurs lower overhead than existing asymmetric cryptography-based authentication techniques such as digital signature. Thirdly, independent and random factors are employed to perturb polynomial shares (of a system- wide secret polynomial) that preloaded to individual nodes, which significantly increases the complexity for the intruder to break the secret polynomial, and therefore renders the proposed approach to be resilient to node compromises. To the best of our knowledge, the proposed approach is the first one that applies the aforementioned, techniques in message authentication for sensor networks, and also the first one that can achieve simultaneously the features of compromise- resiliency, flexible-time authentication, efficiency and non-repudiation without employing public key cryptography. 2.5 EFFICIENT AUTHENTICATION AND SIGNING Multicast stream authentication and signing is an important and challenging problem. Applications include the continuous authentication of radio and TV Internet broadcasts, and authenticated data distribution by satellite. The main challenges are fourfold. First, authenticity
  • 11.
    must be guaranteedeven when only the sender of the data is trusted. Second, the scheme needs to scale to potentially millions of receivers. Third, streamed media distribution can have high packet loss. Finally, the system needs to be efficient to support fast packet rates. To propose two efficient schemes, TESLA and EMSS, for secure lossy multicast streams. TESLA, short for Timed Efficient Stream Loss-tolerant Authentication, offers sender authentication, strong loss robustness, high scalability, and minimal overhead, at the cost of loose initial time synchronization and slightly delayed authentication. EMSS, short for Efficient Multi- chained Stream Signature, provides non repudiation of origin, high loss resistance, and low overhead, at the cost of slightly delayed verification. As the online population continues to expand, the Internet is increasingly used to distribute streamed media, such as streamed radio and video. By expect this trend to continue. To enable wide spread and trusted streamed media dissemination, one must first provide sufficient security guarantees. A most prominent security risk from a user point of view is data authenticity. The user needs assurance that the data stream originated from the purported sender. Otherwise, a malicious ISP could replace parts of the stream with its own material. For example, an adversary might alter stock quotes that are distributed through IP multicast. In that scenario, the receiver needs strong sender and data authentication. The problem of continuous stream authentication is solved for the case of one sender and one receiver via standard mechanisms, e.g.. The sender and receiver agree on a secret key which is used in conjunction with a message authenticating code (MAC) to ensure authenticity of each packet. In case of multiple receivers, however, the problem becomes much harder to solve, because a symmetric approach would allow anyone holding a key (that is, any receiver) to forge packets. Alternatively, the sender can use digital signatures to sign every packet with its private key. This solution provides adequate authentication, but digital signatures are prohibitively inefficient. Real-time data streams are lossy, which makes the security problem even harder. With many receivers, we typically have a high variance among the bandwidth of the receivers, with high
  • 12.
    packet loss forthe receivers with relatively low bandwidth. Nevertheless, we want to assure data authenticity even in the presence of this high packet loss. A number of schemes for solving this problem (i.e. authenticating the data and sender in a setting where only the sender is trusted) have been suggested in the past few years, but none of these schemes is completely satisfactory. There are two very different solutions to the problem of authenticating data streams efficiently in a lossy environment. The first solution, called TESLA (for Timed Efficient Stream Loss-tolerant Authentication), uses only symmetric cryptographic primitives such as pseudorandom functions (PRFs) and message authentication codes (MACs), and is based on timed release of keys by the sender. More specifically, the scheme is based on the following idea: The sender commits to a random key k without revealing it and transmits it to the receivers. The sender then attaches a message authenticating code to the next packet Pi and uses the key k as the MAC key. In a later packet Pi+1, the sender de commits to k, which allows the receivers to verify the commitment and the MAC of packet Pi. If both verifications are correct, and if it is guaranteed that packet Pi+1 was not sent before packet Pi was received, then a receiver knows that the packet Pi is authentic. To start this scheme, the sender uses a regular signature scheme to sign the initial commitment. All subsequent packets are authenticated through chaining. Our first scheme, TESLA, has the following properties: Low computation overhead The authentication involves typically only one MAC function and one hash function computation per packet, for both sender and receiver. Low per-packet communication overhead . Overhead can be as low as 10 bytes per packet.Arbitrary packet loss tolerated. Every packet which is received in time can be authenticated. Unidirectional data flow.
  • 13.
    Data only flowsfrom the sender to the receiver. No acknowledgments or other messages are necessary after connection setup. This implies that the sender’s stream authentication overhead is independent on the number of receivers, so our scheme is very scalable. No sender-side buffering. Every packet is sent as soon as it is ready. High guarantee of authenticity The system provides strong authenticity. By strong authenticity we mean that the receiver has a high assurance of authenticity, as long as our timing and cryptographic assumptions are enforced. Freshness of data. Every receiver knows an upper bound on the propagation time of the packet. 2.6. AN INTERLEAVED HOP-BY-HOP AUTHENTICATION Sensor networks are often deployed in unattended environments, thus leaving these networks vulnerable to false data injection attacks in which an adversary injects false data into the network with the goal of deceiving the base station or depleting the resources of the relaying nodes. Standard authentication mechanisms cannot prevent this attack if the adversary has compromised one or a small number of sensor nodes. In this paper, we present an interleaved hop-by-hop authentication scheme that guarantees that the base station will detect any injected false data packets when no more than a certain number t nodes are compromised. Further, our scheme provides an upper bound B for the number of hops that a false data packet could be forwarded before it is detected and dropped, given that there are up to t colluding compromised nodes. We show that in the worst case B is O(t2). We also propose a variant of this scheme which guarantees B = 0 and works for a small t. Through performance analysis, we show that our scheme is efficient with respect to the security it provides, and it also allows a tradeoff between security and performance.
  • 14.
    Consider a militaryapplication of sensor networks for reconnaissance of the opposing forces; want to monitor the activities of the opposing forces, e.g., tank movements, ship arrivals or departures, and other relevant events. To achieve this goal, we can deploy a cluster of sensor nodes around each area. We can then deploy a base station in a secure location to control the sensors and collect data reported by the sensors. To facilitate data collection in such a network, sensor nodes on a path from an area of interest to the base station can relay the data to the base station. The unattended nature of the deployed sensor network lends itself to several attacks by the adversary, including physical destruction of sensor nodes, security attacks on the routing and data link protocols, and resource consumption attacks launched to deplete the limited energy resources of the sensor nodes. Unattended sensor node deployment also makes another attack easier: an adversary may compromise several sensor nodes, and then use the compromised nodes to inject false data into the network. This attack falls in the category of insider attacks. Standard authentication mechanisms are not sufficient to prevent such insider attacks, since the adversary knows all the keying material possessed by the compromised nodes. We note that this attack can be launched against many sensor network applications, though we have only given a military scenario. By present a scheme for addressing this form of attack, which we call a false data injection attack. Our scheme enables the base station to verify the authenticity of a report that it has received as long as the number of compromised sensor nodes does not exceed a certain threshold. Further, our scheme attempts to filter out false data packets injected into the network by compromised nodes before they reach the base station, thus saving the energy for relaying them. hop by hop chapter3 OVERVIEW OF PROPOSED SYSTEM 3.1 PROBLEM ANALYSIS
  • 15.
    The symmetric-key basedapproach requires complex key management, lacks of scalability, and is not resilient to large numbers of node compromise attacks since the message sender and the receiver have to share a secret key. The shared key is used by the sender to generate a message authentication code (MAC) for each transmitted message nodes. An intruder can compromise the key by capturing a single sensor node. To solve the scalability problem, a secret polynomial based message authentication scheme was introduced. 3.2 PROPOSED SYSTEM An unconditionally secure and efficient source anonymous message authentication (SAMA) scheme based on the optimal modified ElGamal signature (MES) scheme on elliptic curves. This MES scheme is secure against adaptive chosen-message attacks in the random oracle model. Our scheme enables the intermediate nodes to authenticate the message so that all corrupted message can be detected and dropped to conserve the sensor power. While achieving compromise-resiliency, flexible-time authentication and source identity protection, our scheme does not have the threshold problem. Both theoretical analysis and simulation results demonstrate that our proposed scheme is more efficient than the polynomial-based algorithms under comparable security levels. connecting nodes coding in java import java.awt.*; import java.awt.event.*; import javax.swing.*; import java.sql.*; import java.util.*; import java.net.*; import java.io.*; import javax.swing.border.*; import com.birosoft.liquid.LiquidLookAndFeel; import javax.swing.table.*; public class connectnodes extends JFrame
  • 16.
    { // Variables declaration privateJLabel jLabel1; private JLabel jLabel2; private JLabel jLabel3; private JLabel jLabel4,jLabel5; private JTextField jTextField1; private JComboBox jComboBox1; private JComboBox jComboBox2; private JTextField jTextField2; private JTextField jTextField5; JScrollPane jsp; private JButton jButton1; private JButton jButton2; private JButton jButton3; private JButton jButton4,jButton5; private JButton jButton7; private JPanel contentPane; private JPanel panel; public Runtime r; int n; int i=0; int portno; String nodename = "",node,des; String sysname = ""; ResultSet rs; Connection cs; Statement st; Font font = new Font("TimesRoman",Font.PLAIN,20); public Vector totalpeer; // End of variables declaration JTable jta; RouterTable rt; Object header[]={"System Name","Process","Monitoring Result"}; public connectnodes() { super(); initializeComponent(); this.setVisible(true); }
  • 17.
    public void initializeComponent() { jLabel1= new JLabel(); jLabel2 = new JLabel(); jLabel3 = new JLabel(); jLabel4 = new JLabel(); jLabel5 = new JLabel(); panel=new JPanel(); jTextField1 = new JTextField(); jTextField2 = new JTextField(); jTextField5 = new JTextField(); jButton1 = new JButton(); jButton2 = new JButton(); jButton3 = new JButton(); jButton4 = new JButton(); jButton5 = new JButton(); jButton7 = new JButton(); jta=new JTable(); rt=new RouterTable(); rt.setColumnIdentifiers(header); jta.setModel(rt); jsp=new JScrollPane(jta); jComboBox1 = new JComboBox(); jComboBox2 = new JComboBox(); jComboBox1.addItem("select"); jComboBox2.addItem("select"); contentPane = (JPanel)this.getContentPane(); jLabel2.setText("User Name"); jLabel3.setText("System"); jLabel4.setText("Neighbour"); jButton1.setText("Submit"); jButton1.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) {
  • 18.
    jButton1_actionPerformed(e); } }); jButton2.setText("Clear"); jButton2.addActionListener(new ActionListener() { publicvoid actionPerformed(ActionEvent e) { jTextField1.setText(""); jTextField2.setText(""); jComboBox1.setSelectedItem("Select"); jComboBox2.setSelectedItem("Select"); } }); jButton3.setText("Cancel"); jButton3.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { dispose(); } }); jButton5.setText("Link"); jButton5.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { jButton5_actionPerformed(e); } }); jButton7.setText("GroupKey"); jButton7.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e)
  • 19.
    { try { String key=JOptionPane.showInputDialog("Enter theGroup Key"); Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); cs=DriverManager.getConnection("jdbc:odbc:evaluate","sa",""); st=cs.createStatement(); String query5 = "update nodeinformation set key='"+key+"'"; st.executeUpdate(query5); } catch(Exception e1) { } } }); // // contentPane // contentPane.setLayout(null); panel.setLayout(null); addComponent(contentPane,panel, -5,-5,550,400); addComponent(panel, jLabel2, 65,100,100,25); addComponent(panel, jLabel3, 65,150,100,25); addComponent(panel, jLabel4, 65,200,150,25); addComponent(panel, jTextField1, 204,100,100,25); addComponent(panel, jComboBox1, 204,150,100,25); addComponent(panel,jComboBox2, 203,200,100,25); addComponent(panel,jLabel1, 325,100,100,25); addComponent(panel, jButton1, 25,50,100,25); addComponent(panel, jButton2, 325,50,100,25); addComponent(panel, jButton3, 125,50,100,25); addComponent(panel, jButton5, 225,50,100,25); addComponent(panel, jLabel5, 65,50,100,25); addComponent(panel, jButton7, 425,50,100,25);
  • 20.
    addComponent(panel, jsp, 25,230,500,100); this.setTitle("Nodedetails"); this.setLocation(new Point(100, 100)); this.setSize(new Dimension(550, 500)); this.setDefaultCloseOperation(DO_NOTHING_ON_CLOSE); this.setResizable(false); } private void addComponent(Container container,Component c,int x,int y,int width,int height) { c.setBounds(x,y,width,height); container.add(c); } private void jButton1_actionPerformed(ActionEvent e) { nodename = jTextField1.getText(); if(!nodename.equals("")) { try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); cs=DriverManager.getConnection("jdbc:odbc:evaluate","sa",""); st=cs.createStatement(); rs= st.executeQuery("select * from NodeInformation where NodeName LIKE '"+nodename+"' "); //OR SystemName LIKE '"+sysname+"' if(rs.next()) { JOptionPane.showMessageDialog(this,"The given Data already Exists"); i--; } else { String query = "insert into NodeInformation values('"+nodename+"','0','','ON','','')"; st.execute(query);
  • 21.
    jTextField1.setText(""); jComboBox1.addItem(nodename); jComboBox2.addItem(nodename); } } catch(Exception ee) { JOptionPane.showMessageDialog(this,"Specify theCorrect PortNo"); System.out.println("Connectivity Error"); ee.printStackTrace(); i--; } } else { JOptionPane.showMessageDialog(this,"Specify correct details"); } } private void jButton5_actionPerformed(ActionEvent e) { try { node = (String)jComboBox1.getSelectedItem(); des = (String)jComboBox2.getSelectedItem(); System.out.println(""+node); System.out.println(""+des); if(node.equals("Select")||des.equals("Select")) { JOptionPane.showMessageDialog(this,"Specify the Nodes"); } else if (node.equals(des)) { JOptionPane.showMessageDialog(this,"Specify a Valid Neighbour"); } else
  • 22.
    { try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); cs=DriverManager.getConnection("jdbc:odbc:evaluate","sa",""); st=cs.createStatement(); rs= st.executeQuery("select *from Connection where NodeName LIKE '"+node+"' AND Neighbour LIKE '"+des+"'"); //OR SystemName LIKE '"+sysname+"' System.out.println("1"); if(rs.next()) { JOptionPane.showMessageDialog(this,"The given Data already Exists"); } else { String query = "insert into Connection values('"+node+"','"+des+"','1','0')"; st.executeUpdate(query); query = "insert into Connection values('"+des+"','"+node+"','1','0')"; st.executeUpdate(query); } } catch(SQLException ee) { JOptionPane.showMessageDialog(this,"Connectivity Error"); System.out.println("Connectivity Error"); ee.printStackTrace(); } } } catch (Exception e3) { JOptionPane.showMessageDialog(this,"Exception"); e3.printStackTrace(); }
  • 23.
    } public Vector connect() { try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); cs=DriverManager.getConnection("jdbc:odbc:evaluate","sa",""); st=cs.createStatement(); ResultSetrs=st.executeQuery("select NodeName from NodeInformation"); totalpeer = new Vector(); totalpeer.add("Select"); while(rs.next()) { totalpeer.addElement(rs.getString(1).trim()); System.out.println(""+totalpeer); } // for(int i1=0;i1 jComboBox1.addItem(totalpeer); jComboBox2.addItem(totalpeer); } catch (Exception ex) { ex.printStackTrace(); } return totalpeer; } public void adddat(Vector dat) { rt.addRow(dat); } class RouterTable extends DefaultTableModel { RouterTable() { } }
  • 24.