v0.3 · pure python · zero deps

Split any file
into two halves.

bitsplit turns any file into a binary block and a 128-bit text key. Without the key, the block is useless. Without the block, the key is just a number.

2^128
key space
~20 MB
peak memory · any file size
0×
dependencies
1 shift + 1 OR
to recover the file
how it works

One file in.
One block + one key out.

The file is interpreted as a single large number. The top 128 bits become the key, the rest is saved as a binary block. Recovery is a single bitwise operation.

Step 01 · Read

File → Number

The bytes of any file — JPEG, MP4, ZIP, executable — are interpreted as a single integer.

# number = int.from_bytes(data, "big")
Step 02 · Split

Top 128 bits → key

Slice the top 128 bits off the integer. They're stored as a short text key in key.txt.

key_data = number >> count
Step 03 · Save

Rest → block

Everything below those 128 bits is written as raw bytes to data.bin. Same total size as the original.

indices = number & ((1 << count) - 1)
File (bytes)  →  Number  →  [ data: 128 bits | indices: the rest ]
                                       │                       │
                                    key.txt                data.bin

Recovery:  number = (key_data << count) | indices
           data   = number.to_bytes(size, "big")
install

One pip away.

Pure Python 3.11+, standard library only. No compiled extensions, no platform quirks.

$ pip install bitsplit

Then run bitsplit encode <file> on any file.

~/photos — zsh
$bitsplit encode photo.jpg Block: data.bin (1105407 bytes) Key: key.txt   $cat key.txt 340079864808174098294188674279182237768:8843264:1105424   $bitsplit decode restored.jpg
performance

Two bitwise ops.
No loops, no rounds.

No ciphers means no per-byte processing. bitsplit is competitive with native crypto on small files and pulls ahead on multi-GB inputs.

Benchmarked on Apple M2 with 8 GB RAM. All files restored with identical SHA-256 checksums.

The lower the bar, the faster. bitsplit is highlighted.

Streaming I/O keeps peak memory flat at ~20 MB regardless of file size — even for 5 GB inputs.

Encode · 1 GB file

seconds, lower is better
use cases

Two places.
Two channels.
Two people.

A breach of one half is useless without the other. That's the whole product.

01 · split storage

Cloud + device

Block on the cloud, key on your laptop. Compromising the cloud reveals nothing.

02 · two channels

Messenger + SMS

Send the block one way, the key another. Intercepting one channel is useless.

03 · offline

Drive + paper

Block on an external SSD. Key written on paper in a safe.

04 · ci/cd

Repo + env vars

Commit the block. Store the 102-byte key in environment variables.

05 · two people

You + co-signer

One person holds the key, another holds the block. Both required to restore.

06 · geo-split

Two data centers

Block in one region. Key in another. Single-region failure protects both.

honest disclosure

It's a splitter.
Not a cipher.

bitsplit doesn't pretend to be encryption. Knowing what it is — and isn't — is part of the contract.

⚠ Caution

bitsplit is not encryption

No ciphers. No rounds. No key derivation. If you need a cryptographic standard for compliance or audits, use AES or ChaCha20 via gpg or age.

128-bit key space

Brute-force is infeasible

2128 ≈ 3.4 × 1038. Every computer on Earth at 1018 ops/sec would need ~1013 years. The universe is 1.4 × 1010 years old.

deterministic

Same file → same key

There is no randomness in the process. Same input, same output. This is by design — and worth knowing before you use it.

recommendations

Keep them apart

Keep key.txt private. Anyone with both halves can restore the file. Store key and block separately — that's the entire point.