.gksend format specification.

The .gksend format is an encrypted envelope that carries one or more documents — typically .gkp files — to a recipient identified by a public key.

Section 1 — Overall structure

A .gksend file has three blocks:

  1. Fixed 32-byte header starting with the magic bytes GKSE (4 bytes: 0x47 0x4B 0x53 0x45).
  2. Send manifest (SendManifest) encoded in canonical CBOR.
  3. Encrypted payload with AES-256-GCM.

Section 2 — Fixed header (32 bytes)

OffsetSizeField
04Magic GKSE
42Major version
62Minor version
88Manifest size (uint64 little-endian)
168Encrypted payload size (uint64 little-endian)
248Emission timestamp (uint64 little-endian, Unix seconds)

Section 3 — Send manifest

The SendManifest carries:

  • from: identifier of the sender and Ed25519 public signing key.
  • to: identifier of the recipient and X25519 encryption public key.
  • alg: envelope algorithm (default "X25519+HKDF+AES-256-GCM").
  • nonce: AES-GCM nonce (12 bytes).
  • items: list of items carried, each with: name, MIME type, cleartext size, BLAKE3 fingerprint.
  • sig: Ed25519 signature of the sender over the manifest.

Section 4 — Key derivation

The encryption key of the payload is derived by HKDF-SHA-256 from the X25519 shared secret between sender and recipient, with a context including the envelope identifier and the operation type.

Section 5 — Payload

The encrypted payload is an archive concatenating the items declared in items. After decryption, the recipient can split the items and verify their individual BLAKE3 fingerprints.

Section 6 — Revocation

A .gksend envelope does not support revocation at the format level. Revocation is carried by the .gkp documents transported inside, each according to its own revocation model.

Section 7 — Compatibility

A conformant receiving client MUST:

  • reject a file whose magic bytes are not GKSE;
  • verify the Ed25519 signature of the manifest before any decryption attempt;
  • verify the BLAKE3 fingerprint of each item after decryption;
  • silently reject items whose fingerprint does not match.

Further reading