Editing Mounting HDD on PC
Jump to navigation
Jump to search
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 1: | Line 1: | ||
=Introduction= | =Introduction= | ||
Line 7: | Line 6: | ||
=ATA and ENCDEC Keys= | =ATA and ENCDEC Keys= | ||
See http://www.ps3devwiki.com/wiki/HDD_Encryption | |||
=Device Mapper= | =Device Mapper= | ||
Line 28: | Line 27: | ||
modprobe loop | modprobe loop | ||
modprobe dm_mod | modprobe dm_mod | ||
modprobe dm-bswap16 | modprobe dm-bswap16.ko | ||
dd if=/dev/zero of=test.bin bs=1K count=100 | dd if=/dev/zero of=test.bin bs=1K count=100 | ||
Line 112: | Line 111: | ||
</pre> | </pre> | ||
==dm- | ==dm-crypto== | ||
* We don't need xts_aes application anymore. | * We don't need xts_aes application anymore. | ||
Line 121: | Line 120: | ||
===HDD Test=== | ===HDD Test=== | ||
* Tested on PS3 | * Tested on PS3 istelf with Debian LiveCD and Linux kernel version 3.4.10 but you can use the same technique on a Linux PC. I was just lazy and it is easier to test on PS3. | ||
<pre> | <pre> | ||
Line 228: | Line 227: | ||
echo "0 8 linear /dev/mapper/hdd_crypt 8" | dmsetup create vflash | echo "0 8 linear /dev/mapper/hdd_crypt 8" | dmsetup create vflash | ||
# create | # create hdd key file | ||
echo <your encdec | echo <your encdec key as hex string> <your encdec tweak key as hex string> | xxd -r -p > hdd_key.bin | ||
ls -l vflash_key.bin | ls -l vflash_key.bin | ||
Line 237: | Line 236: | ||
# create DM crypto target | # create DM crypto target | ||
# key size is 256bit because PS3 uses XTS-AES-128 and the key is just the concatenation of the data and tweak keys. | # key size is 256bit because PS3 uses XTS-AES-128 and the key is just the concatenation of the data and tweak keys. | ||
cryptsetup create -c aes-xts-plain64 -d ./vflash_key.bin -s 256 | cryptsetup create -c aes-xts-plain64 -d ./vflash_key.bin -s 256 vflash_crypt /dev/mapper/vflash | ||
ls -l /dev/mapper/ | ls -l /dev/mapper/ | ||
Line 248: | Line 246: | ||
lrwxrwxrwx 1 root root 7 Sep 4 11:07 vflash -> ../dm-2 | lrwxrwxrwx 1 root root 7 Sep 4 11:07 vflash -> ../dm-2 | ||
lrwxrwxrwx 1 root root 7 Sep 4 11:10 vflash_crypt -> ../dm-3 | lrwxrwxrwx 1 root root 7 Sep 4 11:10 vflash_crypt -> ../dm-3 | ||
</pre> | </pre> | ||
Line 296: | Line 255: | ||
* A new Linux kernel patch is necessary. | * A new Linux kernel patch is necessary. | ||
* PS3 partition table is of size 0x1000 bytes. | * PS3 partition table is of size 0x1000 bytes. | ||
=Links= | =Links= | ||
Line 593: | Line 263: | ||
* http://www.hopelesscase.com/linuxnotes/encrypted_filesystems/dmsetup_losetup_and_mount | * http://www.hopelesscase.com/linuxnotes/encrypted_filesystems/dmsetup_losetup_and_mount | ||
* http://lxr.free-electrons.com/source/block/partitions/ | * http://lxr.free-electrons.com/source/block/partitions/ | ||