Difference between revisions of "Dm-crypt"

From ArchWiki
Jump to: navigation, search
m (restructured sentence)
(change category to Disk encryption)
(15 intermediate revisions by 11 users not shown)
Line 1: Line 1:
 
{{Lowercase title}}
 
{{Lowercase title}}
[[Category:Encryption]]
+
[[Category:Disk encryption]]
[[Category:File systems]]
 
 
[[de:dm-crypt]]
 
[[de:dm-crypt]]
 
[[es:Dm-crypt]]
 
[[es:Dm-crypt]]
Line 7: Line 6:
 
[[it:Dm-crypt with LUKS]]
 
[[it:Dm-crypt with LUKS]]
 
[[ja:Dm-crypt]]
 
[[ja:Dm-crypt]]
[[ru:System Encryption with LUKS]]
+
[[ru:Dm-crypt]]
[[zh-CN:Dm-crypt]]
+
[[zh-hans:Dm-crypt]]
 +
[[zh-hant:Dm-crypt]]
 +
[[pl:Dm-crypt]]
 +
 
 
{{Related articles start}}
 
{{Related articles start}}
 
{{Related|Disk encryption}}
 
{{Related|Disk encryption}}
Line 16: Line 18:
 
From the cryptsetup project's [https://gitlab.com/cryptsetup/cryptsetup/wikis/DMCrypt wiki]:
 
From the cryptsetup project's [https://gitlab.com/cryptsetup/cryptsetup/wikis/DMCrypt wiki]:
  
:Device-mapper is infrastructure in Linux which is used since kernel version 2.6 and higher that provides a generic way to create virtual layers of block devices. Device-mapper crypt target provides transparent encryption of block devices using the kernel crypto API. The user can basically specify one of the symmetric ciphers, an encryption mode, a key (of any allowed size), an iv generation mode and then the user can create a new block device in /dev. Writes to this device will be encrypted and reads decrypted. You can mount your filesystem on it as usual or stack dm-crypt device with another device like RAID or LVM volume. Basic documentation of dm-crypt mapping table comes with kernel source and the latest version is available in git repository.
+
:Device-mapper is infrastructure in the Linux 2.6 and 3.x kernel that provides a generic way to create virtual layers of block devices. Device-mapper crypt target provides transparent encryption of block devices using the kernel crypto API. The user can basically specify one of the symmetric ciphers, an encryption mode, a key (of any allowed size), an iv generation mode and then the user can create a new block device in /dev. Writes to this device will be encrypted and reads decrypted. You can mount your filesystem on it as usual or stack dm-crypt device with another device like RAID or LVM volume. Basic documentation of dm-crypt mapping table comes with kernel source and the latest version is available in git repository.
 +
 
 +
== Common scenarios ==
  
==Common scenarios==
 
 
This part introduces common scenarios to employ ''dm-crypt'' to encrypt a system or individual filesystem mount points. It is meant as starting point to familiarize with different practical encryption procedures. The scenarios cross-link to the other subpages where needed.   
 
This part introduces common scenarios to employ ''dm-crypt'' to encrypt a system or individual filesystem mount points. It is meant as starting point to familiarize with different practical encryption procedures. The scenarios cross-link to the other subpages where needed.   
  
See [[Dm-crypt/Encrypting a non-root file system]] if you need to encrypt a device that is not used for booting a system, like a [[Dm-crypt/Encrypting a non-root file system#Partition|partition]] or a [[Dm-crypt/Encrypting a non-root file system#Loop device|loop device]].
+
See [[dm-crypt/Encrypting a non-root file system]] if you need to encrypt a device that is not used for booting a system, like a [[dm-crypt/Encrypting a non-root file system#Partition|partition]] or a [[dm-crypt/Encrypting a non-root file system#Loop device|loop device]].
 +
 
 +
See [[dm-crypt/Encrypting an entire system]] if you want to encrypt an entire system, in particular a root partition. Several scenarios are covered, including the use of ''dm-crypt'' with the ''LUKS'' extension, ''plain'' mode encryption and encryption and ''LVM''.
 +
 
 +
== Drive preparation ==
 +
 
 +
[[dm-crypt/Drive preparation]] deals with operations like [[dm-crypt/Drive preparation#Secure erasure of the hard disk drive|securely erasing the drive]] and ''dm-crypt'' specific points for [[dm-crypt/Drive preparation#Partitioning|partitioning it]].
 +
 
 +
== Device encryption ==
 +
 
 +
[[dm-crypt/Device encryption]] covers how to manually utilize dm-crypt to encrypt a system through the [[dm-crypt/Device encryption#Cryptsetup usage|cryptsetup]] command. It covers examples of the [[dm-crypt/Device encryption#Encryption options with dm-crypt|Encryption options with dm-crypt]], deals with the creation of [[dm-crypt/Device encryption#Keyfiles|keyfiles]], LUKS specific commands for [[dm-crypt/Device encryption#Key management|key management]] as well as for  [[dm-crypt/Device encryption#Backup and restore|Backup and restore]].  
  
See [[Dm-crypt/Encrypting an entire system]] if you want to encrypt an entire system, in particular a root partition. Several scenarios are covered, including the use of ''dm-crypt'' with the ''LUKS'' extension, ''plain'' mode encryption and encryption and ''LVM''.
+
== System configuration ==
  
==Drive preparation==
+
[[dm-crypt/System configuration]] illustrates how to configure [[dm-crypt/System configuration#mkinitcpio|mkinitcpio]], the [[dm-crypt/System configuration#Boot loader|boot loader]] and the [[crypttab]] file when encrypting a system.
[[Dm-crypt/Drive preparation]] deals with operations like [[Dm-crypt/Drive preparation#Secure erasure of the hard disk drive|securely erasing the drive]] and ''dm-crypt'' specific points for [[Dm-crypt/Drive preparation#Partitioning|partitioning it]].  
 
  
==Device encryption==
+
== Swap device encryption ==
[[Dm-crypt/Device encryption]] covers how to manually utilize dm-crypt to encrypt a system through the [[dm-crypt/Device encryption#Cryptsetup usage|cryptsetup]] command. It covers examples of the [[Dm-crypt/Device encryption#Encryption options with dm-crypt|Encryption options with dm-crypt]], deals with the creation of [[dm-crypt/Device encryption#Keyfiles|keyfiles]], LUKS specific commands for [[Dm-crypt/Device_encryption#Key_management|key management]] as well as for  [[Dm-crypt/Device_encryption#Backup_and_restore|Backup and restore]].
 
  
==System configuration==
+
[[dm-crypt/Swap encryption]] covers how to add a swap partition to an encrypted system, if required. The swap partition must be encrypted as well to protect any data swapped out by the system. This part details methods [[dm-crypt/Swap encryption#Without suspend-to-disk support|without]] and [[dm-crypt/Swap encryption#With suspend-to-disk support|with]] suspend-to-disk support.
[[Dm-crypt/System configuration]] illustrates how to configure [[Dm-crypt/System configuration#mkinitcpio|mkinitcpio]], the [[Dm-crypt/System configuration#Boot loader|boot loader]] and the [[Dm-crypt/System configuration#crypttab|crypttab]] file when encrypting a system.
 
  
==Swap device encryption==
+
== Specialties ==
[[Dm-crypt/Swap encryption]] covers how to add a swap partition to an encrypted system, if required. The swap partition must be encrypted as well to protect any data swapped out by the system. This part details methods [[Dm-crypt_with_LUKS/Swap_Encryption#Without_suspend-to-disk_support|without]] and [[Dm-crypt_with_LUKS/Swap_Encryption#With_suspend-to-disk_support|with]] suspend-to-disk support.
 
  
==Specialties==
+
[[dm-crypt/Specialties]] deals with special operations like [[dm-crypt/Specialties#Securing the unencrypted boot partition|securing the unencrypted boot partition]], [[dm-crypt/Specialties#Using GPG, LUKS, or OpenSSL Encrypted Keyfiles|using GPG or OpenSSL encrypted keyfiles]], a method to [[dm-crypt/Specialties#Remote unlocking of the root (or other) partition|boot and unlock via the network]], another for [[dm-crypt/Specialties#Discard/TRIM support for solid state drives (SSD)|setting up discard/TRIM for a SSD]], and sections dealing with [[dm-crypt/Specialties#The encrypt hook and multiple disks|the encrypt hook and multiple disks]].  
[[Dm-crypt/Specialties]] deals with special operations like [[Dm-crypt/Specialties#Securing the unencrypted boot partition|securing the unencrypted boot partition]], [[Dm-crypt/Specialties#Using GPG or OpenSSL Encrypted Keyfiles|using GPG or OpenSSL encrypted keyfiles]], a method to [[Dm-crypt/Specialties#Remote_unlocking_of_the_root_.28or_other.29_partition|boot and unlock via the network]], another for [[Dm-crypt/Specialties#Discard.2FTRIM_support_for_solid_state_drives_.28SSD.29|setting up discard/TRIM for a SSD]], and sections dealing with [[Dm-crypt/Specialties#The_encrypt_hook_and_multiple_disks|the encrypt hook and multiple disks]].  
 
  
 
== See also ==
 
== See also ==
 +
 
* [https://gitlab.com/cryptsetup/cryptsetup/wikis/DMCrypt dm-crypt] - The project homepage  
 
* [https://gitlab.com/cryptsetup/cryptsetup/wikis/DMCrypt dm-crypt] - The project homepage  
 
* [https://gitlab.com/cryptsetup/cryptsetup cryptsetup] - The LUKS homepage and [https://gitlab.com/cryptsetup/cryptsetup/wikis/FrequentlyAskedQuestions FAQ] - the main and foremost help resource.  
 
* [https://gitlab.com/cryptsetup/cryptsetup cryptsetup] - The LUKS homepage and [https://gitlab.com/cryptsetup/cryptsetup/wikis/FrequentlyAskedQuestions FAQ] - the main and foremost help resource.  
 
* [https://git.kernel.org/cgit/utils/cryptsetup/cryptsetup.git/ cryptsetup repository] and [https://www.kernel.org/pub/linux/utils/cryptsetup/ release] archive.
 
* [https://git.kernel.org/cgit/utils/cryptsetup/cryptsetup.git/ cryptsetup repository] and [https://www.kernel.org/pub/linux/utils/cryptsetup/ release] archive.
 
* [https://github.com/t-d-k/doxbox DOXBOX] - Supports unlocking LUKS encrypted volumes in Microsoft Windows.
 
* [https://github.com/t-d-k/doxbox DOXBOX] - Supports unlocking LUKS encrypted volumes in Microsoft Windows.

Revision as of 11:15, 4 April 2018

From the cryptsetup project's wiki:

Device-mapper is infrastructure in the Linux 2.6 and 3.x kernel that provides a generic way to create virtual layers of block devices. Device-mapper crypt target provides transparent encryption of block devices using the kernel crypto API. The user can basically specify one of the symmetric ciphers, an encryption mode, a key (of any allowed size), an iv generation mode and then the user can create a new block device in /dev. Writes to this device will be encrypted and reads decrypted. You can mount your filesystem on it as usual or stack dm-crypt device with another device like RAID or LVM volume. Basic documentation of dm-crypt mapping table comes with kernel source and the latest version is available in git repository.

Common scenarios

This part introduces common scenarios to employ dm-crypt to encrypt a system or individual filesystem mount points. It is meant as starting point to familiarize with different practical encryption procedures. The scenarios cross-link to the other subpages where needed.

See dm-crypt/Encrypting a non-root file system if you need to encrypt a device that is not used for booting a system, like a partition or a loop device.

See dm-crypt/Encrypting an entire system if you want to encrypt an entire system, in particular a root partition. Several scenarios are covered, including the use of dm-crypt with the LUKS extension, plain mode encryption and encryption and LVM.

Drive preparation

dm-crypt/Drive preparation deals with operations like securely erasing the drive and dm-crypt specific points for partitioning it.

Device encryption

dm-crypt/Device encryption covers how to manually utilize dm-crypt to encrypt a system through the cryptsetup command. It covers examples of the Encryption options with dm-crypt, deals with the creation of keyfiles, LUKS specific commands for key management as well as for Backup and restore.

System configuration

dm-crypt/System configuration illustrates how to configure mkinitcpio, the boot loader and the crypttab file when encrypting a system.

Swap device encryption

dm-crypt/Swap encryption covers how to add a swap partition to an encrypted system, if required. The swap partition must be encrypted as well to protect any data swapped out by the system. This part details methods without and with suspend-to-disk support.

Specialties

dm-crypt/Specialties deals with special operations like securing the unencrypted boot partition, using GPG or OpenSSL encrypted keyfiles, a method to boot and unlock via the network, another for setting up discard/TRIM for a SSD, and sections dealing with the encrypt hook and multiple disks.

See also