ssl documentation2
TRANSCRIPT
SSL BACKEND FORWARDING SCHEMEIN CLUSTER BASED WEB SERVICE
Project Report Submitted in partial fulfillment of the requirements for the award of the Degree of
BACHERLOR OF COMPUTER APPLICATIONS
SUBMITTED BY S.Sudha Devi Reg No:1308127036
M.Salina Julfiya Reg No:1308127028
Under the Guidance of MRS.B.AMALA DEVI,MSC(C.S&IT)..
DEPARTMENT OF IT & BCA
MADURAI SIVAKASI NADAR’S PIONEER MEENAKSHI
WOMEN’S COLLEGE
POOVANTHI-630611
MADURAI SIVAKASI NADAR’S PIONEER MEENAKSHI
WOMEN’S COLLEGE
POOVANTHI-630611
Department of IT & BCA
BONAFIDE CERTIFICATE
This is to certify that the project work entitled “SSL Backend Forwarding Scheme in Cluster Based Web Services” submitted by S.Sudha Devi Reg No:1308127036 , M.Salina Julfiya Reg No:1308127028 is a bonafide record of work carried out during 2011
Project Guide Head of the Department
Submitted for the viva-voce examination held on __________
Internal Examiner External Examiner
DECLARATION
DECLARATION
We hereby declare that the project work entitled ” SSL Backend Forwarding Scheme in Cluster Based Web Services” submitted to ALAGGAPA UNIVERSITY for the award of the degree of BACHELOR OF COMPUTER APPLICATIONS is a record of original work done combined by us.I further declare that this project record or any part of this has not been submitted else where for any other degree.
S.Sudha Devi Reg.No:1308127036 M.Salina Julfiya Reg.No:1308127028
ACKNOWLEDGENT
ACKNOWLEDGEMENT
We are grateful to our beloved principal, Dr.R.Suriyabrabha
MSc.,MPhil.,Ph.D.. , who generously allowed us to do one project. We also
thank her for encouraging us by providing us with our requirements.
We extend our sincere thanks to Mrs.P.Thennarasi
M.Sc(IT).,MPhil the head of the department of IT & BCA .we thank her for the
constant encouragement on our project .
We sincerely dedicate our heartful gratitude to MRS.B.AMALA
DEVI, MSC(C.S&IT).. ,for her valuable guidance in completing our project. We
are extremely thankful to his for spending her precious time for us.
We sincerely dedicate our heartful gratitude to Mr.V.Ananda
Siddhan MCA for his valuable guidance in completing our project. We are
extremely thankful to his for spending her precious time for us.
Finally,we thank everbody who either directly or indirectly helped
us in completing our project work.
CONTENT
CONTENT
1. SYNOPSIS
2. ORGANIZATION PROFILE
3. PROJECT PROFILE
4. SYSTEM ANALYSIS
a. Existing System
b. Proposed System
5. SYSTEM REQUIREMENTS
a. Hardware Specification
b. Software Specification
c. About the software
6. SYSTEM DESIGN
a. Structured Chart
b. Data Flow Diagram
c. Data Dictionary
d. Detailed Design
7. SYSTEM IMPLEMENTATION
8. SYSTEM TESTING
a. Unit Testing
b. White Box Testing
c. Black Box Testing
d. Integration Testing
9. CONCLUSION
a. Appendix A-Sample Screens
b. Appendix B-Source Listing
10. FUTURE ENHANCEMENT
11. BIBLIOGRAPHY
SYNOPSIS
SYNOPSIS
Internet is ruled by web server and web clients. For providing security while transmitting
data between these web server and web clients, digital signatures are used to encrypt data.
Recently, most of the web server are cluster based web servers, where request are created by
another server.
So, here arises a problem that the digital signature received by a client from a cluster is
not unique. Hence data security is not possible in the cluster based web servers. To overcome
these problem, we are creating a backend forwarding model.
ORGANIZATION
PROFILE
ORGANIZATION PROFILE
Candela soft is one of the leading software developers and designers in the industry
started in the year 2008. We have discovered the nitty-gritty of the industries still now while
providing excellent services to our esteemed clients. We at candela soft started with a small team
but we are now a big team since this year started. Candela soft has redefined quality and
effectiveness in website/software development and designing. Our clients range from small start-
up companies needing a basic web presence to large corporations requiring complex web
applications.
Our highest quality services are driven by the customer's comfort, cost benefits, schedule
and budget targets, and confidentiality and security issues. Those distinguish our company from
thousands of others.
We offer software development services in the area of system development, Internet /
intranet, networking, complete development of packaged business applications.
As a software development service provider, Candelasoft strives to provide our customers
quality application development services and web development services that help them to remain
in step with their competitors.
Mission:
We strive to develop superior Products and provide top notch services for our clients
through state-of-the-art technology, innovation, leadership and partnerships.
Vission:
To be the most admired Multinational Company in the next decade while providing cost
effective IT solutions.
Values:
We continually educate and keep ourselves acquainted with the latest concepts, tools and
technologies. In short, it's our constant endeavor to uphold the academic talent required to meet
the business objectives.
Why CandelaSoft Technologies?
Unmatched software development skills
State-of-the-art Infrastructure
Experience in Cutting-Edge Technologies
Efficient Project Implementation
Lower costs with high quality
Less development time through
Efficient project management
Effective management at different stages of the SDLC
24 x 7 Technical support
Leaders know that success is a product of continual improvement and innovation. Our
engagement model is build around that philosophy
PROJECT
PROFILE
PROJECT PROFILE
State-of-the-art cluster-based data centers consisting of three tiers (Web server,
application server, and database server) are being used to host complex Web services such
as e-commerce applications. The application server handles dynamic and sensitive Web
contents that need protection from eavesdropping, tampering, and forgery.
Although the Secure Sockets Layer is the most popular protocol to provide a
secure channel between a client and a cluster-based network server, its high overhead
degrades the server performance considerably and, thus, affects the server scalability.
It improving the performance of SSL-enabled network servers is critical for
designing scalable and high-performance data centers. We examine the impact of SSL
offering and SSL-session-aware distribution in cluster-based network servers.
We propose a back-end forwarding scheme, called ssl_with_bf, that employs a
low-overhead user-level communication mechanism like Virtual Interface Architecture to
achieve a good load balance among server nodes.
We compare three distribution models for network servers, Round Robin,
ssl_with_session, and ssl_with_bf, through simulation.
The experimental results with 16-node and 32-node cluster configurations show
that, although the session reuse of ssl_with_session is critical to improve the performance
of application servers, the proposed back-end forwarding scheme can further enhance the
performance due to better load balancing.
The ssl_with_bf scheme can minimize the average latency by about 40 percent
and improve throughput across a variety of workloads.
Modules
1. Authentication Module.
2. IP Address Representation Module.
3. Load Servers (With Encryption) Module.
4. Load Balancing (With Decryption) Module.
Authentication Module:
This module is to register the new users and previously registered users can enter into our
project. The admin only can enter and do the uploading files into the servers.
IP Address Representation Module:
This module is to give the IP addresses which we are going to assign those as servers. We
can enter and view IP addresses from this module.
Load Servers Module:
This module is, the administrator only can enter into this module. The administrator will
do the encryption of the text file and store into the servers which we are assigned in IP
representation module. This module will make the both public and private key for the
cryptography.
Load Balancing Module:
This module is, the users can enter into this module and can view the file name which the
administrator stored into the servers. The user can select the file from the list and can download
from the server which is in idle state. We will get the response time and from which server we
are getting the file. Finally we can get the decrypted file from the key pair.
SYSTEM ANALYSIS
SYSTEM ANALYSIS
EXISTING SYSTEM:
In existing system, they have used to develop the project using Round Robin [RR] model
and SSL_with_Session model. Those models are not effective. Those models are not
able to give the output in time and the thorough put also lesser than that their expected
output.
These models had made the Latency problem and minimal through put. For this problem
they introduced the SSL_with_bf (Backend forwarding) model is to overcome the
existing problems. We going to implement SSL_with_Backend Forwarding model in
our proposed system.
PROPOSED SYSTEM:
In our Proposed System, We are going to implement the SSL_with_Backend Forwarding
model (Algorithm) is to overcome the problem of existing system.
This model will reduce the latency and increase the throughput than the existing system
(Round Robin model and SSL_with_Session).
The Secure Socket Layer_with_BF model is very helpful for load balancing of the
server. This will reduce the load of the server while the server is being busy. These are
the advantages of our proposed system.
The ssl_with_bf scheme can minimize the average latency by about 40 percent and
improve throughput across a variety of workloads.
SYSTEM
REQUIREMENTS
SYSTEM REQUIREMENTS
Hardware Specification
System : Pentium IV 2.4 GHz
Hard Disk : 40 GB
Floppy Drive : 1.44 Mb
Monitor : 15 VGA Colour
Mouse : Logitech
Ram : 256 Mb
Software Specification
Operating System : Windows XP Professional
Front End : Visual Studio .Net
Coding Language : Visual C# .Net
ABOUT THE SOFTWARE
Overview of the .NET
.NET is the Microsoft Web service strategy to connect information, people, system and
devices through software. Integrated across the Microsoft platform, .NET technology provides
the ability to quickly build, deploy, manage and use connected, security enhanced solutions with
web services.
.NET connected solutions enable business to integrate their systems more rapidly and in a
more agile manner and help them realize of information anytime, anywhere, on any device.
The Microsoft Platform includes everything a business needs to develop and deploy a
web service-connected IT architecture: server to host web services, deployment tools to create
them, applications to use them, and a world wide network of more than 35,000 Microsoft
Certified Partner organizations to provide any help you need.
Microsoft .NET is software that connects information, people, system and devices. It
spans the clients, servers and developer tools and consists of
The .NET framework 1.1 is used for building and running all kinds of
software, including web-based applications, smart client applications,
smart client applications and XML, web services-components that
facilitate integration by sharing data.
Developer tools such as Microsoft Visual Stdio.NET 2003 which provides
an integrated development environment for maximizing developer
productivity with the .NET framework.
A set of servers including Microsoft Windows Server 2003, Microsoft
SQL server that integrates, runs, operates and manages web services and
web-based applications.
.NET Framework
The .NET framework is a development and environment that allows different
programming language and libraries to work together seamlessly to create Windows based
and applications that are easier to build, manage, deploy and to integrate with another
network systems.
The .NET Framework consists of
The Common Language Runtime(CLR):
A language-neutral development and execution provides services to help
“manage” application execution.
The Framework Class Library(FCL):
A consistent, object-oriented library of prepackaged functionality.
The .NET Framework provides the basic infrastructure that windows-based
applications need to make Microsoft’s .NET vision of connecting information,
people, systems and devices a reality.
Support for standard networking protocols and specifications:
The .NET framework uses standard Internet protocols and Specifications like
TCP/IP, SOAP, XML, and HTTP to allow a broad range of information, people,
systems and devices to be connected.
Support for different programming language:
The .NET framework supports a variety of different programming language so
development can pick the language of their choice.
Support for programming libraries developed in different language:
The .NET framework provides consistent programming models for using
prepackaged units of functionality (libraries) which makes applications
development faster, easier and cheaper.
Support for different platforms:
The.NET framework is available for a variety of Windows platforms, which
allows people, systems and device to be connected using different computing forms
platform.
Common Language Run-time (CLR)
The CLR is responsible for runtime services such as language integration,
security enforcement, and memory, process and thread management. In addition, the CLR
has a role a development time when features such as life-cycle management, strong type
naming, cross-language exception handling and dynamic binding reduce the amount of code
that a developer must write to turn business logic into a reusable component.
Overview of C#.Net
Visual C#, pronounced C sharp, is a new object-oriented programming language
that is an evolution of C and C++, providing a simple and type-safe language for developing
application.
Microsoft C# is a new programming language designed for building a range of
enterprise applications that run on the .NET Framework. An evolution of Microsoft C and
Microsoft C++, C# is simple, modern, type safe, and object oriented. C# code is complied as
managed code, which means it benefits from the services of the common language runtime.
These services include languages interoperability, garbage collection, enhanced security, and
improved versioning support.
C# is introduced as Visual Studio .Net suite. Support for Visual C# includes
project templates, designers, property pages, code wizards, an object model, and other features of
the development environment. The library for Visual C# programming is the .NET Framework.
C SHARP
C# is intended be the premier language for writing NGWS (Next Generation Windows
application in the enterprise computing space)
The programming language C# is derived from C and C++.
C+ is a modern language. It simplifies and modernizes C++ area of classes, method
overloading, exception handling.
C# eliminates features of C++ like templates & multiple inheritances.
It is concise, lean and modern language.
It combines the best feature of many commonly used languages, the power of C++ and
the elegance of JAVA.
It embodies today’s concern for simplicity, productivity and robustness.
Major parts on .NET framework are actually coded in C#.
Today’s World Wide Web consists of a large number of individual web sites
that do not co-operate. The next generation of the web is expected to have dynamic co-
operation web-sites on its network. The .NET platform and its technologies developed
Microsoft will enable such co-operation among web.
The language that is designed for both computation and communications. It is
characterized by several key features. They are
Simple
Modern
Object-Oriented
Type-safe
Version able
Compatible
Flexible win32
Interoperable
consistent
Simple
C# simplifies c++ by eliminating irksome operators as >.:: and pointers.
Pointers are not used.
Data types Integer & Boolean are entirely different types.
If-loop only contains Boolean result.
Modern
C# language is called a modern language due of number of features it supports. It supports
Decimal data type is provided for financial calculations. Modern approach to
debugging and robust security model.
Garbage collection is responsible for memory managements.
Robust error handling.
Object Oriented
C# is truly object-oriented. It supports all the here trends of object-oriented systems, namely
There are no global functions, variables & constants.
Everything must be declared inside a class or static member.
Methods are default non-virtual(i.e. cannot be overridden).
It supports modifiers.
It allows & multiple inheritance is implemented using interfaces.
The entire C# class allows model is build on top of the visual object system of the .NET
framework. In C#, everything is an object.
There are no more global functions, variables and constants.
Type-safe
Type-safe promotes robust programs. C# incorporates a number of type-safe measures.
C# performs bounds checking.
Overflow checking is enable with exception thrown when an overflow.
C# does not permit unsafe casts.
Reference parameters that are passé are type-safe.
C# supports automatic garbage collections.
All dynamically allocated objects and arrays are initiated to zero.
C# enforces overflow checking in arithmetic.
Happens
C# integer (Data types) cannot be reference.
Consistent
C# supports a unified type system which eliminates the problems of varying
ranges of integer types. All types are treated as objects and developers can extend
the type system and easily.
Version able
C# provides supports for versioning with the help of new and overrides keywords. With
this support, programmer can guarantee that his new class library will maintain binary
compatibly with the existing client applications.
Multiple application install different versions of the same computer.
As a result, sometimes the application works, and sometimes does not work.
C# provides with the concept of versioning, it can retain the binary compatibility
of application with the existing client applications.
Compatible
C# allows access to different Application programming interfaces.
Flexible
Default C# code runs are safe mode.
Access WIN32 code sometimes mekes use of pointers-unsafe mode.
Inter-operability
C# provides support for using Com objects, no matter what language was used to author
them.
C# also supports special feature that enables a programs to call out in any native API.
Structured Exception Handling
C# supports structured handling, which enables us to detect and remove errors at
runtime. In C#, we need to Try…Catch…Finally statements. We use to create robust and
effective exception handlers to improve the performance of our applications.
Applications of C#.NET
It can use for a variety of applications that are supported by the .NET platforms.
Console Applications
Windows Applications
Developing Windows Controls
Developing ASP.NET projects
Creating Web controls
Provides Web services
Developing .NET component library.
SQL SERVER
Features Of SQL Server
The OLAP services feature available in SQL server is now called SQL server. The OLAP services has been replaced with the Analysis Services also includes a new data mining component. The repository is used only to reference to the repository engine with meta data services.
SQL SERVER database consists of six types of objects. They are Table Query Form Report Macro Module
Table
A database is a collection of data about a specific topic. The table can be worked by two types. They are :
Design table- to built or modify the structure of the table we work in the design view.
Database table- to add, edit or analyze the data itself we work in the view mode.
Query
A query is a question that has created to ask the data. Access gathers data that answers the questions from one or more tables.
The data that make up the answers is either dynast or a snapshot. Each time we run query, we get latest information in the dynast. Access either displays the dynast or snapshot for us to view or perform an action on it, such as deleting or updating.
Forms
A form is used to view and edit information in the database record by record. A form displays only the information we want to see in the way we want to see it. Form use the familiar controls such as textboxes and checkboxes.
This makes viewing and entering data easy. Form can also be work in two ways. They are
Design view – to built or modify the structure of a form, we work in design view.
Form view – is to display the whole design of the form.
Report
A macro is a set of actions. Each action in macros does something such as opening a form or printing a report. the main goal of the macros to automate the common tasks to work easy and to save the time.
Module
Modules are the units of code written in access basic language. We can write and use the module to automate and customize the database in a very sophisticate ways.
SYSTEM DESIGN
Structured Chart
Structured charts are used during architectural design to document hierarchical structure, parameters and interconnections in a system. A structure chart differs from a flowchart in two ways:A structure chart has no decision boxes.The sequential ordering of tasks inherent in a structure chart.
The chart can be augmented with module-by-module specification of the input and output parameters as well as the input and output attributes.During the architectural design the parameters attributes are abstract; they are refined into concrete representation during detailed design.
SYSTEM FLOW DIAGRAM :
DATA FLOW DIAGRAM
Data Flow Diagram Specifies the data source and data sinks, data stores, transformations on the
data and flow of data Between sources,transformation and stores. To simply specify, a DFD is
one that presents a picture of what is being specified and is conceptually easy to understand
presentation of the application.
- - Data Sinks / Data Sources
-
- - Transformation, Process
- Data Stores
- Data Flow
It follows the top-down approach. An initial overview model is exploded into more detailed,
lower level diagrams that shows additional features of the system. Each process can be broken
into yet more detailed DFD.
AUTHENTICATION MODULE
IP ADDRESS REPRESENTATION MODULE
LOAD SERVER MODULE
LOAD BALANCING MODULE
DATA DICTIONARY
Table Name: Authentication
Name Type Description
User Name varchar(30) User Name
Password nvarchar (20) Password
Table Name: IPList
Name Type Description
IP Address nvarchar (50) IP Address
Process nvarchar (20) Process
Table Name: Register
Name Type Description
User Name varchar(30) User Name
Password nvarchar(20) Password
Address nvarchar(30) Address
Phno numeric(15,0) Phone Number
MailId Nvarchar(30) E-mail Id
DETAILED DESIGN
6.1. INPUT DESIGN
Input design is the process of converting user-originated inputs to a computer-based
format. Input design is one of the most expensive phases of the operation of computerized
system and is often the major problem of a system.
6.2. OUTPUT DESIGN
Output design generally refers to the results and information that are generated by the system
for many end-users, output is the main reason for developing the system and the basis on
which they evaluate the usefulness of the application.
The output is designed in such a way that it is attractive, convenient and informative. Forms
are designed in ASP.NET with various features, which make the console output more
pleasing.
As the outputs are the most important sources of information to the users, better design
should improve the system’s relationship with us and also will help in decision-making.
Form design elaborates the way output is presented and the layout available for capturing
information.
6.3. DATABASE DESIGN:
The database design is a must for any application developed especially more for the data
store projects. Since the chatting method involves storing the message in the table and produced
to the sender and receiver, proper handling of the table is a must.
In the project, login table is designed to be unique in accepting the username and the
length of the username and password should be greater than zero.
The complete listing of the tables and their fields are provided in the annexure under the
title ‘Table Structure’.
SYSTEM IMPLEMENTATION
Implementation is the stage of the project when the theoretical design is turned out into a
working system. Thus it can be considered to be the most critical stage in achieving a successful
new system and in giving the user, confidence that the new system will work and be effective.
The implementation stage involves careful planning, investigation of the existing system
and it’s constraints on implementation, designing of methods to achieve changeover and
evaluation of changeover methods.
Implementation is the process of converting a new system design into operation. The
important factor that should be considered here is that the conversion should not disrupt the
functioning of the organization.
This project is basically designed for cluster based web server where digital signatures
are not able to fully implemented due to different servers responding to a single client. For this
we are proposing a backend forwarding method for cluster based web server.
System Testing
Testing is vital to the success of the system.Testing is done for each module. After testing all the
modules, the modules are integrated and testing of the final system is done with the test data,
specially designed to show that the system will operate successfully in all its aspects conditions.
Thus the testing in the software life cycle model into check whether we have developed the
right product.
Unit Testing
In Unit Testing,each program unit in the software is tested. A program unit is routine or a
collection of routines implemented by an individual progammer.
The following tests are performed on a program unit.
1.Functional tests:
Which tests, the function done by that program unit is perfect.
2.Performance tests:
Which determines the amount of execution time spent in various part of the unit, program
throughput, response item and device utility.
3.Strees tests:
The tests is used to determine the strengths and limitation of the units.
4.Sructure tests:
The tests concern with exercising the internal login of a program and traversing
particular execution path.
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.
Integration Testing:
Integration testing is a systematic technique for constructing tests to uncover error
associated within the interface. In the project, all the modules are combined and then the
entire programmer is tested as a whole. In the integration-testing step, all the error uncovered
is corrected for the next testing steps.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace SSL
{
public partial class frmHome : Form
{
public frmHome()
{
InitializeComponent();
}
private void lblad_Click(object sender, EventArgs e)
{
admin am = new admin();
am.Show();
}
private void lblU_Click(object sender, EventArgs e)
{
Form1 fm = new Form1();
fm.Show();
}
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;
namespace SSL
{
public partial class admin : Form
{
public admin()
{
InitializeComponent();
}
private void btn1_Click(object sender, EventArgs e)
{
if (txt1.Text == "")
MessageBox.Show("Enter UserName");
else if (txt2.Text == "")
MessageBox.Show("Enter Password");
else
{
SqlConnection cn = new SqlConnection("Data Source=.;Initial
Catalog=cluster;Integrated Security=true");
cn.Open();
SqlCommand cmd = new SqlCommand("select * from authen where username='" +
txt1.Text + "' and password='" + txt2.Text + "'", cn);
SqlDataReader dr = cmd.ExecuteReader();
bool found = false;
while (dr.Read())
{
found = true;
}
if (found)
{
IP i = new IP();
i.Show();
}
else
{
MessageBox.Show("Invalid UserName or password");
}
}
}
private void btn2_Click(object sender, EventArgs e)
{
ActiveForm.Close();
}
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Net;
using System.IO;
using System.Net.NetworkInformation;
using System.Data.SqlClient;
namespace SSL
{
public partial class IP : Form
{
public IP()
{
InitializeComponent();
ipfun();
}
private void btnc_Click(object sender, EventArgs e)
{
ActiveForm.Close();
}
private void btns_Click(object sender, EventArgs e)
{
lstIP.Items.Clear();
IPHostEntry ipEntry = Dns.GetHostEntry(txtMN.Text);
IPAddress[] addr = ipEntry.AddressList;
for (int i = 0; i < addr.Length; i++)
{
lstIP.Items.Add(addr[i].ToString());
}
}
private void lstIP_SelectedIndexChanged(object sender, EventArgs e)
{
String a;
SqlConnection cn = new SqlConnection("Data Source=CANDELAS-AC81C4;Initial
Catalog=cluster;Integrated Security=true");
cn.Open();
SqlCommand cmd = new SqlCommand("select * from iplist where IPAddress='"
+lstIP.SelectedItem.ToString()+ "'", cn);
SqlDataReader dr = cmd.ExecuteReader();
a = "";
while (dr.Read())
{
a = dr[1].ToString();
}
if (a != "")
{
txtip.Text = lstIP.SelectedItem.ToString();
cmbpr.Text = a;
}
else
{
txtip.Text = lstIP.SelectedItem.ToString();
}
}
public bool CheckSequentialIP(string fullip)
{
bool f = false;
IPHostEntry IpEntry = Dns.GetHostEntry(fullip);
Ping pingSender = new Ping();
PingOptions options = new PingOptions();
options.DontFragment = true;
string data = "a";
byte[] buffer = Encoding.ASCII.GetBytes(data);
int timeout = 120;
PingReply reply = pingSender.Send(fullip, timeout, buffer, options);
if (reply.Status == IPStatus.Success)
{
f = true;
}
return f;
}
public void ipfun()
{
for (int endofip = 1; endofip < 10; endofip++)
{
string fullip;
fullip = "192.168.1." + Convert.ToString(endofip);
if (CheckSequentialIP(fullip))
lstIP.Items.Add(fullip);
}
}
private void btnas_Click(object sender, EventArgs e)
{
string a;
SqlConnection cn = new SqlConnection("Data Source=.;Initial
Catalog=cluster;Integrated Security=true");
cn.Open();
SqlCommand cmd = new SqlCommand("select * from iplist where IPAddress='" +
lstIP.SelectedItem.ToString() + "' ", cn);
SqlDataReader dr = cmd.ExecuteReader();
a = "";
while (dr.Read())
{
a = dr[0].ToString();
}
cn.Close();
cn.Open();
if (a != "")
{
SqlCommand cmd1 = new SqlCommand("update iplist set Process='" +
cmbpr.SelectedItem.ToString() + "' where IPAddress='" + txtip.Text + "' ", cn);
cmd1.ExecuteNonQuery();
}
else
{
SqlCommand cmd2 = new SqlCommand("insert into iplist values('" + txtip.Text + "','"
+ cmbpr.SelectedItem.ToString() + "' ", cn);
cmd2.ExecuteNonQuery();
}
cn.Close();
}
private void btnup_Click(object sender, EventArgs e)
{
Upload u = new Upload();
u.Show();
}
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.IO;
using System.Security.Cryptography;
using System.Net.NetworkInformation;
using System.Net;
using System.Data.SqlClient;
namespace SSL
{
public partial class Upload : Form
{
String filePath;
public Upload()
{
InitializeComponent();
ipfun();
}
private void btnnew_Click(object sender, EventArgs e)
{
richTextBox1.Text = "";
}
private void btnbr_Click(object sender, EventArgs e)
{
DialogResult dr = openFileDialog1.ShowDialog();
if (dr == DialogResult.OK)
{
richTextBox1.LoadFile(openFileDialog1.FileName,
RichTextBoxStreamType.PlainText);
filePath = openFileDialog1.FileName;
}
}
private void btnsave_Click(object sender, EventArgs e)
{
DialogResult dr= saveFileDialog1.ShowDialog();
if (dr == DialogResult.OK)
{
richTextBox1.SaveFile(saveFileDialog1.FileName,
RichTextBoxStreamType.PlainText);
filePath = saveFileDialog1.FileName;
}
}
private void btnup_Click(object sender, EventArgs e)
{
string fn = filePath;
string fl = fn.Substring(fn.LastIndexOf("\\") + 1);
String dir = comboBox1.SelectedItem.ToString();
dir = "D:/SalinaSudha/SSLFILES/" + dir;
if (!Directory.Exists(dir))
{
Directory.CreateDirectory(dir);
}
if (File.Exists(dir + "/" + fl))
{
if (MessageBox.Show("do you want to override the file", "file exist",
MessageBoxButtons.YesNo) == DialogResult.Yes)
{
File.Copy(filePath, dir + "/" + fl,true);
}
}
else
File.Copy(filePath, dir + "/" + fl);
}
private void btnenc_Click(object sender, EventArgs e)
{
richTextBox1.Text = EncryptElgamal(richTextBox1.Text, "musthakk");
}
public string EncryptElgamal(String strText, String strEncrKey)
{
try
{
byte[] IV = { 0x12, 0x34, 0x56, 0x78, 0x90, 0xAB, 0xCD, 0xEF };
byte[] bykey = System.Text.Encoding.UTF8.GetBytes(strEncrKey);
byte[] InputByteArray = System.Text.Encoding.UTF8.GetBytes(strText);
DESCryptoServiceProvider des = new DESCryptoServiceProvider();
MemoryStream ms = new MemoryStream();
CryptoStream cs = new CryptoStream(ms, des.CreateEncryptor(bykey, IV),
CryptoStreamMode.Write);
cs.Write(InputByteArray, 0, InputByteArray.Length);
cs.FlushFinalBlock();
return Convert.ToBase64String(ms.ToArray());
}
catch (Exception ex)
{
return ex.Message;
}
}
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
{
}
public bool CheckSequentialIP(string fullip)
{
bool f = false;
IPHostEntry IpEntry = Dns.GetHostEntry(fullip);
Ping pingSender = new Ping();
PingOptions options = new PingOptions();
options.DontFragment = true;
string data = "a";
byte[] buffer = Encoding.ASCII.GetBytes(data);
int timeout = 120;
PingReply reply = pingSender.Send(fullip, timeout, buffer, options);
if (reply.Status == IPStatus.Success)
{
f = true;
}
return f;
}
public void ipfun()
{
for (int endofip = 1; endofip < 10; endofip++)
{
string fullip;
fullip = "192.168.1." + Convert.ToString(endofip);
if (CheckSequentialIP(fullip))
comboBox1.Items.Add(fullip);
}
}
}
}
BIBLIOGRAPHY
Steve Harris and Robmacdonald,
“Web Development With C#.Net”
← APRESS
Matthew Macdonald,
“Microsoft Visual C#.Net Programmer’s Cookbook”
- Tata McGraw Hill Edition
The Complete Reference SQL (Second Edition)
Groff Weinberg
Software Testing
Brain Hambling, peter Morgan, Angelina Samaroo,
Geory Thompson, Peter Williams.