white paperdraft 0.1.3

openxor white paper

Draft 0.1.3 · 29 November 2026 · Jamieson O'Reilly

Status. This is a design draft for review. openxor is being built to this specification in its GitHub repository. At Draft 0.1, the XOR primitive and the cross-platform test pipeline exist; the rest is in progress. Nothing has been audited, and every format below may change before version 1.0. Changes are listed in the change log at the end. Where the draft makes a choice that is not settled, it says so and lists the question under Open questions.

Contents

1. Summary

openxor is a command-line toolkit and Go library for information-theoretically secure cryptography. Two people share a pad: a large file of random bytes. Each message is encrypted by combining it with unused pad bytes (XOR) and authenticated with a one-time polynomial MAC keyed by further unused pad bytes. Both sides erase the pad bytes once they are used.

Because no part of a message's protection relies on a problem being hard to solve, an attacker who records the encrypted messages learns nothing from them however much computing power they have, now or later. That includes a fast algorithm following a proof that P = NP, and algorithms no one has thought of yet. This is a proof (Shannon 1949), not an assumption about attackers; it holds as long as its conditions do: the pad is truly random, every pad byte is used only once, and the pad stays secret.

The cost is key distribution. The pad must reach the other person physically, on a drive or as a file, and it is used up at one byte per byte sent. openxor makes that practical: it generates pads from hardware randomness, keeps them in locked vaults on removable drives, and handles the bookkeeping so that pad bytes are never used twice.

openxor also provides threshold secret sharing (k of n), for keeping a file safe in several places without any computational assumption.

2. Goals and non-goals

Goals

  1. Confidentiality in transit against unbounded attackers. An attacker who records every message, forever, and has unlimited computation, learns nothing about message contents beyond their rounded length.
  2. Integrity in transit against unbounded attackers. Any change to a message is detected, except with a probability that can be stated and is negligible.
  3. No pad byte is ever used twice, by either party, even after crashes, interrupted writes or messages arriving out of order.
  4. Erasure after use. Once a message has been sent and read, the pad bytes that protected it exist nowhere, so the message can never be decrypted again, even by its sender or recipient.
  5. No network code. openxor never opens a network connection. Users carry the encrypted messages over whatever channel they like.
  6. Portable. One static binary for macOS, Windows and Linux, which can run from the drive holding the vault.
  7. Storage without computational assumptions, using threshold secret sharing.

Non-goals

3. Threat model

The attacker can

The attacker cannot (assumptions)

Out of scope

Malware and compromised hardware on the endpoints, electromagnetic and acoustic side channels, coercion of a party (beyond the emergency wipe in section 8.8), and a contact who deliberately leaks messages.

4. Building blocks

4.1 One-time pad

To encrypt a message m of n bytes, openxor takes n unused pad bytes k and computes c = m XOR k. To decrypt, the recipient computes m = c XOR k with their identical copy of k.

If k is uniformly random, at least as long as m, and never used for anything else, then c is statistically independent of m: every message of length n is equally likely given c (Shannon 1949). No amount of computation changes this, because there is nothing to compute: the information is not in c.

The conditions are strict. Reusing any pad byte leaks the XOR of two plaintexts, which is how the Venona project read Soviet traffic. Pad bytes that are not truly random, such as the output of a deterministic generator, reduce the scheme to the security of that generator (section 5).

4.2 One-time authentication

Encryption alone does not stop an attacker flipping bits in c. openxor authenticates every message with a Wegman–Carter one-time MAC (Wegman and Carter 1981): a polynomial hash over the prime field p = 2^127 − 1, keyed with fresh pad bytes and never reused.

Key. 32 unused pad bytes, split into two 16-byte little-endian integers. The top bit of each is cleared, giving r and s, each in [0, 2^127). A value equal to p is reduced to 0; this changes the distribution by at most 2^−127.

Input encoding. The authenticated data A (section 7.1) is split into 15-byte blocks, the last possibly shorter. Each block b of length ℓ becomes the integer B = LE(b) + 2^(8ℓ) (the block followed by a 0x01 byte, read little-endian), so B < 2^121 < p and different inputs give different polynomials. This is the same encoding Poly1305 uses (Bernstein 2005), with 15-byte blocks to fit the smaller prime.

Tag. For blocks B1 … BL:

h   = (B1·r^L + B2·r^(L−1) + … + BL·r) mod p
tag = (h + s) mod p,  written as 16 bytes little-endian

Security. For any two distinct inputs of at most L blocks, the probability over r that their hashes collide, or differ by any fixed value, is at most L / p. An attacker who sees one tagged message and submits one forgery succeeds with probability at most L / p, about L / 2^127, whatever their computing power. A 100 MB file is about 7 million blocks, giving at most about 2^−104 per attempt. Tags are compared in constant time.

4.3 Threshold secret sharing

For storage, openxor scrambles a file into n shards so that any k rebuild it and any k − 1 reveal nothing about it (Shamir 1979). Each byte is shared independently with a random polynomial of degree k − 1 over GF(2^8), so n is at most 255. The 2-of-2 case is equivalent to XOR with a random file of the same length. Section 10 describes the shard format.

5. Randomness

The one-time pad is only as good as its randomness. A pad made by stretching a short seed with a deterministic generator is not a one-time pad: an attacker who can solve for the seed, which a fast P = NP algorithm could do given some known plaintext, recovers the whole pad. Every operating system's standard generator (getrandom on Linux, BCryptGenRandom on Windows, SecRandomCopyBytes on macOS) works this way.

openxor therefore builds every pad byte as

pad = H XOR S

where H comes from a hardware entropy source and S from the operating system's generator. XOR with an independent value cannot make a uniformly random input less random, so the pad is uniformly random as long as at least one of the two is, and S protects against a faulty or subverted hardware source.

Hardware sources, in order of preference:

  1. an external hardware random number generator on USB, read raw and conditioned by openxor;
  2. the CPU's entropy instruction where the operating system lets programs use it: RDSEED on x86, RNDRRS on Arm processors that have it.

Health tests. Raw hardware output passes the repetition count test and the adaptive proportion test from NIST SP 800-90B before use. If a test fails, openxor make stops.

When no hardware source is available, for example on Apple silicon Macs, which as far as we know do not expose a hardware random instruction to programs, openxor will make pads only with an explicit --standard-randomness flag. Pads made that way are permanently labelled in the vault and shown as "standard randomness: not P = NP-proof" by openxor status. This is an open question (Open question 2).

6. Vaults, containers and pads

6.1 Terms

Alice's vault holds, for each contact Bob, a container with pad(Alice→Bob) and pad(Bob→Alice). Bob's vault holds the same two pads in his container for Alice. Each pad has exactly one sender, so the two parties never need to coordinate which bytes to use.

6.2 Bookkeeping

For each container, the vault records:

6.3 File layout (proposed)

header        magic "OXV1", format version, flags,
              Argon2id parameters and 16-byte salt,
              wrapped vault key (two copies, see 8.8)
table A/B     two slots for the encrypted container table, each with a
              sequence number; the newer valid slot wins (crash safety)
pad chunks    pad bytes in 64 KiB chunks, each encrypted separately

Each pad chunk is encrypted with AES-256-GCM under the vault key, with a random 96-bit nonce stored next to it and the vault ID, container ID, pad ID and chunk index as associated data, so chunks cannot be swapped or moved without detection.

6.4 The lock

A random 32-byte vault key encrypts everything in the vault. The header stores the vault key encrypted (wrapped) under a key derived from the user's password with Argon2id (RFC 9106).

Settings. Every vault uses the same fixed settings: 256 MiB of memory, 3 passes and 4 lanes, so each password guess takes about a second on a typical laptop. Because the settings are fixed, a vault made on a fast computer opens on a slower one; this matters because one person usually makes both vaults.

At these settings, a thief guessing offline at one guess per second per computer needs about three hours to try the 10,000 most common passwords, and longer than any realistic attack to guess a six-word random password.

This lock is ordinary, computational encryption. It protects a lost or stolen drive against guessing today. It does not protect against an attacker who copies the vault and later has a fast P = NP method, because the encrypted pad together with any message sent with it gives such an attacker something to check guesses against. Section 11 states this layer by layer.

6.5 The pickup code

When one person makes both vaults, the other person is not there to choose a password. Their vault is locked with a pickup code instead: four words from the EFF long word list (7,776 words) and a two-digit number, about 58 bits, for example maple orbit river 42.

On first use, the recipient types the pickup code, chooses their own password, and openxor wraps the vault key under the new password and overwrites the old wrapped key. The pickup code then no longer opens the vault, and the person who made it never knows the new password.

The pickup code must travel separately from the vault (out loud, in a phone call), so that intercepting one does not give the other. Like the password, it is computational protection only.

7. The message format

7.1 Binary form

A message consumes 32 + B bytes of the sender's outgoing pad, starting at offset o:

pad[o .. o+32)        one-time MAC key (r, s)
pad[o+32 .. o+32+B)   encryption bytes

B is a multiple of 16, so offsets stay 16-byte aligned. The message is:

FieldSizeContents
version10x01
flags1bit 0: content is a file
offset6o, little-endian (pads up to 256 TiB)
ciphertextBpadded plaintext XOR pad[o+32 .. o+32+B)
tag16one-time MAC (section 4.2) of version, flags, offset and ciphertext

The padded plaintext is: a type byte, a 4-byte content length, for files a name length byte and the file name (UTF-8, at most 255 bytes), then the content, then zero bytes up to B.

The message does not name its recipient or sender. The recipient's openxor checks the tag against each contact's incoming pad at offset o; only the right one verifies. This costs one MAC computation per contact.

7.2 Length rounding

Text up to 256 bytes is rounded up to a multiple of 16 bytes. Longer text and all files are rounded up with the Padmé scheme (Nikitin et al. 2019), which reveals at most O(log log n) bits of the length, then to a multiple of 16.

7.3 Encodings

7.4 What a message reveals

To anyone without the pad: the rounded length, and the offset. The offset reveals roughly how many bytes have been sent in that direction so far. See Open question 4.

8. Procedures

8.1 Making a contact

  1. The user plugs in two drives (or chooses --files to make two vault files).
  2. openxor creates or unlocks the user's own vault, and creates a vault for the contact locked with a new pickup code.
  3. openxor generates two pads (section 5) and writes them, chunk by chunk, to both vaults. Nothing is written to the computer's own disk.
  4. openxor reads both vaults back and checks that the pads are identical, then copies the program onto the contact's drive.
  5. openxor shows the pickup code once.

8.2 Delivering the contact's vault

8.3 Why the first delivery cannot be done safely online

Any way of sending a pad over a network protects it with something smaller than the pad: a key exchange (broken by P = NP), a pre-shared passphrase (a few dozen bytes, which cannot protect a gigabyte against unbounded computation), or multi-party computation (which relies on public-key cryptography or on private channels that would already solve the problem). Splitting the pad across several services only raises the number of recordings an attacker needs. These options are not offered as P = NP-proof.

8.4 Sending

  1. openxor computes the padded plaintext and B.
  2. In the vault, it advances the next send offset past o + 32 + B and writes the updated table (section 6.3). If openxor stops after this step, those bytes are lost, never reused.
  3. It reads the pad bytes, computes the ciphertext and tag, and erases the pad bytes from the vault (section 9).
  4. It outputs the message.

8.5 Receiving

  1. openxor decodes the message and finds the container whose incoming pad verifies the tag at offset o. If none verifies, it reports a damaged or forged message and changes nothing, so a forger cannot use up pad bytes.
  2. If any byte in [o, o + 32 + B) is in an erased range, it refuses the message as already read. This also prevents replays.
  3. It decrypts in memory, records the range as erased, erases the pad bytes, and only then shows the message. The message stays in memory until the user closes it; it is not written to disk unless the user asks.

Messages may arrive in any order.

8.6 Status and renewal

openxor status shows, for each contact, how much of each pad is left and the provenance flags. openxor warns at 20% and 5% remaining. A new pad is a new container made the same way as the first.

8.7 Forgetting a contact

openxor forget <name> erases the container's pads and bookkeeping, after the vault is unlocked.

8.8 Emergency wipe

openxor forget --no-preserve destroys a vault without its password:

  1. It runs only from an interactive terminal, typed in full; it is not in the menu and not in tab completion.
  2. It names the drive or file it will wipe.
  3. The user types three random words shown on screen.
  4. A three-second countdown runs; any key cancels.
  5. openxor overwrites both copies of the wrapped vault key and the Argon2id salt with random bytes, syncs, and reads them back to confirm they changed.

Without the vault key nothing in the vault can be decrypted. --practice performs every step except the overwrite. A copy of the vault made before the wipe is unaffected, and flash memory may keep an old copy of the header (section 9).

9. Erasing

Pad bytes. To erase a range, openxor decrypts the affected chunks, sets the range to zero, encrypts each chunk again under a new nonce, writes it in place and syncs.

Limits on flash storage. USB sticks, SSDs and SD cards move data internally for wear levelling, so an overwrite may leave the old encrypted chunk in a spare block that a forensics lab could read. That old chunk is still encrypted under the vault key, so recovering it also requires the password (or a fast P = NP method). Destroying old drives physically is the only complete answer. Open question 3 proposes per-chunk keys to narrow this.

Memory. openxor keeps pad bytes and plaintext in memory locked against swapping where the operating system allows (mlock, VirtualLock), disables core dumps, and zeroes buffers after use. Go's garbage collector can copy data it manages, so memory erasure is best effort; sensitive buffers are allocated outside the collector where possible.

Disk hygiene. openxor refuses to place a vault in a folder synced by iCloud, Dropbox, OneDrive or Google Drive, marks vault folders to be excluded from Time Machine and search indexing, and never writes plaintext or pad bytes to temporary files.

10. Scrambling files for storage

openxor scramble turns a file, a folder or a typed secret into shards; openxor unscramble rebuilds it from enough of them. A folder is packed into a single archive first.

Each shard holds: a format version, a random 16-byte set ID, k, n, the shard's index, the rounded length, and the shard bytes. Shards from different sets are refused. Before finishing, scramble rebuilds the file from every combination of k shards in memory and compares it with the original.

Making a new version of a file always uses fresh randomness. Reusing a sharing polynomial for two versions would reveal how they differ.

Detecting a deliberately altered shard without computational assumptions is harder than detecting accidental damage; see Open question 1.

No single-file password mode. openxor does not offer a password-only way to protect a file in one output. A password holds a few dozen bytes of secret; a file holds far more. Information-theoretic secrecy requires a key at least as long as the data (Shannon 1949), so any single-file password scheme is computational and falls to a fast P = NP method. Existing tools do that kind of encryption well; openxor leaves it to them.

11. What survives P = NP, layer by layer

LayerProtectsMechanismHolds against a fast P = NP method?
Message contents in transitconfidentialityone-time padyes
Message integrity in transittampering, forgeryone-time MACyes
Replaysreading a message twiceerased rangesyes
Message lengthcontent sizeroundingpartly: rounded length is visible
Vault at resta stolen or copied driveArgon2id and AES-256-GCMno
Pickup code in transitan intercepted driveArgon2id and AES-256-GCMno
Pad randomnesspredictable padshardware source XOR OS generatoryes, if the hardware source is truly random
Downloadstampered binariessignaturesno; rebuilding from source does not depend on them
Shardsstored filesthreshold secret sharingyes

In short: what crosses the network stays unreadable forever; what sits on a drive is protected by physical custody first and ordinary encryption second.

12. Comparison with existing tools

Key agreementSurvives quantum computersSurvives fast P = NPNeeds physical exchange
TLS 1.3ECDHE (plus ML-KEM in hybrid modes)with ML-KEM, yesnono
SignalPQXDH and Double Ratchetyes, against current knowledgenono
OpenPGPRSA or ECCnonono
WireGuard with a pre-shared keyNoise plus symmetric PSKyes, with a strong PSKnoyes, for the PSK
Quantum key distributionquantum channelyesyes, if authenticated with a pre-shared keydedicated hardware and fibre
openxornone; pad delivered physicallyyesyes, for messages in transityes

13. Build and release integrity

Signatures and the checksum database are computational. Rebuilding from source and comparing fingerprints is not.

14. Limits

Open questions

  1. Robust shards. How should unscramble detect a deliberately altered shard without computational assumptions? Candidates: robust secret sharing schemes with an honest majority of shards, or a one-time MAC whose key is itself shared.
  2. Hardware randomness on Apple silicon. Is there a supported way for programs to read raw hardware entropy on Apple silicon Macs? If not, should openxor require an external USB generator there for P = NP-proof pads?
  3. Per-chunk keys. Encrypting each pad chunk under its own key, and destroying that key once the chunk is used up, would make erasure depend on overwriting 32 bytes rather than 64 KiB. Is the extra bookkeeping worth it?
  4. Offset privacy. The offset reveals roughly how much has been sent. Starting each pad at a random offset hides the absolute count; hiding the differences between messages needs more. Is that worth the complexity?
  5. Argon2id parameters. Decided in Draft 0.1.1: fixed settings for every vault, a selftest warning on slow computers, and an optional --harder setting (section 6.4).
  6. Test vectors. Publish known-answer tests for the MAC, the message format and the share format with Draft 0.2. The message vectors will use the text Hasta la vista, baby.

References

Change log