NM / SecOps

Project case record

Real-Time LAN Messaging System

PythonPyQt5Async SocketsBinary ProtocolsCryptographySQLite
Real-Time LAN Messaging System

A high-performance desktop messaging application built on custom async socket architecture for low-latency group communication.

The Problem

Enterprise environments require internal communication systems with sub-10ms latency that operate without external dependencies. HTTP-based messaging platforms introduce unnecessary overhead and can't guarantee message ordering in high-frequency scenarios. Building a custom protocol requires solving complex concurrency challenges while maintaining reliability guarantees.

Engineering Approach

I engineered a native desktop application using Python and PyQt5 with a custom asynchronous socket server handling full-duplex TCP communication. The core challenge was implementing a non-blocking event loop that manages concurrent client connections while maintaining message ordering and delivery guarantees. I designed a binary protocol with message framing and implemented RSA/AES hybrid encryption for end-to-end security. The authentication system uses TOTP (RFC 6238) with QR code generation for seamless 2FA enrollment.

Architecture & Solution

The system operates as a lightweight client-server architecture optimized for LAN performance. The async socket server uses Python's asyncio with custom protocol handlers, achieving message propagation under 5ms within the local network. The desktop client implements a reactive UI pattern with PyQt5 signals/slots for smooth message rendering. Message history is persisted through SQLite with full-text search capabilities.

Operational Results

Delivered a production-grade messaging platform handling 50+ concurrent users with zero message loss. The custom protocol reduced latency by 70% compared to WebSocket-based alternatives. Successfully implemented complex networking patterns including connection pooling, automatic reconnection with exponential backoff, and graceful degradation under network partitions.

Gallery

Signup page with QRCode generated
Signup page with QRCode generated
Enforcing of authentication principles
Enforcing of authentication principles
Login page with fields filled
Login page with fields filled
Transcript of messages exchanged between two users
Transcript of messages exchanged between two users
Messages sent history for a specific user
Messages sent history for a specific user
Message serverside code showing key exchange and establishment of a secure connection
Message serverside code showing key exchange and establishment of a secure connection
Pip
Pip // SecOps Guide
Online
Pip
Hi — I'm Pip, Naftal's security portfolio guide. Ask about his SIEM & IAM work, infrastructure hardening, projects, or how to get in touch.
Cookies & Privacy //We use cookies to remember your theme preference and ensure the best experience on this website.