What if you could take any file β a photo, a database dump, a movie β and split it into two parts where neither part is useful on its own? Not encryption. Not compression. Just a clean cut.
That's bitsplit . It's pure Python, zero dependencies, and the entire restore operation is a single line:
restored = ( data << count ) | indices
Enter fullscreen mode
Exit fullscreen mode
The idea
Treat the whole file as one giant integer. Slice the top 128 bits off the front. Those 128 bits become your key (a short text string). Everything else becomes your block (a binary file).
File (bytes) --> Number --> [ data: 128 bits | indices: the rest ] | | key file data file
Enter fullscreen mode
Exit fullscreen mode
To restore: shift the key left, OR with the block, write bytes. Done.
photo.jpg --> data.bin + key.txt 1.05 MB 1.05 MB 102 B
Enter fullscreen mode
Exit fullscreen mode
Why does this work? Because the 128 missing bits sit at the most significant positions of the number.β¦