{"id":31628207,"url":"https://github.com/ujangbedog/dpq-chat","last_synced_at":"2025-10-06T20:20:02.765Z","repository":{"id":316861941,"uuid":"1065105953","full_name":"ujangbedog/dpq-chat","owner":"ujangbedog","description":"A simple, secure peer-to-peer chat app built with Rust.  Runs directly in the terminal with end-to-end encryption,  post-quantum security (Kyber \u0026 Dilithium), and no central server.","archived":false,"fork":false,"pushed_at":"2025-09-30T00:29:58.000Z","size":188,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-30T01:26:23.885Z","etag":null,"topics":["chat","cli","cryptography","p2p","p2p-chat","rust","secure","terminal","terminal-app","terminal-chat"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ujangbedog.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-27T04:31:07.000Z","updated_at":"2025-09-30T00:30:02.000Z","dependencies_parsed_at":"2025-09-30T01:26:26.361Z","dependency_job_id":null,"html_url":"https://github.com/ujangbedog/dpq-chat","commit_stats":null,"previous_names":["ujangbedog/simple-chat-app","ujangbedog/terminal-chat","ujangbedog/dpq-chat"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/ujangbedog/dpq-chat","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ujangbedog%2Fdpq-chat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ujangbedog%2Fdpq-chat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ujangbedog%2Fdpq-chat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ujangbedog%2Fdpq-chat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ujangbedog","download_url":"https://codeload.github.com/ujangbedog/dpq-chat/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ujangbedog%2Fdpq-chat/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278672238,"owners_count":26025870,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-06T02:00:05.630Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["chat","cli","cryptography","p2p","p2p-chat","rust","secure","terminal","terminal-app","terminal-chat"],"created_at":"2025-10-06T20:20:00.742Z","updated_at":"2025-10-06T20:20:02.760Z","avatar_url":"https://github.com/ujangbedog.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DPQ Chat\n\nA secure peer-to-peer chat application built with Rust that implements post-quantum cryptography to protect against both classical and quantum computer attacks. The system uses CRYSTALS-Dilithium for digital signatures and CRYSTALS-Kyber for key exchange, providing quantum-resistant security for all communications.\n\nFeatures a terminal-based interface with real-time messaging, decentralized architecture (no central servers), and hybrid cryptographic protocols that combine classical and post-quantum algorithms for maximum security.\n\n\u003e **⚠️ Development Notice**  \n\u003e This project is currently under active development. Features and APIs may change.\n\n## Architecture Overview\n\n**Transport Layer Security**\n- Hybrid TLS using [X25519](https://datatracker.ietf.org/doc/rfc7748/) + [ML-KEM-768](https://csrc.nist.gov/pubs/fips/203/final) key exchange\n- NIST-approved post-quantum algorithms via [rustls-post-quantum](https://github.com/rustls/rustls/tree/main/rustls-post-quantum)\n\n**Application Layer Security**  \n- [CRYSTALS-Kyber](https://pq-crystals.org/kyber/) for session key derivation\n- [CRYSTALS-Dilithium](https://pq-crystals.org/dilithium/) for peer authentication\n- [AES-256-GCM](https://en.wikipedia.org/wiki/Galois/Counter_Mode) for message encryption\n\n**Key Characteristics**\n- No message persistence - all data is volatile and destroyed on disconnect\n- No password storage - passwords only used for key derivation\n- Decentralized P2P mesh network with no central servers\n- Terminal-based interface for maximum compatibility\n\n## Usage Flow\n\n### Initial Setup\n1. Generate cryptographic identity using [CRYSTALS-Dilithium](https://pq-crystals.org/dilithium/) keypair\n2. Encrypt private key with user password using [Argon2id](https://datatracker.ietf.org/doc/rfc9106/) + [AES-256-GCM](https://en.wikipedia.org/wiki/Galois/Counter_Mode)  \n3. Store encrypted identity locally in ~/.dpq-chat/identities/\n\n### Starting a Session\n1. User enters password to decrypt private key (password never stored)\n2. Application loads [CRYSTALS-Dilithium](https://pq-crystals.org/dilithium/) keypair into memory\n3. Choose network interface and port for P2P listening\n4. Begin accepting peer connections\n\n### Network Flow\n1. **Peer Discovery**: UDP multicast announces presence on local network\n2. **Direct Connection**: Peers can connect directly via IP:PORT\n3. **Mesh Formation**: Each peer maintains direct connections to all others\n4. **Resilient Topology**: Network continues functioning even if original peer leaves\n\n## Connection Flow: Handshake to Message Encryption\n\n### Step 1: TLS Transport Establishment\n```\nPeer A ←→ Peer B\n   ↓\nX25519 + ML-KEM-768 Hybrid Key Exchange\n   ↓\nEncrypted TLS 1.3 Transport Channel\n```\n\n### Step 2: Application-Layer Authentication\n```\nOver TLS Channel:\n1. A → B: CRYSTALS-Kyber Public Key + Identity Info\n2. B → A: CRYSTALS-Kyber Ciphertext + Identity Info  \n3. Both derive shared secret from Kyber exchange\n4. A → B: CRYSTALS-Dilithium signature of (identity + kyber_data)\n5. B → A: CRYSTALS-Dilithium signature of (identity + kyber_data)\n6. Both verify signatures using peer's public key\n```\n\n### Step 3: Session Key Derivation\n```\nCRYSTALS-Kyber Shared Secret → SHA-256 → AES-256 Session Key\n```\n\n### Step 4: Message Encryption Flow\n```\nPlain Text → AES-256-GCM(session_key, nonce) → Encrypted Payload → TLS Transport\n```\n\n### Data Volatility and Privacy\n\n**No Message Persistence**\n- Messages exist only in memory during active session\n- All chat history destroyed when peer disconnects\n- No database, no logs, no message recovery possible\n\n**No Password Storage**\n- User passwords never stored anywhere on disk\n- Passwords only used for real-time key derivation via Argon2id\n- Private keys encrypted at rest, decrypted only when needed\n\n**Session Isolation**\n- Each peer-to-peer connection has unique session keys\n- Keys expire after 1 hour and are securely erased from memory\n- Past communications remain secure even if current keys compromised\n\n## Getting Started\n\n### Build from Source\n```bash\ngit clone \u003crepository-url\u003e\ncd dpq-chat\ncargo build --release\n```\n\n### Generate Identity  \n```bash\ncargo run -- generate-key\n# Enter username and password when prompted\n```\n\n### Start Chat Session\n```bash\n# Interactive mode (recommended)\ncargo run\n\n# Direct CLI mode\ncargo run -- p2p -u \u003cusername\u003e --host \u003cinterface\u003e\ncargo run -- p2p -u \u003cusername\u003e -b \u003cpeer_ip:port\u003e  # Join existing peer\n```\n\n### Example: Local Network Chat\n```bash\n# User A creates room\ncargo run -- p2p -u Alice --host 192.168.1.100\n\n# User B joins  \ncargo run -- p2p -u Bob -b 192.168.1.100:40000\n```\n\n## License\n\nThis project is licensed under the [MIT License](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fujangbedog%2Fdpq-chat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fujangbedog%2Fdpq-chat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fujangbedog%2Fdpq-chat/lists"}