Dm-crypt

Last updated

dm-crypt is a transparent block device encryption subsystem in Linux kernel versions 2.6 and later and in DragonFly BSD. It is part of the device mapper (dm) infrastructure, and uses cryptographic routines from the kernel's Crypto API. Unlike its predecessor cryptoloop, dm-crypt was designed to support advanced modes of operation, such as XTS, LRW and ESSIV, in order to avoid watermarking attacks. [1] In addition to that, dm-crypt addresses some reliability problems of cryptoloop. [2]

Contents

dm-crypt is implemented as a device mapper target and may be stacked on top of other device mapper transformations. It can thus encrypt whole disks (including removable media), partitions, software RAID volumes, logical volumes, as well as files. It appears as a block device, which can be used to back file systems, swap or as an LVM physical volume.

Some Linux distributions support the use of dm-crypt on the root file system. These distributions use initrd to prompt the user to enter a passphrase at the console, or insert a smart card prior to the normal boot process. [3]

Frontends

The dm-crypt device mapper target resides entirely in kernel space, and is only concerned with encryption of the block device   it does not interpret any data itself. It relies on user space front-ends to create and activate encrypted volumes, and manage authentication. At least two frontends are currently available: cryptsetup and cryptmount.

cryptsetup

cryptsetup
Original author(s) Jana Saout, Clemens Fruhwirth, Milan Broz [4]
Stable release
2.6.1 [5] / 9 February 2023;12 months ago (2023-02-09) [5]
Preview release
2.7.0-rc1 [5] / 21 December 2023;2 months ago (2023-12-21) [5]
Written in C
Operating system Unix-like
Platform x86, x86-64, ARMv8, ARMv7, ppc64le, MIPS
Size 7 MB
Available in16 languages [6]
List of languages
English, Portuguese, Chinese (Simplified), Czech, Danish, Dutch, Finnish, French, German, Italian, Japanese, Polish, Russian, Spanish, Swedish, Ukrainian
Type Disk encryption software
License GPLv2 [7]
Sub-Libraries:
LGPLv2.1+ [8]
Website gitlab.com/cryptsetup/cryptsetup

The cryptsetup command-line interface, by default, does not write any headers to the encrypted volume, and hence only provides the bare essentials: encryption settings have to be provided every time the disk is mounted (although usually employed with automated scripts), and only one key can be used per volume; the symmetric encryption key is directly derived from the supplied passphrase.

Because it lacks a "salt", using cryptsetup is less secure in this mode than is the case with Linux Unified Key Setup (LUKS). [9] However, the simplicity of cryptsetup makes it useful when combined with third-party software, for example, with smart card authentication.

cryptsetup also provides commands to deal with the LUKS on-disk format. This format provides additional features such as key management and key stretching (using PBKDF2), and remembers encrypted volume configuration across reboots. [3] [10]

cryptmount

The cryptmount interface is an alternative to the "cryptsetup" tool that allows any user to mount and unmount a dm-crypt file system when needed, without needing superuser privileges after the device has been configured by a superuser.

Features

The fact that disk encryption (volume encryption) software like dm-crypt only deals with transparent encryption of abstract block devices gives it a lot of flexibility. This means that it can be used for encrypting any disk-backed file systems supported by the operating system, as well as swap space; write barriers implemented by file systems are preserved. [11] [12] Encrypted volumes can be stored on disk partitions, logical volumes, whole disks as well as file-backed disk images (through the use of loop devices with the losetup utility). dm-crypt can also be configured to encrypt RAID volumes and LVM physical volumes.

dm-crypt can also be configured to provide pre-boot authentication through an initrd, thus encrypting all the data on a computer  except the bootloader, the kernel and the initrd image itself. [3]

When using the cipher block chaining mode of operation with predictable initialization vectors as other disk encryption software, the disk is vulnerable to watermarking attacks. This means that an attacker is able to detect the presence of specially crafted data on the disk. To address this problem in its predecessors, dm-crypt included provisions for more elaborate, disk encryption-specific modes of operation. [1] Support for ESSIV (encrypted salt-sector initialization vector) was introduced in Linux kernel version 2.6.10, LRW in 2.6.20 and XTS in 2.6.24.

The Linux Crypto API includes support for most popular block ciphers and hash functions, which are all usable with dm-crypt.

Crypted FS support include LUKS volumes, loop-AES and since Linux kernel 3.13, the TrueCrypt target called "tcw". [13] [14] [15]

Compatibility

dm-crypt and LUKS encrypted disks can be accessed and used under MS Windows using the now defunct FreeOTFE (formerly DoxBox, LibreCrypt), provided that the filesystem used is supported by Windows (e.g. FAT/FAT32/NTFS). Encrypted ext2 and ext3 filesystems are supported by using Ext2Fsd or so-called "Ext2 Installable File System for Windows"; [16] FreeOTFE also supports them.

Cryptsetup/LUKS and the required infrastructure have also been implemented on the DragonFly BSD operating system. [17]

See also

Related Research Articles

ext2, or second extended file system, is a file system for the Linux kernel. It was initially designed by French software developer Rémy Card as a replacement for the extended file system (ext). Having been designed according to the same principles as the Berkeley Fast File System from BSD, it was the first commercial-grade filesystem for Linux.

ext3, or third extended filesystem, is a journaled file system that is commonly used by the Linux kernel. It used to be the default file system for many popular Linux distributions. Stephen Tweedie first revealed that he was working on extending ext2 in Journaling the Linux ext2fs Filesystem in a 1998 paper, and later in a February 1999 kernel mailing list posting. The filesystem was merged with the mainline Linux kernel in November 2001 from 2.4.15 onward. Its main advantage over ext2 is journaling, which improves reliability and eliminates the need to check the file system after an unclean shutdown. Its successor is ext4.

<span class="mw-page-title-main">TrueCrypt</span> Discontinued source-available disk encryption utility

TrueCrypt is a discontinued source-available freeware utility used for on-the-fly encryption (OTFE). It can create a virtual encrypted disk within a file, or encrypt a partition or the whole storage device.

In cryptography and steganography, plausibly deniable encryption describes encryption techniques where the existence of an encrypted file or message is deniable in the sense that an adversary cannot prove that the plaintext data exists.

Disk encryption software is computer security software that protects the confidentiality of data stored on computer media by using disk encryption.

The device mapper is a framework provided by the Linux kernel for mapping physical block devices onto higher-level virtual block devices. It forms the foundation of the logical volume manager (LVM), software RAIDs and dm-crypt disk encryption, and offers additional features such as file system snapshots.

In Linux systems, initrd is a scheme for loading a temporary root file system into memory, to be used as part of the Linux startup process. initrd and initramfs refer to two different methods of achieving this. Both are commonly used to make preparations before the real root file system can be mounted.

Disk encryption is a special case of data at rest protection when the storage medium is a sector-addressable device. This article presents cryptographic aspects of the problem. For an overview, see disk encryption. For discussion of different software packages and hardware devices devoted to this problem, see disk encryption software and disk encryption hardware.

EncFS is a Free (LGPL) FUSE-based cryptographic filesystem. It transparently encrypts files, using an arbitrary directory as storage for the encrypted files.

<span class="mw-page-title-main">FreeOTFE</span> Disk encryption software application

FreeOTFE is a discontinued open source computer program for on-the-fly disk encryption (OTFE). On Microsoft Windows, and Windows Mobile, it can create a virtual drive within a file or partition, to which anything written is automatically encrypted before being stored on a computer's hard or USB drive. It is similar in function to other disk encryption programs including TrueCrypt and Microsoft's BitLocker.

ext4 is a journaling file system for Linux, developed as the successor to ext3.

Cryptoloop is a Linux kernel's disk encryption module that relies on the Crypto API, which is a cryptography framework introduced in version 2.5.45 of the Linux kernel mainline. Cryptoloop was first introduced in the 2.5.x kernel series; its functionality was later incorporated into the device mapper, a generic framework used to map one block device onto another.

The Linux Unified Key Setup (LUKS) is a disk encryption specification created by Clemens Fruhwirth in 2004 and originally intended for Linux.

Disk encryption is a technology which protects information by converting it into code that cannot be deciphered easily by unauthorized people or processes. Disk encryption uses disk encryption software or hardware to encrypt every bit of data that goes on a disk or disk volume. It is used to prevent unauthorized access to data storage.

In cryptography, a watermarking attack is an attack on disk encryption methods where the presence of a specially crafted piece of data can be detected by an attacker without knowing the encryption key.

<span class="mw-page-title-main">BestCrypt</span> Commercial disk encryption app available for Windows, Linux, macOS and Android

BestCrypt, developed by Jetico, is a commercial disk encryption app available for Windows, Linux, macOS and Android.

This is a technical feature comparison of different disk encryption software.

There are various implementations of the Advanced Encryption Standard, also known as Rijndael.

eCryptfs is a package of disk encryption software for Linux. Its implementation is a POSIX-compliant filesystem-level encryption layer, aiming to offer functionality similar to that of GnuPG at the operating system level, and has been part of the Linux kernel since version 2.6.19.

References

  1. 1 2 Clemens Fruhwirth (2005-07-18). "New Methods in Hard Disk Encryption" (PDF). Vienna University of Technology . Retrieved 2007-04-20.{{cite journal}}: Cite journal requires |journal= (help)
  2. Mike Peters (2004-06-08). "Encrypting partitions using dm-crypt and the 2.6 series kernel". Archived from the original on 2012-07-11. Retrieved 2012-02-20.{{cite journal}}: Cite journal requires |journal= (help)
  3. 1 2 3 W. Michael Petullo (2007-01-18). "Disk encryption in Fedora: Past, present and future". Red Hat Magazine. Archived from the original on 2008-10-10. Retrieved 2007-04-20.
  4. "AUTHORS". GitLab. Retrieved 7 September 2019.
  5. 1 2 3 4 "docs · master · cryptsetup / cryptsetup". GitLab. Retrieved 21 December 2023.
  6. "The cryptsetup textual domain". Translation Project. Retrieved 7 September 2019.
  7. "COPYING". GitLab. Retrieved 7 September 2019.
  8. "COPYING.LGPL". GitLab. Retrieved 7 September 2019.
  9. "cryptsetup FAQ".
  10. Clemens Fruhwirth (2004-07-15). "TKS1 – An anti-forensic, two level, and iterated key setup scheme" (PDF). Draft. Retrieved 2006-12-12.
  11. Milan Broz (2012-04-24). "[dm-crypt] Does dm-crypt support journaling filesystem transactional guarantees?". saout.de. Retrieved 2014-07-08.
  12. Mikulas Patocka (2009-06-22). "kernel/git/torvalds/linux.git". Linux kernel source tree. kernel.org. Retrieved 2014-07-08.
  13. "dm-crypt: Linux kernel device-mapper crypto target – IV generators". cryptsetup. 2014-01-11. Retrieved 2015-04-05.
  14. "dm-crypt: Linux kernel device-mapper crypto target" . Retrieved 2015-04-05.
  15. "[dm-devel][PATCH 2/2] dm-crypt: Add TCW IV mode for old CBC TCRYPT containers". redhat.com. Retrieved 2014-06-17.
  16. "Ext2 IFS For Windows". fs-driver.org. Retrieved 15 February 2015.
  17. Alex Hornung (2010-07-23). "HEADS UP: dm, lvm, cryptsetup and initrd on master".