Skip to content

monji024/GhostChat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ghost Chat

English Persian

Ruby License Version

A secure group chat room with AES-256-CBC encryption supporting LAN and global connections

Features

  • 🔐 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

📋 Prerequisites

  • Ruby version 2.5 or higher
  • Ngrok (only for global connections)
  • Operating System: Linux, macOS, or WSL on Windows

Linux macOS WSL

Install Ruby

# 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

Install Ngrok

# 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/

Set your auth token

ngrok authtoken YOUR_TOKEN

Direct Download

git clone https://github.com/monji024/ghostchat.git
cd ghostchat
ruby ghostchat.rb

User Guide

Main Menu


[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

1️⃣ LAN Chat

  • 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 :)

2️⃣ Global Chat (via Internet)

  • 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

🛠 Technical Architecture

Project Structure


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

🐛 Troubleshooting

Issue: require 'openssl' failed

# Ubuntu/Debian
sudo apt install libssl-dev
gem install openssl

Issue: Port 5550 is in use

The program automatically frees the port. If not:

# Linux/macOS
fuser -k 5550/tcp
# OR
lsof -ti :5550 | xargs kill -9

Issue: Garbled/weird characters

** 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

🤝 Contributing

I'd be happy if you contribute to improving this project

Connect

  • GitHub: GitHub
  • Project: Repo

License

MIT © monji

About

GhostChat is my take on a secure group chat. No logs, no tracking—just you, your friends, and AES-256 encryption. Works over LAN or worldwide with Ngrok. Built with Ruby

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages