experimentalin development

openxor is an open-source command-line toolkit and Go library for information-theoretically secure cryptography. It implements one-time pad encryption with one-time message authentication for messages and files, and threshold secret sharing for storage. None of these rely on a computational hardness assumption. Their security is proven mathematically rather than assumed, so it holds against quantum computers, new cryptanalysis or a proof that P = NP, provided the pads are truly random, never reused and kept secret.

The trade-off is key distribution. Before two parties can communicate, the pad has to travel physically on a removable drive: handed over in person, or posted or couriered in a tamper-evident bag. After that, only the scrambled messages and files travel over the network; the pad itself never does. Every byte sent uses up one byte of the pad, so a new drive has to be handed over or posted when it runs out.

openxor is experimental and has not been independently audited. It is not a replacement for TLS, Signal or PGP in everyday use.

Features
  • —One-time pad encryption of text and files. Each pad byte is used once, then erased.
  • —One-time polynomial MACs (Wegman–Carter, mod 2¹²⁷ − 1) to detect any change in transit.
  • —Pads generated from hardware randomness. Every pad byte passes the NIST SP 800-90B health tests, and openxor selftest checks this computer's randomness, the published test results and how long unlocking takes.
  • —Offline key exchange on USB sticks, SSDs, hard drives and SD cards. Each drive is password-locked (Argon2id, AES-256).
  • —Files kept for yourself: openxor scramble turns a file into shards kept in different places: two by default, both required, or any number with --shards and --required.
  • —One static binary for macOS, Windows and Linux. No network code, no accounts, no telemetry.
  • —Reproducible builds with signed build provenance.
  • —Go packages for use in other programs.
Why it exists

Almost all security online rests on the assumption that certain maths problems are too hard to solve. Nobody has proven that assumption, and most researchers expect it to hold. Whether P equals NP is the best-known open question about it.

If it turned out that P = NP, and a fast method came with the proof, the consequences would arrive all at once. HTTPS, VPNs, messaging apps, software update signatures and password vaults would stop being trustworthy, along with any traffic recorded in the years before. Nothing new could be set up securely online either, because the setup itself would run over the broken systems. You couldn't trust anything you received over the internet.

That is why openxor has to exist before it is needed. A one-time pad depends on bytes two people already share. Anyone who starts looking for a safe way to share them after public-key encryption has failed will find there isn't one left online.

This is preparation, not a prediction. P = NP may never be proven, and a proof may never come with a method fast enough to matter. If that's how it turns out, openxor will have cost a drive and an afternoon, and that is a good outcome too.

Use cases
  • —People who see each other now and then. Colleagues, family members, a lawyer and a client: set up once when you meet, then exchange messages and files over any channel for years.
  • —Someone far away. Make both drives yourself and post or courier one in a tamper-evident bag. Send the pickup code separately, for example in a phone call. Nobody has to travel.
  • —Files that must stay private for decades. Contracts, medical or legal records, source material: anything someone could record today and try to read in ten or twenty years.
  • —A channel prepared in advance. If public-key encryption ever fails, people who already hold pads can keep communicating. See why it exists.
  • —Files you keep yourself. Scramble a recovery phrase, a password manager export or a signing key into shards kept in different places, with openxor scramble.
The pad

A one-time pad is a big file of random bytes that only you and one other person have. To send, openxor combines each byte of your message with the next unused pad byte (XOR). openxor then erases those pad bytes from your drive. You send the scrambled result any way you like. Your contact's openxor does the same combining with the same bytes from their copy, which turns it back into your message, and erases those bytes from their drive. After that the bytes exist nowhere, so they can never be used again.

Example
pad jamie → samoffset 0x0000128 B left
message
pad
sent ⊕
 

Every message is rounded up to 16 bytes, so its length gives less away. A real pad is gigabytes, not 128 bytes.

How it works
01GENERATEPlug two drives into your computer: USB sticks, SSDs, SD cards, anything. openxor saves the same pad, a big file of random bytes, on both. 02GIVEHand one drive to your contact in person, or post it in a tamper-evident bag. The pickup code goes separately: said out loud or in a phone call, never in the same parcel. 03SENDType a message and get one line of scrambled text. Post it anywhere, even publicly. The pad bytes it used are already erased. 04READYour contact pastes the line into openxor and reads it. Their copy of those bytes is erased too. 05RENEWWhen the pad runs low, generate a new pair of vaults and hand over or post one again. openxor tells you how much is left.

Example
$ openxor
openxor 0.1.0 · drive KINGSTON 32GB unlocked

  contacts
  1  sam     ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░  97% left
  2  alex    ▓▓▓▓▓▓▓▓▓▓░░░░░░░░░░  51% left

  1  send a message
  2  read a message
  3  generate a pair of vaults
  4  status
  q  quit

choose 1–4 › █
Commands
openxorinteractive menu; start here
openxor generategenerate a pair of vaults with matching pads: yours and your contact's
openxor sendscramble a message or file for a contact
openxor receivecheck, unscramble, then wipe those pad bytes
openxor statushow much pad is left for each contact
openxor selftestcheck that openxor works on this computer: the published results, vaults and erasing, the randomness, and how long unlocking takes
openxor scrambleturn a file into shards: two by default, both required
openxor unscramblerebuild a file from enough of its shards
openxor forgetwipe a contact's pads for good
What survives P = NP

Today's encryption is a bet that some maths problems are too hard to solve. A fast P = NP algorithm would win that bet for the attacker, including on traffic recorded years earlier.

todayfast P = NP
HTTPS / TLSsafereadable
VPNssafereadable
Signal, PGPsafereadable
password vaultssafecracked
openxorsafesafe
Limits
  • —The pad has to travel physically, in person or by post. That is the whole point, and the whole cost.
  • —One byte of pad per byte sent. A gigabyte covers years of text, or one gigabyte-sized file.
  • —It hides what you say, not that you're talking or when.
  • —If someone steals your drive, they can read unread and future messages once they have your password, or without it if a fast P = NP method ever exists. Messages you've already read stay safe, because their pad bytes are erased. More on this.
  • —Flash memory can keep stray copies of wiped data. Destroy old drives physically.
  • —Malware on your computer beats any cipher. Use a machine you trust.
Download

No release yet. Files and their fingerprints appear here automatically when the first release is built.

    
        

    With Go installed, you can also build it yourself: go install openxor.com/cmd/openxor@latest

    A fingerprint on the same page as the download only proves the file arrived intact. What stops a tampered release is checks 2 and 3: a public signature tying each file to a public build of the public source, and the option to rebuild it yourself and get the identical file.

    Verify on your computer
    # 1. the file matches the fingerprint above
    $ shasum -a 256 openxor-0.1.0-darwin-arm64
      windows: certutil -hashfile openxor-0.1.0-windows-amd64.exe SHA256
    
    # 2. GitHub Actions built it from this repo (signed, publicly logged)
    $ gh attestation verify openxor-0.1.0-darwin-arm64 --repo orlyjamie/openxor
    
    # 3. or rebuild it yourself and compare fingerprints
    $ git clone https://github.com/orlyjamie/openxor && cd openxor
    $ git checkout v0.1.0 && make reproduce
    About

    openxor is an experimental personal project by Jamieson O'Reilly, open source under the Apache License 2.0. It has not been independently audited. Until it has been, don't rely on it where a mistake could put someone in danger.

    This page loads nothing from anywhere else unless you press “check these against GitHub”. openxor itself never touches the network.

    The openxor logo is set in Future Earth by V. Sarela, licensed under CC BY-ND 3.0. It is not covered by the Apache License.