CLI client for the Confy encrypted communication system
Project description
Confy CLI
A command-line client for the Confy encrypted communication system.
A secure command-line interface for peer-to-peer encrypted messaging using the Confy communication system. This CLI enables users to establish encrypted connections with other peers, exchange cryptographic keys, and communicate with end-to-end encryption using industry-standard algorithms.
Learn more about the project at github.com/confy-security
Made with dedication by students from Brazil 🇧🇷.
⚡ Features
- End-to-End Encryption - Messages are encrypted using AES-256 in CFB mode
- Digital Signatures - Messages are signed using RSA with PSS padding for authenticity
- Secure Key Exchange - RSA-4096 key exchange with OAEP padding
- Interactive Terminal - User-friendly command-line interface using prompt-toolkit and Typer
- Debug Mode - Detailed logging for troubleshooting and development
- Cross-Platform - Works on Windows, macOS, and Linux
- WebSocket Support - Secure peer-to-peer communication over WebSocket (WSS)
⚙️ Requirements
- Python: 3.13 or higher
- OS: Windows, macOS, or Linux
📦 Installation
Install the CLI globally with your package manager of choice.
pipx install confy-cli
🐳 Using Docker
Alternatively, you can use the CLI via a Docker container:
docker run -it ghcr.io/confy-security/cli:latest
Once inside the container, you can use the CLI normally:
confy your-user-id recipient-user-id
To build the Docker image locally:
docker build -t confy-cli .
docker run -it confy-cli
🚀 Quick Start
Basic Usage
Start a secure conversation with another peer:
confy your-user-id recipient-user-id
When prompted, enter the server address:
Server address: wss://secure-server.example.com
[!TIP] To learn how to deploy your own self-hosted Confy server, see github.com/confy-security/server.
Interactive Commands
Once connected, you can:
- Send messages - Type your message and press Enter
- Receive messages - Messages from peers appear in real-time
- Exit - Type
exitto end the session
Example Session
$ confy alice bob
Server address: wss://secure-server.example.com
[SYSTEM] Waiting for recipient to connect...
[SYSTEM] The recipient is now connected.
> Hello Bob, this is Alice!
[RECEIVED] Hi Alice! I received your message.
> exit
🔒 Security Architecture
Key Exchange Process
- RSA Key Generation - Each client generates a 4096-bit RSA key pair
- Public Key Exchange - Public keys are exchanged securely over WebSocket
- AES Key Generation - A random 256-bit AES key is generated
- Encrypted Key Distribution - AES key is encrypted with peer's RSA public key
- Secure Communication - All messages are encrypted with the shared AES key and signed
Encryption Details
- Message Encryption - AES-256 in CFB mode
- Key Encryption - RSA-4096 with OAEP padding
- Signatures - RSA-4096 with PSS padding and SHA-256
- Cryptography Library - Uses the
cryptographylibrary (actively maintained)
📚 Environment Variables
Configure the CLI using environment variables:
# Enable debug mode
export DEBUG=true
# Or set it in .env file
DEBUG=false
Create a .env file in your project directory:
DEBUG=false
🔧 Configuration
Server Address Format
The server address can be specified as:
- Secure WebSocket -
wss://example.com(recommended) - WebSocket -
ws://example.com(use only for testing) - HTTPS -
https://example.com(automatically converts to WSS) - HTTP -
http://example.com(automatically converts to WS)
Connection History
The CLI stores your connection history in:
~/.confy_address_history
This allows you to quickly access previously used server addresses using arrow keys.
🛠️ Troubleshooting
Connection Issues
"Error connecting to server"
- Verify the server address is correct
- Ensure the server is running and accessible
- Check your network connectivity
- For WSS connections, verify the SSL certificate is valid
"Connection refused"
- Confirm the server is listening on the specified address and port
- Check if a firewall is blocking the connection
Message Issues
"AES key has not been established yet"
- Wait a moment for the key exchange to complete
- Ensure both peers are connected
- Check if the server is properly relaying messages
"Failed to encrypt/verify message"
- This indicates an issue with the encryption layer
- Try reconnecting to the server
- Check if both peers are running compatible CLI versions
Performance Issues
Slow response times
- Check your network latency to the server
- Consider using a server closer to your location
- Reduce the frequency of large messages
📖 Usage Guide
Connecting to a Server
confy alice bob
You'll be prompted to enter the server address. For the first time, you can enter:
Server address: wss://secure-server.example.com
Sending Messages
Simply type your message and press Enter:
> Your encrypted message here
Security Considerations
- Verify Recipients - Ensure you're communicating with the intended person
- Secure Connections - Always use WSS (WebSocket Secure) in production
- Key Management - Store your user ID securely
- Session Management - End sessions with
exitwhen finished
Advanced Usage
Debug Mode
Enable debug mode to see detailed information:
DEBUG=true confy alice bob
This will display:
- Key exchange details
- Message encryption/decryption info
- Connection status changes
- Signature verification steps
Custom Server
Connect to a custom server:
confy your-id recipient-id
Server address: wss://your-custom-server.com:8080
🤝 Dependencies
Confy CLI relies on:
- typer (>=0.15.4, <0.16.0) - CLI framework
- websockets (>=15.0.1, <16.0.0) - WebSocket protocol support
- pydantic-settings (>=2.11.0, <3.0.0) - Configuration management
- confy-addons (>=1.1.0, <2.0.0) - Encryption primitives
- prompt-toolkit (>=3.0.52, <4.0.0) - Terminal interface
All dependencies are installed automatically with pip.
🐛 Bug Reports
If you encounter any issues, please report them:
- Check if the issue already exists on GitHub Issues
- Provide clear reproduction steps
- Include your Python version and OS
- Attach relevant logs with
DEBUG=true
See CONTRIBUTING.md for more information.
🔐 Security Policy
For security vulnerabilities, please follow responsible disclosure:
DO NOT open a public GitHub issue.
Instead, email: confy@henriquesebastiao.com
See SECURITY.md for detailed information.
📝 Contributing
We welcome contributions! Please see CONTRIBUTING.md for guidelines on:
- Setting up the development environment
- Code standards and style guidelines
- Testing requirements
- Pull request process
📄 License
Confy CLI is open source software licensed under the GPL-3.0 license.
📚 Additional Resources
- Confy Security - github.com/confy-security
- Contributing Guide - CONTRIBUTING.md
- Security Policy - SECURITY.md
- Code of Conduct - CODE_OF_CONDUCT.md
🙋 Support
For questions and support:
- Check existing issues and discussions on GitHub
- Review the CONTRIBUTING.md guide
- Contact the team at confy@henriquesebastiao.com
Acknowledgments
This project was created with dedication by Brazilian students 🇧🇷 as part of the Confy Security initiative.
Built with ❤️ by the Confy Security Team
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file confy_cli-0.1.4.tar.gz.
File metadata
- Download URL: confy_cli-0.1.4.tar.gz
- Upload date:
- Size: 26.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0cc5049c1cc4f832a8ee08ed80f841b6eee17b8b78337ee43a3457ee0a015663
|
|
| MD5 |
75be1cfbb742573e5724c3864d6a436c
|
|
| BLAKE2b-256 |
6b91254cae2eba178f6af5b38e5b5d3e7e65ab0d05ceb2c78d8117c3270b1005
|
Provenance
The following attestation bundles were made for confy_cli-0.1.4.tar.gz:
Publisher:
publish.yml on confy-security/cli
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
confy_cli-0.1.4.tar.gz -
Subject digest:
0cc5049c1cc4f832a8ee08ed80f841b6eee17b8b78337ee43a3457ee0a015663 - Sigstore transparency entry: 637769061
- Sigstore integration time:
-
Permalink:
confy-security/cli@7409d1fae5c14bbddabce4e78b3fa28c0bd91507 -
Branch / Tag:
refs/tags/0.1.4 - Owner: https://github.com/confy-security
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@7409d1fae5c14bbddabce4e78b3fa28c0bd91507 -
Trigger Event:
push
-
Statement type:
File details
Details for the file confy_cli-0.1.4-py3-none-any.whl.
File metadata
- Download URL: confy_cli-0.1.4-py3-none-any.whl
- Upload date:
- Size: 25.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
18380c9bba08cd3e4825655b5432c19bf2c021ca8b2cf4a9a50e0fb6f0eb3242
|
|
| MD5 |
473d1aae0cbfee1b3a5a032dade3c7b3
|
|
| BLAKE2b-256 |
20733028acfd09447bed382b56419da13ba8e6d4d7553b8ad313c68a28f39151
|
Provenance
The following attestation bundles were made for confy_cli-0.1.4-py3-none-any.whl:
Publisher:
publish.yml on confy-security/cli
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
confy_cli-0.1.4-py3-none-any.whl -
Subject digest:
18380c9bba08cd3e4825655b5432c19bf2c021ca8b2cf4a9a50e0fb6f0eb3242 - Sigstore transparency entry: 637769062
- Sigstore integration time:
-
Permalink:
confy-security/cli@7409d1fae5c14bbddabce4e78b3fa28c0bd91507 -
Branch / Tag:
refs/tags/0.1.4 - Owner: https://github.com/confy-security
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@7409d1fae5c14bbddabce4e78b3fa28c0bd91507 -
Trigger Event:
push
-
Statement type: