Post-quantum-secured remote shell + file copy for PaideiaOS.
Two binaries, one source tree:
| Binary | Entry point | Purpose |
|---|---|---|
remote |
RemoteClient::_start (src/remote_client.pdx) |
remote <host> -- authenticate, spawn a remote shell, bridge the local tty to it. |
rcopy |
Rcopy::_start (src/rcopy.pdx) |
rcopy <local> <host>:<remote> -- authenticate, stream a local file to a remote path. |
Both binaries share two library modules:
src/kem.pdx(Module Kem) -- ML-KEM-768 (FIPS 203) key exchange over the raw TCP socket, using paideia-as's kernel-linkedMlKem768intrinsics (crates/paideia-as-stdlib/pdx/crypto/ml_kem_768.pdx).src/channel.pdx(Module Channel) -- a ChaCha20-Poly1305 AEAD framed transport keyed by the KEM shared secret, using paideia-as's kernel-linkedChaCha20Poly1305intrinsics (crates/paideia-as-stdlib/pdx/crypto/chacha20_poly1305.pdx).
- TCP connect to
<host>:22(an SSH-shaped port;remoteandrcopyshare one daemon/port, dispatching by opcode rather than by port). - ML-KEM-768 handshake (
Kem::kem_client_handshake): the client generates an ephemeral keypair, sends the 1184-byte encapsulation key, receives a 1088-byte ciphertext, and decapsulates a 32-byte shared secret. - The shared secret keys a
Channel(12-byte counter nonce per frame, 4-byte big-endian length prefix, 16-byte Poly1305 tag per frame). remotesends anAUTH_CHALLENGEframe, then on an OK reply sends aSPAWN_SHELLrequest and pumps stdin/stdout through the channel with the local tty in raw mode.rcopysends aCOPYrequest frame ({op, name_len, name_bytes, size, sha256}), then streams the source file in 4096-byte chunks, each acknowledged by the server.
- Entropy source. No CSPRNG intrinsic (
SecureRandom::fill) orrdrandmnemonic is available in the current paideia-as toolchain.Kem::kem_fill_seed_bytesderives KEM seed material fromrdtscticks mixed with a per-process counter -- not cryptographically strong. This is flagged prominently insrc/kem.pdxand must be replaced once a real linked entropy primitive exists. - File integrity hash. No
Sha256stdlib trait is linked yet (crates/paideia-as-stdlib/pdx/crypto/hasargon2id,chacha20_poly1305, andml_kem_768only).Rcopy::rc_sha256_stubfills thesha256field of theCOPYrequest with 32 zero bytes and is clearly marked as a stub pending a real digest primitive. - tty raw mode.
KIND_TTYis not yet in the kernel'sKIND_SEEDABLE_TABLEfor non-shell processes (seetools/user/shell/src/line_reader.pdx).remote's raw-mode call sites are realcap_invokes but fail closed until that loader-side gap closes; the pump loop still runs (over cooked-mode tty I/O) if raw mode cannot be entered. - Hostname resolution. No DNS/resolver syscall exists;
<host>must be a dotted-quad IPv4 literal (a.b.c.d), matching every other networked user tool in this ecosystem (pdxsock).
On a successful Kem::kem_client_handshake, remote writes
remote ok host=<H> peer_key=<hex8>\n to fd 2. Two design notes:
- "peer's public key" reading. This protocol's client never
receives a public key back from the server (only a ciphertext it
decapsulates locally -- see
src/kem.pdx's module header). The only ML-KEM public key material that exists client-side iskem_ek, the encapsulation key this client generated and sent to the peer;peer_keyhashes that. A real server-side peer would see the sameekbytes cross the wire, so this is the closest available reading of "peer's public key" given this round's client-only scope. - No hash primitive is linked.
kem_peer_key_hash64is Jenkins' one-at-a-time hash (public-domain, non-cryptographic) run natively in a 64-bit register (add/xor/shl/shronly -- noimul, noand reg, imm64truncation risk). This is a greppable log fingerprint, not a security property.
See CHANGELOG.md for the per-issue landing history.