Skip to main content

A decentralized, end-to-end encrypted terminal messenger

Project description

CLI-SXCL

Decentralized, End-to-End Encrypted Terminal Messenger

cli-social (sxcl) is a secure, peer to peer messaging application built entirely for the terminal. It uses a Kademlia Distributed Hash Table (DHT) for decentralized peer discovery, the Noise Protocol for absolute end-to-end encryption, and stateless relay nodes to route traffic around NAT's and handle offline messaging.

No central servers, No phone numbers. Just cryptographic identities and your terminal


Table of Contents

-Features -Installation -How to Use -Demo -Architecture & Security -Running a node -Note for Shipwright


Features

  • End-to-End Encryption: Built on the Noise Protocol Framework
  • Cryptographic Identities: Ed25519 keypairs prevent spoofing and make your Peer ID inherently self-certifying.
  • Decentralized Discovery: A Kademlia-based DHT for finding peers and routing without central registries
  • Secure Local Storage: SQLite database wrapped in App-level AES-GCM encryption, Your messages are never stored in plaintext on disk
  • Cool TUI: Cool looking, Terminal User Interface (TUI) built with Textual

Installation

Requires Python 3.12+

# Install via pip
pip install sxcl

Note: depinding on your system, you may want to use pipx to install it globally in an isolated environment:pipx install sxcl

How to Use

You can use sxcl help to know all commands

1. Generate Identity

You must create a identity before using the network. Your keys are encrypted via Argon2 and AES-GCM before being saved to disk.

sxcl init

Make sure to remember your passphrase, there is no recovery. (This is not a design flaw, but to make it truly secure)

2. Check your ID

Need to share your ID with your friend?

sxcl whoami

3. Launch it

Start the TUI

sxcl tui
  • Ctrl+N: Start a new chat (requires the Peer ID of your friend)
  • Ctrl+D: Close the current chat
  • Ctrl+B: Toggle the siderbar
  • Ctrl+Q: Quit
  • Ctrl+P: Open Palette (Themes settings)

4. Wipe your Identity?

There is no recovery, everything is nuked

sxcl nuke

5. You can run daemon in the background

sxcl daemon

registry command is only for the owner of this project to sign the node registry

Demo

Architecture & Security

cli-social operates entirely peer to peer but uses a relay mesh network to solve NAT traversal and offline delivery.

1.Identity Users generate an Ed25519 keypair. The SHA-256 hash of the public key acts as the 64 character Peer ID 2. Decentralized Hash Table When the app boots, the local DHT node signs a Kademlia record containing the user's Peer ID, their current Relay server and a timestamp, and announces it to the network 3. Routing To send a message, You query the DHT for Person A's Peer ID, The DHT returns Bob's public key and his currently registered Relay Sever. 4. Encryption You encrypt your message with Noise_X_25519_ChaChaPoly_SHA256 and bob's noise public key. Bob then decrypts it with his noise private key. 5. Delivery You push the encrypted frame to your home relay, it then passes to Person A's home relay through the relay mesh links, Person A's relay forwards it to them if they are online , or stores it in a local database if he is offline. The relay cannot read the contents

Running a Node

The network relies on community run relay (but they are signed by only me) and bootstrap nodes, Operators can spin up a node using simple docker setup.

You can find the instructions here:

Note for Shipwrights

When you first join the dht network, it might take time to populate your identity and to tell the network that you are here at this relay, so pls wait for atleast 10-15s before the other person adds you, all functions do work, so I want you to check if offline messaging and offline delivery receipts do work. If there is any problem connecting to the dht network, check your firewall, the relay nodes are up 24/7. Verify the fingerprint shown near the username in the chat header, they should match with the other person's fingerprint shown in the chat header

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sxcl-1.0.1.tar.gz (29.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sxcl-1.0.1-py3-none-any.whl (32.6 kB view details)

Uploaded Python 3

File details

Details for the file sxcl-1.0.1.tar.gz.

File metadata

  • Download URL: sxcl-1.0.1.tar.gz
  • Upload date:
  • Size: 29.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.10 {"installer":{"name":"uv","version":"0.10.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Fedora Linux","version":"43","id":"","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for sxcl-1.0.1.tar.gz
Algorithm Hash digest
SHA256 cddc5e05ee2765e2af282c959d0c2990a8107b17a4f03b97ec15c70bdb58c79b
MD5 8b9532a5f0b612a731fadb6759a09ee0
BLAKE2b-256 b3e73786db904b5e73818d5eb853f7e2f0370f8766ead3002da2e08485466e6e

See more details on using hashes here.

File details

Details for the file sxcl-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: sxcl-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 32.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.10 {"installer":{"name":"uv","version":"0.10.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Fedora Linux","version":"43","id":"","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for sxcl-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0dca8360d791226080e562d766543b91ea56a23ce1fa2cef8b9245c248b07743
MD5 fa35dfcb98d54649851a88c5ded0e887
BLAKE2b-256 6e8566c5cc1b08009b5a063a42f63c05d1940f7ac9855b82bfc2a135512cb2e4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page