/Python-Secure-Socket-Chat

AUTHOR: ALMODAD MUTINDA - MOI UNIVERSITY - Chat applications today are readily available and very useful in conversing with people that might be close by or far away. Internet chat services provide the convenience of conversing with people in real time. These services provide a host of possibilities for work, school, telecommunication, etc. Unfortunately, most of these widely available chat services do not provide adequate protection/privacy of what is being sent through the chat servers. The objective of this project is to build a secure, cross-platform socket based chat application utilizing Diffie-Hellman key exchange to send secure chat messages across the internet. This application uses the client-server architecture. This application was developed using Python programming language. The server was developed as a console based application while the client was developed as a both console and GUI based application. The server is implemented as a singleton class. The main server thread opens a server socket on the local inet address and a specified port. It then waits for clients to connect to it. When a client connects to the server, it creates a separate thread as well as a User object dedicated to that client. The server maintains a hash map of User objects associated with the clients connected to it hashed against the user name. The thread dedicated to the client opens a buffered stream to read input messages from the client and a print writer stream to send messages to the client. The Client is implemented using two threads, one for incoming messages and another for outgoing messages. The main thread opens the socket and connects to the server. It then opens an input buffered stream and print writer for incoming and outgoing messages respectively. A shared secret is important between two parties who may not have ever communicated previously, so that they can encrypt their communications. As such, Diffie-Hellman Key Exchange (DHKE) is used before any two clients can communicate.

Stargazers