A secure group chat room with AES-256-CBC encryption supporting LAN and global connections
- 🔐 End-to-End Encryption with AES-256-CBC and PBKDF2
- 🌐 Local (LAN) and Global (Ngrok) connections
- 👥 Group chat with real-time online user count
- 🎨 Beautiful CLI interface
- 📊 Status bar showing IP, port, online count, and username
- 🚀 Runs on Linux, macOS, and WSL
- 🔌 Ngrok support for internet connections
- ⚡ Lightweight and fast - no database required
- Ruby version 2.5 or higher
- Ngrok (only for global connections)
- Operating System: Linux, macOS, or WSL on Windows
# Ubuntu/Debian
sudo apt update && sudo apt install ruby-full
# macOS
brew install ruby
# Windows (WSL)
wsl --install
sudo apt update && sudo apt install ruby-full# Download and install
wget https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-amd64.zip
unzip ngrok-stable-linux-amd64.zip
sudo mv ngrok /usr/local/bin/ngrok authtoken YOUR_TOKEN
git clone https://github.com/monji024/ghostchat.git
cd ghostchat
ruby ghostchat.rb
[1] Host - Local (LAN) ← Host on local network
[2] Join - Local (LAN) ← Connect to local network
[3] Host - Global (ngrok) ← Host globally
[4] Join - Global (ngrok) ← Connect globally
[5] Exit ← Exit
Usage Scenarios
-
Host:
-
Select option [1] Host - Local
-
Enter room password
-
Share your local IP with friends
-
-
Friends:
-
Select option [2] Join - Local
-
Enter host IP and password
-
Start chatting :)
-
-
Host:
-
Select option [3] Host - Global (ngrok)
-
Enter room password
-
Enter your Ngrok auth token
-
Share the public address (e.g., tcp://0.tcp.ngrok.io:12345) with friends
-
-
Friends:
-
Select option [4] Join - Global (ngrok)
-
Enter public address and password
-
Start chatting :)
-
-
🔒 Security
-
✅ AES-256-CBC encryption - Global standard
-
✅ PBKDF2 - Standard compliant
-
✅ End-to-End encryption - Messages only readable with password
-
✅ No message storage - Messages never saved to disk
-
✅ Password authentication - Only password holders can join
-
ghostchat/
├── ghostchat.rb # Main application file
├── README-fa.md # Persian documentation
├── README.md # English documentation
└── LICENSE # License
-
Core Components
-
Crypto - Encryption management
-
ChatServer - Chat server (connection management & message broadcasting)
-
ChatClient - Chat client (send and receive messages)
-
StatusBar - Status bar (display information)
-
NgrokManager - Ngrok tunnel management
-
Issue: require 'openssl' failed
# Ubuntu/Debian
sudo apt install libssl-dev
gem install opensslThe program automatically frees the port. If not:
# Linux/macOS
fuser -k 5550/tcp
# OR
lsof -ti :5550 | xargs kill -9** Make sure your terminal supports UTF-8: **
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8-
Issue: Ngrok connection not working
-
Make sure ngrok is installed: which ngrok
-
Set your auth token: ngrok authtoken YOUR_TOKEN
-
Check your internet connection
-
I'd be happy if you contribute to improving this project
MIT © monji