The Linux File System Encryption API
System Preparation
For the users whose Linux system using the original Linux kernel before the version 2.4.22, it is not possible to encrypt a file on the local file system, or the local file system, or a hard disk, or even the Swap of the Linux system. So, it needs to make a patch to their Linux kernel to add this encryption function to the Linux kernel. For the Linux kernel version 2.4, it is need to do the following work:
- The Linux kernel source 2.4.22
- The "Cryptoloop" patch to the Linux system (two options: patch-cryptoloop-jari-2.4.22.0, or patch-cryptoloop-hvr-2.4.22.0)
Notes: the first patch "patch-cryptoloop-jari-2.4.22.0" has a lot of important improvements but it does not support to encrypt the Swap. For the second patch "patch-cryptoloop-hvr-2.4.22.0" can offer the ability of the minimum changes between the encryption and the de-encryption. Here we recommend using the second patch because it can calculate the right size of the disk volume.
For the Linux kernel version 2.6, it is stable and it originally supports the Cryptographic API, the Cryptoloop device and the IPSec, so, no need to patch any more.
But in the mean time, we have to make sure that the required components are in the right versions to be able to work together with the Cryptoloop and Cryptoapi version: check if your Linux system is installed the util-linux2.12 (to check: #mount -V).
If your Linux system does not have the util-linux2.12, you need to download the source code of util-linux2.12 and install it to the system. (This is the version offering minimum support to CryptoAPI and in the same time supports the new version of the loop device in the Linux kernel version 2.6.)