Share PDF

Search documents:
  Report this document  
    Download as PDF   
      Share on Facebook

1. INTRODUCTION

Anonymizing networks such as Tor route traffic through independent nodes in separate administrative domains to hide a client’s IP address. Unfortunately, some users have misused such networks—under the cover of anonymity, users have repeatedly defaced popular Web sites such as Wikipedia. Since Web site administrators cannot blacklist individual malicious users’ IP addresses, they blacklist the entire anonymizing network. Such measures eliminate malicious activity through anonymizing networks at the cost of denying anonymous access to behaving users. In other words, a few “bad apples” can spoil the fun for all.(This has happened repeatedly with Tor)

There are several solutions to this problem, each providing some degree of accountability. In pseudonymous credential systems users log into Websites using pseudonyms, which can be added to a blacklist if a user misbehaves. Unfortunately, this approach results in pseudonymity for all users, and weakens the anonymity provided by the anonymizing network.

Anonymous credential systems employ group signatures. Basic group signatures allow servers to revoke a misbehaving user’s anonymity by complaining to a group manager. Servers must query the group manager for every authentication, and thus, lacks scalability. Traceable signatures allow the group manager to release a trapdoor that allows all signatures generated by a particular user to be traced; such an approach does not provide the backward unlinkability that we desire, where a user’s accesses before the complaint remain anonymous. Backward unlinkability allows for what we call subjective blacklisting, where servers can blacklist users for whatever reason since the privacy of the blacklisted user is not at risk. In contrast, approaches without backward unlinkability need to pay careful attention to when and why a user must have all their connections linked, and users must worry about whether their behaviors will be judged fairly.

Subjective blacklisting is also better suited to servers such as Wikipedia, where misbehaviors such as questionable edits to a Webpage, are hard to define in mathematical terms. In some systems, misbehavior can indeed be defined precisely. For instance, double spending of an “e-coin” is considered a misbehavior in anonymous e-cash systems following which the offending user is deanonymized. Unfortunately, such systems work for only narrow definitions of misbehavior—it is difficult to map more complex notions of misbehavior onto “double spending” or related approaches.

With dynamic accumulators a revocation operation results in a new accumulator and public parameters for the group, and all other existing users’ credentials must be updated, making it impractical. Verifier-local revocation (VLR) fixes this shortcoming by

requiring the server (“verifier”) to perform only local updates during revocation. Unfortunately, VLR requires heavy computation at the server that is linear in the size of the blacklist. For example, for a blacklist with 1,000 entries, each authentication would take tens of seconds a prohibitive cost in practice. In contrast, our scheme takes the server about one millisecond per authentication, which is several thousand times faster than VLR. We believe these low overheads will incentivize servers to adoptsuch a solution when weighed against the potential benefits of anonymous publishing (e.g., whistle- blowing, reporting, anonymous tip lines, activism, and so on.).

2. AIM AND SCOPE OF THE PRESENT INVESTIGATION

2.1 EXISTING SYSTEM

Existing users’ credentials must be updated, making it impractical. Verifier-local revocation (VLR) fixes this shortcoming by requiring the server (“verifier”) to perform only local updates during revocation. Unfortunately, VLR requires heavy computation at the server that is linear in the size of the blacklist.

2.1.1Limitations

ÿPermanent blocking of misbehaviors IP Address.

ÿMisbehavior cannot check whether his IP Address is blocked (or) not.

ÿAdministrator is responsible for managing the clients. That is if any client makes mistake then entire administration will be blocked.

2.2PROPOSED SYSTEM

We present a secure system called Nymble, which provides all the following properties: anonymous authentication, backward unlinkability, subjective blacklisting, fast authentication speeds, rate-limited anonymous connections, revocation auditability (where users can verify whether they have been blacklisted), and also addresses the Sybil attack to make its deployment practical In Nymble, users acquire an ordered collection of nymbles, a special type of pseudonym, to connect to websites. Without additional information, these nymbles are computationally hard to link,and hence using the stream of nymbles simulates anonymous access to services.

Websites, however, can blacklist users by obtaining a seed for a particular nymble, allowing them to link future nymbles from the same user — those used before the complaint remain unlinkable. Servers can therefore blacklist anonymous users without knowledge of their IP addresses while allowing behaving users to connect anonymously. Our system ensures that users are aware of their blacklist status before they present a nimble, and disconnect immediately if they are blacklisted. Although our work applies to anonymizing networks in general, we consider Tor for purposes of exposition. In fact, any number of anonymizing networks can rely on the same Nymble system, blacklisting anonymous users regardless of their anonymizing network(s) of choice.

Fig 2.1 : System Architecture of Nymble

•Blacklisting anonymous users. We provide a means by which servers can blacklist users of an anonymizing network while maintaining their privacy.

•Practical performance. Our protocol makes use of inexpensive symmetric cryptographic operations to significantly outperform the alternatives.

•Open-source implementation. With the goal of contributing a workable system, we have built an opensource implementation of Nymble, which is publicly available. We provide performance statistics to show that our system is indeed practical.

2.3MODULES

2.3.1.Nymble Manager

Servers can therefore blacklist anonymous users without knowledge of their IP addresses while allowing behaving users to connect anonymously. Our system ensures that users are aware of their blacklist status before they present a nymble, and disconnect immediately if they are blacklisted. Although our work applies to anonymizing networks in general, we consider Tor for purposes of exposition. In fact, any number of anonymizing networks can rely on the same Nymble system, blacklisting anonymous users regardless of their anonymizing network(s) of choice.

2.3.2. Pseudonym Manager

The user must first contact the Pseudonym Manager (PM) and demonstrate control over a resource; for IP-address blocking, the user must connect to the PM

directly (i.e., not through a known anonymizing network), ensuring that the same pseudonym is always issued for the same resource.

2.3.3. Blacklisting a user

Users who make use of anonymizing networks expect their connections to be anonymous. If a server obtains a seed for that user, however, it can link that user’s subsequent connections. It is of utmost importance, then,that users be notified of their blacklist status before they present a nymble ticket to a server. In our system, the user can download the server’s blacklist and verify her status. If blacklisted, the user disconnects immediately.

IP-address blocking employed by Internet services. There are, however, some inherent limitations to using IP addresses as the scarce resource. If a user can obtain multiple addresses she can circumvent both nymble-based and regular IP- address blocking. Subnet-based blocking alleviates this problem, and while it is possible to modify our system to support subnet-based blocking, new privacy challenges emerge; a more thorough description is left for future work.

2.3.4. Nymble-authenticated connection

Blacklistability assures that any honest server can indeed block misbehaving users. Specifically, if an honest server complains about a user that misbehaved in the current linkability window, the complaint will be successful and the user will not be able to “nymble-connect,” i.e., establish a Nymble- authenticated connection, to the server successfully in subsequent time periods (following the time of complaint) of that linkability window.

Rate-limiting assures any honest server that no user can successfully nymble-connect to it more than once within any single time period. Non- frameability guarantees that any honest user who is legitimate according to an honest server can nymble-connect to that server. This prevents an attacker from framing a legitimate honest user, e.g., by getting the user blacklisted for someone else’s misbehavior. This property assumes each user has a single unique identity.

When IP addresses are used as the identity, it is possible for a user to “frame” an honest user who later obtains the same IP address. Non-frameability holds true only against attackers with different identities (IP addresses).

A user is legitimate according to a server if she has not been blacklisted by the server, and has not exceeded the rate limit of establishing Nymble-connections. Honest servers must be able to differentiate between legitimate and illegitimate users.

Anonymity protects the anonymity of honest users, regardless of their legitimacy according to the (possibly corrupt) server; the server cannot learn any more information beyond whether the user behind (an attempt to make) a nymble- connection is legitimate or illegitimate.

3. SYSTEM REQUIREMENTS SPECIFICATION

3.1 SOFTWARE REQUIREMENTS:

Operating System

:

Windows XP/7

Tool

:

Eclipse 3.3

Server

:

apache-tomcat6.0.18 (Web Server)

Design

:

Star UML

Front End

:

Jdk1.7, RMI.

Back End

:

Ms-Access

3.2 HARDWARE REQUIREMENTS:

Hard Disk

:

40GB

RAM

:

256MB

Processor

:

Pentium IV 2.4 GHz

3.3 FEASIBITY STUDY

The feasibility of the project is analyzed in this phase and business proposal is put forth with a very general plan for the project and some cost estimates. During system analysis the feasibility study of the proposed system is to be carried out. This is to ensure that the proposed system is not a burden to the company. For feasibility analysis, some understanding of the major requirements for the system is essential.

Three key considerations involved in the feasibility analysis are

ÿTECHNICAL FEASIBILITY

ÿSOCIAL FEASIBILITY

ÿECONOMICAL FEASIBILITY

3.3.1TECHNICAL FEASIBILITY:

This study is carried out to check the technical feasibility, that is, the technical requirements of the system. Any system developed must not have a high demand on the available technical resources. This will lead to high demands on the available technical resources. This will lead to high demands being placed on the client. The developed system must have a modest requirement, as only minimal or null changes are required for implementing this system.

3.3.2 SOCIAL FEASIBILITY:

The aspect of study is to check the level of acceptance of the system by the user. This includes the process of training the user to use the system efficiently. The user must not feel threatened by the system, instead must accept it as a necessity. The level of acceptance by the users solely depends on the methods that are employed to educate the user about the system and to make him familiar with it. His level of confidence must be raised so that he is also able to make some constructive criticism, which is welcomed, as he is the final user of the system.

3.3.3 ECONOMIC FEASIBILITY:

This study is carried out to check the economic impact that the system will have on the organization. The amount of fund that the company can pour into the research and development of the system is limited. The expenditures must be justified. Thus the developed system as well within the budget and this was achieved because most of the technologies used are freely available. Only the customized products had to be purchased.

4. SYSTEM DESIGN

4.1 DEFINITION:

The process

of

applying various techniques and principles for the purpose

of designing a device, a

process or a system in sufficient detail to Permit

its physical

realization.

 

 

 

 

 

 

 

Designer’s goal

is

to produce a model or representation

of an

Entity that

will later be built. The process by which the model is developed

combines intuiting

and judgment based

on

experience

building

similar entities, A

set of criteria that

enables quantity to

be

judged and a

process

of iteration that leads to final design

representation.

 

 

 

 

 

 

 

4.2 DESIGN PRINCIPLES:

Basic design principles enable the software engineer to navigate the design process. The following principles have to be followed in designing of project.

ÿThe design should be traceable to the analysis mode.

ÿThe design should not reinvent the wheel or the cycle.

ÿThe design should exhibit uniformity and integration.

ÿThe design should be assessed for quality as it is being created.

ÿThe design is not coding.

ÿThe design should be reviewed to minimize conceptual errors

4.3UML DIAGRAMS:

4.3.1USE CASE DIAGRAM:

A use case diagram is a graph of actors, a set of use cases enclosed by a system boundary, communication (participation) associations between the actors and users and generalization among use cases. The use case model defines the outside (actors) and inside (use case) of the system’s behavior.

Fig 4.1: Usecase Diagram for Nymble

4.3.2CLASS DIAGRAM:

UML Class diagram shows the static structure of the model. The class diagram is a collection of static modeling elements, such as classes and their relationships, connected as a graph to each other and to their contents.

Fig 4.2: Class Diagram for Nymble

4.3.3 SEQUENCE DIAGRAM:

Sequence diagram are an easy and intuitive way of describing the behavior Of a system by viewing the interaction between the system and its environment. A Sequence diagram shows an interaction arranged in a time sequence. A sequence diagram has two dimensions: vertical dimension represents time; the horizontal Dimension represents different objects. The vertical line is called is the object’s life line. The lifeline represents the object’s existence during the interaction.

Client

Cloud Server

DataBase

connected validation

user name,password

valid user file requested

file shown exit

invoke connection established

to verify verified valid/invalid user

checked original/fake

Fig 4.3.Sequence Diagram for Nymble

4.3.4 ACTIVITY DIAGRAM:

The purpose of activity diagram is to provide a view of flows and what is going on inside a use case or among several classes. Activity diagram can also be used to represent a class’s method implementation. A token represents an operation. An activity is shown as a round box containing the name of the operation. An outgoing solid arrow attached to the end of activity symbol indicates a transition triggered by the completion.

Fig 4.4: Activity Diagram for Nymble

4.3.5 DATA FLOW DIAGRAM:

The DFD is also called as bubble chart. It is a simple graphical formalism that can be used to represent a system in terms of the input data to the system, various processing carried out on these data, and the output data is generated by the system.

USER

EXISTING

USER

ENTER

USERNAME &

PWD

NO

IS VALID

YES

CONNECT WITH THE

SERVER

NON-EXISTING

USER

REGISTER WITH THE

SERVER

Fig 4.6: Client Data Flow Diagram for Nymble

5. SYSTEM IMPLEMENTATION

5.1 TECHNOLOGY DESCRIPTION

General

A programming tool or software tool is a program or application that software developers use to create, debug, maintain, or otherwise support other programs and applications. The term usually refers to relatively simple programs that can be combined together to accomplish a task. The Chapter describes about the software tool that is used in our project.

Java Technology

Java technology is both a programming language and a platform.

The Java Programming Language

The Java programming language is a high-level language that can be characterized by all of the following buzzwords:

ÿSimple

ÿArchitecture neutral

ÿObject oriented

ÿPortable

ÿDistributed

ÿHigh performance

ÿInterpreted

ÿMultithreaded

ÿRobust

ÿDynamic

ÿSecure

With most programming languages, you either compile or interpret a program so that you can run it on your computer. The Java programming language is unusual in that a program is both compiled and interpreted. With the compiler, first you translate a program into an intermediate language called Java byte codes —the platform-independent codes interpreted by the interpreter on the Java platform. The interpreter parses and runs each

Java byte code instruction on the computer. Compilation happens just once; interpretation occurs each time the program is executed. The following figure illustrates how this works.

Fig 5.1: Execution of java program

You can think of Java byte codes as the machine code instructions for the Java Virtual Machine (Java VM). Every Java interpreter, whether it’s a development tool or a Web browser that can run applets, is an implementation of the Java VM. Java byte codes help make “write once, run anywhere” possible. You can compile your program into byte codes on any platform that has a Java compiler. The byte codes can then be run on any implementation of the Java VM. That means that as long as a computer has a Java VM, the same program written in the Java programming language can run on Windows 2000, a Solaris workstation, or on an iMac. Algorithm. NMVerifyPseudonym

Input: ðpnym;wÞ 2 P NN

Persistent state: nmState 2 SN

Output: b 2 ftrue; falseg

1:Extract macKeyNP from nmState

2:ðnym; macÞ :¼ pnym 3: return mac ¼ ? MA:Macðnymkw;macKeyNP Þ

Fig 5.2: Compilation of java program

The Java Platform

A platform is the hardware or software environment in which a program runs.We’ve already mentioned some of the most popular platforms like Windows 2000, Linux, Solaris, and MacOS. Most platforms can be described as a combination of the operating system and hardware. The Java platform differs from most other platforms in that it’s a software-only platform that runs on top of other hardware-based platforms.

The Java platform has two components:

ÿThe Java Virtual Machine (Java VM)

ÿThe Java Application Programming Interface (Java API)

You’ve already been introduced to the Java VM. It’s the base for the Java platform and is ported onto various hardware-based platforms.

The Java API is a large collection of ready-made software components that provide many useful capabilities, such as graphical user interface (GUI) widgets. The Java API is grouped into libraries of related classes and interfaces; these libraries are known as packages.The next section, What Can Java Technology Do? Highlights what functionality some of the packages in the Java API provide. The following figure depicts a program that’s running on the Java platform. As the figure shows, the Java API and the virtual machine insulate the program from hardware.

Fig 5.3: java platform

Native code is code that after you compile it, the compiled code runs on a specific hardware platform. As a platform-independent environment, the Java platform can be a bit slower than native code. However, smart compilers, well-tuned interpreters, and just-in- time byte code compilers can bring performance close to that of native code without threatening portability.

What Can Java Technology Do?

The most common types of programs written in the Java programming language are applets and applications. If you’ve surfed the Web, you’re probably already familiar with applets. An applet is a program that adheres to certain conventions that allow it to run within a Java-enabled browser.

However, the Java programming language is not just for writing cute, entertaining applets for the Web. The general-purpose, high-level Java programming language is also a powerful software platform. Using the generous API, you can write many types of programs. An application is a standalone program that runs directly on the Java platform. A special kind of application known as a server serves and supports clients on a network. Examples of servers are Web servers, proxy servers, mail servers, and print servers. Another specialized program is a servlet. A servlet can almost be thought of as an applet that runs on the server side. Java Servlets are a popular choice for building interactive web applications, replacing the use of CGI scripts. Servlets are similar to applets in that they are runtime extensions of applications. Instead of working in browsers, though, servlets run within Java Web servers, configuring or tailoring the server.

How does the API support all these kinds of programs? It does so with packages of software components that provides a wide range of functionality. Every full implementation of the Java platform gives you the following features:

ÿThe essentials: Objects, strings, threads, numbers, input and output, data structures, system properties, date and time, and so on.

ÿApplets: The set of conventions used by applets.

ÿNetworking: URLs, TCP (Transmission Control Protocol), UDP (User Data gram Protocol) sockets, and IP (Internet Protocol) addresses.

ÿInternationalization: Help for writing programs that can be localized for users worldwide. Programs can automatically adapt to specific locales and be displayed in the appropriate language.

ÿSecurity: Both low level and high level, including electronic signatures, public and private key management, access control, and certificates.

ÿSoftware components: Known as JavaBeansTM, can plug into existing component architectures.

ÿObject serialization: Allows lightweight persistence and communication via Remote Method Invocation (RMI).

ÿJava Database Connectivity (JDBCTM): Provides uniform access to a wide range of relational databases.

The Java platform also has APIs for 2D and 3D graphics, accessibility, servers, collaboration, telephony, speech, animation, and more. The following figure depicts what is included in the Java 2 SDK.

Fig 5.4: java IDE

How Will Java Technology Change My Life?

We can’t promise you fame, fortune, or even a job if you learn the Java programming language. Still, it is likely to make your programs better and requires less effort than other languages. We believe that Java technology will help you do the following:

ÿGet started quickly: Although the Java programming language is a powerful object-oriented language, it’s easy to learn, especially for programmers already familiar with C or C++.

ÿWrite less code: Comparisons of program metrics (class counts, method counts, and so on) suggest that a program written in the Java programming language can be four times smaller than the same program in C++.

ÿWrite better code: The Java programming language encourages good coding practices, and its garbage collection helps you avoid memory leaks. Its object orientation, its JavaBeans component architecture, and its wide-ranging, easily extendible API let you reuse other people’s tested code and introduce fewer bugs.

ÿDevelop programs more quickly: Your development time may be as much as twice as fast versus writing the same program in C++. Why? You write fewer lines of code and it is a simpler programming language than C++.

ÿAvoid platform dependencies with 100% Pure Java: You can keep your program portable by avoiding the use of libraries written in other languages. The 100% Pure JavaTM Product Certification Program has a repository of historical process manuals, white papers, brochures, and similar materials online.

ÿWrite once, run anywhere: Because 100% Pure Java programs are compiled into machine-independent byte codes, they run consistently on any Java platform.

ÿDistribute software more easily: You can upgrade applets easily from a central server. Applets take advantage of the feature of allowing new classes to be loaded “on the fly,” without recompiling the entire program.

ODBC

Microsoft Open Database Connectivity (ODBC) is a standard programming interface for application developers and database systems providers. Before ODBC became a de facto standard for Windows programs to interface with database systems, programmers had to use proprietary languages for each database they wanted to connect to. Now, ODBC has made the choice of the database system almost irrelevant from a coding perspective, which is as it should be. Application developers have much more important things to worry about than the syntax that is needed to port their program from one database to another when business needs suddenly change.

Through the ODBC Administrator in Control Panel, you can specify the particular database that is associated with a data source that an ODBC application program is written to use. Think of an ODBC data source as a door with a name on it. Each door will lead you to a particular database. For example, the data source named Sales Figures might be a

SQL Server database, whereas the Accounts Payable data source could refer to an Access database. The physical database referred to by a data source can reside anywhere on the LAN.

The ODBC system files are not installed on your system by Windows 95. Rather, they are installed when you setup a separate database application, such as SQL Server Client or Visual Basic 4.0. When the ODBC icon is installed in Control Panel, it uses a file called ODBCINST.DLL.

From a programming perspective, the beauty of ODBC is that the application can be written to use the same set of function calls to interface with any data source, regardless of the database vendor. The source code of the application doesn’t change whether it talks to Oracle or SQL Server. We only mention these two as an example. There are ODBC drivers available for several dozen popular database systems. Even Excel spreadsheets and plain text files can be turned into data sources. The operating system uses the Registry information written by ODBC Administrator to determine which low-level ODBC drivers are needed to talk to the data source (such as the interface to Oracle or SQL Server). The loading of the ODBC drivers is transparent to the ODBC application program. In a client/server environment, the ODBC API even handles many of the network issues for the application programmer.

The advantages of this scheme are so numerous that you are probably thinking there must be some catch. The only disadvantage of ODBC is that it isn’t as efficient as talking directly to the native database interface. ODBC has had many detractors make the charge that it is too slow. Microsoft has always claimed that the critical factor in performance is the quality of the driver software that is used. In our humble opinion, this is true. The availability of good ODBC drivers has improved a great deal recently. And anyway, the criticism about performance is somewhat analogous to those who said that compilers would never match the speed of pure assembly language. Maybe not, but the compiler (or ODBC) gives you the opportunity to write cleaner programs, which means you finish sooner. Meanwhile, computers get faster every year.

JDBC

In an effort to set an independent database standard API for Java; Sun Microsystems developed Java Database Connectivity, or JDBC. JDBC offers a generic SQL database access mechanism that provides a consistent interface to a variety of RDBMSs. This consistent interface is achieved through the use of “plug-in” database

connectivity modules, or drivers. If a database vendor wishes to have JDBC support, he or she must provide the driver for each platform that the database and Java run on.

To gain a wider acceptance of JDBC, Sun based JDBC’s framework on ODBC. As you discovered earlier in this chapter, ODBC has widespread support on a variety of platforms. Basing JDBC on ODBC will allow vendors to bring JDBC drivers to market much faster than developing a completely new connectivity solution.

JDBC was announced in March of 1996. It was released for a 90 day public review that ended June 8, 1996. Because of user input, the final JDBC v1.0 specification was released soon after.

The remainder of this section will cover enough information about JDBC for you to know what it is about and how to use it effectively. This is by no means a complete overview of JDBC. That would fill an entire book.

JDBC Goals

Few software packages are designed without goals in mind. JDBC is one that, because of its many goals, drove the development of the API. These goals, in conjunction with early reviewer feedback, have finalized the JDBC class library into a solid framework for building database applications in Java.

The goals that were set for JDBC are important. They will give you some insight as to why certain classes and functionalities behave the way they do. The eight design goals for JDBC are as follows:

1. SQL Level API

The designers felt that their main goal was to define a SQL interface for Java. Although not the lowest database interface level possible, it is at a low enough level for higher-level tools and APIs to be created. Conversely, it is at a high enough level for application programmers to use it confidently.Attaining this goal allows for future tool vendors to “generate” JDBC code and to hide many of JDBC’s complexities from the end user.

2.SQL Conformance

SQL syntax varies as you move from database vendor to database vendor. In an

effort to support a wide variety of vendors, JDBC will allow any query statement to be passed through it to the underlying database driver. This allows the connectivity module to handle non-standard functionality in a manner that is suitable for its users.

3. JDBC must be implemental on top of common database interfaces

The JDBC SQL API must “sit” on top of other common SQL level APIs. This goal allows JDBC to use existing ODBC level drivers by the use of a software interface. This interface would translate JDBC calls to ODBC and vice versa.

4.Provide a Java interface that is consistent with the rest of the Java system

Because of Java’s acceptance in the user community thus far, the designers feel

that they should not stray from the current design of the core Java system.

5.Keep it simple

This goal probably appears in all software design goal listings. JDBC is no

exception. Sun felt that the design of JDBC should be very simple, allowing for only one method of completing a task per mechanism. Allowing duplicate functionality only serves to confuse the users of the API.

6.Use strong, static typing wherever possible

Strong typing allows for more error checking to be done at compile time; also, less

error appear at runtime.

7.Keep the common cases simple

Because more often than not, the usual SQL calls used by the programmer are

simple SELECT’s, INSERT’s, DELETE’s and UPDATE’s, these queries should be simple to perform with JDBC. However, more complex SQL statements should also be possible.

Finally we decided to proceed the implementation using Java Networking.

And for dynamically updating the cache table we go for MS Access database.

Java has two things: a programming language and a platform.

Java is a high-level programming language that is all of the following

Simple

Architecture-neutral

Object-oriented

Portable

Distributed

High-performance

Interpreted

multithreaded

Robust

Dynamic

Secure

 

Java is also unusual in that each Java program is both compiled and interpreted. With a compile you translate a Java program into an intermediate language called Java byte codes the platform-independent code instruction is passed and run on the computer.

Compilation happens just once; interpretation occurs each time the program is executed. The figure illustrates how this works.

Java Program

Interpreter

Compilers

My Program

Fig 5.5: Compilation

You can think of Java byte codes as the machine code instructions for the Java Virtual Machine (Java VM). Every Java interpreter, whether it’s a Java development tool or a Web browser that can run Java applets, is an implementation of the Java VM. The Java VM can also be implemented in hardware.

Java byte codes help make “write once, run anywhere” possible. You can compile your Java program into byte codes on my platform that has a Java compiler. The byte codes can then be run any implementation of the Java VM. For example, the same Java program can run Windows NT, Solaris, and Macintosh.

5.2 SAMPLE CODE

import java.rmi.*; import java.rmi.server.*; import java.net.*; import java.io.*; import javax.swing.*; import java.awt.event.*; import java.lang.*; import java.awt.*;

import javax.swing.filechooser.FileSystemView; import java.util.StringTokenizer;

import java.net.InetAddress; import java.rmi.Naming; import java.util.Date; import java.util.Vector; import java.util.Random;

public class Login extends javax.swing.JFrame

{

RMISIntf ref;

JOptionPane op;

Vector v= new Vector(2);

String sss=null;

static String username;

/** Creates new form Login */

public Login()

{

initComponents();

}

private void initComponents()

{

jPan = new javax.swing.JPanel(); jLabel1 = new javax.swing.JLabel(); user = new javax.swing.JTextField(); jLabel2 = new javax.swing.JLabel(); submit = new javax.swing.JButton(); reset = new javax.swing.JButton(); exit = new javax.swing.JButton();

pass = new javax.swing.JPasswordField(); jLabel3 = new javax.swing.JLabel(); op=new JOptionPane(); getContentPane().setLayout(null); jPanel1 = new javax.swing.JPanel(); listres = new javax.swing.JList();

jLab = new javax.swing.JLabel(); download = new javax.swing.JButton(); resArea = new TextArea();

save = new javax.swing.JButton(); getContentPane().setLayout(null); getContentPane().setBackground(new Color(200,40,50)); addWindowListener(new java.awt.event.WindowAdapter()

{

public void windowClosing(java.awt.event.WindowEvent evt)

{

exitForm(evt);

}

});

jPan.setLayout(null);

jPan.setBackground(new java.awt.Color(200, 113, 181));

jPan.setBorder(new javax.swing.border.EtchedBorder());

jLab.setFont(new java.awt.Font("Arial", 0, 14));

jLab.setText("User ID:"); jPan.add(jLab); jLab.setBounds(40, 40, 90, 30); jPan.add(user); user.setBounds(140, 40, 100, 30);

jLabel2.setFont(new java.awt.Font("Arial", 0, 14)); jLabel2.setText("Password:");

jPan.add(jLabel2); jLabel2.setBounds(40, 90, 90, 30);

submit.setBackground(new java.awt.Color(204, 204, 255)); submit.setFont(new java.awt.Font("Arial", 0, 14)); ubmit.setForeground(new java.awt.Color(0, 0, 153)); submit.setText("Submit");

submit.addActionListener(new java.awt.event.ActionListener()

{

public void actionPerformed(java.awt.event.ActionEvent evt)

{

submitActionPerformed(evt);

}

});

jPan.add(submit); submit.setBounds(20, 150, 80, 27);

reset.setBackground(new java.awt.Color(204, 204, 255)); reset.setFont(new java.awt.Font("Arial", 0, 14)); reset.setForeground(new java.awt.Color(0, 0, 153)); reset.setLabel("Reset");

reset.addActionListener(new java.awt.event.ActionListener()

{

public void actionPerformed(java.awt.event.ActionEvent evt)

{

resetActionPerformed(evt);

}

});

jPan.add(reset); reset.setBounds(120, 150, 80, 27);

exit.setBackground(new java.awt.Color(204, 204, 255)); exit.setFont(new java.awt.Font("Arial", 0, 14)); exit.setForeground(new java.awt.Color(0, 0, 153)); exit.setLabel("Exit");

exit.addActionListener(new java.awt.event.ActionListener()

{

public void actionPerformed(java.awt.event.ActionEvent evt)

{

exitActionPerformed(evt);

}

});

jPan.add(exit); exit.setBounds(220, 150, 70, 27); jPan.add(pass); pass.setBounds(140, 91, 100, 30); getContentPane().add(jPan);

jPan.setBounds(250, 140, 320, 200); jLabel3.setFont(new java.awt.Font("Arial", 0, 24));

jLabel3.setForeground(new java.awt.Color(255, 255, 255));

jLabel3.setText("Nymble: Blocking Misbehaving Users in Anonymizing

Networks");

jLabel3.setFont(new java.awt.Font("Arial", 0, 18)); getContentPane().add(jLabel3); jLabel3.setBounds(100, 30, 570, 30);

pack();

jPanel1.setLayout(null);

jPanel1.setBorder(new javax.swing.border.EtchedBorder());

listres.setBorder(new

javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.LO

WERED));

jPanel1.add(listres); listres.setBounds(10, 60, 150, 220);

jLabel1.setFont(new java.awt.Font("Arial", 0, 15)); jLabel1.setText("Resources Available:"); jPanel1.add(jLabel1);

jLabel1.setBounds(10, 10, 180, 40); download.setBackground(new java.awt.Color(204, 204, 254)); download.setFont(new java.awt.Font("Arial", 0, 15)); download.setText("Access File..");

download.addActionListener(new java.awt.event.ActionListener()

{

public void actionPerformed(java.awt.event.ActionEvent evt)

{

downloadActionPerformed(evt);

}

});

jPanel1.add(download); download.setBounds(180, 60, 140, 27); getContentPane().add(jPanel1); jPanel1.setBounds(20, 70, 340, 300); getContentPane().add(resArea); resArea.setBounds(400, 90, 240, 250);

save.setBackground(new java.awt.Color(204, 204, 254)); save.setFont(new java.awt.Font("Arial", 0, 15)); save.setText("Save");

save.addActionListener(new java.awt.event.ActionListener()

{

public void actionPerformed(java.awt.event.ActionEvent evt)

{

saveActionPerformed(evt);

}

}); getContentPane().add(save);

save.setBounds(470, 370, 70, 27); resArea.setVisible(false); save.setVisible(false); jPanel1.setVisible(false);

jPanel1.setBackground(new java.awt.Color(0, 204, 204));

}

//GEN-END:initComponents

private void exitActionPerformed(java.awt.event.ActionEvent evt)

{

//GEN-FIRST:event_exitActionPerformed System.exit(0);

}

private void resetActionPerformed(java.awt.event.ActionEvent evt)

{

//GEN-FIRST:event_resetActionPerformed user.setText("");

pass.setText("");

}

private void submitActionPerformed(java.awt.event.ActionEvent evt)

{

try

{

ref= (RMISIntf)Naming.lookup("rmi://"+"192.168.1.55"+"/RMIServer"); //System.out.println(ref.res("sdsd","dsa")); if(user.getText().trim().equals(""))

{

op.showConfirmDialog(this,"Enter The User Name","Alert",JOptionPane.DEFAULT_OPTION,JOptionPane.ERROR_ MESSAGE);

user.grabFocus();

}

else

{

if(pass.getText().trim().equals(""))

{

op.showConfirmDialog(this,"Enter The PassWord","Alert",JOptionPane.DEFAULT_OPTION,JOptionPane.ERRO R_MESSAGE);

pass.grabFocus();

}

else

{

InetAddress Address = InetAddress.getLocalHost();

String c =Address.getHostAddress();

ref=(RMISIntf)Naming.lookup("rmi://"+"192.168.1.55"+"/RMIServer");

String ss=ref.CliDet(user.getText(),pass.getText(),c);

if(ss.equals("notok"))

{

op.showConfirmDialog(this,"UnAuthorised User","Alert",JOptionPane.DEFAULT_OPTION,JOptionPane.ERROR_M ESSAGE);

user.grabFocus();

}

else

{

username=user.getText();

String key=(String)JOptionPane.showInputDialog(this,"Enter your Key:");

ref=(RMISIntf)Naming.lookup("rmi://"+"192.168.1.55"+"/RMIServer");

String status=ref.CliDet_key(user.getText(),key);

if(status.equals("ok"))

{

username=user.getText(); //getContentPane().remove(jPan);//.visible(false); jPan.setVisible(false);

jPanel1.setVisible(true);

resArea.setVisible(true);

save.setVisible(true);

StringTokenizer token=new StringTokenizer(ss,";"); while(token.hasMoreTokens())

{

String nextToken = token.nextToken(); v.addElement(nextToken); System.out.println(nextToken);

}

listres.setListData(v); }///inner if

else

{

op.showConfirmDialog(this,"UnAuthorised User","Alert",JOptionPane.DEFAULT_OPTION,JOptionPane.ERROR_M ESSAGE);

user.grabFocus();

}

}

}

}

}

catch(Exception e){System.out.println(e);}

}

private void downloadActionPerformed(java.awt.event.ActionEvent evt)

{

sss=(String)listres.getSelectedValue();

System.out.println(sss); int ch=0;

try{

InetAddress Address = InetAddress.getLocalHost();

String c =Address.getHostAddress();

/////////////////////////////////////////////////////

String aa[]=new String[4];

ref= (RMISIntf)Naming.lookup("rmi://"+"192.168.1.55"+"/RMIServer");

/////////////////////////

String chh=ref.checkipp(c,sss);

StringTokenizer st=new StringTokenizer(chh,";");

String ipp=null;

String opp=null; //while(st.hasMoreTokens()) { ipp=st.nextToken(); System.out.println(ipp+"hai"); opp=st.nextToken(); System.out.println(opp);

//}

String optiontest="null"; if(ipp.equals("ok")||opp.equals("true"))

{

optiontest="true";

String a=(String)JOptionPane.showInputDialog(this,"Enter your

password:");

aa[0]=a;

a=(String)JOptionPane.showInputDialog(this,"Enter your correct

password:");

aa[1]=a;

a=(String)JOptionPane.showInputDialog(this,"Enter correct password:");

aa[2]=a;

System.out.println(aa[0]+aa[1]);

aa[3]=new Date().toString();

ref.store(aa,c,username,sss);

JOptionPane.showMessageDialog (null, "IP Blocked & you are Misbehaving User &you Can't Access Nymble web Page & Cant downlod the file", "you Can't Access Nymble web Page", JOptionPane.ERROR_MESSAGE);

}

/////////change

String ssss=ref.res(sss,c,optiontest);

/********File ss=ref.res(sss,c,);

//File file = new File(ss);

FileInputStream in = new FileInputStream(ss);

int i = in.available();

char st[]=new char[i];

int j =0;

while((ch=in.read())!=-1)

{

st[j] = (char) ch;

j++;

}

String str=new String(st);

resArea.setText(str);

***********/

System.out.println("new "+ssss);

resArea.setText(ssss);

Logged1 l1=new Logged1();

l1.show();

}

catch(Exception e)

{

System.out.println(e);

}

}

private void saveActionPerformed(java.awt.event.ActionEvent evt)

{

//GEN-FIRST:event_saveActionPerformed try {

FileDialog fd=new FileDialog(this,"File Store", FileDialog.SAVE); fd.setVisible(true);

String f= fd.getFile(); fd.setFile(f); // Filename filter

fd.setDirectory("."); // Current directory //fd.show();

FileOutputStream out=new FileOutputStream(f);

String s=resArea.getText();

System.out.println(s);

byte b[]=s.getBytes(); out.write(b);

} catch(Exception e)

{

System.out.println(e);

}

}

/** Exit the Application */

private void exitForm(java.awt.event.WindowEvent evt)

{

//GEN-FIRST:event_exitForm System.exit(0);

}

/**

* @param args the command line arguments

*/

public static void main(String args[]) {

JFrame jf1=new Login();

jf1.setResizable(false);

jf1.setSize(680,500);

jf1.setTitle("Nymble: User Login");

jf1.show();

}

//Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton exit;

private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel2; private javax.swing.JLabel jLabel3; private javax.swing.JPanel jPan;

private javax.swing.JPasswordField pass; private javax.swing.JButton reset; private javax.swing.JButton submit; private javax.swing.JTextField user; private javax.swing.JButton download; private javax.swing.JLabel jLab; private.javax.swing.JPanel jPanel1; private javax.swing.JList listres;

private java.awt.TextArea resArea; private javax.swing.JButton save;

//End of variables declaration//GEN-END:variables

}

import javax.swing.*;

import java.awt.*;

import java.awt.event.*;

import java.io.*;

import java.net.*;

import java.util.*;

import javax.swing.event.*; import java.sql.*;

class NymbleServer extends JFrame

{

JLabel jl1;

JLabel jl2;

JButton jb1;

JButton jb2;

JTextField jt1;

JPasswordField jt2;

String msg="";

Container c;

ImageIcon ii;

ImageIcon i2;

JLabel jl4;

JLabel jl6;

String str="";

String pass="";

String path="";

String coreaddr="";

String core="";

String nextcore="";

String dest="";

String dest1="";

File f;

File fgs;

Vector v = new Vector();

NymbleServer()

{

jl1=new JLabel("Nymble Server Name ");

jl2=new JLabel("Server Key "); jb1=new JButton("Send"); jb2=new JButton("Reset"); jt1=new JTextField(10); jt2=new JPasswordField(10);

ii=new ImageIcon("nymbleserver.png"); i2=new ImageIcon("nymbleserver1.PNG"); jl4=new JLabel(ii);

jl6=new JLabel(i2); c = getContentPane(); c.setLayout(null);

c.setBackground(new Color(0,0,120)); c.show();

c.add(jl1);

c.add(jt1);

c.add(jl2);

c.add(jb1);

c.add(jb2);

c.add(jl4);

c.add(jl6);

c.add(jt2);

addWindowListener(new java.awt.event.WindowAdapter() { public void windowClosing(java.awt.event.WindowEvent evt) { exitForm(evt);

}

});

jl4.setBounds(30,20,728,68);

jl1.setBounds(20,110,200,25);

jt1.setBounds(150,110,100,25);

jl2.setBounds(50,145,200,25);

jt2.setBounds(150,145,100,25);

jb1.setBounds(70,235,100,25);

jb2.setBounds(180,235,100,25);

jl6.setBounds(300,105,485,309);

setSize(800,500);

setVisible(true);

setTitle("Server"); jb1.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ae)

{

try {

if(!jt1.getText().equals("") && !jt2.getText().equals("")){

JOptionPane.showMessageDialog (null, "Authorised User", "Login

Seccess", JOptionPane.INFORMATION_MESSAGE);

VerifAdminLogin();

}

else

JOptionPane.showMessageDialog((Component) null, "Invalid password. Please try again. ", "Login Error", JOptionPane.INFORMATION_MESSAGE);

}

catch(Exception e) { System.out.println(e);

}

}

});

jb2.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ae)

{

jt1.setText("");

jt2.setText("");

}

});

}

private void exitForm(java.awt.event.WindowEvent evt) {//GEN- FIRST:event_exitForm

dispose();

}

public static void main(String a[])

{

new FileOpen();

}

void VerifAdminLogin()

{

Connection con=null;

String url="jdbc:odbc:nymble";

Statement st=null;

try

{

String val1=jt1.getText(); val1 = val1.trim();

String val2 = (String)jt2.getText(); val2 = val2.trim();

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");

con=DriverManager.getConnection(url); st = con.createStatement();

ResultSet rs=st.executeQuery("Select Key from Server where SerName='"+val1+"'");

while(rs.next()){

String user = rs.getString(1); boolean b=user.equals(val2); if(b)

{

new Server().show();

}

else

{

JOptionPane.showMessageDialog((Component) null, "Invalid password. Please try again. ", "Login Error", JOptionPane.INFORMATION_MESSAGE);

jt1.setText("");

jt2.requestFocus();

}

}

}

catch(SQLException ex)

{

System.out.println("Unable to access the database");

}

catch(ClassNotFoundException ex)

{

System.out.println("Class not found");

}

catch(Exception ex)

{

System.out.println("Exception raised is:"+ex);

}

finally { con=null;

}

}

}

6. SYSTEM TESTING

6.1 INTRODUCTION

The purpose of testing is to discover errors. Testing is the process of trying to discover every conceivable fault or weakness in a work product. It provides a way to check the functionality of components, sub assemblies, assemblies and/or a finished product It is the process of exercising software with the intent of ensuring that the Software system meets its requirements and user expectations and does not fail in an unacceptable manner. There are various types of test. Each test type addresses a specific testing requirement.

6.2 TYPES OF TESTS

Unit testing

Unit testing involves the design of test cases that validate that the internal program logic is functioning properly, and that program inputs produce valid outputs. All decision branches and internal code flow should be validated. It is the testing of individual software units of the application .it is done after the completion of an individual unit before integration. This is a structural testing, that relies on knowledge of its construction and is invasive. Unit tests perform basic tests at component level and test a specific business process, application, and/or system configuration. Unit tests ensure that each unique path of a business process performs accurately to the documented specifications and contains clearly defined inputs and expected results.

Integration testing

Integration tests are designed to test integrated software components to determine if they actually run as one program. Testing is event driven and is more concerned with the basic outcome of screens or fields. Integration tests demonstrate that although the components were individually satisfaction, as shown by successfully unit testing, the combination of components is correct and consistent. Integration testing is specifically aimed at exposing the problems that arise from the combination of components.

Functional testing

Functional tests provide systematic demonstrations that functions tested are available as specified by the business and technical requirements, system documentation, and user manuals.

Functional testing is centered on the following items:

Valid Input

:

identified classes of valid input must be accepted.

Invalid Input

:

identified classes of invalid input must be rejected.

Functions

:

identified functions must be exercised.

Output

:

identified classes of application outputs must be

exercised.

 

 

Systems/Procedures: interfacing systems or procedures must be invoked.

Organization and preparation of functional tests is focused on requirements, key functions, or special test cases. In addition, systematic coverage pertaining to identify Business process flows; data fields, predefined processes, and successive processes must be considered for testing. Before functional testing is complete, additional tests are identified and the effective value of current tests is determined.

System Testing

System testing ensures that the entire integrated software system meets requirements. It tests a configuration to ensure known and predictable results. An example of system testing is the configuration oriented system integration test. System testing is based on process descriptions and flows, emphasizing pre-driven process links and integration points.

White Box Testing

White Box Testing is a testing in which in which the software tester has knowledge of the inner workings, structure and language of the software, or at least its purpose. It is purpose. It is used to test areas that cannot be reached from a black box level.

Black Box Testing

Black Box Testing is testing the software without any knowledge of the inner workings, structure or language of the module being tested. Black box tests, as most other

kinds of tests, must be written from a definitive source document, such as specification or requirements document, such as specification or requirements document. It is a testing in which the software under test is treated, as a black box .you cannot “see” into it. The test provides inputs and responds to outputs without considering how the software works.

Test strategy and approach

Field testing will be performed manually and functional tests will be written in

detail.

Test objectives

∑All field entries must work properly.

∑Pages must be activated from the identified link.

∑The entry screen, messages and responses must not be delayed.

Features to be tested

∑Verify that the entries are of the correct format

∑No duplicate entries should be allowed

∑All links should take the user to the correct page.

Test Results: All the test cases mentioned above passed successfully. No defects encountered.

7. SCREENSHOTS

Fig: 7.1 server batch file

Fig: 7.2 server login