Network Programming (Secured Client-Server Chat Application)

5 Chapters
|
90 Pages
|
1,525 Words

Network programming refers to the specialized field of software development that involves designing and implementing communication protocols between computer systems. In the context of a secured client-server chat application, network programming plays a crucial role in establishing a reliable and encrypted communication channel between the client and server. This involves the utilization of various programming languages and libraries to create a robust system that ensures data integrity and confidentiality. The secure exchange of messages is achieved through the implementation of cryptographic techniques, such as encryption and decryption, to protect sensitive information from unauthorized access. Additionally, the client-server architecture facilitates the seamless flow of messages, enhancing the efficiency of real-time communication. The development of a secured client-server chat application demands a comprehensive understanding of network programming concepts, encryption algorithms, and the integration of security measures to safeguard the communication process from potential threats and unauthorized interception.

ABSTRACT

Several network systems are built to communicate with one another as well as
made available through service-oriented architectures. In this project, the client
server architecture is used to develop a chat application. Firstly a chat application
is created for both Client and Server which is based on Transmission Control
Protocol (TCP) where TCP is connection oriented protocol and is a reliable
connection protocol. As security is the key factor while communicating over a
network, so in this project, MySQL SSL protocol and hash function was used for
the Database based on a numbers of benefits. The hash values of the real password
and the random generated number (salt) is stored in the database. The original
password is not stored on the system, making cracking of password much harder.

TABLE OF CONTENT

Title Page i
Certification ii
Approval Page iii
Dedication iv
Acknowledgement v
Abstract vi
Table of Contents vii
List of Tables x
List of Figures xi

Chapter 1:
1.1 Introduction 1
1.2 Background of the study 2
1.3 Statement of the problem 4
1.4 Objectives of the study 4
1.5 Significance of the study 5
1.6 Scope of the study 6

1.7 Limitations 6
1.8 Organization of the work 7
1.9 Definition of terms 8
Chapter 2: Literature Review
2.1 Client-Server and other models 10
2.2 Client-Server communication 11
2.3 Host identification and service port 12
2.4 Sockets and socket based communication 13
2.5 TCP/IP Socket programming 14
2.6 Socket programming in Java 15
2.7 Secure internet programming 16
2.8 Overview of secure socket layer (SSL 16
2.9 Security 17
2.10 Hash functions 19

Chapter 3:
SYSTEM ANALYSIS AND DESIGN
3.1 Methodology 21
3.2 Primary Data collection 26
3.2.1Secondary Data collection 26
3.3 Analysis of the existing system 26
3.4 Limitations of the existing system 27
3.5 System Design 27
3.6 Database Design 38
3.7 System Flowchart 40
3.8 Top Down Diagram 41
3.9 Justification of the new system 41

Chapter 4:
IMPLEMENTATION TESTING AND INTEGRATION
4.1 Choice of development tools 42
4.2 System Requirements 43
4.2.1 Software Requirements 43
4.2.2 Hardware Requirements 44
4.3 Implementation 44
4.4 Testing 51
4.4.1 Unit Test 51
4.4.2 System Test 51
4.5 Integration 52

Chapter 5:
SUMMARY, RECOMMENDATIONS AND CONCLUSION
5.1 Summary 53
5.2 Limitations 53
5.3 Recommendations 54
5.4 BILL OF ENGINEERING MEASUREMENT AND EVALUATION 55
5.3 Conclusion 56
Bibliography  58
Appendix A: PROGRAM CODES
BAChatClient.java 59
BAChatServer.java 59
DatabaseManager.java 62
Encryptor.java 67
Appendix B: SAMPLE OUTPUT 72
Appendix C: USER GUID 79

CHAPTER ONE

1.1 INTRODUCTION
Several network systems are built to communicate with one another and are made
available through service-oriented architectures. In this project, we use the client
server architecture to develop a secured Client-Server chat application. A chat
application is created based on Transmission Control Protocol (TCP) where TCP is
connection oriented protocol and in the end, multithreading is used to develop the
application.
A client-server chat application consists of a Chat Client and a Chat Server and
there exists a two way communication between them. Here, Message Processor is
used to interpret message from the user, Message Interpreter is used to extract and
pass the received message. Message Maker is used to construct back the message
and Client Manager is used to maintain the clients list which the sender and
receiver at both sides use to interact with each other.
In general, the server process will start on some computer system; in fact, the
server should be executed before the client. Server usually initializes itself, and
then goes to wait state or sleep state where it will wait for a client request. After
that, a client process can start on either the same machine or on some other
machine. Whenever the client wants some service from the server, it will send a
request to the server and the server will accept the request and process it. After the
server has finished providing its service to the client, the server will again go back
to sleep, that is, waiting for the next client request to arrive. This process is
repeated as long as the server processes is running. Whenever such request comes,
the server can immediately serve the client and again go back to the waiting state
for the next request to arrive.

1.2 BACKGROUND OF THE STUDY
Client server model is the standard model which has been accepted by many for
developing network applications. In this model, there is a notion of client and
notion of server. As the name implies, a server is a process (or a computer in which
the process is running) that is offering some services to other entities which are
called clients. A client on the other hand is process (which is running) on the same
computer or other computer that is requesting the services provided by the server.
A chat application is basically a combination of two applications:
 Server application
 Client application
Server application runs on the server computer and client application runs on the
client computer (or the machine with server). In this chat application, a client can
send data to anyone who is connected to the server.
Java application programming interface (API) provides the classes for creating
sockets to facilitate program communications over the network. Sockets are the
endpoints of logical connections between two hosts and can be used to send and
receive data. Java treats socket communications much as it treat input and output
operations; thus programs can read from or write to sockets as easily as they can
read from or write to files.
To establish a server connection, a server socket needs to be created and attached
to a port, which is where the server listens for connections. The port recognizes the
Transmission Control Protocol service on the socket. For instance, the email server
runs on port 25, and the web server usually runs on port 80.
Server Execution: At server the side, a thread is created which receives numerous
clients’ requests. It also contains a list in which Client’s name and IP addresses are
stored. After that, it broadcast the list to all the users who are currently in chat
room and when a client logs out then server deletes that particular client from the
list, update the list and then broadcast the list to all available clients.
Client Execution: A client firstly must have to register itself by sending username
to the server and should have to start the thread so that system can get the list of all
available clients. Then any of two registered clients can communicate with each
other.

1.3 STATEMENT OF THE PROBLEM
The client-server communication model is used in a wide variety of software
applications. Where normally the server side is sufficiently protected and sealed
from public access, but client applications running on devices like notebooks and
desktops are considered insecure and exposed to security threats.
The main weakness of client-server chat application is that there is no security
provided to data which is transferred between clients. Any unauthorized client can
hack the client account and can change the data. This is the main objective of this
project (To develop a secured Client-Server Chat Application).

1.4 OBJECTIVES OF THE STUDY
The aim of this project is to develop a reliable and secure network programming
(Client-Server chat model) which can perform a multithreaded server client chat
connection is established between them then they can communicate with each
other.
Client: A client is a system that accesses or desires for a service made accessible
by a server.
Server: A server is a system (hardware or software) program running to provide
the service requests of other system programs.
Port: Port is a software mechanism that allows the centralized connected Servers
to listen for requests made by clients. Port is actually purposed as a gateway to
listen for the requested parameters by the server terminals or other machines. It is a
software address on a system that is on the network. Entire request response
proceeding among this Application is carries through machine ports.
Network: This refers to a system were computers are linked to share software,
data, hardware and resources for the benefit of users.
Interface: This may be software or hardware that upon an agreed method spells
out the manner a system component can exchange information with another system
component.
Secure socket layer (SSL): This refers to Secure Sockets Layer protocol that is
used for encryption of data for secure data transmission.
IP: This refers to Internet Protocol; it is the reasonable network address of device
on a network. It is notational called dotted-decimal (for instance: 128.1.0.1).
Thread: A thread is a section of code which is executing independently of others
threads in a same program. Java has a class Thread which is defined in java.lang
package. Thread is the most powerful feature that JAVA supports from other
programming languages.

SIMILAR PROJECT TOPICS:

SHARE PROJECT MATERIALS ON:

MORE DESCRIPTION:

Network Programming (Secured Client-Server Chat Application):

Creating a secured client-server chat application involves several steps, including setting up the server, implementing the client, and ensuring secure communication. Below, I’ll provide an overview of the process and highlight key concepts and technologies you can use. Please note that this is a high-level guide, and you’ll need to dive deeper into each step for a complete implementation.

Step 1: Server Setup

Choose a Programming Language: Select a programming language for your server. Popular choices include Python, Java, C#, or Node.js.

Socket Programming: Implement socket programming to create a server that listens for incoming client connections. Sockets allow communication between the client and server over a network.

Security Measures: Use SSL/TLS to encrypt data transmitted between the client and server. Most programming languages have libraries or modules for implementing SSL/TLS encryption.

Authentication: Implement user authentication to ensure that only authorized users can connect to the server. You can use username and password authentication or more advanced methods like OAuth.

Database Integration: If you want to store user data or chat history, integrate a database system like MySQL, PostgreSQL, or MongoDB into your server.

User Management: Create a system for managing users, including registration, login, and user profiles.

Step 2: Client Implementation

Choose a Programming Language: Like the server, select a programming language for your client application.

Socket Programming: Implement socket programming on the client-side to connect to the server.

User Interface: Create a user-friendly interface for users to send and receive messages. You can use libraries or frameworks for building GUIs if needed.

Secure Communication: Implement SSL/TLS encryption on the client-side to ensure secure communication with the server.

Step 3: Secure Communication

SSL/TLS Encryption: Implement SSL/TLS encryption for all data transmitted between the client and server. Use certificates to authenticate the server and establish a secure channel.

Data Encryption: Encrypt the chat messages before sending them over the network. You can use cryptographic libraries to implement encryption and decryption.

Authentication Tokens: Use tokens or session management to ensure that only authenticated users can send and receive messages.

Step 4: Additional Features

Chat Rooms: Implement chat rooms or channels to allow multiple users to communicate in separate groups.

Message Persistence: If needed, store chat messages in a database for future retrieval.

File Sharing: Add the capability to share files securely between users.

Offline Messages: Implement a mechanism for storing and delivering messages when a user is offline.

Notification System: Notify users about new messages or events using notifications or push notifications.

Step 5: Testing and Deployment

Testing: Thoroughly test your chat application, including security, scalability, and user experience.

Deployment: Deploy your server and client applications to a production environment. Consider using cloud platforms like AWS, Azure, or Google Cloud.

Monitoring and Maintenance: Continuously monitor the server for performance and security issues. Regularly update and maintain the application.

Remember that security is a crucial aspect of a chat application. Regularly update your application and libraries to patch security vulnerabilities, and follow best practices for secure coding throughout the development process. Additionally, consider consulting with a cybersecurity expert to perform security assessments and penetration testing to identify and address potential vulnerabilities.