Reference no: EM133768061
Objectives:
To implement a client and a server application using UDP and TCP sockets;
To use C/C library functions for implementing socket applications;
To get familiarized with the Unix programming environment.
Introduction:
For this project, you will be writing programs that will implement Chit, a secure chat application between two users using TCP socket streams. A Chit chat communication will be implemented using end-to-end encryption on messages exchanged between users.
You may use the Public Key (PK) Server program from Project 1 to manage the users' public keys.
You will be writing an Address Server program to manage the "listening" addresses of the client processes being used by individual users who are currently logged in. Chit chat clients should look up another user's "listening" address to enable a direct chat with that other user. All user-to-user communication should be through a TCP socket and all communication between a client and the servers will be through UDP sockets. All Chit chats between users should be encrypted using RSA public key encryption (PKE).
The components to this programming project are:
A. Chit Chat Client:
Provides a user interface that implements secure communication with other Chit users through TCP sockets.
Performs chat message encryption and decryption using RSA PKE.
B. Public Key Server:
Manages users' public-key.
Communicates with Chit clients through UDP sockets.
C. Address Server:
Maintains the listening addresses of Chit users who are currently logged-in.
Communicates with Chit clients through UDP sockets.
Description:
Secure communication requires a Chit client to encrypt a message using the recipient user's public key. Therefore, a user must register their public key with the Public Key server before sending a login message to the Address server.
In order to allow any two client processes to communicate with each other, the initiating client must have the "listening" TCP port number (and IP address) that the other client is using for receiving messages.
During login, the client process should send a message to the Address server containing the user's userid and the TCP port number it will be listening on. The Address server should store this information for each logged in user. A user could then determine who are currently logged in by having the client process send a who query to the Address server. The server should then respond with the corresponding list of userids from users who have sent a login message. A user then has the option to initiate a Chit chat session with another user or wait for a request to chat from another user. A chat request should be performed by first sending an "address lookup" message for a particular userid to the server. The server then responds with the corresponding address information (IP address and TCP port number), which the initiating client could then use to setup a direct TCP connection with the other client. The receiving user should be given the option to accept or decline the request to chat. If the chat request was accepted, the two users should be able to chat directly by sending their messages over a TCP connection.
Before messages can be exchanged, each user must send a request for the recipient user's key from the Public Key server. All messages should be encrypted before transmission during a chat session.
You only need to implement a one-to-one chat session for this programming project, i.e., the user need not be able to receive another chat request while participating in a "chat" session. Either user can terminate the chat session by sending an end-of-file character or CTRL-D. Each client should be able to send or receive another chat request after each session without terminating the process. Each client should also send a logout message to the server before exiting to allow the server to clear any entries corresponding to the user. Messages between client and server should be implemented using only UDP sockets.