DM (Device-mapper) is an infrastructure hosted in the core of Linux environments since versions 2.6 and 3.x which provides a generic way to create virtual layers of block devices of the data hosted there.
Dm-crypt (Device-mapper crypt) has been developed with the aim of offering transparent encryption of block devices using the crypto API kernel.
By using this command, as users we can specify a symmetric encryption, an encryption mode, a key (of any size, and later it will be possible to create a new block device in the root / dev..
All data stored in this route will be encrypted and the only possible way to read them will be deciphering your password, otherwise we will not have access to them.
We can mount this file system in a traditional way or stack the dm-crypt device with any other device such as RAID or LVM volumes.
To enable dm-crypt support, it will be necessary to enable CONFIG_DM_CRYPT on the device to use.
Something important to keep in mind is that most current Linux distributions have dm-crypt included by default in their system.
To configure it we must use the following user space components:
Device Mapper Library (part of the LVM2 package)
Cryptsetup.
All these packages are already included in the repository of the distribution to use.