logo

Client Server Programming Using RSA

Develop a secure communication system for the Rebellion using cybersecurity knowledge.

9 Pages1136 Words384 Views
   

Added on  2022-08-10

About This Document

This Java program is used to create a server and a client to send private message with each other. In this Java program, there are four Java classes is used to perform the client server programming.

Client Server Programming Using RSA

Develop a secure communication system for the Rebellion using cybersecurity knowledge.

   Added on 2022-08-10

ShareRelated Documents
Running Head: Client Server Programming Using RSA
Client Server Programming Using RSA
Name of the Student
Name of the University
Client Server Programming Using RSA_1
Client Server Programming Using RSA1
Client Server Programming Using RSA
This Java program is used to create a server and a client to send private message with
each other. In this Java program, there are four Java classes is used to perform the client server
programming. The first class called Server.java which is used to create a server by which clients
can interact with the server to communicate with each other.
The second class is used for the client where every client have to connect with the server
to send and receive messages from the server. The third Java class is used to perform the
encryption and decryption of the message using RSA algorithm. In this class all the encryption
and decryption methods are created to encrypt the message of the client and sends the encrypted
message to server for secure transition of the messages.
Every message is encrypted before sending it to the server and then if the server wants to
see the message then server decrypt the message using the public key. In this program a
message.java class is used to store all the messages and keys along with the user id of the client
if the server does not decrypt the message after it’s received the message from the client. All the
classes describe below.
Server.java:
Server.java is the most important class of this program because without this class all the
rest of the class is useless. Because the server is the every client is connected to the server by
their port number and host name. If this class does not exist, then the entire program stop
executing.
Client Server Programming Using RSA_2
Client Server Programming Using RSA2
For this program socket programming is used to create server and client because to
connect with other terminal or computer socket connection is used. Basically socket
programming means that both of the system, server and client have the information with each
other like network location and port. In Java socket is represented by Java.net.Socket.
ServerSocket ss=new ServerSocket(4567);
The above code is used to create the instance of Server Socket class and for the
communication between client and server 4567 port number is used. After creating an instance of
the server socket the server waits for the client for connection.
Socket s=ss.accept();
This above line of code is used to accept the client connection if the client tries to connect
to a server with the same port number, then the this accept () method returns an instance of the
socket.
Client.java
Client.java is a class which is used to create a client application for that it is necessary to
create an instance of socket by passing hostname, port number and the user id. In this program
the client and server both classes are running on the same machine so local host is used for
connection.
Socket s = new Socket(args[0], Integer.parseInt(args[1]));
String userID = args[2];
Client Server Programming Using RSA_3

End of preview

Want to access all the pages? Upload your documents or become a member.

Related Documents
Client Server Programming - Desklib
|9
|1289
|365

Client Server System for Socket Programming | Desklib
|18
|1451
|253

Client and Server Application | Report
|16
|1570
|21

Program Description | Document
|15
|1603
|24

Code for Proxy Cache Assignment - Desklib
|7
|1720
|105

How to Install NetBeans and JDK for Java Programming
|17
|1542
|79