andlabs / reallymine

WD MyBook encrypted hard drive decryption (still WIP).
https://github.com/andlabs/reallymine/issues/38
GNU General Public License v3.0
216 stars 48 forks source link

Is WD My Book encryption secure? #133

Open colortrekninja opened 2 years ago

colortrekninja commented 2 years ago

Hi,

I am trying to figure out if I can trust the encryption what WD provides with their drives.

Here is what I've found so far:

What I have not been able to find is any information on recent drives. My disks are from 2021/22 and use the JMS579 chip, for which I can't even find a datasheet (seems to be a WD exclusive, maybe?).

Which leaves me with the following questions:

Basically, I'm trying to decide whether I can truly trust the hardware encryption of these drives to keep my data safe, if I make sure that I provide it with unguessable key material (if that is even possible, e.g. can I provide a custom DEK (or at least custom entropy for it) to drives that only do FullDiskEncryption?). Would you, for example, be comfortable storing the private key to a BitCoin wallet containing millions of dollars onto this drive without feeling the need to then also make sure no-one ever gets their hands on this drive?

Thank you for your help and I love the work you're doing!

themaddoctor commented 2 years ago

The SymWave and JMS538S (and all the others) encrypt in ECB mode, so any identical 16-byte blocks of data are encrypted to identical 16-byte blocks. That's a big weakness. (SymWave has the option of XTS mode, but I think that decision is made at the factory.)

The JMS538S is only "safe" from easily guessing the DEK if the user changes it.

The PLX OXUF943 chip writes a backup keyblock to the disk, and does not overwrite it unless the user changes the password TWICE.

I have no knowledge of the JMS579.

To answer your actual question, I would not trust WD encryption to protect anything of value. I base this opinion on their past performance. I would, and do, use full-disk encryption through the linux utility "cryptsetup", which makes the encryption transparent to the OS while the disk is open, through a filter in the kernel, but everything on the device is encrypted. It uses CBC mode by default, not ECB, and has some choices of cipher (AES, SERPENT, Twofish, ...). I also use a KDF (key derivation function) and long passwords and salt.