Scramble & Unscramble Files with ScrambleNinja!

Here’s ScrambleNinja, a tool that can scramble any file by rearranging the bytes it consists of—rendering it unreadable; and also unscramble any scrambled file (only if it was scrambled using this tool in the first place) by restoring the arrangement of bytes to be as the original, unscrambled file.

Example execution of ScrambleNinja.

File types tested so far & confirmed as fully supported

  • .EXE
  • .FLAC
  • .JPEG / .JPG
  • .MKV
  • .MOV
  • .MP3
  • .MP4
  • .PDF
  • .PNG
  • .RAR
  • .WAV
  • .ZIP

You may test other file extensions/types and report them as supported/unsupported to update this list in the future.

File types not optimally supported / not recommended to scramble (yet)

Microsoft Office files (.docx, .xlsx, etc.)

The tool successfully scrambles these files, but once they are unscrambled, Microsoft Excel/Word would see them as “corrupted or damaged”. However, Microsoft will also then ask if you would like to “fix” the contents of this unscrambled file, and upon choosing to do so, will be able to read the file as normal.

This happens due to the byte-scrambling approach implemented in this tool. When the byte lines are scrambled, a pesky little “end-of-line / carriage-return” byte combination is left at the very end of the bytes list, which Microsoft Office applications apparently are quite strict about. When you choose to let Microsoft “fix” this, that final combination is simply removed by Microsoft. Hence, technically, the scrambling and unscrambling work as ultimately intended; but the mechanism is just—for lack of a better word—a little “janky”.

Plain text files

Since this tool rearranges the lines of bytes in a file in order to scramble it, only the line arrangement of the plain text will be scrambled. This may impact the human readability of the file by throwing a wrench in the typical sequential reading process, but the overall context may somewhat still be intelligible even if completely unordered.

For example, a .TXT file with the following lines:

Line #Line Text
1It was all a dream, I used to read Word Up! magazine
2Salt-n-Pepa and Heavy D up in the limousine
3Hangin’ pictures on my wall
4Every Saturday Rap Attack, Mr. Magic, Marley Marl
5I let my tape rock ’til my tape popped
6Smokin’ weed in Bambu, sippin’ on Private Stock

… upon scrambling, becomes:

Line #Line Text
3Hangin’ pictures on my wall
2Salt-n-Pepa and Heavy D up in the limousine
1It was all a dream, I used to read Word Up! magazine
6Smokin’ weed in Bambu, sippin’ on Private Stock
5I let my tape rock ’til my tape popped
4Every Saturday Rap Attack, Mr. Magic, Marley Marl

Hence, it is not recommended to use this tool to scramble plain text files if your usage scenario is serious and/or your priority is confidentiality.

Note

ScrambleNinja is currently RAM-intensive (due to holding the bytes-to-scramble within a list). Hence, please ensure your system uses the 64-bit architecture and your Python installation is 64-bit as well for optimal performance. If either of these two criteria is not matched, ScrambleNinja may not work for file sizes upwards of ~2GBs since the 32-bit architecture and/or 32-bit installation Python will only allow 4GBs of RAM to be utilized no matter how many sticks you have installed (You will get “MemoryError” in the ScrambleNinja window if it fails).

You can read more about why 32-bit systems are limited to 4GBs of RAM utilization here.

1 comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.