Nested Full disk encryption guide (Arch Linux)
Disclamer: This is intended to be used as a reference side by side with the arch linux installation guide on the wiki
Recognized benefits:
[*] Encryption Redundancy
[*] Multiple keys must be entered to decrypt a single partition
[*] Decreased chance of data recovery via cold boot attacks # aka 3 is more difficiult to recover than 1
[*] Decreased chance of shoulder surfing
-
Run "fdisk -l" and identify what partiton you want to encrypt, for me it was /dev/sda3 because I'm going to have an nested encrypted LVM setup
-
encrypt the initial partition:
cryptsetup luksFormat -s 512 -h sha512 -c aes-xts-plain64 /dev/sda3
- open the encrypted partition
cryptsetup open /dev/sda3 crypta
- encrypt the unencrypted version of the encrypted partition (nesting)
cryptsetup luksFormat -s 512 -h sha512 -c serpent-xts-plain64 /dev/mapper/crypta
- open the encrypted parititon /dev/mapper/crypta
cryptsetup open /dev/mapper/crypta cryptb
- encrypt the unencrypted partiton (cryptb)
crypsetup luksFormat -s 512 -h sha512 -c twohfish-xts-plain64 luksFormat /dev/mapper/cryptb
- open the encrypted parition /dev/mapper/cryptb
cryptsetup open /dev/mapper/cryptb cryptc
- now you can do what I did if you want which is to create an lvm inside the nested encryption like so
pvcreate /dev/mapper/cryptc # make it a physical volume
vgcreate VolGroup /dev/mapper/cryptc # create volume group
- Create all the logical volumes
lvcreate -L 10G VolGroup -n tmp
lvcreate -L 15G VolGroup -n root
lvcreate -L 50G VolGroup -n usr
lvcreate -L 25G VolGroup -n var
lvcreate -L 16G VolGroup -n swap
lvcreate -L 25G VolGroup -n home
lvcreate -l 100%FREE VolGroup -n data
- format the logical volumes with filesystems
mkfs.ext4 /dev/mapper/VolGroup-root
mkfs.ext4 /dev/mapper/VolGroup-home
etc....
-
mount the logical volumes, install the base packages, and chroot into the new systems root directory
-
Create multiple encrypt hooks
-
edit /etc/mkinitcpio.conf and add "encrypt encrypt2 encrypt3" to the HOOKS=(... Line
-
Generate the new kernel image with "mkinitcpio -p <kernel package" for me its "mkinitcpio -p linux-hardened"
edit "/etc/default/grub" and add the following to the "GRUB_CMDLINE_LINUX="" line so it looks like this:
GRUB_CMDLINE_LINUX="cryptdevice=/dev/sda3:crypta cryptdevice2=/dev/mapper/crypta:cryptb cryptdevice3=/dev/mapper/cryptb:cryptc"
- Generate the grub configuration file with "grub-mkconfig -o /boot/grub/grub.cfg"