File format
A .gvf is a short signed header followed by the encrypted content. This is version 3.
Layout
"GVF3" 4 bytes
header length 4 bytes, big-endian
header JSON
signature length 4 bytes, big-endian
signature ML-DSA-87 over everything above it
chunk, chunk, ... AES-256-GCM
Header
{
"v": 3,
"file_id": "...",
"origin": "https://docs.example.com",
"deployment_id": "GV-XXXX-XXXX-XXXX-XXXX",
"key_id": "...",
"created": "2027-01-15T09:30:00Z",
"chunk_size": 65536,
"nonce_prefix": "...",
"sig_alg": "ML-DSA-87",
"kdf": "HKDF-SHA384",
"cipher": "AES-256-GCM"
}
| Field | Meaning |
|---|---|
origin | The address the file opens at. |
deployment_id | The installation, whatever its address. |
key_id | Which of the installation's signing keys signed this header. |
chunk_size | Bytes of content per chunk before encryption. |
nonce_prefix | Random, per file. |
The header holds no file name, no owner, no permissions and no key. Those live on the installation, which is why they can be changed after the file has been sent.
Content
- The content key is derived from the file key with HKDF-SHA-384. The file key itself is never used directly.
- Content is split into chunks of
chunk_sizebytes. Each is encrypted separately, so large files are handled as a stream. - Each chunk's nonce is the file's prefix, the chunk's number, and a flag marking the last chunk. Chunks cannot be reordered, and a file cut short is detected because its final chunk is missing the flag.
- Every chunk is also bound to a SHA-384 hash of the signed header. A chunk from one file will not decrypt inside another.
Signature
The installation signs the magic bytes, the header length and the header. A reader checks the signature before trusting any field, the address included.
Editing
When a document is edited in the viewer, the server writes a new .gvf with the same file ID and file key and a fresh nonce prefix. Copies made before the edit still open, to the content they held.