Difference between revisions of "Dm-crypt"

From ArchWiki
Jump to: navigation, search
(two links are to an old untranslated copy of the article, that content is now in dm-crypt/Device Encryption linked above; the third link was to the old talk page, now in Talk:dm-crypt: if that discussion is useful it must be merged to a subpage)
(31 intermediate revisions by 7 users not shown)
Line 5: Line 5:
 
[[fr:LUKS]]
 
[[fr:LUKS]]
 
[[ru:System Encryption with LUKS]]
 
[[ru:System Encryption with LUKS]]
[[zh-CN:System Encryption with LUKS]]
+
[[zh-CN:Dm-crypt]]
{{Stub|1=This article is currently under heavy restructuring: for its latest stable revision see [[Dm-crypt with LUKS]]}}
+
 
{{Related articles start}}
 
{{Related articles start}}
 
{{Related|Disk Encryption}}
 
{{Related|Disk Encryption}}
 
{{Related|Removing System Encryption}}
 
{{Related|Removing System Encryption}}
{{Related|Plain dm-crypt without LUKS}}
 
 
{{Related articles end}}
 
{{Related articles end}}
 +
This article focuses on how to set up encryption on Arch Linux using ''dm-crypt'', which is the standard device-mapper encryption functionality provided by the Linux kernel.
  
This article focuses on how to set up full system encryption on Arch Linux, using dm-crypt with LUKS.
+
==Common scenarios==
 +
This section introduces common scenarios to employ ''dm-crypt'' to encrypt a system or individual filesystem mount points. The scenarios cross-link to the other subpages where needed. It is meant as starting point to familiarize with different practical encryption procedures.
  
'''dm-crypt''' is the standard device-mapper encryption functionality provided by the Linux kernel. It can be used directly by those who like to have full control over all aspects of partition and key management.
+
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]].
  
'''LUKS''' is an additional convenience layer which stores all of the needed setup information for dm-crypt on the disk itself and abstracts partition and key management in an attempt to improve ease of use.
+
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''.
  
For more details on how dm-crypt+LUKS compares to other disk encryption solution, see [[Disk Encryption#Comparison table]].
+
==Drive preparation==
 +
This step will deal with operations like [[Dm-crypt/Drive Preparation#Secure erasure of the hard disk drive|securely erasing the drive]] and [[Dm-crypt/Drive Preparation#Partitioning|partitioning it]].  
  
== Overview ==
+
See [[Dm-crypt/Drive Preparation]].
{{Warning|Encrypting a disk or partition will erase everything currently on that disk or partition, make appropriate data backups prior to starting.
+
Also be aware that encrypting a system might not only make the life of laptop thieves more miserable, but also yours if you don't plan ahead on:
+
* how to make secure backups of the encrypted system/-setup/data and
+
* how to access the encrypted system manually for maintenance.
+
Keeping those points in mind while deciding on how to use encryption may help to decide on method and tools as well.}}
+
  
The installation of a LUKS-encrypted system is largely the same as installing an unencrypted system. Routine creation of an encrypted system follows these general steps:
+
==Device encryption==
 +
This section covers how to manually utilize dm-crypt to encrypt a system through the [[dm-crypt/Device Encryption#Cryptsetup usage|cryptsetup]] command, also dealing with the usage of [[dm-crypt/Device Encryption#Cryptsetup actions specific for LUKS|LUKS]] and [[dm-crypt/Device Encryption#Cryptsetup and keyfiles|keyfiles]].
  
* [[#Drive preparation|Preparation]] of the drive(s) where the system will be installed
+
See [[Dm-crypt/Device Encryption]].
* Creation of the needed [[#Device encryption|encryption layers]]
+
* [[#System configuration|Configuration]] of the system to handle the encryption
+
* Installation of the system following the [[Installation Guide]] or the [[Beginners' Guide]]
+
 
+
Note that the Arch installation media comes with all the tools required for system encryption.
+
 
+
==Common scenarios==
+
{{Expansion|This section is an alternative to [[#Examples]], see [[Talk:Dm-crypt_with_LUKS/draft#New_idea]]. Add some introductory text with links to the most important subsections of [[Dm-crypt with LUKS/Encrypting a non-root file system]] and [[Dm-crypt with LUKS/Encrypting an entire system]].}}
+
See [[Dm-crypt with LUKS/Encrypting a non-root file system]] and [[Dm-crypt with LUKS/Encrypting an entire system]].
+
 
+
==Drive preparation==
+
This step will deal with operations like [[Dm-crypt with LUKS/Drive Preparation#Secure erasure of the hard disk drive|securely erasing the drive]] and [[Dm-crypt with LUKS/Drive Preparation#Partitioning|partitioning it]]. See [[Dm-crypt with LUKS/Drive Preparation]].
+
 
+
==Device encryption==
+
{{Expansion|Add some introductory text with links to the most important subsections of [[Dm-crypt with LUKS/Device Encryption]].}}
+
See [[Dm-crypt with LUKS/Device Encryption]].
+
  
 
==System configuration==
 
==System configuration==
{{Expansion|Add some introductory text with links to the most important subsections of [[Dm-crypt with LUKS/System Configuration]].}}
+
This page 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.
See [[Dm-crypt with LUKS/System Configuration]].
+
  
==Examples==
+
See [[Dm-crypt/System Configuration]].
{{Expansion|This section is an alternative to [[#Common scenarios]], see [[Talk:Dm-crypt_with_LUKS/draft#New_idea]]. Add some introductory text with links to the most important subsections of [[Dm-crypt with LUKS/Examples]].}}
+
See [[Dm-crypt with LUKS/Examples]].
+
  
 
==Swap device encryption==
 
==Swap device encryption==
 
A swap partition may be added 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.
 
A swap partition may be added 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.
  
See [[Dm-crypt with LUKS/Swap Encryption]].
+
See [[Dm-crypt/Swap Encryption]].
  
 
==Specialties==
 
==Specialties==
This part deals with special operations like [[Dm-crypt with LUKS/Specialties#Securing the unencrypted boot partition|securing the unencrypted boot partition]], [[Dm-crypt with LUKS/Specialties#Using GPG or OpenSSL Encrypted Keyfiles|using GPG or OpenSSL encrypted keyfiles]], a method to [[Dm-crypt with LUKS/Specialties#Using GPG or OpenSSL Encrypted Keyfiles|boot and unlock via the network]], or [[Dm-crypt with LUKS/Specialties#Using GPG or OpenSSL Encrypted Keyfiles|setting up discard/TRIM for a SSD]].
+
This part 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]], or [[Dm-crypt/Specialties#Discard.2FTRIM_support_for_solid_state_disks_.28SSD.29|setting up discard/TRIM for a SSD]].
  
See [[Dm-crypt with LUKS/Specialties]].
+
See [[Dm-crypt/Specialties]].
  
 
== See also ==
 
== See also ==
 
* [http://code.google.com/p/cryptsetup/wiki/FrequentlyAskedQuestions cryptsetup FAQ] - The main and foremost help resource, directly from the developers.
 
* [http://code.google.com/p/cryptsetup/wiki/FrequentlyAskedQuestions cryptsetup FAQ] - The main and foremost help resource, directly from the developers.
 
* [http://www.freeotfe.org/ FreeOTFE] - Supports unlocking LUKS encrypted volumes in Microsoft Windows.
 
* [http://www.freeotfe.org/ FreeOTFE] - Supports unlocking LUKS encrypted volumes in Microsoft Windows.

Revision as of 12:57, 15 January 2014

This article focuses on how to set up encryption on Arch Linux using dm-crypt, which is the standard device-mapper encryption functionality provided by the Linux kernel.

Common scenarios

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

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

This step will deal with operations like securely erasing the drive and partitioning it.

See Dm-crypt/Drive Preparation.

Device encryption

This section covers how to manually utilize dm-crypt to encrypt a system through the cryptsetup command, also dealing with the usage of LUKS and keyfiles.

See Dm-crypt/Device Encryption.

System configuration

This page illustrates how to configure mkinitcpio, the boot loader and the crypttab file when encrypting a system.

See Dm-crypt/System Configuration.

Swap device encryption

A swap partition may be added 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.

See Dm-crypt/Swap Encryption.

Specialties

This part 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, or setting up discard/TRIM for a SSD.

See Dm-crypt/Specialties.

See also

  • cryptsetup FAQ - The main and foremost help resource, directly from the developers.
  • FreeOTFE - Supports unlocking LUKS encrypted volumes in Microsoft Windows.