This repository contains a basic implementation of Onion Routing, a technique for anonymous communication over a computer network. The project includes multiple Python scripts that simulate the core components of an onion routing system, including client, server, and relay functionalities.
- Client-Server Communication: Establishes secure communication channels between clients and servers.
- Encryption & Decryption: Utilizes cryptographic functions from the
cryptographylibrary to ensure data privacy and integrity. - Relay Servers: Implements multiple relay layers to anonymize the traffic origin.
- Modular Structure: The project is organized into distinct directories for better maintainability and scalability.
Onion-Routing/
├── README.md # Project documentation
├── requirements.txt # Python dependencies
├── .gitignore # Files and directories to ignore in version control
├── venv/ # Virtual environment (auto-generated)
├── src/ # Source code
│ ├── __init__.py # Marks this directory as a Python package
│ ├── client_server.py # Client-side application script
│ ├── crypt.py # Cryptographic functions for encryption/decryption
│ ├── directory.py # Directory server script
│ ├── logger.py # Logging utilities
│ ├── network.py # Networking utilities
│ ├── relay_server.py # Primary relay server script
│ ├── relay_server1.py # Additional relay server script
│ └── relay_server2.py # Additional relay server script
├── templates/ # HTML templates
│ └── response.html # Sample HTML response template
└── logs/ # Logs for the application
└── app.log # Example log file
- Python 3.8 or higher
- Pip for Python package management
- Clone the repository:
git clone https://github.com/AnasMohammad4321/Onion-Routing.git
- Navigate to the project directory:
cd Onion-Routing - Create and activate a virtual environment:
python3 -m venv venv source venv/bin/activate - Install the required packages:
pip install -r requirements.txt
To start the system, execute the following scripts in separate terminals:
- Run the directory server:
python3 src/directory.py
- Initialize the primary relay server:
python3 src/relay_server.py
- Start additional relay servers:
python3 src/relay_server1.py python3 src/relay_server2.py
- Launch the client application:
python3 src/client_server.py https://www.DUMMY.com
We welcome contributions from the community. If you'd like to contribute:
- Fork the repository.
- Create a new branch:
git checkout -b feature-branch
- Make your changes.
- Commit your changes:
git commit -am 'Add some feature' - Push to your branch:
git push origin feature-branch
- Open a pull request.
For queries, feel free to reach out:
- Email: [email protected]