I have seen on this site that many Linux users encrypt the swap partition. What are the benefits of encrypting swap?
I have seen on this site that many Linux users encrypt the swap partition. What are the benefits of encrypting swap?
Encryption of swap space is used to protect sensitive information. Consider an application that deals with passwords. As long as these passwords stay in physical memory, these passwords will not be written to disk and be cleared after a reboot. If the OS starts swapping out memory pages to free space for other applications, the passwords may be written to the disk platters unencrypted. Encrypting swap space can be a solution for this scenario.
Swap partitions are not encrypted by default and should be cleared of any sensitive data before continuing.
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.
To encrypt SWAP, see Encrypted swap partition on Ubuntu
Extra Reading:Swap encryption, and Ubuntu - How to encrypt swap partition
Source:C. Brüffer