Security architecture

How SparkVault seals every vault under three independent root keys (an ML-KEM-1024 key pair, a per-account key inside FIPS 140-3 Level 3 hardware security modules, and the vault holder’s own key), and the infrastructure, deploy pipeline and audit trail built around them.

Version 3.0, November 2026

Abstract

SparkVault stores files in encrypted vaults under a Triple Zero-Trust model, and delivers short-lived secrets: each vault’s data key is derived from three mathematically independent root keys, generated separately and kept in three different places, and deriving it takes all three. This paper specifies, in the detail a security engineer needs to evaluate it, each cryptographic construction and its parameters, where each root key lives, the hardware and infrastructure that hold the keys, the path code takes to production, and the bounds of each guarantee.

The SparkVault Master Key (SVMK) is an ML-KEM-1024 key pair, the highest parameter set of NIST’s lattice-based key-encapsulation standard (FIPS 203), whose private key is kept in a managed secret store and proved against a pinned fingerprint of its public key each time it loads. Each account’s Account Master Key (AMK) is a 512-bit HMAC-SHA512 key generated inside FIPS 140-3 Level 3 validated hardware security modules (HSMs), which never release it: the platform can only ask them for a MAC. Each vault’s Vault Master Key (VMK) is 144 random bits that SparkVault draws when the vault is created and hands out once, keeping only a memory-hard Argon2id verifier of it. HKDF-SHA512 combines the ML-KEM shared secret, the VMK and the AMK’s MAC into the vault’s 256-bit key, which seals every file in AES-256-GCM chunks whose authenticated data binds each chunk to its account, vault, file and position. The secrets behind delegated vault keys are sealed with a second, independent AEAD construction, ChaCha20-Poly1305. Every random value the platform draws is the HSM’s output XORed with a local CSPRNG, with no fallback when the HSM cannot answer.

SparkVault holds two of the three root keys. The third, the VMK, stays with the vault’s owner: SparkVault receives the VMK each time its holder unseals the vault and stores only a one-way verifier of it, except for a vault whose owner has turned on a feature that opens it unattended. Every path from stored data to a vault’s key needs a MAC that only the account’s AMK, inside the HSMs, can compute, so copies of the metadata store and of object storage reveal no file’s contents, even to a future cryptographically relevant quantum computer. Section III states where this guarantee ends.

I. Executive summary

SparkVault is designed so that no single store and no single root key is enough to read a customer’s stored files. Each vault’s files are encrypted under a key derived from three independent master keys, each generated separately and kept in a separate place. The SparkVault Master Key (SVMK) sits in a managed secret store, each account’s Account Master Key (AMK) inside a hardware security module it never leaves, and each vault’s Vault Master Key (VMK) with the vault’s owner. No single store, and no copy of one, holds enough to decrypt a vault. Deriving a vault’s key takes all three.

Key encapsulation is ML-KEM-1024, the highest of NIST FIPS 203’s three parameter sets (security category 5), so the SVMK’s contribution to each vault key holds against an adversary who records ciphertext today and runs a quantum computer later. The AMK is an HMAC-SHA512 key with 512 bits of key material, HKDF-SHA512 (RFC 5869) combines the roots under versioned, domain-separated labels, and file data is sealed with AES-256-GCM. The secrets behind delegated keys are sealed with a second AEAD construction, ChaCha20-Poly1305 (RFC 8439); both ciphers take 256-bit keys and produce 128-bit authentication tags. The VMK’s verifier is Argon2id (RFC 9106) at 64 MiB, three passes and four lanes, so each guess at the VMK’s 144 bits costs an attacker holding a stolen verifier a full memory-hard evaluation.

Each account’s AMK is created inside FIPS 140-3 Level 3 validated HSMs as a non-exportable key, and no operation returns it. The same HSMs wrap the per-vault key behind every delegated key, generate the RSA key pairs that sign the platform’s access tokens, and supply one of the two sources of every random value the platform draws. The platform XORs the HSM’s output with its own CSPRNG, so neither source alone decides a nonce, a salt or any key the platform derives from a draw. When the HSMs cannot answer, unseals and file transfers fail closed (section X).

A vault is opened by an unseal ceremony (section XI). Its holder presents the VMK over TLS; the platform checks it against the verifier, decapsulates the vault’s ML-KEM-1024 ciphertext with the SVMK, asks the HSM for the AMK’s MAC over a message that names the vault and its account, and derives the vault’s key with HKDF-SHA512. The key is then sealed into the session’s record under two layers of AES-256-GCM, a fresh data key and a key-encryption key derived from the AMK, and overwritten in memory. A session closes an hour after its last upload, download or change by default, and a day after its unseal at most. Each request re-opens the envelope only for as long as it needs the key. No backup ever holds a vault’s key or a Spark: the tables that keep sessions, file transfers, uploads and Sparks keep no point-in-time backups, so a vault’s sealed key and a Spark exist only in their live records, and one that has been removed is gone from every copy. The one thing a backup keeps that can lead to a vault’s contents is the system grant of a feature its owner has turned off, for up to 35 days (section III).

Access can be delegated without handing over the VMK. A delegated vault access key is the VMK XORed with a fresh 256-bit random secret. When a person holds one, SparkVault stores only the key’s SHA-256 digest and the secret sealed with ChaCha20-Poly1305, under a key that is derived from an HSM-wrapped per-vault key and salted with the delegated key itself, so the stored secret opens only when its holder presents the key. Each delegated key can be revoked on its own, leaving the VMK and every other delegated key as they were (section VIII).

File data moves through a streaming file service that encrypts each chunk of up to 50 MiB as it arrives and writes nothing to disk, so a file of up to 5 TiB is never held whole. Each file takes a fresh random 96-bit base nonce, and each chunk’s nonce is that base XORed with the chunk’s index. Each chunk’s authenticated data binds it to its account, vault, file and position and marks the last one, so a chunk that is reordered, moved to another file or vault, or cut from the end of its file is rejected. Each file and folder is created with its name sealed as well, together with a file’s content type, its original file name and the address it was uploaded from, under a key of its own derived from the vault’s key and padded so that the stored length reveals only a size bucket.

The guarantee has limits. SparkVault generates each vault’s VMK, shows it once and keeps only its verifier, but the platform receives the VMK at every unseal and holds the derived key while the session lasts. A vault whose owner turns on sharing, an upload portal or widget, Messaging or the help desk is one the platform can open unattended, by design. Against an adversary in control of the running platform, the protection is access control, not cryptography. Section III sets out each bound; sections IV to XI specify the cryptography, section XII the transport, and sections XIX and XX the audit log and incident response.

SparkVault is SOC 2 Type 2 compliant, and customers can request its SOC 2 Type 2 report and penetration test summaries (Independent security validation, section II). Around the cryptography, the platform is built as independent layers (section II). Every public web and API host resolves to a global edge network that absorbs volumetric attacks and terminates TLS, preferring a hybrid post-quantum key agreement, X25519 combined with ML-KEM-768, with every client that offers one (section XII). The API runs as event-driven functions, in execution environments isolated from one another on micro-VMs that no other customer shares, inside a private network whose paths from the API to the metadata store, object storage, the HSMs and the secret stores do not cross the public internet. The file service runs as isolated container tasks behind a firewall that admits only the edge network and its load balancer. The cloud account’s network, compute, data stores, queues, alarms and service roles are declared in code and changed by applying saved plans. Code deploys to the cloud account authenticate with short-lived credentials exchanged for the CI run’s identity token, require the repository guards and the full test suites to pass before anything ships, and ship artifacts built from the locked dependency tree. Every package in the workspace’s dependency graph is pinned by a SHA-512 integrity hash, barred from running install scripts, and audited against published advisories.

II. Platform and infrastructure security

Around the cryptography, the platform is built as a series of independent layers, each designed on the assumption that the one outside it can fail: encryption protects what the platform stores, and these layers protect the running service that combines the keys. Every public SparkVault web and API host resolves to an edge network, which absorbs volumetric attacks and terminates the client’s connection. An origin lock has the API’s HTTP routes and the file service check that a request came through the edge. Compute runs in isolated execution environments that the provider creates from each deploy’s artifact and later discards, with no server of our own to compromise or keep a foothold on. A private network keeps the API’s paths to its private stores and key services off the public internet, and admits inbound only the flows each component needs. Hardware security modules hold the keys that no software may export. A deploy pipeline ships only artifacts whose test suites have passed, built from the locked dependency tree, and reaches the cloud account only with credentials that expire within the hour.

Where a property is leased, such as the validation level of the HSMs or the isolation that the provider’s hypervisor enforces, this section states it as the provider publishes it, with how the platform uses it.

The platform runs in one region of its cloud provider; its private network and its compute span two of that region’s availability zones (Disaster recovery and business continuity, below). Each data center controls physical access at its entrances with on-site security staff, video surveillance and intrusion detection, and authorized staff pass multi-factor authentication to enter. The managed services that run the platform’s compute, storage, network and keys are in scope of the provider’s SOC 1, SOC 2 and SOC 3 reports, its ISO/IEC 27001 certification and its PCI DSS Level 1 service-provider certification. The provider’s FedRAMP certification for the platform’s region is at Class C, the Moderate baseline. The HSMs are validated to FIPS 140-3 Level 3, and section X describes them and the provider’s controls around them. SparkVault adds its own cryptographic layers on top of all of this (sections IV to XI).

Edge network and origin lock

Every public SparkVault web and API host is reached through the edge network, among them the API, the file service, the console, the sign-in origin, the shared-file and upload pages, the help desk portals and this site. Each host name resolves to the edge’s addresses, never to the platform’s, so a client’s connection lands at a nearby point of presence, which terminates TLS and, for a host the platform serves, forwards the request to it over TLS of its own. Section XII gives the protocol versions, cipher suites, key-exchange groups and certificates the edge serves, and the hop behind it. The edge is a global anycast network. Its DDoS protection covers layers 3, 4 and 7, is always on, and detects and mitigates attacks automatically across the whole network, so a volumetric flood aimed at SparkVault’s hosts meets the edge’s capacity, not an origin’s. Attacks that arrive as well-formed requests meet the edge’s web application firewall, which inspects traffic at layer 7, classifies threats with machine learning, and applies rules that block SQL injection, cross-site scripting (XSS) and the other attack vectors of the OWASP Top 10 before a request reaches the platform. The edge’s operator is itself certified to ISO/IEC 27001, holds a SOC 2 Type II report on its security, confidentiality and availability controls, and is PCI DSS Level 1 compliant for a defined set of its services.

Part of the platform runs on the edge itself. The web console, the marketing site and the shared-file and upload pages are static builds that the edge’s function runtime serves with no origin server behind them. The sign-in origin’s page shell is rendered at the edge, which proxies the rest of that origin’s traffic to the API, and the help desk portals and the public avatar host are edge functions as well. The edge runs each function in a sandbox whose memory is isolated from every other tenant’s code. A help desk customer’s own domain is served by the edge with a TLS 1.2 minimum, under a domain-validated certificate issued for that domain.

The API’s HTTP routes and the file service check that a request came through the edge (section XII).

Serverless compute and execution isolation

SparkVault runs no server, virtual machine or host operating system of its own. The API, every product built on it and the platform’s background work run as event-driven functions; the file service runs as managed container tasks; the web surfaces run at the edge (above); and the metadata store, object storage, the queues, the cache cluster and the HSMs are managed services whose hosts the provider operates. There is no host for us to harden, patch or log into.

Each of the API’s execution environments is created from the deployed package and reserved for one version of one function, never reused across functions or customers, and run inside a hardware-virtualized micro-VM; the provider isolates environments from one another with kernel namespaces, control groups, system-call filtering and a scoped file system. An environment serves one request at a time and is retired when the provider recycles it or a deploy replaces the package. The functions run in the private network’s private tier (Network isolation, below), with no public address, and nothing can open a network connection into an execution environment. A function is reached only through the provider’s invocation path: by the HTTP and WebSocket gateways, the queues, streams and timers wired to it, and the identities granted the invoke action. A function holds a vault’s key only in memory, only for the request that needs it, and overwrites it when the request ends (section XI).

The file service runs as managed container tasks, each isolated from every other task, with no kernel, processor, memory or network interface shared between them. A task runs one minimal image, its service process as an unprivileged user, from a self-contained production bundle that carries no development dependencies, under an identity limited to the records, objects, secret, HSM operation and API calls the file service uses (Access to production, below). The provider allows no privileged container, restricts the Linux capabilities a container may add, and gives no one, its own operators included, a way into the hosts that run the tasks.

The file service streams. An upload arrives as resumable chunks of up to 50 MiB, each encrypted with AES-256-GCM under the vault’s key as it passes through memory and written to object storage; a download is read and decrypted chunk by chunk. A file of up to 5 TiB is never held whole, and the service writes nothing to disk. The vault’s key reaches a task only wrapped, in the envelope of a transfer token or of the upload session that token opened, which the task unwraps for the request that uses it and overwrites afterwards. A stopping task drains its open transfers for as long as its stop allows, and an upload cut short resumes on another task from its last committed chunk.

A conventional server accumulates state an attacker can hide in: a modified binary, a scheduled job, a kernel module, a key left on disk. This architecture bounds how long such state can live: whatever an attacker plants in an execution environment lasts only as long as that environment, which the next deploy or the provider’s own recycling discards. Every execution environment starts from the artifact the pipeline built for the commit being served, and none is patched in place. The deploy pipeline (below) builds the code a service starts from only after that service’s test suites pass on it, and the account’s audit trail records every change to a function’s package or to the specification a service’s tasks run from.

Network isolation

The platform’s functions, its cache cluster and its file service run inside a private network that the platform’s infrastructure code defines, spanning two availability zones, in two tiers. The API’s functions and the cache cluster sit in the private tier, where nothing has a public address and the only route to the internet is a managed NAT gateway, which lets them open connections outward and lets nothing outside open a connection in. The file service and its load balancer sit in the public tier, behind the firewall described below.

The API’s paths to its private stores and key services stay on the provider’s network. It reaches the metadata store and object storage through private gateway routes, which need no internet gateway or NAT, and the HSM service and both managed secret stores through private endpoints inside the private tier, whose traffic stays on the provider’s network without traversing the public internet. The file service takes the same private endpoints to the HSM service and the secret store, and reaches object storage and the metadata store over a path the provider documents as never leaving its network. The API’s other outbound calls, to queues, mail, the edge network’s store of published public files and the third-party services it integrates with, leave through the NAT gateway.

The functions, the private endpoints, the cache cluster and the file service’s tasks each sit behind a stateful firewall that denies inbound traffic unless a rule admits it. The rules admit only what each component needs: HTTPS from the API and the file service to the private endpoints, the API alone to the cache, and only the edge network and the load balancer’s own subnets to the file service. The load balancer preserves each client’s source address, so the file service’s firewall judges the real sender, independently of the origin check the service itself makes (section XII). The API reaches the cache only over TLS, with an authentication token, which the cache cluster’s configuration requires, and the cache encrypts its data at rest.

Past the edge and the network, requests meet the application’s own gates before a handler runs. A protected route requires a credential: a signed access token, or an API key, a 240-bit random secret that the platform shows its creator once and stores only as its SHA-256 digest. Each account’s requests are counted against its rate limit by an atomic counter in the metadata store, and a request whose count cannot be recorded is refused. The anonymous secret sender, which takes no credential at all, spends budgets keyed on the address the edge reports before it draws a random value or derives a key, and a send whose budget cannot be recorded is refused.

Infrastructure as code and immutable deployments

The platform’s cloud infrastructure is declared in code and kept in version control, with documented exceptions, the root keys among them (below). Two declarations cover it. The bootstrap creates the declarations’ own state store, an encrypted, versioned bucket with a lock table so that two applies never interleave, together with the deploy identity’s infrastructure permissions. The production declaration holds the rest: the private network and its endpoints, the API’s function and its HTTP and WebSocket gateways, the container service and its load balancer, the platform’s tables, buckets and queues, the audit trail, the alarms, and the service roles’ permissions. Every live table, bucket and queue, the audit trail, the private network, the API’s function, and the file service and its load balancer carry a guard that fails any plan which would destroy them. Every live table is also deletion-protected by the database service, so removing one takes two separate applies.

The keys the cryptography depends on sit outside the declarations on purpose. The SVMK and the HSM key-encryption key behind every delegated key are created once by an operator, and each AMK by the API at its account’s first use, never by the declarations, so no plan, apply or destroy can replace or delete one. No role the platform defines may schedule a key’s deletion or disable one, and every call that would do either is reported to operations as soon as the audit trail records it.

Platform secrets, among them the SVMK’s private key, the token-signing keys, the origin secret and the credentials of the services the platform calls, live in a managed secret store as encrypted parameters, encrypted under keys held in the FIPS 140-3 Level 3 validated HSMs. The API reads each one through the private network’s endpoint for the store. The operator scripts that make the SVMK and the token-signing key pair make them with the HSM-backed entropy service, prove each pair by a round trip before storing it, and write it straight into the store, never printing a private key.

A change to the production declaration, other than a file-service roll-out (below), applies in two steps. The first plans the change from a commit and saves the plan, with a readable copy for a person to review. The second is a separate dispatch that names the planning run and applies that run’s saved plan exactly. It refuses a plan made from another commit or branch or by a re-run, passes the repository guards first, and waits behind the one lock that every plan, apply and file-service roll-out shares. A saved plan whose state has moved since it was made is refused. The format, validation and pin checks a change must pass before any plan runs are described under Infrastructure as code checks (below).

No job that touches the cloud account holds a stored credential for it. Each presents its CI run’s signed identity token to the provider’s token exchange and receives credentials for the deploy role that expire within an hour; no long-lived access key for the cloud account exists in CI. The deploy role’s own permissions, and the fences around them, are described under The deployment identity (below). Workflow tokens are read-only by default, and the few jobs allowed to mint an identity token or to push a commit are enumerated and held to that list by a test. Each CI job runs on a new virtual machine that the CI provider provisions for that job. The platform’s public SDKs are published to the package registry through trusted publishing, which exchanges the CI run’s identity token for publish rights, so no registry token is stored either.

Each deploy workflow carries its own gates, so a failing check stops the deploy. Before the API ships, its workflow lints every package the deployment carries and runs the repository guards (Automated security checks, below). It then requires the full test suites of the API and of every product it carries to pass, including integration suites against a local emulation of the metadata store and browser suites that drive real consent forms. It builds the deployment package from exactly the dependency tree those tests ran on, then unpacks it and starts the API from it as a cold start would, refusing the deploy if any module fails to resolve or any error is logged. It confirms that the function’s runtime is the one the tests used, and only then updates the function.

The file service’s deploy imports every module of the exact bundle its image will run before it builds the image, and runs the credential scan, the repository guards, its own suites and the API’s suites over its code. Each deploy builds one image, tagged with the commit it ships. Its roll-out applies a plan limited to the service and the specification its tasks run from, and a check refuses the deploy if the plan would change anything else, such as a network, a role or a table. New tasks start beside the old ones, the deploy waits until the service is stable, and a canary then confirms through the edge that the new tasks serve and that the decrypt path answers.

A deploy replaces execution environments and never modifies a running one: each commit’s API package is a new artifact the provider moves the function onto, and the file service’s tasks are replaced, never patched. Deploys of each artifact run one at a time, and a newer push replaces any older run still waiting, so the newest commit pushed deploys last. The API’s deploy runs only from the main branch and refuses a re-run of a commit older than the one already shipped. The file service, the console, the site, the SDK on the CDN and the mobile app’s builds ship only once the API their commit needs is live.

Supply chain security

The platform treats each third-party package as untrusted input to the build, and constrains how a package can enter the workspace, what it can run while the workspace installs it, and what of it reaches production. The audit of locked packages against published advisories, the committed-credential scan and the repository guards are described under Automated security checks (below).

Every package in the workspace is pinned. The workspace’s lockfile records the exact version of every package in its dependency graph and a SHA-512 integrity hash of each one’s published archive. Every install of the workspace, in CI, in each deploy and inside the file service’s image build, runs in frozen mode: it installs the tree the lockfile records, checks each archive against its hash and fails on a mismatch, and fails if the lockfile does not name a version. The package manager is pinned to one exact version and the runtime to one major version, each named in one file that a repository guard holds every deploy to. A required dependency whose declared engine range excludes that runtime fails the install.

Installing the workspace runs none of its dependencies’ code. Package install and build scripts, a common way for a malicious package to run code on a developer’s machine or a build server, are off for every dependency of the workspace. The workspace lists each dependency that declares one, each set not to run, and a newly added dependency that declares one fails the install until a person decides. When the lockfile is updated, the package manager resolves each dependency, transitive ones included, to a release published at least a day earlier whenever one satisfies the declared range, so an hours-old release, the kind a compromised maintainer account publishes, is passed over whenever an older one fits. Each release the workspace admits inside that window on purpose is listed by name with the reason it was reviewed. A transitive dependency may not come from an arbitrary git repository or tarball URL, only from a trusted source such as the package registry.

The API’s deployment package carries the API’s production dependency graph alone. The file service’s image is a multi-stage build whose final stage holds only a self-contained production bundle, development dependencies dropped, on a minimal base image, with its service process running as an unprivileged user. It is built once per deploy, from the commit it ships, and the registry scans it for known vulnerabilities as it is pushed.

Access to production

The production cloud account is acted on by the running services, each under a role of its own, by the deployment pipeline, by the people who operate the platform, and by an independent compliance-monitoring service through a role that reads the account’s configuration and changes nothing in it (independent security validation, below). Each acts through the provider’s authenticated management interface, and the account’s audit trail records what each one does to keys, secrets and roles, and every file chunk any of them writes or deletes. Section III states why this layer carries so much weight: it is the protection against an adversary who would take control of the running platform, which cryptography alone does not stop.

Service roles

The API and the file service each run under a role written for the actions its code performs. In the metadata store, the API’s role holds item-level reads, writes, conditional checks and transactions on the platform’s tables, and may scan only a short, named list of tables. In object storage it may read, write and delete an object by its exact key, and it may not list the file store’s keys. Of the hardware security modules’ operations, it may compute a MAC with an account’s key, wrap and unwrap under the one key-encryption key, generate the entropy service’s key pairs, draw random bytes, and create account keys. It holds no action that disables a key, schedules a key’s deletion, or changes a key’s policy or alias. In the secret stores it reads secrets under named paths, may list one store’s secret names, and may write a single parameter.

The file service’s role is narrower still. It reads file records and never writes one, keeps its own upload sessions and transfer records, reads, writes and deletes chunk objects by key with no right to list them, reads, writes and deletes the sealed photo thumbnails it renders, also by key, computes MACs with account keys, calls the API, and reads exactly one secret: the value that proves a request reached it through the edge network. A test in the file service’s deploy drives every database call its code can make against a recording stand-in, maps each call to the permission it needs, and fails unless the role grants exactly those permissions, so a database grant the code does not use cannot ship.

Neither role can disable a key, schedule a key’s deletion or change a key’s policy; delete a secret parameter, a table or a table’s backups; or remove a stored object’s earlier versions. What either service deletes from the stores of record therefore stays recoverable: a record deleted from a table of record remains in that table’s point-in-time recovery for 35 days, and a deleted file chunk leaves a delete marker over a version that stays restorable for 90 days (disaster recovery, below).

The deployment identity

Pipeline deployments reach the cloud account with the federated credentials, expiring within the hour, that infrastructure as code (above) describes. The deployment role applies the infrastructure, so its reach is wide, and it is fenced where a deployment has no business. It cannot change its own permissions; only an administrator can. It may create, start and update the account’s audit trail, never stop or delete it, and it is denied writing or deleting any log in the store that holds the trail’s logs. It holds no grant on an account key or on the key-encryption key, so it cannot itself compute a MAC with an account key, or disable either key or schedule its deletion; the code it deploys runs under the service roles above, whose grants it can change only through calls the trail records. It manages the platform’s tables without reading or writing their items. A standing test evaluates the grants the infrastructure definitions give the deployment role, matching each statement as the provider’s policy language does, and fails if the role could rewrite its own grants, stop or delete the trail, or write or delete a log in the trail’s store.

Operators

People administer the account through the provider’s authenticated management interface; there are no servers of SparkVault’s own to sign in to. The scripts operators run against production data, and the safeguards built into them, are described under operational security, below.

Records of access

One account-wide trail records every management event in every region of the account, the provider’s global identity services included, together with every write and every deletion of an object in the file store. Each entry names the identity that made the call, the address it came from, the time and the request. Because the trail takes every management event, it also records every use of the hardware security modules (each MAC computed with an account’s key, each wrap and unwrap under the key-encryption key, each random draw) and every read of a secret from the secret store, with the role that made it. The trail delivers to a log store of its own, closed to public access and to any connection without TLS, in which the deployment identity may neither write nor delete a log, and where any deletion made by a request raises an alarm. The trail’s integrity validation is on: it delivers signed digests that record a SHA-256 hash of each log file and chain to one another under RSA signatures, so a log file altered, removed or forged after delivery is detected when the logs are validated against them. Beneath the trail, the provider keeps a recent history of management events of its own, which no one, SparkVault included, can alter or delete.

The trail is also what the platform watches. Rules on the account’s event bus report to operations, as the trail records them, destructive and anti-forensic control-plane calls, among them a key scheduled for deletion or disabled, a table deleted or its recovery turned off, a bucket’s versioning or lifecycle changed, a policy written or attached to a role, the trail stopped and an alarm deleted. Each report names who made the call, from where, when and with what request. A stored file version deleted for good by a request raises an alarm at the first event, and so does any deletion a request makes in the trail’s log store.

Inside the application, every vault unseal, delegated key use and file download is recorded in the audit log and kept for three months by default; for each vault, the account chooses how long the records of public access through shared links and upload portals are kept, or turns them off (section XIX).

Automated security checks

Beyond the test suites (infrastructure as code, above), three automated checks watch the code and what it depends on: an audit of the workspace’s locked dependencies against published advisories, a scan of every application, package, product and infrastructure tree for committed credentials, and repository-wide guards that every deploy runs before it ships. The audit and the credential scan also run on pull requests and, on a schedule, against the main branch.

Dependency vulnerability audit

Every package in the workspace’s dependency tree is checked, at the exact version the lockfile pins, against published security advisories, and the audit fails on any advisory of moderate severity or higher unless that advisory has been accepted as described below. Because the scheduled run audits the main branch as it stands, an advisory published after a package was adopted surfaces even when no code around it has changed. A finding is answered by raising the floor: the workspace requires the affected transitive package’s patched release, scoped to one major version line where a package has dependents on several, and moves a dependent onto a major version it did not ask for only where that dependent’s use has been checked against it. An advisory that no floor can lift, because its fix is published outside every version range the package’s dependents accept, or not at all, is accepted only with its package, path, reason and re-check condition written beside it, and a test fails if an accepted advisory’s package is in what the API or the file service runs.

Guards on every deploy

Repository-wide guards run in every deploy workflow, ahead of every step that ships. The randomness guard lexes the production source of every language the repository holds and refuses any raw random-number source, key generator or library call that draws randomness of its own, anywhere outside the platform’s entropy service (which XORs the HSM’s random output with the host’s CSPRNG, section X) and the named device-secret mixes that combine a device’s own share with an entropy-service draw; both infrastructure applies run it too, so infrastructure that would draw its own randomness never applies. The hidden-character guard fails on any raw invisible or bidirectional-control character in any file the repository tracks, which closes, across the repository’s own files, the bidirectional-text technique catalogued as CVE-2021-42574, in which source code displays in a different order than the order a compiler reads it. The toolchain guard requires the runtime major version that every workflow, the container image and the functions run, and the package manager every install uses, to come from the one file that pins each. The API’s deploy and the deploys of the sign-in, help desk and notification edge workers also run a module-boundary test that holds each module to the published interfaces of the others.

Infrastructure as code checks

Every change to the infrastructure definitions is format-checked and validated, then held to the code by pin tests before any plan or apply may run. The pins fail when the file service’s role grants a database permission its code does not use, when a file-service alarm stops matching the log code it watches, when the deployment identity could rewrite its own grants or touch the trail’s logs, when a family of metadata tables drifts from the one shared declaration that sets its point-in-time recovery, encryption and deletion protection, or loses its protection against being destroyed, and when the file store’s version window differs from the 90 days this paper states. A plan against production runs for every such change on a pull request from within the repository and on the main branch; a pull request from a fork never receives credentials. Infrastructure changes apply through the two-step plan and apply that infrastructure as code (above) describes; the deployment role’s own grants, which it cannot change, are applied by an administrator.

Claims held to the system

The platform’s public claims are tested as well. Tests over the copy of the public site, the console, the mobile app, the CRM integrations, and the platform’s emails and shared-link pages refuse every claim on one shared list of security claims that this paper contradicts, and the public site’s build fails if a page names an infrastructure vendor.

Independent security validation

SparkVault is SOC 2 Type 2 compliant, with controls aligned to the SOC 2 Trust Services Criteria for Security, Availability and Confidentiality. Third parties run SparkVault’s penetration testing and security audits. Every month, independent security firms run penetration tests against the production infrastructure, the APIs and the web applications: external network penetration testing, an assessment of the APIs’ security, testing of the web applications by the OWASP methodology, and a social engineering assessment. A critical finding from those tests is remediated within 72 hours, and every other finding within 30 days. Those deadlines govern the findings of SparkVault’s own penetration tests; a report from an outside researcher follows the vulnerability disclosure program of section XX, which sets no fixed timeline. Customers can request SparkVault’s SOC 2 Type 2 report, summaries of its penetration tests, and completed SIG and CAIQ security questionnaires by writing to security@sparkvault.com, as the compliance page describes.

Alongside those reviews, an independent compliance-monitoring service runs automated checks of SparkVault’s security controls through a role in the production account that reads its configuration and changes nothing in it; the privacy policy lists it among the providers SparkVault shares information with. Outside researchers report vulnerabilities under SparkVault’s published disclosure program, which offers safe harbor for good-faith research (section XX).

Data isolation and segregation

SparkVault is multi-tenant: every customer account’s records share the metadata store’s tables, and every account’s encrypted chunks share the file store. Isolation between tenants is therefore built into three layers: the scope every request is given, the keys under which records and objects are stored, and the cryptographic keys every vault’s content is sealed with.

Scoped by the credential

The account an authenticated request acts for is the one its validated access token or API key belongs to, never one the request names in its own parameters. The platform’s own services also reach the API over internal channels that never cross the public API, and the API tells those calls apart from outside requests by properties a client cannot forge. Every route of the file interface also requires a Vault Access Token that the platform minted for that vault and that account, which carries the access level of the credential that unsealed the vault, and the platform promotes the token’s account onto the request, so every handler downstream reads one source of truth for whose data it is touching. The anonymous upload page, which reaches a vault without an account credential, takes the account from the vault’s own record, and an anonymous upload is accepted only when the vault’s owner has turned that page or widget on.

Ownership in the record keys

The metadata store’s keys carry ownership. A vault’s record is keyed by the vault and its owning account together, so every read and write made on an account’s behalf names both, and a lookup made for one account cannot address another account’s vault even with the right vault identifier. A file’s record is keyed under its vault, and an account’s list of vaults is read from an index partitioned by the account. The idempotency key a tenant chooses for a notification send is namespaced by the account in the record’s key, so one tenant’s key can neither read nor occupy another’s. Each recipient’s notification inbox is partitioned by the sending account and the recipient together, and a pagination cursor naming any partition other than the caller’s own is refused before a single read is made. Apart from the API’s short list of scannable tables, every read the API makes is a keyed lookup or a query within one partition.

The store also enforces ownership inside its own atomic operations, where no concurrent change can slip between a check and the write it guards. Creating a link to a file is one transaction that checks, in the same atomic step, that the file’s record still exists, is active and belongs to the account creating the link; if any of the three has changed, the transaction fails and no link exists. Every update to a vault’s record is conditioned on the record existing, so a write that arrives after the vault’s deletion fails instead of recreating a fragment of it.

Addressed by tenant in the file store

Every chunk of every file is stored as an object of its own, under a key that begins with the owning account and names the vault, the file and the chunk’s position. Neither service may list the file store, so the services reach a chunk only by the exact key its file’s record names. Each object holds one chunk’s AES-256-GCM ciphertext followed by its 16-byte authentication tag. Public access is blocked on the store, and the store applies its own AES-256 encryption at rest beneath SparkVault’s.

Where a vault’s record and a file’s chunks are stored, and what binds each to its tenant
// A vault's record is keyed by the vault and its owner together
vault = MetadataStore.Get(key = (vault_id, account_id)) // account_id: the account the request's credential resolved
// Chunk n of a file: the object's key begins with the owning account, and no service may list keys
key = ObjectKey(account_id, vault_id, file_id, upload_id, n)
// The object holds chunk n sealed under its vault's VAK, bound to the same names (section XI)
aad = "SparkVault:Ingot:v1|acct=" || account_id || "|vault=" || vault_id || "|id=" || file_id || "|chunk=" || n // the last chunk adds "|final=1"
object = AES-256-GCM.Seal(VAK, nonce = file.base_nonce XOR n, chunk, aad) // ciphertext || 16-byte tag

Separated by cryptographic key

Above the storage layout sits the cryptography. Each account has its own Account Master Key inside the HSM (section X); the salt that derives each vault’s key is a MAC under that account’s key over a message naming both the vault and the account, and the derivation’s info string names the vault again (section XI). No two vaults share a key, even within one account, and no vault’s key can be derived with another account’s key. Each chunk’s associated data binds it to its account, vault, file and position, so a chunk copied into another tenant’s storage path, moved into another file, or reordered within its own fails authentication when it is opened rather than decrypting to anything. When an audit event about a vault or a file is written with the vault’s key, its details and the client address and agent it records are sealed under a key derived from the vault’s key (section XIX), so that part of the log is partitioned cryptographically by vault as well.

Data residency

SparkVault’s own stores sit in a single region of its infrastructure provider, in the United States: the metadata store and its point-in-time recovery, the file store and every earlier version it keeps, the account keys in the HSMs, the secret stores, the audit log, the API’s and the file service’s logs, and the trail. Nothing is replicated to another region. Within the region, the metadata store and the file store each keep their data across at least three of the region’s physically separate availability zones (disaster recovery, below). The exceptions are what the edge network keeps, where it chooses to keep it: the files published to be public (profile photos, organization logos and published help-center articles) and page-view analytics that set no cookies, as the privacy policy states, and the logs of the code SparkVault runs at the edge. Connections to SparkVault terminate at the edge network’s global locations (section XII) before they reach the region.

Monitoring and detection

Monitoring is continuous, and it has two parts. A security operations center monitors SparkVault around the clock, seven days a week, and responds to the threats it detects. Alongside it, the platform watches itself automatically. Every alarm the platform defines notifies operations when it fires and again when it clears, and carries a description of what it watches. An alarm that stays in the alarm state is raised again by a scheduled sweep until it clears.

Failures watched by name

Failures that must not pass silently, such as an audit-log record that failed to write, a stored field or a token envelope that will not open under its key, or a chunk a download could not read while the file’s record still names it, are each written as a stable code on a log line of their own, with a log filter matching exactly that code and an alarm on it. A chunk or thumbnail that fails its integrity check raises an alarm as well. A reworded code would silently kill its alarm, so tests in the API’s and the file service’s deploy gates read the production alarm definitions and fail the deploy unless every alarmed code in the source has its filter and alarm.

Key-integrity failures raise alarms the same way, and each one fails closed. Every instance of the API checks the ML-KEM key pair the secret store holds against the fingerprint of its public key pinned in the deployment; an instance that finds any other pair, or the pinned public key beside a private key that is not its own, refuses every encapsulation and decapsulation, so nothing is decrypted under a wrong root and nothing new is sealed under one. An account that owns vaults but has lost the binding to its account key is refused rather than given a new key, and if the key-encryption key behind delegated keys is disabled or scheduled for deletion, every delegated key is refused until that same key is restored; no replacement key is ever made.

Crashes, health checks and an outside probe

An invocation of the API that crashes, by an unhandled exception, a timeout or an exhausted memory limit, alerts operations. So do a file-service container failing its load balancer’s health checks, sustained high processor load on the file service, and a delivery queue whose oldest message has waited too long or whose retries are spent; when a file-service container stops for a fault, operations is sent its stop code and the reason. From outside, the provider’s health checkers, in locations around the world, fetch the file service’s health endpoint through the edge network, exactly as clients reach it, and expect its healthy answer. A failure anywhere on that path (name resolution, the edge network, the load balancer, or every container at once) alerts operations even when every signal inside the region looks normal, and a checker that stops reporting counts as a failure.

Attacks and anti-forensics

Destructive and anti-forensic calls at the control plane reach operations as the trail records them (records of access, above). Abuse of the public surfaces is watched as well. Limits on anonymous use alert operations when they are reached, and so does a run of signed inbound deliveries that fail verification, because either can mean an attack in progress.

Logs

The API’s and the file service’s operational logs are collected in one log service in the region; the records behind the deletion alarms are kept longer than a deleted file version stays recoverable, so the record of a deletion outlives the version it names. The file service writes one structured JSON object per line, and every line the API writes inside a request carries that request’s identifier, so one request can be followed through every line it produced.

Disaster recovery and business continuity

SparkVault holds its operations to an internal service-level objective of 99.99% availability, an engineering target the company sets for itself. The platform runs in two availability zones, and every table of record in its metadata store can be restored to any second of the last 35 days. The provider builds each region from availability zones that are physically separate, each with its own power, cooling and physical security, and links them by redundant low-latency networks.

Compute across zones

The API’s function reaches the private network through subnets in both zones. The file service keeps at least two containers running in subnets of both zones, which the provider aims to spread across the zones it can reach, behind a network load balancer that routes each connection to a healthy container in either zone. A container that stops, or fails its load balancer’s health checks, is replaced by the provider’s container scheduler, so the loss of a container leaves the rest serving while it is replaced, and with the containers spread across both zones, so does the loss of a zone. Capacity scales out under load and never falls below two containers, and a roll-out keeps full healthy capacity throughout, starting the new containers beside the old ones.

Durability of the stores

The file store is designed by its provider for eleven nines (99.999999999%) of annual object durability: it stores every object redundantly across at least three availability zones, so that the data survives the loss of an entire zone. The metadata store replicates every table synchronously across three availability zones of the region. The account keys’ durability is the HSM service’s (section X).

Backups and versions

Point-in-time recovery is on for every table of record: the accounts, the users, the vaults, the records of files and folders, the delegated keys with their system grants, shared links and their receipts, the audit log, billing, identities, and the help desk’s and the other products’ data. For each, the store keeps continuous backups with recovery points at one-second granularity across the past 35 days, encrypted like the tables themselves, in the same region. The short-lived tables keep no backups at all: no backup holds a vault session’s record, a file transfer’s token record, an upload session’s record, a Spark, a sign-in session, a refresh token, a rate-limit counter or a one-time code. A record in one of those tables exists only in the live store, and once it is removed, by its owner, by a revocation or by the store’s expiry process, no copy of it remains. Every live table is deletion-protected, so it cannot be deleted by anyone while that protection is on.

In the file store, which holds every file’s encrypted chunks, versioning is on for every key. Earlier versions of every stored object, kept 90 days after it is replaced or deleted, lie beneath the current ones: when either service deletes a chunk, the store places a delete marker over it and keeps the version beneath, and neither service’s role can remove a version. A version that any request removes for good raises an alarm, and a daily inventory lists every version and delete marker, so a chunk missing from a file that nobody has downloaded can be found from the inventory rather than from a customer’s failed download. The 90 days outlast the 35 of the tables of record, so a file’s record restored from point-in-time recovery still finds its chunks.

Deletion as a recoverable act

A vault deleted from its settings is recoverable by design. That deletion requires an owner’s or administrator’s session and the vault’s exact name; it locks the vault at once, emails the account’s other administrators with who asked and when the deletion will run, and runs seven days later, and it can be cancelled until then. An account key in the HSM can only be scheduled for deletion, with a waiting period in which the deletion can be cancelled (section X), and the platform’s root keys are permanent (section XX).

Recovery follows written runbooks. The runbook for restoring records restores the table, as of the moment before the loss, to a separate table, finds the affected records there, copies each back under the condition that it does not already exist, and deletes the separate table. The runbook for a deleted chunk reads from the trail who deleted it and stops that caller first, then removes the delete marker so the version beneath becomes current again. While a restore is under way, operators set a flag that stops the operator tools that delete data, so a half-restored state (records back before the accounts they belong to, chunks back before their records) is never mistaken for orphaned data and deleted; a flag that cannot be read stops those tools too.

Operational security

Application code reaches production through deploy workflows that guard, lint and test what they ship, and infrastructure through the two-step plan and apply that infrastructure as code (above) describes. A change made any other way is still a call to the provider’s management interface, recorded by the trail, and reported to operations when it is of a kind records of access describes.

The scripts operators run against production data are dry runs unless the operator passes an explicit apply flag, and the dry run is the precondition check: its runbook has the operator apply only what it reported. Each is run, by its runbook, from a checkout of the commit production runs, or of the release it belongs to, and prints record identifiers and keys through the same mask the services use, never a whole record. The scripts that delete data refuse to run while a restore is under way, and the cleanup script refuses to apply when the share of a table it would delete exceeds a bound, so a fault in its own judgment cannot sweep away a table.

A customer’s names stay out of operations. A file’s, folder’s or vault’s name, a structured record’s keys, and what a person searched for are the customer’s data, and no log line carries one: a lint rule in the gates of the API’s and the file service’s deploys refuses such a name in any log call and in the message of any error the platform throws; a request line names its path alone, never its query, writes a path segment that addresses a file by name as a placeholder, and masks an email address or a phone number anywhere in the path. The mobile app’s crash reports carry code locations, stable error codes and device facts, never an error’s message, a file’s name or a person’s data, and each report is rebuilt from permitted fields alone before it leaves the device.

The runbooks for failure modes such as a missing chunk, a record its expiry removed, a root key that cannot be used, a scheduled vault deletion and a queue to re-drive are written down in the infrastructure documentation, and the response procedures for a key compromise, an algorithm weakness and an HSM outage are section XX’s.

Personnel and device security

The people who build and operate SparkVault are held to controls of their own. Every employee passes a background check and signs non-disclosure and confidentiality agreements. Each receives security training during onboarding and security awareness training every year, and regular phishing simulations test that training against the kind of message an attacker would send.

The devices they work on are managed. Each is enrolled in mobile device management, requires full-disk encryption, installs security updates automatically and runs endpoint detection and response, and each can be wiped remotely.

People’s access follows the principles the platform’s roles follow. Each person holds the least privilege their work needs, duties are separated, and access is reviewed regularly. Changes follow a change management process, which for the platform’s code and infrastructure is the gated deploys and the two-step plan and apply described above, and incidents follow the response procedures of section XX.

Controls at a glance

The controls of this section in brief, each with the mechanism behind it and the assurance it gives.

ControlMechanismAssurance
Independent attestationSOC 2 Type 2 compliant; report, penetration test summaries and questionnaires on requestSOC 2 Trust Services Criteria: Security, Availability, Confidentiality
Penetration testingMonthly, by independent firms: network, APIs, web applications, social engineeringCritical findings remediated within 72 hours, others within 30 days
Security operationsA security operations center that monitors and responds24 hours a day, seven days a week
Serverless computeEvent-driven functions and managed containers, replaced by every deployNo servers of our own to patch
Edge networkEvery public host behind the edge, which terminates TLS and mitigates DDoSTLS: section XII
Web application firewallLayer 7 inspection at the edge, with machine-learning threat classificationSQL injection, XSS and the OWASP Top 10 blocked
Keys in hardwareAccount keys inside HSMs; every key operation in the trailFIPS 140-3 Level 3
Least privilegeA role per service, unable to disable or delete keys, tables or object versionsFile service database grants held to its code by test
Federated deploymentPer-job identity token exchanged for credentials that expire within the hourNo stored cloud access key
Audit trail and alertsEvery management event and file-store write; destructive control-plane calls reportedSigned digests: SHA-256 hashes, RSA signatures
Repository guardsRandomness, hidden-character and toolchain guards before every deployCVE-2021-42574 closed in our source
ScansDependency audit and credential scan on pull requests and on a scheduleAudit fails at moderate severity
Tenant isolationAccount from the credential; vault records keyed by owner; chunks bound to their tenantAES-256-GCM associated data
Data residencyOne region, in the United States, apart from what the edge keepsMetadata and file stores span three or more zones
AvailabilityTwo zones; two or more file-service containers; external canaryHealth-checked, self-replacing; an internal objective of 99.99% availability
Point-in-time recoveryEvery table of record, encrypted, in-region; none for sessions, transfers, uploads or Sparks35 days, per second
Object versionsEvery key in the file store90 days after replacement or deletion
Vault deletionFrom settings: owner or administrator, exact name, administrators emailedSeven days to cancel
Personnel and devicesBackground checks, training, phishing simulations; managed, encrypted devices with endpoint detection and remote wipeLeast privilege, separation of duties, access reviews
Vulnerability disclosurePublished program with safe harborSection XX

III. Threat model and security objectives

Security objectives

SparkVault’s cryptographic architecture is designed to keep what a vault stores confidential and intact against polynomial-time adversaries, classical and quantum, who may hold far more than an ordinary attacker: every byte the platform stores, the network path between a client and the platform, and in some cases one or two of the platform’s own root keys. Confidentiality is meant in the standard sense of semantic security under adaptive chosen-ciphertext attack (IND-CCA2): nothing an adversary can compute from stored ciphertext distinguishes it from the encryption of any other content of the same length. What the stored data does not hide is each file’s length and, for a file a device backed up with its keyed content digest, which other such files of the vault are identical (section XV). Integrity is meant as integrity of ciphertexts (INT-CTXT): no adversary can produce a ciphertext that the platform will accept unless the platform itself produced it, under the vault’s key, for that file, at that position in the file.

Three further objectives govern how the keys themselves are held. The first is custody separation: a vault’s key is derived from three keys of three different kinds, kept in three different places (a secret store, a hardware security module and the vault’s holder), so that no single place holds enough to derive it (section IV). The second is bounded exposure of derived keys: a vault’s key is never stored in the clear; it is derived when its holder unseals the vault or a feature opens it, and between uses the platform keeps it only sealed under a key that the account’s AMK alone can derive, in a live record that no backup ever copies, while the AMK itself never leaves the HSM. The third is failing closed: when the HSM cannot answer, when the SVMK is not the one the platform is pinned to, or when an account has lost the binding to its AMK, the platform refuses the operation rather than continue with less (sections IV and V).

The threat model below names each adversary SparkVault considers: what that adversary can do, what they would obtain, and why the design defeats them or where it stops. The guarantee covers the contents of the files a vault stores and every key that opens them. Its limits are stated with the adversary that reaches them, above all under control of the running platform. Sparks, the short-lived payloads the platform seals for delivery under two of the three keys, are described in section V.

Adversaries considered

Each adversary is defined by its capabilities, and the capabilities are not exclusive: a single adversary may steal stored data, watch the network and serve legal process at once.

Theft of stored data

Read access to every row of the metadata store, every object in object storage, every backup of either, and every line the platform logs: the position of an attacker who has exfiltrated the platform’s data at rest, or of an insider who can read that data but cannot run code inside the platform or use its keys.

Of the contents of vaults’ files, and of the keys that open them, such an adversary holds only ciphertext and one-way values; what it reads of a vault in the clear is metadata: the vault’s name and description, each file’s size and times, and the names, types, original file names and uploader addresses of the vault’s older rows not yet sealed (section XVIII). Each file is stored as chunks of AES-256-GCM ciphertext under its vault’s key, the Vault Access Key (VAK), every chunk carrying its 128-bit authentication tag. A vault’s record holds what the platform needs in order to derive that key, minus the keys themselves: the vault’s ML-KEM-1024 ciphertext, which only the SVMK’s private key decapsulates, and the Argon2id verifier of its VMK, from which a VMK can only be guessed. Where the platform keeps a vault’s key between uses, for a session or a transfer, the key is sealed under a key that only the account’s AMK can derive. Where a delegated key exists, its secret is sealed under a key derived from a per-vault key that the HSM wraps and from the delegated key itself, which no store holds, so not even the HSM’s help opens it until the key is presented (section VIII). The metadata store keeps each delegated key, API key and refresh token only as its SHA-256 digest, which cannot be presented in its place, and keeps a system grant’s token only sealed (section VIII). The API’s logger withholds every log field named for a credential, the VMK’s among them, and masks the formats of the tokens the platform issues in any text it writes; the file service never receives a session token, a delegated key or a VMK.

Every route from that data to the contents of a vault’s files runs through the HSM. Deriving a VAK takes a MAC that only the account’s AMK can compute, inside the HSM, together with the vault’s ML-KEM shared secret, which needs the SVMK’s private key from a separate secret store, and the VMK, which no store holds: the store keeps only values computed from it one way, its verifier among them, or, for a vault that a feature opens unattended, a sealed escrow that only the HSM opens (section VIII). Opening a session’s or a transfer’s record takes the same AMK, and opening a delegated key’s envelope takes an operation of the HSM and the presented delegated key as well. A correct guess at the VMK, one of 2¹⁴⁴, yields one input of three. Backups change none of this: they hold the same ciphertext for longer, 35 days for the metadata store’s tables of record and 90 days for earlier versions of the objects that hold files (section II), and they hold no vault’s key and no Spark, because the tables that keep sessions, transfers, uploads and Sparks keep no backups. On their own, stolen copies decrypt nothing a vault stores. The stores do also hold tokens that the running platform honors while they are live, a file transfer’s among them; a thief who presents one to the platform before it expires receives what it was issued for, as its holder would, and nothing more.

Tampering with stored data

Write access to the same stores: the ability to alter, reorder, truncate, extend, delete or move ciphertext and the records around it. Such an adversary can destroy data, but cannot make the platform accept ciphertext it did not produce. Every chunk of a file is sealed with AES-256-GCM under a nonce derived from the file’s own random base nonce and the chunk’s index, and with authenticated data that names the account, the vault, the file and the chunk’s position, and marks the last chunk as the last. A chunk moved to another position, file, vault or account fails authentication, and so does a file whose trailing chunks were dropped or to which chunks were added, because the final mark no longer sits on the final chunk. What the binding does not cover is a file’s version: a writer to both stores who puts back an earlier version of a file whole, its record and every chunk, has the platform serve that version as current, since each chunk is bound to its file and position, not to the file’s latest upload. The file service holds each chunk’s plaintext until the whole chunk has authenticated, so no byte of a chunk that fails reaches a response.

The envelopes that hold keys are bound the same way. A session’s or a transfer’s sealed VAK names its account and vault in the authenticated data of both of its layers, and a delegated key’s envelope is checked against authenticated data that the platform recomputes at every opening rather than reads from the store (section VIII). Nor can a tamperer change which key the platform derives without the change showing: a vault’s VAK depends on its stored ML-KEM ciphertext and on the VMK its verifier admits, so a replaced ciphertext, or a verifier replaced with one for a VMK of the tamperer’s choosing, yields a key under which every existing chunk fails its tag. The earlier versions that point-in-time recovery and object versioning keep (section II) are the remedy for destruction, which no cipher prevents.

A hostile tenant

A customer acting against another customer: a valid account, its own vaults and keys, and the ability to call every API the platform offers. Isolation between accounts is enforced twice. The platform resolves which account a request acts for before it reads a customer record, and reads a vault only under that account (section II). Beneath that check, every vault’s key is bound to its tenant. Each account has its own AMK, a separate key inside the HSM; the MAC that salts a vault’s key names the vault and the account; the derivation of the VAK names the vault; and the authenticated data of every chunk names the account and the vault. A tenant’s own keys derive nothing that opens another tenant’s files, and ciphertext copied out of another account authenticates under no key the copier can obtain.

Control of the running platform, by an attacker or an insider

The ability to change or observe the running platform: its code, its memory, or its use of the HSM. Cryptography does not stop this adversary, because the running platform is the party that combines the keys. It uses the SVMK, asks the HSM for AMK MACs in the course of its work, and receives a vault’s VMK each time its holder unseals the vault, or presents the VMK to issue a delegated key or to turn on a feature that opens the vault unattended. The adversary can therefore read any vault unsealed, or whose VMK is presented, while they are in control.

Their reach also extends to keys the platform already holds. For as long as a session lasts, and for the life of each file transfer and upload, the platform keeps the vault’s VAK in the session’s, the transfer’s or the upload’s record, sealed under a key that the account’s AMK derives, so that each request need not present the VMK again (sections VIII and XI). Whoever can read those records and have the HSM compute the account’s MAC opens them without the VMK, for as long as each record stands. A session’s record stands until its holder ends the session or the revocation of the delegated key behind it removes it; once the session expires or the whole vault is sealed, it stands until the metadata store’s expiry process removes it. A transfer’s record stands until that expiry process removes it, and an upload’s until the upload is cancelled or that process removes it. Backups add nothing to this reach. The tables that hold session, transfer and upload records keep no point-in-time backups (section II), so through those records an adversary who can read the stores and use the account’s HSM key opens only the vaults whose session, transfer or upload record is live at that moment, and a record, once removed, is gone from every copy. One bound remains in the backups: a feature’s system grant that is turned off stays in the delegated-key table’s point-in-time backups for up to 35 days, and with it the vault’s VMK, which never changes. That table keeps backups because it holds the only copy of a Messaging vault’s VMK.

Vaults that the platform opens unattended are open to them at any time: those with sharing, an upload portal or widget, Messaging or the help desk turned on, and the identity directory, which holds the profiles of people who sign in with SparkVault Identity. Each of those features keeps a system grant from which the platform, with the HSM’s help and no one present, recovers the vault’s VMK (section VIII); the identity directory opens with a credential kept in the platform’s secret stores. Sparks are open to them as well, since a Spark is sealed under the two keys the platform holds (section V), but only while it is live, with its sealed payload still in its record. A burn removes the payload from the record at once, the store’s expiry process removes an expired Spark’s record, and no backup holds a Spark, so a burned or expired Spark, once removed, is gone from the live store and from every backup.

Against this adversary the protection is the platform’s access control (section II): who can deploy code to it, which of its roles may use which keys, and how narrowly each role is granted. The three-key design still bounds what the adversary obtains without a vault’s holder. A vault stays sealed to this adversary until its holder next presents its VMK, or a delegated key to it is next presented, as long as no feature’s grant, live or in a backup, holds its VMK and no live session, transfer or upload holds its key.

Legal compulsion

Lawful requests requiring SparkVault to produce decrypted data, including FISA orders, national security letters, and extraterritorial legal demands. SparkVault can produce only what it holds or can open. Deriving a vault’s key takes its VMK, which SparkVault does not keep, so a vault’s files are beyond SparkVault’s own reach unless it holds a key that opens them: the system grant of a feature the vault’s owner turned on, the identity directory’s credential, or the VAK it keeps sealed in the live record of a session, a transfer or an upload of that vault. No backup holds such a record or a Spark; the point-in-time backups do keep a withdrawn feature’s system grant for 35 days.

An order can therefore reach the contents of a vault that the platform opens unattended, or did at any time in the preceding 35 days, or whose session, transfer or upload record is live when the order is carried out, and of every Spark that is still live then. A burned or expired Spark that the store has removed is beyond its reach, as it is beyond SparkVault’s. Short of compelling a change to the platform, it can reach the contents of no other vault; because the platform receives the VMK whenever its holder presents it, an order that compelled such a change could also reach a vault whose VMK is presented after it. What SparkVault holds in the clear, such as the audit log’s account events (section XIX), it can produce as it is.

Cryptographically-relevant quantum computers (CRQC)

Adversaries with fault-tolerant quantum computers capable of running Shor’s algorithm against RSA, elliptic-curve cryptography and classical Diffie-Hellman, and Grover’s algorithm against symmetric keys, including an adversary who records traffic and keeps stored ciphertext today in order to decrypt it later. Against stored data such an adversary is no closer to a vault’s contents than a classical thief. A vault’s key requires the shared secret of the vault’s ML-KEM-1024 encapsulation. ML-KEM-1024 is believed to satisfy IND-CCA2 security, in FIPS 203’s words; that security rests on the Module Learning With Errors problem, for which no efficient quantum algorithm is known, and ML-KEM-1024 is in NIST FIPS 203 security category 5, the category NIST measures against key search on AES-256. The vault’s key also requires a MAC under a 512-bit HMAC-SHA512 key held in the HSM, against which Grover’s algorithm offers at most a square-root speedup. Nothing a vault stores, and no key that opens it, is protected at rest by a primitive that Shor’s algorithm breaks.

What Shor’s algorithm does break are the classical primitives at the platform’s edges (section VI). A recorded connection whose TLS key exchange was classical can be decrypted, exposing what it carried, a VMK presented at unseal included (section XII), and the RSA and Ed25519 signatures on the platform’s tokens can be forged. These are attacks on the platform’s front door rather than on what it stores: a recovered VMK or a forged token is something to present to the running platform, and neither yields the SVMK’s shared secret or the AMK’s MAC, without which no copy of stored data decrypts. A connection that agreed its keys through the hybrid X25519MLKEM768 group, which the edge network chooses whenever a client offers it, keeps its leg from the client to the edge confidential unless ML-KEM-768 is broken as well. The edge reaches the platform over separate TLS connections (section XII), each protected only as far as its own key exchange, and neither offers a post-quantum group: the API’s agrees its keys classically at TLS 1.2 or 1.3, and the file service’s runs at TLS 1.2 at most. A recording of either hop is open to this adversary, a VMK presented at unseal included, and so is a key handed between a person’s devices, whose X25519 key agreement Shor’s algorithm also breaks (section VII).

Side-channel exploitation (DPA/SPA/EMA)

Differential Power Analysis (DPA), Simple Power Analysis (SPA), electromagnetic emanation analysis (EMA), cache-timing attacks (Flush+Reload, Prime+Probe), speculative-execution vulnerabilities (Spectre and Meltdown variants), and timing measured remotely: adversaries who learn secrets from how hardware behaves while it computes, rather than from what it outputs. The AMK is in constant use, and it is the key best placed against such measurement. Every MAC under an AMK is computed inside the HSM’s FIPS 140-3 Level 3 validated boundary (section X), where the key’s plaintext exists only in volatile memory for the moments an operation takes. Power or electromagnetic analysis of the AMK would therefore need physical access to the provider’s HSMs, and the AMK never enters the platform’s own memory, where a cache or speculative-execution attack could reach it.

The SVMK’s private key is used in the API, and each derived VAK in the API and the file service, inside execution environments that the provider isolates: each of the API’s execution environments is reserved for one version of one function, never reused across functions or customers, and isolated from every other environment inside the provider’s hardware-virtualized micro-VMs, and each task of the file service is isolated from every other task, sharing no kernel, processor or memory with it (section II). The platform holds a VAK only for the unit of work that needs it and overwrites its buffer at the last use, on failure paths too; the wipe is best effort (section XVI). Over the network, an attacker never chooses what a root key works on in software: a presented VMK is checked against its Argon2id verifier, by constant-time comparison, before the SVMK or the AMK is used, and every ciphertext the SVMK decapsulates is read from the platform’s own records, never taken from a request. A wrong VMK is refused after its full Argon2id evaluation, and only to an authenticated caller in the vault’s account, so online guessing gains nothing over the offline search section XV bounds.

Advanced persistent network adversary

Complete visibility into all network traffic, with BGP hijacking capability and the ability to perform active man-in-the-middle attacks. SparkVault’s apps and SDKs reach it over TLS, which the edge network terminates, and files and VMKs cross the network inside it: the file service encrypts each chunk of a file as it arrives (section XI). TLS authenticates SparkVault by its certificate alone, so an adversary who obtains a certificate a public authority issued for a SparkVault domain can impersonate the service and read what a client sends it, a VMK presented at unseal included. Without such a certificate, TLS keeps what a connection carries from the adversary, as far as the version and cipher suite the client agrees to allow (section XII).

Past the edge the adversary meets TLS again, and private networking. The edge reaches the platform over TLS (section XII), and the API reaches its metadata store, object storage, the HSM and its secret stores over private endpoints, never the public internet (section II). A vault key handed between a person’s own devices crosses the network end to end encrypted, with X25519 key agreement between keypairs that live for that one session and XSalsa20-Poly1305 authenticated encryption, so the server that relays it sees only ciphertext (section VII). What a network adversary always keeps is traffic analysis: which clients connect, when, and how much they send and receive.

The two-of-three guarantee

An adversary holding any two of the three root keys, together with a vault’s stored ciphertext and verifier, cannot feasibly derive the vault’s key. The vault’s key is derived by HKDF-SHA512, with the ML-KEM shared secret and the VMK as input keying material and the AMK’s MAC as salt: VAK = HKDF(salt = MAC_AMK(vault), ikm = ss || VMK). Without the VMK the adversary faces a search of 2¹⁴⁴ candidates, each tested by a full derivation or an Argon2id evaluation; Grover’s algorithm would reduce that to about 2⁷² sequential evaluations, still more than the 2⁶⁴ it leaves against a 128-bit key. Without the AMK, they face a MAC under a 512-bit key that never leaves its HSM; without the SVMK, a 256-bit shared secret behind ML-KEM-1024.

This is a property of the derivation. It does not hold against an adversary in control of the running platform while a vault is unsealed, who then holds all three for that vault, and it does not extend to a key the platform already holds: a session’s, a transfer’s or an upload’s live record opens with the AMK alone (no backup holds one), and a vault with a system grant, or the identity directory, opens with the keys and the credential the platform holds (see above). It holds in full against any adversary without the use of the account’s AMK, whatever else of the stored data and the other two root keys that adversary holds, because every route to a vault’s key, the derivation and each record that keeps the key sealed, runs through a key that never leaves the HSM. One stored value lies outside the derivation: a keyed content digest is keyed from the VMK alone, so an adversary holding the VMK and the stored data, without the other two keys, can confirm whether the vault holds a file it already has, though it decrypts nothing.

The bound on deriving a vault’s key from two of its three root keys
Pr[𝒜 derives VAK | two of {SVMK, AMK, VMK}, the vault's ciphertext and verifier]
  ≤ q · 2⁻¹⁴⁴ + AdvIND-CCA2ML-KEM-1024(ℬ₁) + AdvPRFHMAC-SHA512(ℬ₂) + Advikm-PRFHMAC-SHA512(ℬ₃)
// q: the candidates 𝒜 tests. 2⁻¹⁴⁴ per guess is the missing-VMK case, the weakest of the three;
// with the AMK or the SVMK missing, a guess at the 256-bit VAK itself succeeds with 2⁻²⁵⁶. Section XV, Theorem 5, gives every term and hypothesis

IV. Triple Zero-Trust architecture

SparkVault’s Triple Zero-Trust model derives each vault’s key from three independent master keys, each generated separately and kept in a separate place, so that no single store holds enough to derive it. The SparkVault Master Key (SVMK) is an ML-KEM-1024 key pair (NIST FIPS 203, based on CRYSTALS-Kyber), kept in a managed secret store. The Account Master Key (AMK) is a per-account HMAC-SHA512 key that cannot be extracted from its FIPS 140-3 Level 3 validated HSM. The Vault Master Key (VMK) is a random key, one per vault, held by the vault’s owner, of which SparkVault keeps a one-way Argon2id verifier. HKDF-SHA512 combines the three into the vault’s data key, the Vault Access Key (VAK), and any two without the third yield output with no feasible correlation to it (section III states the bound). SparkVault holds the first two, which cannot derive a vault’s key without the third.

The model is not a threshold scheme. In Shamir’s secret sharing, any k of n shares reconstruct the secret, and the shares beyond k are redundant. Here all three independent master keys are required to derive a vault’s key, and none can stand in for another, because each enters the derivation in its own role: the AMK’s MAC keys the extraction, and the SVMK’s shared secret and the VMK together are the material extracted. Without any one of them the key cannot be derived at all: there is no degraded mode that works from two.

The three keys are also three different kinds of secret, chosen so that no breach of a store, no cryptanalytic advance against one family of primitives and no leaked VMK exposes more than one of them; only control of the running platform, which holds the SVMK and may use the AMKs, reaches two at once (section III). The SVMK is a post-quantum private key in a managed store: reaching it takes access to that store or to the running platform, and breaking it takes an efficient attack on the Module Learning With Errors problem. The AMK is a symmetric key behind a hardware boundary: it cannot be copied, only used, and only by the roles granted its use. The VMK is held outside the platform: SparkVault stores only its verifier, except for the vaults the platform opens unattended (section III), and the platform checks a presented VMK against the verifier before it uses either of the other two keys. A breach of one store, a cryptanalytic advance against one family of primitives, a misused HSM permission and a leaked VMK are separate events, met by separate defenses, and none of them alone yields a vault’s key.

Triple Zero-Trust architecture: the SparkVault Master Key, the Account Master Key and the Vault Master Key surround your data, and all three are required to derive the key that encrypts it
Figure 1. The three master keys. Deriving a vault’s key needs all three.

Three custody domains

The SVMK’s private key is kept at rest in a managed secret store that encrypts it under keys held in FIPS 140-3 Level 3 validated HSMs, and is used only in the API, which holds it to the platform’s pinned fingerprint (section VII); the file service, which encrypts and decrypts every chunk of every file, holds no grant to read it.

Each AMK exists inside the HSM, which generated it. The platform never handles the key: it sends a message and receives a 64-byte MAC, and none of its roles may disable a key, schedule its deletion or change its policy (section II).

The VMK stays with whoever holds the vault: the person or system that created it, and anyone that holder has given it to. The platform keeps the verifier, which can confirm a presented VMK and cannot produce one. A holder who needs to give someone access without giving the VMK issues a delegated key instead (section VIII). The three domains are therefore separated by more than location: the secret store and the HSM are distinct services under distinct permissions, the file service may use the HSM but cannot read the SVMK, and the VMK is outside both.

What each key contributes

HKDF (RFC 5869) works in two steps, extract and expand, and the three keys enter it in different places. The AMK’s MAC is the salt, which HKDF-Extract uses as the key of an HMAC-SHA512 computation over the input keying material. Keying the extraction with a MAC that only the HSM can compute makes the resulting pseudorandom key, and everything expanded from it, unpredictable to anyone who cannot have the HSM compute that MAC, whatever else they know: it is the output of a pseudorandom function under a key they lack.

The input keying material is the SVMK’s contribution followed by the VMK’s. Its first 32 bytes are the shared secret that ML-KEM-1024 decapsulation recovers from the vault’s own 1,568-byte ciphertext. Every vault received a fresh encapsulation when it was created, so every vault holds a different 256-bit secret, and only the SVMK’s private key recovers any of them. The VMK supplies the rest: its Base62 text, as UTF-8 bytes, carrying the 144 random bits it was minted from. Either part alone makes the input unpredictable to anyone who lacks it: 256 bits from the shared secret, 144 from the VMK.

The expand step binds the result to its vault. HKDF-Expand computes one block, HMAC-SHA512 under the pseudorandom key over the label SparkVault:VAK:v1|vault= and the vault’s identifier followed by the counter byte 0x01, and the VAK is the first 32 bytes of that 64-byte block. The vault’s identifier, with its account’s, is also in the message the AMK MACs, so a VAK is bound to its vault twice over, by the AMK’s MAC and by the expansion, and to its account by the MAC and by the account’s own AMK. The version label in each, v1, leaves room for a successor derivation beside the current one (section XVIII).

Key combination protocol

The three root keys are combined once when a vault is created, again at every unseal, and each time a feature opens the vault through its system grant (section VIII). At creation the platform takes the vault’s identifier, its VMK and its verifier’s salt from one draw of its entropy service, computes the Argon2id verifier, encapsulates a fresh shared secret under the SVMK’s public key with a 32-byte encapsulation message drawn from the same service, and runs the combination once, wiping its output. It stores the ciphertext and the verifier, and returns the VMK, once, to the vault’s creator (section V). At each unseal the platform combines the keys as follows:

  1. Taking the key. The holder presents the VMK over TLS, as 12 to 32 ASCII letters and digits, or presents a delegated key, from which the platform recovers the VMK (section VIII).
  2. Reading the vault. The vault’s record is read with strong consistency: its ML-KEM ciphertext, its verifier, and the verifier’s salt and parameters. A vault scheduled for deletion, or being deleted, is refused.
  3. Verifying the VMK. Argon2id over the presented VMK, with the vault’s salt and stored parameters, is compared with the stored 32-byte tag in constant time. A mismatch is refused after the full evaluation, and nothing further runs: neither the SVMK nor the AMK is used for a wrong key.
  4. Decapsulating. ML-KEM-1024 decapsulation under the SVMK’s private key recovers the vault’s 32-byte shared secret from its 1,568-byte ciphertext.
  5. Asking the HSM. The HSM computes HMAC-SHA512 under the account’s AMK over the vault’s unseal label, which names the vault and the account, and returns the 64-byte MAC. The AMK stays inside the HSM.
  6. Combining. HKDF-SHA512 extracts, with the MAC as salt, from the shared secret followed by the VMK’s bytes, expands under the vault’s label, and keeps the first 32 bytes: the VAK.
  7. Wiping. The shared secret, the MAC, the pseudorandom key, the concatenated input and the copy of the VMK’s bytes are overwritten whether the derivation succeeds or fails. The VAK goes to the session ceremony, which seals it and then overwrites it, a failed seal included (section XI).
Deriving the VAK from the three root keys
// Key 1, the SVMK: decapsulate the vault's own ML-KEM-1024 ciphertext (1,568 bytes)
svmk_shared_secret = ML-KEM-1024.Decaps(svmk_private_key, vault.kem_ciphertext) // 32 bytes
// Key 2, the AMK: an HMAC-SHA512 the HSM computes; the key never leaves it
salt = HMAC-SHA512(AMK, "SparkVault:Salt:Unseal:v1|vault=" || vault_id || "|acct=" || account_id) // computed inside the HSM; 64 bytes
// Key 3, the VMK: the Base62 string its holder presents, once its Argon2id verifier admits it
vmk_bytes = UTF-8(vmk) // 144 random bits in at most 25 characters
// The vault's AES-256-GCM key, via HKDF-SHA512 (RFC 5869)
VAK = HKDF-SHA512(ikm = svmk_shared_secret || vmk_bytes, salt = salt, info = "SparkVault:VAK:v1|vault=" || vault_id, length = 32)
// that is: PRK = HMAC-SHA512(salt, ikm), and VAK = the first 32 bytes of HMAC-SHA512(PRK, info || 0x01)

Properties of the combination

Determinism

The same three keys and the same ciphertext give the same VAK every time, so the VAK never has to be stored to be found again: it is derived at each unseal or unattended opening and wiped after use, and between uses it exists only sealed in a session’s or a transfer’s record. The price of determinism is permanence. Every file of a vault is encrypted under its VAK, so the SVMK, each AMK and each VMK must stay exactly as they are for as long as anything is stored under them, and none of the three is ever rotated (section V).

Silent failures made loud

Two of the three inputs could be wrong without any primitive reporting an error. FIPS 203 decapsulation under the wrong private key does not fail: by design it returns a pseudorandom secret (implicit rejection). A new AMK would return valid MACs under the wrong key. Either would derive a wrong VAK, fail every existing file as tampered, and seal every new upload under a key the real roots never derive again. The platform refuses both before they can happen: it uses no SVMK that fails its pinned fingerprint or its working-pair proof (section VII), and it creates no AMK for an account that already owns a vault or a Spark but has lost the binding to its key. The third input, the VMK, is checked against its verifier before it is used.

Failing closed

When the HSM cannot answer, no MAC is computed and no VAK is derived. There is no software fallback for the AMK, and every new key the platform makes needs randomness the HSM contributes to (section X), so creating a vault fails too. When the SVMK fails its checks, every encapsulation and decapsulation is refused (section VII). No VAK is ever derived from fewer than all three keys, and none is derived any other way.

A short life in memory

The platform holds the VAK only for the unit of work that needs it. An unseal hands it to the session ceremony, which seals it into the session’s record under a key that the account’s AMK derives and then overwrites it (section XI); each later request opens that record, uses the VAK, and overwrites its copy when the request ends, a best-effort wipe (section XVI).

V. Cryptographic key hierarchy

SparkVault’s keys form a hierarchy with three roots. Two belong to the platform: the SVMK, one for the whole platform, and the AMK, one for each account. The third, the VMK, one for each vault, is held by the vault’s holder. Beneath the roots sits one derived key per vault, the VAK, and beneath the VAK the keys that seal what the vault stores. The AMK also roots a branch of its own, which includes the keys that seal a VAK while a session or a transfer holds it, the keys that seal the cursors of an account’s resource listings, the account’s identity-token signing keys, and the MACs behind the help desk’s tokens and digests. Every key the listing below computes is derived from the roots when it is needed rather than drawn at random, so none of them has to be stored to be found again; the keys drawn at random beneath them, the data key of each session’s or transfer’s record and an account’s RS256 signing key, are stored only sealed under one of them.

One more of SparkVault’s own keys lives in the HSM beside the AMKs: a symmetric key-encryption key that wraps, for each vault with delegated keys or a system grant, a per-vault key drawn from the platform’s entropy service, and under which the HSM generates each RS256 key pair the platform needs. It is not a root of any vault’s key and derives nothing on its own; it guards the delegated keys and system grants of section VIII.

The key hierarchy, as the platform derives it
// a, v, s: the account, vault and Spark identifiers; n: the Spark's nonce, base64url; || concatenation
// MAC_AMK(m): HMAC-SHA512 over m, computed inside the HSM under the account's AMK
SVMK  ML-KEM-1024 key pair, one for the platform    (managed secret store)
AMK   HMAC-SHA512 key, one per account              (FIPS 140-3 Level 3 validated HSM)
VMK   144 random bits, one per vault                (the vault's holder; SparkVault keeps an Argon2id verifier)
// One key per vault, from all three roots
VAK = HKDF-SHA512(ikm = ML-KEM-1024.Decaps(svmk_private_key, vault.kem_ciphertext) || UTF-8(vmk),
                  salt = MAC_AMK("SparkVault:Salt:Unseal:v1|vault=" || v || "|acct=" || a),
                  info = "SparkVault:VAK:v1|vault=" || v, length = 32)
├─ file chunks        AES-256-GCM under the VAK itself (section XI)
├─ field key          HKDF-SHA512(ikm = VAK, salt = "", info = "SparkVault:VaultFields:v1|acct=" || a || "|vault=" || v)
├─ field nonce key    HKDF-SHA512(ikm = VAK, salt = "", info = "SparkVault:VaultFieldNonce:v1|acct=" || a || "|vault=" || v)
├─ name index key     HKDF-SHA512(ikm = VAK, salt = "", info = "SparkVault:VaultNameIndex:v1|acct=" || a || "|vault=" || v)
├─ help desk key      HKDF-SHA512(ikm = VAK, salt = "", info = "SparkVault:HelpDeskFields:v1|acct=" || a || "|vault=" || v)
└─ audit detail key   HKDF-SHA512(ikm = VAK, salt = 32 zero bytes, info = "audit-log-encryption") (section XIX)
// One key per Spark, from the SVMK and the AMK
SAK = HKDF-SHA512(ikm = ML-KEM-1024.Decaps(svmk_private_key, spark.kem_ciphertext),
                  salt = MAC_AMK("SparkVault:Salt:v1|acct=" || a || "|type=spark|id=" || s || "|nonce=" || n),
                  info = "SparkVault:Key:v1|acct=" || a || "|type=spark|id=" || s || "|nonce=" || n, length = 32)
// From the AMK alone
├─ session KEK        the first 32 bytes of MAC_AMK("KEK:VAT:" || a || ":" || v)
├─ transfer KEK       the first 32 bytes of MAC_AMK("KEK:ISTK:" || a || ":" || v)
├─ cursor key, nonce  the first 32 and next 12 bytes of MAC_AMK("KEK:CURSOR:" || resource || ":" || base64url(salt)), a 16-byte salt per cursor
├─ identity seed      HKDF-SHA512(ikm = MAC_AMK(label), salt = "sparkvault-identity-signing-key-v1", info = label, length = 32),
│                     label = "SparkVault:Identity:SigningKey:v1|account=" || a, the seed of the account's Ed25519 signing key
├─ RS256 record KEK   HKDF-SHA512(ikm = MAC_AMK(label), salt = "sparkvault-identity-signing-kek-v1", info = label, length = 32),
│                     label = "SparkVault:Identity:SigningKeyKEK:RS256:v1|account=" || a, sealing the stored RS256 signing key
└─ help desk MACs     MAC_AMK("HMAC:HELPDESK-REPLY:v1|…"), "…-UNSUB:v1|…", "…-THREAD:v1|…", "…-REQUESTER:v1|…", "…-SENDER:v1|…",
                      "…-EXTERNAL:v1|…", and "helpdesk-pin|…" for each sign-in challenge's code

SparkVault Master Key (SVMK)

The SVMK is the platform’s post-quantum root: one ML-KEM-1024 key pair, the highest of the three parameter sets of the module-lattice key-encapsulation mechanism that NIST standardized in FIPS 203, based on CRYSTALS-Kyber. Its public half, the 1,568-byte encapsulation key, seals a fresh 32-byte shared secret for every vault and every Spark when it is created. The 1,568-byte ciphertext that encapsulation produces is stored with the vault or Spark, and only the SVMK’s private half, the 3,168-byte decapsulation key, recovers the secret from it. One key pair thus yields a different 256-bit secret for every object it protects, and learning one object’s secret reveals nothing about another’s.

Production’s SVMK was generated once, from the host’s CSPRNG alone, and has never been replaced. An environment without an SVMK gets one from a 64-byte seed that the entropy service draws, the HSM’s random output XORed with the operating system’s CSPRNG (section X), which FIPS 203 key generation turns into the pair, written only by a create-only operation (section VII). Whatever an SVMK’s origin, the API checks it against a pinned fingerprint and proves it a working pair before using it (section VII).

At rest the SVMK is kept in a managed secret store, encrypted under a data key unique to it, which is in turn encrypted under a key held in FIPS 140-3 Level 3 validated HSMs. It is used in the API; the file service holds no grant to read it.

The SVMK is permanent: never rotated, replaced or deleted, for the reason section XVIII gives. Neither the API’s role nor the file service’s may write it, and the pin makes any substitute fail before use instead of deriving wrong keys silently (section VII).

ML-KEM-1024 is believed to satisfy IND-CCA2 security, in FIPS 203’s words, and section XV states the reduction: the Fujisaki-Okamoto transform with implicit rejection makes the underlying lattice encryption a KEM that stays secure against an adversary who may submit ciphertexts of its own choosing for decapsulation, and its security rests on the Module Learning With Errors problem (section VI). It is in NIST FIPS 203 security category 5. Even fully exposed, the SVMK yields each vault’s and each Spark’s shared secret and nothing more: for a vault, one input of three, still short of the AMK’s MAC and the VMK.

Parameter Value
Algorithm ML-KEM-1024 (based on CRYSTALS-Kyber), NIST FIPS 203 security category 5
Encapsulation (public) key 1,568 bytes
Decapsulation (private) key 3,168 bytes
Ciphertext 1,568 bytes, one per vault and one per Spark
Shared secret 32 bytes (256 bits)
Encapsulation message 32 bytes, from the entropy service
Lifetime Permanent: never rotated, replaced or deleted

Account Master Key (AMK)

The AMK is each account’s hardware root: an HMAC-SHA512 key with 512 bits of key material, one for each customer account, generated inside a FIPS 140-3 Level 3 validated HSM and usable only to compute and verify MACs. It is the one root that no software of SparkVault’s ever holds. The platform sends the HSM a message and receives a 64-byte MAC. No operation of the HSM service returns a key’s material (section X). Every message the platform asks an AMK to MAC begins with a label naming its purpose, so the MACs computed for different purposes are distinct by construction.

An account’s AMK is created at the account’s first use of a feature that needs one. The API asks the HSM to generate a 512-bit HMAC key for MAC generation and verification, confined to one region, and binds the key’s identifier to the account’s record with a conditional write that succeeds only while no AMK is bound. The binding is written once and never changed. When two first uses race, one binding wins and the other key is left bound to nothing. An account that already owns a vault or a Spark but binds no AMK is refused rather than given a new key (section X).

The platform’s roles may compute MACs with AMKs, and the API’s may create an account’s AMK (section II); a deletion, by anyone, can only be scheduled, with a waiting period in which it can be cancelled (section X). The platform resolves an account’s key identifier from its record and confirms the key is enabled; whatever the platform has resolved, the HSM refuses every operation with a disabled key.

The AMK is permanent. Its MAC is the salt of every VAK and every Spark key that the account’s data is sealed under, and the source of the keys that seal the account’s session and transfer records and of the account’s identity-signing keys, so a new AMK would leave every vault and Spark of the account unreadable. No code of SparkVault’s rotates or replaces an AMK, and none is deleted. Where an AMK resides is stated in section X, and what its availability depends on in section XX.

HMAC-SHA512 is a pseudorandom function under standard assumptions on the SHA-512 compression function, so to anyone without the key its MACs are indistinguishable from random 512-bit strings, even to an adversary who has obtained MACs of other messages of its choosing. That is what makes it sound to use the AMK’s MAC as the HKDF salt that keys the extraction of a vault’s key, and to take the first 32 bytes of a MAC directly as a key-encryption key, as the session and transfer records do: each such key is recomputed from the HSM’s MAC whenever it is needed and stored nowhere. Because each account has its own AMK, every key in an account’s branch of the hierarchy is cryptographically separate from every other account’s, independent of any access check.

Parameter Value
Algorithm HMAC-SHA512 (FIPS 198-1, RFC 2104; SHA-512 per FIPS 180-4)
Key 512 bits, generated inside the HSM
MAC output 512 bits (64 bytes)
Hash block 1,024 bits
Permitted operations MAC generation and verification only
Export None: no operation returns the key’s material
Scope One key per account, single-region
Module validation FIPS 140-3 Level 3
Lifetime Permanent: never rotated, replaced or deleted

Vault Master Key (VMK)

The VMK is the root held outside the platform: 144 random bits for each vault, drawn when the vault is created and written as a Base62 string of letters and digits, at most 25 characters long, and 24 or 25 characters for more than 99 percent of vaults. The platform mints every VMK from its entropy service, the HSM’s random output XORed with the operating system’s CSPRNG: when it creates a vault, one draw supplies the vault’s identifier, 18 bytes of VMK and the verifier’s salt, in separate slices. No VMK is ever a person’s choice, and every one carries the full 144 bits.

The VMK is returned once, in the response to the request that created the vault, with a warning to save it. SparkVault stores no copy of it unless a feature that opens the vault unattended keeps it sealed in that feature’s system grant (below); no endpoint returns it again, and the API’s logger withholds any log field named for it. What the platform keeps is a verifier: Argon2id (RFC 9106, version 1.3) over the VMK, with 64 MiB of memory, three passes and four lanes, a 32-byte output and a 32-byte salt of the vault’s own. The parameters are stored with the verifier and read from it at every check, so a later vault can be given stronger ones without invalidating earlier verifiers. The verifier confirms a presented VMK; nothing short of guessing computes a VMK from it.

Whoever creates a vault holds its VMK and decides where to keep it. SparkVault’s iPhone app, when its holder chooses to keep a key on the phone, stores it in the device’s keychain, device-only and behind the device’s biometric check unless its holder chooses otherwise. A holder who needs to give someone access without giving the VMK issues a delegated key, which recovers the VMK at unseal without revealing it to the person who presents it (section VIII). Some vaults have the platform as a holder by design. A vault the platform provisions for Messaging has its VMK placed, at creation, in the system grant through which Messaging opens it, and the VMK is never shown to anyone. A vault with sharing, an upload portal or widget, or the help desk turned on gains a system grant of the same kind when its owner turns the feature on. And the identity directory is opened with a credential kept in the platform’s secret stores (section III).

At each unseal the holder sends the VMK to the platform over TLS, as 12 to 32 ASCII letters and digits. The platform checks it against its verifier in constant time and refuses a mismatch after the full Argon2id evaluation, and only to an authenticated caller in the vault’s account. The holder also presents the VMK, checked the same way, to issue a delegated key or to turn on sharing, an upload portal or widget, or the help desk. A VMK that passes becomes, as its UTF-8 bytes, the second part of the input to the vault’s key derivation (section IV). The copy of those bytes that the derivation makes is overwritten when the derivation ends, whether or not it succeeds (section XVI).

A VMK lasts as long as its vault. Nothing changes a vault’s VMK or its verifier after creation, and nothing could without re-encrypting every file, since every file is encrypted under the VAK the VMK helps derive.

Critical security note. SparkVault generates the VMK, shows it once, and does not store it: it keeps a one-way verifier instead. The platform does receive the VMK each time its holder unseals the vault, to derive the vault’s key for that session. SparkVault keeps no copy of a VMK its holder manages and cannot give a lost one back. A vault whose VMK is lost, and that no delegated key holds, can never be unsealed again, by anyone.

The VMK’s strength is its entropy, which section III weighs against classical and quantum search. The verifier’s memory-hard cost per guess is defense in depth rather than the barrier: a stolen verifier lets an adversary test candidates offline, at a 64 MiB, three-pass evaluation each, but the 144 bits already put the search out of reach. Because the platform, not a person, chooses every VMK, no dictionary, reuse or pattern narrows the search. And because no store of SparkVault’s holds a VMK its holder manages, no breach of its stores, backups or logs yields one; the platform meets such a VMK only when it is presented, directly or through a delegated key, the exposure that section III bounds.

Parameter Value
Entropy 144 bits: 18 bytes of the vault’s creation draw
Encoding Base62 (A to Z, a to z, 0 to 9), at most 25 characters
Accepted at unseal 12 to 32 ASCII letters and digits
Verifier Argon2id, version 1.3 (RFC 9106)
Verifier cost 64 MiB (65,536 KiB) of memory, 3 passes, 4 lanes
Verifier output and salt 32 bytes each; the salt is the vault’s own
Lifetime The vault’s: never changed

Keys beneath the roots

The VAK is the one key that depends on all three roots. Every file’s contents, and the names, types, original file names and uploader addresses of a vault’s files and folders, are sealed under it or under a key derived from it; a vault’s own name and description, and each file’s size and times, are not, and a vault’s older rows are moved onto the sealed format as section XVIII describes. File contents are sealed under the VAK itself, chunk by chunk, with AES-256-GCM (section XI). A field key derived from the VAK is the key under which the platform seals those names, types, original file names and uploader addresses in the metadata store; a second key derives each of those seals’ nonces, and a third computes the blind index by which a sealed name is found. The details of file and folder events in the audit log are sealed under a fourth (section XIX), and the help desk’s sealed fields under a fifth. Each is derived with HKDF-SHA512, under a label of its own, when a unit of work needs it.

The AMK’s own branch holds the keys that protect a VAK while the platform holds it. A session’s record seals the VAK under a fresh data key, and the data key under a key-encryption key that is the first 32 bytes of the AMK’s MAC over a label naming the session domain, the account and the vault; a transfer’s record does the same under a label of its own (section XI). Each pagination cursor of an account’s resource listings is sealed under a key and nonce taken from an AMK MAC over a fresh 16-byte salt, so no two of them share a key. The account’s Ed25519 identity-token signing key is derived from an AMK MAC through HKDF-SHA512, so it is the same in every execution environment; its RS256 signing key, which the HSM generates for an account that opts into RS256, is stored only sealed with AES-256-GCM under a key-encryption key derived the same way under a label of its own. The help desk’s reply, unsubscribe and thread tokens, the digests by which it recognizes requesters’ and senders’ addresses, and the record each sign-in challenge keeps of its code are AMK MACs as well. The key-encryption keys, the cursor keys and the Ed25519 signing key are never stored: each is computed from an AMK MAC when it is needed.

A Spark, an encrypted payload of at most 256,000 bytes that lives at most 24 hours, has a key of its own, the Spark Access Key (SAK): HKDF-SHA512 over the shared secret of the Spark’s own ML-KEM-1024 encapsulation, salted with the AMK’s MAC over a label naming the account, the Spark and its nonce. It uses the first two roots only. A Spark has no VMK because the platform itself opens it to deliver it to its recipient, so its protection is the SVMK’s and the AMK’s: no copy of stored data alone opens a Spark, and the running platform opens any Spark that is still live. No backup holds a Spark, so a burned or expired Spark, once its payload is removed, is gone for good (section III).

VI. Post-quantum cryptography

Two quantum algorithms, two different threats

A cryptographically relevant quantum computer (CRQC) would bear on SparkVault through two known algorithms, and they threaten different things. Shor’s algorithm (1994) finds the period of a function in polynomial time, and with it factors integers and computes discrete logarithms, both in the multiplicative groups of finite fields and in the groups of points on elliptic curves. For RSA, finite-field Diffie-Hellman, ECDSA, ECDH, X25519 and Ed25519 that is a collapse rather than a speedup: each rests on a problem Shor’s algorithm solves outright, and no practical increase in key size restores it. Grover’s algorithm (1996) is the other. It finds a marked item in an unstructured space of N candidates with about √N evaluations of the function that recognizes it. It applies to every primitive, symmetric ciphers, MACs and hash functions included, but it only halves the exponent of a brute-force search, and that square root is provably the most any quantum algorithm can gain against an unstructured search.

How Grover’s algorithm runs matters as much as its exponent. Its √N evaluations execute one after another inside a single coherent quantum computation, and each evaluation is a complete reversible circuit for the function being searched, not one machine operation. Divided among M machines, each machine still needs about √(N/M) sequential evaluations, so parallel hardware buys only the square root of the number of machines. NIST defines each of its five post-quantum security categories by a reference attack: breaking a scheme in the category must cost at least as much as that attack under every cost metric NIST considers relevant. Category 1’s reference is key search on AES-128, category 5’s key search on AES-256. As an example metric, NIST caps the serial depth of a quantum attack, a bound it calls MAXDEPTH, at plausible values from 240 logical gates, roughly what envisioned quantum architectures could perform serially in a year, to 296, roughly what atomic-scale qubits with light-speed propagation could perform in a millennium, and counts the attack’s cost in gates under that cap.

The attack that matters before such a computer exists is harvest now, decrypt later: an adversary copies stored ciphertext or records traffic today and runs a quantum computer against it once one is built. That threat reaches backward, and it falls on confidentiality. Whatever a Shor-vulnerable key agreement protected in a recording becomes readable on the day the agreement can be broken. Authentication behaves differently. A signature key broken in the future lets its breaker sign from then on, but it changes nothing a verifier accepted before, so replacing a signature scheme before a CRQC exists leaves no exposure behind. Only a signature that must still convince someone after that day, such as a receipt kept as evidence, loses its worth then, unless a post-quantum signature has taken its place. The analysis below holds each primitive SparkVault uses to the test that applies to it.

The platform’s primitives against a quantum adversary

The table lists the cryptographic primitives that protect SparkVault’s keys, data and identities, where the platform uses each, and what a quantum adversary gains against it. The primitives Shor’s algorithm breaks protect signatures and data in transit. None of them stands between a copy of the platform’s stores and the content of a vault: every primitive on that path is either symmetric or post-quantum.

Primitive Where SparkVault uses it Best known quantum attack
ML-KEM-1024 The SVMK: one encapsulation for each vault and each Spark None better than the category 5 reference, AES-256 key search
AES-256-GCM, ChaCha20-Poly1305 Files, thumbnails, Spark payloads, sealed names, key envelopes, delegated-key secrets Grover: about 2128 sequential cipher evaluations
HMAC-SHA512, HKDF-SHA512 The AMK’s MAC inside the HSM, and every derivation of a vault or Spark key Grover against the 512-bit AMK: about 2256 steps
SHA-256, SHA-512 Credential digests, the SVMK’s fingerprint, the hashes inside HMAC and HKDF Grover preimage search: 2128 and 2256 steps
Argon2id over a 144-bit VMK The VMK verifier Grover over 2144 candidates, with a memory-hard evaluation at every step (below)
HMAC-SHA-1 (TOTP, RFC 6238) Authenticator codes for a second sign-in factor Grover against the 160-bit seed: about 280 steps
X25519MLKEM768 TLS key agreement at the edge, with every client that offers it Shor breaks the X25519 half; the agreement holds while ML-KEM-768 does (category 3)
RSA Access-token signatures and an Identity tenant’s optional RS256 key (RSA-2048), RS256 passkeys, federated sign-in assertions, DKIM on customer-domain mail, TLS certificates (RSA-2048) and the RSA key transport older TLS clients may use Shor: the private key follows from the public key
ECDSA P-256 ES256 passkeys, Web Push authorization, federated sign-in assertions, app-store notifications, TLS certificates Shor
Ed25519 SparkVault Identity’s tokens and portable receipts Shor
X25519 and the NIST curves (ECDH) The key handoff between a person’s devices; TLS key agreement without the hybrid group Shor, against recorded traffic
ECDH P-256 with AES-128-GCM Web Push message encryption, as RFC 8291 specifies it Shor on the key agreement, against recorded messages

Why 256-bit symmetric keys hold

Against a 256-bit AES key, Grover’s algorithm needs about 2128 sequential evaluations of AES-256, each a complete reversible circuit for the cipher’s fourteen rounds and its key schedule. NIST’s current estimate for recovering an AES-256 key, in its 2022 call for signature schemes, is 2285/MAXDEPTH quantum gates, against 2272 classical gates. At the deepest serial computation NIST considers plausible, 296 gates, that is still 2189 quantum gates, a figure NIST notes may understate AES’s quantum security at such depths, and AES-256 key search is the reference for security category 5, where FIPS 203 places ML-KEM-1024. Every symmetric key SparkVault’s code uses to seal stored data is 256 bits long, among them each vault’s VAK, each Spark’s key, the data keys and key-encryption keys of the session, transfer and upload envelopes, each vault’s delegation key, the envelope keys of delegated keys, and the keys a VAK yields for sealed names, help desk fields and audit details. The AMK is a 512-bit HMAC key, so a Grover search for it would run about 2256 steps, and every key derived through it or through HKDF-SHA512 is at least 256 bits long.

Hash functions lose half their preimage resistance to Grover’s algorithm: finding an input that SHA-256 maps to a given digest takes about 2128 quantum steps, and for SHA-512 about 2256. SparkVault keys API keys, refresh tokens and a person’s delegated keys by their SHA-256 digests, and pins the SVMK by the SHA-256 of its encapsulation key. The pin rests on SHA-256’s second-preimage resistance, which keeps 128 bits against Grover; a credential’s digest resists a quantum search only as far as the credential’s own unpredictability does, which Grover’s algorithm halves. Outside TLS, whose suites section XII lists, the one 128-bit encryption key SparkVault’s code uses encrypts Web Push messages. RFC 8291 fixes their encoding as AES-128-GCM under a key derived from a P-256 Diffie-Hellman agreement, and against a quantum adversary that agreement, not the key length, is their weak point (below).

Stored data against a quantum adversary

Consider the adversary who copies every row of the metadata store and every stored object, backup and log today and keeps the copy until a quantum computer exists. The copy holds file chunks and thumbnails under each vault’s VAK and sealed names under keys derived from it; each vault’s 1,568-byte ML-KEM ciphertext and its Argon2id verifier; session, transfer and upload envelopes sealed under keys derived from the AMK’s MAC; and delegated-key envelopes sealed under keys derived from a vault key that an HSM key wraps. No primitive Shor’s algorithm breaks protects any of that. To read a file, the adversary needs its vault’s VAK, and the VAK is the HKDF-SHA512 output over three secrets: the 256-bit shared secret that only the SVMK’s decapsulation key recovers from the stored ciphertext, a 512-bit MAC that only the HSM computes, and the VMK. A quantum computer opens none of the routes to it. ML-KEM-1024 has no known quantum attack better than the category 5 reference. The MAC takes the HSM, or a Grover search for the 512-bit AMK of about 2256 steps. A search for the VAK itself is the 2128-step Grover search above. Even a copy that also held the SVMK’s decapsulation key would leave the adversary missing the MAC and the VMK.

The VMK is the one root shorter than 256 bits. SparkVault draws each VMK as 144 random bits, so classically a guess is one of 2144 equally likely values. Grover’s algorithm reduces a search over them to about 272 sequential iterations, over a space 216 times larger than an AES-128 key’s, and each iteration must test its candidate. A copy of the stores offers only memory-hard tests: the vault’s Argon2id verifier and, to anyone who also knows the content of a file the mobile app backed up, that file’s fingerprint (section IX). A Grover search would have to run that evaluation inside its quantum circuit at every step, and a VMK found that way opens nothing without the other two roots. The cheap test, deriving a candidate VAK with HKDF-SHA512 and checking it against ciphertext sealed under it, is open only to an adversary who already holds the vault’s other two roots: the SVMK’s decapsulation key, and the vault’s MAC under its account’s AMK, which only the HSM computes. An adversary able to make the HSM compute that MAC has the use of the HSM, which puts it among the adversaries section III describes as in control of the running platform, and such an adversary needs no search at all: it can wait for the vault’s next unseal.

Where classical public-key cryptography remains

Signatures are the first place. SparkVault signs the access tokens of its API sessions with RSA-2048 (RS256). SparkVault Identity signs its tokens with Ed25519, under a key derived for each tenant from the account’s AMK, or with a tenant’s optional RSA-2048 key, and signs its portable interaction receipts with the Ed25519 key. The platform accepts passkeys that sign with ECDSA P-256 or with RSA, authenticates its requests to browsers’ push services and to one social sign-in provider with ECDSA P-256, and presents ECDSA P-256 and RSA-2048 certificates in TLS (section XII). It also relies on signatures other parties make with the same classical schemes: the SAML and OpenID Connect assertions of the identity providers a customer federates sign-in with, the signed notifications of the mobile app stores, and the RSA-2048 DKIM signatures on mail sent from a customer’s domain. Shor’s algorithm would let an adversary derive each of these private keys from its public key and sign as its owner, from the day it runs. Replacing each with a post-quantum signature before then ends the exposure, and section XVIII describes how the platform adds algorithms beside the ones it runs.

Key agreement in transit is the second place, and there the threat reaches backward. TLS between a client and the edge network agrees its keys with the hybrid X25519MLKEM768 group whenever the client offers it, which keeps a recorded connection confidential for as long as ML-KEM-768 holds; a client that does not offer the group gets a classical agreement. Behind the edge, the connections that carry requests on to the platform agree their keys classically (section XII). A recording of a classical connection, on either hop, is open to a future quantum computer, and so is what the connection carried, a VMK presented at unseal included. A VMK learned that way is one root of three. Even with copies of the metadata store and object storage, it opens no file without the vault’s MAC from the HSM and the SVMK’s decapsulation key.

Two further classical agreements protect particular messages. A vault key handed between a person’s web session and their phone travels sealed for the receiving device under an X25519 agreement (section VII). The sealed message also crosses TLS on both legs and rests on the platform inside a record sealed under ML-KEM-1024 and the AMK, so reading it from recordings takes a recording of a classical TLS leg and two applications of Shor’s algorithm, one to that leg’s key agreement and one to the session’s X25519 keys. Web Push messages are encrypted to the browser’s P-256 key, as RFC 8291 requires. A recorded push would show a quantum adversary only what it carries: for a sealed notification, a link and its display text, whose content opens only after the recipient’s verification; for a plaintext notification, the alert its sender chose to send in the clear.

ML-KEM-1024

ML-KEM is the module-lattice key-encapsulation mechanism NIST standardized as FIPS 203 in August 2024, based on CRYSTALS-Kyber. FIPS 203 bases its security on the presumed hardness of the Module Learning With Errors (MLWE) problem, a generalization of the Learning With Errors problem Regev introduced in 2005, whose hardness in turn rests on problems in module lattices; NIST describes ML-KEM as believed secure even against adversaries who possess a quantum computer. The standard defines three parameter sets, and SparkVault uses the largest, ML-KEM-1024, at NIST FIPS 203 security category 5, for every vault and every Spark. FIPS 203 names ML-KEM-768 as its default, and also advises that the strongest possible parameter set be used when protections for data are first established, which spares a later transition to a stronger one. Data a vault holds today may need to stay confidential for decades, so SparkVault follows the second instruction.

Parameter ML-KEM-1024 Role
n 256 Degree of the ring Rq = ℤq[X]/(X256 + 1)
q 3329 Prime modulus, 28 × 13 + 1
k 4 Module rank: secrets and errors are vectors of four polynomials
η1 2 Width of the centered binomial noise in s, e and y
η2 2 Width of the centered binomial noise in e1 and e2
du, dv 11, 5 Bits kept per coefficient of u and of v in a ciphertext
Randomness 256 bits Security strength required of the generator behind d, z and m
Encapsulation key 1,568 bytes 384k + 32
Decapsulation key 3,168 bytes 768k + 96
Ciphertext 1,568 bytes 32(duk + dv)
Shared secret 32 bytes The 256-bit key the encapsulation establishes
Decapsulation failure rate 2−174.8 FIPS 203, Table 1
Security category 5 At least as hard to break as AES-256 key search

In ML-KEM-1024 the secret is a vector s of four polynomials in Rq, with q = 3329, so the underlying lattice has dimension 1,024. Key generation expands a public 32-byte seed with SHAKE128 into a pseudorandom 4 × 4 matrix A of polynomials, samples s and an error vector e from the centered binomial distribution with η1 = 2, whose coefficients lie between −2 and 2, and publishes t = As + e. Recovering s from A and t, or telling t apart from uniform, is the MLWE problem. Encryption of a 32-byte message m combines the published equations at random: it samples y with η1 = 2 and errors e1 and e2 with η2 = 2, computes u = ATy + e1 and v = tTy + e2 plus m encoded one bit per coefficient as 0 or ⌈q/2⌋, and compresses u to du = 11 bits and v to dv = 5 bits per coefficient. Decryption computes v − sTu, which leaves the encoded message plus small noise, and rounds each coefficient back to a bit. The parameters are set so that the rounding fails for an honestly generated ciphertext with probability 2−174.8.

The arithmetic is exact and fast because of the ring’s structure. The modulus is the prime 3329 = 28 × 13 + 1, so ℤq holds primitive 256th roots of unity, ζ = 17 among them, though no primitive 512th root. X256 + 1 therefore factors into 128 quadratics modulo q, and the number-theoretic transform (NTT) maps a polynomial to its 128 residues of degree at most one, where the product of two polynomials costs 128 products of linear polynomials instead of a full 256-coefficient convolution. FIPS 203 makes the NTT part of the standard rather than an optimization: keys are stored in NTT form, and the public matrix is sampled directly in it.

K-PKE, the public-key encryption scheme described so far, resists only passive adversaries, and FIPS 203 forbids its use on its own. With a variant of the Fujisaki-Okamoto transform, ML-KEM turns it into a KEM believed to satisfy IND-CCA2, security against adaptive chosen-ciphertext attack. Encapsulation derives both the shared secret and every random coin of the encryption from the message, (K, r) = G(m || H(ek)) with G = SHA3-512 and H = SHA3-256, so a ciphertext is a deterministic function of m and the key. Decapsulation decrypts a candidate m′, derives (K′, r′) the same way, encrypts m′ again with r′, and compares the result with the ciphertext it was given. When they differ, it returns no error. It returns K̄ = J(z || c), a SHAKE256 output keyed by a secret z stored in the decapsulation key. That is implicit rejection: an adversary who submits altered ciphertexts receives pseudorandom keys it cannot tell from real ones, and learns nothing from the answer, not even that the ciphertext was rejected. FIPS 203 forbids an implementation to reveal the outcome of the comparison in any form, and the failure rate of 2−174.8 denies an adversary the decryption failures that reaction attacks on lattice schemes feed on.

ML-KEM-1024 key generation, encapsulation and decapsulation, as FIPS 203 specifies them
// Key generation, once (FIPS 203 Algorithms 16 and 13), from 32-byte seeds d and z
(ρ, σ) ← G(d || k) // G = SHA3-512; k = 4, as one byte
Â[i, j] ← SampleNTT(ρ || j || i) // a 4 × 4 matrix in the NTT domain, from SHAKE128
s[i], e[i] ← SamplePolyCBDη1(PRF(σ, N)) // η1 = 2; PRF = SHAKE256; N counts up
ŝ ← NTT(s); t̂ ← Â ∘ ŝ + NTT(e)
ek ← ByteEncode12(t̂) || ρ // 1,568 bytes
dk ← ByteEncode12(ŝ) || ek || H(ek) || z // 3,168 bytes; H = SHA3-256
// Encapsulation, for each vault and each Spark (Algorithms 17 and 14): m = HSM.Random(32) XOR CSPRNG(32)
(K, r) ← G(m || H(ek))
y[i] ← SamplePolyCBDη1(PRF(r, N)); e1[i], e2 ← SamplePolyCBDη2(PRF(r, N)) // η2 = 2
u ← NTT⁻¹(Âᵀ ∘ NTT(y)) + e1
v ← NTT⁻¹(t̂ᵀ ∘ NTT(y)) + e2 + Decompress1(ByteDecode1(m))
c ← ByteEncode11(Compress11(u)) || ByteEncode5(Compress5(v)) // 1,568 bytes; K is 32 bytes
// Decapsulation, at every unseal and every Spark read (Algorithms 18 and 15); u′, v′ decompressed from c
m′ ← ByteEncode1(Compress1(v′ − NTT⁻¹(ŝᵀ ∘ NTT(u′))))
(K′, r′) ← G(m′ || h); K̄ ← J(z || c) // h = H(ek), stored in dk; J = SHAKE256, 32 bytes
if K-PKE.Encrypt(ek, m′, r′) ≠ c then K′ ← K̄ // implicit rejection: no error is ever signalled

VII. Key encapsulation and exchange

An encapsulation the platform makes to its own key

A key-encapsulation mechanism usually establishes a secret between two parties over a public channel. SparkVault uses ML-KEM-1024 differently: the platform encapsulates to its own key, the SVMK, so that its first root contributes a fresh, independent 256-bit secret to every vault and every Spark. When a vault is created, the API draws a 32-byte message from the platform’s entropy service and runs ML-KEM-1024 encapsulation against the SVMK’s encapsulation key. The resulting 1,568-byte ciphertext is stored on the vault’s record. The 32-byte shared secret it encapsulates is never stored: the creation uses it once and overwrites it. At every unseal, the API decapsulates the stored ciphertext with the SVMK’s decapsulation key (its private key), recovers the same 32 bytes, and feeds them to the derivation of the vault’s key, the VAK. A Spark receives its own encapsulation when it is sealed, and reading it decapsulates.

Because each record carries its own encapsulation, the SVMK’s contribution differs for every vault and every Spark, each drawn from an independent random message. A shared secret exposed during one vault’s unseal tells an adversary nothing about any other vault’s. A stored ciphertext reveals nothing about its secret either: ML-KEM is believed to satisfy IND-CCA2 (section VI), a property that covers an adversary who can submit chosen ciphertexts for decapsulation, one with a quantum computer included. Short of breaking ML-KEM, the only way from a stored ciphertext to its secret runs through the decapsulation key.

In ML-KEM the 32-byte message alone decides the shared secret, because encapsulation derives the secret and every random coin from it, as the listing in section VI shows. The secret is therefore exactly as unpredictable as the message. SparkVault draws the message from its entropy service: the output of the HSM’s NIST SP 800-90A deterministic random bit generator (section X), XORed with the host’s own CSPRNG, so neither source alone decides it. The ML-KEM implementation would draw a message of its own if handed none, so the API refuses any draw that is not exactly 32 bytes rather than let it fall back, and a check that runs before every deploy of the API refuses code that calls encapsulation without supplying the message. The message, and the implementation’s copy of the secret, are overwritten as soon as the result is copied out.

The SVMK key pair

The SVMK is one ML-KEM-1024 key pair, made once for the platform. Its 3,168-byte decapsulation key is kept in a managed secret store (section II); it appears in no source code, no record of the metadata store and no log line. The operator procedure that makes an SVMK creates one only where none exists. It writes the pair with a create-only operation, which fails if the key already exists, and a replacement would have to name the exact stored version it replaces, so no routine run of the procedure can overwrite the root every vault is sealed to.

The API checks the pair before it uses it. The runtime is configured with the SHA-256 fingerprint of the SVMK’s encapsulation key. At first use, the API reads the pair, checks that the keys are exactly 1,568 and 3,168 bytes, and compares the encapsulation key’s fingerprint with the configured one. It then proves that the decapsulation key belongs to that encapsulation key, in two ways. FIPS 203 lays out a decapsulation key as dkPKE || ek || H(ek) || z, so the API checks that the 1,568 bytes at offset 1,536 are exactly the pinned encapsulation key and that the 32 bytes after them are its SHA3-256 hash, the hash check FIPS 203 specifies for decapsulation keys. And it runs a pairwise consistency test: it encapsulates a fresh message drawn from the entropy service under the encapsulation key, decapsulates the ciphertext with the decapsulation key, and compares the two secrets in constant time. A pair that fails any check is overwritten in memory and refused, no vault or Spark is encapsulated or decapsulated, and a pair that is not the pinned one, or not one pair, raises an alarm.

These checks answer a property of ML-KEM itself. Under implicit rejection, a decapsulation with the wrong key does not fail: it returns J(z || c), 32 well-formed bytes that are wrong. A replaced, restored or damaged key would therefore derive a wrong VAK for every vault without any error, fail every download as tampered, and seal every new upload under a key the real SVMK never derives. The pin and the proof turn that silent corruption into a refusal before the first operation. Each decapsulation also checks that the ciphertext it is given is exactly 1,568 bytes, the check FIPS 203 requires at every decapsulation.

The SVMK is a permanent root, never rotated, replaced or deleted (section XVIII). Decapsulation runs in software in the API. Each decapsulation overwrites the copies of key material it makes as soon as the call returns, and the caller overwrites the shared secret it receives once the VAK is derived. On its own, the SVMK opens nothing: section III states what each root yields alone and in pairs.

From shared secret to vault key

The shared secret enters the vault’s key beside the VMK, as input keying material to HKDF-SHA512, while the AMK supplies the salt. The listing gives the derivation exactly as the API runs it. The ML-KEM secret is 32 bytes and the AMK’s MAC 64, and the VMK enters as the UTF-8 bytes of its Base62 string. The concatenated input, the shared secret and the salt are overwritten once the VAK is derived. Section IX explains why each input sits where it does, and section III what the arrangement guarantees.

Key derivation in three stages
// Stage 1: ML-KEM decapsulation (SVMK contribution)
svmk_shared_secret = ML-KEM-1024.Decaps(vault.kem_ciphertext, svmk_private_key) // 32 bytes
// Stage 2: Hardware HMAC for deterministic salt (AMK contribution)
salt = HSM.Mac(key = amk_key_id, algorithm = HMAC-SHA-512, message = "SparkVault:Salt:Unseal:v1|vault=" || vault_id || "|acct=" || account_id) // 64 bytes
// Stage 3: HKDF key derivation (combines all three roots)
VAK = HKDF-SHA512(
  ikm = svmk_shared_secret || vmk, // vmk: the UTF-8 bytes of the vault's Base62 key
  salt = salt, // From HSM HMAC
  info = "SparkVault:VAK:v1|vault=" || vault_id,
  length = 32 // 256-bit key
)

Sparks, under two roots

A Spark is sealed under the two roots SparkVault holds, with no VMK. Sealing draws one entropy sample that supplies the Spark’s identifier and its 96-bit GCM nonce, encapsulates a fresh ML-KEM-1024 secret against the SVMK, and asks the HSM for the account AMK’s MAC of a message that names the account, the Spark and the nonce. HKDF-SHA512 then derives the Spark’s 256-bit key, the SAK, with the MAC as salt, the shared secret as input keying material, and an info string that names the same account, Spark and nonce. The SAK seals exactly one payload with AES-256-GCM and is overwritten. Reading the Spark decapsulates its stored ciphertext and derives the SAK again. Seal and read call the same derivation function, so they cannot drift apart, and a known-answer test that runs before every deploy of the API pins its output. Because a Spark needs only the two roots the platform holds, what protects it against a copy of the stores is the HSM boundary around the AMK, together with the secret store that holds the SVMK.

Sealing a Spark under the SVMK and the AMK
draw = HSM.Random(n) XOR CSPRNG(n) // one draw per seal: the Spark's identifiers and its 12-byte GCM nonce
m = HSM.Random(32) XOR CSPRNG(32) // the encapsulation message, a draw of its own
(ss, kem_ciphertext) = ML-KEM-1024.Encaps(svmk_public_key, m) // the ciphertext is stored with the Spark
salt = HSM.Mac(key = amk_key_id, algorithm = HMAC-SHA-512, message = "SparkVault:Salt:v1|acct=" || account_id || "|type=spark|id=" || spark_id || "|nonce=" || base64url(nonce))
SAK = HKDF-SHA512(
  ikm = ss,
  salt = salt,
  info = "SparkVault:Key:v1|acct=" || account_id || "|type=spark|id=" || spark_id || "|nonce=" || base64url(nonce),
  length = 32
)
(ciphertext, tag) = AES-256-GCM.Seal(SAK, nonce, payload, aad = "SparkVault:Spark:v1|acct=" || account_id || "|id=" || spark_id || "|nonce=" || base64url(nonce))

Key agreement between a person’s devices

Apart from TLS and the Web Push encoding RFC 8291 prescribes, the one key agreement between two parties in SparkVault’s design runs between a person’s own devices. When a person sends a vault key from the web console to the mobile app, or has the app send one back to unseal a vault in the browser, the two devices agree a key with X25519 and seal the message with XSalsa20-Poly1305. Each device makes a new X25519 key pair for the session from a 32-byte secret that is a draw from the platform’s entropy service XORed with the device’s own CSPRNG. The platform, which served one share, cannot reconstruct the secret key, and a flaw in either source alone does not weaken it. The X25519 shared point is hashed with HSalsa20 into a 256-bit key; XSalsa20 encrypts under a 192-bit nonce drawn the same way, and Poly1305 authenticates the result with a 128-bit tag. Each device overwrites its secret key when the session ends.

The session begins when the phone scans a code the browser shows, and the code carries only an identifier that groups the session’s messages, no key. The messages pass through the platform as one-read records: each is sealed at rest under ML-KEM-1024 and the AMK like any Spark, is destroyed by the read that delivers it, and expires within minutes if no one reads it. The phone stores a received key only after its owner confirms the transfer, and only if the key unseals the vault it claims to open; it releases a stored key only after a fresh biometric or passcode check. The devices’ public keys travel through the platform as well, so the channel protects the key from anyone who reads the platform’s stores or its network traffic, and section III’s bound on a party in control of the running platform applies to it as to every other path.

VIII. Authenticated encryption schemes

Authenticated encryption throughout

Every ciphertext SparkVault’s code produces comes from an authenticated encryption scheme. All but one are schemes with associated data (AEAD), which can also authenticate context the ciphertext does not carry; the exception, the device handoff’s XSalsa20-Poly1305, authenticates its ciphertext alone. AES-256-GCM seals files, thumbnails, Spark payloads, sealed names and every key envelope; ChaCha20-Poly1305 seals the secrets behind delegated keys; XSalsa20-Poly1305 seals the device-to-device handoff of section VII; and AES-128-GCM encrypts Web Push messages, as RFC 8291 requires. No unauthenticated cipher mode appears anywhere in the platform’s own code, server or client: no CBC, no counter mode without its MAC, no ECB. The CBC suites section XII lists are offered to older clients by the TLS endpoints, not used by SparkVault’s code. The HSM’s own wrapping of keys is AES-256-GCM as well.

An AEAD gives two guarantees under one key. Confidentiality: ciphertexts reveal nothing about their plaintexts beyond length, even to an adversary who chooses the plaintexts (IND-CPA). Integrity of ciphertexts: no adversary can produce a ciphertext the key holder accepts that the key holder did not create (INT-CTXT). Together they imply security against chosen-ciphertext attack (Bellare and Namprempre, 2000), and integrity alone is why decryption under an AEAD either returns exactly what was sealed or refuses. Associated data extends the integrity guarantee to context the ciphertext does not carry: the data is authenticated but not encrypted, and decryption succeeds only when the opener supplies the same bytes the sealer bound. In the associated data of every file chunk, thumbnail, Spark, sealed field and key envelope, SparkVault names the account and the object the ciphertext belongs to, with a label for its purpose and version, so a ciphertext moved anywhere else fails authentication instead of decrypting in the wrong place.

AES-256-GCM

GCM (NIST SP 800-38D) combines the AES block cipher (FIPS 197), here with 256-bit keys and fourteen rounds, used in counter mode for confidentiality, with GHASH for authentication: a polynomial hash over the field GF(2128) defined by x128 + x7 + x2 + x + 1, keyed by H, the encryption of the all-zero block. With a 96-bit IV, the initial counter block is the IV followed by the 32-bit value 1. The plaintext is encrypted with the counter blocks that follow it, and the tag is the encryption of the initial block XORed with GHASH over the associated data and the ciphertext, each zero-padded to a whole number of blocks, followed by their two 64-bit lengths. SparkVault seals every GCM ciphertext with a 96-bit IV, the length SP 800-38D recommends, and the full 128-bit tag. Every opener in the platform’s code accepts only a full 16-byte tag, so a truncated tag is never accepted, and a ciphertext that fails its tag returns no plaintext to its caller.

The table lists, for each AES-256-GCM ciphertext the core platform makes, what it is sealed under and bound to, followed by the other authenticated ciphers. Section XVII sets out how each nonce is made and why none repeats under its key; this section concerns the keys, the bindings and the limits.

Ciphertext Key Associated data
File chunk The vault’s VAK SparkVault:Ingot:v1, account, vault, file, chunk index; final=1 on the last chunk
Thumbnail The vault’s VAK SparkVault:Thumbnail:v1, account, vault, thumbnail generation, file, content version
Name, type, original file name, uploader address A field key the VAK yields SparkVault:VaultField:v1, account, vault, record, field
Help desk field A desk field key the VAK yields SparkVault:HelpDeskField:v1, account, record, field
Audit event details An audit key the VAK yields A fixed label; the key is the vault’s own
Spark payload The Spark’s SAK, used once SparkVault:Spark:v1, account, Spark, nonce
Unseal session, transfer record A fresh data key, sealed in turn under a KEK from the AMK’s MAC SparkVault:VAT:v1 or SparkVault:ISTK:v1, account, vault
Upload session A fresh data key, sealed in turn under a KEK from the AMK’s MAC SparkVault:TUS:v1, layer, account, vault, upload
Listing cursor A key from one AMK MAC over a fresh salt, used once SparkVault:Cursor:v1, account, listing
Identity RS256 signing key A KEK that HKDF derives from an AMK MAC Account, purpose label
Delegated-key secret, escrowed token (ChaCha20-Poly1305) An envelope key HKDF-SHA256 derives from the vault’s delegation key, used once Account, vault, salt identity, purpose, version
Device handoff (XSalsa20-Poly1305) An X25519 agreement between the two devices None; both keys exist for one session
Web Push message (AES-128-GCM) A P-256 agreement with the browser’s key, through HKDF-SHA256 None, as RFC 8291 specifies

Files

The file service cuts every file into 50 MiB chunks and seals each one separately under the vault’s VAK, so a file of any size passes through bounded memory and a range of a file maps to the chunks that hold it. Each chunk’s associated data names the account, the vault, the file and the chunk’s index, so a chunk swapped with another, moved to another file or vault, or replayed at another position fails its tag. The last chunk alone also binds a final marker. Removing trailing chunks and shrinking the file’s recorded length would promote an earlier chunk to last, and that chunk was sealed without the marker, so the truncation fails authentication instead of yielding a shorter file that verifies chunk by chunk.

Opening a chunk is streamed, and it releases nothing early. The file service checks that the stored object’s declared length is exactly the chunk’s plaintext length plus the 16-byte tag before it reads a byte, decrypts the ciphertext as it arrives, and verifies the tag at the end. Until the tag has verified over the whole chunk, the chunk’s plaintext, at most 50 MiB, is held back, so no byte of a chunk that fails authentication reaches a response. Writing is guarded as carefully. Two requests writing the same chunk at once would encrypt different data under the same derived nonce, so the file service grants one writer an exclusive lease on an upload before it reads any request body, and when it finds a chunk already stored at a chunk’s position it adopts that object only after authenticating that it holds exactly the bytes being written.

Names and other fields

A vault’s file and folder records hold their names, original file names, content types and uploader addresses sealed under a field key the VAK yields (section IX). A record stored before names were sealed keeps those values in the clear until it is sealed (section XVIII). A reader of a sealed record without the vault’s key learns no file name. Two details matter for the AEAD. Authenticated encryption does not hide a plaintext’s length, so each value is padded before sealing to a whole number of 32-byte blocks, with a floor of 128 bytes for a content type and 64 for an address: every common content type, and every IPv4 or IPv6 address, seals to one length. And the IV is not a bare random draw. It is the first 96 bits of an HMAC-SHA256, under a separate nonce key, over a fresh random nonce, the associated data and the padded value, so a nonce used twice would repeat an IV only for the same record, field and value. Such a repeat would show no more than that two sealed values are equal; it puts two different plaintexts under one key and IV only with the probability that two 96-bit HMAC outputs collide. A sealed file or folder is found by name through a blind index, an HMAC-SHA256 under a third key of the record’s kind and the name’s case-folded form, so neither a lookup nor a uniqueness check needs the name in the clear. The index reveals which records of one kind in a vault hold names that match once case and compatibility forms are set aside, and nothing more of them.

Keys in envelopes

The VAK is persisted, or passed to the file service, only inside envelopes. A fresh 256-bit data key seals it with AES-256-GCM, and a key-encryption key seals the data key, both layers bound to the same associated data. For an unseal session (section XI) and a transfer, the key-encryption key is the first 32 bytes of the HSM’s HMAC-SHA512, under the account’s AMK, of a message naming the domain, the account and the vault, so opening such an envelope takes a call to the HSM. Each of its two stored fields is exactly 60 bytes, ciphertext, nonce and tag, and an opener refuses any other length before it decrypts. An upload session wraps the VAK the same way under the transfer’s key-encryption key, with associated data that also names the upload and which of the two layers it seals.

Limits, and how the design stays inside them

GCM’s limits apply per invocation and per key. One invocation may encrypt at most 239 − 256 bits, just under 64 GiB. SparkVault’s largest single GCM invocation is a 50 MiB file chunk, and a file at the platform’s 5 TiB maximum is 104,858 chunks, far inside the 232 chunk indices that the final 32 bits of a chunk’s nonce can carry. Many keys seal exactly one message, so a nonce cannot repeat under them at all: each Spark’s SAK, each envelope’s data key, each cursor’s key and each delegated key’s envelope key. Keys that seal many messages under random 96-bit nonces (the per-vault key-encryption keys, the field and audit keys, and the VAK, which seals thumbnails that way beside its file chunks) fall under SP 800-38D’s rule that a key used with random IVs is invoked at most 232 times in all, every invocation under it counted, which keeps the probability of any repeated IV under 2−32. Reaching that would take billions of unseals, transfers or events, or billions of file chunks and thumbnails, in a single vault. The VAK’s file chunks use nonces derived per upload from a random base, and section XVII gives the uniqueness argument for every construction.

The other limit is volume. GCM’s confidentiality degrades with the number of blocks a key has encrypted: the birthday term of the bound in section XV grows with the square of that number, over 2129. A vault’s VAK encrypts all of that vault’s files for the vault’s whole life, so this is the limit that matters for it, and it is distant. The term stays small until a single key has encrypted petabytes (section XV). Each vault has its own VAK, so one vault’s volume counts toward no other’s.

ChaCha20-Poly1305

RFC 8439’s ChaCha20-Poly1305 seals the random secret behind each delegated key and the token a system grant escrows. ChaCha20 keeps a 512-bit state of sixteen 32-bit words, four constants, eight words of the 256-bit key, a 32-bit block counter and a 96-bit nonce, and mixes it with 20 rounds that alternate column and diagonal rounds of four quarter-rounds each, 80 quarter-rounds in all, built from 32-bit addition, rotation and XOR. The first keystream block, at counter 0, yields the one-time Poly1305 key, and encryption starts at counter 1. Poly1305 evaluates the associated data and the ciphertext, each zero-padded to a multiple of 16 bytes and followed by their lengths as 64-bit little-endian integers, as a polynomial modulo the prime 2130 − 5, and the result gives the 128-bit tag. For a single key, RFC 8439 states that forged messages are rejected with probability 1 − n/2102 for a 16n-byte message, even after 264 legitimate ones. Each delegated-key envelope authenticates well under 512 bytes, and section XV gives the bound that holds across every key at once, from the multi-user analysis of ChaCha20-Poly1305, for a forgery attempt against any envelope of that size.

The construction suits the job. Its operations are additions, rotations and XORs on 32-bit words, with no lookup tables and no branches that depend on secret data, so its software implementations run in constant time without special hardware. Its limits are far away: a ChaCha20-Poly1305 message may be up to 274,877,906,880 bytes, and a delegated-key envelope holds a 32-byte secret or a token of 48. Each envelope key is derived for one envelope and seals nothing else, so its nonce, a fresh 96-bit slice of the mint’s entropy draw, cannot repeat under it.

Delegated keys

A delegated vault access key (DVAK) lets a person, or a platform feature, unseal a vault without holding its VMK. A DVAK is the VMK, zero-padded to 32 bytes, XORed with a fresh 32-byte random secret. Its holder receives the DVAK. SparkVault keeps its SHA-256 digest, as the key of its record, its last four characters, to name it, and the secret, sealed with ChaCha20-Poly1305 under a key that HKDF-SHA256 derives from the vault’s delegation key. That key is 256 random bits, drawn when the vault’s first delegated key is made and stored only wrapped by a key-encryption key that was generated inside the HSM and never leaves it. The HSM wraps it with AES-256-GCM and binds the vault’s context, a purpose label, the account and the vault, as associated data, so a wrapped key copied onto another vault’s record does not unwrap.

Sealing a delegated key’s secret, and a system grant’s escrowed token
draw = HSM.Random(n) XOR CSPRNG(n) // one draw per mint: the 32-byte secret and a 12-byte nonce for each envelope
dvak = pad32(utf8(vmk)) XOR secret // 32 bytes; the holder receives "dvak_" || base64url(dvak)
record_key = SHA-256(base64url(dvak)) // keys the record, which keeps of the DVAK only its last four characters (and a system grant's escrow, below)
k = HSM.Decrypt(key = kek_key_id, ciphertext = vault.hvmk_key_wrapped, context = { purpose: "hvmk", account_id, vault_id }) // the vault's delegation key
secret_envelope = ChaCha20-Poly1305.Seal(
  key = HKDF-SHA256(ikm = k, salt = account_id || ":" || vault_id || ":" || base64url(dvak), info = "sparkvault-dvak-chacha20-poly1305", length = 32),
  nonce = 12 bytes of the mint's draw,
  plaintext = secret,
  aad = JSON({ account_id, vault_id, dvak_value: base64url(dvak), purpose: "dvak_secret", version: 1 }) // recomputed at every open, never stored
)
// A system grant also escrows its token, salted with the record's digest so the platform can open it unattended
escrow_envelope = ChaCha20-Poly1305.Seal(
  key = HKDF-SHA256(ikm = k, salt = account_id || ":" || vault_id || ":" || record_key || ":token", info = "sparkvault-dvak-chacha20-poly1305", length = 32),
  nonce = 12 more bytes of the mint's draw,
  plaintext = "dvak_" || base64url(dvak),
  aad = JSON({ account_id, vault_id, dvak_value: record_key, purpose: "dvak_token", version: 1 })
)

A person’s DVAK opens only when presented: its secret’s envelope key is salted with the DVAK itself, which no store holds, so even a full copy of the stores together with the ability to unwrap the vault’s delegation key cannot derive that envelope key. Presenting the DVAK at unseal supplies the missing salt. The platform finds the record by the presented value’s digest, derives the envelope key, opens the secret, and XORs it with the DVAK to recover the VMK, which then passes through the same verification and derivation as a VMK presented directly (section XI). A wrong value finds no record, and a stored digest presented in place of a DVAK finds nothing either, because the platform looks up the digest of whatever it is handed. The associated data repeats the account, the vault, the salt identity, the purpose and a version. It is recomputed at every open and never stored, because storing it would write the credential in the clear.

A system grant is the deliberate exception. When a vault’s owner turns on a feature that opens the vault unattended (sharing, an upload portal or widget, Messaging or the help desk), SparkVault mints a DVAK for that feature and also seals the DVAK itself in an escrow envelope salted with its record’s digest, which the platform holds, so the platform can open the vault on its own. That is the exception section III states. Each delegated key has its own secret and its own record, so revoking one leaves the VMK and every other delegated key as they were. Revoking a delegated key removes both of its envelopes in the same conditional write that marks it revoked, and withdrawing a feature deletes its grant’s record, so neither opens anything from the live store once its write commits; the delegated-key table’s point-in-time backups keep the earlier record for 35 days (section III). Every open costs one HSM decryption bound to the vault’s context, and the unwrapped vault key, the envelope key and the recovered secret are overwritten after use.

The other authenticated ciphers

XSalsa20-Poly1305 seals the device-to-device handoff that section VII describes. Its 192-bit nonce is long enough to draw at random for every message with no meaningful chance of a repeat. In SparkVault’s code, AES-128-GCM appears only in Web Push, where RFC 8291 fixes the content encoding: a P-256 agreement between a fresh key pair and the browser’s subscription key, HKDF-SHA256 with the subscription’s authentication secret and a 16-byte salt, and a single encrypted record. The platform draws each message’s key-pair seed and salt from its entropy service. In the browser, the web console keeps a local cache of files it has already downloaded and decrypted, and seals that cache too: AES-256-GCM under a per-account key made from a platform draw XORed with the browser’s own random generator, imported as a non-extractable key that the console’s code can use but never read back, with a fresh 96-bit IV for each cached file. Signing out clears the cache and its key.

IX. Key derivation functions

HKDF-SHA512

HKDF (RFC 5869), instantiated with HMAC-SHA512, derives the keys at the center of SparkVault’s design: each vault’s VAK, each Spark’s SAK, the keys a VAK yields for sealed fields, help desk fields and audit details, and the seed of SparkVault Identity’s signing key and the key that protects its optional RSA key. HKDF separates two jobs a key derivation function must do. The extract step condenses input keying material that may be unevenly distributed, such as a 32-byte KEM secret followed by a VMK of at most 25 Base62 characters, into a pseudorandom key: PRK = HMAC-SHA512(salt, IKM), 64 bytes. The expand step stretches that key into output tied to a purpose, each block an HMAC-SHA512 under the PRK of the previous block, the info string and a counter byte. Krawczyk’s analysis of the scheme (2010), which RFC 5869 specifies, treats the extract step as a randomness extractor keyed by the salt and the expand step as a pseudorandom function keyed by the PRK.

The platform’s own implementation, which derives the VAK, the SAK and the help desk, audit and Identity keys, runs a single expand round, T(1) = HMAC-SHA512(PRK, info || 0x01), and returns its first L bytes, so it serves outputs of up to 64 bytes and refuses a longer request rather than return a short key. Every key it derives is 32 bytes. The PRK is overwritten as soon as the expansion is done. The keys a VAK yields for sealed names come from the runtime’s own HKDF-SHA512, which returns the same bytes for the same inputs. Known-answer tests that run before every deploy of the API pin the function to committed outputs and to the runtime’s own independent HKDF implementation, at 32 and at 64 bytes, and pin the VAK and SAK derivations to committed answers, the VAK’s through a real decapsulation of a committed ciphertext. A change that would derive a different key from the same inputs cannot ship.

The HKDF extract and expand phases, as the platform’s own implementation runs them
// Extract phase: the salt keys HMAC, and the input keying material is its message
PRK = HMAC-SHA512(key = salt, message = IKM) // 64 bytes
// Expand phase: one round, so L ≤ 64 bytes; a longer request is refused
T(1) = HMAC-SHA512(key = PRK, message = info || 0x01)
OKM = first L bytes of T(1) // L = 32 for every key this function derives
zeroize(PRK)

Where each input sits, and why

RFC 5869 treats the salt as optional and usually public, and notes that a secret salt gives HKDF an even stronger guarantee. SparkVault’s VAK derivation makes it a secret held behind the HSM: the salt is the 64-byte HMAC-SHA512, under the account’s AMK, of a message naming the vault and the account, a MAC that only the HSM can compute because the AMK never leaves it. The input keying material is the 32-byte ML-KEM shared secret followed by the VMK. HMAC is keyed by its first argument, so the salt is the key of the extract step: without the AMK’s MAC, the PRK is the output of a pseudorandom function under a 512-bit key the adversary does not have, whatever it knows of the input. With the MAC in hand but the shared secret missing, the extract step instead has to condense an input carrying 256 bits the adversary cannot see, the extractor role Krawczyk’s analysis gives it. With only the VMK missing, the unknown part of the input is the VMK’s 144 bits. Section III states what these cases add up to, and section XV the bounds behind them.

The derivation is deterministic, and that is what lets SparkVault keep no vault key at rest. The HSM’s MAC of the same message under the same AMK is the same 64 bytes every time, the stored ML-KEM ciphertext decapsulates to the same shared secret every time, and the holder presents the same VMK, so every unseal derives the same VAK afresh. Nothing at rest holds a VAK in the clear: it exists in the memory of the operation that uses it and, sealed, in the envelopes of section VIII, which live session, transfer and upload records keep for the periods section III states, and which no backup holds. Even the derivation a vault’s creation runs wipes the VAK it computes.

Domain separation

One input may feed many derivations, so each derivation names its purpose. Every info string names its purpose, and most also carry the SparkVault namespace, a version label, and the account and the object the key is for; where one names no object, as for audit details, the input keying material is already the vault’s own. The messages the HSM MACs under an AMK are separated the same way, each beginning with a prefix of its own. Two derivations that differ in purpose, version, account or object produce independent keys even from the same input, so a key derived for one vault’s names is useless for another vault’s names, or for the same vault’s audit details. The version labels are what let a new derivation be introduced beside the current one (section XVIII). The table lists the HKDF derivations as the code performs them.

Key Salt Input keying material Info
VAK AMK MAC of SparkVault:Salt:Unseal:v1|vault={v}|acct={a} ML-KEM secret || VMK SparkVault:VAK:v1|vault={v}
SAK AMK MAC of SparkVault:Salt:v1|acct={a}|type=spark|id={s}|nonce={n} ML-KEM secret SparkVault:Key:v1|acct={a}|type=spark|id={s}|nonce={n}
Field key Empty VAK SparkVault:VaultFields:v1|acct={a}|vault={v}
Field nonce key Empty VAK SparkVault:VaultFieldNonce:v1|acct={a}|vault={v}
Name index key Empty VAK SparkVault:VaultNameIndex:v1|acct={a}|vault={v}
Help desk field key Empty VAK SparkVault:HelpDeskFields:v1|acct={a}|vault={v}
Audit details key 32 zero bytes VAK audit-log-encryption
Identity signing seed (Ed25519) sparkvault-identity-signing-key-v1 AMK MAC of the info string SparkVault:Identity:SigningKey:v1|account={a}
Identity RS256 key-encryption key sparkvault-identity-signing-kek-v1 AMK MAC of the info string SparkVault:Identity:SigningKeyKEK:RS256:v1|account={a}
Delegated-key envelope key (HKDF-SHA256) {a}:{v}: and the salt identity The vault’s delegation key sparkvault-dvak-chacha20-poly1305

The table has two kinds of row. The keys a VAK yields use an empty or all-zero salt, which is RFC 5869’s default and which HMAC’s zero padding of short keys makes identical: their input is already a pseudorandom 256-bit key, so the extract step has nothing to condense and the info string alone separates them. SparkVault Identity’s keys work the other way round. A fixed public salt keys the extract step, and the secret enters as input keying material, the account AMK’s MAC of the info string, so the HSM supplies the secret either way. Of the platform’s own derivations, the delegated-key envelope key is the one that uses HKDF-SHA256, and its salt carries the delegated key itself, or a system grant’s record digest, as section VIII explains; the only other HKDF-SHA256 in the code is the one RFC 8291 prescribes for Web Push.

HMAC-SHA512 inside the HSM

The AMK is a 512-bit HMAC key, one for each customer account, generated inside the HSM at the account’s first use, restricted to generating and verifying MACs, and impossible to export: the platform can send the HSM a message and receive its 64-byte HMAC-SHA512 (FIPS 198-1), never the key itself (section X). Because the MAC of a given message never changes, the AMK is a deterministic, secret source for derivation as well as a MAC. It supplies the VAK and SAK salts above; the key-encryption keys of unseal sessions, transfers and uploads, each the first 32 bytes of the MAC of a message naming its domain, the account and the vault; and the key and nonce that seal each listing cursor, the first 32 and the next 12 bytes of the MAC of a message carrying a fresh 16-byte salt, so each cursor has a key of its own. Each message begins with a prefix that names its purpose, so a MAC computed for one purpose is not the MAC any other purpose asks for. The help desk’s emailed sign-in codes are kept only as their MAC under the AMK, so a copy of the store offers no offline test of a code.

HMAC-SHA512 is a pseudorandom function under standard assumptions about SHA-512’s compression function, and with a 512-bit key the AMK lies beyond exhaustive search for classical and quantum adversaries alike (section VI). What protects it in practice is that the key does not exist outside the HSM, where no operation returns it. Because its MAC is the salt of every VAK and SAK the account’s vaults and Sparks are sealed under, it is also a permanent root, bound to its account once and never rotated or replaced; section X describes that lifecycle and the refusal that guards it.

Argon2id for the VMK verifier

SparkVault stores no VMK. For each vault it keeps an Argon2id hash of the VMK, the verifier, computed when the vault is created under a 32-byte salt drawn in the same entropy sample as the VMK itself; a vault that a feature opens unattended also carries the escrowed delegated key of section VIII. At every unseal the platform computes Argon2id over the presented VMK under the stored salt and parameters, compares the result with the stored verifier in constant time, and refuses a wrong VMK only after that full evaluation. The parameters are stored with each verifier and read back at every check, so a verifier is always checked under the parameters it was made with.

Parameter Value
Variant and version Argon2id (RFC 9106), version 0x13
Memory, m 65,536 KiB (64 MiB): 65,536 blocks of 1,024 bytes
Passes, t 3, so 196,608 block computations per evaluation
Lanes, p 4, each of 16,384 blocks in four slices
Tag 32 bytes
Salt 32 bytes, one per vault

These are the parameters of RFC 9106’s second recommended option, which the RFC calls a uniformly safe choice where much less than its first option’s 2 GiB of memory is available: Argon2id with t = 3, p = 4 and m = 216 KiB, with a 128-bit salt and a 256-bit tag. SparkVault’s salt is twice that length. Argon2id fills its memory with 1,024-byte blocks, each computed by a compression function built on BLAKE2b’s round function, which treats a block as an 8 × 8 matrix of 16-byte registers and adds twice the product of the operands’ low 32 bits to each addition in BLAKE2b’s mixing function. For the first half of its first pass, slices 0 and 1 of pass 0, it chooses which blocks to read independently of the input, so that part’s memory access pattern reveals nothing about the VMK to an observer of the machine. From then on it chooses them by the data, which makes trading memory for recomputation expensive: the best trade-off attack RFC 9106 records against multi-pass Argon2id lowers the time-area product by a factor of only 1.33. Argon2 won the Password Hashing Competition in 2015. For an attacker, each guess costs holding 64 MiB for the length of an evaluation, so parallel hardware buys far less against it than against a fast hash.

A VMK is never a person’s choice: SparkVault draws it as 144 random bits, and a search of 2144 candidates is beyond any classical attacker, with or without the verifier (section VI gives the quantum figure). A stolen verifier is an offline test of VMK guesses, and every guess against it costs a full Argon2id evaluation. The memory-hard cost is defense in depth on top of that entropy, and the verifier decrypts nothing: it tells a right VMK from a wrong one, and nothing more. The same Argon2id costs, with a 16-byte salt, protect the client secrets of OpenID Connect applications registered with SparkVault Identity. In the mobile app, the VMK also keys the fingerprints the app uses to recognize files it has already backed up, through scrypt with N = 215, r = 8 and p = 1, a memory-hard derivation over 32 MiB, so a stored fingerprint, to anyone who also knows the file’s content, is a test of a VMK guess that costs a memory-hard evaluation, as the verifier is.

X. Hardware Security Module integration

All cryptographic operations involving the Account Master Key (AMK) occur exclusively within FIPS 140-3 Level 3 validated Hardware Security Modules in the platform’s region. SparkVault invokes hardware-protected operations without access to the AMK material, which never leaves the HSMs in plaintext: the platform hands the HSM a message and receives a MAC, and no operation exists that would return the key itself. Each customer account has an AMK of its own, so a MAC computed under one account’s key says nothing about any other account’s.

The modules are a regional fleet of validated HSMs that SparkVault leases from its infrastructure provider as a managed key service, which the provider runs behind an interface that answers only authenticated, authorized requests. SparkVault designed everything on the platform’s side of that interface: which keys exist and what each may do, which runtime may ask for which operation, which message each MAC authenticates, how the outputs combine with the other two root keys, and what the platform does when the service cannot answer. The same HSMs do three further jobs. They hold the platform’s key-encryption key, which wraps each vault’s delegation key (section VIII); they supply one of the two random sources XORed into every random value SparkVault’s code draws; and they generate every new RSA key pair the platform signs tokens with.

The validated module

The modules are validated under FIPS 140-3 at overall Level 3, with every applicable area of the standard assessed at Level 3, physical security included. Each module’s cryptographic boundary is a hard, tamper-evident enclosure that meets Level 3’s physical-security requirements, which add resistance to opening and probing to the evidence of tampering that lower levels require; a module erases the keys it holds when it is powered off and when it enters its error state. Level 3 also requires identity-based authentication of the module’s operators. The module verifies the integrity of its firmware when it initializes and runs its conditional self-tests then and again every day; on any failure it enters an error state in which every secret it holds is zeroized and no cryptographic service answers.

An AMK or the key-encryption key exists in plaintext only inside the modules, in memory, for the time a request needs it. The provider administers the modules under quorum-based access controls: no administrative action on a module can be taken by one of the provider’s operators alone. SparkVault holds no administrative role on the modules at all; it can ask them to perform operations on its own keys, within the permissions set out below. Each algorithm the platform uses inside the HSM (HMAC-SHA-512, AES-GCM, the random bit generator and RSA key generation) is among those the module’s FIPS 140-3 certificate lists as approved.

The keys that live in the HSM

The HSMs hold two kinds of key, both generated inside them. The first is the AMK: one per customer account, a 512-bit HMAC key whose only permitted uses are generating and verifying MACs, so no caller, whatever its permissions, can use it to encrypt, decrypt or sign. Its key material is generated by the HSM rather than imported. The provider stores it durably only in encrypted form, under keys that exist only inside the modules. The AMK never leaves the HSM boundary in plaintext, and its encrypted durable copy stays within one region.

An AMK is created at its account’s first use, and its identifier is written to the account’s record once, by a conditional write that only a record without one accepts. Two requests that race to create it settle on whichever key was bound first, and the other key stays unbound and unused. From then on the binding never changes, because the AMK is a permanent root: its MAC is the salt of every vault key and every Spark key the account owns, so a different AMK would derive different keys for all of them. SparkVault never rotates, replaces or deletes an AMK. The same reasoning drives a refusal. If an account that already owns a vault or a Spark is ever found with no AMK on its record, for example after the record was restored from an older image, the platform refuses to create one: a new key would silently derive wrong keys for everything the account owns while sealing new data under a root the old data never opens under. The request fails, operations is alerted, and the remedy is to restore the original binding, never to make a new key.

The second is the platform’s key-encryption key: a single 256-bit AES-GCM key whose only permitted uses are encryption and decryption (the wrapped copy of each key pair the HSM generates under it among them), generated inside the HSM. An operator made it once, and the running platform can neither make a key in its place nor move the name it reaches the key-encryption key by. If that key is ever missing, disabled or scheduled for deletion, every operation that needs it fails closed and operations is alerted, rather than a new key being made in its place: a replacement would fork the root, so that existing wraps stopped opening while new ones landed under the new key. Its lasting job is to wrap each vault’s 32-byte delegation key (section VIII), which the entropy service draws when the vault’s first delegated key is minted. The HSM binds each wrap to an authenticated context naming its purpose, its account and its vault, so a wrapped key copied onto another vault’s record does not unwrap.

AMK creation and use, as the platform asks the HSM
// Once per account, at its first use: a key whose material cannot be exported
amk_key_id = HSM.CreateKey(type = HMAC-512, usage = MAC generation and verification only)
// Every use: the HSM returns a MAC, never the key
mac = HSM.Mac(key = amk_key_id, algorithm = HMAC-SHA-512, message = message)
Wrapping a vault’s delegation key, as the platform asks the HSM
// Once per vault, at its first delegated key: 32 bytes the entropy service drew
wrapped_key = HSM.Encrypt(key = kek_key_id, plaintext = vault_key, context = { purpose: "hvmk", account_id, vault_id })
zeroize(vault_key) // whether the HSM wraps it or refuses
// Each recovery: the HSM unwraps it only under the same context
vault_key = HSM.Decrypt(key = kek_key_id, ciphertext = wrapped_key, context = { purpose: "hvmk", account_id, vault_id })

Every operation the platform asks of the HSM

The platform’s code asks the HSM for these operations and no others:

  • Creating an AMK. Once per account, at its first use, as above. The platform’s code creates no other kind of key.
  • Checking a key. The API periodically confirms with the service that an AMK it uses is enabled. The check is an early warning, never the guard: a key disabled since the last check still fails at the MAC itself.
  • Computing a MAC. HMAC-SHA-512 under an account’s AMK, a 64-byte answer to a labeled message. The labels separate its purposes, which include the salt of each vault’s key (at the vault’s creation, at every unseal, and whenever a feature opens the vault unattended; sections III and VIII), the salt of each Spark’s key, the key-encryption keys of session and transfer envelopes, the key and nonce of each pagination cursor, the seed of the account’s identity signing key and the key that seals its optional RS256 key, and the help desk’s reply tokens, the MACs of its emailed sign-in codes, and the digests it names requesters and senders by. Each purpose authenticates its own labeled message, so the MACs of different purposes are independent of one another.
  • Wrapping and unwrapping a vault’s delegation key. Encryption and decryption under the key-encryption key, in the vault’s own context, as above: one wrap when the vault’s first delegated key is minted, and one unwrap each time a delegated key or a feature’s grant is recovered to its VMK (section VIII).
  • Drawing random bytes. A bounded number of bytes per call from the HSM’s random bit generator, which the entropy service XORs with the host’s own generator (below).
  • Generating an RSA-2048 key pair. The HSM runs the whole key generation, the search for primes included, and returns the pair; the operator script that makes the platform’s access-token signing key, and the identity service when an account first needs its optional RS256 signing key, ask for their pairs this way. The platform may ask only for this key size, and the copy of the private key that the HSM also returns, wrapped, is discarded.

Everything else the servers compute runs in the API’s and the file service’s own memory: ML-KEM-1024 decapsulation under the SVMK, which is a software key (section IV), HKDF, and every server-side AES-256-GCM and ChaCha20-Poly1305 seal and open, file chunks included. The HSM’s outputs enter those computations as inputs. A MAC becomes an HKDF salt or input, or, cut to its first bytes, a key-encryption key or a cursor’s key and nonce, and an unwrapped vault key becomes the input of an HKDF. The HSM never sees file content: it authenticates short labels and wraps 32-byte keys, and the bulk encryption runs in the file service under the keys those operations help derive.

How the platform authenticates to the HSM

The platform’s runtimes hold no stored credential for the HSM. The API runs as event-driven functions and the file service as managed containers, and the provider gives each runtime temporary credentials for its own role and renews them itself; every request to the HSM service is signed with them. The service verifies the signature and evaluates the request against the role’s permissions and the key’s policy before it performs the operation, and it accepts requests only over TLS, with cipher suites that provide forward secrecy. Both runtimes reach the service through a private endpoint inside the platform’s virtual network (section II), so their HSM traffic never crosses the public internet.

Each runtime’s role is confined to the operations above that it performs, on the keys it needs them on (section II). Whoever deletes a key can only schedule the deletion: the provider keeps a scheduled key whole through a mandatory waiting period, during which the deletion can be cancelled and the key restored.

Every call is recorded. The provider logs each operation on SparkVault’s keys, with the role that made it and, for the file service, the running task the credentials were issued to, in the cloud account’s audit history (section II). A call that would destroy or disable a key is also reported to operations the moment it is recorded. Every call to the service carries a timeout, and none has a fallback.

Region, durability and failure

The HSM service is regional, and so are SparkVault’s keys: every AMK and the key-encryption key are single-region keys, generated and used in the platform’s region. Section XX states what the platform’s availability depends on and how it recovers from an outage of the service; what follows is how the code behaves during one.

The code treats every HSM failure as a refusal, never as a reason to answer some other way. A MAC that cannot be computed fails the unseal, transfer or Spark that needed it, and no software path stands in for an AMK, because none could produce the same MAC. The entropy service fails a draw rather than continue with the host’s generator alone, and fails it too when the HSM answers with a different number of bytes than were asked for. The file service tells the two kinds of failure apart. When the service cannot answer for a moment, the request is answered with a retry-later status before anything is committed, and nothing single-use is spent. When the HSM refuses outright, because a key is disabled, scheduled for deletion or gone, or a permission was withdrawn, the request fails as a cryptographic error and operations is alerted. A key that stops answering is never replaced by a new one: the recovery is always the same key, enabled again or restored inside its waiting period.

Hardware entropy generation

Every random value SparkVault’s own code draws (keys, nonces, salts, tokens and identifiers) is the HSM’s random output XORed with the host’s CSPRNG. The XOR of two independent sources is at least as random as the better one, so neither alone decides a value, and a flaw in the host’s generator or in the hardware’s does not weaken what the platform draws. The HSM’s bytes are overwritten as soon as they are mixed.

One draw from the entropy service
// The HSM's bytes, exactly as many as asked for
hsm_bytes = HSM.Random(n) // n up to one call's limit
draw = CSPRNG(n) XOR hsm_bytes
zeroize(hsm_bytes)

The hardware source is the module’s NIST SP 800-90A deterministic random bit generator, seeded from an entropy source that meets NIST SP 800-90B, and both run the health tests their standards specify, inside the module’s validated boundary. On the host, the second source is the runtime’s cryptographically secure generator, seeded by the operating system.

The platform draws as few times as a unit of work allows, up to what one HSM call returns, and slices each draw into disjoint fields rather than calling the HSM for each value. An unseal, for example, draws 88 bytes once for its session token, a data key and two nonces (section XI), and a vault’s creation draws its identifier, its VMK and its verifier’s salt in one call. The same service makes every key pair the platform generates at random, apart from the device secrets below. An RSA pair comes whole from the HSM, as above. A P-256 pair is derived from a 48-byte seed by the method of FIPS 186-5, Appendix A.2.1, whose 128 extra bits make the reduction’s bias toward any scalar negligible, and an ML-KEM-1024 pair from a 64-byte seed by FIPS 203’s internal key generation, which is how the operator script makes the SVMK for a new environment.

The randomness guard of section II holds the rule in place on every deploy and every infrastructure change. The only sanctioned exceptions are secrets that only a device may know, such as the key pairs of the device-to-device key handoff (section VII) and the console’s local file-cache key: each is a draw from the platform XORed with the device’s own generator, so the platform never learns the result and neither generator alone decides it.

XI. Vault unseal ceremony

The vault unseal ceremony is how a holder opens a vault. It combines the three root keys to derive the vault’s data key, the Vault Access Key (VAK), seals that key into a session the platform holds, and returns a Vault Access Token (VAT) that names the session. By default a session ends after one hour without activity, and 24 hours after the unseal at most; the account’s administrators can change the first and shorten the second. Files are encrypted and decrypted under the VAK with AES-256-GCM.

The protocol answers two requirements. The VMK reaches the platform at each unseal, so it must be checked and used within that one request and stored nowhere. The VAK, on the other hand, must outlive the request, because every file operation that follows needs it, so it is kept sealed under a key that only the account’s AMK can recompute, and the platform opens it only for a request that presents a live session. Section III states what that sealed copy means against an adversary in control of the running platform. No backup keeps it: the session’s record lives only in the live store. The steps:

  1. Presenting the key. A caller authenticated to the vault’s account sends the VMK over TLS, or a delegated key, from which the platform recovers the VMK.
  2. Admitting the request. The platform reads the vault with a strongly consistent read and refuses one that is scheduled for deletion or being deleted.
  3. Verifying the key. The platform checks the VMK against the vault’s Argon2id verifier, and refuses a wrong key only after the full evaluation.
  4. Deriving the VAK. ML-KEM-1024 decapsulation with the SVMK, an HMAC-SHA512 salt from the account’s AMK inside the HSM, and HKDF-SHA512 over both and the VMK.
  5. Sealing the session. The VAK is sealed into the session’s record with AES-256-GCM, under a fresh data key that is itself sealed under a key derived from the AMK, and the VAK and the intermediate keys are then overwritten in memory.
  6. Committing it. The session’s record is written, on condition that the delegated key behind it, if any, is still live, and the unseal is recorded in the vault’s audit log.
  7. Using the vault. The holder receives a Vault Access Token. Each request that presents it opens the session record to recover the VAK, and each file chunk is sealed and opened under the VAK, bound to its account, vault, file and position.
  8. Ending it. The session ends at its deadline, when its holder ends it, when the vault is sealed or scheduled for deletion, or when the delegated key behind it is revoked.

Presenting the key

Unsealing is an authenticated operation. A request from outside the platform must carry a credential of the vault’s own account, a member’s sign-in or an API key, and the vault must belong to that account, so a VMK on its own, presented by anyone else, opens nothing. The body carries exactly one key. A VMK is the Base62 string the platform minted when the vault was created (144 random bits, section V); a delegated key carries a prefix of its own, and the platform tells the two apart by that prefix alone. Once a delegated key has passed checks of its own, both take one code path, so a delegated key meets every check a VMK meets. An optional lifetime, in whole seconds from one second to 24 hours, can only shorten the session the vault’s settings allow, and a malformed one is refused before anything is read, unwrapped or written.

The key crosses the network inside TLS (section XII), and it is never written to a log: the request lines the platform logs carry no bodies, and the unseal’s own log lines name a delegated key by its last four characters at most. A presented VMK must have the form of one (12 to 32 letters and digits) before any work is spent on it. A delegated key takes one more step first, described in section VIII. Its record is found by the SHA-256 digest of the presented value, read with a strongly consistent read, and only a live key the caller may present goes further: the platform then has the HSM unwrap the vault’s delegation key, opens the delegated key’s sealed secret under a key derived from it, and XORs the secret back into the VMK. The recovered VMK goes through exactly the verification below, so a delegated key never bypasses the vault’s own verifier, and the session it mints inherits its access level: a read-only delegated key yields a read-only session.

Verifying the key

The platform reads the vault’s record with a strongly consistent read, so a vault scheduled for deletion a moment earlier is refused rather than served from a stale image, and it computes the session’s lifetimes from the vault’s settings and the requested lifetime. It then recomputes Argon2id over the presented VMK with the vault’s stored 32-byte salt and stored cost parameters (three passes over 64 MiB in four lanes, section IX), and compares the 32-byte result with the stored verifier in constant time; the recomputed value is overwritten as soon as it has been compared. The cost parameters are read from the vault’s own record rather than from code, so a stronger setting can be adopted for new vaults without disturbing the verifiers of existing ones (section XVIII).

A wrong key is refused only after the full Argon2id evaluation, and the attempt is logged as a security event naming the account, the vault and the client’s address. What makes guessing hopeless is the key itself: a VMK is one of 2¹⁴⁴ values, and even at a trillion guesses a second, an expected search would run for more than 10²³ years. A copy of the verifier is no shortcut, because each offline guess costs a full Argon2id evaluation.

Deriving the VAK

Derivation takes one contribution from each root. The vault’s record holds a 1,568-byte ML-KEM-1024 ciphertext, encapsulated to the SVMK when the vault was created; the API decapsulates it with the SVMK’s 3,168-byte decapsulation key and recovers a 32-byte shared secret, using an SVMK it has first proved to be the pinned key pair (section VII). The second contribution is the AMK’s MAC over a label naming the vault and its account, 64 bytes that only the HSM can compute (section X). The third is the VMK.

HKDF-SHA512 (RFC 5869) combines them. The MAC is the salt of the extract step, the shared secret followed by the VMK’s UTF-8 bytes is the input keying material, and a versioned label naming the vault is the info of the expand step, which yields the 32-byte VAK from a single HMAC block. Salting the extraction with the HSM’s MAC keys it with a secret held in hardware, so the pseudorandom key the expansion runs on depends on all three roots at once; the label binds the result to this vault; and its version leaves room for a successor derivation beside this one (section XVIII). The shared secret and the MAC are overwritten on every exit, a failed derivation included, and the concatenated input and the intermediate pseudorandom key as soon as the VAK exists.

Deriving the VAK at unseal, and decrypting a chunk with it
// Verify the presented VMK
assert Argon2id(vmk, vault.vmkh_salt, t = 3, m = 64 MiB, p = 4) == vault.vmkh
// Derive the VAK from all three roots
ss = ML-KEM-1024.Decaps(vault.kem_ciphertext, svmk_private_key)
salt = HSM.Mac(key = amk_key_id, algorithm = HMAC-SHA-512, message = "SparkVault:Salt:Unseal:v1|vault=" || vault_id || "|acct=" || account_id)
VAK = HKDF-SHA512(ikm = ss || vmk, salt = salt, info = "SparkVault:VAK:v1|vault=" || vault_id, length = 32)
// Authenticated decryption of chunk n of a file
nonce = file.base_nonce XOR n // n in the nonce's last 32 bits
aad = "SparkVault:Ingot:v1|acct=" || account_id || "|vault=" || vault_id || "|id=" || file_id || "|chunk=" || n // the last chunk adds "|final=1"
plaintext = AES-256-GCM.Open(VAK, nonce, chunk, aad)

Sealing the session

The VAK must outlive the request, so the platform seals it into the session’s record under two layers of AES-256-GCM. One draw from the entropy service supplies everything random the session needs: 88 bytes, sliced into a 32-byte session token, a 32-byte data key and a 12-byte nonce for each layer. The inner layer seals the VAK under the data key. The outer layer seals the data key under a key-encryption key, the first 32 bytes of the AMK’s MAC over a label naming the session domain, the account and the vault, computed by the HSM at that moment. Both layers authenticate the same versioned label naming the account and the vault, so a sealed session copied onto another vault’s record fails to open. Each layer is stored as 60 bytes: 32 of ciphertext, the 12-byte nonce, and the full 16-byte tag. The VAK, the data key and the key-encryption key are overwritten in memory as soon as the seal is made, whether or not it succeeded.

Sealing the VAK into the session’s record
// One draw for the session's random fields, sliced into disjoint fields
draw = HSM.Random(88) XOR CSPRNG(88)
vat_token, data_key, vak_nonce, data_key_nonce = draw[0..32], draw[32..64], draw[64..76], draw[76..88]
// The session's key-encryption key: the first 32 bytes of the AMK's MAC
kek = HSM.Mac(key = amk_key_id, algorithm = HMAC-SHA-512, message = "KEK:VAT:" || account_id || ":" || vault_id)[0..32]
aad = "SparkVault:VAT:v1|acct=" || account_id || "|vault=" || vault_id
vak_encrypted = AES-256-GCM.Seal(data_key, vak_nonce, VAK, aad) // ciphertext 32 || nonce 12 || tag 16
data_key_encrypted = AES-256-GCM.Seal(kek, data_key_nonce, data_key, aad)
zeroize(VAK, data_key, kek)
vat = "vat_" || base64url(vat_token)

The token is those 32 random bytes in base64url behind a fixed prefix: 256 bits that name the session and are worth nothing without a credential of the vault’s account. The session’s record holds the two sealed layers, the vault and the account it belongs to, its access level, the vault’s session and deletion generations as the unseal read them, its time of issue, its inactivity timeout, its current deadline and an immutable hard deadline. A session that a delegated key minted also holds the SHA-256 digest of that key: a pointer that lets a revocation find the session, never the key itself. Nothing in the record yields the VMK, because the derivation of the VAK runs one way.

The record is written once the seal exists. For a session a delegated key minted, the write is one transaction that also checks the delegated key’s record is still live, because the derivation takes long enough for a revocation to land while it runs: if the key was revoked meanwhile, no session is created and the request is refused. The unseal is then recorded on the vault and in its audit log (section XIX), with who unsealed it, from where, the session’s timeouts and, for a delegated key, its type and last four characters. The response carries the token, the vault’s identifier, the deadlines and the inactivity timeout, and no key.

Using an unsealed vault

A VAT names a session. It is not a key, and it is never enough on its own. Every request that uses the vault presents the VAT in a header beside a credential of the vault’s account, and the API checks, in order: that a session record exists for the token, read with a strongly consistent read so that a renewal or an ending is never missed; that the session’s deadline has not passed, whether or not its record is still stored; that the vault, read strongly as well, is not scheduled for deletion and still carries the session and deletion generations the session was minted in; and, for a session a delegated key minted, that the key’s record is still live, read strongly on every use. Only then does it ask the HSM for the session’s key-encryption key and open the two layers. The session must also belong to the caller’s account and to the vault the request names, or the request is refused.

The VAK opened for a request lives for that request alone. It is used for the operation and overwritten when the response ends, on every exit path, an error included, together with any field keys the request derived from it to seal or open the vault’s file and folder names. The session’s access level decides what the request may do: a read-only session reads, and every write checks the level for itself. File content moves through the file service. For each transfer the API seals the VAK once more, under a key-encryption key of the transfer domain derived from the same AMK, and the file service opens it with its own call to the HSM. Every chunk of a file is sealed and opened under the VAK with AES-256-GCM, its nonce derived from a random base nonce and the chunk’s index, and its authenticated data binding the account, the vault, the file and the chunk’s position, with the last chunk marked so that a file cut short fails authentication (section XVII).

Activity extends a session, within limits. A successful upload or download authorization, or a change to a file, its sharing or a folder, moves the session’s deadline to the inactivity timeout from now, never past the hard deadline set at the unseal. Listing, navigating, searching, polling and thumbnails extend nothing, so a vault left open on a screen still reseals. Each extension is a conditional transaction that requires the session to still exist and be live, the vault’s generations to match and any delegated key behind it to be live, so a concurrent seal or revocation always prevails and no extension can recreate an ended session. An explicit Extend action renews a live session within the same hard deadline and never replaces it. Every successful response to a request that used a session reports that session’s deadlines, so the console and the mobile app can warn before it reseals.

The clients keep the token out of durable storage. The console keeps it in the browser tab’s session storage, which is discarded with the tab, and the mobile app keeps it in memory only. The mobile app can also keep a vault’s VMK or delegated key in the phone’s keychain, device-only and behind the device’s biometric check unless the person chooses otherwise, and present it at the next unseal.

Lock, timeout and seal

A session ends in one of five ways, and each takes effect at once. When the inactivity timeout or the hard deadline passes, every resolution refuses the token, because authorization checks the deadline itself instead of waiting for the record to disappear; the record becomes eligible for the metadata store’s expiry an hour later, and once that process removes it, nothing of it remains, since no backup keeps a session’s record (section III). When the holder ends the session, with the Seal Vault action in the console or the mobile app, the record its token names is deleted. Any holder of the token signed in to the vault’s account may end it, a read-only or expired session included, because ending a session only takes access away.

A seal of the vault ends every session of it in one atomic write that advances the vault’s session generation. Every session carries the generation it was minted in, and every resolution compares it with a strongly consistent read of the vault, so all of the vault’s sessions end at that instant, including any that an eventually consistent index has not yet listed. The same seal revokes every private file transfer derived from the earlier generation, which the file service checks before it opens a transfer and again before each chunk that follows. Revoking a delegated key ends every session that key minted the moment the revocation commits, by the per-use check above, and a sweep then deletes their records. Scheduling the vault’s deletion advances its deletion generation and ends every session the same way, and cancelling the deletion revives none of them.

After any of these, the vault opens again only through a new unseal: the key presented and verified again, the VAK derived again, and a new session minted in the vault’s current generation. Every unseal, and every seal that ends all of a vault’s sessions, is recorded in the vault’s audit log.

Reseal settings

How long a session may last is a property of the vault, set by the account’s administrators and applied from the next unseal. The inactivity timeout runs from 60 seconds to 24 hours, or zero for a fixed lifetime that activity never extends; the maximum runs from 60 seconds to 24 hours, and the inactivity timeout may not exceed it. A vault that sets neither inherits the platform’s defaults of one hour and 24 hours. Presets cover common choices: one ends a session after 15 minutes without activity and 12 hours at most, and the strictest gives every session a fixed life of one hour. The settings are copied into each session as it is minted, its hard deadline immutable from then on, so a later change to the vault’s settings never lengthens a session that already exists, and a lifetime requested at the unseal can only shorten the result.

XII. Transport layer security

Every web page, API call, file transfer and live-update connection reaches SparkVault over TLS, which the edge network terminates, and a plain-HTTP request is answered only with a permanent redirect to the same address over HTTPS. A client that supports TLS 1.3 (RFC 8446) gets it: authenticated encryption, forward secrecy, the version’s own protection against being downgraded, and hybrid post-quantum key agreement whenever the client offers it. On most hosts, the edge also serves clients that offer only TLS 1.0, 1.1 or 1.2, and accepts older cipher suites from them: CBC-mode suites, which are not AEAD, and on the hosts that serve an RSA certificate, RSA key transport, which has no forward secrecy.

Transport protects what crosses the internet: a VMK presented at unseal, the plaintext of a file on its way in or out, and the credentials that authorize each request. It does not decide the safety of stored data. A vault’s key, the VAK, never leaves the platform’s memory unsealed, and a VMK learned from a recorded connection still lacks the SVMK and the AMK that stored data needs (section VI). The parameters, as the edge serves them:

Parameter Value
Minimum version TLS 1.0, at the edge network
Preferred version TLS 1.3, with every client that supports it
TLS 1.3 cipher suites TLS_AES_256_GCM_SHA384, TLS_CHACHA20_POLY1305_SHA256, TLS_AES_128_GCM_SHA256
Cipher suites AEAD only on TLS 1.3; TLS 1.0 to 1.2 also accept CBC suites, and RSA key transport without forward secrecy on the hosts that serve an RSA certificate
Key agreement X25519MLKEM768 (hybrid post-quantum key agreement, chosen whenever the client offers it), and classical elliptic-curve groups for a client that does not
Certificates ECDSA P-256 and, on most hosts, RSA-2048 beside it, from public certificate authorities
Certificate lifetime At most 90 days, issued and renewed automatically by the edge network
Certificate Transparency Signed certificate timestamps from public logs in every certificate
Plain HTTP A permanent redirect to the same address over HTTPS
Strict-Transport-Security One year, on the marketing site, the console and the API

Hybrid post-quantum key agreement

X25519MLKEM768 runs two key agreements inside one TLS 1.3 handshake: the X25519 Diffie-Hellman exchange of RFC 7748, and ML-KEM-768, the module-lattice key encapsulation mechanism of FIPS 203. The client’s key share carries an ML-KEM-768 encapsulation key and an X25519 public value; the edge answers with an ML-KEM ciphertext and its own X25519 value; and the two shared secrets, concatenated, become the input of TLS 1.3’s key schedule. An adversary has to break both to learn the session’s keys. Against today’s adversaries the long-studied X25519 holds on its own, at about 128 bits. Against a cryptographically relevant quantum computer, which would break X25519 with Shor’s algorithm, ML-KEM-768 holds, at the security category 3 that FIPS 203 assigns it. That is the defense against “harvest now, decrypt later” collection, in which an adversary records encrypted traffic today in order to decrypt it once such a computer exists. Pairing the two is the point of the hybrid: ML-KEM is the newer design, and a flaw found later in either one alone does not expose a session.

The edge chooses the hybrid group whenever a client offers it, and current releases of the major browsers offer it by default. Where a host advertises HTTP/3, the connection runs on QUIC, whose handshake is TLS 1.3 by definition (RFC 9001), and the edge offers the same hybrid agreement there; QUIC also protects its packet numbers and its own control messages, which TCP leaves visible to anyone on the path. A client that offers no hybrid group gets a classical one. A connection whose key exchange was classical is open to a quantum adversary who recorded it: that adversary can read what it carried, a VMK presented at unseal included, but not the SVMK or the AMK that stored data needs (section VI).

Authentication is a separate question from key agreement. The edge’s certificates use classical signatures (ECDSA on P-256, and RSA-2048 for older clients), and a quantum adversary able to forge them could impersonate SparkVault, but only by doing so live, during a handshake. A recording made today gives such an adversary nothing to forge later. That is why key agreement is the part of TLS that has to be post-quantum first: it is the part a recording can attack years afterwards.

Versions and cipher suites

TLS 1.3 removes the weaker choices rather than configuring them away. Compared with TLS 1.2, it drops static RSA and static Diffie-Hellman key exchange, every cipher that is not an AEAD, compression and renegotiation (RFC 8446). Every cipher suite it defines is an AEAD, and the edge offers three: AES-256-GCM, ChaCha20-Poly1305 and AES-128-GCM. Every full handshake agrees fresh ephemeral keys, so a session recorded today cannot be decrypted later with a stolen certificate key, and everything after the server’s first message, the certificate included, is encrypted. The protocol also carries its own downgrade protection: a TLS 1.3 server that negotiates an older version marks its random value, and a TLS 1.3 client that sees the mark knows that someone stripped TLS 1.3 from the handshake (RFC 8446, section 4.1.3). A current client therefore cannot be pushed onto an older version by an attacker in the network path.

On most hosts, the edge still accepts TLS 1.0, 1.1 and 1.2 from clients that offer nothing newer. Over TLS 1.2 it accepts ECDHE key agreement with AES-GCM or ChaCha20-Poly1305. From TLS 1.0 to 1.2 it also accepts CBC-mode suites, which authenticate with a separate MAC instead of an AEAD, and, on the hosts that serve an RSA certificate, RSA key transport, in which the client encrypts the session’s secret to the certificate’s key: anyone who recorded such a session and later obtained that key could decrypt it. These are the edge network’s settings for SparkVault’s domains, and section III states what a network adversary gains from a client that allows them.

Certificates

Each host presents an ECDSA certificate on the P-256 curve, and most hold an RSA-2048 certificate beside it, so a client that cannot verify ECDSA still connects; the edge chooses between them by the signature algorithms the client says it supports. ECDSA comes first because P-256 gives about 128 bits of strength with far smaller keys and signatures than RSA-2048, whose strength is about 112 bits. The certificates are issued by public certificate authorities that validate control of the domain, and each is valid for at most 90 days. The edge network issues, deploys and renews them automatically, so no certificate’s renewal depends on a person remembering a date.

Every certificate carries signed certificate timestamps from public Certificate Transparency logs (RFC 6962): each log’s signed promise to publish the certificate in an append-only record that anyone can audit. Browsers that enforce Certificate Transparency trust a publicly issued certificate only with such timestamps, so a certificate any authority issues for a SparkVault name is accepted by those browsers only once logs have promised to publish it. TLS authenticates SparkVault by its certificate alone (section III).

Behind the edge

The edge network reaches the platform over TLS too: the API accepts TLS 1.2 and 1.3, and the file service’s load balancer TLS 1.0 to 1.2, so that hop runs at TLS 1.2 at most. The API’s own endpoints accept nothing older than TLS 1.2 and offer TLS 1.3 with the same three AEAD suites the edge offers, for its requests and for the live-update channel the console listens on alike. Both origins present certificates for SparkVault’s own domains. The file service’s load balancer runs inside the platform’s virtual network and passes each connection to a file service container there, keeping the connecting edge server’s address so that the container’s firewall, which admits from the internet only the edge network’s published address ranges, can check it (section II).

Both hops agree their keys classically: the API’s endpoints offer no hybrid group, and TLS 1.2, the most the file service’s load balancer speaks, has none. A recording of either hop is therefore open to a future quantum adversary, with what it carried, as section VI describes. The API’s HTTP routes and the file service also check that a request came through the edge network: the edge adds to each request it forwards a secret kept in the platform’s managed secret store and never given to a client, and each origin compares the value it receives with its own copy in constant time.

Inside the platform, the API and the file service reach the provider’s services (the metadata store, object storage, the HSM and the secret stores) only over TLS, at TLS 1.2 or later, which the provider requires of every service endpoint, and each request is signed with the caller’s temporary role credentials (section X). The HSM and the secret stores are reached through private endpoints inside the virtual network. The in-memory cache that holds the API’s short-lived state accepts only TLS connections and encrypts what it stores. The file service calls the API not through the public API host but by invoking the API’s function through the provider’s signed invocation interface, under the file service’s own role.

Security headers

The pages a browser loads and the API’s responses carry Strict-Transport-Security for one year, so that after one visit the browser itself uses only HTTPS for that host, and a network attacker cannot downgrade a typed address on later visits. The console, the file-sharing pages, the API, the identity portal and the help desk’s and notifications’ domains send the policy with subdomains included. The marketing site sends it for its own host alone, because not every name in its domain is the marketing site’s to vouch for, and a policy sent from the apex would hold them all to HTTPS for a year. A policy is sent only over HTTPS, as RFC 6797 requires. On a customer’s own custom domain, the help desk sends a policy for that one host, so the customer’s other names stay theirs to serve.

The same responses carry the other headers that harden how a browser handles them. They forbid content sniffing (X-Content-Type-Options: nosniff), so a browser never treats a response as a type it was not served as. They forbid framing by any site (X-Frame-Options: DENY, and frame-ancestors 'none' wherever a page carries a content security policy), which closes clickjacking against the console, the vault pages and the upload pages. They send only the origin, never the path or the query, in a referrer to another site (strict-origin-when-cross-origin). API responses default to Cache-Control: no-store with private, so neither a browser nor a shared cache keeps a copy of a response carrying account data. Every HTML page the API renders forbids framing, and the console’s content security policy lists the origins it may connect to.

Mail in transit

Mail the help desk sends to a desk’s customers, and mail the notification service sends for a customer organization, is handed to a receiving server only over TLS. The sending configuration requires it, so a message whose recipient’s server cannot start TLS is not delivered, rather than sent in the clear. Mail the help desk receives must arrive over TLS as well: mail from a sending server that cannot start TLS is refused and never reaches a desk.

XIII. Technical specifications summary

Cryptographic algorithms

This section gathers the platform’s principal cryptographic parameters in one place, as the code runs them today. Sections IV to XII argue each choice; the tables state what was chosen. The values every stored object depends on, the key derivations and their labels, are pinned by known-answer tests: a change that would leave existing data unreadable fails the test suite the owning service’s deploy runs before it ships, however cleanly new data would round-trip under it.

The algorithms, with the standard each implements and where SparkVault uses it. Every encryption key whose size SparkVault chooses is 256 bits; Web Push, whose standard fixes the cipher, uses AES-128-GCM for a notification’s payload.

Algorithm Standard Use Parameters
ML-KEM-1024 NIST FIPS 203 A fresh shared secret for every vault and every Spark, encapsulated to the SVMK Encapsulation key 1,568 bytes; decapsulation key 3,168 bytes; ciphertext 1,568 bytes; shared secret 32 bytes
AES-256-GCM FIPS 197, NIST SP 800-38D File chunks, Sparks, session and transfer envelopes, sealed fields, audit details, pagination cursors 256-bit key; 96-bit nonce; 128-bit tag
ChaCha20-Poly1305 RFC 8439 The sealed secrets of delegated keys 256-bit key; 96-bit nonce; 128-bit tag
HMAC-SHA-512 FIPS 198-1, RFC 2104 The AMK, computed inside the HSM; the PRF of HKDF-SHA512 512-bit AMK; 512-bit output
HKDF-SHA-512 RFC 5869 The VAK, Spark keys, field keys, audit detail keys, identity signing seeds One expansion block; 32-byte keys
HKDF-SHA-256 RFC 5869 The envelope keys of delegated keys 32-byte keys
Argon2id RFC 9106 The VMK’s verifier; the secrets of identity-provider clients Three passes; 64 MiB; four lanes; 32-byte output
HMAC-SHA-256 FIPS 198-1 The blind index of file and folder names; the nonces of sealed fields; unsubscribe and invitation links 256-bit keys
SHA-256 FIPS 180-4 Digests of bearer credentials at rest; the SVMK’s pinned fingerprint 256-bit output
RSA-2048 (RS256) FIPS 186-4 key generation, as the HSM is validated to perform it; RFC 7518 Access and refresh tokens; an account’s optional RS256 identity tokens 2048-bit modulus; new pairs made in the HSM
Ed25519 RFC 8032 Identity tokens and interaction receipts One key per account, derived from its AMK
X25519, XSalsa20-Poly1305 RFC 7748 (X25519); XSalsa20 (Bernstein, 2011) and Poly1305 (Bernstein, 2005) Carrying a vault key between a person’s own devices Key pairs that live for one session; 192-bit nonce
ECDH P-256, AES-128-GCM RFC 8291 Web Push notification payloads A new P-256 key pair and a 16-byte salt for every message
Deterministic random bit generator NIST SP 800-90A The HSM’s random bit generator Seeded from an SP 800-90B entropy source in the module
X25519MLKEM768 FIPS 203, RFC 7748 TLS 1.3 key agreement at the edge Hybrid; section XII

ML-KEM-1024 and the 256-bit symmetric primitives are the platform’s post-quantum layer. The first rests on the Module Learning With Errors problem, for which no efficient quantum algorithm is known, and the second keep a 128-bit margin even against Grover’s search. The classical public-key algorithms in the table sign tokens and receipts, authenticate TLS, carry keys between a person’s own devices and encrypt push notifications; none of them protects the confidentiality of stored data (section VI).

The table can also be read by where each primitive runs. HMAC-SHA-512 under an AMK, AES-GCM under the key-encryption key, the random bit generator and RSA key generation run inside the HSM. The device-to-device handoff runs on the two devices, and the platform relays only its ciphertext. TLS key agreement runs at the edge network (section XII), and every other use in the table runs in the memory of the API or the file service (section X).

Security strength

The strength of each primitive in bits of work, what a quantum adversary changes, and what the primitive protects on SparkVault. The classical figures follow NIST SP 800-57 Part 1, which rates RSA-2048 at 112 bits and P-256 at 128; the categories are the ones FIPS 203 assigns.

Primitive Classical strength Against a quantum adversary Protects
ML-KEM-1024 Security category 5: at least as hard to break as key search on AES-256 Category 5 Every vault’s and Spark’s shared secret
AES-256-GCM, ChaCha20-Poly1305 256-bit keys; 128-bit tags About 128 bits, under Grover’s search Files, Sparks, sealed fields and envelopes
SHA-512 256-bit collision resistance; 512-bit preimage resistance About 256-bit preimage resistance HKDF and the AMK’s MAC
ML-KEM-768 with X25519 Category 3, combined with X25519’s 128 bits Category 3 TLS connections that agree the hybrid group
ECDSA and ECDH on P-256, X25519, Ed25519 About 128 bits Broken by Shor’s algorithm TLS authentication and classical key agreement, device-to-device handoff, Web Push, identity tokens and receipts
RSA-2048 About 112 bits Broken by Shor’s algorithm Access and refresh tokens; TLS authentication and RSA key transport on hosts with an RSA certificate

NIST’s categories compare a scheme with key search on a block cipher: category 1 with AES-128, category 3 with AES-192 and category 5 with AES-256, counting quantum attacks as well as classical ones. Section VI explains why Grover’s search leaves a 256-bit key about 128 bits and why Shor’s algorithm leaves the classical public-key rows nothing, which is why they carry no figure in the quantum column. The VMK is not a row because it is not a primitive: its strength is its 144 random bits, which sections III and VI weigh.

The weakest rows protect the confidentiality of no stored data. RSA-2048 signs access tokens, which live for an hour, and refresh tokens, which live 30 days, and on the hosts that serve an RSA certificate it authenticates TLS and, for clients that use RSA key transport, carries the session’s secret; its 112-bit strength is within what NIST SP 800-57 accepts for protecting data through 2030. The elliptic-curve rows authenticate, sign tokens and receipts, and carry keys in transit. Every file and Spark at rest is sealed with AES-256-GCM under a key whose derivation needs an ML-KEM-1024 shared secret and a MAC from the HSM-held AMK, and, for a file, the vault’s VMK as well.

Keys

The principal keys the platform holds or derives, where each lives and for how long. The three root keys are permanent by design: each vault’s key is derived from all three, so replacing any of them would take every affected vault’s VMK, which SparkVault does not hold, apart from vaults a feature opens unattended (section III). Section XX states what this means for incident response.

Key Form Where it is held Lifetime
SVMK ML-KEM-1024 key pair A managed secret store; its public key pinned by SHA-256 Permanent
AMK 512-bit HMAC key, one per account Inside the HSM, in one region; never exported Permanent, from the account’s first use
VMK 144 random bits, at most 25 Base62 characters With the vault’s holder; SparkVault keeps only an Argon2id verifier, apart from vaults a feature opens unattended (section III) Permanent
Key-encryption key 256-bit AES-GCM key Inside the HSM, in one region; never exported Permanent
Vault delegation key 32 random bytes, one per vault Stored only wrapped by the key-encryption key, bound to its vault The vault’s life
Delegated key (DVAK) The VMK XORed with a 32-byte secret With its holder; stored as a SHA-256 digest, and a feature’s grant also in a sealed escrow; its secret sealed with ChaCha20-Poly1305 Until revoked; a revoked key’s earlier record and a withdrawn grant stay in the point-in-time backups for 35 days (section III)
VAK 32 bytes from HKDF-SHA512 over the three roots Sealed in a session’s, a transfer’s or an upload’s record; opened for one request at a time The vault’s life, re-derived at each unseal; each sealed copy lasts as long as its live record, and no backup holds one (section III)
Spark key (SAK) 32 bytes from HKDF-SHA512 over the AMK’s MAC and an ML-KEM shared secret Derived when needed, never stored One operation
Session key-encryption key The first 32 bytes of the AMK’s MAC over the vault’s session label Derived per use, then overwritten One use
Session data key 32 random bytes Sealed under the session key-encryption key The session
Access-token signing key RSA-2048 key pair; a new one is made in the HSM A managed secret store Until an operator replaces it, which ends every signed-in session
Identity signing key Ed25519 key pair, one per account, derived from its AMK Never stored; derived into memory Permanent

The lifetimes fall into tiers. The three roots are permanent, and they are held in three places of different kinds: a secret store, the HSM and the vault’s holder. What the roots protect is reached through keys derived when they are needed: the VAK at each unseal, kept sealed in its session’s, transfer’s or upload’s live record and in no backup, and the keys that seal those records, derived for one use and overwritten at their last use (section XVI). The delegation key and the delegated keys sit between the tiers: they last as long as the vault or the grant, and they are stored only sealed or as a digest.

The access-token signing key and the identity signing key behave differently from the rest on purpose. The first is the one key here meant to be replaceable: it signs credentials and seals nothing, so replacing it ends every signed-in session, people’s and integrations’ alike, and costs no stored data anything. An account’s Ed25519 identity signing key is never stored anywhere: it is derived from the account’s AMK wherever it is needed and exists only in memory, so a copy of every store the platform keeps holds none of them.

Sessions

The unseal ceremony’s parameters (section XI). The defaults apply to a vault for which the account’s administrators have set nothing, and every limit is enforced by the API on each request, never by the client.

Parameter Value
Vault Access Token 256 random bits in base64url, behind a fixed prefix
Inactivity timeout One hour by default; 60 seconds to 24 hours, or none for a fixed lifetime
Maximum lifetime 24 hours by default; 60 seconds to 24 hours
Requested lifetime 1 second to 24 hours, never beyond the vault’s maximum
What extends a session A successful upload or download authorization, or a change to a file, its sharing or a folder
Wrong key Refused only after the full Argon2id evaluation
Session envelope Two AES-256-GCM layers of 60 bytes each, bound to the account and the vault
Backups of the session’s record None: the record exists only in the live store

The inactivity timeout and the maximum work together. The first ends a session that is opened and then left alone, and the actions that count as activity push it forward; the maximum is a ceiling fixed at the unseal that no activity moves. A vault whose inactivity timeout is zero gives every session a fixed length from the start. The requested lifetime lets an integration ask for less time than the vault allows, never more.

Hardware security module and entropy

The leased HSM capability as SparkVault uses it (section X). The validation, the key storage and the random bit generator are the provider’s published properties of its modules; the key specifications, the operations and the draw are SparkVault’s choices.

Parameter Value
Validation FIPS 140-3, overall Level 3; physical security at Level 3
Key storage in the module Plaintext only inside the module, for the time a request needs it
AMK 512-bit HMAC key; MAC generation and verification only; one region
Key-encryption key 256-bit AES-GCM key; encryption and decryption only; one region
Operations SparkVault uses Creating AMKs, MACs, encryption and decryption, random bytes, RSA-2048 key pairs
Random bit generator NIST SP 800-90A DRBG, seeded from an SP 800-90B entropy source in the module
One draw Up to one HSM call’s bytes, XORed with as many from the host’s CSPRNG
Key deletion Scheduled only, after a mandatory waiting period in which it can be cancelled

Three kinds of value sit in these tables. The HSM’s validation, its key storage, its random bit generator and its deletion waiting period are properties of the service SparkVault leases, stated as the provider publishes them, and the hybrid key agreement is the edge network’s. Everything else is SparkVault’s own design within the standards each row cites: the three-root derivation, the key specifications and the permissions around them, the envelope formats, the session rules and the single entropy path. Transport parameters are in section XII, and nonce construction by context in section XVII.

XIV. Mathematical notation and definitions

Section XV states SparkVault’s security the way a cryptography paper does: as theorems, each of which bounds what an adversary can achieve against the construction by what the same adversary could achieve against one of the standard primitives inside it, plus terms that are written out in full. Sections XVI and XVII examine what those theorems assume of the implementation. This section fixes the notation and the security definitions the three sections use. The conventions are those of the provable-security literature in its concrete form. Every bound is a function of what the adversary spends (time, queries, data), not only a statement that some quantity is negligible, so each theorem can be checked against the published result it rests on and evaluated at the parameters SparkVault actually runs.

Strings, numbers and sampling

{0,1}n is the set of n-bit strings, and byte strings are read as bit strings, so a 32-byte key is an element of {0,1}256. x ∥ y is the concatenation of x and y, which the rest of this document writes ||, and x ⊕ y is the bitwise exclusive-or of two strings of equal length. 0k is the string of k zero bits, and ⟨n⟩32 is the 32-bit big-endian encoding of an integer 0 ≤ n < 232. A label in quotation marks, such as "SparkVault:VAK:v1|vault=", stands for the bytes of its UTF-8 encoding, and ⌈x⌉ is the least integer not less than x.

x ←$ S means that x is drawn uniformly at random from the finite set S, and x ← D that it is sampled from the distribution D. A left arrow after an algorithm’s name, as in (ek, dk) ← ML-KEM-1024.KeyGen(), names the outputs of one run of it. 𝒜O is 𝒜 with access to an oracle O: a procedure it may call, and whose internals, a key for instance, it cannot see. Apart from keys an HSM generates inside itself, such as the AMK, every value a theorem writes as x ←$ S comes from the platform’s entropy source (section X), the XOR of a hardware security module’s random bit generator with the host’s CSPRNG. The theorems assume such draws are uniform. The XOR of two independent strings is uniform as long as either one is, so the assumption holds if either source is sound.

Four algebraic structures appear inside the primitives. ℤq is the ring of integers modulo q, and Rq = ℤq[X]/(X256 + 1) is the polynomial ring of ML-KEM, with q = 3329. Rqk is a vector of k such polynomials, and Bη is the centered binomial distribution with parameter η, from which ML-KEM samples its secrets and errors. 𝔽2128 is the field of 2128 elements defined by the polynomial x128 + x7 + x2 + x + 1, in which GCM’s GHASH computes its authenticator, and 𝔽p, with p = 2130 − 5, is the prime field in which Poly1305 computes its own.

Adversaries, games and advantage

An adversary is an algorithm, named with a script capital: 𝒜 for the attacker a theorem is about, and ℬ and 𝒞 for the adversaries its proof builds from 𝒜. An adversary is measured by its resources: its running time t, the number of queries it makes to each oracle, and the total length of those queries. A security property is defined by a game, a short program in which a challenger generates keys, answers the adversary’s oracle queries and finally decides whether the adversary won. Pr[G(𝒜) ⇒ 1] is the probability that game G, played with 𝒜, outputs 1. In the code-based style of Bellare and Rogaway (2006), each definition below is an exact experiment, described here in words.

Most properties compare two worlds. In the real world the adversary’s oracles run the scheme under a key it does not know; in the ideal world they run something secure by construction, such as a function chosen uniformly at random. The adversary’s advantage against property x of a scheme Π measures how well it tells the two apart: AdvxΠ(𝒜) = |Pr[RealxΠ(𝒜) ⇒ 1] − Pr[IdealxΠ(𝒜) ⇒ 1]|. An equivalent form flips a hidden bit b, runs the real world when b = 0 and the ideal world when b = 1, and scores the adversary’s guess b′ as |2·Pr[b′ = b] − 1|. For an authenticity property the adversary must instead produce something, a forgery, and its advantage is the probability that it does. An advantage of 0 means the adversary learned nothing; an advantage of 1 means it always wins.

A reduction is a theorem of the form AdvxΠ(𝒜) ≤ c·AdvyΣ(ℬ) + ε. It says that from any adversary 𝒜 against property x of a construction Π, one can build an adversary ℬ, running in about the same time, against property y of a primitive Σ that Π is built from. Any attack on Π therefore yields an attack on Σ of about the same cost, so as long as Σ resists attack, Π does too, apart from the explicit term ε: a statistical term such as a birthday bound or a failure probability, which needs no computational assumption beyond any idealized model the theorem names. The factor c is the reduction’s loss. A reduction with c = 1 and a small ε is tight: breaking the construction is then no easier than breaking the primitive.

Negligible functions and bits of security

Asymptotic definitions measure a scheme against a security parameter λ. A function ε of λ is negligible, written negl(λ), if for every polynomial p there is a λ0 such that ε(λ) < 1/p(λ) for every λ ≥ λ0. An adversary is PPT (probabilistic polynomial time) if its running time is bounded by some poly(λ), and a scheme is secure in this sense if every PPT adversary has negligible advantage. Several of the papers cited state their results in this form as well. The primitives SparkVault runs have fixed parameters (AES-256 has one key length), so section XV states its theorems concretely, as bounds that can be evaluated. A primitive offers b bits of security when no known attack running in time t succeeds with probability greater than about t/2b. An advantage of 2−64, for instance, is about one success in 264 independent attempts.

Pseudorandom functions and permutations

A function family F: 𝒦 × D → R is a pseudorandom function (PRF) if, for a key K ←$ 𝒦 the adversary does not see, the oracle F(K, ·) cannot be told apart from a function ρ drawn uniformly from all functions from D to R: AdvPRFF(𝒜) = |Pr[𝒜F(K,·) ⇒ 1] − Pr[𝒜ρ(·) ⇒ 1]|. A pseudorandom permutation (PRP) is defined the same way, against a uniformly random permutation. AES-256 is modeled as a PRP on 128-bit blocks under a 256-bit key, ChaCha20’s block function as a PRF from a 256-bit key, a counter and a nonce to 512 bits, and HMAC-SHA512 as a PRF with 512-bit output. The proofs about HMAC reduce further, to the compression function of SHA-512, h: {0,1}512 × {0,1}1024 → {0,1}512, which maps a 512-bit chaining value and a 1,024-bit message block to a new chaining value. Written h, it is keyed through its chaining value; written h̄, the same function is keyed through its message block.

Two variants of the PRF notion appear in section XV. A related-key PRF stays pseudorandom even when the adversary may also query it under keys derived from the secret key by a fixed set Φ of transformations, such as an XOR with a constant. HMAC needs this of h̄, because it derives its two internal keys from one key by XORing two constants into it, after padding the key with zeros when it is shorter than a block (Bellare, 2006; Backendal, Bellare, Günther and Scarlata, 2023). A swap-PRF is a two-input function that is a PRF when keyed through its second input instead of its first, and a function that is both a PRF and a swap-PRF is a dual-PRF. HKDF uses HMAC both ways. Its first step takes the salt as HMAC’s key and the input keying material as HMAC’s message, so when the secret sits in the input keying material, the property a proof needs is swap-PRF security.

Key encapsulation: IND-CCA2

A key-encapsulation mechanism (KEM) consists of three algorithms. KeyGen returns a public encapsulation key ek and a private decapsulation key dk; Encaps(ek) returns a ciphertext c and a key K; Decaps(dk, c) returns K again. In ML-KEM-1024, ek and c are 1,568 bytes each and K is 256 bits. Decapsulating a ciphertext that fails ML-KEM’s re-encryption check returns a pseudorandom key derived from a secret seed rather than an error, a design called implicit rejection. The security notion is indistinguishability under adaptive chosen-ciphertext attack (IND-CCA2). The challenger runs KeyGen and Encaps, flips a bit b, and gives the adversary ek, the challenge ciphertext c*, and either the real key K0 or a random K1 ←$ {0,1}256. The adversary may ask for the decapsulation of any ciphertext other than c*, and wins by guessing b: AdvIND-CCA2KEM(𝒜) = |2·Pr[b′ = b] − 1|.

ML-KEM’s IND-CCA2 security is proved from the Module Learning With Errors problem (MLWE). With m samples of rank k and noise parameter η, the adversary receives a uniformly random matrix A ∈ Rqm×k and a vector that is either A·s + e, for a secret s ← Bηk and an error e ← Bηm, or uniformly random in Rqm. AdvMLWEm,k,η(𝒜) is its advantage at telling which. The best known attacks on MLWE at ML-KEM’s parameters are lattice reductions, and the discussion after Theorem 1 gives their estimated cost.

Authenticated encryption: IND-CPA and INT-CTXT

A nonce-based scheme for authenticated encryption with associated data (AEAD) has an encryption algorithm Enc(K, N, A, M), which returns a ciphertext C carrying a τ-bit authentication tag, and a decryption algorithm Dec(K, N, A, C), which returns M or the rejection symbol ⊥. K is the key, N the nonce, A the associated data, which the tag binds to the ciphertext without encrypting it, and M the message. Both AEADs that SparkVault uses for stored data, AES-256-GCM and ChaCha20-Poly1305, take a 256-bit key and a 96-bit nonce and produce a 128-bit tag. Their security has two parts. Indistinguishability under chosen-plaintext attack (IND-CPA) is privacy: the adversary’s encryption oracle returns real ciphertexts in one world and uniformly random strings of the same length in the other. Integrity of ciphertexts (INT-CTXT) is authenticity: given the same encryption oracle and a verification oracle, the adversary wins if any (N, A, C) it did not receive from the encryption oracle is accepted.

In both games the adversary is nonce-respecting: it never asks for two encryptions under one key with the same nonce. That hypothesis is the subject of section XVII. A scheme with both properties is also secure against chosen-ciphertext attack: its IND-CCA advantage is at most its IND-CPA advantage plus twice its INT-CTXT advantage (Bellare and Namprempre, 2000). The adversary’s resources have standard names, which section XV uses throughout: q is the number of encryption queries; σ the total length of their messages and associated data, in 128-bit blocks; ℓ the length of the longest single message with its associated data, in blocks; and qv the number of forgery attempts, counted as failed decryptions plus one.

The multi-key setting

A single-key definition describes an attack on one key, but an attacker who obtains a copy of SparkVault’s stored data faces many keys at once: a VAK for every vault, an AMK for every account, a fresh data key for every session record. The multi-key, or multi-user, form of each game gives the adversary oracles for u independent keys, indexed by i, and counts it as winning if it breaks any one of them. A hybrid argument, which replaces the keys one at a time, bounds any multi-key advantage by the sum of the single-key advantages, each with the resources the adversary spent on that key (Bellare, Boldyreva and Micali, 2000; for AES-GCM, Bellare and Tackmann, 2016).

Two consequences shape section XV. Terms that grow with the data one key protects, such as GCM’s birthday terms, are paid key by key, so what matters is the most data any one key protects, not the total across the platform. And exhaustive key search gets easier with more targets: p trial evaluations against u keys of k bits succeed with probability at most u·p/2k, which for AES-256 with u = 240 keys and p = 2100 trials is 2−116. Tighter multi-user bounds have been proved for GCM and for ChaCha20-Poly1305 (Hoang, Tessaro and Thiruvengadam, 2018; Degabriele, Govinden, Günther and Paterson, 2021), but in the ideal-cipher and ideal-permutation models, so section XV uses the generic sum, which needs only the standard-model assumptions above.

Idealized models

Some of the proofs cited model one component as ideal. In the random-oracle model (ROM), a hash function is replaced by a function drawn uniformly at random, which every party may query. In the quantum random-oracle model (QROM), the adversary may query that function in quantum superposition. In the ideal-cipher model, a block cipher is replaced by an independent random permutation for every key. A bound proved in such a model covers every attack that uses the component as a black box, and says nothing about an attack that exploits its internal structure. Where a theorem in section XV holds only in one of these models, it says so.

Symbols used in sections XV to XVII

Symbol Meaning
𝒜, ℬ, 𝒞 An adversary, and the adversaries a reduction builds from it
AdvxΠ(𝒜) The advantage of 𝒜 against property x of scheme Π
q, qv Encryption queries, and forgery attempts
σ, ℓ 128-bit blocks under one key in all, and in the longest message
qRO Queries to a random oracle
qH, qA HMAC evaluations, and memory-hard (Argon2id or scrypt) evaluations, spent guessing a VMK
u Independent keys under attack at once
CK Seals made under one key K
δ ML-KEM-1024’s decryption-failure probability, 2−174
h, h̄ SHA-512’s compression function, keyed through its chaining value and through its message block
ssv, sv Vault v’s 256-bit ML-KEM shared secret, and the AMK’s HMAC of its salt message
ℛ The root keys (SVMK, AMK, VMK) an adversary holds
Λ(M) What the construction does not hide about a file’s contents M

XV. Formal security reductions

This section states, as reductions in the sense of section XIV, what the construction of sections IV, VII and XI guarantees. Theorems 1 to 4 are published results about its primitives, specialized to the parameters SparkVault runs them at. Theorem 5 composes them, and bounds what an adversary holding the platform’s stored data and up to two of a vault’s three root keys can learn about that vault’s files. Each bound reduces to assumptions about the primitives: the hardness of Module-LWE, and properties of AES-256, of ChaCha20, of SHAKE-256 and of the compression functions of SHA-512 and SHA-256. Where a step needs an idealized model, or an assumption beyond the standard ones, the theorem says so. The composition is argued on paper in this section; it has not been machine-checked or independently reviewed. One component has more behind it: the IND-CCA security of the ML-KEM specification has a machine-checked proof, in the classical random-oracle model and down to a variant of Module-LWE (Almeida et al., 2024). That proof covers the specification, not the implementation SparkVault runs.

The adversary of these theorems is the first adversary of section III, who reads stored data, extended in Theorem 5 by root keys. None of them controls the running platform. Section III explains why no cryptography stops an adversary who does, and the hypotheses of Theorem 5 state exactly where its guarantee stops.

The construction

In the notation of section XIV, the parts of the construction that the theorems reason about are these:

The construction the theorems reason about
Setup     (ek, dk) ← ML-KEM-1024.KeyGen()                    // the SVMK, once for the platform
          AMKa ←$ {0,1}512                                  // for each account a, inside the HSM
Create v  VMKv = Base62(r), r ←$ {0,1}144                       // returned to its creator once
          (cv, ssv) ← ML-KEM-1024.Encaps(ek)                 // cv stored with the vault
          vmkhv = Argon2id(VMKv, zv; t = 3, m = 64 MiB, p = 4)   // zv ←$ {0,1}256
Unseal v  ssv = ML-KEM-1024.Decaps(dk, cv)
          sv = HMAC-SHA512(AMKa, "SparkVault:Salt:Unseal:v1|vault=" ∥ v ∥ "|acct=" ∥ a)
          VAKv = HKDF-SHA512(salt = sv, ikm = ssv ∥ VMKv, info = "SparkVault:VAK:v1|vault=" ∥ v, L = 32)
Session   KEKv = HMAC-SHA512(AMKa, "KEK:VAT:" ∥ a ∥ ":" ∥ v), first 32 bytes
          record = AES-256-GCM(KEKv, D), AES-256-GCM(D, VAKv)       // D ←$ {0,1}256, fresh for each unseal
Store     Cf,n = AES-256-GCM.Enc(VAKv, Nf ⊕ (064 ∥ ⟨n⟩32), Af,n, Mf,n)
          Af,n = "SparkVault:Ingot:v1|acct=" ∥ a ∥ "|vault=" ∥ v ∥ "|id=" ∥ if ∥ "|chunk=" ∥ n   // "|final=1" appended on the last chunk
          // if: the id of the file upload f writes, which its later versions keep

The three roots enter at three different places: the SVMK through the KEM, the AMK through the salt, and the VMK through the input keying material. HKDF combines them, and Theorem 5 shows that its output stays pseudorandom as long as any one of the three stays secret. The VAK keys every chunk of every file in the vault directly. Each upload f, of a new file or a new version of one, has its own random 96-bit base nonce Nf (section XVII). The keys that seal a vault’s names and types and derive their synthetic nonces, the key of its name index, the key of its audit details and, for a help desk, the key of its sealed fields are derived from the VAK by HKDF-SHA512 under info strings of their own. An unseal also writes a session record that holds the VAK under a fresh data key, itself sealed under a key-encryption key the AMK derives (section XI); transfer and upload records hold the VAK the same way, under a second such key.

Theorem 1: KEM security

Theorem 1 (IND-CCA2 security of the KEM). Let 𝒜 be an adversary against Kyber-1024, the round-3 parameter set that FIPS 203 standardized as ML-KEM-1024 (k = 4, η1 = η2 = 2, du = 11, dv = 5), that makes at most qRO queries to the hash functions the proof models as random oracles. Then there are adversaries ℬ against MLWE and 𝒞 against the pseudorandom function the scheme samples its noise with, each running in about the time of 𝒜, such that:

IND-CCA2 advantage against the KEM standardized as ML-KEM-1024, in the random-oracle and quantum random-oracle models
ROM    AdvIND-CCA2(𝒜) ≤ 2·AdvMLWE5,4,2(ℬ) + AdvPRF(𝒞) + 4·qRO·δ
QROM   AdvIND-CCA2(𝒜) ≤ 4·qRO·√(AdvMLWE5,4,2(ℬ) + AdvPRF(𝒞)) + 8·qRO2·δ
       δ = 2−174

These are Theorems 2 and 3 of the scheme’s round-3 specification (Avanzi et al., 2021). FIPS 203 made small changes when it standardized the scheme as ML-KEM, and the machine-checked proof cited above establishes IND-CCA security for the ML-KEM specification itself, in the classical random-oracle model. The MLWE term is the advantage of ℬ on k + 1 = 5 samples of rank k = 4 with η = 2. The PRF term covers SHAKE-256, the function with which ML-KEM expands a seed into its noise. δ = 2−174 is the probability that a valid ML-KEM-1024 ciphertext fails to decapsulate, an event a chosen-ciphertext adversary could try to provoke and observe; with qRO = 264 classical hash queries, the term 4·qRO·δ is 2−108. The classical bound is tight. The quantum bound, with its square root and its qRO2, is not, and its authors present it as an asymptotic indication of security against quantum adversaries rather than as a concrete figure.

Both bounds rest on MLWE being hard at these parameters. The specification estimates the cost of the best known attack, a lattice reduction, at 2256 classical and 2232 quantum operations in the core-SVP measure, and, in a refined classical model, at 2287.3 gates and 2189.7 bits of memory. That places ML-KEM-1024 in NIST’s security category 5, the category of AES-256.

Three details of SparkVault’s use meet the theorem’s hypotheses. The random message from which an encapsulation derives its shared secret is drawn from the platform’s entropy source, never from the library’s own generator, so it is uniform if either of that source’s inputs is. The challenge ciphertext of the game is a vault’s cv. And the platform never returns a decapsulated secret, so an outside adversary has no decapsulation oracle at all, less than the IND-CCA2 game grants it. A cv altered in storage decapsulates, under implicit rejection, to an unrelated key, and the alteration shows only as data that does not authenticate under the VAK that key yields.

Theorem 2: AEAD security

Theorem 2 (AEAD security). Let 𝒜 be a nonce-respecting adversary with the resources q, σ, ℓ and qv of section XIV, attacking one key. Then there are adversaries ℬ and ℬ′ against the underlying primitive, each making about one query for each block 𝒜 processes, such that:

Privacy and authenticity bounds for AES-256-GCM and ChaCha20-Poly1305, for one key and for many
AES-256-GCM
  AdvIND-CPA(𝒜)   ≤ AdvPRPAES-256(ℬ) + (σ + q + 1)2 / 2129
  AdvINT-CTXT(𝒜)  ≤ AdvPRPAES-256(ℬ′) + 2·qv·(ℓ + 1) / 2128        while σ + q + qv < 264
ChaCha20-Poly1305
  AdvIND-CPA(𝒜)   ≤ AdvPRFChaCha20(ℬ)
  AdvINT-CTXT(𝒜)  ≤ AdvPRFChaCha20(ℬ′) + qv·(ℓ + 1) / 2103
u independent keys
  Advmu-x(𝒜)      ≤ Σi=1..u Advx(ℬi)                        ℬi spends what 𝒜 spent on key i

Iwata, Ohashi and Minematsu (2012) found a flaw in GCM’s original security proofs and replaced them. For 96-bit nonces, the length every GCM seal in SparkVault uses, their bounds are the two GCM lines above, as the Crypto Forum Research Group’s draft on AEAD usage limits states them. Both treat AES as a random permutation, and the PRP terms account for running AES-256 instead. The privacy term is a birthday bound: GCM’s keystream is built from outputs of a permutation, which never repeat, while the blocks of a random string may. It stays below 2−32 until about 248.5 blocks, about 5.7 PiB, have been sealed under one key. The authenticity term bounds each forgery attempt by 2(ℓ + 1)/2128. For a 50 MiB file chunk, which is 3,276,800 blocks plus its associated data, that is below 2−105 per attempt.

Procter (2014) gave the first analysis of ChaCha20-Poly1305, which Degabriele, Govinden, Günther and Paterson (2021) corrected and extended to many users. ChaCha20 is modeled as a PRF, so privacy costs nothing beyond its PRF advantage. Authenticity costs (ℓ + 1)/2103 per forgery attempt, with ℓ counting the message and its associated data in Poly1305’s 16-byte blocks. Every delegated-key envelope, built as section VIII describes, is under 512 bytes, which puts each attempt below 2−97. Each envelope also has a key of its own, so by the last line qv forgery attempts spread across all of them succeed with probability below qv·2−97, plus one ChaCha20 PRF term for each key.

The last line is the hybrid argument of section XIV, and it is the form Theorem 5 uses, because every vault has its own VAK. The privacy term is paid per VAK, on that vault’s own σ: about 2−57 for a vault holding 1 TiB and about 2−37 for one holding 1 PiB, whatever the platform holds in total.

Theorem 3: key derivation security

HKDF-SHA512, as the platform implements it, has two steps. Extract computes PRK = HMAC-SHA512(salt, ikm). Expand computes HMAC-SHA512(PRK, info ∥ 0x01) and keeps its first L bytes. Every key the platform derives this way is 32 bytes, so Expand is a single block of RFC 5869’s expansion; the API’s implementation computes only that block and refuses any L above 64 bytes. HMAC pads a key shorter than its 128-byte block with zeros, so an empty salt and RFC 5869’s default salt of 64 zero bytes give the same function.

Theorem 3 (HKDF as a key-derivation function). Let a key be derived as above from a salt and input keying material of which at least one is secret, under an info string that no other derivation from the same PRK uses. Then, in each of the three cases that arise in SparkVault, the advantage of telling the derived key from a uniformly random one satisfies:

KDF advantage against HKDF-SHA512 in its three uses, by which of its inputs is secret
first case: salt uniform and secret
  AdvKDF(𝒜) ≤ AdvPRFHMAC-SHA512(ℬ1) + AdvPRFHMAC-SHA512(ℬ2)
second case: ikm = k ∥ y with k ←$ {0,1}256 secret, y and the salt public
  AdvKDF(𝒜) ≤ Advikm-PRFHMAC-SHA512(ℬ1) + AdvPRFHMAC-SHA512(ℬ2)
third case: ikm ←$ {0,1}256 secret, one fixed public salt
  AdvKDF(𝒜) ≤ Advswap-PRFHMAC-SHA512(ℬ1) + AdvPRFHMAC-SHA512(ℬ2)
  Advswap-PRFHMAC-SHA512(ℬ1) ≤ 2·AdvRKA-PRFh̄,Φpad(ℬ3) + AdvPRFh(ℬ4) + AdvCRh(ℬ5)      Backendal, Bellare, Günther and Scarlata, Theorem 11

In each case the first term pays for Extract and the second for Expand. Truncating a PRF’s output to 32 bytes leaves it pseudorandom, and because each derivation from one PRK uses its own info string, Expand is evaluated at distinct points and the keys it returns are independent of one another. Theorem 5 uses all three cases.

The VAK, against an adversary without the AMK, is the first case. The salt sv is then a pseudorandom 512-bit string the adversary does not know (Theorem 4), so Extract is HMAC under a key that may be treated as uniformly random, and both terms are conventional PRF advantages of HMAC-SHA512 with 512-bit keys, which Theorem 4 bounds.

The VAK, against an adversary that holds the AMK but not the SVMK, is the second case. The secret is then the 256-bit KEM shared secret at the start of the input keying material, and it reaches HMAC through the message input. Backendal, Bellare, Günther and Scarlata (2023) proved that HMAC is a swap-PRF, in the standard model and from assumptions on the compression function alone, when its message is a secret drawn uniformly from all strings of its length and its key comes from a set they call feasible: all strings of one length up to the block length, or only strings longer than the block. The message here is a uniform 256-bit string followed by a VMK this adversary may hold, which is not uniform over its length, so Theorem 5 states the property it needs for this input as an assumption, written Advikm-PRFHMAC-SHA512: HMAC-SHA512(x, k ∥ y) is a PRF in k ←$ {0,1}256 for public x and y. In the model where SHA-512’s compression function is ideal, HMAC-SHA512 restricted to keys of one fixed length less than d − 1 bits, d its 1,024-bit block, as the 64-byte salt is, is indifferentiable from a random oracle (Dodis, Ristenpart, Steinberger and Tessaro, 2012), and the assumption then holds with advantage at most qH/2256 plus that result’s indifferentiability bound.

Every key derived from a VAK is the third case: the keys for a vault’s sealed names and types, for their synthetic nonces and for its name index, the key for its audit details, and the key for a help desk’s sealed fields. Each takes the VAK as input keying material under a public all-zero salt (empty, or 32 zero bytes, which HMAC pads to the same block), so all of them share one Extract: HMAC under one fixed key, keyed through its message input by a uniform 256-bit string, which is exactly the setting in which Theorem 11 of the same paper proves swap-PRF security, in the standard model. Its terms are assumptions on SHA-512’s compression function: that h is a PRF, that h is collision resistant, and that h̄ is a related-key PRF under Φpad, the transformations that overwrite the end of a block with padding. Each of these keys has an info string of its own (the one for names and types is "SparkVault:VaultFields:v1|acct=" ∥ a ∥ "|vault=" ∥ v), so they are independent of one another.

Theorem 4: HSM-bound HMAC security

The AMK is a 512-bit HMAC-SHA512 key generated inside the HSM and used only by MAC operations the HSM performs (section X). Every computation that Theorem 3 treats as a PRF in HMAC’s key input also has a 512-bit key: the salt sv, or a PRK.

Theorem 4 (PRF security of HMAC-SHA512). Let 𝒜 attack HMAC-SHA512 under one or many 512-bit keys, making q queries of at most L bits each. Then there are adversaries ℬ1, ℬ2 and ℬ3 against SHA-512’s compression function, each running in about the time of 𝒜, such that:

PRF advantage against HMAC-SHA512 with 512-bit keys, the AMK’s included, in the multi-user setting
AdvPRFHMAC-SHA512(𝒜) ≤ (m + 3)·AdvPRFh(ℬ1) + AdvPRFh̄(ℬ2) + AdvRKA-PRFh̄,Φzio(ℬ3) + q·(q − 1) / 2513
                     m = 1 + ⌈L / 1024⌉

This is Theorem 10 of Backendal, Bellare, Günther and Scarlata (2023), for SHA-512’s 512-bit chaining value and 1,024-bit block. Earlier proofs of HMAC’s PRF security covered only keys as long as the hash’s block, which for SHA-512 is 1,024 bits (Bellare, 2006). This one covers keys of any length, the 512-bit keys of Theorems 3 and 4 included, and it is a multi-user bound: it covers every account’s AMK at once, and the number of keys enters it only through the queries made. The first term is the assumption on which the standard-model proofs of HMAC have rested since 2006, that the compression function is a PRF keyed through its chaining value; Gaži, Pietrzak and Rybár (2014) showed that the loss it carries in NMAC, the construction at HMAC’s core, is essentially tight. The second and third terms concern h̄, and arise from how HMAC turns one key into two: it pads the key with zeros and XORs two constants into it, the transformations Φzio. The last term is the chance of a collision among 512-bit chaining values, 2−385 even after 264 queries. Finding a 512-bit key by exhaustive search succeeds with probability at most p/2512 after p trials.

The HSM does not change the bound; it changes who can query. The key material is generated inside a FIPS 140-3 validated HSM and never leaves it unencrypted, so an adversary that reads stored data has no access to the PRF at all. The platform does hand some AMK MACs to people, such as the reply tokens and mute links of the help desk, and each is a PRF output at another point. The salt message of a VAK begins "SparkVault:Salt:Unseal:v1|", and no other message the platform builds for an AMK does, so those outputs reveal nothing about any vault’s salt. A party that can make the running platform compute AMK MACs at messages of its choosing controls the running platform, which places it with the adversary section III sets apart, and Theorem 5 assumes the adversary is not such a party.

Theorem 5: composed security

The game is this. Fix a target vault v and a set ℛ of at most two of its root keys. The adversary 𝒜 receives every record the platform stores, meaning the metadata store’s rows, stored objects, backups and logs, together with the roots in ℛ: the SVMK’s decapsulation key, the AMK itself, which gives more than access to the HSM would, or the VMK. It chooses the contents of files in every vault, and for one file of v it chooses two candidate contents M0 and M1 with Λ(M0) = Λ(M1). The platform stores Mb for a hidden bit b, and 𝒜 wins by guessing b: AdvSVℛ(𝒜) = |2·Pr[b′ = b] − 1|.

Five hypotheses complete the statement. First, 𝒜 holds no other key the HSM keeps, in particular not the key-encryption key behind delegated keys (section X), and, beyond choosing the files the game stores, sends the running platform no request: the theorem measures what stored data and root keys reveal, and section III treats attacks on the running platform. Second, if ℛ contains the AMK, 𝒜 holds no live session, transfer or upload record of v (section III; no backup holds one): those records hold the VAK sealed under keys the AMK alone derives (section XI), so with the AMK they open without the other two roots. Third, Λ(M) is what the construction does not hide about a file’s contents: the lengths of the ciphertexts stored for it, which are its chunks and any thumbnail made from it, and, for a file that a device backed up with a keyed content digest, which other such files of the vault carry the same digest. That digest is keyed from the VMK alone, so when ℛ contains the VMK the theorem covers only files stored without one. Fourth, the VAK’s two uses, as an AES-256-GCM key and as HKDF’s input keying material, are jointly pseudorandom (below). Fifth, as Theorem 2 assumes of its adversary, no nonce seals two different messages under one key, apart from the random repeats the bound counts.

Theorem 5 (vault confidentiality). Under these hypotheses, and with K ranging over the keys that seal data of v, there are adversaries ℬ1 to ℬ9 and ℬK, each running in about the time of 𝒜, such that:

Advantage against the combined system: the roots’ terms combine by a minimum, everything else by a sum
AdvSVℛ(𝒜) ≤ 2·(εℛ + εsub + ΣK AdvIND-CPAAES-256-GCM(ℬK) + ΣK CK2 / 297)
  εℛ    = minr ∉ ℛ εr        when 𝒜 holds no live session, transfer or upload record of v
  εℛ    = εAMK                 when 𝒜 holds one (so ℛ does not contain the AMK)
  εSVMK = AdvIND-CCA2ML-KEM-1024(ℬ1) + Advikm-PRFHMAC-SHA512(ℬ2) + AdvPRFHMAC-SHA512(ℬ3)
  εAMK  = 3·AdvPRFHMAC-SHA512(ℬ4)
  εVMK  = (qH + qA) / 2144 + εesc                 HMAC-SHA512, Argon2id and scrypt as random oracles
  εesc  = AdvIND-CPAHSM(ℬ5) + AdvKDFHKDF-SHA256(ℬ6) + AdvIND-CPAChaCha20-Poly1305(ℬ7)    for a vault with a delegated key, live or in a backup, else 0
  εsub  = Advswap-PRFHMAC-SHA512(ℬ8) + AdvPRFHMAC-SHA512(ℬ9)

The root terms combine by a minimum, and the reason is the three-key property itself. The VAK takes all three roots through HKDF, and it stays pseudorandom as long as any one of the roots the adversary lacks stays secret. Each missing root gives a separate proof, resting on the assumption its term names, and the theorem may use whichever proof gives the smallest bound, so an adversary missing two roots must defeat the assumptions behind both to reach the VAK through its derivation. Every other term is a sum, because it is paid whichever root a proof rests on: the same chunks are sealed under the same VAK in every case. The factor 2 comes from the game itself, which compares two real contents: the proof passes from M0’s world to one in which everything stored for the file is random, and from there to M1’s, paying each term once in each direction.

εSVMK is the proof for an adversary without the SVMK. IND-CCA2 security (Theorem 1) replaces ssv with a uniform secret, the ikm-PRF assumption of Theorem 3’s second case makes the PRK uniform, and Expand, a PRF keyed by that PRK, makes the VAK uniform. εAMK is the proof for an adversary without the AMK, in three PRF steps (Theorem 4). The first replaces every MAC under the AMK with a uniform string, the salt sv and the session and transfer key-encryption keys among them; the second replaces Extract’s output under that salt, and the third Expand’s. When 𝒜 holds a live session, transfer or upload record of v, this is the only proof available, because those records hold the VAK itself under keys the AMK derives, and their layers then join the sum over K.

εVMK is the proof for an adversary without the VMK, and it holds in the random-oracle model. An adversary holding the other two roots learns nothing about VAKv until it evaluates the derivation at the right VMK. Each HMAC evaluation tests one candidate, and so does each Argon2id evaluation against the verifier vmkhv, or each scrypt evaluation against a content digest whose file the adversary knows; the VMK is 144 uniform bits. Every such test is specific to one vault, because the HKDF salt, the KEM secret, the Argon2id salt and the content digest’s scrypt salt all differ from vault to vault, so qH + qA counts guesses across all vaults together, and 280 evaluations bring the term to 2−64. A vault with a system grant (section VIII) also keeps its VMK recoverable: its delegated key and that key’s secret, whose XOR is the VMK, are each sealed with ChaCha20-Poly1305 under a key HKDF-SHA256 derives from a per-vault delegation key, which the HSM’s key-encryption key wraps with its own AES-256-GCM. εesc is the cost of opening that path without the HSM’s key-encryption key, which the first hypothesis withholds. It applies to any vault with a delegated key, live or in a backup, because a person’s delegated key needs no term of its own: it is the VMK XORed with an independent random secret, so its record’s digest and the few characters the record keeps say nothing about the VMK, and the envelope holding its secret opens only under the same delegation key.

εsub is Theorem 3’s third case, for the keys derived from the VAK, and it rests on the fourth hypothesis. The VAK keys AES-256-GCM directly and also serves as HKDF’s input keying material for those keys, and the separate reductions above do not cover one key used in two primitives; the pair is jointly pseudorandom when AES-256 is modeled as an ideal cipher and SHA-512’s compression function as an ideal function. The remaining sums run over every key that seals data of v: the VAK itself, which seals chunks and thumbnails, the keys derived from it, and, when 𝒜 holds a live session, transfer or upload record, those records’ key-encryption keys and data keys. For each, Theorem 2’s privacy bound applies with that key’s own σ. CK2/297 bounds the probability that the platform’s random draws repeat a nonce under K (section XVII). It is added because Theorem 2 assumes a nonce-respecting adversary, and the platform, not the adversary, chooses the nonces; beyond those random repeats, the theorem assumes, as its fifth hypothesis and like Theorem 2, that no nonce seals two different messages under one key.

The same argument, with INT-CTXT in place of IND-CPA, bounds integrity. An adversary who can also write to storage gets a chunk accepted at any account, vault, file or position other than the one it was sealed for, or gets a file accepted with its final chunks removed, with probability at most εℛ + εsub + ΣK AdvINT-CTXTAES-256-GCM(ℬK) + ΣK CK2/297, a forgery probability, which takes no factor 2. Since Af,n binds each of those (section XVII), each change presents the verifier with an (N, A, C) it never produced. A Spark’s key takes the SVMK and the AMK only (section VII), and the same argument, without the VMK’s term, bounds its confidentiality advantage by twice the sum of min(εSVMK, εAMK) and the AEAD terms of its one seal.

What the bounds come to

Side by side, the terms fall into two kinds. The root terms are the costs of attacking ML-KEM-1024, HMAC-SHA512 and a 144-bit search, as Theorems 1, 4 and 5 state them. They do not grow with the data a vault holds, but which of them applies depends on its use: while a session, transfer or upload record of the vault is live (section III), only εAMK applies, and a delegated key, live or in a backup, adds εesc to the VMK’s term. No backup extends the first case, because no backup holds such a record. The AEAD terms grow with use, with the square of the data and of the seals under one VAK, so in practice they are the ones that set the bound, and a vault holding a pebibyte in large files keeps their sum below 2−36. An adversary attacking every vault at once rather than one gains at most a factor of the number of vaults in the root terms, by the hybrid argument of section XIV, except in the VMK’s term, whose guesses are already counted across all vaults.

Against a quantum adversary, Theorem 1’s quantum bound takes the place of its classical one. Grover’s algorithm, which is optimal for unstructured search, turns exhaustive search for a 256-bit AES key into 2128 sequential evaluations (section VI), and makes the success probability of q quantum evaluations against the 144-bit VMK of order q2/2144, a case that arises only for an adversary already holding the SVMK and the AMK.

XVI. Side-channel attack mitigations

The theorems of section XV describe an adversary that sees what goes into a computation and what comes out. A side-channel attack measures something else: how long an operation takes, which memory it touches, how much power it draws or what it radiates. From those measurements it works back to the key. Every such attack needs a vantage point: a stopwatch on the network, code running on the same processor, or an instrument near the device. SparkVault’s defenses are organized by where each key is used, because that decides which vantage points exist. The AMK is used only inside an HSM. The keys the platform derives in software are used in its own execution environments. And every check that compares a presented secret with a stored one is something a remote caller can time.

Keys the host never holds

The AMK never exists outside the HSM. Every MAC under it, the salt of every VAK and the key-encryption key of every session record among them, is computed inside the module, and the platform receives only the result. A timing, cache or speculative-execution attack against the hosts that run SparkVault’s code, whatever its vantage point, finds no AMK in their memory and no computation with it on their processors; what such an observer could measure about the AMK is the latency of a request to the HSM. The same holds for the HSM’s other work for the platform: the half of every random draw that comes from the HSM’s generator (section X), the key-encryption key that wraps each vault’s delegation key, which never leaves the HSM, and the prime search whenever the platform makes an RSA key pair. The delegation key, once unwrapped, and the RSA private keys that sign access tokens are used on the host, under the defenses below.

Power and electromagnetic analysis need an instrument at the device, and for the AMK the device is an HSM in the provider’s facility, inside the physical security of a FIPS 140-3 Level 3 module: a hard, tamper-evident enclosure that resists opening and probing (section X). No such attack on the AMK can begin without an instrument next to that module, inside the provider’s facility.

Constant-time comparison

An equality check that stops at the first differing byte answers sooner the shorter the correct prefix of a guess. Repeated over many requests, that difference lets an attacker recover a secret byte by byte from a remote timing, the classic attack on naive signature and token checks. SparkVault’s server code relies on two comparisons that do not stop early. The first, for values of fixed length, is the runtime’s constant-time equality, whose running time depends only on that length. It checks the 32-byte Argon2id output that verifies a VMK, the digests of refresh tokens, the password verifiers of the help desk, and the tag of a file chunk already in storage when an upload resends that chunk.

The second is a helper that first hashes both values with SHA-256 and then compares the two 32-byte digests in constant time. Its running time depends on the lengths of the two inputs, never on how much of them agree, and it cannot be made to fail early or throw on inputs of different lengths. It checks the HMAC signatures of unsubscribe links and member invitations, the codes the help desk emails and its reply tokens and mute links, the help desk’s PKCE verifiers and sign-in nonces, the nonces of the sign-ins the API completes as a relying party, and the secret the edge network presents to the platform’s origins. Some credentials are not compared at all. API keys and delegated keys are found by the SHA-256 digest of the presented value, so for them no comparison between a presented value and a stored secret runs in the platform’s code. Authentication tags are verified inside the runtime’s native cryptographic library, whose GCM and Poly1305 tag checks are constant-time comparisons.

Access tokens are signed with RSA in the same native library, which blinds every RSA private-key operation. Blinding is the standard defense against timing attacks on RSA private-key operations, which Brumley and Boneh (2003) showed can be mounted across a network.

What a wrong key costs

A VMK is verified by recomputing its Argon2id verifier: 64 MiB of memory, three passes and four lanes for every well-formed key a caller presents, typed into the request or recovered from a delegated key the caller presented. Only then are the 32 stored bytes compared with the 32 computed ones, in constant time. The time to refuse a key therefore does not depend on how close the key was, because the expensive step runs in full before any comparison and the comparison takes the same time for every result. Argon2id’s first half-pass over its memory uses data-independent addressing (RFC 9106), so the memory accesses of that part of the computation do not depend on the key being verified.

A wrong VMK is refused only after its full Argon2id evaluation, and only to an authenticated caller in the vault’s account. Online guessing therefore gains nothing over the offline search that Theorem 5 bounds, which the VMK’s 144 bits put out of reach. What must stay secret is the key, and nothing about the key is in the timing.

Decapsulation no request can steer

ML-KEM decapsulation runs in software. The KyberSlash attacks on ML-KEM implementations (Bernstein et al., 2025), for example, recover a decapsulation key by timing the decapsulation of many ciphertexts the attacker submits. SparkVault decapsulates only ciphertexts it produced itself: a vault’s, written when the vault is created, a Spark’s, written when it is sealed, and a throwaway one with which it checks the key pair before using it. No request carries a ciphertext for decapsulation, so no outside party can choose what the SVMK decapsulates, which is the access such attacks depend on. Every stored ciphertext’s length is checked against ML-KEM-1024’s 1,568 bytes before decapsulation, and under implicit rejection a ciphertext altered in storage yields an unrelated key that opens nothing, never a decapsulation error.

Authenticate before release

An attacker who can submit altered ciphertexts and watch how decryption fails can sometimes learn the plaintext a little at a time. Padding-oracle attacks on CBC-mode encryption are the best-known case. Two rules leave nothing of that kind to observe where a vault’s keys and files are opened. When a session, transfer or upload envelope or a sealed name is opened, the plaintext is returned only after its tag verifies; if it does not, the bytes decrypted so far are overwritten before one refusal is returned, the same refusal whatever made the tag check fail. When a file is downloaded, each chunk is decrypted as it streams from storage, but its plaintext is held until the whole chunk’s tag and length verify. No byte of a chunk that fails a check reaches a response, an object whose stored length is wrong is refused before it is read, and every chunk that fails authentication is logged as a security event.

Where the computation runs

The keys SparkVault uses in software, the VAK and the keys derived from it among them, live in the API’s execution environments and, during a transfer, in the file service’s containers (section II). The provider dedicates each of the API’s execution environments to one release of the platform’s code, never reuses one across customers, and runs them inside hardware-virtualized machines. Code belonging to anyone else therefore never runs inside the environment that holds a vault’s key.

Secure memory zeroization

Key material that outlives its use can be read later, by a memory disclosure bug, a core dump or a heap inspected after the fact. On the unseal path and in the file service, SparkVault overwrites each key buffer with zeros once nothing needs it, through one wipe function shared by the API, the file service and the console. The function takes a byte buffer, or nothing for a key not yet made, and refuses any other value, which could not be wiped in place and would mark a mistake. On the unseal path the wipes of keys sit in finally blocks, so a failure wipes a key as surely as a success does. This is the derivation of a VAK from its three roots:

Zeroization, as the platform does it: the VAK’s derivation from the three roots (log lines and comments omitted)
export async function deriveVAKFromVMK(accountId, vaultId, kemCiphertext, vmk) {
  const { svmkService, amkService } = getContainer();
  const svmkSS = await svmkService.decapsulate(kemCiphertext);
  let amkHmac = null;
  try {
    amkHmac = await amkService.generateMac(accountId, buildVaultMacMessage(accountId, vaultId));
    const vak = deriveVAK(accountId, vaultId, svmkSS, amkHmac, vmk);
    return vak;
  } finally {
    zeroize(svmkSS);
    zeroize(amkHmac);
  }
}

The KEM’s shared secret and the AMK’s salt are wiped on every exit from the derivation, a failed one included. Inside it, the VMK’s bytes, the input keying material that holds them and HKDF’s intermediate PRK are wiped on every exit as well. The unseal wipes the VAK in a finally block that opens as soon as the VAK exists, so a failed random draw or a failed seal wipes it too. Sealing the session wipes its key-encryption key and data key on every exit, a failed request to the HSM included, and verifying the VMK wipes the Argon2id output it computed. When a delegated key is presented instead of the VMK, the unwrapped delegation key, the envelope key, the secret and the buffers the VMK is rebuilt in are wiped on every exit as well. In the file service, the VAK lives, for each chunk sealed, inside a block whose every exit wipes it. Outside the unseal path, the keys for a vault’s sealed names are derived once per request and wiped when the request ends, whether it was answered or refused.

The wipe is best effort. Text cannot be overwritten in the JavaScript runtime, so a VMK, which arrives as text, is left to the runtime’s memory management, and the cryptographic libraries, native and JavaScript, free their own working copies themselves.

XVII. Nonce and initialization vector management

Theorem 2 assumes that no nonce is used twice under one key, and both AEADs fail badly when that assumption breaks. Two GCM messages sealed under the same key and nonce share a keystream, so the XOR of their ciphertexts is the XOR of their plaintexts. Their two tags also give an equation in GHASH’s key H, whose roots an attacker can compute (Joux, 2006). H is the same for every nonce under the key, and once it is known, every valid ciphertext the attacker has seen under that key lets it forge others of its choosing under the same nonce; Böck et al. (2016) found HTTPS servers that repeated GCM nonces and demonstrated such forgeries against them. ChaCha20-Poly1305 likewise repeats its keystream, and reveals the one-time Poly1305 key of that nonce. NIST SP 800-38D therefore requires that the probability of any IV repeating under a key be at most 2−32, which for random 96-bit IVs means at most 232 seals per key, and caps a single message at 239 − 256 bits.

For a vault’s data and the keys that guard it, SparkVault’s code uses three nonce constructions, chosen per context: random nonces, each a slice of a fresh draw that no key or other nonce shares; nonces derived from a random per-upload base and a chunk counter, for files; and synthetic nonces computed from the message itself, for sealed names. Where a key seals exactly once, which is true of most keys the platform uses, nonce reuse cannot occur by construction.

Where every random nonce comes from

Every random nonce the platform’s code supplies comes from the entropy source of section X: the HSM’s random bytes XORed with the host’s CSPRNG, failing outright when the HSM cannot answer. By the platform’s rule, a unit of work draws as few times as it can and cuts each draw into disjoint fields by a layout fixed in code. An unseal, for example, draws 88 bytes: its session token, the data key that seals the VAK, and the two nonces of the session record’s two layers. Because the fields never overlap, a nonce never doubles as a key or as another nonce, and a unit that needs a varying number of values reads consecutive slices from a cursor that never hands out a byte twice. Every deploy runs a check that refuses any other source of raw randomness in production code, apart from the device-side mixing of a draw with a device’s own generator.

A random nonce: the entropy service XORs the HSM’s draw, hsmBytes, into the host CSPRNG’s, and an unseal cuts its one draw into disjoint fields (two excerpts)
const draw = crypto.randomBytes(numBytes);
for (let i = 0; i < numBytes; i++) {
  draw[i] ^= hsmBytes[i];
}
zeroize(hsmBytes);
const UNSEAL_DRAW = defineEntropyLayout([
  ['vatToken', 32],
  ['dataKey', 32],
  ['vakNonce', 12],
  ['dataKeyNonce', 12]
]);

Derived per chunk (file data)

A file is sealed in chunks of up to 50 MiB under its vault’s VAK, and each chunk’s nonce is derived rather than drawn. When an upload starts, its session draws a 96-bit base nonce Nf, together with the data key and the two nonces of the envelope that holds the session’s VAK. The base nonce is stored with the session and then with the file’s record. Chunk n is sealed under Nf with the 32-bit big-endian encoding of n XORed into its last four bytes. Every upload, whether of a new file or a new version of one, draws its own base.

A chunk’s nonce and associated data, as the file service derives them
export function deriveChunkNonce(baseNonce, chunkIndex) {
  const nonce = Buffer.from(baseNonce);
  const indexBuf = Buffer.alloc(4);
  indexBuf.writeUInt32BE(chunkIndex, 0);
  for (let i = 0; i < 4; i++) {
    nonce[nonce.length - 4 + i] ^= indexBuf[i];
  }
  return nonce;
}
export function buildChunkAad(accountId, vaultId, ingotId, chunkIndex, isFinal = false) {
  const base = `SparkVault:Ingot:v1|acct=${accountId}|vault=${vaultId}|id=${ingotId}|chunk=${chunkIndex}`;
  return isFinal ? `${base}|final=1` : base;
}

Within one upload, distinct chunk indices give distinct nonces, since only the last 32 bits change and they change by a different value for each index. The counter cannot wrap: the encoding refuses any index outside 32 bits rather than reducing it. In practice the index never comes near that limit, because a file is at most 5 TiB and so has at most 104,858 chunks, whose indices fit in 17 bits. A 50 MiB chunk is also far below GCM’s per-message limit of just under 64 GiB. The associated data binds each chunk to its account, vault, file and index, and marks the last chunk, so a chunk moved to another file or position, or a file with trailing chunks dropped, fails authentication.

Across uploads the analysis is the birthday bound’s. Chunk n of upload f and chunk m of another upload g share a nonce exactly when Nf ⊕ Ng = 064 ∥ ⟨n ⊕ m⟩32, and for independent uniform bases each such pair does so with probability 2−96. Summed over all pairs, the probability that any two of the CK seals under one VAK share a nonce is at most CK(CK − 1)/297: the bound that independent random nonces would give, with the pairs inside an upload, which can never collide, left over as margin. A thumbnail made from an image is sealed under the same VAK with a random 96-bit nonce and associated data of its own, and counts in CK like a chunk.

Three mechanisms govern how each chunk is written under its nonce. A request claims the upload’s exclusive write lease before it reads a byte of a chunk and renews it while the chunk streams, and a refused renewal stops the write. The chunk is stored with a precondition under which storage refuses the write while an object exists at that chunk’s key. And a resent chunk that finds an object already stored adopts it only after reading it back, authenticating it, and finding its tag equal, in a constant-time comparison, to the tag the resent bytes seal to. Under one key, nonce and associated data, GCM seals given bytes to one ciphertext and one tag, and two different chunks of equal length share a tag with probability at most (ℓ + 1)/2128, so a match shows the resent bytes are the stored ones. A resend carrying different bytes ends the upload rather than storing them under that chunk’s spent nonce.

Random nonces under long-lived keys

On a vault’s key path, a few keys seal many values with random nonces over their lifetime. The key-encryption key of a vault’s session records seals one data key per unseal, for as long as the vault exists. The key-encryption key of its transfer records seals one per transfer token and per upload. The key for its audit details seals one value per encrypted event, and a help desk’s field key one per sealed field. For each, the repeat probability is a function of use, and the birthday bound caps it:

The probability that a nonce repeats under one key, and when chunk nonces can coincide
Pr[some nonce repeats under key K] ≤ CK·(CK − 1) / 297
  CK = 92,682      ≤ 2−64
  CK = 220          < 2−57
  CK = 109          < 2−37
  CK = 232          < 2−33        the most seals SP 800-38D allows a key with random IVs
Chunk nonces under one VAK
  nonce(f, n) = Nf ⊕ (064 ∥ ⟨n⟩32)
  nonce(f, n) = nonce(f, m)            exactly when n = m
  nonce(f, n) = nonce(g, m), f ≠ g     exactly when Nf ⊕ Ng = 064 ∥ ⟨n ⊕ m⟩32, probability 2−96

For a VAK, CK counts every chunk and thumbnail sealed in the vault. A vault holding 1 PiB in large files has sealed about 224.4 chunks, which puts its probability below 2−48; a VAK that has made a billion seals, as a vault of a billion small files has, is below 2−37. For the session key-encryption key, CK is the number of times the vault has been unsealed, and a vault unsealed a million times is below 2−57. Any key that has sealed fewer than 232 values stays inside the probability SP 800-38D sets.

Synthetic IVs for sealed names

The names, types and other sealed fields of a vault’s files and folders are sealed with a construction that tolerates a repeated nonce. Each seal takes a 96-bit nonce from its unit of work’s draw, refusing one that is all zeros, and uses as its IV the first 96 bits of HMAC-SHA256, under a nonce key derived from the VAK, over that nonce, the associated data and the padded value. The stored blob carries the IV, not the nonce. Two seals with the same nonce share an IV, apart from a collision of 96-bit PRF outputs, only if they also share the associated data (the account, vault, record and field) and the padded value, and then they produce the same blob, which reveals only that one field of one record was sealed twice with the same value. Seals with different nonces see their IVs collide only as a PRF’s 96-bit outputs do, with the birthday bound’s probability. This is the synthetic-IV approach of SIV (Rogaway and Shrimpton, 2006): a nonce that repeats degrades privacy to revealing equality, rather than breaking it. The nonce key and the field key are separate keys, derived from the VAK under different info strings.

Keys that seal once

Most of the platform’s keys seal exactly one value, so their nonces cannot repeat under them. The inner layer of every session, transfer and upload record seals the VAK under a fresh 256-bit data key that seals nothing else. A Spark’s key is derived for that Spark alone, and its 96-bit nonce is also an input to that derivation and part of its associated data. Each delegated-key envelope, sealed with ChaCha20-Poly1305, has a key derived from the vault’s delegation key under a salt of its own (the delegated key’s own value for the envelope holding its secret, a person’s key or a system grant’s alike, and the record’s digest, with a suffix of its own, for a system grant’s escrowed key), and that key seals one envelope. A pagination cursor’s key and nonce are both cut from the AMK’s MAC over a 128-bit salt drawn for that cursor. Each vault’s delegation key is wrapped by the HSM’s own AES-256-GCM, whose IV is chosen inside the HSM. A browser push notification follows RFC 8291, which derives a fresh AES-128-GCM key and nonce for every message from a new P-256 key agreement and a new 16-byte salt. The device-to-device handoff uses XSalsa20-Poly1305 with a 192-bit nonce, a server draw XORed with the device’s own generator, under a key from X25519 with a fresh sender key pair for every message. At 192 bits, even a key that sealed 280 messages under random nonces would see a repeat with probability only 2−33.

Nonce construction in the contexts of sections IV to XI

Context Algorithm Key, and what it seals Nonce
File chunks and thumbnails AES-256-GCM The vault’s VAK: every chunk and thumbnail in the vault A random 96-bit base per upload, with the chunk index XORed into its last 32 bits; 96 random bits for a thumbnail
Session, transfer and upload records, outer layer AES-256-GCM A key-encryption key the AMK derives for the vault: one data key per unseal, transfer token or upload 96 random bits, a slice of the operation’s draw
Session, transfer and upload records, inner layer AES-256-GCM A fresh 256-bit data key: the VAK, once 96 random bits, a slice of the same draw
Names, types and other sealed fields of files and folders AES-256-GCM The vault’s field key, from its VAK: every sealed field Synthetic: the first 96 bits of HMAC-SHA256 over a drawn nonce, the associated data and the padded value
Audit details AES-256-GCM The vault’s audit key, from its VAK: every encrypted event 96 random bits from the event’s draw
Help desk fields AES-256-GCM The desk vault’s field key, from its VAK: every sealed field 96 random bits from the unit of work’s draw
Spark payload AES-256-GCM The Spark’s own key: one payload 96 random bits, also an input to the key’s derivation
Delegated-key envelope ChaCha20-Poly1305 A key for the vault and the envelope’s salt: one envelope 96 random bits, a slice of the minting draw
Pagination cursor AES-256-GCM A key from the AMK’s MAC over the cursor’s 128-bit salt: one cursor Cut from the same MAC as the key
Vault delegation key AES-256-GCM, inside the HSM The HSM’s key-encryption key Chosen inside the HSM
Browser push payload AES-128-GCM, as RFC 8291 specifies A key from a fresh P-256 agreement: one message Derived with the key by HKDF-SHA256
Device handoff XSalsa20-Poly1305 A key from X25519 with a fresh sender key pair: one message 192 bits: a server draw XORed with the device’s own generator

Key commitment

Neither GCM nor ChaCha20-Poly1305 commits to its key: a ciphertext can be built that authenticates under two different keys of the builder’s choosing. The known attacks that exploit this need one of two things. One is a service that decrypts an attacker-supplied ciphertext under a secret key, typically one derived from a password, and reveals whether decryption succeeded; a ciphertext built to open under many candidate keys then tests all of them in one query, a partitioning oracle (Len, Grubbs and Ristenpart, 2021). The other is a ciphertext that different readers open under different keys, and so read differently (Dodis, Grubbs, Ristenpart and Woodage, 2018). SparkVault offers neither. A presented VMK is checked against its Argon2id verifier, and a presented delegated key is found by its digest, before any key derived from them opens anything. Every reader of a vault’s data opens it under keys that descend from that vault’s one VAK, whose derivation names the vault, and the associated data of every chunk, sealed name and record envelope names the account and the vault. A stored ciphertext is only ever tried under the one key its record’s vault derives.

XVIII. Cryptographic agility

Cryptographic agility is the ability to change an algorithm, a parameter set or a data format without losing what is already protected under the old one. The keys the platform derives and the ciphertexts it stores are bound to a named construction and a version; the records that hold key material (vaults, Sparks, vault sessions, transfer tokens, upload sessions, delegated keys) carry a schema version; the cost parameters of its memory-hard verifiers and the geometry of every file are written beside the object they protect; and the readers of sealed fields, sessions, transfer tokens, upload sessions and files refuse a version they do not implement rather than guess at one.

Agility here is a property of the format, not a published schedule. Today each sealing construction has exactly one version in service. What the format guarantees is narrower and more useful: a stored object declares the construction that sealed it, so a reader never has to guess, and an object relabeled as another version does not open. A second version can therefore be added beside the first for new objects while every existing object stays readable under the version that sealed it. Two things the platform deliberately cannot change on its own are the root keys and the protection of a vault whose key it does not hold, and the end of this section explains why.

Versions inside the cryptography

Most labels that pin the platform’s constructions follow one grammar: the word SparkVault, a purpose, a version, then the identifiers of the object being bound. A vault’s key is derived under the info string SparkVault:VAK:v1|vault= followed by the vault’s id. Its salt is the AMK’s MAC of SparkVault:Salt:Unseal:v1 with the vault and account ids. Each chunk of a file is sealed under associated data that begins SparkVault:Ingot:v1. The same grammar names the keys and associated data of Sparks, of a vault’s sealed fields and of the help desk’s, the envelopes that hold a vault’s key during a session, a transfer or an upload, the cursors that resume an account’s listings, and the Ed25519 signing key each account’s identity provider derives from its AMK. Where a label carries no version, as with the HSM messages behind the session, transfer and cursor keys, the key that seals audit details and the key that seals a delegated key’s secret, the associated data or the record it seals carries one.

The version sits inside these strings, not in a field beside the ciphertext, and that is what makes it binding. HKDF’s info input and an AEAD’s associated data are inputs to the computation itself. Two keys derived from the same input key material under different info strings are computationally independent as long as HMAC-SHA512 behaves as a pseudorandom function (section XV), so a v2 key shares nothing usable with its v1 counterpart. A ciphertext sealed under v1 associated data fails its tag check under any other label, except with the negligible probability of a forgery (sections VIII and XV). An attacker who can edit stored records cannot move an object from one version to another: the edit produces an object that does not open, and the reader refuses it.

The stored formats carry their version a second time, outside the ciphertext, so a reader can decide what it is holding before it attempts anything. A sealed field (a file’s or folder’s name, a file’s content type, the type its uploader declared, its original file name and its uploader’s address) is the base64url encoding of bytes whose first is its version, 0x01, followed by a 96-bit IV, the ciphertext of the length-prefixed value padded to whole 32-byte blocks, and the 128-bit tag. The help desk’s sealed fields lead with the same version byte. A vault session’s record carries schema version 2, and the record behind an Ingot Secure Transaction Key (ISTK), the bearer token a file transfer presents to the file service, carries version 4. An upload session’s record names the version of the envelope that wraps its key. A delegated key’s record carries schema version 2, and the associated data of its sealed secret, which the platform recomputes at every open and never stores, ends in a version field. Vault records, Spark records and audit records each carry schema version 1.

Where the version lives, as the platform writes it
// Inside the cryptography: a purpose and a version in the label
salt = MAC_AMK("SparkVault:Salt:Unseal:v1|vault=" || vault_id || "|acct=" || account_id)
VAK = HKDF-SHA512(ikm = ss || VMK, salt = salt, info = "SparkVault:VAK:v1|vault=" || vault_id, length = 32)
aad[n] = "SparkVault:Ingot:v1|acct=" || account_id || "|vault=" || vault_id || "|id=" || file_id || "|chunk=" || n // the last chunk adds "|final=1"
// A file's record: the model that sealed it, and its geometry
file = { encryption_mode: "chunked", chunk_size, chunk_count, base_nonce } // one stored object per chunk
// A sealed field: its version is its first byte
field_key = HKDF-SHA512(ikm = VAK, salt = "", info = "SparkVault:VaultFields:v1|acct=" || account_id || "|vault=" || vault_id, length = 32)
nonce_key = HKDF-SHA512(ikm = VAK, salt = "", info = "SparkVault:VaultFieldNonce:v1|acct=" || account_id || "|vault=" || vault_id, length = 32)
aad = "SparkVault:VaultField:v1|acct=" || account_id || "|vault=" || vault_id || "|row=" || row_id || "|field=" || field
blob = base64url(0x01 || IV || AES-256-GCM(field_key, IV, padded, aad)) // the ciphertext, then its 16-byte tag; IV as section XVII and padding as section VIII derive them
// Session and transfer envelopes: a record version the reader requires
KEK = MAC_AMK("KEK:" || domain || ":" || account_id || ":" || vault_id)[0..32] // domain: VAT or ISTK
aad = "SparkVault:" || domain || ":v1|acct=" || account_id || "|vault=" || vault_id
layer = base64url(ciphertext[32] || nonce[12] || tag[16]) // the VAK under a data key, the data key under the KEK
session.v = 2, istk.v = 4
// The VMK's verifier: its parameters live in the vault's record
vault.vmkh_params = { algorithm: "argon2id", version: 19, t: 3, m: 65536, p: 4 }
Object Construction Version carried in What the reader requires
A vault’s key (VAK) HKDF-SHA512 over the ML-KEM-1024 secret and the VMK, salted with the AMK’s HMAC-SHA512 The VAK:v1 info string and the Salt:Unseal:v1 MAC message The v1 labels; any other derives an unrelated key, under which no chunk opens
A file’s chunks AES-256-GCM under the VAK, each nonce the base nonce XOR the chunk index Ingot:v1 in each chunk’s associated data; the record’s encryption model The chunked model; any other is refused before storage is read
Sealed fields AES-256-GCM under an HKDF-SHA512 key from the VAK; a vault field’s IV derived with HMAC-SHA256 The leading byte; the VaultFields:v1 and VaultField:v1 labels (HelpDeskFields:v1 and HelpDeskField:v1 for the help desk) Byte 0x01; any other is refused as malformed
Vault session Two AES-256-GCM layers, the outer key from the AMK’s HMAC-SHA512 Record version 2; VAT:v1 associated data Version 2; any other is refused
Transfer token (ISTK) The same envelope, with the AMK’s key identifier Record version 4; ISTK:v1 associated data Version 4; any other is refused before the envelope is opened
Upload session Two AES-256-GCM layers under the transfer token’s outer key Envelope version 1; TUS:v1 associated data Version 1; any other is refused before the HSM is asked for a key
Delegated key secret ChaCha20-Poly1305 under an HKDF-SHA256 key Record version 2; the version field of the recomputed associated data Version 1 in the associated data; an envelope sealed under any other fails authentication
A Spark AES-256-GCM under HKDF-SHA512 over the ML-KEM-1024 secret, salted with the AMK’s HMAC-SHA512 The Key:v1, Salt:v1 and Spark:v1 labels; record version 1 The v1 labels; any other derives an unrelated key or fails authentication
Identity signing key An Ed25519 seed from HKDF-SHA512 over the AMK’s HMAC-SHA512 The Identity:SigningKey:v1 label The v1 label; any other derives another key
VMK verifier Argon2id, version 0x13 Its parameters in the vault’s record Nothing global: the record’s own cost
Relying-party client secret Argon2id The encoded hash string Nothing global: the string’s own cost

Strict readers

The readers are strict, and the strictness is specific. The session code opens a session record only in schema version 2 and refuses any other as an unknown envelope version. The file service refuses a transfer token whose record is not version 4, or that lacks either envelope layer or the identifier of the account’s AMK, before it opens the envelope, and both the file service and the API refuse an upload session whose envelope is not the version they write before they ask the HSM for its key. A vault’s sealed field opens only when its base64url encoding is canonical, its first byte is the version the platform writes and its length is the fixed overhead plus a whole number of 32-byte blocks; anything else is refused as malformed before decryption is attempted, and a help desk field opens only when its first byte is that same version. The file service refuses a file whose record names any encryption model but the chunked one it writes, before it commits a response header or reads a byte from storage, and it holds the record’s chunk geometry to the authenticated length of every chunk as the file streams. The identity provider’s stored RSA signing key record has a version of its own, and a record it cannot read is a hard failure, never a reason to generate a new key, because a new key would invalidate every token the old one signed.

Strictness is the security property. A reader that tried a second interpretation when the first failed would hand an attacker a downgrade: edit the version on a record and the platform would fall back to whatever the older interpretation does. A reader that guessed at a missing parameter would derive a wrong key and seal new data under it, the failure the root-key checks at the end of this section exist to stop. A refusal costs one error, and an operations alarm when the object refused is a file’s record, a vault’s sealed field or a transfer token (section XX).

Nor can a token choose an algorithm the platform did not sign it with. The platform’s access tokens are verified under RS256 alone, against the current public key, whatever a token’s header claims. The platform’s own sign-in through its identity provider accepts EdDSA alone and refuses any other header before it looks up a key. The identity provider’s own verifier accepts only the two algorithms it signs with, each against its own key, and refuses any other header, none and HMAC among them, before it verifies a byte.

Parameters that travel with the data

Where a construction has tunable parameters, they are written beside the object they protect, and the check reads them from there. Each vault’s record holds its VMK verifier’s parameters as a structured field: the algorithm, argon2id; the Argon2 version, 19, which is 0x13, the version RFC 9106 specifies; 3 passes; 65,536 KiB of memory; and 4 lanes, beside the vault’s own 256-bit salt and 256-bit tag. Verification takes the time cost, memory cost and parallelism from the vault’s record, not from the platform’s configuration, so the cost given to new vaults can rise at any time while every existing verifier stays checkable at the cost it was created with. No code path rewrites a verifier after its vault is created, so each vault keeps its original parameters.

A file’s record does the same for its encryption. It names the model the file was sealed under, the size every chunk but the last was cut to, the number of chunks, and the 96-bit base nonce each chunk’s nonce is derived from (section XVII). The file service reads all four from the record each time it opens the file and accepts any chunk size up to the one it writes, so new files can be cut into larger chunks without touching a file already stored. Only the last chunk’s associated data carries the final marker, so a record whose chunk count has been edited downward promotes a chunk sealed without the marker, and that chunk fails its tag check: an edit to the geometry becomes a refusal, never silently truncated plaintext (section XVII).

Two kinds of credential carry their parameters in their own encoding: the client secret a relying party presents, and the identity tokens the provider signs. A client secret is stored as an encoded Argon2id string, in the Password Hashing Competition’s string format, which names the algorithm, its version and its memory, time and parallelism costs beside the salt and the hash. Verification reads all of them back from the string, so new clients can be given a higher cost while every existing secret keeps verifying. Each relying-party client of an account’s identity provider is registered for EdDSA over Ed25519 (RFC 8032, RFC 8037), the default, or for RS256 (RFC 7518). The provider publishes the account’s Ed25519 public key, and its RSA public key once one exists, in the account’s JSON Web Key Set (RFC 7517), and every identity token names its algorithm and the identifier of the key that signed it in its JSON Web Signature header (RFC 7515). Two signature algorithms are in service side by side today, chosen per client and verified per key identifier, with no flag day between them.

Formats that change by expiry

The records that hold a vault’s key between requests all expire. A vault session lasts 24 hours at most, and a single-use transfer token expires within a day of being minted. An upload session lapses when its upload stalls, stops receiving at a deadline scaled to the file’s size, and, once every byte has arrived, lasts only a fixed window past each attempt to publish it. Their formats can change at a deploy without migrating stored data: a record in an older version is refused, and its holder unseals the vault again, asks for a new transfer or restarts the upload.

Moving stored data to a new protection

Re-encrypting stored data takes the key that protects it, and in the three-key design (section IV) a vault’s key reaches the platform through its holder’s unseal or through a hosted feature its owner turned on (section III). SparkVault does not work around this, and the vault-field sealer is built on it. The sealer moves a vault’s file and folder rows that still hold names, content types, original file names or uploader addresses in plaintext onto the sealed format above. There is no key-free path, and no copy of a key is kept for the purpose.

The sealer works through a vault’s rows a page at a time, never two pages of one vault at once, and for each page that holds rows to seal it resolves the vault’s key afresh: from a live session if the vault’s holder has unsealed it, otherwise from a system grant if one of the vault’s hosted features opens it unattended. With neither, the walk stops where it is and the vault’s next unseal resumes it, so a vault that only its key holder can open moves onto the sealed format only while its holder has it unsealed, and not before. Each row is sealed by a conditional write, so a row a request rewrote meanwhile is sealed from its new version, and every step is idempotent, so a page retried after a failure seals only what is still plaintext. Each page that seals rows records in the vault’s audit trail, under the vault’s key, where the key came from and how many files and folders it sealed (section XIX), and a walk the platform starts on its own through system grants is recorded in the platform’s audit trail before any of it runs. No code path creates a file or folder row in plaintext or returns a sealed row to plaintext, so a vault once sealed stays sealed.

File content is sealed once, chunk by chunk, as it is uploaded, and is never re-encrypted in place. A new upload of a file is sealed afresh, under a new base nonce, with the constructions in service when it is written. Moving existing content to a new cipher would take each vault’s key exactly as the sealer does, and for a vault no hosted feature opens, that means its holder’s next unseal.

The root keys do not change

The three root keys are the part of the design that is deliberately not agile. Every vault’s ML-KEM-1024 ciphertext is encapsulated to the one SVMK, and every vault’s key is salted with its account’s AMK MAC. Each vault’s key also takes its VMK, which the platform keeps only as a verifier, except for a vault it opens unattended (section III), so a vault that only its holder opens cannot be moved to a new SVMK or a new AMK without that holder. A new SVMK would leave every vault and every live Spark unreadable, and a new AMK would do the same to every vault and Spark of its account. The SVMK and the AMKs are permanent: never rotated, replaced or deleted. A VMK, likewise, never changes after its vault is created.

The platform enforces that permanence. It serves only the SVMK whose public key matches the fingerprint pinned in its deployment, and proves at every load that the private key is that public key’s own (section VII); it never creates an AMK for an account that already owns a vault or a Spark, and refuses such an account until the binding to its original AMK is restored (section X). Each refusal raises an alarm, because a substitute would not announce itself: it would derive wrong keys, silently, for every vault it touched (sections VII and X).

Permanent roots do not make a weakness in one root’s algorithm fatal, because no stored vault rests on one root (section IV). A practical attack on ML-KEM-1024 would give an adversary holding a copy of the metadata store each vault’s shared secret, and leave them facing the AMK’s MAC, which only the HSM computes, and the VMK’s 144 bits, which no store holds in a form that opens without the HSM. A weakness in HMAC-SHA512 alone would still leave the SVMK and the VMK. That redundancy covers the primitives that establish the keys, not the function that combines them or the cipher that uses them: a practical break of AES-256-GCM would require a new data cipher beside the old for new objects, and re-encryption of stored content under each vault’s key as that key becomes available.

Known answers

One more control keeps the constructions from changing by accident. The derivations every file and Spark depends on are pinned to known answers. The VAK and the Spark key are computed from a committed, test-only ML-KEM-1024 key pair whose every input is regenerated from a label with no randomness, then compared both with committed values and with an independent HKDF implementation; the messages the AMK is asked to MAC are compared with committed strings; and the sealed fields’ keys, IVs and blind index, the chunk nonces and associated data, and the identity signing seed have known answers of their own. A change to an info string, to the order of the key material or to a salt fails those tests even while every encrypt-then-decrypt test still passes, and each service’s test suite runs before every deploy of that service (section II). A change meant to alter a derivation has to move the known answers, and that is the moment its migration is designed.

XIX. Audit logging

SparkVault records security-relevant events of every account, vault and file in an audit log, at the moment each happens, through one writer that every part of the platform calls. The log answers who did what, to which object, when and from where, and it seals part of that answer under the key that protects the data it describes: in a vault’s and a file’s own trails, the details of what happens to the vault’s files and folders, and the network address and software of whoever did it, are sealed under a key derived from that vault’s own key, so a copy of the store that holds the log does not reveal them there. A SparkLink’s receipts, a shared file’s openings among them, are account records and are kept in the clear.

Each event is one record in the metadata store, written once, into the trail of its scope: the account’s, a vault’s or a file’s. A trail lists in the order its events happened, newest first, and is deleted with the object that owns it. The record of a deletion made through the API is written one level up, where it survives.

One record per event

Each record is keyed within its trail by its time and 64 bits drawn for it alone, so a trail lists in the order its events happened and no two records share a key. The draw, the HSM’s output XORed with the operating system’s CSPRNG (section X), also supplies the 96-bit AES-GCM nonce of a record that seals anything. Every event type comes from a registry of the types each scope may hold: a test holds every writer and the registry to each other, a retired type stays readable and filterable but can no longer be written, and the route through which the identity provider files its events refuses any type the registry does not hold.

An audit event record
record = {
  key: its trail, then its time and 64 random bits, // unique in its trail, listed newest first
  account_id, vault_id, ingot_id, // as far as the scope reaches
  event_type: a type its scope's registry holds,
  timestamp: epoch seconds,
  actor_id: a member | an API key | a verified identity | "system" | null,
  // written without the vault's key: account events, and the vault's own lifecycle
  ip_address, user_agent, metadata: details,
  // written with the vault's key: file and folder events, a file's deletion, a key's use on public access
  ip_address: null, user_agent: null, metadata: null,
  encrypted_metadata: { nonce, ciphertext, tag } = AES-256-GCM(
    key = HKDF-SHA512(salt = 32 zero bytes, ikm = VAK, info = "audit-log-encryption", length = 32),
    nonce = 96 bits of the record's draw, // the draw that also supplies the key's 64 random bits
    plaintext = JSON({ ...details, ip_address, user_agent }),
    aad = "audit-log-metadata"),
  is_encrypted,
  ttl_epoch: timestamp + retention,
  v: 1
} // written create-only: refused if its key is taken, never replaced

What is recorded

The account’s trail records sign-ins to and sign-outs from the console; the verification attempts, successes and failures, passkey removals and identity merges that the account’s identity provider reports; members invited, accepting an invitation, removed or leaving, seat types set and licenses requested; teams created, renamed and deleted and their membership changed; the organization’s name, handle, logo and account email, its policy on naming files in email, and its custom domains added and removed; each vault’s creation, the scheduling and cancelling of its deletion, and its deletion; API keys created and revoked; delegated keys revoked because their holder left or lost a license; SparkLinks, the platform’s grants to a Spark or a file at a short link, created, updated and deleted, with receipts of their openings and of the answers given through them; the help desk’s governance trail; and Secure Notify’s settings and projects and the removal of an address’s opt-out. The help desk’s records never carry a request’s content, and Secure Notify’s never carry an endpoint, a secret or a full address.

A vault’s trail records every unseal, with the session’s lifetime, inactivity timeout and hard expiry, and, when a delegated key opened the vault, that key’s last four characters and type; each seal of the whole vault; renames, settings changes and retention changes; sharing turned on, off or reconfigured; the upload portal and widget turned on, off or repaired; the creation of the vault’s hosted key wrapper; delegated keys created, revoked and used; every folder created, renamed, moved, updated or deleted; the deletion of a file through the API; and each page the vault-field sealer seals (section XVIII). A file’s trail records its creation through the API, each upload through the vault’s upload portal or widget, each download through the API or a shared link, and each rename or move of the file itself made without replacing its content.

An account’s deletion, whether its owner or a SparkVault administrator deleted it, and an administrator’s change to an account’s status are written to the platform’s own trail rather than the account’s. Deleting an account removes the account’s trails; the platform’s trail is not the account’s to remove, so the record of the deletion outlives the account.

Details sealed under the vault’s own key

Whether a record is sealed is decided by whether its writer holds the vault’s key, and the platform arranges for the writers of file and folder events always to hold it. Every one of the API’s file and folder routes runs under an unsealed vault session, and every public download or upload recovers the vault’s key through the feature’s system grant. File events, folder events, a file’s deletion and each use of a delegated key behind a public download or upload are therefore written with the VAK. The writer derives an audit key from the VAK with HKDF-SHA512, under an all-zero salt and the info string audit-log-encryption, and seals with AES-256-GCM the event’s details together with the client’s network address and user agent, under a nonce from the record’s own draw and the associated data audit-log-metadata. The record’s top-level address and agent are left empty. What stays in the clear is what the trail needs to be listed and filtered: the scope, the event type, the time, the actor, and the ids of the vault and the file.

What is written without the vault’s key is recorded in the clear: account events, which belong to no vault, a SparkLink’s receipts among them, and the vault’s own lifecycle, its unseals and seals, renames, settings, sharing and upload-channel changes, retention changes and the creation and revocation of delegated keys. Those writers do not hold the VAK, by design; a seal, for one, ends the sessions that would hold it. A vault’s name, which the platform keeps in plaintext by design, appears in those records. The file and folder events that record a name, such as a rename, record it inside the sealed details.

Reading a sealed record takes the vault’s key. The API serves a vault’s trail and a file’s trail only to a request that presents a Vault Access Token, whose session holds the VAK (section XI). The reader derives the audit key, opens each record’s details, and lifts the address and agent back into the entry. AES-256-GCM authenticates what it seals: a sealed record whose ciphertext has been altered does not open, and the entry is shown without its details. No store holds a vault’s VAK in a form that opens without the HSM (section III), so a copy of the audit store yields a vault’s file and folder events as a skeleton: which kind of event, when, by which member or key, on which file id. The vault’s lifecycle records, listed above, are in the clear. Section III’s bounds apply here as everywhere: a vault that is unsealed, or that a feature opens unattended, has a key the running platform can hold.

Who acted, and from where

The actor of a request made with an API key is the key itself, not the member who created it, because a trail has to tell two keys of one member apart, and a key from its member’s own session; the creating member is recorded in the details beside it. Work the platform does on its own, such as a renewal taking effect or the vault-field sealer sealing a page of a vault’s rows, is recorded under the actor system, with the platform operation in place of a user agent and no address. A visitor on a shared link or a public upload page has no account identity, so the file’s record names no actor and holds the visitor’s address and agent sealed under the vault’s key. The receipt that a shared link’s opening writes to the account’s trail names the identity the visitor verified, if any, and records the address and agent in the clear.

When a SparkVault product calls the platform’s core API while serving a request, such as Structured Ingots storing a record in a vault, the inner call carries the audit context of the outer request, so the record names the person and the client behind the original request rather than the product. The platform reads that context only from calls on its internal channel, which it tells apart from outside requests by properties a client cannot forge (section II). An outside request that carries the same header is attributed to its own credential and its own client, so no outside caller can name someone else as the actor by sending it.

The events the identity provider reports name the person and the client by correlation keys. The identifier the person verified, an email address, a phone number or a linked account, is recorded as the first 64 bits of the SHA-256 digest of its canonical form, beside a masked hint: the domain of an email address, the last four digits of a phone number, or a linked account’s provider. The client’s address is recorded as the first 64 bits of its SHA-256 digest, and the user agent is cut to 50 characters. The digests let an administrator correlate repeated attempts on one identifier, or from one address.

What a reader sees of an entry’s address and agent depends on who reads it, and the API decides it once, for every trail and every client. A company owner or administrator sees them on every entry, and so does an API key, which reads with the role of the administrator who created it. Any other member sees them on their own entries and on the platform’s system entries, and sees them as null on a teammate’s, an API key’s, a visitor’s or a recipient’s. The rule changes only what a reader is shown: the record keeps what was written, and every other field of an entry reads the same to every reader.

Written once

Every record is written with a create-only condition: the store refuses the write if the record’s key is already taken, so a key that collided would fail its write instead of replacing the event recorded there. No code path in the platform updates or replaces an audit record. The operations the platform performs on the log are the create-only write, the read of a page, and the deletion of a whole trail together with the object that owns it.

Write-once is a property of the platform’s code and of the store’s conditional writes, so it holds against every caller of the API; a party in control of the running platform is outside it, as section III states for the whole design.

When a write fails

The writer distinguishes a record of something that has already happened from a record that is itself the thing happening. A record of an action already taken, such as a download, a rename or a sign-in, is written as the action completes, and a record the writer cannot store raises an operations alarm instead of disappearing (section XX).

A record that is the action fails closed. When a recipient approves, denies, signs, acknowledges or replies through a SparkLink, the receipt is written in one transaction with the spending of the grant and of the content the answer concerns, so either all of it lands or none of it does, and a ceremony whose receipt cannot be written fails with nothing written. A transaction that returns no verdict is settled by a strongly consistent read of the receipt’s index row, so the platform never reports a ceremony it cannot prove. The receipt carries a token signed with the account’s Ed25519 identity key, naming the account, a digest of the link’s code, the verified identity, the interaction and, where the interaction has them, the decision and a digest of the action approved or signed. A third party can verify it against the account’s published public keys alone. A receipt is never written under a retention it was not given: when the account’s receipt window cannot be read, the receipt is not written, and the failure raises that same alarm.

Retention and deletion

Every record carries its own expiry, its timestamp plus the retention its writer applied, and the metadata store deletes it after that time passes. The default is three months, 90 days. An account sets, vault by vault, how long the records of public access to the vault are kept (downloads through shared links, and uploads through the vault’s upload portal or widget): 24 hours, 7 days, one, two, three, six or nine months, or one, two or three years. The account can also turn those records off, in which case no file’s trail records its public access; a shared link’s opening still writes its receipt to the account’s trail, kept for the account’s receipt window. A change to that setting is itself recorded under the default window, so turning the records off leaves a record of who turned them off. Turning them off never turns off the record of the vault’s key being used: each use of a feature’s system grant behind a public download or upload is still recorded in the vault’s trail, sealed, for 90 days. SparkLink receipts are kept for the account’s receipt retention, 365 days unless the account sets another whole number of days, so that a proof can outlive the dispute it settles; the index row that lists a receipt expires with it.

Deletion follows ownership: a file deleted through the API takes its trail with it and is recorded in its vault’s trail; a deleted folder takes the trails of the files it held; a deleted vault takes its own trail and every file trail in it, and is recorded in the account’s trail; and a deleted account takes every trail it owns. A cascade deletes a page at a time and resumes where it stopped, so a trail of any length is deleted across as many invocations as it needs. The audit log is a table of record, so a deleted record remains within its 35-day point-in-time recovery window (section II) until that window moves past it.

Reading the log

Each trail has its own endpoint in the public API: GET /v1/audit-logs for the account’s, and one each for a vault’s and a file’s, both under a Vault Access Token. Every member of the account can read the account’s trail, and the console, the mobile app and every API caller read the same projection of it. A page holds up to 100 entries, newest first, optionally narrowed to a set of event types.

The cursor that resumes a trail is sealed. It is the last key of the page, encrypted with AES-256-GCM under a key and a nonce taken from the first 44 bytes of the HMAC-SHA512 that the account’s AMK computes over a context that names the trail, its event-type filter and a 128-bit salt drawn for that cursor alone, with the account and the query bound into its associated data under the label SparkVault:Cursor:v1. One key seals exactly one cursor and is erased after use. A cursor reveals nothing about the entries it resumes from, and one that has been altered, taken from another account, or replayed against another trail or another filter is refused.

XX. Incident response procedures

Incident response at SparkVault starts in the platform’s own code. The failures that matter most in a system built on three keys are the ones that would otherwise pass unseen: a key that has been substituted, a stored record that no longer authenticates, an audit record the writer could not store, a control-plane call that destroys data or the means of recovering it. Where the platform must choose between serving a request and being certain of the key the request needs, it refuses the request rather than guess.

Detection

Section II describes how the platform watches itself, alongside the security operations center that monitors around the clock. The alarms that matter most to an incident watch for a root key that has been substituted, lost or made unusable, and for a file’s or folder’s sealed field, or a transfer token’s envelope, that does not open under its key. Another fires when the audit writer cannot store a record (section XIX). An alarm notifies operations when it fires, and an alarm that stays firing is reported again until it is resolved.

Account holders take part in detection. SparkVault Identity sends an email or a text message to the address or number a person signs in with when a passkey is added to their identity and when they sign in from a kind of browser that address or number has not recently used with that organization, and it messages every email address and phone number of an identity merged into another when the merge happens, so a takeover by merging is announced even on channels an attacker does not control. A new browser is recorded as known before its alert is sent, so two simultaneous sign-ins raise one alert, and the record is withdrawn if the alert cannot be sent, so the next sign-in tries again. The new-browser alert names where to lock the identity down, and the terms of service list security alerts among the messages no one can opt out of while using the service.

Containing a compromised credential

A VMK is a root and does not change (section XVIII), and presenting one at unseal also takes an authenticated credential of the vault’s account. The credentials derived from a vault’s key are another matter: each is short-lived, can be ended, or both. Sealing a vault is the kill switch for its sessions: it ends every session of the vault at once (section XI) and revokes every private file transfer issued under those sessions, which the file service checks before it opens a transfer’s key and again before every chunk it releases. Ending one session ends only that session. Revoking a delegated key ends the sessions it minted at their next use, because every use of such a session reads the key’s record with a strongly consistent read. Turning off a hosted feature deletes its system grant, with the sealed secret and escrow the grant holds, and ends every session the grant minted, so nothing new can be opened through it.

An account has the same reach over its people and its keys. Only an administrator in an interactive session can create or revoke an API key, and a key can do neither, so a leaked administrator’s key cannot mint successors that outlive its own revocation. A key is refused as soon as the member who created it is no longer a member. Removing a member revokes every delegated key they hold, ends their sign-in sessions and their integrations’ grants immediately rather than at their next refresh, revokes every API key they created and deletes their devices’ notification registrations. Every route that requires a current member then refuses them. Each step of a removal is idempotent, so a removal that fails part way leaves the member in place, to be removed again, with whatever the completed steps revoked still revoked.

A person can contain a compromise of their own identity. Lockdown, in the identity portal, revokes every other session of the identity, refuses new sign-ins for 24 hours from every address but the one that locked it, makes token introspection refuse every access token issued to the identity before the lockdown, by raising the issued-at threshold it checks, and blocks the identity from being merged into another.

Deleting a vault on its own is slow on purpose (section II). The vault locks the moment its deletion is scheduled, which ends its sessions and stops its transfers, while its contents stay untouched for the seven days in which the company’s other administrators are told and any administrator can cancel the deletion.

Platform-wide credentials have rotations whose costs are known in advance. Replacing the key pair that signs the platform’s access and refresh tokens ends every session at once, because verification holds only the current public key. Replacing the root of the platform’s HMAC-signed capabilities voids every outstanding member invitation, unsubscribe link and domain-verification value. Neither touches stored data.

Root keys are restored, never replaced

The response to trouble with a root key is never a new root key. The SVMK, the AMKs and the key-encryption key behind delegated keys are each permanent, because each is the only key the data sealed under it will ever open under (sections X and XVIII). The remedy is always the same key: a key scheduled for deletion is restored within the provider’s waiting period (section X), a disabled key is enabled again, a lost AMK binding is restored from the accounts table’s point-in-time recovery to the key it named and to no other, and a substituted SVMK is replaced by the pinned original. Service resumes once the original key is back in service.

An exposed root is not replaced either, since replacing it would destroy every vault sealed under it; the design answers exposure with the other two roots (sections III and XVIII).

When the hardware security modules cannot answer

AMK operations depend on the regional HSM infrastructure; SparkVault keeps no standby HSM of its own. The key-encryption key behind delegated keys lives in the same HSM service. While the service cannot answer, unseals and file transfers fail, and so does every operation that draws randomness, because every random value the platform draws mixes the HSM’s output with the operating system’s (section X) and a draw fails rather than continue on one source. No key is restored from a backup: each AMK remains in durable HSM-backed storage. SparkVault holds no copy of an AMK. The platform keeps no memory of a refusal, so service resumes with the first request the HSM service answers.

A weakness in a primitive

A published weakness in a primitive is met with the mechanisms of section XVIII. Moving stored content to a new protection would take each vault’s key, so a vault that only its holder opens could move only once its holder next unseals it.

Records for an investigation

Three records support an investigation, each kept apart from the others and each answering a different question. The audit log of section XIX answers what happened inside an account, and who did it. The infrastructure’s management trail answers what happened to the infrastructure: it records every management call and every write or deletion of a stored file chunk with its caller and source address, carries digests the provider signs, which make a log file altered or removed after delivery detectable, and is kept longer than a deleted file version stays recoverable. The platform’s operational logs answer how a request was served: every line the API writes for a request carries its identifier, and no line carries a customer’s names (section II).

Reporting a vulnerability

Researchers report vulnerabilities to security@sparkvault.com, under SparkVault’s published vulnerability disclosure program. The address is also published at /.well-known/security.txt, in the format RFC 9116 defines, beside the program’s address, the file’s canonical location and the preferred language. The file’s expiry is set afresh by every build of the site, to just under a year ahead, so it never lapses while the site deploys. A researcher with sensitive proof-of-concept material can ask first for a PGP-encrypted channel.

The program covers the SparkVault web application and marketing site, the HTTP API and the short domains SparkVault operates under .sv, its mobile applications, and the SDKs and integrations it publishes. It offers safe harbor: SparkVault will not pursue civil or criminal action against good-faith research, or refer it for prosecution, when the research stays in scope, uses only the researcher’s own accounts or accounts they have permission to test, accesses other customers’ data no further than a proof requires and then stops, deletes it and reports it, avoids privacy violations, destruction of data, degradation of service and other harm, gives SparkVault a reasonable opportunity to remediate before anything is disclosed, and complies with all applicable laws. Findings against the third-party services SparkVault depends on, denial-of-service testing, social engineering and physical attacks, and reports produced by a scanner alone fall outside it. Every report is acknowledged and triaged, and its reporter is kept informed of meaningful progress where that is reasonable. Once an issue is resolved or mitigated, SparkVault may publish a coordinated advisory, crediting the researcher with their permission. The program sets no fixed timeline for response or remediation, and SparkVault commits to communicating honestly about timing when it can.

Notifying customers

SparkVault’s privacy policy commits to notifying a person within 72 hours when a breach of its systems affects their personal information, with details of the breach, the data affected and the steps being taken. Its security policy commits to notifying affected users within 72 hours of a confirmed breach, with what data was affected, the remediation taken and guidance on the protective measures they can take. The terms of service ask customers, in turn, to tell SparkVault immediately of any unauthorized use of their accounts.

XXI. References and bibliography

NIST standards

  • [FIPS 140-3] Security Requirements for Cryptographic Modules. NIST, 2019.
  • [FIPS 180-4] Secure Hash Standard (SHS). NIST, 2015.
  • [FIPS 186-4] Digital Signature Standard (DSS). NIST, 2013.
  • [FIPS 186-5] Digital Signature Standard (DSS). NIST, 2023.
  • [FIPS 197] Advanced Encryption Standard (AES). NIST, 2001.
  • [FIPS 198-1] The Keyed-Hash Message Authentication Code (HMAC). NIST, 2008.
  • [FIPS 202] SHA-3 Standard: Permutation-Based Hash and Extendable-Output Functions. NIST, 2015.
  • [FIPS 203] Module-Lattice-Based Key-Encapsulation Mechanism Standard. NIST, 2024.
  • [SP 800-38D] Recommendation for Block Cipher Modes of Operation: Galois/Counter Mode (GCM) and GMAC. NIST, 2007.
  • [SP 800-57 Part 1] Recommendation for Key Management, Part 1: General (Revision 5). NIST, 2020.
  • [SP 800-90A] Recommendation for Random Number Generation Using Deterministic Random Bit Generators (Revision 1). NIST, 2015.
  • [SP 800-90B] Recommendation for the Entropy Sources Used for Random Bit Generation. NIST, 2018.
  • [NIST PQC] Submission Requirements and Evaluation Criteria for the Post-Quantum Cryptography Standardization Process. NIST, 2016.
  • [NIST PQC Signatures] Call for Additional Digital Signature Schemes for the Post-Quantum Cryptography Standardization Process. NIST, 2022.

IETF RFCs and Internet-Drafts

  • [RFC 2104] Krawczyk, H., Bellare, M., Canetti, R. “HMAC: Keyed-Hashing for Message Authentication.” 1997.
  • [RFC 5869] Krawczyk, H., Eronen, P. “HMAC-based Extract-and-Expand Key Derivation Function (HKDF).” 2010.
  • [RFC 6238] M’Raihi, D., Machani, S., Pei, M., Rydell, J. “TOTP: Time-Based One-Time Password Algorithm.” 2011.
  • [RFC 6797] Hodges, J., Jackson, C., Barth, A. “HTTP Strict Transport Security (HSTS).” 2012.
  • [RFC 6962] Laurie, B., Langley, A., Kasper, E. “Certificate Transparency.” 2013.
  • [RFC 7515] Jones, M., Bradley, J., Sakimura, N. “JSON Web Signature (JWS).” 2015.
  • [RFC 7517] Jones, M. “JSON Web Key (JWK).” 2015.
  • [RFC 7518] Jones, M. “JSON Web Algorithms (JWA).” 2015.
  • [RFC 7748] Langley, A., Hamburg, M., Turner, S. “Elliptic Curves for Security.” 2016.
  • [RFC 8032] Josefsson, S., Liusvaara, I. “Edwards-Curve Digital Signature Algorithm (EdDSA).” 2017.
  • [RFC 8037] Liusvaara, I. “CFRG Elliptic Curve Diffie-Hellman (ECDH) and Signatures in JSON Object Signing and Encryption (JOSE).” 2017.
  • [RFC 8291] Thomson, M. “Message Encryption for Web Push.” 2017.
  • [RFC 8439] Nir, Y., Langley, A. “ChaCha20 and Poly1305 for IETF Protocols.” 2018.
  • [RFC 8446] Rescorla, E. “The Transport Layer Security (TLS) Protocol Version 1.3.” 2018.
  • [RFC 9001] Thomson, M., Turner, S. “Using TLS to Secure QUIC.” 2021.
  • [RFC 9106] Biryukov, A., Dinu, D., Khovratovich, D., Josefsson, S. “Argon2 Memory-Hard Function for Password Hashing and Proof-of-Work Applications.” 2021.
  • [RFC 9116] Foudil, E., Shafranovich, Y. “A File Format to Aid in Security Vulnerability Disclosure.” 2022.
  • [AEAD Limits] Günther, F., Thomson, M., Wood, C.A. “Usage Limits on AEAD Algorithms.” Internet-Draft draft-irtf-cfrg-aead-limits-13, IRTF Crypto Forum Research Group, 2026.

Academic publications

  • [Kyber] Avanzi, R., et al. “CRYSTALS-Kyber Algorithm Specifications and Supporting Documentation (version 3.02).” NIST PQC Round 3 Submission, 2021.
  • [Curve25519] Bernstein, D.J. “Curve25519: New Diffie-Hellman Speed Records.” PKC 2006.
  • [ChaCha20] Bernstein, D.J. “ChaCha, a variant of Salsa20.” SASC 2008.
  • [Poly1305] Bernstein, D.J. “The Poly1305-AES Message-Authentication Code.” FSE 2005.
  • [XSalsa20] Bernstein, D.J. “Extending the Salsa20 Nonce.” Symmetric Key Encryption Workshop 2011.
  • [Argon2] Biryukov, A., Dinu, D., Khovratovich, D. “Argon2: The Memory-Hard Function for Password Hashing and Other Applications.” Password Hashing Competition Winner, 2015.
  • [GCM] McGrew, D., Viega, J. “The Galois/Counter Mode of Operation (GCM).” NIST, 2004.
  • [SIV] Rogaway, P., Shrimpton, T. “A Provable-Security Treatment of the Key-Wrap Problem.” EUROCRYPT 2006.
  • [HKDF] Krawczyk, H. “Cryptographic Extraction and Key Derivation: The HKDF Scheme.” CRYPTO 2010.

Security analysis

  • [LWE] Regev, O. “On Lattices, Learning with Errors, Random Linear Codes, and Cryptography.” STOC 2005.
  • [MLWE] Langlois, A., Stehlé, D. “Worst-Case to Average-Case Reductions for Module Lattices.” Designs, Codes and Cryptography, 2015.
  • [Shor] Shor, P.W. “Algorithms for Quantum Computation: Discrete Logarithms and Factoring.” FOCS 1994.
  • [Grover] Grover, L.K. “A Fast Quantum Mechanical Algorithm for Database Search.” STOC 1996.
  • [BN00] Bellare, M., Namprempre, C. “Authenticated Encryption: Relations among Notions and Analysis of the Generic Composition Paradigm.” ASIACRYPT 2000.
  • [BBM00] Bellare, M., Boldyreva, A., Micali, S. “Public-Key Encryption in a Multi-user Setting: Security Proofs and Improvements.” EUROCRYPT 2000.
  • [BB03] Brumley, D., Boneh, D. “Remote Timing Attacks Are Practical.” USENIX Security 2003.
  • [BR06] Bellare, M., Rogaway, P. “The Security of Triple Encryption and a Framework for Code-Based Game-Playing Proofs.” EUROCRYPT 2006.
  • [Bel06] Bellare, M. “New Proofs for NMAC and HMAC: Security without Collision-Resistance.” CRYPTO 2006.
  • [Joux06] Joux, A. “Authentication Failures in NIST Version of GCM.” Comments to NIST, 2006.
  • [IOM12] Iwata, T., Ohashi, K., Minematsu, K. “Breaking and Repairing GCM Security Proofs.” CRYPTO 2012.
  • [DRST12] Dodis, Y., Ristenpart, T., Steinberger, J., Tessaro, S. “To Hash or Not to Hash Again? (In)differentiability Results for H² and HMAC.” CRYPTO 2012.
  • [GPR14] Gaži, P., Pietrzak, K., Rybár, M. “The Exact PRF-Security of NMAC and HMAC.” CRYPTO 2014.
  • [Pro14] Procter, G. “A Security Analysis of the Composition of ChaCha20 and Poly1305.” IACR Cryptology ePrint Archive, Report 2014/613, 2014.
  • [BT16] Bellare, M., Tackmann, B. “The Multi-user Security of Authenticated Encryption: AES-GCM in TLS 1.3.” CRYPTO 2016.
  • [BZDSJ16] Böck, H., Zauner, A., Devlin, S., Somorovsky, J., Jovanovic, P. “Nonce-Disrespecting Adversaries: Practical Forgery Attacks on GCM in TLS.” USENIX WOOT 2016.
  • [HTT18] Hoang, V.T., Tessaro, S., Thiruvengadam, A. “The Multi-user Security of GCM, Revisited: Tight Bounds for Nonce Randomization.” ACM CCS 2018.
  • [DGRW18] Dodis, Y., Grubbs, P., Ristenpart, T., Woodage, J. “Fast Message Franking: From Invisible Salamanders to Encryptment.” CRYPTO 2018.
  • [DGGP21] Degabriele, J.P., Govinden, J., Günther, F., Paterson, K.G. “The Security of ChaCha20-Poly1305 in the Multi-user Setting.” ACM CCS 2021.
  • [LGR21] Len, J., Grubbs, P., Ristenpart, T. “Partitioning Oracle Attacks.” USENIX Security 2021.
  • [BBGS23] Backendal, M., Bellare, M., Günther, F., Scarlata, M. “When Messages Are Keys: Is HMAC a Dual-PRF?” CRYPTO 2023.
  • [ML-KEM proof] Almeida, J.B., et al. “Formally Verifying Kyber Episode V: Machine-Checked IND-CCA Security and Correctness of ML-KEM in EasyCrypt.” CRYPTO 2024.
  • [KyberSlash] Bernstein, D.J., et al. “KyberSlash: Exploiting Secret-Dependent Division Timings in Kyber Implementations.” IACR TCHES 2025(2).

Encrypt with AES-256-GCM and ML-KEM-1024

Store your files under three independent master keys, one of them held by you.