You are on page 1of 46

Privacy preserving on mobile health data in cloud

ABSTRACT:
In the concept of MPI chatting and file transmission the decryption part will be
done automatically. Here we use three types of keys; they are pubic, private and secret key. Keys
are displayed to the destination only if they accept the request or else displaying of key is not
possible in the destination side and also it wont give or establish the Connection. In largely
spread clusters, computing nodes are naturally deployed in a variety of computing sites. The
Information processed in a spread cluster is communal among a group of distributed processes or
client by high-quality of messages passing protocols (e.g. message passing interface - MPI)
running on the Internet. Because of the open available nature of the Internet, data encryption for
these large-scale distributed clusters becomes a non-trivial and challenging problem. We
improved the security of the MPI (Message Passing Interface) protocol by encrypting and
decrypting messages sent and received among computing nodes. We are listening carefully on
MPI rather than more protocols because MPI is one of the most accepted communication
protocols for cluster computing environments. From among a multiple of MPI implementations,
we selected MPICH2 developed by the Argonne National Laboratory. Design goal of MPICH2 a commonly use MPI implementation - is to join portability with high presentation. we gives a
security enhanced MPI-library with the standard MPI interface, data communications of a
conservative MPI program can be secured without converting the program into the
corresponding secure report. We included encryption algorithms into the MPICH2 library so that
data in secret of MPI applications could be readily preserved without require modifying the
source codes of the MPI applications. We used Sandia Micro Benchmark and Intel MPI
Benchmarks to evaluate and compared the performance of original MPICH2 and
Enhanced Security MPICH2. According to the performance estimation, ES-MPICH2 provides
protected Message Passing Interface by give up sensible system performance.

EXISTING SYSTEM:

The nontrivial and difficult complexity to offer secrecy service for largescale spread clusters, because there is an open easy to get to nature of
the open networks. To identify this question, we improved the security
of the MPI protocol by encrypting and decrypting messages sent and
expected among compute nodes. Rising number of product clusters are
connected to other by public networks, its become a possible threat to safety sensitive
similar application running on the cluster. To address this safety problems we residential

a Message Passing Interface (MPI) implements to protect privacy of messages


communicate amongst nodes of clusters in an unprotect network.
1.

2.

DISADVANTAGES:
The programmers may rely on external libraries to implement secure
applications
MPI-interface-level solution enables programmers to write secure MPI
applications with minimum changes to the interface

PROPOSED SYSTEM:
The ES-MPICH2 methods allow application programmers to simply write safe
MPI applications without extra code for data-secrecy security. We apply a standard MPI
method called ES-MPICH2 to present data confidentiality for safe network
communications in message passing environment. Our planned security method
incorporated in the MPICH2 librarys can be very helpful for projects data transmitted in
open network like Internet. Channel-level explanation in which encryption and
decryption functions are built-in into the MPICH2 library.ES-MPICH2 maintain a
standard MPI interface to replace messages while preserve datas confidentiality.

ADVANTAGES:
The implemented ES-MPICH2 framework provides a secured design file that
enables application programmers to selectively choose any cryptographic
algorithm and symmetric-key in ES-MPICH2.
This feature makes it possible for programmers to easily and fully control the
security services incorporated in the MPICHI2 library. To demonstrate this
feature, we implemented the AES and 3DES algorithms in ESMPICH2.

SYSTEM REQUIREMENT SPECIFICATION

HARDWARE REQUIREMENTS
Processor

Pentium IV

RAM

512 MB

Hard Disk

80 GB

SOFTWARE REQUIREMENTS
Front End

Java

Environment

Net Beans

Back End

SQL Server 2005

Operating System

Windows XP

4.3 SOFTWARE DESCRIPTIONS:


NETWORK SECURITY
Network security is a complicated subject, historically only tackled by well-trained and
experienced experts. However, as more and more people become ``wired'', an increasing number
of people need to understand the basics of security in a networked world. This document was
written with the basic computer user and information systems manager in mind, explaining the
concepts needed to read through the hype in the marketplace and understand risks and how to
deal with them. Some history of networking is included, as well as an introduction to TCP/IP
and internetworking. We go on to consider risk management, network threats, firewalls, and
more special-purpose secure networking devices .This is not intended to be a ``frequently asked
questions'' reference, nor is it a ``hands-on'' document describing how to accomplish specific
functionality. It is hoped that the reader will have a wider perspective on security in general, and
better understand how to reduce and manage risk personally, at home, and in the workplace.

WHAT IS JAVA?
Java ha two things: a programming language and a platform. Java is a highlevel programming language that is all of the following
Simple
Architecture-neutral
Object-oriented
Portable
Distributed
High-performance
Interpreted
multithreaded
Robust
Dynamic
Secure
Java is also unusual in that each Java program is both compiled and
interpreted. With a compile you translate a Java program into an intermediate
language called Java bytecodes the platform-independent code instruction is
passed and run on the computer.
Compilation happens just once; interpretation occurs each time the program is
executed. The figure illustrates how this works.
Interpreter

Java
Program

Compilers

My Program

You can think of Java byte codes as the machine code instructions for the Java
Virtual Machine (Java VM). Every Java interpreter, whether its a Java
development tool or a Web browser that can run Java applets, is an
implementation of the Java VM. The Java VM can also be implemented in
hardware.
Java byte codes help make write once, run anywhere possible. You can
compile your Java program into byte codes on my platform that has a Java

compiler. The byte codes can then be run any implementation of the Java VM. For
example, the same Java program can run Windows NT, Solaris, and Macintosh.

JAVA PLATFORM
A platform is the hardware of software environment in
which a program runs. The Java platform differs from most other
platforms in that its a software only platform that runs on the top of
other, hardware-based platform. Most other platforms are described as
a combination of hardware and operating system.

The Java platform has two components:


The Java Virtual Machine (Java VM)
The Java Application Programming Interface (Java API)

Youve already been introduced to the Java VM. Its the base for the
Java platform and is ported onto various hardware-based platforms.
The Java API is a large collection of ready-made software
components that provide many useful capabilities, such as graphical user interface
(GUI) widgets.
The Java API is grouped into libraries (package) of related
components. The next sections, what can Java do? Highlights each area of
functionally provided by the package in the Java API.
The following figure depicts a Java program, such as an application
or applet, thats running on the Java platform. A special kind of application known
as a server serves and supports clients on a network. Examples of the servers
include Web Servers, proxy servers, mail servers, print servers, and boot servers.
Another specialized program is a Servlet. Servlets are similar to applets in that

they are runtime extensions of the application. Instead of working in browsers,


though, servlets run with in Java Web Servers, configuring of tailoring the server.
How does the Java API support all of these kinds of programs? With
packages of software components that provide a wide range of functionality. The
API is the API included in every full implementation of the platform.

The core API gives you the following features:


The Essentials: Objects, Strings, threads, numbers, input and output, datastructures,
system properties, date and time, and so on.
NETWORKING: URLs TCP and UDP sockets and IP addresses.
INTERNATIONALIZATION: Help for writing programs that can be localized for
users.
Worldwide programs can automatically adapt to specific locates and
be displayed in the appropriate language.

JAVA PROGRAM

Java API

Java Virtual Machine

Java Program

Hard Ware
API and Virtual Machine insulates the Java program from
hardware dependencies. As a platform-independent environment, Java can be a bit
slower than native code. However, smart compilers, well-tuned interpreters, and

Just-in-time-byte-code compilers can bring Javas performance close to the native


code without threatening portability.

WHAT CAN JAVA DO?


However, Java is not just for writing cut, entertaining
applets for the World Wide Web (WWW). Java is a general purpose, high-level
programming language and a powerful software platform. Using the fineries
Java API,you can write many types of programs.
The most common types of program are probably applets and
application, where a Java application is a standalone program that runs directly on
the Java platform.

SECURITY:
Both low-level and high-level, including electronic signatures,
public/private key management, accesses control, and certificate.

MODULES:

Key Agreement

AES

3 DES

ECC

Chatting

File Sharing

MODULES DESCRIPTION:

Key Agreement:

In this Project for Key Agreement we are using DiffieHellman key exchange
algorithm that establishes a shared secret that can be used for secret communications by
exchanging data over a public network. The following diagram illustrates the general idea of the
key exchange by using colors instead of a very large number. The key part of the process is that
Alice and Bob exchange their secret colors in a mix only. Finally this generates an identical key
that is mathematically difficult (impossible for modern supercomputers to do in a reasonable
amount of time) to reverse for another party that might have been listening in on them. Alice and
Bob now use this common secret to encrypt and decrypt their sent and received data. Note that
the yellow paint is already agreed by Alice and Bob:

AES:

AES is based on a design principle known as a substitution-permutation network, and


is fast in both software and hardware. Unlike its predecessor DES, AES does not use a Feistel
network. AES is a variant of Rijndael which has a fixed block size of 128 bits, and a key size of
128, 192, or 256 bits. By contrast, the Rijndael specification per se is specified with block and
key sizes that may be any multiple of 32 bits, both with a minimum of 128 and a maximum of
256 bits.
AES operates on a 44 column-major order matrix of bytes, termed the state, although some
versions of Rijndael have a larger block size and have additional columns in the state. Most AES
calculations are done in a special finite field.
The key size used for an AES cipher specifies the number of repetitions of transformation rounds
that convert the input, called the plaintext, into the final output, called the cipher text. The
numbers of cycles of repetition are as follows:

10 cycles of repetition for 128 bit keys.


12 cycles of repetition for 192 bit keys.

14 cycles of repetition for 256 bit keys.

Each round consists of several processing steps, including one that depends on the encryption
key itself. A set of reverse rounds are applied to transform cipher text back into the original
plaintext using the same encryption key.

3 DES:

The original DES cipher's key size of 56 bits was generally sufficient when that
algorithm was designed, but the availability of increasing computational power made brute-force

attacks feasible. Triple DES provides a relatively simple method of increasing the key size of
DES to protect against such attacks, without the need to design a completely new block cipher
algorithm.
Triple DES uses a "key bundle" which comprises three DES keys, K1, K2 and K3, each of
56 bits (excluding parity bits). The encryption algorithm is:
Cipher text = EK3(DK2(EK1(plaintext)))
I.e., DES encrypts with K1, DES decrypt with K2, then DES encrypt with K3.
Decryption is the reverse:
Plaintext = DK1(EK2(DK3(cipher text)))
I.e., decrypt with K3, encrypt with K2, and then decrypt with K1.

ECC:

Elliptic curve cryptography (ECC) is an approach to public-key cryptography based


on the algebraic structure of elliptic curves over finite fields. Popular asymmetric cryptosystems
like RSA are known to be very costly concerning calculation time and memory needs for larger
key sizes. To solve this problem, elliptic curve cryptosystems based can be used. An elliptic
curve cryptosystem is an asymmetric cryptosystem relying on the hardness of the discrete
logarithm problem in elliptic curve groups. With ECIES encryption, it is possible to encrypt data
with a 160-bit key as secure as with RSA using a 1024-bit key. So ECIES encryption is the better
choice compared to RSA when calculation time and available memory are restricted, e.g. when
using cryptosystems on smartcards. The Elliptic Curve Integrated Encryption Scheme (ECIES),
also known as Elliptic Curve Augmented Encryption Scheme or simply the Elliptic Curve
Encryption Scheme.
Chatting:
In Chatting, after Finished the key agreement the sender will send the message
and receiver will receive the msg using the socket connection. While sending Sender must have
to choose Any one of the three algorithm for encrypt the whole msg. The sender can send
message using IP Address only.
File Sharing:
In File Sharing, After Finished the key agreement the sender will send the file and
receiver will receive the file without any loss of information using the socket connection. while
sending Sender must have to choose Any one of the three algorithm for encrypt the whole data.
The sender can send file using IP Address only.

MODULES WISE DIAGRAMS:

Key Agreement

AES

3 DES

CHATTING:

FILE SHARING

1. UML DIAGRAMS:
i. USE CASE DIAGRAM
ii. CLASS DIAGRAM
iii. SEQUENCE DIAGRAM ETC
USE CASE DIAGRAM

SEQUENCE DIAGRAM ETC

HIERARCHICAL DIAGRAM:

Sender

Receiver

Registration
ChattingReceiver Key
Agreement
Choose
Send
Receiver
File Sharing

Receiver

SYSTEM ARCHITECTURE:

Sender

Network

Receiver

We can save
Choose file or
message
Original
message or file

Algorithm
Chosen

Auto
encry
pt

Auto
decrypt

.
Send to
destination

Key
assi

DATA FLOW DIAGRAM:

Registration

Chatting

File Sharing

Sender
DB

ER DIAGRAM:

Send
Message
Send File

Key
Agreement
Choose
algorithm

TABLE DESIGN:
algorithm

Userdetiles

Key agreement

Registration

CONCLUSION:
To address the issue of providing confidentiality services for large-scale clusters
connected by an open unsecured network, we aim at improving the security of the message
passing interface protocol by encrypting and decrypting messages communicated among
computing nodes. In this study, we implemented the ES-MPICH2 framework, which is based on
MPICH2. ES-MPICH2 is a secure, compatible and portable implementation of the message
passing interface standard. Compared with the original version of MPICH2, ES-MPICH2
preserves message confidentiality in MPI applications by integrating encryption techniques like
AES and 3DES into the MPICH2 library. In light of ES-MPICH2, programmers can easily write
secure MPI applications without an additional source code for data-confidentiality protection in
open public networks. The security feature of ES-MPICH2 is entirely transparent to MPI
programmers because encryption and decryption functions are implemented at the channel-level
in the MPICH2 library. MPI-application programmers can fully configure any confidentiality
services in MPICHI2, because a secured configuration file in ES-MPICH2 offers the
programmers flexibility in choosing any cryptographic schemes and keys seamlessly
incorporated in ES-MPICH2. Besides the implementation of AES and 3DES in ESMPICH2,
other cryptographic algorithms can be readily integrated in the ES-MPICH2 framework. We used

the Sandia Micro Benchmarks and the Intel MPI benchmarks to evaluate and analyze the
performance of MPICH2. Confidentiality services in ES-MPICH2 do introduce additional
overhead because of security operations. In the case of small messages, the overhead incurred by
the security services is marginal. The security overhead caused by AES and 3DES becomes more
pronounced in ES-MPICH2 with larger messages (e.g., the message size is larger than 256 KB).
Our experimental results show that the security overhead in ES-MPICH2 can be significantly
reduced by high-performance clusters. For example, the overhead added by AES in ES-MPICH2
is reduced by more than half when the 6-node cluster of Intel Celeron is used instead of the 10node cluster of Intel Pentium II. In addition to high-end clusters, the following two solutions can
be applied to further reduced overhead caused by confidentiality services in ES-MPICH2. First,
AES/3DES hardware implementations can lower security overhead in ES-MPICH2. Second,
security coprocessors can hide the overhead by allowing the encryption and decryption processes
to be executed in parallel with the message passing processes. We are currently investigating
varies means of reducing security overhead in ES-MPICH2. For example, we plan to study if
multicourse processors can substantially lower the overhead of confidentiality services in ESMPICH2. Another interesting direction for future work is to consider several strong and efficient
cryptographic algorithms like the Elliptic Curve Cryptography in ES-MPICH2. Since ECC is an
efficient and fast cryptographic solution, both the performance and the security of ES-MPICH2
are likely to be improved by incorporating ECC. A third promising direction for further work is
to integrate encryption and decryption algorithms in other communication channels like
SHMEM and InfiniBand in MPICH2 because an increasing number of commodity clusters are
built using standalone and advanced networks such as Infiniband and Marine. The current
version of ES-MPICH2 is focused on securing the transmission control protocol (TCP)
connections on the internet, because we addressed the data confidentiality issues on
geographically distributed cluster computing systems. In addition to the MPI library, other
parallel programming libraries will be investigated. Candidate libraries include the shared
memory access library and the remote direct memory access library. We plan to provide
confidentiality services in the SHMEM and RDMA libraries. Last but not least, we will
quantitatively evaluate the performance of integrity checking services that are incorporated into
the ES-MPICH2 framework. The goal of developing the integrity checking services is to reduce
overhead of the services in ES-MPICH2

SAMPLE CODING

ADMIN LOGIN:
import java.awt.BorderLayout;
import java.awt.EventQueue;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;

import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JTextField;
import javax.swing.JButton;
import java.awt.Color;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.rmi.*;
import java.net.*;

public class AdminLogin extends JFrame {


public AdminLogin() {
}

private JPanel contentPane;


private JTextField textField;
private JTextField textField_1;

/**
* Launch the application.
*/
public static void main(String[] args) {

AdminLogin frame = new AdminLogin();


frame.AdminLogin();
try

{
CheckImp chk=new CheckImp();
System.out.println("Binding server.....");
String obj="CheckUser";
Naming.rebind(obj,chk);
System.out.println("Server is waiting.....");
chk.db();
}
catch(Exception ex)
{
ex.printStackTrace();
}
}

/**
* Create the frame.
*/
public void AdminLogin() {
setVisible(true);
setTitle("AdminLogin");
setResizable(false);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setBounds(100, 100, 450, 300);
contentPane = new JPanel();
contentPane.setBackground(Color.WHITE);
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));

setContentPane(contentPane);
contentPane.setLayout(null);

JLabel lblNewLabel = new JLabel("New label");


lblNewLabel.setIcon(new
javax.swing.ImageIcon(getClass().getResource("/images/admin.jpg")));
lblNewLabel.setBounds(43, 57, 137, 149);
contentPane.add(lblNewLabel);

JPanel panel = new JPanel();


panel.setBackground(Color.PINK);
panel.setBounds(223, 49, 194, 177);
contentPane.add(panel);
panel.setLayout(null);

JLabel lblUserName = new JLabel("USER NAME");


lblUserName.setForeground(Color.BLUE);
lblUserName.setBounds(10, 32, 80, 14);
panel.add(lblUserName);

textField = new JTextField();


textField.setBounds(83, 29, 101, 20);
panel.add(textField);
textField.setColumns(10);

JLabel lblPassword = new JLabel("PASSWORD");


lblPassword.setForeground(Color.BLUE);

lblPassword.setBounds(10, 78, 80, 14);


panel.add(lblPassword);

textField_1 = new JTextField();


textField_1.setBounds(83, 75, 101, 20);
panel.add(textField_1);
textField_1.setColumns(10);

JButton btnSubmit = new JButton("SUBMIT");


btnSubmit.addActionListener(new SubmitListener());
btnSubmit.setBackground(Color.PINK);
btnSubmit.setForeground(Color.MAGENTA);
btnSubmit.setBounds(10, 126, 80, 23);
panel.add(btnSubmit);

JButton btnExit = new JButton("EXIT");


btnExit.addActionListener(new ExitListener());
btnExit.setBackground(Color.PINK);
btnExit.setForeground(Color.MAGENTA);
btnExit.setBounds(109, 126, 80, 23);
panel.add(btnExit);
}

public class SubmitListener implements ActionListener


{
public void actionPerformed(ActionEvent e)

{
try{
String us=textField.getText();
String pass=textField_1.getText();

if(us.equalsIgnoreCase("admin")&&pass.equalsIgnoreCase("admin"))
{
setVisible(false);
Options o=new Options();
o.Options();
}
else{
JOptionPane.showMessageDialog(null, "ACCESS DENIAL",
"ERROR", JOptionPane.ERROR_MESSAGE);
}
}
catch(Exception e1){
e1.printStackTrace();

}
}

public class ExitListener implements ActionListener

{
public void actionPerformed(ActionEvent e)
{
System.exit(1);
}

}
}

CLIENT LOGIN

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JTextField;
import javax.swing.JPasswordField;
import javax.swing.JButton;
import java.rmi.*;
import java.rmi.server.*;
import java.awt.Color;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.net.InetAddress;

public class LoginForm extends JFrame implements serVER_1


{
public LoginForm() {
}

private JPanel contentPane;


private JTextField textField;
private JPasswordField passwordField;
String url;int serial,port;
int size=1024;

/**
* Launch the application.
*/
public static void main(String[] args) {

LoginForm frame = new LoginForm();


frame.LoginForm();

/**
* Create the frame.
*/
public void LoginForm() {

setVisible(true);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setTitle("LoginForm");
setResizable(false);
setBounds(100, 100, 457, 379);
contentPane = new JPanel();
contentPane.setBackground(Color.WHITE);
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
setContentPane(contentPane);
contentPane.setLayout(null);

JLabel lblNewLabel = new JLabel("New label");


lblNewLabel.setIcon(new
javax.swing.ImageIcon(getClass().getResource("/images/login.jpg")));
lblNewLabel.setBounds(52, 11, 333, 135);
contentPane.add(lblNewLabel);

JPanel panel = new JPanel();

panel.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFa
ctory.createMatteBorder(2, 2, 2, 2, new java.awt.Color(255, 204, 204)), "SIGN IN",
javax.swing.border.TitledBorder.CENTER,
javax.swing.border.TitledBorder.DEFAULT_POSITION));
panel.setBounds(52, 157, 342, 158);
contentPane.add(panel);
panel.setLayout(null);

JLabel lblNewLabel_1 = new JLabel("USER NAME");


lblNewLabel_1.setForeground(Color.BLUE);
lblNewLabel_1.setBounds(56, 24, 74, 20);
panel.add(lblNewLabel_1);

textField = new JTextField();


textField.setBounds(167, 24, 118, 20);
panel.add(textField);
textField.setColumns(10);

JLabel lblNewLabel_2 = new JLabel("PASSWORD");


lblNewLabel_2.setForeground(Color.BLUE);
lblNewLabel_2.setBounds(54, 67, 76, 20);
panel.add(lblNewLabel_2);

passwordField = new JPasswordField();


passwordField.setBounds(167, 67, 118, 20);
panel.add(passwordField);

JButton btnSubmit = new JButton("SUBMIT");


btnSubmit.addActionListener(new SubmitListener());
btnSubmit.setBackground(Color.PINK);
btnSubmit.setForeground(Color.MAGENTA);
btnSubmit.setBounds(56, 124, 89, 23);
panel.add(btnSubmit);

JButton btnCancel = new JButton("CANCEL");


btnCancel.addActionListener(new CancelListener());
btnCancel.setBackground(Color.PINK);
btnCancel.setForeground(Color.MAGENTA);
btnCancel.setBounds(189, 124, 89, 23);
panel.add(btnCancel);
}

public class SubmitListener implements ActionListener


{
public void actionPerformed(ActionEvent e)
{
try
{
String u=textField.getText();
String p=passwordField.getText();
String ip=InetAddress.getLocalHost().getHostAddress();
String url=new String("//"+server+"/CheckUser");
Check chk1=(Check)Naming.lookup("//"+server+"/CheckUser");
if(chk1!=null)
{
System.out.println("Requesting the remote object");
serial=chk1.serial(u,p);
System.out.println(serial);
port=chk1.port(u);
String msg=chk1.send(u,p,ip);

System.out.println(msg);
if(msg.compareToIgnoreCase("ok")==0 )
{
JOptionPane.showMessageDialog(null, "Successful
Login", "INFORMATION", JOptionPane.INFORMATION_MESSAGE);

setVisible(false);

MessageFile m=new MessageFile();


m.MessageFile(u);
}
else if(msg.compareToIgnoreCase("ok")!=0 )
{
JOptionPane.showMessageDialog(null, "Invalid Entry",
"ERROR", JOptionPane.ERROR_MESSAGE);
textField.setText("");
passwordField.setText("");
textField.requestFocus();
}

}
else
System.out.println("Requested remote object is null");
}
catch(Exception ex1)
{
ex1.printStackTrace();

}
}

public class CancelListener implements ActionListener


{
public void actionPerformed(ActionEvent e)
{
setVisible(false);
ClientMainForm c = new ClientMainForm();
c.initcomponents();

}
}
}

SAMPLE SCREEN SHOTS:

You might also like