X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=man%2Fcryptsetup.8;h=b9082ee3126b2c77f3d91103cc004aa776e1fa7b;hb=e4c1cef5a4674eb873a551d4f2a492d985e55e1e;hp=b13a4c8245b8a1eea74c455ee7c6fad135d07bcc;hpb=154731306b67937cdcb7fdf1ad8867235bf2fd36;p=platform%2Fupstream%2Fcryptsetup.git diff --git a/man/cryptsetup.8 b/man/cryptsetup.8 index b13a4c8..b9082ee 100644 --- a/man/cryptsetup.8 +++ b/man/cryptsetup.8 @@ -1,4 +1,4 @@ -.TH CRYPTSETUP "8" "May 2012" "cryptsetup" "Maintenance Commands" +.TH CRYPTSETUP "8" "January 2021" "cryptsetup" "Maintenance Commands" .SH NAME cryptsetup - manage plain dm-crypt and LUKS encrypted volumes .SH SYNOPSIS @@ -12,7 +12,7 @@ and can hence offer more features than plain dm-crypt. On the other hand, the header is visible and vulnerable to damage. In addition, cryptsetup provides limited support for the use of -historic loopaes volumes and for TruerCrypt compatible volumes. +loop-AES volumes, TrueCrypt, VeraCrypt and BitLocker compatible volumes. .SH PLAIN DM-CRYPT OR LUKS? .PP @@ -29,12 +29,12 @@ to be mentioned here. \fBBackup:\fR Storage media die. Encryption has no influence on that. Backup is mandatory for encrypted data as well, if the data has any -worth. See the Cryptsetup FAQ for advice on how to do backup of an +worth. See the Cryptsetup FAQ for advice on how to do a backup of an encrypted volume. \fBCharacter encoding:\fR If you enter a passphrase with special symbols, the passphrase can change -depending character encoding. Keyboard settings can also change, +depending on character encoding. Keyboard settings can also change, which can make blind input hard or impossible. For example, switching from some ASCII 8-bit variant to UTF-8 can lead to a different binary encoding and hence different @@ -55,38 +55,40 @@ secure wiping by just overwriting header and key-slot area. \fBPreviously used partitions:\fR If a partition was previously used, it is a very good idea to wipe filesystem signatures, data, etc. before -creating a LUKS or plain dm-crypt container on it. -For a quick removal of filesystem signatures, use "wipefs". Take care -though that this may not remove everything. In particular md (RAID) -signatures at the end of a device may survive. It also does not -remove data. For a full wipe, overwrite the whole partition before -container creation. If you do not know how to to that, the +creating a LUKS or plain dm-crypt container on it. +For a quick removal of filesystem signatures, use "wipefs". Take care +though that this may not remove everything. In particular, MD RAID +signatures at the end of a device may survive. It also does not +remove data. For a full wipe, overwrite the whole partition before +container creation. If you do not know how to do that, the cryptsetup FAQ describes several options. -.SH BASIC COMMANDS +.SH BASIC ACTIONS The following are valid actions for all supported device types. \fIopen\fR \-\-type .IP Opens (creates a mapping with) backed by device . -Device type can be \fIplain\fR, \fIluks\fR (default), \fIloopaes\fR -or \fItcrypt\fR. +Device type can be \fIplain\fR, \fIluks\fR (default), \fIluks1\fR, \fIluks2\fR, +\fIloopaes\fR or \fItcrypt\fR. For backward compatibility there are \fBopen\fR command aliases: -\fBcreate\fR (argument-order ): open \-\-type plain +\fBcreate\fR (argument-order ): open \-\-type plain .br -\fBplainOpen\fR: open \-\-type plain +\fBplainOpen\fR: open \-\-type plain .br \fBluksOpen\fR: open \-\-type luks .br \fBloopaesOpen\fR: open \-\-type loopaes .br \fBtcryptOpen\fR: open \-\-type tcrypt +.br +\fBbitlkOpen\fR: open \-\-type bitlk \fB\fR are type specific and are described below -for individual device types. For \fBcreate\fR, the order of the +for individual device types. For \fBcreate\fR, the order of the and options is inverted for historical reasons, all other aliases use the standard \fB \fR order. .PP @@ -98,6 +100,9 @@ For backward compatibility there are \fBclose\fR command aliases: \fBremove\fR, \fBplainClose\fR, \fBluksClose\fR, \fBloopaesClose\fR, \fBtcryptClose\fR (all behaves exactly the same, device type is determined automatically from active device). + +\fB\fR can be [\-\-deferred] + .PP \fIstatus\fR .IP @@ -107,10 +112,96 @@ Reports the status for the mapping . .IP Resizes an active mapping . -If \-\-size (in sectors) is not specified, the size of the -underlying block device is used. Note that this does not -change the raw device geometry, it just changes how many -sectors of the raw device are represented in the mapped device. +If \-\-size (in 512-bytes sectors) or \-\-device\-size are not specified, +the size is computed from the underlying device. For LUKS it is the size +of the underlying device without the area reserved for LUKS header +(see data payload offset in \fBluksDump\fR command). +For plain crypt device, the whole device size is used. + +Note that this does not change the raw device geometry, it just +changes how many sectors of the raw device are represented +in the mapped device. + +If cryptsetup detected volume key for active device loaded in kernel keyring +service, resize action would first try to retrieve +the key using a token and only if it failed it'd ask for a passphrase +to unlock a keyslot (LUKS) or to derive a volume key again (plain mode). +The kernel keyring is used by default for LUKS2 devices. + +With LUKS2 device additional \fB\fR can be [\-\-token\-id, \-\-token\-only, +\-\-key\-slot, \-\-key\-file, \-\-keyfile\-size, \-\-keyfile\-offset, \-\-timeout, +\-\-disable\-locks, \-\-disable\-keyring]. + +.PP +\fIrefresh\fR +.IP +Refreshes parameters of active mapping . + +Updates parameters of active device without need to deactivate the device +(and umount filesystem). Currently it supports parameters refresh on following +devices: LUKS1, LUKS2 (including authenticated encryption), plain crypt +and loopaes. + +Mandatory parameters are identical to those of an open action for respective +device type. + +You may change following parameters on all devices \-\-perf\-same_cpu_crypt, +\-\-perf\-submit_from_crypt_cpus, \-\-perf-no_read_workqueue, \-\-perf-no_write_workqueue +and \-\-allow\-discards. + +Refreshing device without any optional parameter will refresh the device +with default setting (respective to device type). + +\fBLUKS2 only:\fR + +\-\-integrity\-no\-journal parameter affects only LUKS2 devices with +underlying dm-integrity device. + +Adding option \-\-persistent stores any combination of device parameters +above in LUKS2 metadata (only after successful refresh operation). + +\-\-disable\-keyring parameter refreshes a device with volume key passed +in dm-crypt driver. + +.PP +\fIreencrypt\fR or --active-name [] +.IP +Run resilient reencryption (LUKS2 device only). + +There are 3 basic modes of operation: + +\(bu device reencryption (\fIreencrypt\fR) + +\(bu device encryption (\fIreencrypt\fR \-\-encrypt) + +\(bu device decryption (\fIreencrypt\fR \-\-decrypt) + + or --active-name is mandatory parameter. + +With parameter cryptsetup looks up active dm mapping. +If no active mapping is detected, it starts offline reencryption otherwise online +reencryption takes place. + +Reencryption process may be safely interrupted by a user via SIGTERM signal (ctrl+c). + +To resume already initialized or interrupted reencryption, just run the cryptsetup +\fIreencrypt\fR command again to continue the reencryption operation. +Reencryption may be resumed with different \-\-resilience or \-\-hotzone\-size unless +implicit datashift resilience mode is used (reencrypt \-\-encrypt with \-\-reduce-device-size +option). + +If the reencryption process was interrupted abruptly (reencryption process crash, system crash, poweroff) +it may require recovery. The recovery is currently run automatically on next activation (action \fIopen\fR) +when needed. + +Optional parameter takes effect only with \-\-encrypt option and it activates device +immediately after encryption initialization gets finished. That's useful when device needs to be ready +as soon as possible and mounted (used) before full data area encryption is completed. + +Action supports following additional \fB\fR [\-\-encrypt, \-\-decrypt, \-\-device\-size, +\-\-resilience, \-\-resilience-hash, \-\-hotzone-size, \-\-init\-only, \-\-resume\-only, +\-\-reduce\-device\-size, \-\-master\-key\-file, \-\-key\-size]. + .SH PLAIN MODE Plain dm-crypt encrypts the device sector-by-sector with a single, non-salted hash of the passphrase. No checks @@ -128,10 +219,11 @@ The following are valid plain device type actions: Opens (creates a mapping with) backed by device . \fB\fR can be [\-\-hash, \-\-cipher, \-\-verify-passphrase, -\-\-key-file, \-\-keyfile-offset, \-\-key-size, \-\-offset, \-\-skip, \-\-size, -\-\-readonly, \-\-shared, \-\-allow-discards] +\-\-sector\-size, \-\-key-file, \-\-keyfile-offset, \-\-key-size, +\-\-offset, \-\-skip, \-\-size, \-\-readonly, \-\-shared, \-\-allow\-discards, +\-\-refresh] -Example: 'cryptsetup open --type plain /dev/sda10 e1' maps the raw +Example: 'cryptsetup open \-\-type plain /dev/sda10 e1' maps the raw encrypted device /dev/sda10 to the mapped (decrypted) device /dev/mapper/e1, which can then be mounted, fsck-ed or have a filesystem created on it. @@ -141,7 +233,7 @@ It adds a standardized header at the start of the device, a key-slot area directly behind the header and the bulk data area behind that. The whole set is called a 'LUKS container'. The device that a LUKS container resides on is called a 'LUKS device'. -For most purposes both terms can be used interchangeably. But +For most purposes, both terms can be used interchangeably. But note that when the LUKS header is at a nonzero offset in a device, then the device is not a LUKS device anymore, but has a LUKS container stored in it at an offset. @@ -153,6 +245,12 @@ are protected against brute-force and dictionary attacks by PBKDF2, which implements hash iteration and salting in one function. +LUKS2 is a new version of header format that allows additional +extensions like different PBKDF algorithm or authenticated encryption. +You can format device with LUKS2 header if you specify +\fI\-\-type luks2\fR in \fIluksFormat\fR command. +For activation, the format is already recognized automatically. + Each passphrase, also called a .B key in this document, is associated with one of 8 key-slots. @@ -160,31 +258,52 @@ Key operations that do not specify a slot affect the first slot that matches the supplied passphrase or the first empty slot if a new passphrase is added. +The \fB\fR parameter can also be specified by a LUKS UUID in the +format UUID=. Translation to real device name uses symlinks +in /dev/disk/by-uuid directory. + +To specify a detached header, the \fB\-\-header\fR parameter can be used +in all LUKS commands and always takes precedence over the positional +\fB\fR parameter. + The following are valid LUKS actions: \fIluksFormat\fR [] .IP Initializes a LUKS partition and sets the initial passphrase -(for key-slot 0), +(for key-slot 0), either via prompting or via . Note that if the second argument is present, then the passphrase is taken from the file given there, without the need to use the \-\-key-file option. Also note that for both forms -of reading the passphrase from file you can +of reading the passphrase from a file you can give '-' as file name, which results in the passphrase being read from stdin and the safety-question being skipped. -You can only call luksFormat on a LUKS device that is not mapped. +You cannot call luksFormat on a device or filesystem that is mapped or in use, +e.g. mounted filesysem, used in LVM, active RAID member etc. +The device or filesystem has to be un-mounted in order to call luksFormat. + +To use LUKS2, specify \fI\-\-type luks2\fR. -\fB\fR can be [\-\-hash, \-\-cipher, \-\-verify\-passphrase, -\-\-key\-size, \-\-key\-slot, +\fB\fR can be [\-\-hash, \-\-cipher, \-\-verify\-passphrase, +\-\-key\-size, \-\-key\-slot, \-\-key\-file (takes precedence over optional second argument), \-\-keyfile\-offset, \-\-keyfile\-size, \-\-use\-random | \-\-use\-urandom, \-\-uuid, \-\-master\-key\-file, \-\-iter\-time, \-\-header, -\-\-force\-password]. +\-\-pbkdf\-force\-iterations, +\-\-force\-password, \-\-disable-locks]. + +For LUKS2, additional \fB\fR can be +[\-\-integrity, \-\-integrity\-no\-wipe, \-\-sector\-size, +\-\-label, \-\-subsystem, +\-\-pbkdf, \-\-pbkdf\-memory, \-\-pbkdf\-parallel, +\-\-disable\-locks, \-\-disable\-keyring, +\-\-luks2\-metadata\-size, \-\-luks2\-keyslots\-size, +\-\-keyslot\-cipher, \-\-keyslot\-key\-size]. \fBWARNING:\fR Doing a luksFormat on an existing LUKS container will -make all data the old container permanently irretrievable, unless +make all data the old container permanently irretrievable unless you have a header backup. .PP \fIopen\fR \-\-type luks @@ -193,19 +312,20 @@ you have a header backup. .IP Opens the LUKS device and sets up a mapping after successful verification of the supplied passphrase. -If the passphrase is not supplied via \-\-key-file, the command -prompts for it interactively. -The parameter can be also specified by LUKS UUID in the -format UUID=, which uses the symlinks in /dev/disk/by-uuid. +First, the passphrase is searched in LUKS tokens. If it's not +found in any token and also the passphrase is not supplied via \-\-key-file, +the command prompts for it interactively. \fB\fR can be [\-\-key\-file, \-\-keyfile\-offset, \-\-keyfile\-size, \-\-readonly, \-\-test\-passphrase, -\-\-allow\-discards, \-\-header, \-\-key-slot, \-\-master\-key\-file]. +\-\-allow\-discards, \-\-header, \-\-key-slot, \-\-master\-key\-file, \-\-token\-id, +\-\-token\-only, \-\-disable\-keyring, \-\-disable\-locks, \-\-type, \-\-refresh, +\-\-serialize\-memory\-hard\-pbkdf]. .PP \fIluksSuspend\fR .IP -Suspends an active device (all IO operations will blocked +Suspends an active device (all IO operations will block and accesses to the device will wait indefinitely) and wipes the encryption key from kernel memory. Needs kernel 2.6.19 or later. @@ -216,39 +336,48 @@ the mapped device. \fBWARNING:\fR never suspend the device on which the cryptsetup binary resides. -\fB\fR can be [\-\-header]. +\fB\fR can be [\-\-header, \-\-disable\-locks]. .PP \fIluksResume\fR .IP Resumes a suspended device and reinstates the encryption key. Prompts interactively for a passphrase if \-\-key-file is not given. -\fB\fR can be [\-\-key\-file, \-\-keyfile\-size, \-\-header] +\fB\fR can be [\-\-key\-file, \-\-keyfile\-size, \-\-header, +\-\-disable\-keyring, \-\-disable\-locks, \-\-type] .PP \fIluksAddKey\fR [] .IP -adds a new passphrase. An existing passphrase must be supplied +Adds a new passphrase. An existing passphrase must be supplied interactively or via \-\-key-file. The new passphrase to be added can be specified interactively or read from the file given as positional argument. +\fBNOTE:\fR with \-\-unbound option the action creates new unbound +LUKS2 keyslot. The keyslot cannot be used for device activation. +If you don't pass new key via \-\-master\-key\-file option, +new random key is generated. Existing passphrase for any active keyslot +is not required. + \fB\fR can be [\-\-key\-file, \-\-keyfile\-offset, \-\-keyfile\-size, \-\-new\-keyfile\-offset, \-\-new\-keyfile\-size, \-\-key\-slot, \-\-master\-key\-file, -\-\-iter\-time, \-\-force\-password]. +\-\-force\-password, \-\-header, \-\-disable\-locks, +\-\-iter-time, \-\-pbkdf, \-\-pbkdf\-force\-iterations, +\-\-unbound, \-\-type, \-\-keyslot\-cipher, \-\-keyslot\-key\-size]. .PP \fIluksRemoveKey\fR [] .IP Removes the supplied passphrase from the LUKS device. The passphrase to be removed can be specified interactively, -as positional argument or via \-\-key-file. +as the positional argument or via \-\-key-file. \fB\fR can be [\-\-key\-file, \-\-keyfile\-offset, -\-\-keyfile\-size] +\-\-keyfile\-size, \-\-header, \-\-disable\-locks, \-\-type] \fBWARNING:\fR If you read the passphrase from stdin -(without further argument or with '-' as argument -to \-\-key\-file), batch-mode (-q) will be implicitely +(without further argument or with '-' as an argument +to \-\-key\-file), batch-mode (\-q) will be implicitly switched on and no warning will be given when you remove the last remaining passphrase from a LUKS container. Removing the last passphrase makes the LUKS container permanently @@ -277,26 +406,68 @@ inaccessible. \fB\fR can be [\-\-key\-file, \-\-keyfile\-offset, \-\-keyfile\-size, \-\-new\-keyfile\-offset, -\-\-new\-keyfile\-size, \-\-key\-slot, \-\-force\-password]. +\-\-iter-time, \-\-pbkdf, \-\-pbkdf\-force\-iterations, +\-\-new\-keyfile\-size, \-\-key\-slot, \-\-force\-password, \-\-header, +\-\-disable\-locks, \-\-type, \-\-keyslot\-cipher, \-\-keyslot\-key\-size]. +.PP +.PP +\fIluksConvertKey\fR +.IP +Converts an existing LUKS2 keyslot to new pbkdf parameters. The +passphrase for keyslot to be converted must be supplied interactively +or via \-\-key\-file. If no \-\-pbkdf parameters are specified LUKS2 +default pbkdf values will apply. + +If a keyslot is specified (via \-\-key\-slot), the passphrase for that +keyslot must be given. If no keyslot is specified and there is still +a free keyslot, then the new parameters will be put into a free +keyslot before the keyslot containing the old parameters is +purged. If there is no free keyslot, then the keyslot with the old +parameters is overwritten directly. + +\fBWARNING:\fR If a keyslot is overwritten, a media failure during +this operation can cause the overwrite to fail after the old +parameters have been wiped and make the LUKS container inaccessible. + +\fB\fR can be [\-\-key\-file, \-\-keyfile\-offset, +\-\-keyfile\-size, \-\-key\-slot, \-\-header, \-\-disable\-locks, +\-\-iter-time, \-\-pbkdf, \-\-pbkdf\-force\-iterations, +\-\-pbkdf\-memory, \-\-pbkdf\-parallel, +\-\-keyslot\-cipher, \-\-keyslot\-key\-size]. .PP \fIluksKillSlot\fR .IP -Wipe the key-slot number from the LUKS device. A remaining -passphrase must be supplied, either interactively or via \-\-key-file. +Wipe the key-slot number from the LUKS device. Except running +in batch-mode (\-q) a remaining passphrase must be supplied, +either interactively or via \-\-key-file. This command can remove the last remaining key-slot, but requires an interactive confirmation when doing so. Removing the last passphrase makes a LUKS container permanently inaccessible. -\fB\fR can be [\-\-key\-file, \-\-keyfile\-offset, -\-\-keyfile\-size]. +\fB\fR can be [\-\-key\-file, \-\-keyfile\-offset, +\-\-keyfile\-size, \-\-header, \-\-disable\-locks, \-\-type]. \fBWARNING:\fR If you read the passphrase from stdin -(without further argument or with '-' as argument -to \-\-key-file), batch-mode (-q) will be implicitely +(without further argument or with '-' as an argument +to \-\-key-file), batch-mode (\-q) will be implicitly switched on and no warning will be given when you remove the last remaining passphrase from a LUKS container. Removing the last passphrase makes the LUKS container permanently inaccessible. + +\fBNOTE:\fR If there is no passphrase provided (on stdin or through +\-\-key-file argument) and batch-mode (\-q) is active, the +key-slot is removed without any other warning. + +.PP +\fIerase\fR +.br +\fIluksErase\fR +.IP +Erase all keyslots and make the LUKS container permanently inaccessible. +You do not need to provide any password for this operation. + +\fBWARNING:\fR This operation is irreversible. .PP \fIluksUUID\fR .IP @@ -309,23 +480,31 @@ Set new UUID if \fI\-\-uuid\fR option is specified. Returns true, if is a LUKS device, false otherwise. Use option \-v to get human-readable feedback. 'Command successful.' means the device is a LUKS device. + +By specifying \-\-type you may query for specific LUKS version. .PP \fIluksDump\fR .IP Dump the header information of a LUKS device. If the \-\-dump\-master\-key option is used, the LUKS device master key is -dumped instead of the keyslot info. Beware that the master key cannot be -changed and can be used to decrypt the data stored in the LUKS container -without a passphrase and even without the LUKS header. This means -that if the master key is compromised, the whole device has to be -erased to prevent further access. Use this option carefully. +dumped instead of the keyslot info. Together with \-\-master\-key\-file option, +master key is dumped to a file instead of standard output. Beware that the +master key cannot be changed without reencryption and can be used to decrypt +the data stored in the LUKS container without a passphrase and even without the +LUKS header. This means that if the master key is compromised, the whole device +has to be erased or reencrypted to prevent further access. Use this option carefully. + +To dump the master key, a passphrase has to be supplied, +either interactively or via \-\-key\-file. -In order to dump the master key, a passphrase has to be supplied, -either interactively or via \-\-key\-file. +To dump unbound key (LUKS2 format only), \-\-unbound parameter, specific \-\-key-slot +id and proper passphrase has to be supplied, either interactively or via \-\-key\-file. +Optional \-\-master\-key\-file parameter enables unbound keyslot dump to a file. \fB\fR can be [\-\-dump\-master\-key, \-\-key\-file, -\-\-keyfile\-offset, \-\-keyfile\-size]. +\-\-keyfile\-offset, \-\-keyfile\-size, \-\-header, \-\-disable\-locks, +\-\-master\-key\-file, \-\-type, \-\-unbound, \-\-key-slot]. \fBWARNING:\fR If \-\-dump\-master\-key is used with \-\-key\-file and the argument to \-\-key\-file is '-', no validation question @@ -356,12 +535,68 @@ from the specified file. Note: Using '-' as filename reads the header backup from a file named '-'. \fBWARNING:\fR Header and keyslots will be replaced, only -the passphrases from the backup will work afterwards. +the passphrases from the backup will work afterward. This command requires that the master key size and data offset of the LUKS header already on the device and of the header backup match. Alternatively, if there is no LUKS header on the device, the backup will also be written to it. +.PP +\fItoken\fR +.IP +Action \fIadd\fR creates new keyring token to enable auto-activation of the device. +For the auto-activation, the passphrase must be stored in keyring with the specified +description. Usually, the passphrase should be stored in \fIuser\fR or +\fIuser-session\fR keyring. +The \fItoken\fR command is supported only for LUKS2. + +For adding new keyring token, option \-\-key\-description is mandatory. +Also, new token is assigned to key slot specified with \-\-key\-slot option or to all +active key slots in the case \-\-key\-slot option is omitted. + +To remove existing token, specify the token ID which should be removed with +\-\-token\-id option. + +\fBWARNING:\fR The action \fItoken remove\fR removes any token type, not just \fIkeyring\fR +type from token slot specified by \-\-token\-id option. + +Action \fIimport\fR can store arbitrary valid token json in LUKS2 header. It may be passed via +standard input or via file passed in \-\-json\-file option. If you specify \-\-key\-slot then +successfully imported token is also assigned to the key slot. + +Action \fIexport\fR writes requested token json to a file passed with \-\-json\-file or +to standard output. + +\fB\fR can be [\-\-header, \-\-token\-id, \-\-key\-slot, \-\-key\-description, +\-\-disable\-locks, \-\-disable\-keyring, \-\-json\-file]. +.PP +\fIconvert\fR \-\-type +.IP +Converts the device between LUKS1 and LUKS2 format (if possible). +The conversion will not be performed if there is an additional LUKS2 feature or LUKS1 has +unsupported header size. + +Conversion (both directions) must be performed on inactive device. There must not be active +dm-crypt mapping established for LUKS header requested for conversion. + +\fB\-\-type\fR option is mandatory with following accepted values: \fIluks1\fR or \fIluks2\fR. + +\fBWARNING:\fR The \fIconvert\fR action can destroy the LUKS header in the case of a crash +during conversion or if a media error occurs. +Always create a header backup before performing this operation! + +\fB\fR can be [\-\-header, \-\-type]. +.PP +\fIconfig\fR +.IP +Set permanent configuration options (store to LUKS header). +The \fIconfig\fR command is supported only for LUKS2. + +The permanent options can be \fI\-\-priority\fR to set priority (normal, prefer, ignore) +for keyslot (specified by \fI\-\-key\-slot\fR) or \fI\-\-label\fR and \fI\-\-subsystem\fR. + +\fB\fR can be [\-\-priority, \-\-label, \-\-subsystem, \-\-key\-slot, \-\-header]. + .SH loop-AES EXTENSION cryptsetup supports mapping loop-AES encrypted partition using a compatibility mode. @@ -375,9 +610,17 @@ Opens the loop-AES and sets up a mapping . If the key file is encrypted with GnuPG, then you have to use \-\-key\-file=\- and decrypt it before use, e.g. like this: .br -gpg \-\-decrypt | cryptsetup loopaesOpen \-\-key\-file=\- +gpg \-\-decrypt | cryptsetup loopaesOpen \-\-key\-file=\- +\fBWARNING:\fR The loop-AES extension cannot use the direct input of key file +on real terminal because the keys are separated by end-of-line and only part +of the multi-key file would be read. +.br +If you need it in script, just use the pipe redirection: +.br +echo $keyfile | cryptsetup loopaesOpen \-\-key\-file=\- + Use \fB\-\-keyfile\-size\fR to specify the proper key length if needed. Use \fB\-\-offset\fR to specify device offset. Note that the units @@ -393,12 +636,13 @@ passphrase hashing (otherwise it is detected according to key size). \fB\fR can be [\-\-key\-file, \-\-key\-size, \-\-offset, \-\-skip, -\-\-hash, \-\-readonly, \-\-allow\-discards]. +\-\-hash, \-\-readonly, \-\-allow\-discards, \-\-refresh]. .PP See also section 7 of the FAQ and \fBhttp://loop-aes.sourceforge.net\fR for more information regarding loop-AES. -.SH TCRYPT (TrueCrypt-compatible) EXTENSION -cryptsetup supports mapping of TrueCrypt or tcplay encrypted partition +.SH TCRYPT (TrueCrypt-compatible and VeraCrypt) EXTENSION +cryptsetup supports mapping of TrueCrypt, tcplay or VeraCrypt +(with \fB\-\-veracrypt\fR option) encrypted partition using a native Linux kernel API. Header formatting and TCRYPT header change is not supported, cryptsetup never changes TCRYPT header on-device. @@ -416,6 +660,20 @@ Cryptsetup should recognize all header variants, except legacy cipher chains using LRW encryption mode with 64 bits encryption block (namely Blowfish in LRW mode is not recognized, this is limitation of kernel crypto API). +To recognize a VeraCrypt device use the \fB\-\-veracrypt\fR option. +VeraCrypt is just extension of TrueCrypt header with increased +iteration count so unlocking can take quite a lot of time (in comparison +with TCRYPT device). + +To open a VeraCrypt device with a custom Personal Iteration Multiplier (PIM) +value, \fBadditionally to \-\-veracrypt \fR use either the +\fB\-\-veracrypt\-pim=\fR option to directly specify the PIM on the command- +line or use \fB\-\-veracrypt\-query\-pim\fR to be prompted for the PIM. + +The PIM value affects the number of iterations applied during key derivation. Please refer to +\fBhttps://www.veracrypt.fr/en/Personal%20Iterations%20Multiplier%20%28PIM%29.html\fR +for more detailed information. + \fBNOTE:\fR Activation with \fBtcryptOpen\fR is supported only for cipher chains using LRW or XTS encryption modes. @@ -423,12 +681,26 @@ The \fBtcryptDump\fR command should work for all recognized TCRYPT devices and doesn't require superuser privilege. To map system device (device with boot loader where the whole encrypted -system resides) use \fB\-\-tcrypt\-system\fR option. Use the whole -device not the system partition as the device parameter. +system resides) use \fB\-\-tcrypt\-system\fR option. +You can use partition device as the parameter (parameter must be real partition +device, not an image in a file), then only this partition is mapped. + +If you have the whole TCRYPT device as a file image and you want to map multiple +partition encrypted with system encryption, please create loopback mapping +with partitions first (\fBlosetup \-P\fR, see \fPlosetup(8)\fR man page for more info), +and use loop partition as the device parameter. + +If you use the whole base device as a parameter, one device for the whole system +encryption is mapped. This mode is available only for backward compatibility +with older cryptsetup versions which mapped TCRYPT system encryption +using the whole device. To use hidden header (and map hidden device, if available), use \fB\-\-tcrypt\-hidden\fR option. +To explicitly use backup (secondary) header, use \fB\-\-tcrypt\-backup\fR +option. + \fBNOTE:\fR There is no protection for a hidden volume if the outer volume is mounted. The reason is that if there were any protection, it would require some metadata describing @@ -440,21 +712,33 @@ become detectable. .br \fItcryptOpen\fR (\fBold syntax\fR) .IP -Opens the TCRYPT (a TrueCrypt-compatible) and sets up +Opens the TCRYPT (a TrueCrypt-compatible) and sets up a mapping . -\fB\fR can be [\-\-key\-file, \-\-tcrypt\-hidden, -\-\-tcrypt\-system, \-\-readonly, \-\-test\-passphrase]. +\fB\fR can be [\-\-key\-file, \-\-tcrypt\-hidden, +\-\-tcrypt\-system, \-\-tcrypt\-backup, \-\-readonly, \-\-test\-passphrase, +\-\-allow-discards, \-\-veracrypt, \-\-veracrypt\-pim, \-\-veracrypt\-query\-pim, +\-\-header]. -The keyfile parameter allows combination of file content with the +The keyfile parameter allows a combination of file content with the passphrase and can be repeated. Note that using keyfiles is compatible with TCRYPT and is different from LUKS keyfile logic. + +If you use \fB\-\-header\fR in combination with hidden or system options, +the header file must contain specific headers on the same positions as the original +encrypted container. + +\fBWARNING:\fR Option \fB\-\-allow\-discards\fR cannot be combined with +option \fB\-\-tcrypt\-hidden\fR. For normal mapping, it can cause +the \fBdestruction of hidden volume\fR (hidden volume appears as unused space +for outer volume so this space can be discarded). + .PP \fItcryptDump\fR .IP Dump the header information of a TCRYPT device. -If the \-\-dump\-master\-key option is used, the TCRYPT device master key +If the \-\-dump\-master\-key option is used, the TCRYPT device master key is dumped instead of TCRYPT header info. Beware that the master key (or concatenated master keys if cipher chain is used) can be used to decrypt the data stored in the TCRYPT container without @@ -462,17 +746,58 @@ a passphrase. This means that if the master key is compromised, the whole device has to be erased to prevent further access. Use this option carefully. -\fB\fR can be [\-\-dump\-master\-key, \-\-key\-file, -\-\-tcrypt\-hidden, \-\-tcrypt\-system]. +\fB\fR can be [\-\-dump\-master\-key, \-\-key\-file, +\-\-tcrypt\-hidden, \-\-tcrypt\-system, \-\-tcrypt\-backup]. -The keyfile parameter allows combination of file content with the +The keyfile parameter allows a combination of file content with the passphrase and can be repeated. .PP -See also \fBhttp://www.truecrypt.org\fR for more information regarding +See also \fBhttps://en.wikipedia.org/wiki/TrueCrypt\fR for more information regarding TrueCrypt. Please note that cryptsetup does not use TrueCrypt code, please report -all problems related to this compatibility extension to cryptsetup project. +all problems related to this compatibility extension to the cryptsetup project. + +.SH BITLK (Windows BitLocker-compatible) EXTENSION (EXPERIMENTAL) +cryptsetup supports mapping of BitLocker and BitLocker to Go encrypted partition +using a native Linux kernel API. +Header formatting and BITLK header changes are not supported, cryptsetup +never changes BITLK header on-device. + +\fBWARNING:\fR This extension is EXPERIMENTAL. + +BITLK extension requires kernel userspace crypto API to be available +(for details see TCRYPT section). + +Cryptsetup should recognize all BITLK header variants, except legacy +header used in Windows Vista systems and partially decrypted BitLocker devices. +Activation of legacy devices encrypted in CBC mode requires at least +Linux kernel version 5.3 and for devices using Elephant diffuser kernel 5.6. + +The \fBbitlkDump\fR command should work for all recognized BITLK devices +and doesn't require superuser privilege. + +For unlocking with the \fBopen\fR a password or a recovery passphrase must +be provided. Other unlocking methods (TPM, SmartCard) are not supported. + +.PP +\fIopen\fR \-\-type bitlk +.br +\fIbitlkOpen\fR (\fBold syntax\fR) +.IP +Opens the BITLK (a BitLocker-compatible) and sets up +a mapping . + +\fB\fR can be [\-\-key\-file, \-\-readonly, \-\-test\-passphrase, +\-\-allow-discards]. + +.PP +\fIbitlkDump\fR +.IP +Dump the header information of a BITLK device. + +Please note that cryptsetup does not use any Windows BitLocker code, please report +all problems related to this compatibility extension to the cryptsetup project. .SH MISCELLANEOUS .PP \fIrepair\fR @@ -483,7 +808,15 @@ for LUKS device type. This command is useful to fix some known benign LUKS metadata header corruptions. Only basic corruptions of unused keyslot are fixable. This command will only change the LUKS header, not -any key-slot data. +any key-slot data. You may enforce LUKS version by adding \-\-type +option. + +It also repairs (upgrades) LUKS2 reencryption metadata by adding +metadata digest that protects it against malicious changes. + +If LUKS2 reencryption was interrupted in the middle of writting +reencryption segment the repair command can be used to perform +reencryption recovery so that reencryption can continue later. \fBWARNING:\fR Always create a binary backup of the original header before calling this command. @@ -491,7 +824,7 @@ header before calling this command. \fIbenchmark\fR .IP Benchmarks ciphers and KDF (key derivation function). -Without parameters it tries to measure few common configurations. +Without parameters, it tries to measure few common configurations. To benchmark other ciphers or modes, you need to specify \fB\-\-cipher\fR and \fB\-\-key\-size\fR options or \fB\-\-hash\fR for KDF test. @@ -511,19 +844,25 @@ If you are configuring kernel yourself, enable .B "\-\-verbose, \-v" Print more information on command execution. .TP -.B "\-\-debug" +.B "\-\-debug or \-\-debug\-json" Run in debug mode with full diagnostic logs. Debug output lines are always prefixed by '#'. +If \-\-debug\-json is used, additional LUKS2 JSON data structures are printed. +.TP +.B "\-\-type +Specifies required device type, for more info read \fIBASIC ACTIONS\fR section. .TP .B "\-\-hash, \-h \fI\fR" -Specifies the passphrase hash for \fIopen\fR (for plain and loopaes device types). +Specifies the passphrase hash for \fIopen\fR (for plain and +loopaes device types). Specifies the hash used in the LUKS key setup scheme and volume key digest -for \fIluksFormat\fR. +for \fIluksFormat\fR. The specified hash is used as hash-parameter +for PBKDF2 and for the AF splitter. The specified hash name is passed to the compiled-in crypto backend. Different backends may support different hashes. -For \fIluksFormat\fR, the hash +For \fIluksFormat\fR, the hash algorithm must provide at least 160 bits of output, which excludes, e.g., MD5. Do not use a non-crypto hash like \fB"crc32"\fR as this breaks security. @@ -542,6 +881,11 @@ The current default in the distributed sources is "aes-cbc-essiv:sha256" for plain dm-crypt and "aes-xts-plain64" for LUKS. +If a hash is part of the cipher specification, then it is +used as part of the IV generation. For example, ESSIV +needs a hash function, while "plain64" does not and +hence none is specified. + For XTS mode you can optionally set a key size of 512 bits with the \-s option. Key size for XTS mode is twice that for other modes for the same @@ -574,18 +918,18 @@ See section \fBNOTES ON PASSPHRASE PROCESSING\fR for more information. .TP .B "\-\-keyfile\-offset \fIvalue\fR" Skip \fIvalue\fR bytes at the beginning of the key file. -Works with all commands that accepts key files. +Works with all commands that accept key files. .TP .B "\-\-keyfile\-size, \-l \fIvalue\fR" Read a maximum of \fIvalue\fR bytes from the key file. -Default is to read the whole file up to the compiled-in +The default is to read the whole file up to the compiled-in maximum that can be queried with \-\-help. Supplying more data than the compiled-in maximum aborts the operation. This option is useful to cut trailing newlines, for example. If \-\-keyfile\-offset is also given, the size count starts after the offset. -Works with all commands that accepts key files. +Works with all commands that accept key files. .TP .B "\-\-new\-keyfile\-offset \fIvalue\fR" Skip \fIvalue\fR bytes at the start when @@ -595,7 +939,7 @@ adding a new passphrase from key file with .B "\-\-new\-keyfile\-size \fIvalue\fR" Read a maximum of \fIvalue\fR bytes when adding a new passphrase from key file with \fIluksAddKey\fR. -Default is to read the whole file up to the compiled-in +The default is to read the whole file up to the compiled-in maximum length that can be queried with \-\-help. Supplying more than the compiled in maximum aborts the operation. @@ -612,15 +956,19 @@ LUKS header and all other parameters are the same, then the new header decrypts the data encrypted with the header the master key was taken from. +Action \fIluksDump\fR together with \-\-dump\-master\-key +option: The volume (master) key is stored in a file instead of +being printed out to standard output. + \fBWARNING:\fR If you create your own master key, you -need to make sure to do it right. Otherwise you can end +need to make sure to do it right. Otherwise, you can end up with a low-entropy or otherwise partially predictable master key which will compromise security. For \fIluksAddKey\fR this allows adding a new passphrase -without having to know an exiting one. +without having to know an existing one. -For \fIopen\fR this allows to open the LUKS device +For \fIopen\fR this allows one to open the LUKS device without giving a passphrase. .TP .B "\-\-dump\-master\-key" @@ -628,6 +976,11 @@ For \fIluksDump\fR this option includes the master key in the displayed information. Use with care, as the master key can be used to bypass the passphrases, see also option \-\-master\-key\-file. .TP +.B "\-\-json\-file" +Read token json from a file or write token to it. See \fItoken\fR action for more +information. \-\-json\-file=- reads json from standard input or writes it to +standard output respectively. +.TP .B "\-\-use\-random" .TP .B "\-\-use\-urandom" @@ -670,27 +1023,44 @@ All other LUKS actions will use the key-size specified in the LUKS header. Use \fIcryptsetup \-\-help\fR to show the compiled-in defaults. .TP .B "\-\-size, \-b " -Force the size of the underlying device in sectors of 512 bytes. +Set the size of the device in sectors of 512 bytes. This option is only relevant for the \fIopen\fR and \fIresize\fR actions. .TP .B "\-\-offset, \-o " Start offset in the backend device in 512-byte sectors. This option is only relevant for the \fIopen\fR action with plain -or loopaes device types. +or loopaes device types or for LUKS devices in \fIluksFormat\fR. + +For LUKS, the \-\-offset option sets the data offset (payload) of data +device and must be be aligned to 4096-byte sectors (must be multiple of 8). +This option cannot be combined with \-\-align\-payload option. .TP .B "\-\-skip, \-p " -How many sectors of the encrypted data to skip at the beginning. +Start offset used in IV calculation in 512-byte sectors +(how many sectors of the encrypted data to skip at the beginning). This option is only relevant for the \fIopen\fR action with plain or loopaes device types. -This is different from the \-\-offset options with respect to -the sector numbers used in IV calculation. -Using \-\-offset will shift the IV calculation by the same negative amount. -Hence, if \-\-offset \fIn\fR, sector \fIn\fR will get a sector -number of \fI0\fR for the IV calculation. -Using \-\-skip causes sector \fIn\fR to also be the first sector -of the mapped device, but with its number for IV generation is \fIn\fR. +Hence, if \-\-offset \fIn\fR, and \-\-skip \fIs\fR, sector \fIn\fR +(the first sector of the encrypted device) will get a sector number +of \fIs\fR for the IV calculation. +.TP +.B "\-\-device\-size \fIsize[units]\fR" +Instead of real device size, use specified value. + +With \fIreencrypt\fR action it means that only specified area +(from the start of the device to the specified size) will be +reencrypted. + +With \fIresize\fR action it sets new size of the device. + +If no unit suffix is specified, the size is in bytes. + +Unit suffix can be S for 512 byte sectors, K/M/G/T (or KiB,MiB,GiB,TiB) +for units with 1024 base or KB/MB/GB/TB for 1000 base (SI scale). + +\fBWARNING:\fR This is destructive operation when used with reencrypt command. .TP .B "\-\-readonly, \-r" set up a read-only mapping. @@ -698,29 +1068,88 @@ set up a read-only mapping. .B "\-\-shared" Creates an additional mapping for one common ciphertext device. Arbitrary mappings are supported. -This option is only relevant for the +This option is only relevant for the \fIopen \-\-type plain\fR action. Use \-\-offset, \-\-size and \-\-skip to specify the mapped area. .TP +.B "\-\-pbkdf " +Set Password-Based Key Derivation Function (PBKDF) algorithm for LUKS keyslot. +The PBKDF can be: \fIpbkdf2\fR (for PBKDF2 according to RFC2898), +\fIargon2i\fR for Argon2i or \fIargon2id\fR for Argon2id +(see https://www.cryptolux.org/index.php/Argon2 for more info). + +For LUKS1, only PBKDF2 is accepted (no need to use this option). +The default PBKDF2 for LUKS2 is set during compilation time +and is available in \fIcryptsetup \-\-help\fR output. + +A PBKDF is used for increasing dictionary and brute-force attack cost +for keyslot passwords. The parameters can be time, memory and parallel cost. + +For PBKDF2, only time cost (number of iterations) applies. +For Argon2i/id, there is also memory cost (memory required during +the process of key derivation) and parallel cost (number of threads +that run in parallel during the key derivation. + +Note that increasing memory cost also increases time, so the final +parameter values are measured by a benchmark. The benchmark +tries to find iteration time (\fI\-\-iter\-time\fR) with required +memory cost \fI\-\-pbkdf\-memory\fR. If it is not possible, +the memory cost is decreased as well. +The parallel cost \fI\-\-pbkdf\-parallel\fR is constant, is is checked +against available CPU cores (if not available, it is decreased) and the maximum +parallel cost is 4. + +You can see all PBKDF parameters for particular LUKS2 keyslot with +\fIluksDump\fR command. + +\fBNOTE:\fR If you do not want to use benchmark and want to specify +all parameters directly, use \fI\-\-pbkdf\-force\-iterations\fR with +\fI\-\-pbkdf\-memory\fR and \fI\-\-pbkdf\-parallel\fR. +This will override the values without benchmarking. +Note it can cause extremely long unlocking time. Use only in specific +cases, for example, if you know that the formatted device will +be used on some small embedded system. +In this case, the LUKS PBKDF2 digest will be set to the minimum iteration count. +.TP .B "\-\-iter\-time, \-i " -The number of milliseconds to spend with PBKDF2 passphrase processing. +The number of milliseconds to spend with PBKDF passphrase processing. This option is only relevant for LUKS operations that set or change passphrases, such as \fIluksFormat\fR or \fIluksAddKey\fR. Specifying 0 as parameter selects the compiled-in default. .TP +.B "\-\-pbkdf\-memory " +Set the memory cost for PBKDF (for Argon2i/id the number represents kilobytes). +Note that it is maximal value, PBKDF benchmark or available physical memory +can decrease it. +This option is not available for PBKDF2. +.TP +.B "\-\-pbkdf\-parallel " +Set the parallel cost for PBKDF (number of threads, up to 4). +Note that it is maximal value, it is decreased automatically if +CPU online count is lower. +This option is not available for PBKDF2. +.TP +.B "\-\-pbkdf\-force\-iterations " +Avoid PBKDF benchmark and set time cost (iterations) directly. +It can be used for LUKS/LUKS2 device only. +See \fI\-\-pbkdf\fR option for more info. +.TP .B "\-\-batch\-mode, \-q" Suppresses all confirmation questions. Use with care! If the \-y option is not specified, this option also switches off the passphrase verification for \fIluksFormat\fR. .TP +.B "\-\-progress-frequency " +Print separate line every with wipe progress. +.TP .B "\-\-timeout, \-t " The number of seconds to wait before timeout on passphrase input via terminal. It is relevant every time a passphrase is asked, for example for \fIopen\fR, \fIluksFormat\fR or \fIluksAddKey\fR. It has no effect if used in conjunction with \-\-key-file. .br -This option is useful when the system +This option is useful when the system should not stall if the user does not input a passphrase, e.g. during boot. The default is a value of 0 seconds, which means to wait forever. @@ -737,51 +1166,88 @@ Align payload at a boundary of \fIvalue\fR 512-byte sectors. This option is relevant for \fIluksFormat\fR. If not specified, cryptsetup tries to use the topology info -provided by kernel for the underlying device to get optimal alignment. +provided by the kernel for the underlying device to get the optimal alignment. If not available (or the calculated value is a multiple of the default) data is by default aligned to a 1MiB boundary (i.e. 2048 512-byte sectors). -For a detached LUKS header this option specifies the offset on the +For a detached LUKS header, this option specifies the offset on the data device. See also the \-\-header option. + +\fBWARNING:\fR This option is DEPRECATED and has often unexpected impact +to the data offset and keyslot area size (for LUKS2) due to the complex rounding. +For fixed data device offset use \fI\-\-offset\fR option instead. + .TP .B "\-\-uuid=\fIUUID\fR" Use the provided \fIUUID\fR for the \fIluksFormat\fR command -instead of generating new one. Changes the existing UUID when +instead of generating a new one. Changes the existing UUID when used with the \fIluksUUID\fR command. The UUID must be provided in the standard UUID format, e.g. 12345678-1234-1234-1234-123456789abc. .TP .B "\-\-allow\-discards\fR" -Allow the use of discard (TRIM) requests for device. +Allow the use of discard (TRIM) requests for the device. This option is only relevant for \fIopen\fR action. +This is also not supported for LUKS2 devices with data integrity protection. \fBWARNING:\fR This command can have a negative security impact because it can make filesystem-level operations visible on the physical device. For example, information leaking filesystem type, used space, etc. may be extractable from the physical device if the discarded blocks can be located -later. If in doubt, do no use it. +later. If in doubt, do not use it. -A kernel version of 3.1 or later is needed. For earlier kernels +A kernel version of 3.1 or later is needed. For earlier kernels, this option is ignored. .TP +.B "\-\-perf\-same_cpu_crypt\fR" +Perform encryption using the same cpu that IO was submitted on. +The default is to use an unbound workqueue so that encryption work +is automatically balanced between available CPUs. +This option is only relevant for \fIopen\fR action. + +\fBNOTE:\fR This option is available only for low-level dm-crypt +performance tuning, use only if you need a change to default dm-crypt +behaviour. Needs kernel 4.0 or later. +.TP +.B "\-\-perf\-submit_from_crypt_cpus\fR" +Disable offloading writes to a separate thread after encryption. +There are some situations where offloading write bios from the +encryption threads to a single thread degrades performance +significantly. The default is to offload write bios to the same +thread. +This option is only relevant for \fIopen\fR action. + +\fBNOTE:\fR This option is available only for low-level dm-crypt +performance tuning, use only if you need a change to default dm-crypt +behaviour. Needs kernel 4.0 or later. +.TP +.B "\-\-perf\-no_read_workqueue, \-\-perf\-no_write_workqueue\fR" +Bypass dm-crypt internal workqueue and process read or write requests +synchronously. +This option is only relevant for \fIopen\fR action. + +\fBNOTE:\fR These options are available only for low-level dm-crypt +performance tuning, use only if you need a change to default dm-crypt +behaviour. Needs kernel 5.9 or later. +.TP .B "\-\-test\-passphrase\fR" -Do not activate device, just verify passphrase. +Do not activate the device, just verify passphrase. This option is only relevant for \fIopen\fR action (the device mapping name is not mandatory if this option is used). .TP .B "\-\-header\fR " Use a detached (separated) metadata device or file where the -LUKS header is stored. This options allows to store ciphertext +LUKS header is stored. This option allows one to store ciphertext and LUKS header on different devices. -This option is only relevant for LUKS devices and can be +This option is only relevant for LUKS devices and can be used with the \fIluksFormat\fR, \fIopen\fR, \fIluksSuspend\fR, \fIluksResume\fR, \fIstatus\fR and \fIresize\fR commands. -For \fIluksFormat\fR with a file name as argument to \-\-header, -it has to exist and be large enough to contain the LUKS header. +For \fIluksFormat\fR with a file name as the argument to \-\-header, +the file will be automatically created if it does not exist. See the cryptsetup FAQ for header size calculation. For other commands that change the LUKS header (e.g. \fIluksAddKey\fR), @@ -792,19 +1258,244 @@ If used with \fIluksFormat\fR, the \-\-align\-payload option is taken as absolute sector alignment on ciphertext device and can be zero. \fBWARNING:\fR There is no check whether the ciphertext device specified -actually belongs to the header given. In fact you can specify an +actually belongs to the header given. In fact, you can specify an arbitrary device as the ciphertext device for \fIopen\fR with the \-\-header option. Use with care. .TP -.B "\-\-force\-password\fR" +.B "\-\-header\-backup\-file " +Specify file with header backup for \fIluksHeaderBackup\fR or +\fIluksHeaderRestore\fR actions. +.TP +.B "\-\-force\-password" Do not use password quality checking for new LUKS passwords. This option applies only to \fIluksFormat\fR, \fIluksAddKey\fR and \fIluksChangeKey\fR and is ignored if cryptsetup is built without password quality checking support. -For more info about password quality check, see manual page -for \fBpwquality.conf(5)\fR. +For more info about password quality check, see the manual page +for \fBpwquality.conf(5)\fR and \fBpasswdqc.conf(5)\fR. +.TP +.B "\-\-deferred" +Defers device removal in \fIclose\fR command until the last user closes it. +.TP +.B "\-\-disable\-locks" +Disable lock protection for metadata on disk. +This option is valid only for LUKS2 and ignored for other formats. + +\fBWARNING:\fR Do not use this option unless you run cryptsetup in +a restricted environment where locking is impossible to perform +(where /run directory cannot be used). +.TP +.B "\-\-disable\-keyring" +Do not load volume key in kernel keyring and store it directly +in the dm-crypt target instead. +This option is supported only for the LUKS2 format. +.TP +.B "\-\-key\-description " +Set key description in keyring for use with \fItoken\fR command. +.TP +.B "\-\-priority " +Set a priority for LUKS2 keyslot. +The \fIprefer\fR priority marked slots are tried before \fInormal\fR priority. +The \fIignored\fR priority means, that slot is never used, if not explicitly +requested by \fI\-\-key\-slot\fR option. +.TP +.B "\-\-token\-id" +Specify what token to use in actions \fItoken\fR, \fIopen\fR or \fIresize\fR. +If omitted, all available tokens will be checked before proceeding further with +passphrase prompt. +.TP +.B "\-\-token\-only" +Do not proceed further with action (any of \fItoken\fR, \fIopen\fR or +\fIresize\fR) if token activation failed. Without the option, +action asks for passphrase to proceed further. +.TP +.B "\-\-sector\-size " +Set sector size for use with disk encryption. It must be power of two +and in range 512 - 4096 bytes. The default is 512 bytes sectors. +This option is available only in the LUKS2 mode. + +Note that if sector size is higher than underlying device hardware sector +and there is not integrity protection that uses data journal, using +this option can increase risk on incomplete sector writes during a power fail. + +If used together with \fI\-\-integrity\fR option and dm-integrity journal, +the atomicity of writes is guaranteed in all cases (but it cost write +performance - data has to be written twice). + +Increasing sector size from 512 bytes to 4096 bytes can provide better +performance on most of the modern storage devices and also with some +hw encryption accelerators. +.TP +.B "\-\-iv-large-sectors" +Count Initialization Vector (IV) in larger sector size (if set) instead +of 512 bytes sectors. This option can be used only for \fIopen\fR command +and \fIplain\fR encryption type. + +\fBNOTE:\fR This option does not have any performance or security impact, +use it only for accessing incompatible existing disk images from other systems +that require this option. +.TP +.B "\-\-persistent" +If used with LUKS2 devices and activation commands like \fIopen\fR or \fIrefresh\fR, +the specified activation flags are persistently written into metadata +and used next time automatically even for normal activation. +(No need to use cryptab or other system configuration files.) + +If you need to remove a persistent flag, use \fI\-\-persistent\fR without +the flag you want to remove (e.g. to disable persistently stored discard flag, +use \fI\-\-persistent\fR without \fI\-\-allow-discards\fR). + +Only \fI\-\-allow-discards\fR, \fI\-\-perf\-same_cpu_crypt\fR, +\fI\-\-perf\-submit_from_crypt_cpus\fR, \fI\-\-perf\-no_read_workqueue\fR, +\fI\-\-perf\-no_write_workqueue\fR and \fI\-\-integrity\-no\-journal\fR +can be stored persistently. +.TP +.B "\-\-refresh" +Refreshes an active device with new set of parameters. See action \fIrefresh\fR description +for more details. +.TP +.B "\-\-label