Final DOCUMENT KS
Final DOCUMENT KS
BCA
by
SNEKA M(20BCA0130)
KAVIYA V(20BCA0137)
Dr.Thanapal P
1
DECLARATION
We here by declare that the thesis entitled “A SECURE BACKUP SYSTEM USING
MULTICLOUD” submitted by us, for the award of the degree of Bachelor of Computer
Application is a record of bonafide work carried out by us under the supervision of
Dr.Thanapal P.
We further declare that the work reported in this thesis has not been submitted and
will not be submitted, either in part or in full, for the award of any other degree or diploma in
this institute or any other institute or university.
Place: Vellore
Date: 20/04/2023
SNEKA M (20BCA0130)
KAVIYA V(20BCA0137)
2
3
ABSTRACT
More clients might need to store their data to PCS (open cloud servers) close
by the quick headway of circulated figuring. New security issues must be handled in order to
help more clients process their data with no attempt at being subtle cloud. Right when the
client is limited to get to PCS, he will dole out its delegate to process his data and exchange
them. On the other hand, remote data uprightness checking is also a basic security issue out
in the open circulated stockpiling. It makes the clients check whether their outsourced data is
kept set up without downloading the whole data. From the security issues, we propose a
novel middle person masterminded data exchanging and remote data trustworthiness
checking model in identity based open key cryptography: IDPUIC (character based middle
person orchestrated data exchanging and remote data dependability looking at in the open
cloud). We give the formal definition, structure model and security model. By then, a strong
ID-PUIC tradition is sketched out by using the bilinear pairings. The proposed ID-PUIC
tradition is provably secure in perspective of the hardness of CDH (computational Diffie-
Hellman) issue. Our ID-PUIC tradition is furthermore beneficial and versatile. In
perspective of the special client's endorsement, the proposed ID-PUIC tradition can
comprehend private remote data genuineness checking designated remote data genuineness
checking and open remote data reliability checking.
4
ACKNOWLEDGEMENT
5
TABLE OF CONTENTS
LIST OF ABBREVATION............................................................08
CHAPTER 1
INTRODUCTION........................................................................................09
1.1 OBJECTIVES................................................................................................09
1.2 SCOPE OF THE PROJECT..........................................................................10
1.3 EXISTING PROJECT…...............................................................................10
1.4 PROPOSED SYSTEM..................................................................................10
1.5 ADVANTAGES IN PROPOSED THEORY…............................................11
CHAPTER 2
CHAPTER 3
REQUIREMENTS
3.1 HARDWARE REQUIREMENTS................................................................21
CHAPTER 4
CHAPTER 5
MODULES
REFERENCES.........................................................................78
7
LIST OF ABBREVATION
1. DB DataBase
4. CB Collective Behavior
5. SD Social Dimension
8
CHAPTER 1
INTRODUCTION
1.1 OBJECTIVES
In this paper, we propose Division and Replication of Data in the Cloud for Optimal
Performance and Security (DROPS) that collectively approaches the security and
performance issues. Outsourcing data to a third-party administrative control, as is done
in cloud computing, gives rise to security concerns. The data compromise may occur due
to attacks by other users and nodes within the cloud. Therefore, high security measures
are required to protect data within the cloud. However, the employed security strategy
must also take into account the optimization of the data retrieval time. The objective of
the project is to provide the user data’s from the cloud attackers or third party
users. To overcome this we use Division and Replication of Data in the Cloud for Optimal
Performance and Security (DROPS) scheme in the proposed system to provide security
9
1.2 SCOPE OF THE PROJECT
The security issue is main thing for the users because data compromise may occur due to
attacks by other users and nodes within the cloud. The data will be loss because of
security issues. Therefore, high security measures are required to protect data within the
cloud. There is no key generation in the existing system. There is no file fragmentation
and also maintaining full file copies in the storage. In this any unauthorized users can
stole the data’s of the users. There is no security in this because any unauthorized users
can stole the data’s in this technique. The data will be loss because of security issues.
Therefore, high security measures are required to protect data within the cloud.
In this paper, our proposed approach consists of Division and Replication of Data in the
Cloud for Optimal Performance and Security (DROPS) that collectively approaches the
security and performance issues. We divide a file into fragments, and replicate the
fragmented data over the cloud nodes. Each of the nodes stores only a single fragment of a
particular data file. The proposed DROPS scheme ensures that even in the case of a
successful attack, no meaningful information is revealed to the attacker. We do not rely on
traditional cryptographic techniques for data security. The non-cryptographic nature of the
proposed scheme makes it faster to perform the required operations (placement and
retrieval) on the data. We ensure a controlled replication of the file fragments, where each
10
of the fragments is replicated only once for the purpose of improved security.
11
1.5 ADVANTAGES IN PROPOSED SYSTEM:
CHAPTER 2
LITERATURE SURVEY:
DESCRIPTION
Cloud computing is an emerging paradigm that provides computing resources as a
service over a network. Communication resources often become a bottleneck in service
provisioning for many cloud applications. Therefore, data replication, which brings data (e.g.,
databases) closer to data consumers (e.g., cloud applications), is seen as a promising solution.
It allows minimizing network delays and bandwidth usage. In this paper we study data
replication in cloud computing data centers. Unlike other approaches available in the
literature, we consider both energy efficiency and bandwidth consumption of the system, in
addition to the improved Quality of Service (QoS) as a result of the reduced communication
delays. The evaluation results obtained during extensive simulations help to unveil
performance and energy efficiency tradeoffs and guide the design of future data replication
solutions. It offers computing as a utility, sharing resources of scalable data centers. End
users can benefit from the convenience of accessing data and services globally, centrally
managed backups, high computational capacity, and flexible billing strategies. Cloud
computing is also ecologically friendly. It benefits from the efficient utilization of servers,
data center power planning, large scale virtualization, and optimized software stacks.
12
2) TITLE : Dike: Virtualization-aware Access Control for Multitenant Filesystems
AUTHOR : G. Kappes, A. Hatzieleftheriou, and S. V. Anastasiadis
YEAR 2013
DESCRIPTION
13
3) TITLE :On the Optimal Placement of Secure Data Objects over
Internet AUTHOR : M. Tu, P. Li, Q. Ma, I-L. Yen, and F. B. Bastani
YEAR 2005
DESCRIPTION
Secret sharing algorithms have been used for intrusion tolerance, which ensure the
confidentiality, integrity and availability of critical information. However, dynamically
changing the number of shares in secret sharing schemes can be costly. To achieve
performance goals in data accesses, secret sharing can be combined with dynamic replication
in a distributed system with varying client access patterns. In this paper, we investigate the
problem of optimal allocation of secure data objects that are secret shared and possibly
replicated. The system topology we consider consists of two layers. In the upper layer,
multiple clusters form a network topology that can be represented by a general graph. The
nodes within each cluster also have a topology represented by a general graph. We
decompose the share replica allocation problem into two sub-problems, the resident set
problem which allocates a subset of shares to clusters, and the -intra-cluster allocation
problem which determines the number of share replicas to be allocated and their placements.
We develop two different heuristic algorithms for the two sub-problems. The algorithm for
the optimal resident set problem has a time complexity of O (n2). An O (n3) algorithm is
presented for the intra-cluster allocation problem.
14
4) TITLE ::Cloud Hooks: Security and Privacy Issues in Cloud Computing
AUTHOR :W. A. Jansen
YEAR :2011.
DESCRIPTION
In meteorology, the most destructive extratropical cyclones evolve with the formation
of a bent-back front and cloud head separated from the main polar-front, creating a hook that
completely encircles a pocket of warm air with colder air. The most damaging winds occur
near the tip of the hook. The cloud hook formation provides a useful analogy for cloud
computing, in which the most acute obstacles with outsourced services (i.e., the cloud hook)
are security and privacy issues. This paper identifies key issues, which are believed to have
long-term significance in cloud computing security and privacy, based on documented
problems and exhibited weaknesses. Cloud computing has been defined by NIST as a model
for enabling convenient, on-demand network access to a shared pool of configurable
computing resources that can be rapidly provisioned and released with minimal management
effort or service provider interaction. Cloud computing can be considered a new computing
paradigm with implications for greater flexibility and availability at lower cost. Because of
this, cloud computing has been receiving a good deal of attention lately.
15
5) TITLE : On the Characterization of the Structural Robustness of Data Center
Networks AUTHOR : K. Bilal, M. Manzano, S. U. Khan, E. Calle, K. Li, and A.Zomaya
YEAR : 2013.
DESCRIPTION
Data centers being an architectural and functional block of cloud computing are
integral to the Information and Communication Technology (ICT) sector. Cloud computing is
rigorously utilized by various domains, such as agriculture, nuclear science, smart grids,
healthcare, and search engines for research, data storage, and analysis. A Data Center
Network (DCN) constitutes the communicational backbone of a data center, ascertaining the
performance boundaries for cloud infrastructure. The DCN needs to be robust to failures and
uncertainties to deliver the required Quality-of-Service (QoS) level and satisfy service-level
agreement (SLA). In this paper, we analyze robustness of the state-of-the-art DCNs. Our
major contributions are: 1) we present multilayered graph modeling of various DCNs; 2) we
study the classical robustness metrics considering various failure scenarios to perform a
comparative analysis; 3) we present the inadequacy of the classical network robustness
metrics to appropriately evaluate the DCN robustness; and 4) we propose new procedures to
quantify the DCN robustness. Currently, there is no detailed study available centering the
DCN robustness. Therefore, we believe that this study will lay a firm foundation for the
future DCN robustness research.
16
6) TITLE : A User Identity Management Protocol Using Efficient Dynamic Credentials
AUTHOR : Sheetal S. Dharwadkar1, Rashmi M. Jogdand2
YEAR : 2014.
DESCRIPTION
Today mobile devices make use of the services provided by the newly emerging
technology Mobile Cloud Computing (MCC)to overcome the challenges of resource
limitations such as, battery life, storage, computation power and bandwidth. Though this new
technology is very flexible to use but however, the mobile devices are facing many
challenges related to security. The legitimate users prove their identity to cloud using digital
credentials such as passwords and digital certificate. As the technology has become very
transparent adversaries may hack the valuable credentials of the user without the knowledge
of legitimate user. The attackers may draw the services from cloud using the user’s
credentials and fool the cloud. The users will not come to know of this theft until some
disaster has been done by the hacker. This system model proposes an light weight algorithm
which reduces the burden of processing on mobile device as all computation are carried on
trusted entity and it also improves the security of users Credentials by updating it
dynamically based on the user and cloud communication.
17
7) TITLE : Selecting the right data distribution scheme for a survivable storage system
AUTHOR : J. J. Wylie, M. Bakkaloglu, V. Pandurangan, M. W. Bigrigg, S. Oguz, K.
Tew, C. Williams, G. R. Ganger, and P. K. Khosla
YEAR : 2001.
DESCRIPTION
Survivable storage system design has become a popular research topic. This paper
tackles the difficult problem of reasoning about the engineering trade-o_s inherent in data
distribution scheme selection. The choice of an encoding algorithm and its parameters
positions a system at a particular point in a complex trade-o_ space between performance,
availability, and security. We demonstrate that no choice is right for all systems, and we
present an approach to codifying and visualizing this trade-o_ space. Using this approach, we
explore the sensitivity of the space to system characteristics, workload, and desired levels of
security and availability.
18
8) TITLE : Data Security Issues in Cloud Computing
AUTHOR : Neha Rawat*, Ratnesh Srivastava, Binay Kumar Pandey, Poonam Rawat,
Shikha Singh and Awantika Sharma
YEAR : 2014.
DESCRIPTION
19
9) TITLE : Non-replicated Dynamic Data Allocation in Distributed Database Systems
AUTHOR : Arjan Singh† and K.S. Kahlon
YEAR : 2009.
DESCRIPTION
Allocation of data or fragments in distributed database is a critical design issue and requires
the most effort. It has the greater impact on the quality of the final solution and hence the
operational efficiency of the system. Performance of the distributed database system is
heavily dependent on allocation of data among the different sites over the network. The static
allocation provides only the limited response to the change in workload. So, choosing an
appropriate technique for allocation in the distributed database system is an important design
issue. In this paper, a new dynamic data allocation algorithm for non-replicated distributed
database system has been proposed. The proposed algorithm reallocates data with respect to
the changing data access patterns with time constraint. This algorithm will decrease the
movement of data over the network and also improve the overall performance of the system.
20
10) TITLE : Towards Secure Communication for Highly Scalable Mobile
Applications
in Cloud Computing Systems
AUTHOR : Piotr K. Tysowski and M. Anwarul Hasan
YEAR : 2014.
DESCRIPTION
Cloud computing is a distributed computing model in which clients pay for computing
and data storage resources of a third-party cloud provider. Cloud applications can scale up or
down almost instantly to meet real-time computational demands. Despite the economic
advantages of a pay-on-demand business model, security remains a paramount concern.
Cloud applications by nature must store and retain access to a potentially large volume of
data. Yet, the consensus among IT organizations is that the cloud provider generally cannot
be implicitly trusted, and thus this data should ideally be transmitted and stored in encrypted
form. Major challenges exist concerning the aspects of the generation, distribution, and usage
of encryption keys in cloud systems, such as the safe location of keys, and the presence of
users that tend to connect to contemporary cloud applications using resource-constrained
mobile devices in extremely large numbers simultaneously; these characteristics lead to
difficulties in achieving efficient and highly scalable key management. The underlying
schemes include identity-based encryption, multi-level key management, and data re-
encryption. Each model varies in how user keys are stored, exchanged, re-generated, and
used; each is analyzed and compared in terms of storage and communication requirements,
assessing the impact on tight resource constraints in a mobile device environment; these
constraints include costly wireless data usage, limited mobile processing power, and limited
battery life.
21
CHAPTER 3
REQUIREMENTS
SYSTEM TECHNIQUES
We develop a scheme for outsourced data that takes into account both the security and
performance. The proposed scheme fragments and replicates the data file over cloud nodes.
The division of a file into fragments is performed based on a given user criteria such that the
individual fragments do not contain any meaningful information. Once the file is split into
fragments, the DROPS methodology selects the cloud nodes for fragment placement. The
selection is made by keeping an equal focus on both security and performance in terms of the
access time. We choose the nodes that are most central to the cloud network to provide better
access time. The DROPS methodology uses the concept of centrality to reduce access time.
The proposed DROPS scheme ensures that even in the case of a successful attack, no
meaningful information is revealed to the attacker.
22
INPUT EXPECTED OUTPUT:
• Output : If Valid cloud user Open the user window otherwise error
page.
User Upload
Fragmentation
T-Coloring
Replication
23
CHAPTER 4
4.2 SYSTEM ARCHITECTURE
EXPLANATION:
We develop a scheme for outsourced data that takes into account both
the security and performance. The proposed scheme fragments and
replicates the data file over cloud nodes. The division of a file into
fragments is performed based on a given user criteria such that the
individual fragments do not contain any meaningful information.
Once the file is split into fragments, the DROPS methodology selects
the cloud nodes for fragment placement. The selection is made by
keeping an equal focus on both security and performance in terms of
the access time. We choose the nodes that aremost central to the
cloud network to provide better access time. The DROPS
methodology uses the concept of centrality to reduce access time.
The proposed DROPS scheme ensures that even in the case of a
successful attack, no meaningful information is revealed to the
24
attacker.
25
USECASE DIAGRAM
26
CLASS DIAGRAM
OBJECT DIAGRAM
27
STATE DIAGRAM
ACTIVITY DIAGRAM
28
SWQUENCE DIAGRAM
COLLABORATION DIAGRAM
4.10
29
DATA FLOW DIAGRAM
LEVEL 0
LEVEL 1
30
2.2.1 MODULES
This is the first module of our project. The important role for the cloud user is to move
login window to cloud user window. This module has created for the security purpose. In this
login page we have to enter login user id and password. It will check username and password
is match or not (valid user id and valid password). If we enter any invalid username or
password we can’t enter into login window to user window it will shows error message. So
we are preventing from unauthorized user entering into the login window to user window. It
will provide a good security for our project. So server contain user id and password server
also check the authentication of the user. It well improves the security and preventing from
unauthorized user enters into the network. In our project we are using JSP for creating design.
Here we validate the login user and server authentication.
User Upload:
This is the module for uploading consumer’s files or documents into the virtual machines.
These constraints serve a dual purpose as they can introduce high-level policies which are the
flexible file access policies and assist in administration tasks. Reduce Dist enforces the high-
level policy of clustering VMs of the same user on hosts that may not be far apart in terms of
network hops. In this we are using fast recovery algorithm for uploading documents or files.
When using this algorithm we can upload and retrieve the files fastly. So when consumer
uploads any file of particular size the file will be uploaded into first virtual machine of that
login user.
31
Fragmentation:
This is the third module of our project, in this we have to fragments user files into
pieces and replicates them at strategic locations within the cloud. How we fragment the file
means after uploading any data or files the files are splitted into fragments. The division of a
file into fragments is performed based on a given user criteria such that the individual
fragments do not contain any Meaningful information. Each of the cloud nodes (we use the
term node to represent computing, storage, physical, and virtual machines) contains a distinct
fragment to increase the data security. Only a single fragment is stored in the cloud nodes. So
successful attack on a single node must not reveal the locations of other fragments within the
cloud.
T-Coloring:
In this module to keep an attacker uncertain about the locations of the file fragments
and to further improve the security, we select the nodes in a manner that they are not adjacent
and are at certain distance from each other. The node separation is ensured by the means of
the T-coloring. The nodes storing the fragments are separated with certain distance by means
of graph T-coloring to prohibit an attacker of guessing the locations of the fragments. T-
coloring prohibits storing the fragment in neighborhood of a node storing a fragment,
resulting in the elimination of a number of nodes to be used for storage. In such a case, only
for the remaining fragments, the nodes that are not holding any fragment are selected for
storage randomly. To improve data retrieval time, the nodes are selected based on the
centrality measures in which shortest paths from the nodes that ensure an improved access
time. We choose the nodes that are most central to the cloud network to provide better access
time. The DROPS methodology uses the concept of centrality to reduce access time.
Replication:
In this module we have to replicate the data’s over the cloud nodes for the users. In
this the replicated data’s are stored in virtual machines that are created at the time of file
uploading and a secret key is generated for the files that are stored in that virtual machines.
So users can download the files by using the particular key that is generated at the time of
replication. To handle the download request from user, the cloud manager collects all the
fragments from the Nodes and re-assemble them into a single file. Afterwards, the file is sent
to the user.
32
MODULE DIAGRAMS:
Welcome
Page
Cloud
Appplicat
valid
username
Request Validate
Login Database
password Server
Invalid
Registrat
ion
Page
Cloud
User Random Key Generation Server
33
User Upload
Admin Login
Server
Cloud
Uploaded files storage
34
Fragmentation
Cloud
Data’s for uploading
storage
File Upload
Splitting of data’s
Fragmented Files
35
T-Coloring
Splitting
Users
Upload Fragment files
files
Secret Key Generation for
each file
Single
Fragmented data
In cloud nodes
T-Coloring
36
Replication
Original file
Download data
37
CHAPTER 5
Register:
register.jsp:
RegistrationServlet.java
package com.drops.servlet;
import java.io.File;
import java.io.IOException;
import java.util.Random;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import com.drops.beanclass.RegisterBean;
39
import com.drops.interfaces.SqlMethodImplementation;
@WebServlet("/Register")
public Register() {
super();
String user=request.getParameter("user");
String pass=request.getParameter("pass");
String cpass=request.getParameter("cpass");
String mail=request.getParameter("mail");
String sex=request.getParameter("sex");
String date=request.getParameter("date");
String month=request.getParameter("month");
String year=request.getParameter("year");
String phone=request.getParameter("no");
String add=request.getParameter("address");
String dateofbirth=date+"/"+month+"/"+year;
int secret=r.nextInt(100000);
40
String skey=""+secret;
rb.setUsername(user);
rb.setPass(pass);
rb.setCpass(cpass);
rb.setId(mail);
rb.setGender(sex);
rb.setDob(dateofbirth);
rb.setPhone(phone);
rb.setAddress(add);
rb.setSkey(skey);
String drive=request.getRealPath("/");
drive=drive.substring(0,drive.indexOf("."));
String path=drive+"drops\\WebContent\\userfile\\"+user;
file=new File("D:\\workspace\\new1\\sample\\WebContent\\
CloudServerDatas\\ Resource_Broker1\\"+user);
if(file.mkdir()){
System.out.println("Folder created");
SqlMethodImplementation
implementation=SqlMethodImplementation.getImplementation();
int status=implementation.register(rb);
41
if(status>0){
HttpSession session=request.getSession();
session.setAttribute("secret", skey);
request.getRequestDispatcher("secretkeydisplay.jsp").forward(request,
response);
else{
request.getRequestDispatcher("error.jsp").forward(request, response);
} }
user-login.jsp:
function validateForm()
42
var x=document.forms["myForm"]["username"].value;
if(x==null || x==""){
return false;
}
}
</script>
</head>
<body>
<div id="right">
<h1 style="color: yellow;">LOGIN</h1>
<form name="myForm" action="Login" method="post">
<table>
<tr><td style="color: aqua;">User Name</td><td><input type="text"
name="name" id="user" onblur="return validatelogin()"></input></td></tr>
<tr><td style="color: aqua;">Password</td><td><input type="password"
name="pass" id="passw" onblur="return validatepass()"></input></td></tr>
<tr><td style="color: aqua;">Secret Key</td><td><input type="password"
name="skey" id="key" onblur="return validatekey()"></input></td></tr>
<tr align="center"><td ></td><td><input type="submit" value="Login"
align="middle"></input></td></tr>
<tr align="right"><td align="right"><a style="color: yellow;"
href="register.jsp">New User Click Here</a></td></tr>
</table>
</form>
</div>
</body>
</html>
Login.java:
package com.drops.servlet;
import java.io.IOException;
43
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import com.drops.beanclass.RegisterBean;
import com.drops.interfaces.SqlMethodImplementation;
@WebServlet("/Login")
public Login() {
super();
//response.getWriter().append("Served at:
").append(request.getContextPath());
String user=request.getParameter("name");
String pass=request.getParameter("pass");
44
String keyValue=request.getParameter("skey");
System.out.println(keyValue);
rb.setUsername(user);
rb.setPass(pass);
rb.setSkey(keyValue);
SqlMethodImplementation
implementation=SqlMethodImplementation.getImplementation();
boolean b=implementation.login(rb);
if(b==true){
HttpSession session=request.getSession();
session.setAttribute("username", user);
request.getRequestDispatcher("Joinus.jsp").forward(request, response);
else{ request.getRequestDispatcher("error.jsp").forward(reque
st, response);
upload.jsp:
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
45
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Metamorphosis Design Free Css Templates</title>
<meta name="keywords" content="" />
<meta name="description" content="" />
<link href="styles.css" rel="stylesheet" type="text/css" />
</head>
<%
String username=(String)session.getAttribute("username");
%>
<div id="main">
<!-- header begins -->
<div id="header">
<div id="logo"><a href="#">metamorph_nightsky</a><h2><a
href="http://www.metamorphozis.com/" id="metamorph">Design by Metamorphosis
Design</a></h2></div>
<div id="buttons">
<div ><a href="index.jsp" class="but_1" title="">Home</a></div>
<div ><a href="upload.jsp" class="but_2" title="">upload</a></div>
<div><a href="#" class="but_3" title="">Gallery</a></div>
<div><a href="#" class="but_4" title="">Contact Us</a></div>
<div ><a href="logout.jsp" class="but_5" title="">LogOut</a></div>
</div>
</div>
<!-- header ends -->
<!-- content begins -->
<div id="content">
<div id="right">
<h1 style="color: yellow;">UPLOAD FILE</h1>
46
<form action="UploadFile" method="post" enctype="multipart/form-data">
<table>
<tr><td style="color: aqua;">Uplaod your file</td><td><input type="file"
name="name"></input></td></tr>
47
<div style="clear: both"><img src="images/spaser.gif" alt="" width="1"
height="1" /></div><br />
<h2>Free Website Templates</h2>
<div class="text">
<span>Fusce ac arcu porta eros tempor sodales id ut est. </span><br />
Quisque nec eros vel enim laoreet adipiscing sed nec massa. Aliquam metus nisi,
mattis non tincidunt et, facilisis vel dolor. Donec venenatis dictum adipiscing. Curabitur
accumsan elit vel metus rutrum quis euismod leo vehicula. Suspendisse vel ligula ut felis
adipiscing molestie. Suspendisse facilisis scelerisque sagittis. Proin nulla nibh, gravida
suscipit <br />
<div class="read"><a href="#">read more</a></div>
</div>
</div>
<div class="left_bot"></div>
</div>
<div style="clear: both"><img src="images/spaser.gif" alt="" width="1" height="1"
/></div>
</div>
<!-- content ends -->
<!-- footer begins -->
<div id="footer">
Copyright 2009. Designed by <a href="http://www.metamorphozis.com/" title="Website
Templates">Website Templates</a><br />
<a href="#">Privacy Policy</a> | <a href="#">Terms of Use</a> | <a
href="http://validator.w3.org/check/referer" title="This page validates as XHTML 1.0
Transitional"><abbr title="eXtensible HyperText Markup Language">XHTML</abbr></a> |
<a href="http://jigsaw.w3.org/css-validator/check/referer" title="This page validates as
CSS"><abbr title="Cascading Style Sheets">CSS</abbr></a></div>
<!-- footer ends -->
</div>
</body>
</html>
48
UploadFile.java:
package com.drops.servlet;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Date;
import java.util.Random;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import com.drops.beanclass.UploadBean;
import com.drops.interfaces.SqlMethodImplementation;
import com.oreilly.servlet.multipart.FilePart;
import com.oreilly.servlet.multipart.MultipartParser;
import com.oreilly.servlet.multipart.ParamPart;
import com.oreilly.servlet.multipart.Part;
@WebServlet("/UploadFile")
49
private static final long serialVersionUID = 1L;
public UploadFile() {
super();
Part part=null;
ParamPart paramPart=null;
FilePart filePart=null;
String fileName=null;
String filePath=null;
String fileType=null;
File file=null;
double fileSize = 0;
HttpSession session=request.getSession();
System.out.println("user\t"+userName);
String StoringPath=request.getSession().getServletContext().getRealPath("/");
int a=StoringPath.indexOf('.');
userfile\\"+userName+"\\";
50
UploadBean ub=new UploadBean();
while((part=parser.readNextPart())!=null)
{ if(part.isFile()){
filePart=(FilePart) part;
fileName=filePart.getFileName();
fileType=filePart.getContentType();
filePath=filePath+fileName;
System.out.println("file path\t"+filePath);
file=new File(filePath);
fileSize=filePart.writeTo(file);
System.out.println("file size\t"+fileSize);
ub.setUploadContent(fis);
else if (part.isParam()) {
paramPart=(ParamPart) part;
String tagname=paramPart.getName();
System.out.println(tagname+"tagname");
String tagValue=paramPart.getStringValue();
System.out.println("tag value"+tagValue);
String date=d.toString();
51
Random r=new Random();
int fileKey=r.nextInt(100000);
String displayKey=""+fileKey;
ArrayList<Object> al=new
ArrayList<>(); System.out.println(date);
al.add(userName);
al.add(fileName);
al.add(fileType);
al.add(fileSize);
al.add(filePath);
al.add(date);
al.add(displayKey);
SqlMethodImplementation
implementation=SqlMethodImplementation.getImplementation();
int status=implementation.upload(al);
if(status>0){
HttpSession session2=request.getSession();
session2.setAttribute("filename", fileName);
HttpSession hs=request.getSession();
hs.setAttribute("filekey", displayKey);
request.getRequestDispatcher("split.jsp").forward(request, response);
else{
request.getRequestDispatcher("error.jsp").forward(request, response);
}
52
}
Split.jsp:
<%@page import="java.io.IOException"%>
<%@page import="java.io.FileInputStream"%>
<%@page import="java.io.File"%>
<%@page import="java.io.FileOutputStream"%>
pageEncoding="ISO-8859-1"%>
<html>
<head>
</head>
<%
String username=(String)session.getAttribute("username");
%>
int a=path.indexOf('.');
String filepath=path.substring(0,a);
String filename=(String)session.getAttribute("filename");
username=(String)session.getAttribute("username");
String storingPath=filepath+"drops\\WebContent\\userfile\\"+username+"\\"+filename;
String splitPath=filepath+"drops\\WebContent\\splitfile\\"+filename;
String splitPath1=filepath+"drops\\WebContent\\splitfile\\Node1\\"+filename;
String splitPath2=filepath+"drops\\WebContent\\splitfile\\Node2\\"+filename;
String splitPath3=filepath+"drops\\WebContent\\splitfile\\Node3\\"+filename;
String splitPath4=filepath+"drops\\WebContent\\splitfile\\Node4\\"+filename;
String splitPath5=filepath+"drops\\WebContent\\splitfile\\Node5\\"+filename;
String splitPath6=filepath+"drops\\WebContent\\splitfile\\Node6\\"+filename;
String splitPath7=filepath+"drops\\WebContent\\splitfile\\Node7\\"+filename;
String splitPath8=filepath+"drops\\WebContent\\splitfile\\Node8\\"+filename;
String splitPath9=filepath+"drops\\WebContent\\splitfile\\Node9\\"+filename;
String splitPath10=filepath+"drops\\WebContent\\splitfile\\Node10\\"+filename;
System.out.print("pathh in split"+storingPath);
54
File inputFile = new File(storingPath);
long size = 0;
if(inputFile.exists())
double len=inputFile.length();
size=(long) (len/1024);
String filesize=""+size;
FileInputStream inputStream;
String newFileName4;
String newFileName1;
String newFileName2;
String newFileName3;
String newFileName5;
String newFileName6;
String newFileName7;
String newFileName8;
String newFileName9;
String newFileName10;
FileOutputStream filePart;
System.out.println("file size"+fileSize);
55
byte[] byteChunkPart;
try {
if (fileSize <= 5)
{ readLength = fileSize;
fileSize -= read;
nChunks++;
+ destIx;
+ destIx;
+ destIx;
+ destIx;
+ destIx;
56
+ destIx;
+ destIx;
+ destIx;
+ destIx;
+ destIx;
if(destIx==1){
filePart.write(byteChunkPart);
filePart.flush();
filePart.close();
if(destIx==2){
filePart.write(byteChunkPart);
filePart.flush();
filePart.close();
if(destIx==3){
57
filePart = new FileOutputStream(new File(newFileName3));
filePart.write(byteChunkPart);
filePart.flush();
filePart.close();
if(destIx==4){
filePart.write(byteChunkPart);
filePart.flush();
filePart.close();
if(destIx==5){
filePart.write(byteChunkPart);
filePart.flush();
filePart.close();
if(destIx==6){
filePart.write(byteChunkPart);
filePart.flush();
filePart.close();
58
}
if(destIx==7){
filePart.write(byteChunkPart);
filePart.flush();
filePart.close();
if(destIx==8){
filePart.write(byteChunkPart);
filePart.flush();
filePart.close();
if(destIx==9){
filePart.write(byteChunkPart);
filePart.flush();
filePart.close();
if(destIx==10){
filePart.write(byteChunkPart);
filePart.flush();
filePart.close();
59
}
byteChunkPart = null;
filePart = null;
//out.print("Splitted");
System.out.println("splitted"+storingPath);
inputStream.close();
exception.printStackTrace();
%>
<div id="main">
<div id="header">
<div id="buttons">
</div>
60
</div>
<div id="content">
<div id="right">
<%
String filekey=(String)session.getAttribute("filekey");
%>
</div>
<div id="left">
<div class="left_top"></div>
<div class="left_s">
</div>
</body>
</html>
Fragment.jsp:
<div id="main">
<!-- header begins -->
<div id="header">
<div id="logo"><a href="#">metamorph_nightsky</a><h2><a
href="http://www.metamorphozis.com/" id="metamorph">Design by Metamorphosis
Design</a></h2></div>
<div id="buttons">
<div ><a href="index.jsp" class="but_1" title="">Home</a></div>
<div ><a href="upload.jsp" class="but_2" title="">upload</a></div>
<div><a href="downloadoredit.jsp" class="but_3" title="">Download</a></div>
<div><a href="searchfile.jsp" class="but_4" title="">SearchFile</a></div>
<div ><a href="logout.jsp" class="but_5" title="">LogOut</a></div>
</div>
</div>
<!-- header ends -->
<!-- content begins -->
<div id="content">
<div id="right">
<h1 style="color: yellow;">Fragment the files</h1>
<form action="fragmentsuccess.jsp" method="" >
<%
String backColor = request.getParameter("COLOR");
if (backColor == null)
backColor = "skyblue";
%>
<BODY BGCOLOR="<%= backColor %>" >
</div>
</body>
</html>
admin.jsp:
62
<title>Metamorphosis Design Free Css Templates</title>
<meta name="keywords" content="" />
<meta name="description" content="" />
<link href="styles.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="main">
<!-- header begins -->
<div id="header">
<div id="logo"><a href="#">metamorph_nightsky</a><h2><a
href="http://www.metamorphozis.com/" id="metamorph">Design by Metamorphosis
Design</a></h2></div>
<div id="buttons">
<div ><a href="index.jsp" class="but_1" title="">Home</a></div>
<div ><a href="login.jsp" class="but_2" title="">Login</a></div>s
<div><a href="#" class="but_3" title="">Gallery</a></div>
<div><a href="#" class="but_4" title="">About us</a></div>
<div ><a href="#" class="but_5" title="">Contact us</a></div>
</div>
</div>
<!-- header ends -->
<!-- content begins -->
<div id="content">
<div id="right">
<h1 style="color: yellow;">Admin LOGIN</h1>
<form action="Admin" method="post">
<table>
<tr><td style="color: aqua;">Admin Name</td><td><input type="text"
name="name"></input></td></tr>
<tr><td style="color: aqua;">Password</td><td><input type="password"
name="pass"></input></td></tr>
<tr><td><input type="submit" value="Login"></input></td></tr>
</table>
</form>
63
</div>
</div>
</body>
</html>
Admin.java:
package com.drops.servlet;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@WebServlet("/Admin")
public Admin() {
super();
doGet(request, response);
String name=request.getParameter("name");
64
String pass=request.getParameter("pass");
System.out.println(name);
System.out.println(pass);
if(name.equals("admin")&&pass.equals("admin")){
request.getRequestDispatcher("viewuser.jsp").forward(request,
response);
else{ request.getRequestDispatcher("error.jsp").forward
(request, response);
adminsearch.jsp
function userdetails(){
//alert("hi");
65
var user=document.getElementById("username").value;
if(user==""){
var xmlhttp;
var urls="search.jsp?ok="+user;
if(window.XMLHttpRequest){
xmlhttp=new XMLHttpRequest();
//alert("hello")
}
else{
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4)
{
var some=xmlhttp.responseText;
//alert(some+"::::::::");
document.getElementById("avail").innerHTML=some;
}
}
xmlhttp.open("POST",urls,true);
xmlhttp.send();
66
}
</script>
</head>
<body>
<!-- <form action=""> -->
<table>
<tr><td>User Name</td><td><input type="text" name="user"
id="username"></input></td></tr>
<tr><td><input type="submit" value="submit" onclick="return
userdetails(this.value)"></input></td></tr>
</table>
<span id="avail"></span>
<!-- </form> -->
</body>
</html>
Search.jsp:
<%@page import="java.util.List"%>
<%@page import="java.util.Iterator"%>
<%@page import="com.drops.interfaces.SqlMethodImplementation"%>
<table border="10">
<tr align="right"><td align="center" style="color: black;">UserName </td><td
align="center" style="color: black;"> FileName </td><td align="center" style="color:
black;">FileType </td><td align="center" style="color: black;">FileSize</td></tr>
<%
String user=request.getParameter("ok");
SqlMethodImplementation implementation=SqlMethodImplementation.getImplementation();
List status=implementation.getUserDetails(user);
System.out.println("stst"+status);
if(!status.isEmpty()){
67
Iterator it=status.iterator();
while(it.hasNext()){
String username=(String)it.next();
String filename=(String)it.next();
String type=(String)it.next();
String size=(String)it.next();
%>
<tr><td style="color: black;" ><%=username %></td><td style="color: black;"><
%=filename %></td><td style="color: black;"><%=type %></td><td style="color: black;"><
%=size %></td>
<%
}
}
%>
</table>
</body>
</html>
Downloadfile.jsp
<%@page import="java.util.Iterator"%>
<%@page import="java.util.ArrayList"%>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<%
68
ArrayList arrayList=(ArrayList)request.getSession().getAttribute("arrayvaleu");
System.out.println("^%%%%%%%%%%%%%"+arrayList);
Iterator iterator=arrayList.iterator();
while(iterator.hasNext())
{
String
username=iterator.next().toString();
String Filename=iterator.next().toString();
String type=iterator.next().toString();
}
%>
</body>
</html>
Download.java
package com.drops.servlet;
import java.io.DataInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.ServletOutputStream;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
@WebServlet("/download")
public class download extends HttpServlet {
private static final long serialVersionUID = 1L;
69
public download() {
70
super();
// TODO Auto-generated constructor stub
}
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws
ServletException, IOException {
// TODO Auto-generated method stub
String s=request.getParameter("fname");
System.out.println(""+s);
// doPost(request, response);
doPost(request, response);
}
protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
// TODO Auto-generated method stub
try{
HttpSession session=request.getSession();
String user=(String)session.getAttribute("username");
String filename=request.getParameter("fname");
String filepath=request.getParameter("fpath");
System.out.println(filename+"filenamedhdghdghdg@#@@#@"+filepath);
String folder=request.getRealPath("/");
folder=folder.substring(0, folder.indexOf("."));
System.out.println("folder"+folder); folder=folder+"drops\\
WebContent\\userfile\\"+user+"\\"; File file=new
File(folder,filename);
int length = 0;
ServletOutputStream outStream = response.getOutputStream();
ServletContext context=getServletConfig().getServletContext();
String mimietype=context.getMimeType(filepath);
if(mimietype==null)
{
71
mimietype = "application/octet-stream";
}
response.setContentType(mimietype);
response.setContentLength((int)file.length());
response.setHeader("Content-Disposition", "attachement; filename=\""+
filename+"\"");
//BUFSIZE
byte[] bytebuffer=new byte[(int)file.length()];
DataInputStream dis = new DataInputStream(new FileInputStream(file));
while((dis != null) && ((length = dis.read(bytebuffer)) != -1 ))
{
outStream.write(bytebuffer, 0, length);
}
dis.close();
outStream.close();
}
catch(Exception e)
{
e.printStackTrace();
}
}
72
SNAPSHOTS
Register.jsp
Login.jsp
73
package.jsp
Upload.jsp
74
Fragment.jsp
Fragmentfiles.jsp
75
Split.jsp
76
Admin.jsp
Adminmonitoring.jsp
77
Adminsearch.jsp
downloadoredit.jsp
78
CONCLUSIONS AND FUTURE WORK
CONCLUSION:
FUTURE WORK:
79
REFERENCES
[1].N. Bitouzé and L. Dolecek, “Synchronization from insertions and deletions under a non-
binary, non-uniform source,” in Proc.
[2] N. Bitouzé, F. Sala, S. M. S. Tabatabaei Yazdi, and L. Dolecek, “A practical framework
for efficient file synchronization,” in Proc..
[3] M. Mitzenmacher and G. Varghese, “The complexity of object reconciliation, and open
problems related to set difference and coding,”
[4] R. L. Dobrushin, “Shannon’s theorems for channels with synchronization errors,”
Problems Inf. Transmiss.,
[5] V. I. Levenshtein, “Binary codes capable of correcting deletions, insertions and reversals,”
Sov. Phys.—Dokl
[6] G. Tenengolts, “Nonbinary codes, correcting single deletion or insertion (Corresp.
[7] A. S. J. Helberg and H. C. Ferreira, “On multiple insertion/deletion correcting codes.
[8] K. A. S. Abdel-Ghaffar, F. Paluncic, H. C. Ferreira, and W. A. Clarke, “On Helberg’s
generalization of the Levenshtein code for multiple deletion/insertion error correction.
[9] L. Dolecek and V. Anantharam, “Repetition error correcting sets: Explicit constructions
and prefixing methods.
[10] M. Mitzenmacher, “A survey of results for deletion channels and related
synchronization channels.
80