Security Architecture & Cryptography
MohaliChat was engineered from the ground up for environments where cellular towers, central backbones, or public internet networks are unavailable, untrusted, or compromised. This page outlines the cryptographic principles and architectural safeguards built into the app.
1. Hybrid Routing Architecture
Autonomous Dynamic Routing
The application continuously monitors interface status. If an active internet connection exists, messages are sent via secure cloud relays. If internet access is severed, the app seamlessly engages local Bluetooth Low Energy (BLE) and Wi-Fi Direct mesh routing without interrupting the user experience.
2. Offline Mesh Cryptography & Multi-Hop Safety
- Packet Envelopes: Mesh packets transmitted over radio frequencies are encapsulated in signed cryptographic envelopes.
- Intermediate Relay Blindness: Devices that forward packets acting as mesh nodes cannot inspect the plaintext payload or forge the sender identity. Only the intended destination holding the matching cryptographic keys can decipher the message.
- Replay Protection: Each packet carries a unique UUID and timestamp threshold (with deduplication caching) to prevent replay or spoofing attacks.
- Deterministic Collision Resolution: Low-level BLE connection conflicts are deterministically resolved via lexicographical key comparison, preventing radio deadlocks in dense crowds.
3. Voice & Video Calling Security (WebRTC)
- Media Stream Encryption: All audio and video streams utilize standard DTLS-SRTP (Datagram Transport Layer Security / Secure Real-time Transport Protocol). Media packets are encrypted directly on the phone before transmission over UDP.
- Direct P2P Handshake: Calls utilize Google STUN servers to punch holes through NAT firewalls, establishing direct phone-to-phone data sockets. Audio and video never transit intermediate media servers in P2P mode.
- Transient LiveKit Fallback: If direct P2P fails due to restrictive enterprise firewalls, packets are relayed through an encrypted session on our secure LiveKit media server. Call streams are processed purely in RAM and never written to storage.
4. On-Device Safety & Local ML Inference
Unlike conventional chat platforms that transmit user messages to cloud servers for content analysis, MohaliChat incorporates an embedded ONNX Runtime (v1.21.0) neural network engine:
- Text classification runs 100% on the device processor (NPU/CPU).
- Zero chat content leaves your phone for the purpose of machine learning classification.
- The binary libraries are built with strict 16 KB page alignment for Android 15 performance and memory integrity.
5. Profile Masking & Anti-Scraping
To prevent user email harvesting and automated stalking, email addresses are automatically masked across all public endpoints and UI components (e.g. jo***@domain.com). Raw emails are used strictly for cryptographic authentication tokens.
6. Vulnerability Reporting & Bug Bounty
We welcome security researchers and ethical hackers to review our application. If you discover a vulnerability or potential security flaw:
Please email our security desk at security@mohalichat.app. We request that you provide reasonable time to mitigate the issue prior to public disclosure.