ENCRYPTED CHAT PROGRAMThis system allows pairs of users or clients "connected" to a network to establish a communication session and interchange encrypted text messages between them.Every message sent to or received by a client is encrypted so anyone else who succeeds in intercepting the communication would not be able to understand the content of such message. to do so, the system implements a cryptography protocol called Key Exchange with Symmetry Cryptography.The Key Distribution Server (KDS) maintains a list of currently connected clients. It is responsible for the creation and distribution of the session keys the clients are going to use when they want to exchange messages.When client C1 wants to talk to client C2, the protocol's steps are as follows:. 1 C1 calls KDS and requests a session key to communicate with C2. 2. Kds Generates a Random Session Key. It: One In C1's Key and The Other In C2's Private Key. Kds sends the respective private keys to c1 and C2.3. C1 Decrypts Its Copy of The session key.4. C2 Decrypts Its Copy of the session key.5. Both c1 and c2 Use this session key to communicate securely.6. One of the clients ends the session.
Each user communicates with the KDS and other users through a graphical user interface (GUI) control panel.Every user can see what other users are currently connected. Each user can select another user to talk to. The user can accept or reject a request of communication. Once a communication session has been established, they can send and receive messages to each other. Each user can have multiple chat sessions. The user's GUI permits the management of the current sessions. Only one session can be used at a time for active Communication Between Users.There Are 3 State A Session Can Be in:
WAIT_REPLY, ACCEPT_REJECT and CHAT.The WAIT_REPLY state is when a user has initiated a session request and is waitingfor a reply from the requested user.The ACCEPT_REJECT state is when a user is the recipient of a request to establish a communication session. The user is only able to accept or reject the request.The CHAT state is when users write and exchanges messages with each other. in this state, the user is able to type in a text message, clear the text message and send the message. They are also able to end the session.Whenever a message is sent or received, the encrypted and decrypted versions of the message are displayed on the text display area of the GUI.The system has a control centre that is responsible for start-up of the client- server network and provides an interface for adding new clients to the network.When the system first starts up, the KDS is created.Each client is added by a user through the user interface of the control centre. Each client has their own private ke y, selected by the user.Encryption and Decryption AlgorithmsThe encryption and decryption algorithms used are based on the Single Columnar Transposition Cipher encryption technique.EncryptionThe cipher uses a key with one or more upper case letters of the English alphabet (eg VAMPIRES, AVIATOR, SECRET ). The message to be encrypted can contain any character of the ASCII code except the asterisk (*) which is used as part of the encryption algorithm.The characters of the message are arranged from left to right and top to bottom in a dimensional table WITH a NUMBER OF Column Equal to the Numr of Characters of The Key. Let's Suppose The Message To Be Encrypted IS:
THE MISSION HAS BEEN SUCCESSFUL, WE CAN MOVE ON NOW.AND The Key Icecream, THE TABLE SHOULD LOOK LIKE: THE M I S I O N H A S B E E N S U c c U L, W E C A N M o V e o N n o w. * * * *
As the characters of the message do not completely fill the table, the empty positions are filled with an asterisk (*). The encrypted message is created by reading the characters of each column top to bottom (the asterisks are not included in the encrypted message ). The Order in which the columns are read is defined by the ot in the alphabet. In The Example: Key: Icecrea Morder of Characters: 6 2 4 3 8 5 1 7'a 'Is The First In The Alphabet, The Second C Read from Left To Right, Third The Other C, Fourth The E, AND SO ON.
6 2 4 3 8 5 1 7
T H E M I S I O N H A S B E E N S U C C E S F u L, W E C A N M O V E O N o w. * * * * *
Now the Encrypted Message Can Be Read:
"SSULNNHOEEWOO NS E.nesevwiasuaotibc Mns C, MH FC"
DecryptionTo obtain the original message the totally opposite process is carried out. The first thing to be done is calculating the order in which columns are filled in the table and the number of rows the table has. Remember that there might be some empty spaces at the end that need to be filled with asterisks, this is done first. Then the table is populated with the characters of the encrypted message and then the original message is obtained by reading the message from left to right, top to bottom. The asterisks are not Read of course.
Limitations of the systemThe client-server communication uses "mock" networking for this assignment. The client (s) and server will be running on the same machine, hence no real networking is required between machines. In a true client-server situation, the client and server normally reside on different machines in a network, and would require a specialised networking layer.GUI DesignYou are expected to apply the design principles of clarity and consistency to the GUI. You are at liberty to design the aesthetic "look and feel" .