Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
588 changes: 581 additions & 7 deletions Cargo.lock

Large diffs are not rendered by default.

15 changes: 14 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,20 @@ build = "build.rs"
[dependencies]
serde_json = "1"
hqtui = { git = "https://github.com/profullstack/hqtui" }
ureq = { version = "2", default-features = false, features = ["tls"] }
ureq = { version = "2", default-features = false, features = ["tls", "json"] }
# Backups: sk33p's E2E layer (symmetric, quantum-safe) and c0mpute's sealed format.
argon2 = { version = "0.5", default-features = false, features = ["alloc"] }
chacha20poly1305 = "0.10"
aes-gcm = { version = "0.10", features = ["zeroize"] }
hkdf = "0.12"
sha2 = "0.10"
blake3 = "1"
x25519-dalek = { version = "2", features = ["static_secrets", "zeroize"] }
ed25519-dalek = { version = "2", features = ["zeroize"] }
rand = "0.8"
base64 = "0.22"
zeroize = "1"
rpassword = "7"

[build-dependencies]
cc = "1"
Expand Down
48 changes: 48 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,54 @@ explanation and preview (with FILE it sends the same context).
Each ask is one call against your API plan. Get a free key at
https://sk33p.pwa.pit.world/key and save it: `mkdir -p ~/.config/sk33p && echo sk33p_... > ~/.config/sk33p/key`.

## Back up to c0mpute (free)

End-to-end encrypted workbook backups on the [c0mpute](https://c0mpute.com) network,
free with a c0mpute account. Encryption happens in `sk33p` on your machine; neither
sk33p nor c0mpute can read the backups or see their names.

```sh
sk33p login # Sign in with c0mpute: browser, OAuth 2.1 + PKCE, scope storage:write
sk33p login --token c0k_... # or store a c0mpute API key (no browser on this machine)
sk33p backup budget.xlsx # asks for a backup passphrase (twice, the first time)
sk33p backup q3.xlsx --name "Q3 forecast"
sk33p backups # NAME SIZE BACKED UP (UTC), from the encrypted index
sk33p restore "Q3 forecast" -o q3.xlsx
sk33p backup --rm budget.xlsx
sk33p logout # revokes the OAuth token and forgets it
```

- **Key**: a passphrase typed at the prompt, `--keyfile PATH` (created with 32 random
bytes when missing), `$SK33P_BACKUP_KEYFILE` or `$SK33P_PASSPHRASE`. It never leaves
the machine. There is no recovery: lose it and the backups are gone.
- **Quantum-safe**: 256-bit symmetric encryption (XChaCha20-Poly1305) with an Argon2id
key. The passphrase goes through Argon2id (64 MiB, 3 passes, random salt) to a 256-bit
key that wraps a fresh random 256-bit key per file. No public-key step, so a quantum
computer only gets Grover's square-root speedup (about 128-bit strength left). Blob
header: magic `SK33PE2E`, format version, algorithm ids, KDF parameters, salt, nonces,
wrapped key; all authenticated. Unknown versions or algorithm ids are refused, so the
format can be upgraded later.
- **On the network**: each encrypted file is packaged in c0mpute's private-storage
format (`c0mpute-private-v1`) and held in 3 copies by c0mpute nodes. That envelope
wraps its key to your c0mpute storage identity with X25519 and authenticates the upload
with ed25519; neither protects readable data, since what they wrap is already sk33p
ciphertext. Names, sizes and dates live in an encrypted index object whose address is
derived from your key and account, so another machine with the same login and key
finds everything. c0mpute sees ciphertext, padded sizes and upload times.
- **Limits**: 100 MB per backup (sk33p). c0mpute's free app-upload limits per account:
4 GiB per upload, 20 GiB a day, 200 GiB in all, 60 uploads an hour.
- **Once per c0mpute account**: link a storage identity with the c0mpute CLI,
`c0mpute storage key init` then `c0mpute storage key link`.
- **MCP**: `sk33p mcp` adds `backup`, `list_backups` and `restore` (key from the
`keyfile` argument, `$SK33P_BACKUP_KEYFILE` or `$SK33P_PASSPHRASE`).

| Variable | Default | |
|---|---|---|
| `SK33P_C0MPUTE_URL` | `https://c0mpute.com` | sign-in and storage API |
| `SK33P_C0MPUTE_GATEWAY` | `https://gateway.c0mpute.com` | where backups are read from |
| `SK33P_C0MPUTE_TOKEN` | `~/.config/sk33p/c0mpute.json` (0600) | the c0mpute token |
| `SK33P_CONFIG_DIR` | `~/.config/sk33p` | |

## Hosted API and MCP

The same engine over HTTPS and remote MCP at **https://sk33p.pwa.pit.world**: evaluate
Expand Down
29 changes: 28 additions & 1 deletion cloud/src/page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -238,12 +238,13 @@ box.value=j.formula+'\\n'+box.value;note.textContent=j.explanation+' = '+j.previ
<div class="grid">
<div class="card price"><h3>Terminal</h3><div class="amt">$0 <small>forever, MIT</small></div><ul><li>TUI, CLI and local MCP</li><li>Runs on your machine, no limits</li><li>Linux x86_64 / arm64, macOS arm64</li></ul><a class="btn ghost" href="${REPO}">Install</a></div>
<div class="card price"><h3>Free API</h3><div class="amt">$0 <small>with an email</small></div><ul><li>${L.free.calls} API + MCP calls a day</li><li>Files up to ${Math.round(L.free.maxBytes / 1048576)} MB</li><li>All tools: eval, read, write, sheets, convert, ask</li></ul><a class="btn ghost" href="/key">Get a free key</a></div>
<div class="card price"><h3>Back up to c0mpute</h3><div class="amt">$0 <small>sign in with c0mpute</small></div><ul><li>Encrypted on your machine before upload; neither sk33p nor c0mpute can read it</li><li>Quantum-safe: XChaCha20-Poly1305, 256-bit keys, Argon2id passphrase key</li><li>Workbooks up to 100 MB each, 3 copies on the c0mpute network</li><li><code>sk33p login</code> then <code>sk33p backup budget.xlsx</code></li></ul><a class="btn ghost" href="/docs#back-up-to-c0mpute-free">How it works</a></div>
<div class="card price hot"><h3>Pro</h3><div class="amt">$${cfg.proUsd} <small>per ${cfg.proDays} days</small></div><ul><li>${L.pro.calls.toLocaleString('en-US')} calls a day</li><li>Files up to ${Math.round(L.pro.maxBytes / 1048576)} MB</li><li>Pay with any coin or PayPal via CoinPay</li><li>No subscription: buy more days when you want</li></ul><a class="btn" href="/upgrade">Go Pro</a></div>
</div></section>

<section><h2>Questions</h2>
<details><summary>What is the engine?</summary><p>SkeeptoEngine, a C++20 calculation core by Stéphane Allez (MIT): 344 worksheet functions including dynamic arrays, XLOOKUP, LET, LAMBDA helpers and financial solvers. sk33p is an independent Rust frontend for it.</p></details>
<details><summary>Do you keep my files?</summary><p>No. Each call runs in a fresh, sandboxed process in a scratch directory that is deleted when the call ends. We store your key's hash, your email and a daily call count.</p></details>
<details><summary>Do you keep my files?</summary><p>The hosted API keeps nothing: each call runs in a fresh, sandboxed process in a scratch directory that is deleted when the call ends. We store your key's hash, your email and a daily call count.</p><p>Optional free backups (<code>sk33p backup</code>) go to your own c0mpute storage, not to us, and are encrypted on your machine before upload with a passphrase or keyfile that never leaves it. Neither sk33p nor c0mpute can read them, or see their file names; the network holds ciphertext and its size. Lose the passphrase and nobody can recover them.</p></details>
<details><summary>What happens when I hit the limit?</summary><p>The API answers 402 with the next step (a free key, or Pro) instead of a bare error. Counts reset at midnight UTC.</p></details>
<details><summary>Anything Excel does that sk33p does not?</summary><p>No <code>^</code> operator (use <code>POWER()</code>), one workbook per process, no charts or macros. Number formats from .xlsx are applied.</p></details>
</section>
Expand Down Expand Up @@ -367,6 +368,32 @@ Tools: eval, read_range, write_cells, list_sheets, convert (files as base64), as

Local, unlimited, no account: install the app and run \`sk33p mcp\` (stdio; the same tools on file paths).

## Back up to c0mpute (free)

End-to-end encrypted workbook backups on the c0mpute network, free for anyone with a c0mpute account. Everything below runs in the \`sk33p\` app on your machine; the hosted API is not involved and keeps nothing.

\`\`\`
sk33p login # Sign in with c0mpute (browser; OAuth 2.1 + PKCE, scope storage:write)
sk33p login --token c0k_... # or a c0mpute API key, on a machine without a browser
sk33p backup budget.xlsx # asks for your backup passphrase the first time
sk33p backups # name, size, date (from your encrypted index)
sk33p restore budget.xlsx -o budget.xlsx
sk33p backup --rm budget.xlsx
sk33p logout
\`\`\`

Use \`--keyfile PATH\` (created with 32 random bytes if missing), \`$SK33P_BACKUP_KEYFILE\` or \`$SK33P_PASSPHRASE\` instead of typing a passphrase. The local MCP server (\`sk33p mcp\`) has the same as tools: backup, list_backups, restore.

**Encryption (quantum-safe).** 256-bit symmetric encryption (XChaCha20-Poly1305) with an Argon2id key: your passphrase goes through Argon2id (64 MiB, 3 passes) to a 256-bit key that wraps a fresh random 256-bit key per file. There is no public-key step in sk33p's encryption, so a quantum computer gains only Grover's square-root speedup (about 128-bit strength left). The header records the format version and algorithm ids, and every byte of it is authenticated.

**What c0mpute sees.** Each encrypted file is then packaged in c0mpute's private-storage format and kept in 3 copies by c0mpute nodes. That envelope uses X25519 (a copy of its key wrapped to your c0mpute storage identity) and ed25519 (authenticating the upload to the network); they protect no readable data, since what they wrap is already sk33p ciphertext. File names are inside an encrypted index, never sent in the clear. c0mpute sees ciphertext, padded sizes and upload times.

**Free limits.** sk33p caps each backup at 100 MB. c0mpute's app-upload limits per account: 4 GiB per upload, 20 GiB per 24 hours, 200 GiB in all, 60 uploads an hour.

**Once per account.** c0mpute needs a storage identity linked to your account: \`c0mpute storage key init\` then \`c0mpute storage key link\` with the c0mpute CLI.

**No recovery.** Lose the passphrase or keyfile and the backups cannot be opened by anyone.

## The app

\`${INSTALL}\`
Expand Down
17 changes: 17 additions & 0 deletions cloud/test/app.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,23 @@ describe('pages', () => {
expect(await (await req('/docs.md')).text()).toContain('## MCP')
expect(await (await req('/llms.txt')).text()).toContain('# sk33p')
expect((await req('/.well-known/openwebring.json')).status).toBe(200)
expect((await req('/nope')).status).toBe(404)
})

test('free c0mpute backups: pricing card, FAQ and docs say what is and is not kept', async () => {
const { req } = setup()
const home = await (await req('/')).text()
expect(home).toContain('Back up to c0mpute')
expect(home).toContain('href="/docs#back-up-to-c0mpute-free"')
expect(home).toContain('The hosted API keeps nothing')
expect(home).toContain('Neither sk33p nor c0mpute can read them')
const docs = await (await req('/docs.md')).text()
expect(docs).toContain('## Back up to c0mpute (free)')
expect(docs).toContain('256-bit symmetric encryption (XChaCha20-Poly1305) with an Argon2id key')
expect(docs).toContain('sk33p login --token c0k_')
expect(docs).not.toContain('ML-KEM')
const html = await (await req('/docs')).text()
expect(html).toContain('id="back-up-to-c0mpute-free"')
expect(await (await req('/healthz')).json()).toEqual({ ok: true })
expect((await req('/nope')).status).toBe(404)
})
Expand Down
Loading
Loading