nbdkit-xor-filter(1)

πŸ“¦
version 1.48.1 Β· 2 versions
, in fedora 44

πŸ’– nbdkit-xor-filter β€” obfuscate contents of a plugin with XOR πŸ’–

okay bestie, sit DOWN, because we're talking about nbdkit-xor-filter(1), part of the nbdkit manual. this little cutie is a filter that scrambles your plugin's data with XOR and honestly? it's giving ✨masked✨.


🌈 NAME 🌈

nbdkit-xor-filter β€” obfuscate contents of a plugin with XOR πŸŽ€


✨ SYNOPSIS ✨

nbdkit --filter=xor [PLUGIN ARGS ...] xor=VALUE xorlen=LENBYTES

nbdkit --filter=xor [PLUGIN ARGS ...] xor=rand[:SEED]

πŸ’… DESCRIPTION πŸ’…

nbdkit-xor-filter is a filter for nbdkit(1) and what it does is XOR (that's exclusive or, the iconic bitwise bestie) a value across all of the data in the underlying plugin. so every single byte gets the treatment. no cap.

what's it for? two things, lowkey:

  • obfuscating the contents of a plugin πŸ™ˆ
  • being a trivial, insecure, but fast type of encryption
and if you want proper encryption, do NOT come to this filter's party β€” go see nbdkit-luks-filter(1) instead, she's the real one πŸ‘‘

this filter has two modes, and you gotta pick one:

mode 1: fixed repeating pattern β€” you XOR with a value that repeats over and over:

nbdkit file disk.img --filter=xor xor=0xDEADBEEF xorlen=4

mode 2: PRNG vibes β€” you XOR with the output of a pseudo-random number generator (PRNG), and you can optionally hand it a seed, using xor=rand[:SEED]. the result is more obfuscated πŸ’€ and in this mode, xorlen is just... not used. she's off duty.

nbdkit file disk.img --filter=xor xor=rand:1984
🚨 okay important thing, this filter does not currently support sparse plugins. trim operations will fill the backing plugin with XORed zeroes β€” which makes it super easy to read out the "key". that's yet another reason this is not secure, bestie. it's giving open diary πŸ“–

πŸŽ€ PARAMETERS πŸŽ€

  • xor=VALUE β€” the value that gets XORed with the underlying data. it's either truncated or extended to xorlen bytes, whatever it needs to be. usually you wanna write this in hex using the 0x prefix, that's the move πŸ’…

the value is big endian. for example, xor=0x123456 xorlen=3 will XOR bytes like this:

 data:     A0 A1 A2 A3 A4 A5 A6
 XOR with: 12 34 56 12 34 56 12
           ────────────────────
 result:   B2 95 F4 B1 90 F3 B4

look at that alignment. ate. πŸ”₯

  • xor=rand
  • xor=rand:SEED β€” XOR the underlying data with the output of a pseudo-random number generator (PRNG). optionally you can give it a seed for the PRNG (and if you don't, the seed is 0, default behaviour, she's chill like that).
the xor parameter is required. no xor, no service πŸ™…β€β™€οΈ
  • xorlen=LENBYTES β€” the length of the XOR value, in bytes. any length from 1 to 8 is supported, so that's your range, don't get creative 🌸

this parameter is required when you're using xor=VALUE, and it should not be set for xor=rand. two different girls, two different rules, iykyk.


πŸ¦‹ FILES πŸ¦‹

  • $filterdir/nbdkit-xor-filter.so β€” the filter itself. the main character file πŸ‘‘

use nbdkit --dump-config to find the location of $filterdir. that's how you find her house 🏠


⭐ VERSION ⭐

nbdkit-xor-filter first appeared in nbdkit 1.48. a legend was born ✨


🌸 SEE ALSO 🌸

nbdkit(1), nbdkit-file-plugin(1), nbdkit-luks-filter(1), nbdkit-map-filter(1), nbdkit-pattern-plugin(1), nbdkit-random-plugin(1), nbdkit-swab-filter(1), nbdkit-filter(3), nbdkit_parse_uint64_t(3).

go read them, bestie, they're all part of the family 🫢


πŸ’œ AUTHORS πŸ’œ

Richard W.M. Jones β€” the icon, the moment, the whole entire vibe πŸ’–


Copyright Red Hat


πŸ‘‘ LICENSE πŸ‘‘

redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  • Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  • Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  • Neither the name of Red Hat nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY RED HAT AND CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RED HAT OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

and that's the whole page, periodt πŸ’… mwah! this was nbdkit 1.48.1, dated 2026-08-29, for the nbdkit-xor-filter(1) manual. stay obfuscated, stay unbothered, and remember: XOR is not encryption, she's just a vibe πŸŽ€πŸ’–βœ¨

πŸ“¦ where this page comes from