0

It looks like losetup with cryptoloop did it and there was a dm-xor module for a very old kernel, but can't find anything modern. I'm wading through a ton of obsolete losetup documents.

Something like this:

cryptsetup open --key-file /dev/disk/by-label/randomdatadisk --type plain --cipher xor /dev/disk/by-label/encrypteddisk decrypted

There must be a way to do this, can anyone point me in the right direction?

  • You might be thinking of one-time passwords. One-time pads for disk encryption would essentially take a write disk and a random disk. Data would be XORed with the random disk before writing and the after reading it would be XORed with the random disk again. – Pedro Sep 19 at 23:20
  • You can kind of build an xor disk with mdadm but I would not use this for crypto. Not to mention all that storage space to hold an entire disk worth of random data - what is the point when you can just leave that to a regular cipher? – frostschutz Sep 19 at 23:46
  • The future proofing is the only reason. The XOR from mdadm isn't direct, it includes all kinds of headers and junk. Assuming a direct XOR I could manually XOR it back in the future even if mdadm standards change. – Pedro Sep 19 at 23:51
  • @Pedro apologies. I misread. – Philip Couling Sep 20 at 9:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.