A secure IRC (Internet Relay Chat) client/server system with advanced security features.
- Secure Communication: RSA/AES-256 hybrid encryption for all data transmission
- Strong Authentication: SHA-256 password hashing with salts
- Anti-Abuse System: IP tracking and anomaly detection (blocks after 3 IP changes)
- Admin Commands: Comprehensive administrator command system
- Decentralized Management: Channel owners and moderators with delegated permissions
- Intelligent Multithreading: Efficient worker pool implementation
- Multi-Language Support: Server in Golang, reference client in Java
OnyxIRC/
├── server/ # Golang server
│ ├── cmd/
│ │ └── server/ # Main entry point
│ ├── internal/ # Internal packages
│ │ ├── config/ # Configuration management
│ │ ├── database/ # Database layer
│ │ ├── models/ # Data models
│ │ ├── auth/ # Authentication & encryption
│ │ ├── security/ # IP tracking, session management
│ │ ├── server/ # TCP server implementation
│ │ ├── protocol/ # IRC protocol
│ │ ├── admin/ # Admin commands
│ │ └── threadpool/ # Worker pool
│ └── configs/ # Configuration files
├── client-java/ # Java client
│ └── src/main/java/com/onyxirc/client/
│ ├── network/ # Connection handling
│ ├── security/ # Encryption
│ ├── ui/ # User interface
│ ├── protocol/ # Protocol implementation
│ └── models/ # Data models
├── sql/ # Database schema
└── docs/ # Documentation
-
Password Security
- SHA-256 hashing with per-user random salts
- Minimum password length enforcement
- Optional special character requirements
-
Data Encryption
- RSA (2048/4096-bit) for initial key exchange
- AES-256-GCM for bulk data encryption
- Per-session symmetric keys
-
IP Tracking System
- Records all login attempts with IP addresses
- Compares current IP with last known IP
- Increments suspicion counter on mismatch
- Locks account when suspicion > 3
- Admin unlock capability
- users: User accounts and credentials
- user_ip_tracking: Login history with IP addresses
- user_security_status: IP suspicion tracking and account locks
- channels: Chat channels
- channel_members: Channel membership and roles
- messages: Encrypted message storage
- direct_messages: Private messages
- server_config: Server configuration
- admin_action_log: Audit log for admin actions
- user_bans: Ban management
- session_tokens: Session management
Server:
- Go 1.21 or higher
- MySQL 8.0 or higher
Client:
- Java 17 or higher
- Maven 3.8 or higher
-
Database Setup
mysql -u root -p < sql/schema.sql -
Server Setup
cd server go mod download go build -o server cmd/server/main.go ./server -config configs/server.yaml -
Client Setup
cd client-java mvn clean package java -jar target/onyxirc-client.jar
Edit server/configs/server.yaml:
- Server host/port settings
- Database connection details
- Security parameters (RSA/AES settings, IP tracking)
- Thread pool configuration
- Logging settings
Edit client-java/src/main/resources/client.properties:
- Server connection details
- Security settings
- Auto-reconnect behavior
- UI preferences
/register <username> <password> - Register new account
/login <username> <password> - Login to server
/join <channel> - Join a channel
/part <channel> - Leave a channel
/msg <user> <message> - Send private message
/quit - Disconnect from server
/admin kick <username> - Kick user from server
/admin ban <username> <duration> - Ban user (duration in seconds, 0 = permanent)
/admin unban <username> - Remove ban
/admin unlock <username> - Reset IP suspicion counter
/admin makeadmin <username> - Grant admin privileges
/admin removeadmin <username> - Revoke admin privileges
/admin broadcast <message> - Send message to all users
/admin stats - Show server statistics
/admin shutdown - Graceful server shutdown
- Never commit private keys or certificates to version control
- Use environment variables for sensitive configuration
- Enable TLS/SSL in production
- Regularly update dependencies
- Implement rate limiting on authentication endpoints
- Monitor admin action logs for suspicious activity
- Regular security audits recommended
Server:
cd server
go test ./...Client:
cd client-java
mvn testServer:
cd server
go build -o server cmd/server/main.goClient:
cd client-java
mvn clean packageMIT
no one
For issues and questions, please open an issue on the project repository.