Skip to content
Repos

TOSV

Markdown 8.4 KB87 lines Opens in site

Directory Raw Download

TOSV compared with comparable tools

  • Status: positioning document. Spec: SEC-09, SEC-10, SEC-11, NFR-05, D-23, docs/quantum-posture.md
  • Scope: TOSV is a component for integration with other products. It is not a product on its own: no UI to sell, no accounts, no sync client. Other systems store and fetch blobs through its HTTP, WebDAV and SFTP surfaces.
  • Evidence rule: TOSV rows come from this repo and gate runs (377/377 at v0.6.1, binaries measured 2026-11-05). Competitor rows were checked on 2026-11-05 against primary sources (official docs, release notes, repos); the notes with URLs are in research_notes/ (kept local, not committed). Cells marked "unverified" could not be confirmed from a primary source. "None documented" for a feature is an absence of evidence, not proof of absence.
  • Versions seen: age 1.3.2, OpenBao 2.7.2, restic 0.19.1, rclone 1.75.2, gocryptfs 2.6.1, Cryptomator 1.19.6, KeePassXC 2.8.0, Vaultwarden 1.37.5, OpenSSH 10.6p2, Go 1.24+ for the Go tools.

Memory scrubbing

TOSV overwrites secret memory instead of leaving it for the allocator. Passwords, credentials, derived keys and TLS key material are zeroed after use (WipeStr, wipe_mem, VKey in vault.inc; sodium_memzero in tls13.inc), derived keys are mlock'd so they are not swapped, and the duress path wipes the vault.

This is not unique. Vault documents mlock (on by default, disable_mlock to turn it off), gocryptfs documents key zeroing, and KeePassXC zeroes memory it allocates and blocks ptrace and core dumps. What TOSV adds is doing both explicitly inside a small embeddable component, without a garbage collector that can copy secrets (Go cannot guarantee erasure, Go issue 21865).

Limits: overwriting cannot reach copies the kernel, swap, CPU registers or a hostile root already took, and MADV_DONTDUMP is only probed at startup, not applied to every secret. Scrubbing shrinks the window, it does not close it.

Comparison

Legend: yes, no, partial, n/a, unverified (no primary source found), not assessed. "PQ" means a post-quantum hybrid key exchange.

Property TOSV 0.6.1 Vault / OpenBao age restic rclone crypt gocryptfs Cryptomator Vaultwarden / Bitwarden KeePassXC SOPS OpenSSH sftp
Role blob vault component secrets platform file encryption backup tool encrypted remote wrapper encrypted filesystem encrypted cloud folders password manager password manager secrets in git file transfer
Single binary, no runtime deps yes (728KB, libc only) unverified yes unverified unverified no (needs FUSE) no (Java) no (containers) no (Qt app) CLI yes, KMS backends need network no
Built to be embedded yes partial (API, heavy) yes (Go library) partial partial no no no no partial (Go module) partial
At-rest cipher and KDF XChaCha20-Poly1305, Argon2id AES-256-GCM ChaCha20-Poly1305, scrypt or X25519 AES-256-CTR plus Poly1305-AES, scrypt XSalsa20-Poly1305, scrypt AES-256-GCM (also AES-SIV, XChaCha20), scrypt AES-SIV names, AES-GCM content, scrypt AES-256-CBC plus HMAC, PBKDF2 600k or Argon2id AES, Twofish, ChaCha20, Argon2 AES-256-GCM n/a
PQ transit, HTTP yes, PQ-only by default yes, hybrid by default via Go 1.24+ TLS (Vault docs); OpenBao 2.7 can enforce it n/a partial (inherits Go) partial (inherits Go) n/a n/a unverified n/a n/a n/a
PQ transit, SSH yes, PQ-only by default n/a n/a follows system ssh partial (inherits Go x/crypto) n/a n/a n/a n/a n/a yes, default since 10.0; classical still allowed with a warning
PQ at rest symmetric 256-bit symmetric hybrid PQ recipients since 1.3.0 symmetric symmetric symmetric symmetric symmetric symmetric symmetric n/a
Secret memory handling explicit wipe, mlock for keys mlock on by default, memory inspection out of threat model, zeroing undocumented undocumented unverified unverified zeroing documented, GC limits admitted unverified clients purge keys on lock, server undocumented zeroes own allocations, anti-ptrace, no mlock found undocumented unverified
Duress wipe yes none documented none documented none documented none documented none documented none documented none documented none documented none documented none documented
Per-grant IP, time, append-only yes policies (richer) no no no no no org policies no no partial
Hard caps on rates, sizes, counts yes not assessed not assessed not assessed not assessed not assessed not assessed not assessed not assessed not assessed not assessed
Dynamic secrets, leases, PKI, SSO no yes no no no no no partial no no no
Independent audit no Vault yes (ALMOND 2025, report not fully read); OpenBao none found none found informal 2017 review only none found design audit 2017 Cure53 2017 yes (Cure53 and others, SOC 2; Vaultwarden BSI 2024) yes (2023 audit, ANSSI visa) none found unverified
Maturity new mature mature mature mature mature mature mature mature mature mature

Final verdict

TOSV is a good choice when you need a small, dependency-free blob vault that you embed in another product, where both network surfaces must refuse classical key exchange by default: HTTP/WebDAV through in-tree TLS 1.3 and SFTP through SSH, one static binary under a megabyte, hard caps everywhere, explicit memory scrubbing.

The research changed the claim. Post-quantum transit is no longer unique: current Vault and OpenBao negotiate X25519MLKEM768 by default through Go, and OpenSSH has defaulted to a PQ hybrid since 10.0. TOSV's difference is that it is PQ-only by default and refuses classical clients, and that it needs nothing else installed. Memory scrubbing is also practiced elsewhere. TOSV's niche is the combination, in an embeddable component.

It is not the best tool overall. Pick Vault or OpenBao for dynamic secrets, leases, PKI and SSO, age or restic for files and backups with mature tooling, a password manager for people. TOSV has no external security review, its TLS and SSH code is hand-written over libsodium and mlkem-native, and its Ed25519 certificates and SSH host and user keys are still classical until a PQ signature is standardized. Get an outside review before exposing it to the public internet.

How to do it (CLI)

# build (fetches pinned libsodium and mlkem-native, no other dependency)
make build

# TLS: make a self-signed Ed25519 pair, or bring your own Ed25519 PEM
./tosv --tls-selfsign vault.example.com cert.pem key.pem

# run the HTTP/WebDAV surface with PQ TLS (port is the argument)
TOSV_TLS_CERT=cert.pem TOSV_TLS_KEY=key.pem TOSV_BIND=0.0.0.0 ./tosv 8765

# store a blob (store credentials su and sp are in tosv_db.txt)
curl --cacert cert.pem --user "$SU:$SP" --data-binary @secret.bin https://vault.example.com:8765/store
# prints JSON with the blob id

# issue a retrieval grant (log in once with the bootstrap user and pass from .env.json)
curl --cacert cert.pem -c jar -d "u=$USER&p=$PASS" https://vault.example.com:8765/login
curl --cacert cert.pem -b jar -H 'Accept: application/json' \
     -d 'tw=0&ips=&frm=&to=&layers=1' https://vault.example.com:8765/grant
# prints retrieve.user and retrieve.pass

# fetch with the grant
curl --cacert cert.pem --user "$RUSER:$RPASS" -o out.bin https://vault.example.com:8765/fetch/$ID

# SFTP surface, PQ-only by default (add TOSV_SFTP_ALLOW_CLASSICAL=1 only for old clients)
# the gateway key file lists allowed client keys with their gids, mode 600, in the server directory
ssh-keygen -t ed25519 -f gw_key -N ''
echo "ssh-ed25519 $(cut -d' ' -f2 gw_key.pub) gateway gids=$GID" > sftp_gateway_keys && chmod 600 sftp_gateway_keys
./tosv-sftp 2222
sftp -P 2222 -i gw_key u@127.0.0.1   # grant credential is carried in the path, see docs/sftpserver.md

# migrate old v1 blobs: dry run first, then apply with the server stopped
./tosv --restore-v2
./tosv --restore-v2 --apply

Plain HTTP works only on 127.0.0.1. A non-loopback TOSV_BIND without TLS is refused.

Integration note

TOSV is for integration with other products. It is a building block you run behind your own application, gateway or backup pipeline, not a standalone product. Your product owns users, UI and policy; TOSV owns encrypted storage, grants, caps and the audit trail.

145.0ms