Swapping Bytes with dd
I was reading in the man
page for dd
and found that some of the conversion options for it are kind of fun. One of these options, the swab conversion, swaps every two bytes of the input file and sticks them in the output file. The resulting file is usually not readable (if it is a binary) and pretty obfuscated if it is text. The usage is like this:
dd if=(input file) of=(output file) conv=swab
Since all we are doing is swapping bytes, we can actually run that command on the output file to get the input file. I wrote a script that will toggle the swap on files you put into it. It’s pretty fun, and is a quick way of making legitimate files appear corrupted or broken to curious eyes.
You can download the script here.