Skip to content

Chat room with secure login and possibility to "hardening" connection over TOR network.

License

Notifications You must be signed in to change notification settings

ScratchyCode/ChatRoom

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ChatRoom

This is an advanced Python-based chat room with secure login. The project is entirely based on the socket programming done using Python. The server is set to the listening mode, with a specific port number (asked at runtime). Client are made to connect to the server, prompted to enter a nickname and password. The messages are then broadcasted to all the connected clients.

First login will register nickname and password on the server.

It is also possible to ensure traffic by wrapping TCP packet into TOR full-encrypted connection, creating hidden service and using torsocks.

Introduction

Sockets

Sockets and the socket API are used to send messages across a network. They provide a form of inter-process communication (IPC). The network can be a logical, local network to the computer, or one that’s physically connected to an external network, with its own connections to other networks. The obvious example is the Internet, which you connect to via your ISP.


Image Credit:Real Python

TCP Socket

In the diagram below, given the sequence of socket API calls and data flow for TCP:

Usage in clearnet

  1. We will have to start our server first.
python3 server.py
  1. Run the client file, to start the conversation.
python3 client.py

3. enter a nickname, password and server address for start your chatting.

Chatting over deep web

  1. Install TOR typing (under Linux):
sudo apt install tor
  1. Create hidden service editing '/etc/tor/torrc' with:
HiddenServiceDir /var/lib/tor/ChatRoom/
HiddenServicePort 8080 127.0.0.1:8080
  1. Restart TOR:
$ systemctl restart tor
  1. Find onion address:
$ cat /var/lib/tor/ChatRoom/hostname
  1. Start server.py entering the port;

binding host = '127.0.0.1' by editing server code, we will receive only tor connections, being able to leave the ports of the firewall and the router closes.

  1. Then start client.py typing:
$ torsocks python3 client.py

and compile entries 'Host' and 'Port' with onion address and port (8080) used before in tor setup.

Example of TOR connection


Server-side:

Client-side:


About

Chat room with secure login and possibility to "hardening" connection over TOR network.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%