Erasure Code Full Report
Erasure Code Full Report
Objective:
We propose a novel method called secure erasure code based algorithm for cloud data
security in distributed storage systems.
ABSTRACT:
DISADVATAGES:
❖ The user can perform more computation and communication traffic between the user
❖ The user has to manage his cryptographic keys otherwise the security has to be
broken.
❖ The data storing and retrieving, it is hard for storage servers to directly support other
functions.
PROPOSED SYSTEM:
In our proposed system we address the problem of forwarding data to another
user by storage servers directly under the command of the data owner. We consider the
system model that consists of distributed storage servers and key servers. Since storing
cryptographic keys in a single device is risky, a user distributes his cryptographic key to key
servers that shall perform cryptographic functions on behalf of the user. These key servers are
highly protected by security mechanisms.
Here Storage system has allocates by different data container. Once owner
uploads the data with AES encryption mechanism, system again takes the data and makes
Secure Data segregation process. All the data pieces will be save in different location in cloud
storage. Here public distributor monitors all the data and corresponding positions where it is
saved. When a proper client asking the data, cloud system will provide the data in reversible
manner. So our system will prevent our data from both Inside and Outside attackers.
ADVANTAGES:
❖ Tight integration of encoding, encryption, and forwarding makes the storage system
efficiently meet the requirements of data robustness, data confidentiality, and data
forwarding.
❖ The storage servers independently perform encoding and re-encryption process and
❖ More flexible adjustment between the number of storage servers and robustness.
System architecture:
Admin login
Server1
Server3
Server4
File upload
Proxy re encryption
Download the data
HARDWARE SPECIFICATION
● Hard Disk : 80 GB
SOFTWARE SPECIFICATION
● Language : Java
Technical Terms:
Module
1. Registration
2. Sharing Data
3. Secure Cloud Storage
4. Proxy re-encryption
5. Data retrieval
Registration:
For the registration of user with identity ID the group manager randomly selects
a number. Then the group manager adds into the group user list which will be used in
the traceability phase. After the registration, user obtains a private key which will be
used for group signature generation and file decryption.
Registration
Group Manager Group Members
Sharing Data:
The canonical application is data sharing. The public auditing property is especially
useful when we expect the delegation to be efficient and flexible. The schemes enable a
content provider to share her data in a confidential and selective way, with a fixed and small
ciphertext expansion, by distributing to each authorized user a single and small aggregate
key.
Proxy re-encryption:
Proxy re-encryption schemes are crypto systems which allow third parties (proxies) to
alter a cipher text which has been encrypted for one user, so that it may be decrypted by
another user. By using proxy re-encryption technique the encrypted data (cipher text) in the
cloud is again altered by the user. It provides highly secured information stored in the cloud.
Every user will have a public key and private key. Public key of every user is known to
everyone but private key is known only the particular user.
Data retrieval:
Reports and data are the two primary forms of the retrieved data from servers. There are
some overlaps between them, but queries generally select a relatively small portion of the
server, while reports show larger amounts of data. Queries also present the data in a standard
format and usually display it on the monitor; whereas reports allow formatting of the output
however you like and is normally retrieved.
Registration
Database SQL
Login Compare
File upload
Level 1
Key
Cipher text
Plain text
Encryption
Cloud Storage
Encrypted File
Level 2:
SQL
USECASE:-
Net
wor
End
user
Data
encryption/encoding
No of
S
Server
C er
li
Proxy
Reencryption
Provid
ekey
Upload/
Download
Description:
Use case diagrams gives a graphic overview of the actors involved in a system, different
functions needed by those actors and how these different functions are interacted.
Here the sender and receiver are the actors and select video, select file, encryption key,
decrypt data, extract data and view data are the functions
CLASS DIAGRAM:-
S
Data dividing
Serv Security provider
User Serv
er 1
Serv
er 2
Encryp
Log
tion
er 3
Login ffile
Erasure Secur
Application
User name() code() ity()
Password()
Manipulatio Datab
n up ase
downl
se
dat
up
oad de
le
de
dat
let
let manipulat
e()
Update_file()
Select_file()
Delete_file()
Description:
It is the main building block of any object oriented solution. It shows the classes in a system,
attributes and operations of each class and the relationship between each class.
A class has three parts, name at the top, attributes in the middle and operations or methods at
the bottom. In large systems with many related classes, classes are grouped together to create
class diagrams. Different relationships between classes are shown by different types of
arrows.
Here sender, embed data, receiver, encrypt and decrypt are the classes, each class contains its
own attribute and functions, they are related by arrows.
SEQUENCE DIAGRAM:-
Net W encry s
wor e ption er
Description:
Sequence diagrams in UML shows how object interact with each other and the order those
interactions occur. It’s important to note that they show the interactions for a particular
scenario. The processes are represented vertically and interactions are show as arrows.
Here sender, receiver, embedding data and room are objects they interact each other. The
arrow shows interaction like send cover video and data, reserving room etc.
COLLABORATION DIAGRAM:-
Description:
collaboration diagram, is an interaction diagram that shows similar information to sequence
diagrams but its primary focus is on object relationships.
On collaboration diagrams, objects are shown with association connectors between them.
Messages are added to the associations and show as short arrows pointing in the direction of
the message flow. The sequence of messages is shown through a numbering scheme
Here the objects like sender, receiver, room and Embed data are connected each other and
messages are added to the associations
ACTIVITY DIAGRAM:-
Description:
Activity diagrams represent workflows in an graphical way. They can be used to describe
business workflow or the operational workflow of any component in a system
Definition
The Advanced Encryption Standard (AES) is an encryption algorithm for securing sensitive
but unclassified material by U.S. Government agencies and, as a likely consequence, may
eventually become the de facto encryption standard for commercial transactions in the
private sector. (Encryption for the US military and other classified communications is
handled by separate, secret algorithms.)In January of 1997, a process was initiated by the
National Institute of Standards and Technology (NIST), a unit of the U.S. Commerce
Department, to find a more robust replacement for the Data Encryption Standard (DES) and
to a lesser degree Triple DES. The specification called for a symmetric algorithm
(same key for encryption and decryption) using block encryption (see block cipher) of 128
bits in size, supporting key sizes of 128, 192 and 256 bits, as a minimum. The algorithm was
required to be royalty-free for use worldwide and offer security of a sufficient level to
protect data for the next 20 to 30 years. It was to be easy to implement in hardware and
software, as well as in restricted environments (for example, in a smart card) and offer good
defenses against various attack techniques.The entire selection process was fully open to
public scrutiny and comment, it being decided that full visibility would ensure the best
possible analysis of the designs. In 1998, the NIST selected 15 candidates for the AES, which
were then subject to preliminary analysis by the world cryptographic community, including
the National Security Agency. On the basis of this, in August 1999, NIST selected five
algorithms for more extensive analysis. These were:
● Rijndael, submitted by two Belgian cryptographers, Joan Daemen and Vincent Rijmen
Explanations
AES is based on a design principle known as a Substitution permutation network. It is fast in
both software and hardware. Unlike its predecessor, DES, AES does not use a Feistel
network.AES has a fixed block size of 128 bits and a key size of 128, 192, or 256 bits,
whereas Rijndael can be specified with block and key sizes in any multiple of 32 bits, with a
minimum of 128 bits. The blocksize has a maximum of 256 bits, but the keysize has no
theoretical maximum.AES operates on a 4×4 column-major order matrix of bytes, termed
the state (versions of Rijndael with a larger block size have additional columns in the state).
Most AES calculations are done in a special finite field.The AES cipher is specified as a
number of repetitions of transformation rounds that convert the input plaintext into the
final output of ciphertext. Each round consists of several processing steps, including one
that depends on the encryption key. A set of reverse rounds are applied to transform
ciphertext back into the original plaintext using the same encryption key.
1. KeyExpansion—round keys are derived from the cipher key using Rijndael's key
schedule
2. Initial Round
1. AddRoundKey—each byte of the state is combined with the round key
using bitwise xor
3. Rounds
1. SubBytes—a non-linear substitution step where each byte is replaced
with another according to lookup.
2. ShiftRows—a transposition step where each row of the state is shifted
cyclically a certain number of steps.
3. MixColumns—a mixing operation which operates on the columns of the
state, combining the four bytes in each column.
4. AddRoundKey
4. Final Round (no MixColumns)
1. SubBytes
2. ShiftRows
3. AddRoundKey
Diagrams
Examples
In this appendix, twenty examples are provided for the MAC generation process. The
underlying block cipher is either the AES algorithm or TDEA. A block cipher key is fixed for
each of the currently allowed key sizes, i.e., AES-128, AES-192, AES-256, two key TDEA, and
three key TDEA. For each key, the generation of the associated subkeys is given, followed by
four examples of MAC generation with the key. The messages in each set of examples are
derived by truncating a common fixed string of 64 bytes. All strings are represented in
hexadecimal notation, with a space (or a new line) inserted every 8 symbols, for readability.
As in the body of the Recommendation, K1 and K2denote the subkeys, M denotes the
message, and T denotes the MAC. For the AES algorithm examples, Tlen is 128, i.e., 32
hexadecimal symbols, and K denotes the key. For the TDEA examples, Tlen is 64, i.e., 16
hexadecimal symbols, and the key, K, is the ordered triple of strings, (Key1, Key2, Key3). For
two key TDEA, Key1 = Key3. D.1 AES-128
For Examples 1–4 below, the block cipher is the AES algorithm with the following 128 bit
key:
Subkey Generation
CIPHK(0
128
Example Explanations
The Advanced Encryption Standard (AES) specifies a FIPS-approved cryptographic algorithm
that can be used to protect electronic data. The AES algorithm is a symmetric block cipher
that can encrypt (encipher) and decrypt (decipher) information. Encryption converts data to
an unintelligible form called ciphertext; decrypting the ciphertext converts the data back
into its original form, called plaintext. The AES algorithm is capable of using cryptographic
keys of 128, 192, and 256 bits to encrypt and decrypt data in blocks of 128 bits.
Definition
MD5 is an algorithm that is used to verify data integrity through the creation of a 128-bit
message digest from data input (which may be a message of any length) that is claimed to
be as unique to that specific data as a fingerprint is to the specific individual. MD5, which
was developed by Professor Ronald L. Rivest of MIT, is intended for use with digital
signature applications, which require that large files must be compressed by a secure
method before being encrypted with a secret key, under a public key cryptosystem. MD5 is
currently a standard, Internet Engineering Task Force (IETF) Request for Comments (RFC)
1321. According to the standard, it is "computationally infeasible" that any two messages
that have been input to the MD5 algorithm could have as the output the same message
digest, or that a false message could be created through apprehension of the message
digest. MD5 is the third message digest algorithm created by Rivest. All three (the others are
MD2 and MD4) have similar structures, but MD2 was optimized for 8-bit machines, in
comparison with the two later formulas, which are optimized for 32-bit machines. The MD5
algorithm is an extension of MD4, which the critical review found to be fast, but possibly not
absolutely secure. In comparison, MD5 is not quite as fast as the MD4 algorithm, but offers
much more assurance of data security.
Explanations
The MD5 Message-Digest Algorithm is a widely used cryptographic hash function that
produces a 128-bit (16-byte) hash value. Specified in RFC 1321, MD5 has been employed in
a wide variety of security applications, and is also commonly used to check data integrity.
However, it has been shown that MD5 is not collision resistant; as such, MD5 is not suitable
for applications like SSL certificates or digital signatures that rely on this property. An MD5
hash is typically expressed as a 32-digit hexadecimal number.MD5 was designed by Ron
Rivest in 1991 to replace an earlier hash function, MD4. In 1996, a flaw was found with the
design of MD5. While it was not a clearly fatal weakness, cryptographers began
recommending the use of other algorithms, such as SHA-1 (which has since been found also
to be vulnerable). In 2004, more serious flaws were discovered, making further use of the
algorithm for security purposes questionable; specifically, a group of researchers described
how to create a pair of files that share the same MD5 checksum. Further advances were
made in breaking MD5 in 2005, 2006, and 2007. In an attack on MD5 published in December
2008, a group of researchers used this technique to fake SSL certificate validity.
MD5 Diagram
Data
Message Registers
Length
Counter
Destination
MD5 Round MAC Adress
Operations
Source MAC
Padding Adress
COunt
MIC Key
Example
MD5 (Message-Digest algorithm 5) is a widely used cryptographic hash function with a 128-
bit hash value. Specified in RFC 1321, MD5 is one in a series of message digest algorithms
designed by Professor Ronald Rivest of MIT (Rivest, 1994). Today MD5 has been employed
in a wide variety of security applications, and is also commonly used to check the integrity of
files. MD5 is perfectly fine solution for security thinking, As one Java developer, we usually
need to take over or coding to md5 encryption, the md5 encryption is very complicated and
not to easy implement. Ideally, The standard edition of Java has really came with MD5
support built in. according by Java specification class MessageDigest support applications
the functionality of a message digest algorithm, such as MD5 or SHA.. and it is defined in the
java.security package. firstly you need some string manipulation to turn the plain text into
byte array. This is going easy just use method getBytes() of class string. the digest is then
updated from the bytes from the byte array and a hash computation is conducted upon
them.
import java.io.FileInputStream;
import java.io.UnsupportedEncodingException;
import java.math.BigInteger;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
try {
MessageDigest md = MessageDigest.getInstance("MD5");
// Now we need to zero pad it if you actually want the full 32 chars.
return hashtext;
catch (NoSuchAlgorithmException e) {
System.out.println(getMD5("Javarmi.com"));
Example Explanations
It is simply a one-way fingerprint of the message. It doesn't include the original message,
and you can't (generally) use the fingerprint (the md5sum) to 'figure out' the original
message.Okay, so you take a message - like a password - and generate an MD5sum from it..
Can't you brute-force that? Like any password system, you could attempt to brute force the
answer. However, MD5sum's are in a 128-bit space, meaning that to brute force it would
take 2^128 attempts - thats over 3 with 38 zeroes afterit.Neat! Thats a lot. Are there any
flaws in the algorithm that could speed it up?A birthday attack is based on the theory that
there *might* be *one* md5sum that matches multiple inputs. In theory, it is possible that
a "birthday" attack could be possible - two md5sum hashes could be the same. But even
then, the total number of brute forces is at 2^64 attempts - still a heck of a lot.Okay. But
couldn't (insert super-sneaky government agency here) build an md5 dictionary, and know
what the password was with the md5?Yes. Its entirely possible. However - it would take
some work to do so. For example, just for a dictionary consisting of Alphabet letters (upper
and lower), and numbers, there would be 46,656,000,000 entries - all at 32 characters each.
Thats over 1 terabyte of data to store and search! It could be done - absolutely. But is it
likely? So its hard to brute force, what about dictionary attacks? Dictionary attacks are a way
of attacking poor passwords - most people use words in their passwords. If you can guess
the word - for example, "love", then you can cut down the number of tries it would take. Of
course if you guess right, then your # of attacks = 1. However, in general, using common
computers as of the writing of this (2005), you can generally get roughly 5 million attacks
per second, or fast enough to guess all 8-character Alphanumericals within 497 days.
Proxy re-encryption
Proxy re-encryption (PRE) allows a proxy to convert a ciphertext encrypted under one key
into an encryption of the same message under another key. The main idea is to place as
little trust and reveal as little information to the proxy as necessary to allow it to perform its
translations. At the very least, the proxy should not be able to learn the keys of the
participants or the content of the messages it re-encrypts. However, in all prior PRE
schemes, it is easy for the proxy to determine between which participants a re-encryption
key can transform ciphertexts. This can be a problem in practice. For example, in a secure
distributed file system, content owners may want to use the proxy to help re-encrypt
sensitive information without revealing to the proxy the identity of the recipients.
In this work, we propose key-private (or anonymous) re-encryption keys as an additional
useful property of PRE schemes. We formulate a definition of what it means for a PRE
scheme to be secure and key-private. Surprisingly, we show that this property is not
captured by prior definitions or achieved by prior schemes, including even the secure
obfuscation of PRE by Hohenberger et al. Finally, we propose the first key-private PRE
construction and prove its CPA-security under a simple extension of Decisional Bilinear Diffie
Hellman assumption and its key-privacy under the Decision Linear assumption in the
standard model.
In information theory, an erasure code is a forward error correction (FEC) code for the
binary erasure channel, which transforms a message of k symbols into a longer message
(code word) with n symbols such that the original message can be recovered from a subset
of the n symbols. The fraction r = k/n is called the code rate, the fraction k’/k, where k’
denotes the number of symbols required for recovery, is called reception efficiency.
Optimal erasure codes have the property that any k out of the n code word symbols are
sufficient to recover the original message (i.e., they have optimal reception efficiency).
Optimal erasure codes are maximum distance separable codes (MDS codes).Optimal codes
are often costly (in terms of memory usage, CPU time, or both) when n is large. Except for
very simple schemes, practical solutions usually have quadratic encoding and decoding
For Examples 1–4 below, the block cipher is the AES algorithm with the following 128 bit
key:
Subkey Generation
CIPHK(0
128
Example Explanations
The Advanced Encryption Standard (AES) specifies a FIPS-approved cryptographic algorithm
that can be used to protect electronic data. The AES algorithm is a symmetric block cipher
that can encrypt (encipher) and decrypt (decipher) information. Encryption converts data to
an unintelligible form called ciphertext; decrypting the ciphertext converts the data back
into its original form, called plaintext. The AES algorithm is capable of using cryptographic
keys of 128, 192, and 256 bits to encrypt and decrypt data in blocks of 128 bits.
History
The JAVA language was created by James Gosling in June 1991 for use in a set top
box project. The language was initially called Oak, after an oak tree that stood outside
Gosling's office - and also went by the name Green - and ended up later being renamed to
Java, from a list of random words. Gosling's goals were to implement a virtual machine and a
language that had a familiar C/C++ style of notation. The first public implementation was
Java 1.0 in 1995. It promised "Write Once, Run Anywhere” (WORA), providing no-cost
runtimes on popular platforms. It was fairly secure and its security was configurable,
allowing network and file access to be restricted. Major web browsers soon incorporated the
ability to run secure Java applets within web pages. Java quickly became popular. With the
advent of Java 2, new versions had multiple configurations built for different types of
platforms. For example, J2EE was for enterprise applications and the greatly stripped down
version J2ME was for mobile applications. J2SE was the designation for the Standard
Edition. In 2006, for marketing purposes, new J2 versions were renamed Java EE, Java ME,
and Java SE, respectively.
In 1997, Sun Microsystems approached the ISO/IEC JTC1 standards bodyand later
the Ecma International to formalize Java, but it soon withdrew from the process. Java remains
a standard that is controlled through the Java Community Process. At one time, Sun made
most of its Java implementations available without charge although they were proprietary
software. Sun's revenue from Java was generated by the selling of licenses for specialized
products such as the Java Enterprise System. Sun distinguishes between its Software
Development Kit (SDK) and Runtime Environment (JRE)which is a subset of the SDK, the
primary distinction being that in the JRE, the compiler, utility programs, and many necessary
header files are not present.
Primary goals
There were five primary goals in the creation of the Java language:
systems.
● It should be easy to use by selecting what were considered the good parts of
● Simple
● Architecture neutral
● Object oriented
● Portable
● Distributed
● High performance
In the Java programming language, all source code is first written in plain text files
ending with the .java extension. Those source files are then compiled into .class files by
the javac compiler.
A .class file does not contain code that is native to your processor; it instead
contains byte codes — the machine language of the Java Virtual Machine 1 (Java VM). The
java launcher tool then runs your application with an instance of the Java Virtual Machine.
Because the Java VM is available on many different operating systems, the same
TM
.class files are capable of running on Microsoft Windows, the Solaris Operating System
(Solaris OS), Linux, or Mac OS. Some virtual machines, such as the Java Hot Spot virtual
machineperform additional steps at runtime to give your application a performance boost.
This include various tasks such as finding performance bottlenecks and recompiling (to
native code) frequently used sections of code.
Through the Java VM, the same application is capable of running on
multiple platforms.
You've already been introduced to the Java Virtual Machine; it's the base for the Java
platform and is ported onto various hardware-based platforms.
The API is a large collection of ready-made software components that provide many
useful capabilities. It is grouped into libraries of related classes and interfaces; these libraries
are known as packages. The next section, What CanJavaTechnologyDo?Highlights some of
the functionality provided by the API.
The API and Java Virtual Machine insulate the program from the
underlying hardware.
As a platform-independent environment, the Java platform can be a bit slower than native
code. However, advances in compiler and virtual machine technologies are bringing performance
close to that of native code without threatening portability.
The Java Runtime Environment, or JRE, is the software required to run any
application deployed on the Java Platform. End-users commonly use a JRE in software
packages and Web browser plug-in. Sun also distributes a superset of the JRE called the Java
2 SDK(more commonly known as the JDK), which includes development tools such as the
Javacompiler,Javadoc, Jarand debugger.
One of the unique advantages of the concept of a runtime engine is that errors
(exceptions) should not 'crash' the system. Moreover, in runtime engine environments such as
Java there exist tools that attach to the runtime engine and every time that an exception of
interest occurs they record debugging information that existed in memory at the time the
exception was thrown (stack and heap values). These Automated Exception Handling tools
provide 'root-cause' information for exceptions in Java programs that run in production,
testing or development environments.
Uses OF JAVA
Blue is a smart card enabled with the secure, cross-platform, object-oriented Java
Card API and technology. Blue contains an actual on-card processing chip, allowing for
enhance able and multiple functionality within a single card. Applets that comply with the
Java Card API specification can run on any third-party vendor card that provides the
necessary Java Card Application Environment (JCAE). Not only can multiple applet
programs run on a single card, but new applets and functionality can be added after the card
is issued to the customer
JSP :
The JSP syntax adds additional XML-like tags, called JSP actions, to be used to
invoke built-in functionality. Additionally, the technology allows for the creation of JSP tag
libraries that act as extensions to the standard HTML or XML tags. Tag libraries provide a
platform independent way of extending the capabilities of a Web server.
JSPs are compiled into Java Servlet by a JSP compiler. A JSP compiler may generate
a servlet in Java code that is then compiled by the Java compiler, or it may generate byte code
for the servlet directly. JSPs can also be interpreted on-the-fly reducing the time taken to
reload changes
JavaServer Pages (JSP) technology provides a simplified, fast way to create dynamic
web content. JSP technology enables rapid development of web-based applications that are
server and platform-independent.
Architecture OF JSP
With the exception of cookies, HTTP and form submission data is not available to
JavaScript. And, since it runs on the client, JavaScript can't access server-side resources like
databases, catalogs, pricing information, and the like. Static HTML. Regular HTML, of
course, cannot contain dynamic information. JSP is so easy and convenient that it is quite
feasible to augment HTML pages that only benefit marginally by the insertion of small
amounts of dynamic data. Previously, the cost of using dynamic data would preclude its use
in all but the most valuable instances.
ARCHITECTURE OF JSP
● The browser sends a request to a JSP page.
The Java Servlet API allows a software developer to add dynamic content to a Web
server using the Java platform. The generated content is commonly HTML, but may be other
data such as XML. Servlet are the Java counterpart to non-Java dynamic Web content
technologies such as PHP, CGI and ASP.NET. Servlet can maintain state across many server
transactions by using HTTP cookies, session variables or URL rewriting.
The Servlet API, contained in the Java package hierarchy javax. Servlet, defines the
expected interactions of a Web container and a Servlet. A Web container is essentially the
component of a Web server that interacts with the Servlet. The Web container is responsible
for managing the lifecycle of Servlet, mapping a URL to a particular Servlet and ensuring
that the URL requester has the correct access rights.
A Servlet is an object that receives a request and generates a response based on that
request. The basic Servlet package defines Java objects to represent Servlet requests and
responses, as well as objects to reflect the Servlet configuration parameters and execution
environment. The package javax .Servlet. Http defines HTTP-specific subclasses of the
generic Servlet elements, including session management objects that track multiple requests
and responses between the Web server and a client. Servlet may be packaged in a WAR file
as a Web application.
Servlet can be generated automatically by Java Server Pages(JSP), or alternately by
template engines such as Web Macro. Often Servlet are used in conjunction with JSPs in a
pattern called "Model 2”, which is a flavour of the model-view-controller pattern.
Servlet are Java technology's answer to CGI programming. They are programs that
run on a Web server and build Web pages. Building Web pages on the fly is useful (and
commonly done) for a number of reasons:.
The Web page is based on data submitted by the user. For example the results pages
from search engines are generated this way, and programs that process orders for e-commerce
sites do this as well. The data changes frequently. For example, a weather-report or news
headlines page might build the page dynamically, perhaps returning a previously built page if
it is still up to date. The Web page uses information from corporate databases or other such
sources. For example, you would use this for making a Web page at an on-line store that lists
current prices and number of items in stock.
Some Web servers, such as Sun's Java Web Server (JWS), W3C's Jigsaw and Gefion
Software's Lite Web Server (LWS) are implemented in Java and have a built-in Servlet
engine. Other Web servers, such as Netscape's Enterprise Server, Microsoft's Internet
Information Server (IIS) and the Apache Group's Apache, require a Servlet engine add-on
module. The add-on intercepts all requests for Servlet, executes them and returns the
response through the Web server to the client. Examples of Servlet engine add-ons are Gefion
Software's WAI Cool Runner, IBM's Web Sphere, Live Software's JRun and New Atlanta's
Servlet Exec.
All Servlet API classes and a simple Servlet-enabled Web server are combined into
the Java Servlet Development Kit (JSDK), available for download at Sun's official Servlet
site .To get started with Servlet I recommend that you download the JSDK and play around
with the sample Servlet.
The container calls the init() method. This method initializes the Servlet and must be
called before the Servlet can service any requests. In the entire life of a Servlet, the init()
method is called only once. After initialization, the Servlet can service client-requests.
Each request is serviced in its own separate thread. The container calls the service()
method of the Servlet for every request.
The service() method determines the kind of request being made and dispatches it to
an appropriate method to handle the request. The developer of the Servlet must provide an
implementation for these methods. If a request for a method that is not implemented by the
Servlet is made, the method of the parent class is called, typically resulting in an error being
returned to the requester. Finally, the container calls the destroy() method which takes the
Servlet out of service. The destroy() method like init() is called only once in the lifecycle of a
Servlet.
The HttpServletRequest object provides the same information as the CGI environment
variables, plus more, in a standardized way. It also provides methods for extracting HTTP
parameters from the query string or the request body depending on the type of request (GET
or POST). As a Servlet developer you access parameters the same way for both types of
requests. Other methods give you access to all request headers and help you parse date and
cookie headers.
Instead of writing the response to stdout as you do with CGI, you get an
OutputStream or a PrintWriter from the HttpServletResponse. The OuputStream is intended
for binary data, such as a GIF or JPEG image, and the PrintWriter for text output. You can
also set all response headers and the status code, without having to rely on special Web server
CGI configurations such as Non Parsed Headers (NPH). This makes your Servlet easier to
install.
There is only one Servlet Context in every application. This object can be used by all
the Servlet to obtain application level information or container details. Every Servlet, on the
other hand, gets its own ServletConfig object. This object provides initialization parameters
for a servlet. A developer can obtain the reference to Servlet Context using either the
ServletConfig object or Servlet Request object.
All servlets belong to one servlet context. In implementations of the 1.0 and 2.0
versions of the Servlet API all servlets on one host belongs to the same context, but with the
2.1 version of the API the context becomes more powerful and can be seen as the humble
beginnings of an Application concept. Future versions of the API will make this even more
pronounced.
Many servlet engines implementing the Servlet 2.1 API let you group a set of servlets
into one context and support more than one context on the same host. The Servlet Context in
the 2.1 API is responsible for the state of its servlets and knows about resources and attributes
available to the servlets in the context. Here we will only look at how Servlet Context
attributes can be used to share information among a group of servlets.
There are three Servlet Context methods dealing with context attributes: get Attribute,
set Attribute and remove Attribute. In addition the servlet engine may provide ways to
configure a servlet context with initial attribute values. This serves as a welcome addition to
the servlet initialization arguments for configuration information used by a group of servlets,
for instance the database identifier we talked about above, a style sheet URL for an
application, the name of a mail server, etc.
JDBC
A database that another program links to is called a data source. Many data sources,
including products produced by Microsoft and Oracle, already use a standard called Open
Database Connectivity (ODBC). Many legacy C and Perl programs use ODBC to connect to
data sources. ODBC consolidated much of the commonality between database management
systems. JDBC builds on this feature, and increases the level of abstraction. JDBC-ODBC
bridges have been created to allow Java programs to connect to ODBC-enabled database
software.
JDBC Architecture
Two-tier and Three-tier Processing Models
The JDBC API supports both two-tier and three-tier processing models for database
access.
In the two-tier model, a Java applet or application talks directly to the data source.
This requires a JDBC driver that can communicate with the particular data source being
accessed. A user's commands are delivered to the database or other data source, and the
results of those statements are sent back to the user. The data source may be located on
another machine to which the user is connected via a network. This is referred to as a
client/server configuration, with the user's machine as the client, and the machine housing the
data source as the server. The network can be an intranet, which, for example, connects
employees within a corporation, or it can be the Internet.
In the three-tier model, commands are sent to a "middle tier" of services, which then
sends the commands to the data source. The data source processes the commands and sends
the results back to the middle tier, which then sends them to the user.
MIS directors find the three-tier model very attractive because the middle tier makes
it possible to maintain control over access and the kinds of updates that can be made to
corporate data. Another advantage is that it simplifies the deployment of applications.
Finally, in many cases, the three-tier architecture can provide performance advantages.
Until recently, the middle tier has often been written in languages such as C or C++,
which offer fast performance. However, with the introduction of optimizing compilers that
translate Java byte code into efficient machine-specific code and technologies such as
Enterprise JavaBeans™, the Java platform is fast becoming the standard platform for middle-
tier development. This is a big plus, making it possible to take advantage of Java's robustness,
multithreading, and security features.
With enterprises increasingly using the Java programming language for writing server
code, the JDBC API is being used more and more in the middle tier of a three-tier
architecture. Some of the features that make JDBC a server technology are its support for
connection pooling, distributed transactions, and disconnected rowsets. The JDBC API is also
what allows access to a data source from a Java middle tier.
Testing
White-box testing (also known as clear box testing, glass box testing, transparent
box testing, and structural testing) is a method of testing software that tests internal
structures or workings of an application, as opposed to its functionality (i.e. black-box
testing). In white-box testing an internal perspective of the system, as well as programming
skills, are used to design test cases. The tester chooses inputs to exercise paths through the
code and determine the appropriate outputs. This is analogous to testing nodes in a circuit,
e.g. in-circuit testing (ICT).
While white-box testing can be applied at the unit, integration and system levels of
the software testing process, it is usually done at the unit level. It can test paths within a unit,
paths between units during integration, and between subsystems during a system–level test.
Though this method of test design can uncover many errors or problems, it might not detect
unimplemented parts of the specification or missing requirements.
● Branch testing
● Path testing
● Statement coverage
● Decision coverage
White-box testing is a method of testing the application at the level of the source code.
The test cases are derived through the use of the design techniques mentioned above: control
flow testing, data flow testing, branch testing, path testing, statement coverage and decision
coverage as well as modified condition/decision coverage. White-box testing is the use of
these techniques as guidelines to create an error free environment by examining any fragile
code.
These White-box testing techniques are the building blocks of white-box testing, whose
essence is the careful testing of the application at the source code level to prevent any hidden
errors later on. These different techniques exercise every visible path of the source code to
minimize errors and create an error-free environment. The whole point of white-box testing is
the ability to know which line of the code is being executed and being able to identify what
the correct output should be.
Levels
1. Unit testing. White-box testing is done during unit testing to ensure that the code is
working as intended, before any integration happens with previously tested code.
White-box testing during unit testing catches any defects early on and aids in any
defects that happen later on after the code is integrated with the rest of the application
and therefore prevents any type of errors later on.
2. Integration testing. White-box testing at this level are written to test the interactions
of each interface with each other. The Unit level testing made sure that each code was
tested and working accordingly in an isolated environment and integration examines
the correctness of the behaviour in an open environment through the use of white-box
testing for any interactions of interfaces that are known to the programmer.
3. Regression testing. White-box testing during regression testing is the use of recycled
white-box test cases at the unit and integration testing levels.
White-box testing's basic procedures involve the understanding of the source code that
you are testing at a deep level to be able to test them. The programmer must have a deep
understanding of the application to know what kinds of test cases to create so that every
visible path is exercised for testing. Once the source code is understood then the source code
can be analysed for test cases to be created. These are the three basic steps that white-box
testing takes in order to create test cases:
Test procedures
Test cases
Test cases are built around specifications and requirements, i.e., what the application
is supposed to do. Test cases are generally derived from external descriptions of the software,
including specifications, requirements and design parameters. Although the tests used are
primarily functional in nature, non-functional tests may also be used. The test designer selects
both valid and invalid inputs and determines the correct output without any knowledge of the
test object's internal structure.
● All-pairs testing
● Equivalence partitioning
Unit testing
In computer programming, unit testing is a method by which individual units
of source code, sets of one or more computer program modules together with associated
control data, usage procedures, and operating procedures are tested to determine if they are fit
for use. Intuitively, one can view a unit as the smallest testable part of an application.
In procedural programming, a unit could be an entire module, but is more commonly an
individual function or procedure. In object-oriented programming, a unit is often an entire
interface, such as a class, but could be an individual method. Unit tests are created by
programmers or occasionally by white box testers during the development process.
Ideally, each test case is independent from the others. Substitutes such as method
stubs, mock objects, fakes, and test harnesses can be used to assist testing a module in
isolation. Unit tests are typically written and run by software developers to ensure that code
meets its design and behaves as intended. Its implementation can vary from being very
manual (pencil and paper)to being formalized as part of build automation.
Testing will not catch every error in the program, since it cannot evaluate every
execution path in any but the most trivial programs. The same is true for unit testing.
Additionally, unit testing by definition only tests the functionality of the units themselves.
Therefore, it will not catch integration errors or broader system-level errors (such as functions
performed across multiple units, or non-functional test areas such as performance).
Unit testing should be done in conjunction with other software testing activities, as
they can only show the presence or absence of particular errors; they cannot prove a complete
absence of errors. In order to guarantee correct behaviour for every execution path and every
possible input, and ensure the absence of errors, other techniques are required, namely the
application of formal methods to proving that a software component has no unexpected
behaviour.
Software testing is a combinatorial problem. For example, every Boolean decision statement
requires at least two tests: one with an outcome of "true" and one with an outcome of "false".
As a result, for every line of code written, programmers often need 3 to 5 lines of test code.
This obviously takes time and its investment may not be worth the effort. There are
also many problems that cannot easily be tested at all – for example those that
are nondeterministic or involve multiple threads. In addition, code for a unit test is likely to
be at least as buggy as the code it is testing. Fred Brooks in The Mythical Man-
Month quotes: never take two chronometers to sea. Always take one or three. Meaning, if
two chronometers contradict, how do you know which one is correct?
Another challenge related to writing the unit tests is the difficulty of setting up
realistic and useful tests. It is necessary to create relevant initial conditions so the part of the
application being tested behaves like part of the complete system. If these initial conditions
are not set correctly, the test will not be exercising the code in a realistic context, which
diminishes the value and accuracy of unit test results.
To obtain the intended benefits from unit testing, rigorous discipline is needed
throughout the software development process. It is essential to keep careful records not only
of the tests that have been performed, but also of all changes that have been made to the
source code of this or any other unit in the software. Use of a version control system is
essential. If a later version of the unit fails a particular test that it had previously passed, the
version-control software can provide a list of the source code changes (if any) that have been
applied to the unit since that time.
It is also essential to implement a sustainable process for ensuring that test case
failures are reviewed daily and addressed immediately if such a process is not implemented
and ingrained into the team's workflow, the application will evolve out of sync with the unit
test suite, increasing false positives and reducing the effectiveness of the test suite.
Unit testing embedded system software presents a unique challenge: Since the
software is being developed on a different platform than the one it will eventually run on, you
cannot readily run a test program in the actual deployment environment, as is possible with
desktop programs.[7]
Functional testing
Functional testing is a quality assurance (QA) process and a type of black box
testing that bases its test cases on the specifications of the software component under test.
Functions are tested by feeding them input and examining the output, and internal program
structure is rarely considered (not like in white-box testing). Functional Testing usually
describes what the system does.
Functional testing differs from system testing in that functional testing "verifies a program by
checking it against ... design document(s) or specification(s)", while system testing
"validate a program by checking it against the published user or system requirements" (Kane,
Falk, Nguyen 1999, p. 52).
Functional testing typically involves five steps .The identification of functions that the
software is expected to perform
Performance testing
Testing types
Load testing
Load testing is the simplest form of performance testing. A load test is usually
conducted to understand the behaviour of the system under a specific expected load. This
load can be the expected concurrent number of users on the application performing a specific
number of transactions within the set duration. This test will give out the response times of all
the important business critical transactions. If the database, application server, etc. are also
monitored, then this simple test can itself point towards bottlenecks in the application
software.
Stress testing
Stress testing is normally used to understand the upper limits of capacity within the
system. This kind of test is done to determine the system's robustness in terms of extreme
load and helps application administrators to determine if the system will perform sufficiently
if the current load goes well above the expected maximum.
Soak testing
Soak testing, also known as endurance testing, is usually done to determine if the
system can sustain the continuous expected load. During soak tests, memory utilization is
monitored to detect potential leaks. Also important, but often overlooked is performance
degradation. That is, to ensure that the throughput and/or response times after some long
period of sustained activity are as good as or better than at the beginning of the test. It
essentially involves applying a significant load to a system for an extended, significant period
of time. The goal is to discover how the system behaves under sustained use.
Spike testing
Spike testing is done by suddenly increasing the number of or load generated by,
users by a very large amount and observing the behaviour of the system. The goal is to
determine whether performance will suffer, the system will fail, or it will be able to handle
dramatic changes in load.
Configuration testing
Rather than testing for performance from the perspective of load, tests are created to
determine the effects of configuration changes to the system's components on the system's
performance and behaviour. A common example would be experimenting with different
methods of load-balancing.
Isolation testing
Isolation testing is not unique to performance testing but involves repeating a test
execution that resulted in a system problem. Often used to isolate and confirm the fault
domain.
Integration testing
Integration testing (sometimes called integration and testing, abbreviated I&T) is
the phase in software testing in which individual software modules are combined and tested
as a group. It occurs after unit testing and before validation testing. Integration testing takes
as its input modules that have been unit tested, groups them in larger aggregates, applies tests
defined in an integration test plan to those aggregates, and delivers as its output the integrated
system ready for system testing.
Purpose
Test cases are constructed to test whether all the components within assemblages
interact correctly, for example across procedure calls or process activations, and this is done
after testing individual modules, i.e. unit testing. The overall idea is a "building block"
approach, in which verified assemblages are added to a verified base which is then used to
support the integration testing of further assemblages.
Some different types of integration testing are big bang, top-down, and bottom-up.
Other Integration Patterns are: Collaboration Integration, Backbone Integration, Layer
Integration, Client/Server Integration, Distributed Services Integration and High-frequency
Integration.
Big Bang
In this approach, all or most of the developed modules are coupled together to form a
complete software system or major part of the system and then used for integration testing.
The Big Bang method is very effective for saving time in the integration testing process.
However, if the test cases and their results are not recorded properly, the entire integration
process will be more complicated and may prevent the testing team from achieving the goal
of integration testing.
A type of Big Bang Integration testing is called Usage Model testing. Usage Model
Testing can be used in both software and hardware integration testing. The basis behind this
type of integration testing is to run user-like workloads in integrated user-like environments.
In doing the testing in this manner, the environment is proofed, while the individual
components are proofed indirectly through their use.
For integration testing, Usage Model testing can be more efficient and provides better
test coverage than traditional focused functional integration testing. To be more efficient and
accurate, care must be used in defining the user-like workloads for creating realistic scenarios
in exercising the environment. This gives confidence that the integrated environment will
work as expected for the target customers.
All the bottom or low-level modules, procedures or functions are integrated and then
tested. After the integration testing of lower level integrated modules, the next level of
modules will be formed and can be used for integration testing. This approach is helpful only
when all or most of the modules of the same development level are ready. This method also
helps to determine the levels of software developed and makes it easier to report testing
progress in the form of a percentage.
Top Down Testing is an approach to integrated testing where the top integrated
modules are tested and the branch of the module is tested step by step until the end of the
related module.
The main advantage of the Bottom-Up approach is that bugs are more easily found. With
Top-Down, it is easier to find a missing branch link
It is sometimes said that validation can be expressed by the query "Are you building
the right thing?" and verification by "Are you building it right?"In practice, the usage of these
terms varies. Sometimes they are even used interchangeably.
The PMBOK guide, an IEEE standard, defines them as follows in its 4th edition
● "Validation. The assurance that a product, service, or system meets the needs of the
customer and other identified stakeholders. It often involves acceptance and suitability
with external customers. Contrast with verification."
● Verification is intended to check that a product, service, or system (or portion thereof,
or set thereof) meets a set of initial design specifications. In the development phase,
verification procedures involve performing special tests to model or simulate a
portion, or the entirety, of a product, service or system, then performing a review or
analysis of the modelling results. In the post-development phase, verification
procedures involve regularly repeating tests devised specifically to ensure that the
product, service, or system continues to meet the initial design requirements,
specifications, and regulations as time progresses. It is a process that is used to
evaluate whether a product, service, or system complies with
regulations, specifications, or conditions imposed at the start of a development phase.
Verification can be in development, scale-up, or production. This is often an internal
process.
● It is sometimes said that validation can be expressed by the query "Are you building
the right thing?" and verification by "Are you building it right?". "Building the right
thing" refers back to the user's needs, while "building it right" checks that the
specifications are correctly implemented by the system. In some contexts, it is
required to have written requirements for both as well as formal procedures or
protocols for determining compliance.
● It is entirely possible that a product passes when verified but fails when validated.
This can happen when, say, a product is built as per the specifications but the
specifications themselves fail to address the user’s needs.
Activities
Torres and Hyman have discussed the suitability of non-genuine parts for clinical use
and provided guidelines for equipment users to select appropriate substitutes which are
capable to avoid adverse effects. In the case when genuine parts/devices/software are
demanded by some of regulatory requirements, then re-qualification does not need to be
conducted on the non-genuine assemblies. Instead, the asset has to be recycled for non-
regulatory purposes.
System testing
As a rule, system testing takes, as its input, all of the "integrated" software
components that have passed integration testing and also the software system itself integrated
with any applicable hardware system(s). The purpose of integration testing is to detect any
inconsistencies between the software units that are integrated together (called assemblages)
or between any of the assemblages and the hardware. System testing is a more limited type of
testing; it seeks to detect defects both within the "inter-assemblages" and also within the
system as a whole.
The following examples are different types of testing that should be considered during
System testing:
● Usability testing
● Compatibility testing
● Exception handling
● Load testing
● Volume testing
● Stress testing
● Security testing
● Scalability testing
● Sanity testing
● Smoke testing
● Exploratory testing
● Ad hoc testing
● Regression testing
● Installation testing
● Web Accessibility Initiative (WAI) of the World Wide Web Consortium (W3C)
Although different testing organizations may prescribe different tests as part of System
testing, this list serves as a general framework or foundation to begin with.
Structure Testing:
● Output of test cases compared with the expected results created during design of test
cases.
● Asking the user about the format required by them tests the output generated or
● Here, the output format is considered into two was, one is on screen and another one
is printed format.
● The output on the screen is found to be correct as the format was designed in the
● The output comes out as the specified requirements as the user’s hard copy.
● Final Stage, before handling over to the customer which is usually carried out by the
customer where the test cases are executed with actual data.
● The system under consideration is tested for user acceptance and constantly keeping
touch with the prospective system user at the time of developing and making changes
whenever required.
● It involves planning and execution of various types of test in order to demonstrate that
the implemented software system satisfies the requirements stated in the requirement
document.
Two set of acceptance test to be run:
Coding:
Database
/*
*********************************************************************
*/
SET NAMES utf8;
SET SQL_MODE='';
USE `erasurecode`;
SET@OLD_SQL_MODE=@@SQL_MODE,
SQL_MODE='NO_AUTO_VALUE_ON_ZERO';
SET SQL_MODE=@OLD_SQL_MODE;
*/
package com.ErasureCode;
import java.io.IOException;
import java.io.PrintWriter;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
/**
* @author Admin
*/
/**
* methods.
*
*/
response.setContentType("text/html;charset=UTF-8");
/* TODO output your page here. You may use following sample code. */
out.println("<!DOCTYPE html>");
out.println("<html>");
out.println("<head>");
out.println("<title>Servlet AdminServlet</title>");
out.println("</head>");
out.println("<body>");
out.println("</body>");
out.println("</html>");
}
/**
*/
@Override
processRequest(request, response);
}
/**
*/
@Override
HttpSession session1=request.getSession();
Connection con=null;
Statement st=null;
ResultSet rs=null;
String Username=request.getParameter("username");
String Password=request.getParameter("password");
Class.forName("com.mysql.jdbc.Driver");
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/
imageselectionerasurecode","root","password");
st=con.createStatement();
if(rs.next())
response.sendRedirect("UserReg.jsp");
else
{
// out.print("Sorry UserName or Password Error!");
RequestDispatcher rd=request.getRequestDispatcher("Admin1.jsp");
rd.include(request, response);
catch(Exception ex)
ex.printStackTrace();
Screenshot:
Conclusion:
Erasure codes are promising for improving the reliability of the storage system due to
its space efficiency compared to the replication methods. Traditional erasure codes split data
into equalsized data blocks and encode strips in different data blocks. This brings heavy
repairing traffic when clients read parts of the data, since most strips read for repairing are
not in the expected blocks. This paper proposes a novel discrete data dividing method to
completely avoid this problem. The key idea is to encode strips from the same data block. We
could see that for repairing failed blocks, the strips to be read are either in the same data
block with corrupted strips or from the encoded strips. Therefore, no data is wasted. We
design and implement this data layout into a HDFS-like storage system. Experiments over a
small-scale testbed shows that the proposed discrete data divided method avoids downloading
data blocks that are not needed for clients during the repairing operations.
REFERENCES
[1] James S. Plank, Erasure Codes for Storage Systems A Brief
Primer, USENIX .login, Vol. 38 No. 6, 2013.
[2] Hsing-bung Chen, Ben McClelland, et al., An Innovative
Parallel Cloud Storage System using OpenStack’s Swift Object
Store and Transformative Parallel I/O Approach, Los Alamos
National Lab Science Highlights, 2013.
[3] Corentin Debains, Gael Alloyer, Evaluzation, Evaluation of
Erasure-coding libraries on Parallel Systems, 2010.
[4] Peter Sobe, Parallel Reed/Solomon Coding on Multicore
Processors, in Proceedings of International Workshop on
Storage Network Architecture and parallel I/O, 2010.
[5] Babak Behzad, Improving parallel I/O auto tuning with
performance modeling, in Proceedings of ACM International
Symposium on High-performance Parallel and Distributed
Computing (HPDC), 2014.
[6] Hsing-bung Chen, parEC – A Parallel and Scalable of erasure
coding support in Cloud Object Storage Systems, Los Alamos
National Lab.
[7] A. Varbanescu , On the Effective Parallel Programming of
Multi-core Processors, Ph.D Thesis, Technische Universiteit
Delft , 2010.
[8] William Gropp Ewing Lusk, Anthony Skjellum, Using MPI:
Portable Parallel Programming with the Message-Passing
Interface, The MIT Press, 2014.
[9] Hsing-bung Chen, Parallel Workload Benchmark on Hybrid
Storage EcoSystem, Los Alamos national Lab.