{"id":44049594,"url":"https://github.com/mario-so/zend","last_synced_at":"2026-02-07T23:05:28.937Z","repository":{"id":335899432,"uuid":"1135048758","full_name":"Mario-SO/zend","owner":"Mario-SO","description":"P2P file sharing engine","archived":false,"fork":false,"pushed_at":"2026-02-01T18:39:27.000Z","size":41,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-02-02T03:06:54.351Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Zig","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Mario-SO.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2026-01-15T15:11:54.000Z","updated_at":"2026-02-02T01:01:05.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/Mario-SO/zend","commit_stats":null,"previous_names":["mario-so/zend"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/Mario-SO/zend","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mario-SO%2Fzend","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mario-SO%2Fzend/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mario-SO%2Fzend/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mario-SO%2Fzend/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Mario-SO","download_url":"https://codeload.github.com/Mario-SO/zend/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mario-SO%2Fzend/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29211674,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-07T22:58:45.823Z","status":"ssl_error","status_checked_at":"2026-02-07T22:58:45.272Z","response_time":63,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2026-02-07T23:05:28.304Z","updated_at":"2026-02-07T23:05:28.929Z","avatar_url":"https://github.com/Mario-SO.png","language":"Zig","funding_links":[],"categories":[],"sub_categories":[],"readme":"# zend\n\nA secure peer-to-peer file transfer engine written in Zig.\n\n## Features\n\n- **Identity management** using Ed25519 keypairs\n- **Secure transport** using Noise IK protocol\n- **Peer authentication** with TOFU (Trust On First Use)\n- **Encrypted file transfer** with integrity verification\n- **JSON output** for IPC with [hermes](https://github.com/Mario-SO/hermes)\n\n## Cryptographic Primitives\n\n| Purpose | Algorithm |\n|---------|-----------|\n| Identity | Ed25519 |\n| Key Agreement | X25519 (Noise IK) |\n| AEAD | ChaCha20-Poly1305 |\n| Hashing | SHA-256 |\n| KDF | HKDF-SHA256 |\n\nAll cryptography uses Zig's standard library (`std.crypto`), which wraps audited implementations.\n\n## Building\n\nRequires Zig 0.15.2 or later.\n\n```bash\n# Build\nzig build\n\n# Run tests\nzig build test\n\n# Build release\nzig build -Doptimize=ReleaseSafe\n```\n\n## Usage\n\nAll output is JSON (one object per line) for machine consumption.\n\n### Identity Management\n\n```bash\n# Generate a new identity\nzend id init\n\n# Show your identity (public key and fingerprint)\nzend id show\n```\n\nOutput:\n```json\n{\"event\":\"identity_created\",\"public_key\":\"\u003cbase64\u003e\",\"fingerprint\":\"\u003chex\u003e\"}\n```\n\n### Peer Management\n\n```bash\n# Add a trusted peer\nzend peer add alice \"their_public_key_base64\" \"192.168.1.100:7654\"\n\n# Update trust state\nzend peer trust alice blocked\n\n# List all peers\nzend peer list\n\n# Remove a peer\nzend peer remove alice\n```\n\n### File Transfer\n\n```bash\n# Send a file to a peer\nzend send document.pdf alice\n\n# Receive files (listen on default port 7654)\nzend receive\n\n# Receive on a custom port\nzend receive --port 8080\n```\n\n## Using with Tailscale\n\nFor transferring files between computers across the internet (different cities, countries, etc.), we recommend [Tailscale](https://tailscale.com) - a free mesh VPN that requires no port forwarding or firewall changes.\n\n### Setup (one time per device)\n\n```bash\n# Install Tailscale\n# see https://tailscale.com/download\n\n# Start and authenticate\nsudo tailscale up\n\n# Get your Tailscale IP\ntailscale ip -4\n# Example: 100.64.0.2\n```\n\n### Example: Country A to Country B\n\n**Friend in Country B (receiver):**\n```bash\ntailscale ip -4              # Note: 100.64.0.2\nzend id show                 # Share the public_key with sender\nzend receive\n```\n\n**You in Country A (sender):**\n```bash\nzend peer add country_b \"FRIENDS_PUBLIC_KEY\" \"100.64.0.2:7654\"\nzend send vacation_photos.zip country_b\n```\n\n### Why Tailscale?\n\n- **No port forwarding** - works through NAT and firewalls automatically\n- **Private network** - the `100.x.x.x` IPs are only reachable by your Tailscale devices\n- **Double encryption** - Tailscale (WireGuard) + zend (Noise IK)\n- **Free** for personal use (up to 100 devices)\n\n## JSON Events\n\n| Event | Fields | Description |\n|-------|--------|-------------|\n| `identity_created` | `public_key`, `fingerprint` | New identity generated |\n| `identity_loaded` | `public_key`, `fingerprint` | Identity loaded from disk |\n| `peer_added` | `name`, `fingerprint` | Peer added to trusted list |\n| `peer_removed` | `name` | Peer removed |\n| `peer_trust_updated` | `name`, `trust` | Peer trust updated |\n| `peer_list` | `peers` | List of all peers |\n| `connecting` | `peer`, `address` | Connecting to peer |\n| `listening` | `port` | Listening for connections |\n| `handshake_complete` | `peer` | Noise handshake succeeded |\n| `transfer_start` | `file`, `size`, `peer` | File transfer started |\n| `progress` | `bytes`, `percent` | Transfer progress |\n| `transfer_complete` | `file`, `hash` | Transfer completed |\n| `error` | `code`, `message` | Error occurred |\n\n## Noise IK Protocol\n\nzend uses the Noise IK handshake pattern for authenticated key exchange:\n\n```\n-\u003e e, es, s, ss   (initiator sends ephemeral, encrypts static key)\n\u003c- e, ee, se      (responder completes handshake)\n```\n\nThe IK pattern assumes the initiator knows the responder's static public key (from the trusted peers list), enabling immediate mutual authentication.\n\n## Security Guarantees\n\n**Protected against:**\n- Network interception (all traffic encrypted)\n- Man-in-the-middle attacks (mutual authentication)\n- Data tampering (authenticated encryption + hash verification)\n- Replay attacks (nonce-based encryption)\n\n**Not protected against:**\n- Compromised operating system\n- Malicious authorized peers\n- Side-channel attacks\n\n## Architecture\n\n```\nzend/src/\n├── main.zig              # CLI entry, command parsing\n├── root.zig              # Public library API\n├── identity/\n│   ├── keypair.zig       # Ed25519 key generation\n│   └── storage.zig       # Identity file I/O\n├── peer/\n│   ├── manager.zig       # Peer CRUD operations\n│   └── storage.zig       # JSON persistence\n├── transport/\n│   ├── tcp.zig           # TCP client/server\n│   ├── frame.zig         # Length-prefixed framing\n│   ├── noise.zig         # Noise IK implementation\n│   └── channel.zig       # Secure channel abstraction\n├── protocol/\n│   ├── messages.zig      # Message serialization\n│   └── transfer.zig      # File transfer state machine\n└── utils/\n    ├── json.zig          # JSON event output\n    └── memory.zig        # Secure memory wiping\n```\n\n## File Locations\n\n- Identity: `~/.zend/identity`\n- Peers: `~/.zend/peers.json`\n- Received files: Current working directory\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmario-so%2Fzend","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmario-so%2Fzend","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmario-so%2Fzend/lists"}