Skip to content

Free E2E encrypted backups on c0mpute (Sign in with c0mpute) - #4

Merged
ralyodio merged 2 commits into
mainfrom
backup
Nov 30, 2026
Merged

ralyodio merged 2 commits into
mainfrom
backup

Conversation

@ralyodio

Copy link
Copy Markdown
Contributor

Depends on #3 (ask): this branch is based on it. Merge #3 first; the diff then shrinks to this commit.

What

sk33p login (Sign in with c0mpute), logout, backup FILE [--name N], backups, restore NAME [-o OUT], backup --rm NAME; MCP tools backup, list_backups, restore.

How

  • Auth: c0mpute.com OAuth 2.1, PKCE S256, loopback redirect http://127.0.0.1:<port>/callback (c0mpute matches loopback redirects on everything but the port). Scope storage:write. Public client c0c_T6_uQc-rZh8zTgXvzFfHUA, registered with POST https://c0mpute.com/api/oauth/register (RFC 7591, no secret exists). login --token c0k_... stores an API key instead (headless). Token file ~/.config/sk33p/c0mpute.json, mode 0600; logout revokes (RFC 7009). No cloud callback route was needed.
  • sk33p encryption (src/vault.rs), symmetric only: Argon2id (64 MiB, t=3, p=1) or keyfile HKDF-SHA256 -> 256-bit KEK, wrapping a random 256-bit per-file key; XChaCha20-Poly1305 for wrap and body. 136-byte header SK33PE2E + version + kdf/aead/wrap ids + KDF params + salt + nonces + wrapped key, all authenticated; unknown versions/ids refused with "upgrade sk33p".
  • c0mpute packaging (src/sealed.rs): port of @profullstack/c0mpute-sealed (c0mpute-private-v1 + signed v1 hosting record). Verified against the reference crate c0mpute-sealed in a scratch harness: our blobs open with the owner's storage identity via open_with_secret, and unwrap_custody returns our per-object seed (sizes 0 B to 3 MB). That envelope's X25519 wrap and ed25519 signature protect no readable data (the payload is already sk33p ciphertext); docs say so.
  • Names never leave the machine: each backup is an opaque object; the list (name, size, date, per-object keys) is an encrypted index object whose address derives from the key + account identity, so a new machine needs only login + key. A wrong passphrase is refused rather than silently starting a second set (--new-key to do it on purpose).
  • Free tier: c0mpute's app-upload limits (4 GiB/upload, 20 GiB/day, 200 GiB/account, 60 uploads/h, no charge in code); sk33p caps each backup at 100 MiB.
  • Cloud: pricing card, FAQ "Do you keep my files?" covers both modes, /docs section "Back up to c0mpute (free)".

Tests

  • cargo test --release: 19 passed (new: vault round trip, wrong passphrase, tampering at 6 offsets, header alg ids + unknown version/alg rejected, hostile KDF params, locator; sealed padme/names/round trip; PKCE/query; and an integration test against a stand-in c0mpute (OAuth authorize/token/revoke, identity, uploads, ingest PUT/finish with record-signature + manifest + seq checks, open reads) covering login, backup, replace, list, restore, wrong passphrase, rm, second machine, keyfile, logout, and asserting no file name, plaintext, passphrase or key appears in any request).
  • SK33P_SKIP_NATIVE=1 cargo clippy --all-targets: clean.
  • bun test (cloud, SK33P_BIN=target/release/sk33p): 19 passed (new page test).

Real c0mpute end to end: blocked on c0mpute's side

Against c0mpute.com with a real account: auth, GET /api/v1/storage/identity (linked) and POST /api/v1/storage/uploads (ticket) work. The ingest PUT fails: gateway.c0mpute.com (dev2 :7777) runs with [hosting] enabled = false and sealed_ingest_issuer = "", so it answers 404 "this gateway does not take app uploads" (502 through the public proxy). Until some public gateway sets sealed_ingest_issuer = "3322452609d54218dee2fceb757fbc93dfef7b82dfb902c551d9efddd6b5d0b6" (the ticket_issuer from /api/v1/storage/config) with hosting enabled, and c0mpute.com's ingest URL points at it, no app (PairUX included) can upload. Not changed here.

🤖 Generated with Claude Code

ralyodio and others added 2 commits November 30, 2026 16:54
sk33p login / logout / backup FILE [--name N] / backups / restore NAME [-o OUT] /
backup --rm NAME, plus local MCP tools backup, list_backups, restore.

- Sign in: OAuth 2.1 + PKCE (S256) loopback redirect against c0mpute.com, scope
  storage:write, public client c0c_T6_uQc-rZh8zTgXvzFfHUA (registered via RFC 7591
  POST /api/oauth/register). `login --token c0k_...` for headless machines. Token in
  ~/.config/sk33p/c0mpute.json (0600); logout revokes it (RFC 7009).
- sk33p's encryption (src/vault.rs), symmetric only so quantum-safe: Argon2id
  (64 MiB, t=3, p=1) or keyfile HKDF -> 256-bit KEK wrapping a random 256-bit key per
  file, XChaCha20-Poly1305 for both. Versioned header with algorithm ids, fully
  authenticated; unknown versions/ids are refused.
- c0mpute packaging (src/sealed.rs): a port of @profullstack/c0mpute-sealed's
  c0mpute-private-v1 format and signed v1 hosting record, checked against the
  reference Rust crate (opens with the owner's identity, custody unwraps).
- File names, sizes and keys live in an encrypted index object at an address derived
  from the key and the account, so a new machine needs only login + key. A mistyped
  passphrase is refused instead of starting an empty second set.
- Cloud: pricing card, FAQ ("Do you keep my files?") and /docs section.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ralyodio
ralyodio merged commit f53a091 into main Nov 30, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant