Cyphra
Cyphra is a Python package for building client-side encrypted messaging applications. It provides both a ready-to-run terminal client and reusable SDK components for developer applications.
Why Cyphra
Cyphra is designed around an explicit trust boundary:
- Identity keys are generated on the client.
- Private keys and plaintext remain on the client.
- Trusted contacts are approved using a human-readable fingerprint.
- Messages are encrypted and signed before they leave the client.
- The relay routes public data and opaque ciphertext without decrypting messages.
- Persistent identity, contact, and encrypted-message data is stored in a local SQLCipher database.
The package is a security-focused reference implementation. It should receive an independent cryptographic and operational review before production use.
Two Usage Modes
Standalone terminal application
Install the package and launch the client with a local display name:
python3 -m pip install cyphra
cyphra chat --name Alice
The terminal client creates or opens a local encrypted database, registers its public identity, displays connected people, supports fingerprint approval, and provides encrypted messaging. A second user can run cyphra chat --name Bob.
The fixed relay URL is configured by the application. The user does not need to select a broker. Each local profile has its own database under ~/.cyphra/ unless --db is supplied.
Developer SDK
Applications can compose Cyphra directly instead of using the terminal UI:
from cyphra import CyphraClient, CryptoEngine, DatabaseManager
from cyphra.network.http_client import HttpBrokerClient
engine = CryptoEngine()
database = DatabaseManager.from_passphrase(
"alice.db",
"a local passphrase with at least 12 characters",
)
CyphraClient.provision_identity(engine, database)
transport = HttpBrokerClient("https://post-q.vercel.app")
client = CyphraClient(engine, database, transport)
The SDK exposes the same security workflow as the standalone application: connect, discover a contact, compare fingerprints, approve the contact, send encrypted messages, and receive authenticated messages.
Cryptographic Suite
Each message uses a mandatory hybrid construction:
X25519 ephemeral DH
||
ML-KEM-768 encapsulation
-> HKDF-SHA384
-> AES-256-GCM encryption
-> Ed25519 envelope signature
There is no classical-only downgrade path. Each message receives fresh ephemeral key material, a fresh KDF salt, and a fresh AES-GCM nonce. Recipients verify routing metadata, contact trust, signatures, timestamps, and replay identifiers before displaying plaintext.
Local Storage
Cyphra uses SQLCipher for local persistence and Argon2id to derive the database key from the user's passphrase. The local database stores private identity material, approved contact bundles, fingerprints, and encrypted envelopes. It does not provide a plaintext storage API.
The relay can observe identity IDs, public bundles, message IDs, timing, packet sizes, and ciphertext. It must not receive private keys, passphrases, derived message keys, or plaintext.
Relay Behavior
The default relay is the deployed HTTPS application at https://post-q.vercel.app. It supports registration, public-bundle lookup, active-peer lookup, opaque packet forwarding, and polling.
The relay uses transient process memory and no external database. It is suitable for demonstrations and controlled testing, but it does not guarantee offline delivery across serverless instances. Applications requiring durable delivery should add a separately audited opaque store-and-forward service.
Public API
The primary public objects are:
CyphraClient: application workflow coordinator.CryptoEngine: identity, encryption, signature, and decryption service.DatabaseManager: local SQLCipher persistence service.BrokerTransport: transport interface for relay implementations.HttpBrokerClient: fixed deployed HTTPS transport.EncryptedEnvelope: authenticated encrypted message value object.PreKeyBundle: signed public identity bundle value object.
Security and Scope
Cyphra does not provide anonymity, traffic-analysis resistance, group messaging, multi-device synchronization, account recovery, hardware-backed keys, or production abuse controls. It is intended to demonstrate endpoint encryption, explicit trust, local encrypted storage, and object-oriented separation of responsibilities.
Maintainers
- Anupam1707
- asmitbaldi
Project
Repository: https://github.com/Anupam1707/PostQ
Metadata
Release files for cyphra 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| cyphra-0.1.2.tar.gz | 30.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| cyphra-0.1.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 61.7 kB
Release files / cyphra-0.1.2.tar.gz
| Download URL | cyphra-0.1.2.tar.gz |
|---|---|
| Size | 30.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f86a36868bbb06c71bbaeb64cae5389c382a539d4bc80d75ecdb141cef8b6314
|
|
BLAKE2b-256 checksum How to use checksums |
565f6a6915ab115d8f257ec532fcaba10b7cd4b0cfaad7c033ceb6916ba6ffc2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.10.0
|
Release files / cyphra-0.1.2-py3-none-any.whl
| Download URL | cyphra-0.1.2-py3-none-any.whl |
|---|---|
| Size | 31.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
aff46996f71b179692c1ea90875847b083a5dc422b26d8a8b842d0baa014ba19
|
|
BLAKE2b-256 checksum How to use checksums |
d8eebcb918ff2f68920dbaa0066e1944c9d2c3a1d5cb483a1911544cba60f2c7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.10.0
|