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
- 2. Goals and non-goals
- 3. Threat model
- 4. Building blocks
- 5. Randomness
- 6. Vaults, containers and pads
- 7. The message format
- 8. Procedures
- 9. Erasing
- 10. Scrambling files for storage
- 11. What survives P = NP, layer by layer
- 12. Comparison with existing tools
- 13. Build and release integrity
- 14. Limits
- Open questions
- References
- Change log
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
- 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.
- Integrity in transit against unbounded attackers. Any change to a message is detected, except with a probability that can be stated and is negligible.
- No pad byte is ever used twice, by either party, even after crashes, interrupted writes or messages arriving out of order.
- 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.
- No network code. openxor never opens a network connection. Users carry the encrypted messages over whatever channel they like.
- Portable. One static binary for macOS, Windows and Linux, which can run from the drive holding the vault.
- Storage without computational assumptions, using threshold secret sharing.
Non-goals
- Hiding who is communicating, when, or roughly how much. openxor rounds message lengths but does not hide that messages exist.
- Protecting a compromised computer. Malware on either computer can read messages as they are typed or displayed.
- Protecting stored pads against unbounded attackers. The lock on a vault is ordinary encryption (section 6.4). It stops someone who finds a drive today, not someone who copies it and later has a fast P = NP method.
- Exchanging pads over a network. No protocol can create an information-theoretically secure shared key over a channel the attacker can record without some prior shared secret of at least the same size (Maurer 1993). openxor does not pretend otherwise (section 8.3).
- Group messaging. Groups are made of pairs, each with its own pads.
3. Threat model
The attacker can
- record all network traffic between the two parties, indefinitely, and analyse it later with unlimited computation, including quantum computers and a fast P = NP algorithm;
- change, delay, reorder, replay, drop and inject messages;
- intercept a drive or vault file in transit, and copy it (detectably, if a tamper-evident bag is used and checked; undetectably, for a file sent over a network);
- steal a drive or a computer;
- see the length and timing of every message.
The attacker cannot (assumptions)
- predict the output of at least one of the randomness sources used to make the pad (section 5);
- copy a pad during delivery without it being noticed, for pads delivered by hand or in a checked tamper-evident bag;
- run code on either party's computer while it is in use.
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:
- an external hardware random number generator on USB, read raw and conditioned by openxor;
- the CPU's entropy instruction where the operating system lets programs use it:
RDSEEDon x86,RNDRRSon 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
- Pad: a file of random bytes used for messages in one direction only.
- Container: the two pads that two people share, one for messages each sends to the other, plus the bookkeeping for both.
- Vault: a single locked file holding one person's containers. On a drive, the vault sits in the
openxorfolder next to copies of the program. Without a drive, it is a file in a folder of the user's choice.
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:
- the contact's name;
- a random 16-byte container ID;
- the size of each pad;
- next send offset: the first unused byte of the outgoing pad;
- erased ranges of the incoming pad: every byte range that has been read and erased;
- provenance flags: whether every pad byte included a hardware source, and how the other party's copy travelled (in person, by post, or over a network), as declared when the vault was opened.
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.
openxor selftestmeasures how long one unlock takes on the current computer, and warns if it takes longer than 5 seconds or the computer cannot spare the memory.--harderuses 1 GiB of memory and 4 passes, for people who accept slower unlocking in exchange for slower guessing. The settings are recorded in the vault header, so every computer that opens the vault uses them; before making a contact with--harder, both people should runopenxor selftest --harder.
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:
| Field | Size | Contents |
|---|---|---|
| version | 1 | 0x01 |
| flags | 1 | bit 0: content is a file |
| offset | 6 | o, little-endian (pads up to 256 TiB) |
| ciphertext | B | padded plaintext XOR pad[o+32 .. o+32+B) |
| tag | 16 | one-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
- One line, for posts and chat:
oxr:followed by the message in unpadded URL-safe Base64. A 280-character post holds a text message of up to about 170 characters. - Block, for email and longer text:
-----BEGIN OPENXOR MESSAGE-----, Base64 in 64-character lines,-----END OPENXOR MESSAGE-----. - File: the binary message, saved with a neutral name such as
msg-0007.oxr. The original file name travels inside the ciphertext.
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
- The user plugs in two drives (or chooses
--filesto make two vault files). - openxor creates or unlocks the user's own vault, and creates a vault for the contact locked with a new pickup code.
- openxor generates two pads (section 5) and writes them, chunk by chunk, to both vaults. Nothing is written to the computer's own disk.
- openxor reads both vaults back and checks that the pads are identical, then copies the program onto the contact's drive.
- openxor shows the pickup code once.
8.2 Delivering the contact's vault
- In person: hand over the drive; say the pickup code.
- By post or courier: seal the drive in a tamper-evident bag and record its serial number; send the pickup code and serial number by a different route. The recipient checks both before opening and does not use the drive if either is wrong.
- Over a network (for testing, or when the parties accept the risk): send the vault file; send the pickup code by a different route. On first use the recipient declares this, and the container is permanently flagged "travelled over a network: not P = NP-proof".
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
- openxor computes the padded plaintext and
B. - In the vault, it advances the next send offset past
o + 32 + Band writes the updated table (section 6.3). If openxor stops after this step, those bytes are lost, never reused. - It reads the pad bytes, computes the ciphertext and tag, and erases the pad bytes from the vault (section 9).
- It outputs the message.
8.5 Receiving
- 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. - If any byte in
[o, o + 32 + B)is in an erased range, it refuses the message as already read. This also prevents replays. - 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:
- It runs only from an interactive terminal, typed in full; it is not in the menu and not in tab completion.
- It names the drive or file it will wipe.
- The user types three random words shown on screen.
- A three-second countdown runs; any key cancels.
- 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.
- By default it makes two shards and both are required: one is fresh random bytes the same length as the file, the other is the file XOR those bytes. Either alone is uniformly random.
- **
--shards n --required k** makesnshards, anykof which rebuild the file (k-of-n threshold sharing, section 4.3). For example,--shards 3 --required 2gives a spare so that losing one place is not fatal, and--shards 5 --required 3gives five people one shard each.
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
| Layer | Protects | Mechanism | Holds against a fast P = NP method? |
|---|---|---|---|
| Message contents in transit | confidentiality | one-time pad | yes |
| Message integrity in transit | tampering, forgery | one-time MAC | yes |
| Replays | reading a message twice | erased ranges | yes |
| Message length | content size | rounding | partly: rounded length is visible |
| Vault at rest | a stolen or copied drive | Argon2id and AES-256-GCM | no |
| Pickup code in transit | an intercepted drive | Argon2id and AES-256-GCM | no |
| Pad randomness | predictable pads | hardware source XOR OS generator | yes, if the hardware source is truly random |
| Downloads | tampered binaries | signatures | no; rebuilding from source does not depend on them |
| Shards | stored files | threshold secret sharing | yes |
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 agreement | Survives quantum computers | Survives fast P = NP | Needs physical exchange | |
|---|---|---|---|---|
| TLS 1.3 | ECDHE (plus ML-KEM in hybrid modes) | with ML-KEM, yes | no | no |
| Signal | PQXDH and Double Ratchet | yes, against current knowledge | no | no |
| OpenPGP | RSA or ECC | no | no | no |
| WireGuard with a pre-shared key | Noise plus symmetric PSK | yes, with a strong PSK | no | yes, for the PSK |
| Quantum key distribution | quantum channel | yes | yes, if authenticated with a pre-shared key | dedicated hardware and fibre |
| openxor | none; pad delivered physically | yes | yes, for messages in transit | yes |
13. Build and release integrity
- Releases are built by GitHub Actions from a tagged commit, with a pinned Go toolchain,
CGO_ENABLED=0,-trimpathand an empty build ID, so anyone can rebuild them and get byte-identical files. - Each release carries
SHA256SUMSand a signed build-provenance attestation per file, verifiable withgh attestation verify. - The Go module path is
openxor.com. Go's checksum database records every published version. - The website shows file fingerprints written by the release workflow itself, and can check them against GitHub's own record.
Signatures and the checksum database are computational. Rebuilding from source and comparing fingerprints is not.
14. Limits
- The pad must travel physically. That is the point, and the cost.
- One byte of pad per byte sent.
- Metadata is visible: that messages exist, when, their rounded length, and the pad offset.
- Stored pads are only as safe as the drive's physical custody and the password.
- A compromised computer defeats any cipher.
- Erasure on flash storage is not guaranteed.
- openxor is experimental and unaudited.
Open questions
- Robust shards. How should
unscrambledetect 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. - 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?
- 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?
- 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?
- Argon2id parameters. Decided in Draft 0.1.1: fixed settings for every vault, a
selftestwarning on slow computers, and an optional--hardersetting (section 6.4). - 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
- C. E. Shannon. Communication theory of secrecy systems. Bell System Technical Journal 28(4), 1949.
- G. S. Vernam. Cipher printing telegraph systems for secret wire and radio telegraphic communications. Journal of the AIEE 45, 1926.
- M. N. Wegman and J. L. Carter. New hash functions and their use in authentication and set equality. Journal of Computer and System Sciences 22, 1981.
- A. Shamir. How to share a secret. Communications of the ACM 22(11), 1979.
- D. J. Bernstein. The Poly1305-AES message-authentication code. Fast Software Encryption, 2005.
- U. Maurer. Secret key agreement by public discussion from common information. IEEE Transactions on Information Theory 39(3), 1993.
- A. Biryukov, D. Dinu, D. Khovratovich, S. Josefsson. RFC 9106: Argon2 memory-hard function, 2021.
- M. S. Turan et al. NIST SP 800-90B: Recommendation for the entropy sources used for random bit generation, 2018.
- K. Nikitin et al. Reducing metadata leakage from encrypted files and communication with PURBs. Proceedings on Privacy Enhancing Technologies, 2019.
- Electronic Frontier Foundation. Long word list for passphrases, 2016.
Change log
- Draft 0.1.3 · 29 November 2026.
splitandjoinmerged intoscrambleandunscramble, which make shards: two by default, both required, or any number with--shardsand--required(section 10). - Draft 0.1.2 · 29 November 2026. Added
scrambleandunscramble, and why there is no single-file password mode (section 10). - Draft 0.1.1 · 29 November 2026. Argon2id settings decided: fixed for every vault, with a
selftestwarning and an optional--hardersetting (open question 5). Test message for the vectors chosen. - Draft 0.1 · 29 November 2026. First draft.