This page describes how to create an encrypted container on a Linux system using LUKS.
*This is not the same as on-the-fly encryption
The only software required for this process is cryptsetup. It can be installed with apt:
apt install cryptsetup
All the following commands should be run as root
fallocate -l 25G /enc
Change the size of the file as necessary. This will determine the available drive space when mounted.
cryptsetup luksFormat /enc
Follow the prompts in the command line - including the passphrase to unlock the container.
cryptsetup luksOpen /enc enc
mkfs.ext4 /dev/mapper/enc
Once the container has been setup, the root user can mount it with the following commands.
cryptsetup luksOpen /enc enc
You will be prompted for the passphrase used when creating the volume.
mount /dev/mapper/enc /data
// the end