Skip to content

This program enables safe communication between hosts in a encrypted environment

License

Notifications You must be signed in to change notification settings

RicksThread/ChatProgram

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RelyConn chat program

Overview

This project is for learning purposes: its aim is to apply, from theory, remote communication through sockets, multithreading and encryption.

Technical overview

The program is a server-client distributed system where the server forwards the messages from the source client to the given client destination.

It uses C as a programming language, and posix's pthreads and mutexes for multithreading. For the communication between hosts it also uses posix's sockets. Lastly for the trasmission of packets it uses the TCP protocol for reliable messanging.

The encryption

The encryption system is an hybrid assymmetric-symmetric key algorithm; to be more specific it is an RSA-AES hybrid. It uses RSA encrpytion first communicate the symmetric key, and then it uses the key with the AES algorithm to encrpyt the actual messages between clients.

Platforms

The program is only tested to work on Ubuntu linux. Other systems need a configuration which has not been implemented yet.

Installation

Fork the repository; after that import the dependencies.

Dependencies

GNU-MP

A library for handling arbitrary arithmetic operations (I.E 1024 bit values or more (used mainly in RSA encryption)) to download the dependecy click here

if that doesn't work you can try to install it with this in CLI:

sudo apt-get install libgmp3-dev libgmp10

Usage

Once downloaded the executables are found in the "build" folder inside the respective client and server directories. When a client connects to the server the encryption system is initialized and immediatly after that a login procedure is required. This procedure asks for a username which will be used as an id on the server. The id is used then by the others to communicate with each other.

here's an image that takes as an example the login procedure. There are 2 clients (the two instances on the left) and 1 server (the process on the right) running in localhost.

Inizializzazione

The login accepts a username no shorter than 5 characters and no longer than 16 characters. If a username has already been taken a warning will be sent to the client to change the name.

In order to communicate with other users there is a pattern to respect:

username|message

where the username has to be a client present on the server.

Chatting

On the server there are several commands the administrator can invoke: kick and shut down

the commands follow the respective patterns:

server|kick:username:reason
server|end

Here is an example of the administrator kicking marco for bad behaviour.

From the server POV

kicking

From Marco's POV

kicking_clientPOV

Open source licensing info

LICENSE

About

This program enables safe communication between hosts in a encrypted environment

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published