penum-client is a minimal, engineering-focused implementation of the Penum protocol client in Rust. It provides the mechanism for constructing and sending layered encrypted packets through a Penum relay network.
- A real implementation of the Penum client protocol.
- Responsible for constructing Penum packets, choosing relay paths, and layering encryption.
- NOT a relay node.
- NOT a gateway node.
- NOT a UI application or browser extension.
- Path Selection: Client-side randomized selection of an Entry, Middle, and Gateway relay.
- Packet Construction: Fixed-size (1024 bytes) packet creation with client-side padding.
- Layered Encryption: Three layers of ChaCha20-Poly1305 AEAD encryption (Gateway -> Middle -> Entry).
- Ephemeral Keys: X25519 key exchange per hop with no persistent state.
- Load Config: Reads static relay information and destination.
- Select Path: Randomly chooses one Entry, one Middle, and one Gateway.
- Build Packet:
- Pad payload to 1024 bytes.
- Encrypt for Gateway.
- Encrypt for Middle.
- Encrypt for Entry.
- Transmit:
- Connect to Entry relay via TCP.
- Perform ephemeral key exchange.
- Send the 1024-byte packet.
- Receive 1024-byte response.
- Unwrap: Decrypt layers in reverse order.
- Cleanup: Drop all state immediately.
- TCP Only: No UDP support.
- Fixed Size: All packets are exactly 1024 bytes (+ AEAD tags).
- No Retries: Failures result in immediate connection closure.
- No Logging: No traffic or metadata is logged.
- Status: Experimental / Research implementation.
This implementation strictly follows penum-spec. Interoperability with penum-relay is a core requirement.