A secure messaging client that communicates over Tailscale, using the Bubble Tea TUI framework. This client is designed to work with the Padserve secure messaging server and provides a terminal-based user interface for sending and receiving encrypted messages.
- Features
- Prerequisites
- Installation
- Usage
- Commands
- Command History
- Key Shortcut Actions
- Encryption Details
- Project Structure
- Contributing
- License
- Acknowledgements
- Secure communication over Tailscale networks.
- End-to-end encryption using AES and OTP (XOR cipher).
- Terminal-based user interface built with Bubble Tea.
- Operator support with special commands.
- Message broadcasting to all connected clients.
- Cross-platform support across macOS, Linux, Windows, and (experimentally) FreeBSD.
Client Version | Server Version | Compatibility |
---|---|---|
0.1.1 | 0.1.x | ✅ |
- Go 1.23 or higher.
- Tailscale installed and connected.
- A Padserve secure messaging server set up on your Tailscale network.
- Tailscale network configured with the server and clients.
-
Clone the Repository
git clone https://github.com/tailsecurity/padclient.git cd padclient
-
Install Dependencies
Ensure you have the necessary Go packages installed:
go mod tidy
go run . <YourID> <TailscaleServer>
<YourID>
: A unique identifier for your client (e.g., your username).<TailscaleServer>
: The Tailscale IP address or hostname of the messaging server.
go run . Alice 100.101.102.103
Ensure you are connected to your Tailscale network before running the client:
tailscale up
Once connected, you can use the following commands within the client:
SEND <RecipientID|ALL> <Message>
: Send a message to a specific client or broadcast to all clients.HELP
: Display help information about available commands.LIST
: List all connected clients.SERVERHELP
: Display help information about the available server commands.EXIT
: Exit the client program.
If you are the server operator, you may have access to additional commands (consult the server documentation for details):
KICK <ClientID>
: Remove a client from the server.BAN <ClientID>
: Ban a client from the server.UNBAN <ClientID>
: Remove a ban on a client.LISTBANS
: List all banned clients.
The client application includes a command history feature that allows you to navigate through your previously entered commands, similar to a typical terminal experience. This feature enhances productivity by enabling you to quickly reuse or edit past commands without retyping them entirely.
- Navigate Backward in History:
- Up Arrow Key (
↑
): Press the Up arrow key to scroll backward through your command history. Each press will display the previous command in the input field.
- Up Arrow Key (
- Navigate Forward in History:
- Down Arrow Key (
↓
): After scrolling backward, you can press the Down arrow key to move forward through the history. This allows you to return to more recent commands or to an empty input field.
- Down Arrow Key (
- Once a previous command is displayed in the input field, you can edit it before executing.
- This is useful for sending similar messages or commands with slight modifications.
-
Type a command:
SEND ALL Hello, everyone!
-
Press
Enter
to execute. -
To resend the same message or modify it:
- Press the Up arrow key to retrieve the command.
- Edit the message if desired (e.g., change "Hello" to "Hi").
- Press
Enter
to send the modified command.
The client application supports several key shortcuts to improve navigation and efficiency. Below is a list of available key shortcuts and their actions.
- Up Arrow Key (
↑
):- Action: Navigate backward through the command history.
- Usage: Retrieve previous commands to reuse or edit them.
- Down Arrow Key (
↓
):- Action: Navigate forward through the command history.
- Usage: Move toward more recent commands or return to an empty input field.
- Scroll Up:
- Keys:
- Page Up (
PgUp
) - Control + U (
Ctrl+U
)
- Page Up (
- Action: Scroll up through the message history in the viewport.
- Usage: View earlier messages that have scrolled off the screen.
- Keys:
- Scroll Down:
- Keys:
- Page Down (
PgDn
) - Control + D (
Ctrl+D
)
- Page Down (
- Action: Scroll down through the message history.
- Usage: Return to more recent messages after scrolling up.
- Keys:
- Jump to Top:
- Key:
- Home
- Action: Jump to the very top of the message history.
- Usage: Quickly view the earliest messages in the session.
- Key:
- Jump to Bottom:
- Key:
- End
- Action: Jump to the bottom of the message history.
- Usage: Return to the most recent messages.
- Key:
- Submit Command:
- Key:
- Enter
- Action: Submit the command or message typed in the input field.
- Usage: Execute commands like
SEND
,HELP
, orEXIT
.
- Key:
- Exit Application:
- Keys:
- Control + C (
Ctrl+C
) - Escape (
Esc
)
- Control + C (
- Action: Exit the client application gracefully.
- Usage: Close the application when you are done or need to disconnect.
- Keys:
- Typing New Commands:
- When you start typing a new command (i.e., any printable character), the command history navigation resets. This means that pressing the Up arrow key will start from the most recent command again.
- Editing Input:
- Standard text editing keys work within the input field (e.g., Left/Right arrows to move the cursor, Backspace to delete characters).
-
Scrolling Messages:
- To read an earlier message:
- Press
Ctrl+U
orPage Up
to scroll up. - Continue pressing to scroll further back.
- Press
- To return to the latest messages:
- Press
Ctrl+D
orPage Down
to scroll down. - Press
End
to jump directly to the bottom.
- Press
- To read an earlier message:
-
Navigating Command History:
- After executing several commands:
- Press the Up arrow key to access the last command.
- Press Up again to go further back.
- Press Down to navigate forward in the history.
- Edit the retrieved command if needed before executing.
- After executing several commands:
- Broadcast Messages: Encrypted using AES with a shared secret derived from ECDH key exchange.
- Direct Messages: Encrypted using a One-Time Pad (OTP) generated for each message and XOR cipher.
- The client performs an ECDH key exchange with the server to establish a shared secret.
- The shared secret is hashed using SHA-256 to derive a symmetric key for AES encryption.
- AES Encryption: Used for broadcasting messages to all clients securely.
- OTP (XOR Cipher): Used for direct messages between two clients.
main.go
: Initializes the client and handles the main loop using Bubble Tea.client.go
: Manages client setup, registration, and key exchange with the server.encryption.go
: Contains encryption functions for AES and XOR ciphers.message_handler.go
: Reads and processes messages from the server.
Contributions are welcome! Please visit CONTRIBUTING.md for more information.
This project is licensed under the MIT License. See the LICENSE file for details.
- Bubble Tea for the TUI framework.
- Tailscale for the secure network overlay.
- tailutils for Tailscale utilities.