Skip to content

Makkkiiii/Coursework2-Tele-ChatRoom

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

66 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿš€ TeleChat ๐Ÿ”’


๐ŸŒŸ Professional-Grade Secure Chat Application

TeleChat is an enterprise-level, TCP-based secure chat room application built with Python, featuring cutting-edge PyQt5 GUI, high-grade encryption, advanced cybersecurity features, intelligent file sharing, and real-time security monitoring. This application showcases advanced programming concepts including Object-Oriented Programming (OOP), Data Structures & Algorithms (DSA), and comprehensive cybersecurity implementation.

Python PyQt5 Encryption Auth

f425c385-dca5-4a4d-97f7-82d79f432a0e

Overview

Softwarica College of IT and E-Commerce

"Coursework 2"

Programming and Algorithm 2 (Python) - Lecturer: Suman Shrestha

Telechat - 26th June (3rd Semester)

โšก Quick Start - Verify Security Works

๐Ÿ” Complete security verification:

cd Main-PyQT-GUI
python comprehensive_security_test.py

๐Ÿ–ฅ๏ธ Start the secure server:

cd Main-PyQT-GUI
python Main_Server.py

๐Ÿ’ป Start the client:

cd Main-PyQT-GUI
python Main_Client.py

๐ŸŽฏ What you'll experience:

๐Ÿ”
Password Protection
Server authentication challenges
๐Ÿ›ก๏ธ
Real-time Security
Live threat detection
๐Ÿšซ
XSS Blocking
Dangerous content warnings
๐Ÿ“Š
Rate Limiting
Spam & DoS protection
๐Ÿ”
File Security
Malware detection
๐Ÿ“‹
Audit Logging
Security event tracking
โš ๏ธ
Live Alerts
Security notifications
๐Ÿ‘ฎ
Admin Controls
User management
๐Ÿ’Ž
Modern UI
Professional interface

๐Ÿš€ Features

๐Ÿ›ก๏ธ Security Features

๐Ÿ” Advanced Authentication & Access Control
  • ๐Ÿ” Password Authentication: Military-grade server access with brute-force protection
  • ๐Ÿ›ก๏ธ Session Management: Secure session handling with intelligent timeout protection
  • ๐Ÿšซ Brute-force Protection: Smart rate limiting on authentication attempts
  • ๐Ÿ“Š Session Tracking: Real-time monitoring of user sessions and activities
๐Ÿ›ก๏ธ Real-time Threat Detection & Prevention
  • ๐Ÿšจ XSS Detection: Advanced real-time blocking of malicious script injections
  • ๐Ÿ” Content Filtering: Intelligent detection of dangerous content patterns
  • โšก Live Monitoring: Instant threat detection with immediate response
  • ๐Ÿ“‹ Threat Intelligence: Comprehensive analysis of security threats
๐Ÿ“Š Intelligent Rate Limiting & DoS Protection
  • ๐ŸŽฏ Smart Filtering: Multi-tier rate limiting (5 msg/min, 3 auth/min, 10 conn/min)
  • ๐Ÿšซ DoS Prevention: Advanced protection against denial of service attacks
  • โš–๏ธ Load Balancing: Intelligent message throttling and queue management
  • ๐Ÿ“‹ Analytics: Real-time monitoring of usage patterns and anomalies
๐Ÿ” Advanced File Security & Malware Detection
  • ๐Ÿฆ  Malware Scanning: Advanced file content analysis and threat detection
  • ๐Ÿ” Size Validation: Intelligent file size limits with security considerations
  • ๐Ÿ” Type Validation: Comprehensive file type analysis and filtering
  • โœ… Transfer Confirmation: Explicit success/failure notifications with detailed feedback

๐Ÿ’ป Core Functionality

๐ŸŒ Network ๐ŸŽจ Interface ๐Ÿ” Security ๐Ÿ“ File System
Multi-client TCP server Modern PyQt5 GUI AES-256 encryption Intelligent file sharing
Concurrent connections Professional dark theme PBKDF2 key derivation Malware detection
Authentication handling Responsive design Message validation Size validation
Thread-safe operations Real-time updates Security monitoring Auto-download system

โš™๏ธ Advanced Technical Features

graph TB
    A[๐Ÿ”’ Security Dashboard] --> B[๐Ÿ” Real-time Monitoring]
    A --> C[๐Ÿ“Š Multi-tier Rate Limiting]
    A --> D[๐Ÿ›ก๏ธ Session Management]

    B --> E[โš ๏ธ Threat Detection]
    B --> F[๐Ÿ“‹ Security Events]

    C --> G[๐Ÿ’ฌ Message Limits]
    C --> H[๐Ÿ”‘ Auth Limits]
    C --> I[๐ŸŒ Connection Limits]

    D --> J[โœ… File Validation]
    D --> K[๐Ÿ”„ Thread-safe Ops]
    D --> L[๐ŸŽจ Modern UI]
Loading
  • ๐Ÿ–ฅ๏ธ Security Dashboard: Real-time monitoring of connections, threats, and security events
  • ๐Ÿ“Š Multi-tier Rate Limiting: Intelligent limits for messages, authentication, and connections
  • ๐Ÿ” Session Management: Advanced session handling with timeout protection
  • โœ… File Transfer Validation: Server-side acceptance/rejection with detailed client feedback
  • ๐Ÿ”„ Thread-safe Operations: Bulletproof concurrent access protection
  • ๐ŸŽฏ Error Handling: Comprehensive error management with graceful degradation
  • ๐Ÿ’Ž Modern UI Design: Professional interface with security-focused color coding

๐Ÿ—๏ธ Technical Implementation

๐Ÿง  Object-Oriented Programming (OOP)

Advanced modular design with inheritance, encapsulation, and polymorphism

๐Ÿ“Š Data Structures & Algorithms

๐Ÿ” Click to view detailed implementation
  • ๐Ÿ”„ Multi-tier Rate Limiting: Separate FIFO queues for different operation types
  • ๐Ÿ—‚๏ธ User Management: Thread-safe HashMaps for efficient user lookup and session management
  • ๐Ÿ” Security Events: Ordered lists with efficient searching and filtering algorithms
  • ๐Ÿ”‘ Authentication Tracking: Binary search trees for lightning-fast session validation
  • โšก Thread-safe Collections: Advanced concurrent access protection with proper synchronization
  • ๐Ÿ“ File Transfer Tracking: Dictionary-based tracking of transfer states and confirmations

๐ŸŽฏ Design Patterns

  • ๐Ÿ‘๏ธ Observer Pattern: Real-time security monitoring and event handling
  • ๐Ÿญ Factory Pattern: Dynamic message creation and processing
  • ๐ŸŽฏ Singleton Pattern: Centralized security manager for system-wide protection

๐Ÿ” Security Stack

Layer Technology Purpose
๐Ÿ”’ Encryption AES-256 with Fernet Military-grade message protection
๐Ÿ”‘ Key Derivation PBKDF2-HMAC-SHA256 (100k iterations) Quantum-resistant key generation
๐Ÿ›ก๏ธ Threat Detection Advanced regex + ML patterns XSS, injection, malware detection
๐Ÿ” Authentication Password + session management Multi-factor access control
๐ŸŒ Network Security Rate limiting + protocol filtering DoS protection + traffic analysis

๐Ÿ“‹ Requirements & Installation

๐Ÿ–ฅ๏ธ System Requirements

Component Requirement Status
๐Ÿ Python 3.12+ Python
๐Ÿ’ป OS Windows/Linux/MacOS OS
๐Ÿง  RAM 4GB minimum RAM
๐ŸŒ Network TCP connectivity Network

๐Ÿ“ฆ Python Dependencies

# ๐ŸŽจ GUI Framework
PyQt5>=5.15.0

# ๐Ÿ–ผ๏ธ Image Processing
pillow>=9.0.0

# ๐Ÿ” Cryptography
cryptography>=3.4.8

# ๐ŸŒ Built-in Modules
socket threading json

๐Ÿ› ๏ธ Installation

๐Ÿ“ฅ Step 1: Clone Repository

git clone https://github.com/Makkkiiii/Coursework2-Tele-ChatRoom.git
cd Tele-ChatRoom

๐Ÿ”ง Step 2: Install Dependencies

pip install PyQt5 pillow cryptography

โœ… Step 3: Verify Installation

cd Main-PyQT-GUI
python comprehensive_security_test.py

โœจ If you see green checkmarks, you're ready to go! โœจ

๐Ÿš€ Quick Start Guide

๐ŸŽฏ Method 1: Run Applications (Recommended)

๐Ÿ–ฅ๏ธ Server Setup

cd Main-PyQT-GUI
python Main_Server.py

๐Ÿ’ป Client Connection

cd Main-PyQT-GUI
python Main_Client.py

๐ŸŽ‰ Launch both in separate terminals for the full experience! ๐ŸŽ‰

๐Ÿ” Method 2: Security Verification

๐Ÿ›ก๏ธ Complete Security Testing Suite
cd Main-PyQT-GUI
python comprehensive_security_test.py

This will test:

  • โœ… Password authentication systems
  • โœ… XSS detection and blocking
  • โœ… Rate limiting effectiveness
  • โœ… File malware detection
  • โœ… Encryption/decryption integrity
  • โœ… Session management security
๐ŸŽฎ Legacy Demo & Testing
cd Tests
python demo_usage.py

For legacy compatibility and testing:

  • ๐Ÿ”„ Basic functionality verification
  • ๐Ÿ“Š Performance benchmarking
  • ๐Ÿงช Unit test execution

๐Ÿ“– Usage Guide

๐Ÿ–ฅ๏ธ Server Administration

๐Ÿ›ก๏ธ Security Control Center

๐Ÿš€ Server Startup

  1. Configure host/port
  2. Set server password
  3. Click "Start Server"

๐Ÿ” Password Protection

  • Server authentication required
  • Brute-force protection active
  • Session timeout management

๐Ÿ“Š Security Dashboard

  • Real-time threat monitoring
  • Rate limiting statistics
  • Security event tracking

๐ŸŽฏ Advanced Admin Features

๐Ÿ‘ฅ User Management & Monitoring
  • ๐Ÿ“‹ Connected Users: View all active users with authentication status
  • โšก Real-time Actions: Kick problematic users with one-click
  • ๐Ÿ“Š Session Tracking: Monitor user activity and connection duration
  • ๐Ÿ” Behavior Analysis: Track user patterns and security events
๐Ÿ’ฌ Message & Communication Control
  • ๐Ÿ” Message Monitoring: View all server communications with filtering
  • ๐Ÿ›ก๏ธ Security Filtering: Automatic XSS and malware detection
  • ๐Ÿ“‹ Audit Trail: Comprehensive logging of all security events
  • โš ๏ธ Threat Alerts: Real-time notifications of security incidents
๐Ÿšซ Rate Limiting & DoS Protection
  • ๐Ÿ“Š Smart Throttling: Automatic protection against spam attacks
  • โš–๏ธ Load Balancing: Intelligent message queue management
  • ๐ŸŽฏ Custom Limits: Configurable rate limits per operation type
  • ๐Ÿ“ˆ Usage Analytics: Real-time monitoring of system performance

๐Ÿ’ป Client Usage Experience

๐ŸŒŸ User Journey

flowchart LR
    A[๐Ÿ”— Connect] --> B[๐Ÿ”‘ Authenticate]
    B --> C[๐Ÿ’ฌ Chat Safely]
    C --> D[๐Ÿ“ Share Files]
    D --> E[โš ๏ธ Security Alerts]
    E --> C
Loading

๐Ÿ” Secure Connection Process

๐Ÿ”— Step 1: Connect

  • Enter server details
  • Provide username
  • Input server password

๐Ÿ”‘ Step 2: Authenticate

  • Complete password challenge
  • Establish secure session
  • Verify connection status

๐Ÿ’ฌ Step 3: Communicate

  • Send encrypted messages
  • Real-time XSS protection
  • Receive security feedback

๐Ÿ›ก๏ธ Security Features in Action

๐Ÿ” XSS Detection ๐Ÿ“Š Rate Limiting ๐Ÿ”’ File Security ๐Ÿ” Authentication
Dangerous content blocked Message throttling Malware detection Password protection
Real-time warnings Spam prevention Size validation Session management
Security notifications DoS protection Type filtering Access control

๐Ÿ“ Intelligent File Sharing System

๐Ÿ”’ Advanced Security File Transfer

๐Ÿ“‹ Feature ๐Ÿ“Š Specification ๐Ÿ›ก๏ธ Security Level
Supported Types PNG, JPG, GIF, PDF, TXT, ZIP โœ… Type Validation
Size Limit 50MB with server validation ๐Ÿ” Size Monitoring
Security Scanning Advanced malware detection ๐Ÿ›ก๏ธ Threat Analysis
Storage received_files/ (client-only) ๐Ÿ”’ No Server Storage
Encryption AES-256 during transmission ๐Ÿ” Military Grade
Feedback Success/failure notifications โœ… Real-time Status

๐Ÿ—๏ธ Relay-Based Architecture

sequenceDiagram
    participant C1 as ๐Ÿ‘ค Client (Sender)
    participant S as ๐Ÿ–ฅ๏ธ Secure Server
    participant C2 as ๐Ÿ‘ฅ Other Clients

    C1->>S: ๐Ÿ“ Send Encrypted File
    S->>S: ๐Ÿ” Malware Scan
    S->>S: ๐Ÿ“ Size Validation
    S->>S: ๐Ÿ›ก๏ธ Type Check

    alt โœ… File Approved
        S->>C1: โœ… Transfer Success
        S->>C2: ๐Ÿ“ Relay to Others
        C2->>C2: ๐Ÿ’พ Auto-save to folder
    else โŒ File Rejected
        S->>C1: โš ๏ธ Security Warning
        S->>S: ๐Ÿ“‹ Log Security Event
    end
Loading

๐Ÿ”„ How It Works

๐Ÿ“ค Client Side (Sender)
  1. ๐Ÿ“ File Selection: User selects file via intuitive GUI
  2. ๐Ÿ” Encryption: File encoded to base64 and encrypted with AES-256
  3. ๐Ÿ“ก Transmission: Secure data sent to server with metadata
  4. โœ… Confirmation: Wait for explicit server success/failure response
๐Ÿ–ฅ๏ธ Server Side (Security & Relay)
  1. ๐Ÿ” Security Validation: File size and type verification
  2. ๐Ÿฆ  Malware Detection: Advanced content and metadata scanning
  3. ๐Ÿ“Š Response Generation: Explicit success/failure notification to sender
  4. ๐Ÿ”„ Relay Operation: Immediate forwarding of approved files to all clients
  5. ๐Ÿ—‘๏ธ No Storage: Server never stores files locally (relay-only architecture)
๐Ÿ“ฅ Client Side (Receivers)
  1. ๐Ÿ“ก File Reception: Receive file data only if server-approved
  2. ๐Ÿ’พ Auto-save: Decode and save to received_files/ folder
  3. โš ๏ธ Security Notifications: Receive alerts if files are blocked
  4. ๐Ÿ” Validation: Each client performs additional security validation

โœจ Benefits of Our Architecture

๐Ÿ›ก๏ธ Security โšก Performance ๐ŸŽฏ User Experience
Server never stores files Constant memory usage Clear success/failure feedback
Advanced malware detection Reduced attack surface Real-time security notifications
File validation layers Scalable architecture Automatic file organization
Comprehensive audit logging No cleanup required Professional UI feedback
- Only validation, security scanning, and relay - no persistent storage
  1. Client Side (Receivers):
    • Clients receive the file data from server (only if approved)
    • Clients decode and save file to received_files/ folder
    • Receive security notifications if files are blocked
    • Each client manages their own file storage with validation

Benefits of Relay Architecture

  • Privacy: Server never stores user files
  • Security: Advanced malware detection and file validation
  • Storage Efficiency: Server doesn't need file storage space
  • Attack Surface: Reduces security risks on server
  • Scalability: Server memory usage remains constant
  • Simplicity: No file cleanup or management needed on server
  • User Feedback: Clear success/failure notifications for all file operations

๐Ÿ—๏ธ Architecture

Network Protocol

Message Format

{
    "type": "message_type",
    "data": {
        "id": "message_id",
        "sender": "username",
        "content": "message_content",
        "type": "text|file|system",
        "file_data": {...},
        "timestamp": "ISO_timestamp"
    }
}

Message Types

  • text: Regular chat message (subject to XSS detection)
  • file: File sharing message (subject to malware detection)
  • system: Server notifications and security alerts
  • error: Error messages and warnings
  • server_message: Server announcements
  • warning: Security warnings (XSS/malware detection)
  • file_success: File transfer confirmation messages
  • auth_challenge: Password authentication requests
  • auth_response: Authentication responses

Data Structures Used

  1. Rate Limiting Queues: Multi-tier FIFO queues for different operation types (messages, auth, connections)
  2. User Management Dictionary: Thread-safe HashMap for user lookup and session management
  3. Security Event Lists: Ordered message history with efficient searching and filtering
  4. Authentication Tracking: Binary search trees for efficient session validation
  5. Thread-safe Collections: Concurrent access protection with proper synchronization
  6. File Transfer Tracking: Dictionary-based tracking of file transfer states and confirmations

๐Ÿงช Testing

Run the comprehensive security test suite:

cd Main-PyQT-GUI
python comprehensive_security_test.py

Quick Verification Tools

Complete Security Verification:

cd Main-PyQT-GUI
python comprehensive_security_test.py

Legacy Test Suite:

cd Tests
python Main_Test.py

Test Coverage

  • โœ… Password authentication and session management
  • โœ… XSS detection and dangerous message blocking
  • โœ… Rate limiting and DoS protection
  • โœ… Malicious file detection and blocking
  • โœ… Encryption/Decryption functionality
  • โœ… Message serialization/deserialization
  • โœ… Thread-safe queue operations
  • โœ… User management and kick functionality
  • โœ… File encoding/decoding with security validation
  • โœ… Security event logging and audit trails
  • โœ… Error handling scenarios

๐Ÿ”ง Configuration

Server Configuration

  • Default Host: localhost
  • Default Port: 12345
  • Max Connections: 5 (configurable)
  • Message Buffer: 4096 bytes

Security Settings

  • Password Protection: Server requires password authentication (configurable)
  • Encryption: AES-256 with Fernet implementation
  • Key Derivation: PBKDF2-HMAC-SHA256 with 100,000 iterations
  • Rate Limiting: Configurable limits for messages (5/min), auth (3/min), connections (10/min)
  • XSS Detection: Advanced regex patterns for dangerous content detection
  • File Security: Malware detection, size limits (50MB), type validation
  • Session Management: Secure session handling with timeout protection
  • Audit Logging: Comprehensive security event logging with timestamps

File Sharing Limits

  • Max File Size: 50MB with server-side validation
  • Supported Types: All file types with security scanning
  • Storage Location: received_files/ (client-side only)
  • Security Scanning: Advanced malware detection and validation
  • Transfer Confirmation: Explicit success/failure notifications

๐Ÿ”’ Security Features

  1. Password Authentication: Server requires password for access with brute-force protection
  2. Advanced Threat Detection: Real-time XSS, injection, and malicious content blocking
  3. Smart Rate Limiting: Prevents spam and DoS attacks with intelligent message filtering
  4. Malicious File Detection: Advanced file scanning with size and type validation
  5. Security Audit Logging: Comprehensive logging of all security events and threats
  6. Real-time Security Alerts: Live monitoring with instant threat notifications
  7. Input Validation: Complete sanitization of all user inputs and data
  8. Admin Controls: Server administrator can kick users and monitor all activities
  9. Session Management: Secure session handling with timeout protection
  10. End-to-End Encryption: All messages encrypted with AES-256

๐Ÿ›ก๏ธ Error Handling

  • Authentication Failures: Clear feedback for incorrect passwords
  • Security Violations: Immediate warnings for XSS/malicious content
  • File Rejection: Detailed notifications for blocked files
  • Rate Limiting: Clear messages when limits are exceeded
  • Invalid Messages: Graceful error display with security logging
  • File Errors: Size/type validation with user feedback and server notifications
  • Encryption Errors: Secure fallback handling with audit logging
  • Network Issues: Timeout handling and user notification with reconnection support

๐Ÿงฉ Project Structure

The project is organized into logical folders to make navigation easier:

๐Ÿ“ ProgrammingAlgo2/
โ”œโ”€โ”€ ๐Ÿ“ Main-PyQT-GUI/                 # Core PyQt Application Files
โ”‚   โ”œโ”€โ”€ Main_Client.py               # ๐Ÿ–ฅ๏ธ Main PyQt5 Client Application with Security
โ”‚   โ”œโ”€โ”€ Main_Server.py              # ๐Ÿ”’ Advanced Secure Server with Admin GUI
โ”‚   โ”œโ”€โ”€ core.py                     # ๐Ÿ—๏ธ Core classes (Message, User, Security)
โ”‚   โ”œโ”€โ”€ security.py                 # ๐Ÿ›ก๏ธ Enterprise security features
โ”‚   โ”œโ”€โ”€ launcher.py                 # ๐Ÿš€ Application launcher
โ”‚   โ”œโ”€โ”€ comprehensive_security_test.py # ๐Ÿงช Complete security test suite
โ”‚   โ””โ”€โ”€ received_files/             # ๐Ÿ“ฅ Client downloaded files
โ”‚
โ”œโ”€โ”€ ๐Ÿ“ Main-Tkinter-GUI/             # Legacy Tkinter Implementation
โ”‚   โ”œโ”€โ”€ Main_Client.py              # ๐Ÿ–ฅ๏ธ Tkinter Client (Legacy)
โ”‚   โ”œโ”€โ”€ Main_Server.py              # ๐Ÿ”’ Tkinter Server (Legacy)
โ”‚   โ”œโ”€โ”€ core.py                     # ๐Ÿ—๏ธ Core classes for Tkinter
โ”‚   โ”œโ”€โ”€ security.py                 # ๐Ÿ›ก๏ธ Security features for Tkinter
โ”‚   โ””โ”€โ”€ received_files/             # ๐Ÿ“ฅ Client downloaded files
โ”‚
โ”œโ”€โ”€ ๐Ÿ“ Tests/                       # Testing & Verification Tools
โ”‚   โ”œโ”€โ”€ Main_Test.py                # ๐Ÿงช Legacy test suite
โ”‚   โ”œโ”€โ”€ verify_encryption.py        # โœ… Encryption verification
โ”‚   โ”œโ”€โ”€ demo_usage.py               # ๐ŸŽฎ Usage demonstration
โ”‚   โ”œโ”€โ”€ chat_core.py                # ๐Ÿ—๏ธ Core classes for testing
โ”‚   โ”œโ”€โ”€ advanced_security_fixed.py  # ๐Ÿ›ก๏ธ Security features for testing
โ”‚   โ””โ”€โ”€ debug_client.py             # ๐Ÿชฒ Debug client for testing
โ”‚
โ”œโ”€โ”€ ๐Ÿ“ Read/                        # Documentation & Guides
โ”‚   โ”œโ”€โ”€ SECURITY_FEATURES.md        # ๐Ÿ” Detailed security documentation
โ”‚   โ””โ”€โ”€ ENCRYPTION_VERIFICATION.md  # ๐Ÿ” How to verify encryption works
โ”‚
โ”œโ”€โ”€ ๐Ÿ“ received_files/              # ๐Ÿ“ฅ Global file storage
โ”œโ”€โ”€ requirements.txt                # ๐Ÿ“ฆ Python dependencies
โ””โ”€โ”€ README.md                      # ๐Ÿ“– This documentation

๐Ÿ“‹ Folder Guide

๐Ÿ“ Main-PyQT-GUI/ - PRIMARY APPLICATION (Start Here)

What it contains: The main PyQt5 applications with full security features

  • Main_Server.py - Advanced server with admin GUI, security monitoring, password protection, and user management
  • Main_Client.py - Modern PyQt5 client with security features, file sharing, and threat detection
  • core.py - Core classes (Message, User, SecurityManager, FileManager) with advanced features
  • security.py - Enterprise-grade security (encryption, rate limiting, XSS detection, malware scanning)
  • launcher.py - Application launcher for easy startup
  • comprehensive_security_test.py - Complete security verification suite

How to use:

  1. First run python Main_Server.py
  2. Then run python Main_Client.py (can run multiple instances)
  3. Use python comprehensive_security_test.py to verify all security features

๐Ÿ“ Main-Tkinter-GUI/ - Legacy Implementation

What it contains: Legacy Tkinter version (for compatibility)

  • Similar structure but with Tkinter GUI instead of PyQt5
  • Basic security features without advanced monitoring

๐Ÿ“ Tests/ - Verification & Testing

What it contains: Tools to test and verify everything works

  • Main_Test.py - Legacy test suite
  • verify_encryption.py - Encryption verification
  • demo_usage.py - Usage demonstration examples
  • chat_core.py - Core classes for testing
  • advanced_security_fixed.py - Security features for testing

How to use:

cd Tests
python Main_Test.py           # Legacy test suite
python verify_encryption.py  # Encryption verification
python demo_usage.py         # Usage demo

๐Ÿ“ Read/ - Documentation Hub

What it contains: Detailed documentation and guides

  • SECURITY_FEATURES.md - Complete security documentation
  • ENCRYPTION_VERIFICATION.md - Step-by-step encryption verification

How to use: Open these files to understand specific features in detail

๐Ÿ“ received_files/

What they contain: File storage for client downloads

  • received_files/ - Files downloaded by clients
  • Main-PyQT-GUI/received_files/ - PyQt client file storage
  • Main-Tkinter-GUI/received_files/ - Tkinter client file storage

How to use: These folders are automatically created and managed by the client applications. The server acts as a relay and does not store files.

๐ŸŽฏ Getting Started Guide

For First-Time Users

  1. ๐Ÿ“ฅ Install Dependencies:

    pip install PyQt5 pillow cryptography
  2. ๐Ÿš€ Quick Security Demo:

    cd Main-PyQT-GUI
    python comprehensive_security_test.py
  3. ๐Ÿ–ฅ๏ธ Run the PyQt Application:

    cd Main-PyQT-GUI
    python Main_Server.py    # Terminal 1
    python Main_Client.py    # Terminal 2 (new terminal)
  4. ๐Ÿ“š Read Documentation:

    • Open Read/SECURITY_FEATURES.md for security details
    • Open Read/ENCRYPTION_VERIFICATION.md for encryption verification

For Professors/Reviewers

  1. โœ… Complete Security Verification:

    cd Main-PyQT-GUI
    python comprehensive_security_test.py
  2. ๐ŸŽฎ Usage Demo:

    cd Tests
    python demo_usage.py
  3. ๐Ÿ“Š Legacy Test Suite:

    cd Tests
    python Main_Test.py
  4. ๐Ÿ–ฅ๏ธ Try the Application:

    cd Main-PyQT-GUI
    python Main_Server.py    # Start server with password protection
    python Main_Client.py    # Start client and test security features

๐Ÿš€ Advanced Usage

Multiple Clients with Security

  1. Start one server instance with password protection
  2. Run multiple client instances (each needs server password)
  3. Each client connects with unique username and authentication
  4. All clients can communicate simultaneously with security monitoring
  5. Server admin can monitor all connections and security events

Secure File Sharing Workflow

  1. Client selects file using "Share File" button
  2. File is encoded to base64 and encrypted with AES-256
  3. Server receives and performs security validation (malware detection, size limits)
  4. Server sends explicit success/failure notification to sender
  5. Server broadcasts approved files to all connected clients
  6. Clients automatically decode and save secure files
  7. All file transfers are logged for security audit

Server Administration & Security

  1. Monitor real-time connection status and authentication events
  2. View security dashboard with threat detection and rate limiting
  3. Review comprehensive security logs and audit trails
  4. Kick problematic users with one click
  5. Monitor XSS/malware detection events
  6. Graceful server shutdown with client notification

๐Ÿ› Troubleshooting

Common Issues

Authentication Failed

  • Ensure you have the correct server password
  • Check if server is configured with password protection
  • Verify server is running and accepting connections

Connection Refused

  • Ensure server is running first
  • Check host/port configuration
  • Verify firewall settings
  • Confirm server password is set correctly

Security Warnings

  • XSS/dangerous content warnings are normal security features
  • File blocking indicates malware detection is working
  • Rate limiting messages show DoS protection is active

Files Not Sharing

  • Check file size (max 50MB)
  • Ensure file passes malware detection
  • Verify network connectivity
  • Check server security logs for rejection reasons

GUI Not Responding

  • Close and restart application
  • Check system resources
  • Update Python and PyQt5 dependencies
  • Verify no conflicting processes

๐Ÿ“œ License

This project is created for educational purposes as part of the Programming & Algorithm 2 coursework. Feel free to use and modify for learning purposes.


Programming & Algorithm 2 - Enterprise Security Chat Application Built with Python โ€ข Featuring PyQt5 GUI, Enterprise Security, OOP, DSA, Encryption, and Advanced Cybersecurity

image

  • Download the zip file.
  • Unzip the zip file.
  • Run it on your machine.

2. FOR LINUX

image

Use Text Editor like:

  • Mousepad
  • Vim
  • Nano
  • Gedit

1. Clone the repository:

git clone https://github.com/Makkkiiii/Coursework2-Tele-ChatRoom.git

2. Compiling

You can just make the script executable by adding the following command

#!/usr/bin/env python

Give permissions

chmod +x Main_Server.py
chmod +x Main_Client.py

3. Launching the program:

cd Main-PyQT-GUI
python3 Main_Server.py
python3 Main_Client.py

Or for legacy Tkinter version:

cd Main-Tkinter-GUI
python3 Main_Server.py
python3 Main_Client.py

3. FOR MAC

image

It is similar to Linux and Windows.

You can use coding software, a terminal, or just clone it.

Use the desired text editor.

Steps

Follow the given instructions inside the program

Tools Used

image

This program was written in Python using Visual Studio Code.

What to Expect

  • ๐Ÿ” Password Protection: Server requires authentication for access
  • ๐Ÿ›ก๏ธ Security Monitoring: Real-time threat detection and prevention
  • ๐Ÿšซ XSS Protection: Dangerous messages are blocked with warnings
  • ๐Ÿ“Š Rate Limiting: Automatic spam and DoS protection
  • ๐Ÿ” File Security: Malware detection and validation
  • ๐Ÿ“‹ Audit Logging: Comprehensive security event tracking
  • ๐Ÿ’ป Modern GUI: Professional PyQt5 interface with dark theme
  • ๐Ÿ”’ Encrypted Data: All communications secured with AES-256
  • โš ๏ธ Security Alerts: Live notifications of security events

Screen Shots

Launcher

Launcher.py

Server

Password

alt text

Server UI

alt text

Client

alt text

About

Coursework 2 (3rd Semester)

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages