Secure communication is essential in modern networked systems. FortiChat is a terminal-based encrypted messaging system in C++.
It supports multiple clients connecting to a TCP server and features:
- Encrypted client–server messaging
- Multi-client support with threads
- Secure user authentication
- Admin moderation: ban, kick, restrict
- Violation tracking & IP-based blocking
- Streak system & leaderboard
- Persistent logging of users, bans, and actions
- Language: C++
- Networking: Berkeley Sockets (TCP)
- Cryptography: OpenSSL (SHA-256, AES-256, 3DES)
- Concurrency: POSIX Threads
- Platform: Linux / WSL
FortiChat/
│── src/
│ ├── server.cpp
│ └── client.cpp
│── README.md
│── .gitignore
g++ src/server.cpp -o server -lssl -lcrypto -pthread
./server
g++ src/client.cpp -o client -lssl -lcrypto
./clientResponsibilities:
- Handle multiple clients concurrently
- Authentication & session management
- Admin moderation (ban, kick, restrict)
- Persistent storage for bans and logs
Admin Commands
users - List connected users
ban <user> - Ban a user
unban <user> - Remove ban
delete <user> - Delete account
kick <user> - Disconnect user
restricted - Show banned users
violations - Show violations
blocked - Show blocked IPs
logs - View logs
broadcast <m> - Message all users
status - Server status
help - Show commands
exit - Graceful shutdown
Responsibilities:
- Connect to server (
127.0.0.1:8080) - Handle secure authentication
- Send/receive encrypted messages
- Respond to server admin actions
Client Commands
help
broadcast <message>
private <message>
streak
leaderboard
rules
delete
exit
- Used for password hashing, identity verification, and data integrity
- Workflow:
Password → SHA-256 → Hash → Server Verification
- Encrypts messages, session tokens, and sensitive commands
- Modes: CBC or ECB
- Fast, secure, standard across OS
- Used if AES unavailable
- Pros: Simple, legacy compatibility
- Cons: Slower, lower security margin
admin_logs.txt– Admin actionsviolation_logs.txt– User violationsrestricted_users.txt– Persistent bansusers.txt– Credentials and streaks
- Secure socket programming
- Encryption and hashing techniques
- Multi-threaded network design
- Moderation and logging systems
- Security-aware C++ development
- Terminal-based interface
- No TLS (custom encryption layer)
- File-based storage only
- Session keys stored in memory
- For educational and experimental purposes only
- Controlled environment testing
- Misuse for unauthorized access is prohibited
Name: Mohid Umer
Email: mohidumer112@gmail.com
FortiChat is a learning project for Linux based network programming and secure encryption solution. Feedback and collaboration are welcome.