WHY2 Chat
Privacy-focused encrypted chat application powered by WHY2 encryption.
WHY2 Chat is a reference implementation demonstrating the WHY2 encryption system in a real-world application. It provides end-to-end encrypted text and voice communication with no metadata collection, no backdoors, and complete transparency.
Features
Security
- End-to-End Encryption: All messages encrypted with WHY2 before transmission
- Hybrid Key Exchange: ECC + ML-KEM post-quantum key encapsulation
- Forward Secrecy: Automatic rekeying invalidates old session keys
- Authenticated Encryption: HMAC-SHA256 ensures message integrity
- Sequence Numbers: Prevents replay and reordering attacks
- TOFU (Trust On First Use): Server public key verification
Communication
- Text Messaging: Real-time encrypted chat with message history
- Voice Channels: End-to-end encrypted voice communication
- Opus codec compression
- Noise reduction (nnnoiseless)
- Voice activity detection
- Audio normalization
- Private Messages: Direct user-to-user encrypted messaging
- Multi-Channel Support: Organize conversations into separate channels
Technical Highlights
- CTR Mode Encryption: Parallel message processing
- TCP + UDP: Reliable text (TCP), low-latency voice (UDP)
- Spam Protection: Rate limiting and packet validation
- Session Management: Automatic timeout and cleanup
- Cross-Platform: Linux, macOS, Windows support
Building from Source
Prerequisites
Linux
macOS
Windows
No additional dependencies required (uses Windows Audio APIs).
Compilation
Client (Default)
# Build client binary
# Binary location: ./target/release/why2
Server
# Build server binary (no client features)
# Binary location: ./target/release/why2-server
Features
client(default): Enables client functionality (TUI, audio I/O)server: Enables server functionality (multi-client handling, no UI)
Usage
Server Setup
-
Run the server:
-
Configuration (auto-generated on first run):
- Location:
~/.config/WHY2/server.toml - Important Settings:
server_ip: Bind address (default:0.0.0.0)port: Server port (default:1204)max_clients: Maximum concurrent connectionsallow_register: Enable/disable new user registrationenable_voice_chat: Enable/disable voice channels
- Location:
-
User Management:
- Users stored in:
~/.config/WHY2/server_users.toml - First connection creates account automatically (if registration enabled)
- Users stored in:
Client Setup
-
Run the client:
-
First-time setup:
- Enter server address (optionally followed by ':PORT')
- Create username and password
- Server public key verification (TOFU)
-
Configuration (auto-generated):
- Location:
~/.config/WHY2/client.toml - Important Settings:
auto_connect_addr: Default server addressdefault_port: Default server port- Display options (
show_id,disable_colors)
- Location:
Important Commands
| Command | Description |
|---|---|
/help |
Display available commands |
/list |
List all connected users |
/pm <user> <message> |
Send private message |
/channel <name> |
Switch to channel |
/voice |
Join voice channel |
/exit |
Disconnect and quit |
Network Architecture
Protocols
-
Text Communication: TCP (port 1204 by default)
- Key exchange (ECC + ML-KEM)
- Encrypted messaging
- Server commands
-
Voice Communication: UDP (same port as TCP)
- Encrypted Opus packets
- Low latency streaming
- Voice activity detection
- Noise reduction
Security Flow
-
Connection:
- Client ← Server: Public key (ECC + ML-KEM)
- Server ← Client: Public key (ECC + ML-KEM)
- Both derive shared secret via hybrid KDF
-
Authentication:
- Client ← Server: Challenge
- Server ← Client: Username + Argon2 hashed password
- Server validates credentials
-
Session:
- All messages encrypted with WHY2 (CTR mode)
- HMAC-SHA256 authentication
- Sequence numbers prevent replay
- Periodic rekeying (every 10 minutes)
Downloads
Prebuilt Binaries
Security Notice
WHY2 Chat is an experimental application built on the WHY2 encryption system, which has not undergone formal security audit.
Known Limitations:
- No perfect forward secrecy between rekeying intervals
- Trust On First Use: First connection to server is critical
- No message persistence: Messages not saved server-side
- Experimental crypto: WHY2 algorithm lacks peer review
Best Practices:
- Verify server keys: Always validate TOFU prompts
- Use strong passwords: Minimum 12 characters required
- Secure server: Run server on trusted infrastructure
- Regular updates: Keep software up-to-date
Technical Details
Dependencies
- Core Crypto:
why2(WHY2 encryption system) - Key Exchange:
r521(ECC),mk-kem(ML-KEM post-quantum) - Authentication:
hmac(HMAC-SHA256),argon2(password hashing) - Voice:
opus(audio codec),nnnoiseless(noise reduction) - Audio I/O:
cpal(cross-platform audio) - Networking:
socks5(SOCKS5 proxy support) - Serialization:
wincode(binary encoding) - UI:
crossterm(terminal interface)
Performance
- Encryption: ~200 MB/s (8×8 grids, single-threaded)
- Voice Latency: ~25ms (depends on network)
- Concurrent Users: Tested up to 100 simultaneous connections
- Message Throughput: Defaultly limited by spam protection
Platform Support
| Platform | Text Chat | Voice Chat | Notes |
|---|---|---|---|
| Linux | ✅ | ✅ | ALSA, PulseAudio, PipeWire |
| macOS | ✅ | ✅ | CoreAudio |
| Windows | ✅ | ✅ | WASAPI |
Contributing
See CONTRIBUTING in the repository root for contribution guidelines.
Getting Help
- Issues: GitLab Issues
- Discord: DM engo150
- Email: engo@satan.red
License
WHY2 Chat is licensed under the GNU GPLv3.
You are free to use, modify, and redistribute it under the terms of the license. See https://www.gnu.org/licenses/ for details.
Philosophy
WHY2 Chat embodies the principle that privacy is a fundamental right:
- No telemetry: Zero data collection
- No backdoors: All code is auditable
- No subscriptions: Free as in freedom
- No censorship: You control your server
- No trust required: Verify the code yourself