I am installing Debian and would like to set up the
/swap partition as encrypted.
I am able to select either encrypted physical device or as
swap/swap. Are there any methods to create an encrypted
The swap partition can hold a lot of unencrypted confidential information and the fact that it persists after shutting down the computer can be a problem.
Encrypting a swap partition however is slightly tricky if one wants to also support suspend-to-disk (also called hibernation).:
0- Install the cryptsetup package:
1- Setup the encrypted partition as root:
2- Add this line to /etc/crypttab:
3- Set the swap partition to be this in /etc/fstab:
4- Configure uswsusp to use /dev/mapper/cswap and write unencrypted data
You will of course want to replace /dev/hda2 with the partition that currently holds your unencrypted swap.