Introduction

InFoEnd is my first experiment with building a secure chatroom application in Go. The goal: create a real-time messaging system where messages are encrypted end-to-end, such that even the server cannot read them.

To make it feel like a proper client, not just a toy, I added a terminal UI using the tview library and relied on the WebSocket protocol for message transport. The result is a multi-room chat platform that demonstrates encryption, networking, and terminal UI in one place.

Architecture Overview

The system consists of two roles: Admin (server) and Clients.

Illustration images


Server (Admin)

Clients

This setup ensures that the server cannot read chatroom traffic. Only clients in the room share the AES key, and even if the server is compromised later, past messages remain secure.

Encryption Workflow

Key Setup

Message Flow

  1. Admin creates a room and generates an AES-256 key.
  2. Each client joins and shares its RSA public key with the server.
  3. The server encrypts the AES key with each client’s RSA public key and sends it to them.
  4. Once all clients in the room have received their encrypted copy, the server destroys its copy of the AES key.
  5. From then on, messages are encrypted with AES-GCM before being sent over WebSocket.
  6. Receiving clients decrypt with the same AES key.

AES-GCM was chosen because it supports variable-length messages and provides both confidentiality and integrity through authenticated encryption.

Terminal User Interface (tview)

Instead of plain stdin/stdout, the application uses tview (a higher-level library built on top of tcell) to create a split-screen terminal interface:

This makes the app feel like a true chat client, while remaining entirely terminal-based.

Chatrooms and Admin Workflow

What Worked Well

Limitations

Conclusion

InFoEnd is not production-ready, but it shows how Go, WebSockets, RSA/AES-GCM encryption, and a terminal UI can come together to form an end-to-end encrypted chatroom.

For me, it was both a learning exercise and a fun way to explore cryptography and networking.

👉 GitHub Repo



Comment


Not that much comments



Next