dotbge.com
Open File Format Specification

The .bge
format.

An open, self-describing container for encrypted files.

Magic number
0x42 0x47 0x45 0x33
Every .bge file begins here.
Document
Version3.0
StatusFinal
Updated2026-02-03
Extension.bge
UTIcom.dotbge.encrypted
LicenseFree to implement
§ 1 — Abstract

A file that carries its own security.

The .bge format is an open container for encrypted files. It pairs RSA-4096 public-key encryption with AES-256-GCM authenticated encryption, splits content into independently sealed chunks for constant-memory streaming, and carries an encrypted metadata block so a file can describe itself without being opened.

There are no servers, no accounts, and no proprietary dependencies. A .bge file is a complete, portable cryptographic object — and this document is everything required to read or write one.

Design goals

§ 2 — File structure

Three linear segments.

A .bge file is read front to back. The header recovers the data key; the metadata block describes the original file; the payload carries its contents as a sequence of sealed chunks.

1  Header variable length
Preamble
magic · version · mode
Mode auth data
wrapped data key
File info
chunk size · size · count
Carries the encrypted Master Key (DEK). Its shape depends on the encryption mode.
2  Metadata block mandatory · ≤ 64 KB
Nonce
12 bytes
Encrypted JSON
filename · type · dimensions
Auth tag
16 bytes
AES-GCM encrypted with the DEK. Lets a file show a name and type in a previewer without exposing its contents.
3  Content payload chunk 0 … chunk N
Chunk 0
nonce · ciphertext · tag
Chunk 1
nonce · ciphertext · tag
Chunk N
may be short
The file contents, split into fixed-size chunks. Each chunk is sealed independently with AES-256-GCM.
§ 3 — Cryptographic primitives

Standard algorithms, no surprises.

Every operation uses a published, widely-implemented algorithm. The format defines no novel cryptography of its own.

Algorithms & parameters
PurposeAlgorithmParameters
Payload & key wrapping AES-256-GCM 256-bit key · 96-bit random nonce per use · 128-bit tag
Identity mode RSA-4096, OAEP SHA-256 · MGF1-SHA256 · 512-byte ciphertext
Password mode PBKDF2-HMAC-SHA512 16-byte random salt · 1,000,000 iterations (default)
Key ID SHA-256 First 8 bytes of SHA-256(SPKI DER) of the public key
§ 4 — Encryption modes

Seal to a person, or to a secret.

The mode byte at offset 5 selects how the Master Key is protected. Everything after the header is identical between the two modes.

Mode 0x01
RSA Identity

The data key is wrapped with the recipient's RSA public key using OAEP. Only the holder of the matching private key can open the file. An 8-byte Key ID lets a reader pick the right key instantly, with no trial decryption.

Mode 0x02
Password

A key-encryption key is derived from a passphrase with PBKDF2-HMAC-SHA512, then used to wrap the data key with AES-GCM. Anyone with the passphrase can open the file — no app, identity, or key exchange required.

§ 6 — Versioning

Old files still open.

The format has carried three on-disk revisions. A conforming v3 reader can identify and route all of them by inspecting only the first four bytes.

Format detection
VersionSignatureNotes
v3bytes = BGE3 Current. RSA + Password modes, metadata block, Key ID.
v2byte 0 = 0x02 Legacy. RSA only, chunked, .enc.
v1bytes 0–3 = RSA length (512) Legacy. RSA only, whole-file, .enc.

Because each version has a disjoint signature, detection never requires a decryption attempt. New revisions extend the magic number rather than overload an existing one.

§ 7 — Implementations

Anyone can build a reader.

The format is published so that .bge files outlive any single program. This document, together with the test vectors, is everything required to build a conforming reader or writer — independent implementations are welcome and need no permission.

Known implementations
ImplementationPlatformStatus
dotbge for iOSiPhone & iPad Available
dotbge for macOSMenu bar app In development
bge CLITerminal In development
Third-partyAny language or platform Welcome

Building a .bge implementation? The format carries no licensing fee and imposes no branding requirement. If you ship one, get in touch and we will list it here.

Clients, downloads, and screenshots for the official apps live on dotbge.app.

§ 8 — Get the specification

Read the full document.

This page summarises the format. The complete specification — the full byte-level layout, encryption and decryption flows, chunk-size recommendations, and the metadata schema — is published openly, with test vectors for verifying an implementation.

§ 9 — Common questions

Questions about the format.

Is the .bge file format open?

Yes. The complete byte-level specification is published and free to implement — in any language, for any purpose including commercial use, with no licensing fee. The format relies only on standard, published cryptographic algorithms.

Does .bge need a server or an account?

No. A .bge file is self-contained: it carries its own encrypted key and an encrypted description of itself. Encryption and decryption happen entirely on-device, with no server, account, or network connection.

What encryption does the .bge format use?

The file payload is encrypted with AES-256-GCM in independently sealed chunks. The data key is protected with RSA-4096 (OAEP-SHA256) for identity-based sharing, or with a PBKDF2-HMAC-SHA512 derived key for password mode.

Can I build my own .bge reader or writer?

Yes. The specification and its test vectors are everything required to build a conforming implementation. Independent implementations are welcome and need no permission.

What is the difference between dotbge.com and dotbge.app?

dotbge.com documents the open .bge file format. dotbge.app is the official application that implements it — available for iPhone and iPad, with macOS and a command-line tool in development.