Blame man/cryptsetup.8

Packit 94f725
.TH CRYPTSETUP "8" "January 2019" "cryptsetup" "Maintenance Commands"
Packit 94f725
.SH NAME
Packit 94f725
cryptsetup - manage plain dm-crypt and LUKS encrypted volumes
Packit 94f725
.SH SYNOPSIS
Packit 94f725
.B cryptsetup <options> <action> <action args>
Packit 94f725
.SH DESCRIPTION
Packit 94f725
.PP
Packit 94f725
cryptsetup is used to conveniently setup dm-crypt managed
Packit 94f725
device-mapper mappings. These include plain dm-crypt volumes and
Packit 94f725
LUKS volumes. The difference is that LUKS uses a metadata header
Packit 94f725
and can hence offer more features than plain dm-crypt. On the other
Packit 94f725
hand, the header is visible and vulnerable to damage.
Packit 94f725
Packit 94f725
In addition, cryptsetup provides limited support for the use of
Packit 94f725
loop-AES volumes, TrueCrypt, VeraCrypt and BitLocker compatible volumes.
Packit 94f725
Packit 94f725
.SH PLAIN DM-CRYPT OR LUKS?
Packit 94f725
.PP
Packit 94f725
Unless you understand the cryptographic background well, use LUKS.
Packit 94f725
With plain dm-crypt there are a number of possible user errors
Packit 94f725
that massively decrease security. While LUKS cannot fix them
Packit 94f725
all, it can lessen the impact for many of them.
Packit 94f725
.SH WARNINGS
Packit 94f725
.PP
Packit 94f725
A lot of good information on the risks of using encrypted storage,
Packit 94f725
on handling problems and on security aspects can be found in the
Packit 94f725
\fICryptsetup FAQ\fR. Read it. Nonetheless, some risks deserve
Packit 94f725
to be mentioned here.
Packit 94f725
Packit 94f725
\fBBackup:\fR Storage media die. Encryption has no influence on that.
Packit 94f725
Backup is mandatory for encrypted data as well, if the data has any
Packit 94f725
worth. See the Cryptsetup FAQ for advice on how to do a backup of an
Packit 94f725
encrypted volume.
Packit 94f725
Packit 94f725
\fBCharacter encoding:\fR If you enter a
Packit 94f725
passphrase with special symbols, the passphrase can change
Packit 94f725
depending on character encoding. Keyboard settings can also change,
Packit 94f725
which can make blind input hard or impossible. For
Packit 94f725
example, switching from some ASCII 8-bit variant to UTF-8
Packit 94f725
can lead to a different binary encoding and hence different
Packit 94f725
passphrase seen by cryptsetup, even if what you see on
Packit 94f725
the terminal is exactly the same. It is therefore highly
Packit 94f725
recommended to select passphrase characters only from 7-bit
Packit 94f725
ASCII, as the encoding for 7-bit ASCII stays the same for
Packit 94f725
all ASCII variants and UTF-8.
Packit 94f725
Packit 94f725
\fBLUKS header:\fR If the header of a LUKS volume gets damaged,
Packit 94f725
all data is permanently lost unless you have a header-backup.
Packit 94f725
If a key-slot is damaged, it can only be restored from a header-backup
Packit 94f725
or if another active key-slot with known passphrase is undamaged.
Packit 94f725
Damaging the LUKS header is something people manage to do with
Packit 94f725
surprising frequency. This risk is the result of a trade-off
Packit 94f725
between security and safety, as LUKS is designed for fast and
Packit 94f725
secure wiping by just overwriting header and key-slot area.
Packit 94f725
Packit 94f725
\fBPreviously used partitions:\fR If a partition was previously used,
Packit 94f725
it is a very good idea to wipe filesystem signatures, data, etc. before
Packit 94f725
creating a LUKS or plain dm-crypt container on it.
Packit 94f725
For a quick removal of filesystem signatures, use "wipefs". Take care
Packit 94f725
though that this may not remove everything. In particular, MD RAID
Packit 94f725
signatures at the end of a device may survive. It also does not
Packit 94f725
remove data. For a full wipe, overwrite the whole partition before
Packit 94f725
container creation. If you do not know how to do that, the
Packit 94f725
cryptsetup FAQ describes several options.
Packit 94f725
Packit 94f725
.SH BASIC COMMANDS
Packit 94f725
The following are valid actions for all supported device types.
Packit 94f725
Packit 94f725
\fIopen\fR <device> <name> \-\-type <device_type>
Packit 94f725
.IP
Packit 94f725
Opens (creates a mapping with) <name> backed by device <device>.
Packit 94f725
Packit 94f725
Device type can be \fIplain\fR, \fIluks\fR (default), \fIluks1\fR, \fIluks2\fR,
Packit 94f725
\fIloopaes\fR or \fItcrypt\fR.
Packit 94f725
Packit 94f725
For backward compatibility there are \fBopen\fR command aliases:
Packit 94f725
Packit 94f725
\fBcreate\fR (argument-order <name> <device>): open \-\-type plain
Packit 94f725
.br
Packit 94f725
\fBplainOpen\fR: open \-\-type plain
Packit 94f725
.br
Packit 94f725
\fBluksOpen\fR: open \-\-type luks
Packit 94f725
.br
Packit 94f725
\fBloopaesOpen\fR: open \-\-type loopaes
Packit 94f725
.br
Packit 94f725
\fBtcryptOpen\fR: open \-\-type tcrypt
Packit 94f725
.br
Packit 94f725
\fBbitlkOpen\fR: open \-\-type bitlk
Packit 94f725
Packit 94f725
\fB<options>\fR are type specific and are described below
Packit 94f725
for individual device types. For \fBcreate\fR, the order of the <name>
Packit 94f725
and <device> options is inverted for historical reasons, all other
Packit 94f725
aliases use the standard \fB<device> <name>\fR order.
Packit 94f725
.PP
Packit 94f725
\fIclose\fR <name>
Packit 94f725
.IP
Packit 94f725
Removes the existing mapping <name> and wipes the key from kernel memory.
Packit 94f725
Packit 94f725
For backward compatibility there are \fBclose\fR command aliases:
Packit 94f725
\fBremove\fR, \fBplainClose\fR, \fBluksClose\fR, \fBloopaesClose\fR,
Packit 94f725
\fBtcryptClose\fR (all behaves exactly the same, device type is
Packit 94f725
determined automatically from active device).
Packit 94f725
Packit 94f725
\fB<options>\fR can be [\-\-deferred]
Packit 94f725
Packit 94f725
.PP
Packit 94f725
\fIstatus\fR <name>
Packit 94f725
.IP
Packit 94f725
Reports the status for the mapping <name>.
Packit 94f725
.PP
Packit 94f725
\fIresize\fR <name>
Packit 94f725
.IP
Packit 94f725
Resizes an active mapping <name>.
Packit 94f725
Packit 94f725
If \-\-size (in 512-bytes sectors) or \-\-device\-size are not specified,
Packit 94f725
the size is computed from the underlying device. For LUKS it is the size
Packit 94f725
of the underlying device without the area reserved for LUKS header
Packit 94f725
(see data payload offset in \fBluksDump\fR command).
Packit 94f725
For plain crypt device, the whole device size is used.
Packit 94f725
Packit 94f725
Note that this does not change the raw device geometry, it just
Packit 94f725
changes how many sectors of the raw device are represented
Packit 94f725
in the mapped device.
Packit 94f725
Packit 94f725
If cryptsetup detected volume key for active device loaded in kernel keyring
Packit 94f725
service, resize action would first try to retrieve
Packit 94f725
the key using a token and only if it failed it'd ask for a passphrase
Packit 94f725
to unlock a keyslot (LUKS) or to derive a volume key again (plain mode).
Packit 94f725
The kernel keyring is used by default for LUKS2 devices.
Packit 94f725
Packit 94f725
With LUKS2 device additional \fB<options>\fR can be [\-\-token\-id, \-\-token\-only,
Packit 94f725
\-\-key\-slot, \-\-key\-file, \-\-keyfile\-size, \-\-keyfile\-offset, \-\-timeout,
Packit 94f725
\-\-disable\-locks, \-\-disable\-keyring].
Packit 94f725
Packit 94f725
.PP
Packit 94f725
\fIrefresh\fR <name>
Packit 94f725
.IP
Packit 94f725
Refreshes parameters of active mapping <name>.
Packit 94f725
Packit 94f725
Updates parameters of active device <name> without need to deactivate the device
Packit 94f725
(and umount filesystem). Currently it supports parameters refresh on following
Packit 94f725
devices: LUKS1, LUKS2 (including authenticated encryption), plain crypt
Packit 94f725
and loopaes.
Packit 94f725
Packit 94f725
Mandatory parametrs are identical to those of an open action for respective
Packit 94f725
device type.
Packit 94f725
Packit 94f725
You may change following parameters on all devices \-\-perf\-same_cpu_crypt,
Packit 94f725
\-\-perf\-submit_from_crypt_cpus and \-\-allow\-discards.
Packit 94f725
Packit 94f725
Refreshing device without any optional parameter will refresh the device
Packit 94f725
with default setting (respective to device type).
Packit 94f725
Packit 94f725
\fBLUKS2 only:\fR
Packit 94f725
Packit 94f725
\-\-integrity\-no\-journal parameter affects only LUKS2 devices with
Packit 94f725
underlying dm-integrity device.
Packit 94f725
Packit 94f725
Adding option \-\-persistent stores any combination of device parameters
Packit 94f725
above in LUKS2 metadata (only after successful refresh operation).
Packit 94f725
Packit 94f725
\-\-disable\-keyring parameter refreshes a device with volume key passed
Packit 94f725
in dm-crypt driver.
Packit 94f725
Packit 94f725
.PP
Packit 94f725
\fIreencrypt\fR <device> or --active-name <name> [<new_name>]
Packit 94f725
.IP
Packit 94f725
Run resilient reencryption (LUKS2 device only).
Packit 94f725
Packit 94f725
There are 3 basic modes of operation:
Packit 94f725
Packit 94f725
\(bu device reencryption (\fIreencrypt\fR)
Packit 94f725
Packit 94f725
\(bu device encryption (\fIreencrypt\fR \-\-encrypt)
Packit 94f725
Packit 94f725
\(bu device decryption (\fIreencrypt\fR \-\-decrypt)
Packit 94f725
Packit 94f725
<device> or --active-name <name> is mandatory parameter.
Packit 94f725
Packit 94f725
With <device> parameter cryptsetup looks up active <device> dm mapping.
Packit 94f725
If no active mapping is detected, it starts offline reencryption otherwise online
Packit 94f725
reencryption takes place.
Packit 94f725
Packit 94f725
Reencryption process may be safely interrupted by a user via SIGTERM signal (ctrl+c).
Packit 94f725
Packit 94f725
To resume already initialized or interrupted reencryption, just run the cryptsetup
Packit 94f725
\fIreencrypt\fR command again to continue the reencryption operation.
Packit 94f725
Reencryption may be resumed with different \-\-resilience or \-\-hotzone\-size unless
Packit 94f725
implicit datashift resilience mode is used (reencrypt \-\-encrypt with \-\-reduce-device-size
Packit 94f725
option).
Packit 94f725
Packit 94f725
If the reencryption process was interrupted abruptly (reencryption process crash, system crash, poweroff)
Packit 94f725
it may require recovery. The recovery is currently run automatically on next activation (action \fIopen\fR)
Packit 94f725
when needed.
Packit 94f725
Packit 94f725
Optional parameter <new_name> takes effect only with \-\-encrypt option and it activates device <new_name>
Packit 94f725
immediately after encryption initialization gets finished. That's useful when device needs to be ready
Packit 94f725
as soon as possible and mounted (used) before full data area encryption is completed.
Packit 94f725
Packit 94f725
Action supports following additional \fB<options>\fR [\-\-encrypt, \-\-decrypt, \-\-device\-size,
Packit 94f725
\-\-resilience, \-\-resilience-hash, \-\-hotzone-size, \-\-init\-only, \-\-resume\-only,
Packit 94f725
\-\-reduce\-device\-size].
Packit 94f725
Packit 94f725
.SH PLAIN MODE
Packit 94f725
Plain dm-crypt encrypts the device sector-by-sector with a
Packit 94f725
single, non-salted hash of the passphrase. No checks
Packit 94f725
are performed, no metadata is used. There is no formatting operation.
Packit 94f725
When the raw device is mapped (opened), the usual device operations
Packit 94f725
can be used on the mapped device, including filesystem creation.
Packit 94f725
Mapped devices usually reside in /dev/mapper/<name>.
Packit 94f725
Packit 94f725
The following are valid plain device type actions:
Packit 94f725
Packit 94f725
\fIopen\fR \-\-type plain <device> <name>
Packit 94f725
.br
Packit 94f725
\fIcreate\fR <name> <device> (\fBOBSOLETE syntax\fR)
Packit 94f725
.IP
Packit 94f725
Opens (creates a mapping with) <name> backed by device <device>.
Packit 94f725
Packit 94f725
\fB<options>\fR can be [\-\-hash, \-\-cipher, \-\-verify-passphrase,
Packit 94f725
\-\-sector\-size, \-\-key-file, \-\-keyfile-offset, \-\-key-size,
Packit 94f725
\-\-offset, \-\-skip, \-\-size, \-\-readonly, \-\-shared, \-\-allow\-discards,
Packit 94f725
\-\-refresh]
Packit 94f725
Packit 94f725
Example: 'cryptsetup open \-\-type plain /dev/sda10 e1' maps the raw
Packit 94f725
encrypted device /dev/sda10 to the mapped (decrypted) device
Packit 94f725
/dev/mapper/e1, which can then be mounted, fsck-ed or have a
Packit 94f725
filesystem created on it.
Packit 94f725
.SH LUKS EXTENSION
Packit 94f725
LUKS, the Linux Unified Key Setup, is a standard for disk encryption.
Packit 94f725
It adds a standardized header at the start of the device,
Packit 94f725
a key-slot area directly behind the header and the bulk
Packit 94f725
data area behind that. The whole set is called a 'LUKS container'.
Packit 94f725
The device that a LUKS container resides on is called a 'LUKS device'.
Packit 94f725
For most purposes, both terms can be used interchangeably. But
Packit 94f725
note that when the LUKS header is at a nonzero offset
Packit 94f725
in a device, then the device is not a LUKS device anymore, but
Packit 94f725
has a LUKS container stored in it at an offset.
Packit 94f725
Packit 94f725
LUKS can manage multiple passphrases that can be individually revoked
Packit 94f725
or changed and that can be securely scrubbed from persistent
Packit 94f725
media due to the use of anti-forensic stripes. Passphrases
Packit 94f725
are protected against brute-force and dictionary
Packit 94f725
attacks by PBKDF2, which implements hash iteration and salting
Packit 94f725
in one function.
Packit 94f725
Packit 94f725
LUKS2 is a new version of header format that allows additional
Packit 94f725
extensions like different PBKDF algorithm or authenticated encryption.
Packit 94f725
You can format device with LUKS2 header if you specify
Packit 94f725
\fI\-\-type luks2\fR in \fIluksFormat\fR command.
Packit 94f725
For activation, the format is already recognized automatically.
Packit 94f725
Packit 94f725
Each passphrase, also called a
Packit 94f725
.B key
Packit 94f725
in this document, is associated with one of 8 key-slots.
Packit 94f725
Key operations that do not specify a slot affect the first slot
Packit 94f725
that matches the supplied passphrase or the first empty slot if
Packit 94f725
a new passphrase is added.
Packit 94f725
Packit 94f725
The \fB<device>\fR parameter can also be specified by a LUKS UUID in the
Packit 94f725
format UUID=<uuid>. Translation to real device name uses symlinks
Packit 94f725
in /dev/disk/by-uuid directory.
Packit 94f725
Packit 94f725
To specify a detached header, the \fB\-\-header\fR parameter can be used
Packit 94f725
in all LUKS commands and always takes precedence over the positional
Packit 94f725
\fB<device>\fR parameter.
Packit 94f725
Packit 94f725
The following are valid LUKS actions:
Packit 94f725
Packit 94f725
\fIluksFormat\fR <device> [<key file>]
Packit 94f725
.IP
Packit 94f725
Initializes a LUKS partition and sets the initial passphrase
Packit 94f725
(for key-slot 0),
Packit 94f725
either via prompting or via <key file>. Note that
Packit 94f725
if the second argument is present, then the passphrase
Packit 94f725
is taken from the file given there, without the need
Packit 94f725
to use the \-\-key-file option. Also note that for both forms
Packit 94f725
of reading the passphrase from a file you can
Packit 94f725
give '-' as file name, which results in the passphrase being read
Packit 94f725
from stdin and the safety-question being skipped.
Packit 94f725
Packit 94f725
You can only call luksFormat on a LUKS device that is not mapped.
Packit 94f725
Packit 94f725
To use LUKS2, specify \fI\-\-type luks2\fR.
Packit 94f725
Packit 94f725
\fB<options>\fR can be [\-\-hash, \-\-cipher, \-\-verify\-passphrase,
Packit 94f725
\-\-key\-size, \-\-key\-slot,
Packit 94f725
\-\-key\-file (takes precedence over optional second argument),
Packit 94f725
\-\-keyfile\-offset, \-\-keyfile\-size, \-\-use\-random | \-\-use\-urandom,
Packit 94f725
\-\-uuid, \-\-master\-key\-file, \-\-iter\-time, \-\-header,
Packit 94f725
\-\-pbkdf\-force\-iterations,
Packit 94f725
\-\-force\-password, \-\-disable-locks].
Packit 94f725
Packit 94f725
For LUKS2, additional \fB<options>\fR can be
Packit 94f725
[\-\-integrity, \-\-integrity\-no\-wipe, \-\-sector\-size,
Packit 94f725
\-\-label, \-\-subsystem,
Packit 94f725
\-\-pbkdf, \-\-pbkdf\-memory, \-\-pbkdf\-parallel,
Packit 94f725
\-\-disable\-locks, \-\-disable\-keyring,
Packit 94f725
\-\-luks2\-metadata\-size, \-\-luks2\-keyslots\-size,
Packit 94f725
\-\-keyslot\-cipher, \-\-keyslot\-key\-size].
Packit 94f725
Packit 94f725
\fBWARNING:\fR Doing a luksFormat on an existing LUKS container will
Packit 94f725
make all data the old container permanently irretrievable unless
Packit 94f725
you have a header backup.
Packit 94f725
.PP
Packit 94f725
\fIopen\fR \-\-type luks <device> <name>
Packit 94f725
.br
Packit 94f725
\fIluksOpen\fR <device> <name> (\fBold syntax\fR)
Packit 94f725
.IP
Packit 94f725
Opens the LUKS device <device> and sets up a mapping <name> after
Packit 94f725
successful verification of the supplied passphrase.
Packit 94f725
Packit 94f725
First, the passphrase is searched in LUKS tokens. If it's not
Packit 94f725
found in any token and also the passphrase is not supplied via \-\-key-file,
Packit 94f725
the command prompts for it interactively.
Packit 94f725
Packit 94f725
\fB<options>\fR can be [\-\-key\-file, \-\-keyfile\-offset,
Packit 94f725
\-\-keyfile\-size, \-\-readonly, \-\-test\-passphrase,
Packit 94f725
\-\-allow\-discards, \-\-header, \-\-key-slot, \-\-master\-key\-file, \-\-token\-id,
Packit 94f725
\-\-token\-only, \-\-disable\-keyring, \-\-disable\-locks, \-\-type, \-\-refresh,
Packit 94f725
\-\-serialize\-memory\-hard\-pbkdf].
Packit 94f725
.PP
Packit 94f725
\fIluksSuspend\fR <name>
Packit 94f725
.IP
Packit 94f725
Suspends an active device (all IO operations will block
Packit 94f725
and accesses to the device will wait indefinitely)
Packit 94f725
and wipes the encryption
Packit 94f725
key from kernel memory. Needs kernel 2.6.19 or later.
Packit 94f725
Packit 94f725
After this operation you have to use \fIluksResume\fR to reinstate
Packit 94f725
the encryption key and unblock the device or \fIclose\fR to remove
Packit 94f725
the mapped device.
Packit 94f725
Packit 94f725
\fBWARNING:\fR never suspend the device on which the cryptsetup binary resides.
Packit 94f725
Packit 94f725
\fB<options>\fR can be [\-\-header, \-\-disable\-locks].
Packit 94f725
.PP
Packit 94f725
\fIluksResume\fR <name>
Packit 94f725
.IP
Packit 94f725
Resumes a suspended device and reinstates the encryption key.
Packit 94f725
Prompts interactively for a passphrase if \-\-key-file is not given.
Packit 94f725
Packit 94f725
\fB<options>\fR can be [\-\-key\-file, \-\-keyfile\-size, \-\-header,
Packit 94f725
\-\-disable\-keyring, \-\-disable\-locks, \-\-type]
Packit 94f725
.PP
Packit 94f725
\fIluksAddKey\fR <device> [<key file with new key>]
Packit 94f725
.IP
Packit 94f725
Adds a new passphrase. An existing passphrase must be supplied
Packit 94f725
interactively or via \-\-key-file.
Packit 94f725
The new passphrase to be added can be specified interactively
Packit 94f725
or read from the file given as positional argument.
Packit 94f725
Packit 94f725
\fBNOTE:\fR with \-\-unbound option the action creates new unbound
Packit 94f725
LUKS2 keyslot. The keyslot cannot be used for device activation.
Packit 94f725
If you don't pass new key via \-\-master\-key\-file option,
Packit 94f725
new random key is generated. Existing passphrase for any active keyslot
Packit 94f725
is not required.
Packit 94f725
Packit 94f725
\fB<options>\fR can be [\-\-key\-file, \-\-keyfile\-offset,
Packit 94f725
\-\-keyfile\-size, \-\-new\-keyfile\-offset,
Packit 94f725
\-\-new\-keyfile\-size, \-\-key\-slot, \-\-master\-key\-file,
Packit 94f725
\-\-force\-password, \-\-header, \-\-disable\-locks,
Packit 94f725
\-\-iter-time, \-\-pbkdf, \-\-pbkdf\-force\-iterations,
Packit 94f725
\-\-unbound, \-\-type, \-\-keyslot\-cipher, \-\-keyslot\-key\-size].
Packit 94f725
.PP
Packit 94f725
\fIluksRemoveKey\fR <device> [<key file with passphrase to be removed>]
Packit 94f725
.IP
Packit 94f725
Removes the supplied passphrase from the LUKS device. The
Packit 94f725
passphrase to be removed can be specified interactively,
Packit 94f725
as the positional argument or via \-\-key-file.
Packit 94f725
Packit 94f725
\fB<options>\fR can be [\-\-key\-file, \-\-keyfile\-offset,
Packit 94f725
\-\-keyfile\-size, \-\-header, \-\-disable\-locks, \-\-type]
Packit 94f725
Packit 94f725
\fBWARNING:\fR If you read the passphrase from stdin
Packit 94f725
(without further argument or with '-' as an argument
Packit 94f725
to \-\-key\-file), batch-mode (\-q) will be implicitly
Packit 94f725
switched on and no warning will be given when you remove the
Packit 94f725
last remaining passphrase from a LUKS container. Removing
Packit 94f725
the last passphrase makes the LUKS container permanently
Packit 94f725
inaccessible.
Packit 94f725
.PP
Packit 94f725
\fIluksChangeKey\fR <device> [<new key file>]
Packit 94f725
.IP
Packit 94f725
Changes an existing passphrase. The passphrase
Packit 94f725
to be changed must be supplied interactively or via \-\-key\-file.
Packit 94f725
The new passphrase can be supplied interactively or in
Packit 94f725
a file given as positional argument.
Packit 94f725
Packit 94f725
If a key-slot is specified (via \-\-key-slot), the passphrase
Packit 94f725
for that key-slot must be given and the new passphrase
Packit 94f725
will overwrite the specified key-slot. If no key-slot
Packit 94f725
is specified and there is still a free key-slot, then
Packit 94f725
the new passphrase will be put into a free key-slot before the
Packit 94f725
key-slot containing the old passphrase is purged. If there is
Packit 94f725
no free key-slot, then the key-slot with the old passphrase is
Packit 94f725
overwritten directly.
Packit 94f725
Packit 94f725
\fBWARNING:\fR If a key-slot is overwritten, a media failure
Packit 94f725
during this operation can cause the overwrite to fail after
Packit 94f725
the old passphrase has been wiped and make the LUKS container
Packit 94f725
inaccessible.
Packit 94f725
Packit 94f725
\fB<options>\fR can be [\-\-key\-file, \-\-keyfile\-offset,
Packit 94f725
\-\-keyfile\-size, \-\-new\-keyfile\-offset,
Packit 94f725
\-\-iter-time, \-\-pbkdf, \-\-pbkdf\-force\-iterations,
Packit 94f725
\-\-new\-keyfile\-size, \-\-key\-slot, \-\-force\-password, \-\-header,
Packit 94f725
\-\-disable\-locks, \-\-type, \-\-keyslot\-cipher, \-\-keyslot\-key\-size].
Packit 94f725
.PP
Packit 94f725
.PP
Packit 94f725
\fIluksConvertKey\fR <device>
Packit 94f725
.IP
Packit 94f725
Converts an existing LUKS2 keyslot to new pbkdf parameters. The
Packit 94f725
passphrase for keyslot to be converted must be supplied interactively
Packit 94f725
or via \-\-key\-file. If no \-\-pbkdf parameters are specified LUKS2
Packit 94f725
default pbkdf values will apply.
Packit 94f725
Packit 94f725
If a keyslot is specified (via \-\-key\-slot), the passphrase for that
Packit 94f725
keyslot must be given. If no keyslot is specified and there is still
Packit 94f725
a free keyslot, then the new parameters will be put into a free
Packit 94f725
keyslot before the keyslot containing the old parameters is
Packit 94f725
purged. If there is no free keyslot, then the keyslot with the old
Packit 94f725
parameters is overwritten directly.
Packit 94f725
Packit 94f725
\fBWARNING:\fR If a keyslot is overwritten, a media failure during
Packit 94f725
this operation can cause the overwrite to fail after the old
Packit 94f725
parameters have been wiped and make the LUKS container inaccessible.
Packit 94f725
Packit 94f725
\fB<options>\fR can be [\-\-key\-file, \-\-keyfile\-offset,
Packit 94f725
\-\-keyfile\-size, \-\-key\-slot, \-\-header, \-\-disable\-locks,
Packit 94f725
\-\-iter-time, \-\-pbkdf, \-\-pbkdf\-force\-iterations,
Packit 94f725
\-\-pbkdf\-memory, \-\-pbkdf\-parallel,
Packit 94f725
\-\-keyslot\-cipher, \-\-keyslot\-key\-size].
Packit 94f725
.PP
Packit 94f725
\fIluksKillSlot\fR <device> <key slot number>
Packit 94f725
.IP
Packit 94f725
Wipe the key-slot number <key slot> from the LUKS device. Except running
Packit 94f725
in batch-mode (\-q) a remaining passphrase must be supplied,
Packit 94f725
either interactively or via \-\-key-file.
Packit 94f725
This command can remove the last remaining key-slot, but requires
Packit 94f725
an interactive confirmation when doing so. Removing the last
Packit 94f725
passphrase makes a LUKS container permanently inaccessible.
Packit 94f725
Packit 94f725
\fB<options>\fR can be [\-\-key\-file, \-\-keyfile\-offset,
Packit 94f725
\-\-keyfile\-size, \-\-header, \-\-disable\-locks, \-\-type].
Packit 94f725
Packit 94f725
\fBWARNING:\fR If you read the passphrase from stdin
Packit 94f725
(without further argument or with '-' as an argument
Packit 94f725
to \-\-key-file), batch-mode (\-q) will be implicitly
Packit 94f725
switched on and no warning will be given when you remove the
Packit 94f725
last remaining passphrase from a LUKS container. Removing
Packit 94f725
the last passphrase makes the LUKS container permanently
Packit 94f725
inaccessible.
Packit 94f725
Packit 94f725
\fBNOTE:\fR If there is no passphrase provided (on stdin or through
Packit 94f725
\-\-key-file argument) and batch-mode (\-q) is active, the
Packit 94f725
key-slot is removed without any other warning.
Packit 94f725
Packit 94f725
.PP
Packit 94f725
\fIerase\fR <device>
Packit 94f725
.br
Packit 94f725
\fIluksErase\fR <device>
Packit 94f725
.IP
Packit 94f725
Erase all keyslots and make the LUKS container permanently inaccessible.
Packit 94f725
You do not need to provide any password for this operation.
Packit 94f725
Packit 94f725
\fBWARNING:\fR This operation is irreversible.
Packit 94f725
.PP
Packit 94f725
\fIluksUUID\fR <device>
Packit 94f725
.IP
Packit 94f725
Print the UUID of a LUKS device.
Packit 94f725
.br
Packit 94f725
Set new UUID if \fI\-\-uuid\fR option is specified.
Packit 94f725
.PP
Packit 94f725
\fIisLuks\fR <device>
Packit 94f725
.IP
Packit 94f725
Returns true, if <device> is a LUKS device, false otherwise.
Packit 94f725
Use option \-v to get human-readable feedback. 'Command successful.'
Packit 94f725
means the device is a LUKS device.
Packit 94f725
Packit 94f725
By specifying \-\-type you may query for specific LUKS version.
Packit 94f725
.PP
Packit 94f725
\fIluksDump\fR <device>
Packit 94f725
.IP
Packit 94f725
Dump the header information of a LUKS device.
Packit 94f725
Packit 94f725
If the \-\-dump\-master\-key option is used, the LUKS device master key is
Packit 94f725
dumped instead of the keyslot info. Together with \-\-master\-key\-file option,
Packit 94f725
master key is dumped to a file instead of standard output. Beware that the
Packit 94f725
master key cannot be changed without reencryption and can be used to decrypt
Packit 94f725
the data stored in the LUKS container without a passphrase and even without the
Packit 94f725
LUKS header. This means that if the master key is compromised, the whole device
Packit 94f725
has to be erased or reencrypted to prevent further access. Use this option carefully.
Packit 94f725
Packit 94f725
To dump the master key, a passphrase has to be supplied,
Packit 94f725
either interactively or via \-\-key\-file.
Packit 94f725
Packit 94f725
To dump unbound key (LUKS2 format only), \-\-unbound parameter, specific \-\-key-slot
Packit 94f725
id and proper passphrase has to be supplied, either interactively or via \-\-key\-file.
Packit 94f725
Optional \-\-master\-key\-file parameter enables unbound keyslot dump to a file.
Packit 94f725
Packit 94f725
\fB<options>\fR can be [\-\-dump\-master\-key, \-\-key\-file,
Packit 94f725
\-\-keyfile\-offset, \-\-keyfile\-size, \-\-header, \-\-disable\-locks,
Packit 94f725
\-\-master\-key\-file, \-\-type, \-\-unbound, \-\-key-slot].
Packit 94f725
Packit 94f725
\fBWARNING:\fR If \-\-dump\-master\-key is used with \-\-key\-file
Packit 94f725
and the argument to \-\-key\-file is '-', no validation question
Packit 94f725
will be asked and no warning given.
Packit 94f725
.PP
Packit 94f725
\fIluksHeaderBackup\fR <device> \-\-header\-backup\-file <file>
Packit 94f725
.IP
Packit 94f725
Stores a binary backup of the LUKS header and keyslot area.
Packit 94f725
.br
Packit 94f725
Note: Using '-' as filename writes the header backup to a file named '-'.
Packit 94f725
Packit 94f725
\fBWARNING:\fR This backup file and a passphrase valid
Packit 94f725
at the time of backup allows decryption of the
Packit 94f725
LUKS data area, even if the passphrase was later changed or
Packit 94f725
removed from the LUKS device. Also note that with a header
Packit 94f725
backup you lose the ability to securely wipe the LUKS
Packit 94f725
device by just overwriting the header and key-slots. You
Packit 94f725
either need to securely erase all header backups in
Packit 94f725
addition or overwrite the encrypted data area as well.
Packit 94f725
The second option is less secure, as some sectors
Packit 94f725
can survive, e.g. due to defect management.
Packit 94f725
.PP
Packit 94f725
\fIluksHeaderRestore\fR <device> \-\-header\-backup\-file <file>
Packit 94f725
.IP
Packit 94f725
Restores a binary backup of the LUKS header and keyslot area
Packit 94f725
from the specified file.
Packit 94f725
.br
Packit 94f725
Note: Using '-' as filename reads the header backup from a file named '-'.
Packit 94f725
Packit 94f725
\fBWARNING:\fR Header and keyslots will be replaced, only
Packit 94f725
the passphrases from the backup will work afterward.
Packit 94f725
Packit 94f725
This command requires that the master key size and data offset
Packit 94f725
of the LUKS header already on the device and of the header backup
Packit 94f725
match. Alternatively, if there is no LUKS header on the device,
Packit 94f725
the backup will also be written to it.
Packit 94f725
.PP
Packit 94f725
\fItoken\fR <add|remove|import|export> <device>
Packit 94f725
.IP
Packit 94f725
Action \fIadd\fR creates new keyring token to enable auto-activation of the device.
Packit 94f725
For the auto-activation, the passphrase must be stored in keyring with the specified
Packit 94f725
description. Usually, the passphrase should be stored in \fIuser\fR or
Packit 94f725
\fIuser-session\fR keyring.
Packit 94f725
The \fItoken\fR command is supported only for LUKS2.
Packit 94f725
Packit 94f725
For adding new keyring token, option \-\-key\-description is mandatory.
Packit 94f725
Also, new token is assigned to key slot specified with \-\-key\-slot option or to all
Packit 94f725
active key slots in the case \-\-key\-slot option is omitted.
Packit 94f725
Packit 94f725
To remove existing token, specify the token ID which should be removed with
Packit 94f725
\-\-token\-id option.
Packit 94f725
Packit 94f725
\fBWARNING:\fR The action \fItoken remove\fR removes any token type, not just \fIkeyring\fR
Packit 94f725
type from token slot specified by \-\-token\-id option.
Packit 94f725
Packit 94f725
Action \fIimport\fR can store arbitrary valid token json in LUKS2 header. It may be passed via
Packit 94f725
standard input or via file passed in \-\-json\-file option. If you specify \-\-key\-slot then
Packit 94f725
successfully imported token is also assigned to the key slot.
Packit 94f725
Packit 94f725
Action \fIexport\fR writes requested token json to a file passed with \-\-json\-file or
Packit 94f725
to standard output.
Packit 94f725
Packit 94f725
\fB<options>\fR can be [\-\-header, \-\-token\-id, \-\-key\-slot, \-\-key\-description,
Packit 94f725
\-\-disable\-locks, \-\-disable\-keyring, \-\-json\-file].
Packit 94f725
.PP
Packit 94f725
\fIconvert\fR <device> \-\-type <format>
Packit 94f725
.IP
Packit 94f725
Converts the device between LUKS1 and LUKS2 format (if possible).
Packit 94f725
The conversion will not be performed if there is an additional LUKS2 feature or LUKS1 has
Packit 94f725
unsupported header size.
Packit 94f725
Packit 94f725
Conversion (both directions) must be performed on inactive device. There must not be active
Packit 94f725
dm-crypt mapping established for LUKS header requested for conversion.
Packit 94f725
Packit 94f725
\fB\-\-type\fR option is mandatory with following accepted values: \fIluks1\fR or \fIluks2\fR.
Packit 94f725
Packit 94f725
\fBWARNING:\fR The \fIconvert\fR action can destroy the LUKS header in the case of a crash
Packit 94f725
during conversion or if a media error occurs.
Packit 94f725
Always create a header backup before performing this operation!
Packit 94f725
Packit 94f725
\fB<options>\fR can be [\-\-header, \-\-type].
Packit 94f725
.PP
Packit 94f725
\fIconfig\fR <device>
Packit 94f725
.IP
Packit 94f725
Set permanent configuration options (store to LUKS header).
Packit 94f725
The \fIconfig\fR command is supported only for LUKS2.
Packit 94f725
Packit 94f725
The permanent options can be \fI\-\-priority\fR to set priority (normal, prefer, ignore)
Packit 94f725
for keyslot (specified by \fI\-\-key\-slot\fR) or \fI\-\-label\fR and \fI\-\-subsystem\fR.
Packit 94f725
Packit 94f725
\fB<options>\fR can be [\-\-priority, \-\-label, \-\-subsystem, \-\-key\-slot, \-\-header].
Packit 94f725
Packit 94f725
.SH loop-AES EXTENSION
Packit 94f725
cryptsetup supports mapping loop-AES encrypted partition using
Packit 94f725
a compatibility mode.
Packit 94f725
.PP
Packit 94f725
\fIopen\fR \-\-type loopaes <device> <name> \-\-key\-file <keyfile>
Packit 94f725
.br
Packit 94f725
\fIloopaesOpen\fR <device> <name> \-\-key\-file <keyfile>  (\fBold syntax\fR)
Packit 94f725
.IP
Packit 94f725
Opens the loop-AES <device> and sets up a mapping <name>.
Packit 94f725
Packit 94f725
If the key file is encrypted with GnuPG, then you have to use
Packit 94f725
\-\-key\-file=\- and decrypt it before use, e.g. like this:
Packit 94f725
.br
Packit 94f725
gpg \-\-decrypt <keyfile> | cryptsetup loopaesOpen \-\-key\-file=\-
Packit 94f725
<device> <name>
Packit 94f725
Packit 94f725
\fBWARNING:\fR The loop-AES extension cannot use the direct input of key file
Packit 94f725
on real terminal because the keys are separated by end-of-line and only part
Packit 94f725
of the multi-key file would be read.
Packit 94f725
.br
Packit 94f725
If you need it in script, just use the pipe redirection:
Packit 94f725
.br
Packit 94f725
echo $keyfile | cryptsetup loopaesOpen \-\-key\-file=\- <device> <name>
Packit 94f725
Packit 94f725
Use \fB\-\-keyfile\-size\fR to specify the proper key length if needed.
Packit 94f725
Packit 94f725
Use \fB\-\-offset\fR to specify device offset. Note that the units
Packit 94f725
need to be specified in number of 512 byte sectors.
Packit 94f725
Packit 94f725
Use \fB\-\-skip\fR to specify the IV offset. If the original device
Packit 94f725
used an offset and but did not use it in IV sector calculations,
Packit 94f725
you have to explicitly use \fB\-\-skip 0\fR in addition to the offset
Packit 94f725
parameter.
Packit 94f725
Packit 94f725
Use \fB\-\-hash\fR to override the default hash function for
Packit 94f725
passphrase hashing (otherwise it is detected according to key
Packit 94f725
size).
Packit 94f725
Packit 94f725
\fB<options>\fR can be [\-\-key\-file, \-\-key\-size, \-\-offset, \-\-skip,
Packit 94f725
\-\-hash, \-\-readonly, \-\-allow\-discards, \-\-refresh].
Packit 94f725
.PP
Packit 94f725
See also section 7 of the FAQ and \fBhttp://loop-aes.sourceforge.net\fR
Packit 94f725
for more information regarding loop-AES.
Packit 94f725
.SH TCRYPT (TrueCrypt-compatible and VeraCrypt) EXTENSION
Packit 94f725
cryptsetup supports mapping of TrueCrypt, tcplay or VeraCrypt
Packit 94f725
(with \fB\-\-veracrypt\fR option) encrypted partition
Packit 94f725
using a native Linux kernel API.
Packit 94f725
Header formatting and TCRYPT header change is not supported, cryptsetup
Packit 94f725
never changes TCRYPT header on-device.
Packit 94f725
Packit 94f725
TCRYPT extension requires kernel userspace
Packit 94f725
crypto API to be available (introduced in Linux kernel 2.6.38).
Packit 94f725
If you are configuring kernel yourself, enable
Packit 94f725
"User-space interface for symmetric key cipher algorithms" in
Packit 94f725
"Cryptographic API" section (CRYPTO_USER_API_SKCIPHER .config option).
Packit 94f725
Packit 94f725
Because TCRYPT header is encrypted, you have to always provide valid
Packit 94f725
passphrase and keyfiles.
Packit 94f725
Packit 94f725
Cryptsetup should recognize all header variants, except legacy cipher chains
Packit 94f725
using LRW encryption mode with 64 bits encryption block (namely Blowfish
Packit 94f725
in LRW mode is not recognized, this is limitation of kernel crypto API).
Packit 94f725
Packit 94f725
To recognize a VeraCrypt device use the \fB\-\-veracrypt\fR option.
Packit 94f725
VeraCrypt is just extension of TrueCrypt header with increased
Packit 94f725
iteration count so unlocking can take quite a lot of time (in comparison
Packit 94f725
with TCRYPT device).
Packit 94f725
Packit 94f725
To open a VeraCrypt device with a custom Personal Iteration Multiplier (PIM)
Packit 94f725
value, \fBadditionally to \-\-veracrypt \fR use either the
Packit 94f725
\fB\-\-veracrypt\-pim=<PIM>\fR option to directly specify the PIM on the command-
Packit 94f725
line or use \fB\-\-veracrypt\-query\-pim\fR to be prompted for the PIM.
Packit 94f725
Packit 94f725
The PIM value affects the number of iterations applied during key derivation. Please refer to
Packit 94f725
\fBhttps://www.veracrypt.fr/en/Personal%20Iterations%20Multiplier%20%28PIM%29.html\fR
Packit 94f725
for more detailed information.
Packit 94f725
Packit 94f725
\fBNOTE:\fR Activation with \fBtcryptOpen\fR is supported only for cipher chains
Packit 94f725
using LRW or XTS encryption modes.
Packit 94f725
Packit 94f725
The \fBtcryptDump\fR command should work for all recognized TCRYPT devices
Packit 94f725
and doesn't require superuser privilege.
Packit 94f725
Packit 94f725
To map system device (device with boot loader where the whole encrypted
Packit 94f725
system resides) use \fB\-\-tcrypt\-system\fR option.
Packit 94f725
You can use partition device as the parameter (parameter must be real partition
Packit 94f725
device, not an image in a file), then only this partition is mapped.
Packit 94f725
Packit 94f725
If you have the whole TCRYPT device as a file image and you want to map multiple
Packit 94f725
partition encrypted with system encryption, please create loopback mapping
Packit 94f725
with partitions first (\fBlosetup \-P\fR, see \fPlosetup(8)\fR man page for more info),
Packit 94f725
and use loop partition as the device parameter.
Packit 94f725
Packit 94f725
If you use the whole base device as a parameter, one device for the whole system
Packit 94f725
encryption is mapped. This mode is available only for backward compatibility
Packit 94f725
with older cryptsetup versions which mapped TCRYPT system encryption
Packit 94f725
using the whole device.
Packit 94f725
Packit 94f725
To use hidden header (and map hidden device, if available),
Packit 94f725
use \fB\-\-tcrypt\-hidden\fR option.
Packit 94f725
Packit 94f725
To explicitly use backup (secondary) header, use \fB\-\-tcrypt\-backup\fR
Packit 94f725
option.
Packit 94f725
Packit 94f725
\fBNOTE:\fR There is no protection for a hidden volume if
Packit 94f725
the outer volume is mounted. The reason is that if there
Packit 94f725
were any protection, it would require some metadata describing
Packit 94f725
what to protect in the outer volume and the hidden volume would
Packit 94f725
become detectable.
Packit 94f725
Packit 94f725
.PP
Packit 94f725
\fIopen\fR \-\-type tcrypt <device> <name>
Packit 94f725
.br
Packit 94f725
\fItcryptOpen\fR <device> <name>  (\fBold syntax\fR)
Packit 94f725
.IP
Packit 94f725
Opens the TCRYPT (a TrueCrypt-compatible) <device> and sets up
Packit 94f725
a mapping <name>.
Packit 94f725
Packit 94f725
\fB<options>\fR can be [\-\-key\-file, \-\-tcrypt\-hidden,
Packit 94f725
\-\-tcrypt\-system, \-\-tcrypt\-backup, \-\-readonly, \-\-test\-passphrase,
Packit 94f725
\-\-allow-discards, \-\-veracrypt, \-\-veracrypt\-pim, \-\-veracrypt\-query\-pim].
Packit 94f725
Packit 94f725
The keyfile parameter allows a combination of file content with the
Packit 94f725
passphrase and can be repeated. Note that using keyfiles is compatible
Packit 94f725
with TCRYPT and is different from LUKS keyfile logic.
Packit 94f725
Packit 94f725
\fBWARNING:\fR Option \fB\-\-allow\-discards\fR cannot be combined with
Packit 94f725
option \fB\-\-tcrypt\-hidden\fR. For normal mapping, it can cause
Packit 94f725
the \fBdestruction of hidden volume\fR (hidden volume appears as unused space
Packit 94f725
for outer volume so this space can be discarded).
Packit 94f725
Packit 94f725
.PP
Packit 94f725
\fItcryptDump\fR <device>
Packit 94f725
.IP
Packit 94f725
Dump the header information of a TCRYPT device.
Packit 94f725
Packit 94f725
If the \-\-dump\-master\-key option is used, the TCRYPT device master key
Packit 94f725
is dumped instead of TCRYPT header info. Beware that the master key
Packit 94f725
(or concatenated master keys if cipher chain is used)
Packit 94f725
can be used to decrypt the data stored in the TCRYPT container without
Packit 94f725
a passphrase.
Packit 94f725
This means that if the master key is compromised, the whole device has
Packit 94f725
to be erased to prevent further access. Use this option carefully.
Packit 94f725
Packit 94f725
\fB<options>\fR can be [\-\-dump\-master\-key, \-\-key\-file,
Packit 94f725
\-\-tcrypt\-hidden, \-\-tcrypt\-system, \-\-tcrypt\-backup].
Packit 94f725
Packit 94f725
The keyfile parameter allows a combination of file content with the
Packit 94f725
passphrase and can be repeated.
Packit 94f725
.PP
Packit 94f725
See also \fBhttps://en.wikipedia.org/wiki/TrueCrypt\fR for more information regarding
Packit 94f725
TrueCrypt.
Packit 94f725
Packit 94f725
Please note that cryptsetup does not use TrueCrypt code, please report
Packit 94f725
all problems related to this compatibility extension to the cryptsetup project.
Packit 94f725
Packit 94f725
.SH BITLK (Windows BitLocker-compatible) EXTENSION (EXPERIMENTAL)
Packit 94f725
cryptsetup supports mapping of BitLocker and BitLocker to Go encrypted partition
Packit 94f725
using a native Linux kernel API.
Packit 94f725
Header formatting and BITLK header changes are not supported, cryptsetup
Packit 94f725
never changes BITLK header on-device.
Packit 94f725
Packit 94f725
\fBWARNING:\fR This extension is EXPERIMENTAL.
Packit 94f725
Packit 94f725
BITLK extension requires kernel userspace crypto API to be available
Packit 94f725
(for details see TCRYPT section).
Packit 94f725
Packit 94f725
Cryptsetup should recognize all BITLK header variants, except legacy
Packit 94f725
header used in Windows Vista systems and partially decrypted BitLocker devices.
Packit 94f725
Activation of legacy devices encrypted in CBC mode requires at least
Packit 94f725
Linux kernel version 5.3 and for devices using Elephant diffuser kernel 5.6.
Packit 94f725
Packit 94f725
The \fBbitlkDump\fR command should work for all recognized BITLK devices
Packit 94f725
and doesn't require superuser privilege.
Packit 94f725
Packit 94f725
For unlocking with the \fBopen\fR a password or a recovery passphrase must
Packit 94f725
be provided. Other unlocking methods (TPM, SmartCard) are not supported.
Packit 94f725
Packit 94f725
.PP
Packit 94f725
\fIopen\fR \-\-type bitlk <device> <name>
Packit 94f725
.br
Packit 94f725
\fIbitlkOpen\fR <device> <name>  (\fBold syntax\fR)
Packit 94f725
.IP
Packit 94f725
Opens the BITLK (a BitLocker-compatible) <device> and sets up
Packit 94f725
a mapping <name>.
Packit 94f725
Packit 94f725
\fB<options>\fR can be [\-\-key\-file, \-\-readonly, \-\-test\-passphrase,
Packit 94f725
\-\-allow-discards].
Packit 94f725
Packit 94f725
.PP
Packit 94f725
\fIbitlkDump\fR <device>
Packit 94f725
.IP
Packit 94f725
Dump the header information of a BITLK device.
Packit 94f725
Packit 94f725
Please note that cryptsetup does not use any Windows BitLocker code, please report
Packit 94f725
all problems related to this compatibility extension to the cryptsetup project.
Packit 94f725
.SH MISCELLANEOUS
Packit 94f725
.PP
Packit 94f725
\fIrepair\fR <device>
Packit 94f725
.IP
Packit 94f725
Tries to repair the device metadata if possible. Currently supported only
Packit 94f725
for LUKS device type.
Packit 94f725
Packit 94f725
This command is useful to fix some known benign LUKS metadata
Packit 94f725
header corruptions. Only basic corruptions of unused keyslot
Packit 94f725
are fixable. This command will only change the LUKS header, not
Packit 94f725
any key-slot data. You may enforce LUKS version by adding \-\-type
Packit 94f725
option.
Packit 94f725
Packit 94f725
\fBWARNING:\fR Always create a binary backup of the original
Packit 94f725
header before calling this command.
Packit 94f725
.PP
Packit 94f725
\fIbenchmark\fR <options>
Packit 94f725
.IP
Packit 94f725
Benchmarks ciphers and KDF (key derivation function).
Packit 94f725
Without parameters, it tries to measure few common configurations.
Packit 94f725
Packit 94f725
To benchmark other ciphers or modes, you need to specify \fB\-\-cipher\fR
Packit 94f725
and \fB\-\-key\-size\fR options or \fB\-\-hash\fR for KDF test.
Packit 94f725
Packit 94f725
\fBNOTE:\fR This benchmark is using memory only and is only informative.
Packit 94f725
You cannot directly predict real storage encryption speed from it.
Packit 94f725
Packit 94f725
For testing block ciphers, this benchmark requires kernel userspace
Packit 94f725
crypto API to be available (introduced in Linux kernel 2.6.38).
Packit 94f725
If you are configuring kernel yourself, enable
Packit 94f725
"User-space interface for symmetric key cipher algorithms" in
Packit 94f725
"Cryptographic API" section (CRYPTO_USER_API_SKCIPHER .config option).
Packit 94f725
Packit 94f725
\fB<options>\fR can be [\-\-cipher, \-\-key\-size, \-\-hash].
Packit 94f725
.SH OPTIONS
Packit 94f725
.TP
Packit 94f725
.B "\-\-verbose, \-v"
Packit 94f725
Print more information on command execution.
Packit 94f725
.TP
Packit 94f725
.B "\-\-debug or \-\-debug\-json"
Packit 94f725
Run in debug mode with full diagnostic logs. Debug output
Packit 94f725
lines are always prefixed by '#'.
Packit 94f725
If \-\-debug\-json is used, additional LUKS2 JSON data structures are printed.
Packit 94f725
.TP
Packit 94f725
.B "\-\-type <device-type>
Packit 94f725
Specifies required device type, for more info
Packit 94f725
read \fIBASIC COMMANDS\fR section.
Packit 94f725
.TP
Packit 94f725
.B "\-\-hash, \-h \fI<hash\-spec>\fR"
Packit 94f725
Specifies the passphrase hash for \fIopen\fR (for plain and
Packit 94f725
loopaes device types).
Packit 94f725
Packit 94f725
Specifies the hash used in the LUKS key setup scheme and volume key digest
Packit 94f725
for \fIluksFormat\fR. The specified hash is used as hash-parameter
Packit 94f725
for PBKDF2 and for the AF splitter.
Packit 94f725
Packit 94f725
The specified hash name is passed to the compiled-in crypto backend.
Packit 94f725
Different backends may support different hashes.
Packit 94f725
For \fIluksFormat\fR, the hash
Packit 94f725
algorithm must provide at least 160 bits of output, which
Packit 94f725
excludes, e.g., MD5. Do not use a non-crypto hash like
Packit 94f725
\fB"crc32"\fR as this breaks security.
Packit 94f725
Packit 94f725
Values compatible with old version of cryptsetup are
Packit 94f725
\fB"ripemd160"\fR for \fIopen \-\-type plain\fR and
Packit 94f725
\fB"sha1"\fR for \fIluksFormat\fR.
Packit 94f725
Packit 94f725
Use \fIcryptsetup \-\-help\fR to show the defaults.
Packit 94f725
.TP
Packit 94f725
.B "\-\-cipher, \-c \fI<cipher\-spec>\fR"
Packit 94f725
Set the cipher specification string.
Packit 94f725
Packit 94f725
\fIcryptsetup \-\-help\fR shows the compiled-in defaults.
Packit 94f725
The current default in the distributed sources is
Packit 94f725
"aes-cbc-essiv:sha256" for plain dm-crypt and
Packit 94f725
"aes-xts-plain64" for LUKS.
Packit 94f725
Packit 94f725
If a hash is part of the cipher specification, then it is
Packit 94f725
used as part of the IV generation. For example, ESSIV
Packit 94f725
needs a hash function, while "plain64" does not and
Packit 94f725
hence none is specified.
Packit 94f725
Packit 94f725
For XTS mode you can optionally set a key size of
Packit 94f725
512 bits with the \-s option. Key size for XTS
Packit 94f725
mode is twice that for other modes for the same
Packit 94f725
security level.
Packit 94f725
Packit 94f725
XTS mode requires kernel 2.6.24 or later and plain64 requires
Packit 94f725
kernel 2.6.33 or later. More information can be found in the FAQ.
Packit 94f725
.TP
Packit 94f725
.B "\-\-verify-passphrase, \-y"
Packit 94f725
When interactively asking for a passphrase, ask for it twice
Packit 94f725
and complain if both inputs do not match. Advised when creating
Packit 94f725
a regular mapping for the first time, or when running
Packit 94f725
\fIluksFormat\fR. Ignored on input from file or stdin.
Packit 94f725
.TP
Packit 94f725
.B "\-\-key-file, \-d \fIname\fR"
Packit 94f725
Read the passphrase from file.
Packit 94f725
Packit 94f725
If the name given is "-", then the passphrase will be read from stdin.
Packit 94f725
In this case, reading will not stop at newline characters.
Packit 94f725
Packit 94f725
With LUKS, passphrases supplied via \-\-key\-file are always
Packit 94f725
the existing passphrases requested by a command, except in
Packit 94f725
the case of \fIluksFormat\fR where \-\-key\-file is equivalent
Packit 94f725
to the positional key file argument.
Packit 94f725
Packit 94f725
If you want to set a new passphrase via key file, you have to
Packit 94f725
use a positional argument to \fIluksAddKey\fR.
Packit 94f725
Packit 94f725
See section \fBNOTES ON PASSPHRASE PROCESSING\fR for more information.
Packit 94f725
.TP
Packit 94f725
.B "\-\-keyfile\-offset \fIvalue\fR"
Packit 94f725
Skip \fIvalue\fR bytes at the beginning of the key file.
Packit 94f725
Works with all commands that accept key files.
Packit 94f725
.TP
Packit 94f725
.B "\-\-keyfile\-size, \-l \fIvalue\fR"
Packit 94f725
Read a maximum of \fIvalue\fR bytes from the key file.
Packit 94f725
The default is to read the whole file up to the compiled-in
Packit 94f725
maximum that can be queried with \-\-help. Supplying more
Packit 94f725
data than the compiled-in maximum aborts the operation.
Packit 94f725
Packit 94f725
This option is useful
Packit 94f725
to cut trailing newlines, for example. If \-\-keyfile\-offset
Packit 94f725
is also given, the size count starts after the offset.
Packit 94f725
Works with all commands that accept key files.
Packit 94f725
.TP
Packit 94f725
.B "\-\-new\-keyfile\-offset \fIvalue\fR"
Packit 94f725
Skip \fIvalue\fR bytes at the start when
Packit 94f725
adding a new passphrase from key file with
Packit 94f725
\fIluksAddKey\fR.
Packit 94f725
.TP
Packit 94f725
.B "\-\-new\-keyfile\-size  \fIvalue\fR"
Packit 94f725
Read a maximum of \fIvalue\fR bytes when adding
Packit 94f725
a new passphrase from key file with \fIluksAddKey\fR.
Packit 94f725
The default is to read the whole file up to the compiled-in
Packit 94f725
maximum length that can be queried with \-\-help.
Packit 94f725
Supplying more than the compiled in maximum aborts the
Packit 94f725
operation.
Packit 94f725
When \-\-new\-keyfile\-offset is also given, reading starts
Packit 94f725
after the offset.
Packit 94f725
.TP
Packit 94f725
.B "\-\-master\-key\-file"
Packit 94f725
Use a master key stored in a file.
Packit 94f725
Packit 94f725
For \fIluksFormat\fR this
Packit 94f725
allows creating a LUKS header with this specific
Packit 94f725
master key. If the master key was taken from an existing
Packit 94f725
LUKS header and all other parameters are the same,
Packit 94f725
then the new header decrypts the data encrypted with the
Packit 94f725
header the master key was taken from.
Packit 94f725
Packit 94f725
Action \fIluksDump\fR together with \-\-dump\-master\-key
Packit 94f725
option: The volume (master) key is stored in a file instead of
Packit 94f725
being printed out to standard output.
Packit 94f725
Packit 94f725
\fBWARNING:\fR If you create your own master key, you
Packit 94f725
need to make sure to do it right. Otherwise, you can end
Packit 94f725
up with a low-entropy or otherwise partially predictable
Packit 94f725
master key which will compromise security.
Packit 94f725
Packit 94f725
For \fIluksAddKey\fR this allows adding a new passphrase
Packit 94f725
without having to know an existing one.
Packit 94f725
Packit 94f725
For \fIopen\fR this allows one to open the LUKS device
Packit 94f725
without giving a passphrase.
Packit 94f725
.TP
Packit 94f725
.B "\-\-dump\-master\-key"
Packit 94f725
For \fIluksDump\fR this option includes the master key in the displayed
Packit 94f725
information. Use with care, as the master key can be used to
Packit 94f725
bypass the passphrases, see also option \-\-master\-key\-file.
Packit 94f725
.TP
Packit 94f725
.B "\-\-json\-file"
Packit 94f725
Read token json from a file or write token to it. See \fItoken\fR action for more
Packit 94f725
information. \-\-json\-file=- reads json from standard input or writes it to
Packit 94f725
standard output respectively.
Packit 94f725
.TP
Packit 94f725
.B "\-\-use\-random"
Packit 94f725
.TP
Packit 94f725
.B "\-\-use\-urandom"
Packit 94f725
For \fIluksFormat\fR these options define which kernel random number
Packit 94f725
generator will be used to create the master key (which is a
Packit 94f725
long-term key).
Packit 94f725
Packit 94f725
See \fBNOTES ON RANDOM NUMBER GENERATORS\fR for more
Packit 94f725
information. Use \fIcryptsetup \-\-help\fR
Packit 94f725
to show the compiled-in default random number generator.
Packit 94f725
Packit 94f725
\fBWARNING:\fR In a low-entropy situation (e.g. in an
Packit 94f725
embedded system), both selections are problematic.
Packit 94f725
Using /dev/urandom can lead to weak keys.
Packit 94f725
Using /dev/random can block a long time, potentially
Packit 94f725
forever, if not enough entropy can be harvested by
Packit 94f725
the kernel.
Packit 94f725
.TP
Packit 94f725
.B "\-\-key\-slot, \-S <0\-7>"
Packit 94f725
For LUKS operations that add key material, this options allows you
Packit 94f725
to specify which key slot is selected for the new key.
Packit 94f725
This option can be used for \fIluksFormat\fR,
Packit 94f725
and \fIluksAddKey\fR.
Packit 94f725
.br
Packit 94f725
In addition, for \fIopen\fR, this option selects a
Packit 94f725
specific key-slot to compare the passphrase against.
Packit 94f725
If the given passphrase would only match a different key-slot,
Packit 94f725
the operation fails.
Packit 94f725
.TP
Packit 94f725
.B "\-\-key\-size, \-s <bits>"
Packit 94f725
Sets key size in bits. The argument has to be a multiple of
Packit 94f725
8. The possible key-sizes are limited by the cipher and
Packit 94f725
mode used.
Packit 94f725
Packit 94f725
See /proc/crypto for more information. Note that key-size
Packit 94f725
in /proc/crypto is stated in bytes.
Packit 94f725
Packit 94f725
This option can be used for \fIopen \-\-type plain\fR or \fIluksFormat\fR.
Packit 94f725
All other LUKS actions will use the key-size specified in the LUKS header.
Packit 94f725
Use \fIcryptsetup \-\-help\fR to show the compiled-in defaults.
Packit 94f725
.TP
Packit 94f725
.B "\-\-size, \-b <number of 512 byte sectors>"
Packit 94f725
Set the size of the device in sectors of 512 bytes.
Packit 94f725
This option is only relevant for the \fIopen\fR and \fIresize\fR
Packit 94f725
actions.
Packit 94f725
.TP
Packit 94f725
.B "\-\-offset, \-o <number of 512 byte sectors>"
Packit 94f725
Start offset in the backend device in 512-byte sectors.
Packit 94f725
This option is only relevant for the \fIopen\fR action with plain
Packit 94f725
or loopaes device types or for LUKS devices in \fIluksFormat\fR.
Packit 94f725
Packit 94f725
For LUKS, the \-\-offset option sets the data offset (payload) of data
Packit 94f725
device and must be be aligned to 4096-byte sectors (must be multiple of 8).
Packit 94f725
This option cannot be combined with \-\-align\-payload option.
Packit 94f725
.TP
Packit 94f725
.B "\-\-skip, \-p <number of 512 byte sectors>"
Packit 94f725
Start offset used in IV calculation in 512-byte sectors
Packit 94f725
(how many sectors of the encrypted data to skip at the beginning).
Packit 94f725
This option is only relevant for the \fIopen\fR action with plain
Packit 94f725
or loopaes device types.
Packit 94f725
Packit 94f725
Hence, if \-\-offset \fIn\fR, and \-\-skip \fIs\fR, sector \fIn\fR
Packit 94f725
(the first sector of the encrypted device) will get a sector number
Packit 94f725
of \fIs\fR for the IV calculation.
Packit 94f725
.TP
Packit 94f725
.B "\-\-device\-size \fIsize[units]\fR"
Packit 94f725
Instead of real device size, use specified value.
Packit 94f725
Packit 94f725
With \fIreencrypt\fR action it means that only specified area
Packit 94f725
(from the start of the device to the specified size) will be
Packit 94f725
reencrypted.
Packit 94f725
Packit 94f725
With \fIresize\fR action it sets new size of the device.
Packit 94f725
Packit 94f725
If no unit suffix is specified, the size is in bytes.
Packit 94f725
Packit 94f725
Unit suffix can be S for 512 byte sectors, K/M/G/T (or KiB,MiB,GiB,TiB)
Packit 94f725
for units with 1024 base or KB/MB/GB/TB for 1000 base (SI scale).
Packit 94f725
Packit 94f725
\fBWARNING:\fR This is destructive operation when used with reencrypt command.
Packit 94f725
.TP
Packit 94f725
.B "\-\-readonly, \-r"
Packit 94f725
set up a read-only mapping.
Packit 94f725
.TP
Packit 94f725
.B "\-\-shared"
Packit 94f725
Creates an additional mapping for one common
Packit 94f725
ciphertext device. Arbitrary mappings are supported.
Packit 94f725
This option is only relevant for the
Packit 94f725
\fIopen \-\-type plain\fR action. Use \-\-offset, \-\-size and \-\-skip to
Packit 94f725
specify the mapped area.
Packit 94f725
.TP
Packit 94f725
.B "\-\-pbkdf <PBKDF spec>"
Packit 94f725
Set Password-Based Key Derivation Function (PBKDF) algorithm for LUKS keyslot.
Packit 94f725
The PBKDF can be: \fIpbkdf2\fR (for PBKDF2 according to RFC2898),
Packit 94f725
\fIargon2i\fR for Argon2i or \fIargon2id\fR for Argon2id
Packit 94f725
(see https://www.cryptolux.org/index.php/Argon2 for more info).
Packit 94f725
Packit 94f725
For LUKS1, only PBKDF2 is accepted (no need to use this option).
Packit 94f725
The default PBKDF2 for LUKS2 is set during compilation time
Packit 94f725
and is available in \fIcryptsetup \-\-help\fR output.
Packit 94f725
Packit 94f725
A PBKDF is used for increasing dictionary and brute-force attack cost
Packit 94f725
for keyslot passwords. The parameters can be time, memory and parallel cost.
Packit 94f725
Packit 94f725
For PBKDF2, only time cost (number of iterations) applies.
Packit 94f725
For Argon2i/id, there is also memory cost (memory required during
Packit 94f725
the process of key derivation) and parallel cost (number of threads
Packit 94f725
that run in parallel during the key derivation.
Packit 94f725
Packit 94f725
Note that increasing memory cost also increases time, so the final
Packit 94f725
parameter values are measured by a benchmark. The benchmark
Packit 94f725
tries to find iteration time (\fI\-\-iter\-time\fR) with required
Packit 94f725
memory cost \fI\-\-pbkdf\-memory\fR. If it is not possible,
Packit 94f725
the memory cost is decreased as well.
Packit 94f725
The parallel cost \fI\-\-pbkdf\-parallel\fR is constant, is is checked
Packit 94f725
against available CPU cores (if not available, it is decreased) and the maximum
Packit 94f725
parallel cost is 4.
Packit 94f725
Packit 94f725
You can see all PBKDF parameters for particular LUKS2 keyslot with
Packit 94f725
\fIluksDump\fR command.
Packit 94f725
Packit 94f725
\fBNOTE:\fR If you do not want to use benchmark and want to specify
Packit 94f725
all parameters directly, use \fI\-\-pbkdf\-force\-iterations\fR with
Packit 94f725
\fI\-\-pbkdf\-memory\fR and \fI\-\-pbkdf\-parallel\fR.
Packit 94f725
This will override the values without benchmarking.
Packit 94f725
Note it can cause extremely long unlocking time. Use only is specified
Packit 94f725
cases, for example, if you know that the formatted device will
Packit 94f725
be used on some small embedded system.
Packit 94f725
In this case, the LUKS PBKDF2 digest will be set to the minimum iteration count.
Packit 94f725
.TP
Packit 94f725
.B "\-\-iter\-time, \-i <number of milliseconds>"
Packit 94f725
The number of milliseconds to spend with PBKDF passphrase processing.
Packit 94f725
This option is only relevant for LUKS operations that set or change
Packit 94f725
passphrases, such as \fIluksFormat\fR or \fIluksAddKey\fR.
Packit 94f725
Specifying 0 as parameter selects the compiled-in default.
Packit 94f725
.TP
Packit 94f725
.B "\-\-pbkdf\-memory <number>"
Packit 94f725
Set the memory cost for PBKDF (for Argon2i/id the number represents kilobytes).
Packit 94f725
Note that it is maximal value, PBKDF benchmark or available physical memory
Packit 94f725
can decrease it.
Packit 94f725
This option is not available for PBKDF2.
Packit 94f725
.TP
Packit 94f725
.B "\-\-pbkdf\-parallel <number>"
Packit 94f725
Set the parallel cost for PBKDF (number of threads, up to 4).
Packit 94f725
Note that it is maximal value, it is decreased automatically if
Packit 94f725
CPU online count is lower.
Packit 94f725
This option is not available for PBKDF2.
Packit 94f725
.TP
Packit 94f725
.B "\-\-pbkdf\-force\-iterations <num>"
Packit 94f725
Avoid PBKDF benchmark and set time cost (iterations) directly.
Packit 94f725
It can be used for LUKS/LUKS2 device only.
Packit 94f725
See \fI\-\-pbkdf\fR option for more info.
Packit 94f725
.TP
Packit 94f725
.B "\-\-batch\-mode, \-q"
Packit 94f725
Suppresses all confirmation questions. Use with care!
Packit 94f725
Packit 94f725
If the \-y option is not specified, this option also switches off
Packit 94f725
the passphrase verification for \fIluksFormat\fR.
Packit 94f725
.TP
Packit 94f725
.B "\-\-progress-frequency <seconds>"
Packit 94f725
Print separate line every <seconds> with wipe progress.
Packit 94f725
.TP
Packit 94f725
.B "\-\-timeout, \-t <number of seconds>"
Packit 94f725
The number of seconds to wait before timeout on passphrase input
Packit 94f725
via terminal. It is relevant every time a passphrase is asked,
Packit 94f725
for example for \fIopen\fR, \fIluksFormat\fR or \fIluksAddKey\fR.
Packit 94f725
It has no effect if used in conjunction with \-\-key-file.
Packit 94f725
.br
Packit 94f725
This option is useful when the system
Packit 94f725
should not stall if the user does not input a passphrase,
Packit 94f725
e.g. during boot. The default is a value of 0 seconds,
Packit 94f725
which means to wait forever.
Packit 94f725
.TP
Packit 94f725
.B "\-\-tries, \-T"
Packit 94f725
How often the input of the passphrase shall be retried.
Packit 94f725
This option is relevant
Packit 94f725
every time a passphrase is asked, for example for
Packit 94f725
\fIopen\fR, \fIluksFormat\fR or \fIluksAddKey\fR.
Packit 94f725
The default is 3 tries.
Packit 94f725
.TP
Packit 94f725
.B "\-\-align\-payload <number of 512 byte sectors>"
Packit 94f725
Align payload at a boundary of \fIvalue\fR 512-byte sectors.
Packit 94f725
This option is relevant for \fIluksFormat\fR.
Packit 94f725
Packit 94f725
If not specified, cryptsetup tries to use the topology info
Packit 94f725
provided by the kernel for the underlying device to get the optimal alignment.
Packit 94f725
If not available (or the calculated value is a multiple of the default)
Packit 94f725
data is by default aligned to a 1MiB boundary (i.e. 2048 512-byte sectors).
Packit 94f725
Packit 94f725
For a detached LUKS header, this option specifies the offset on the
Packit 94f725
data device. See also the \-\-header option.
Packit 94f725
Packit 94f725
\fBWARNING:\fR This option is DEPRECATED and has often unexpected impact
Packit 94f725
to the data offset and keyslot area size (for LUKS2) due to the complex rounding.
Packit 94f725
For fixed data device offset use \fI\-\-offset\fR option instead.
Packit 94f725
Packit 94f725
.TP
Packit 94f725
.B "\-\-uuid=\fIUUID\fR"
Packit 94f725
Use the provided \fIUUID\fR for the \fIluksFormat\fR command
Packit 94f725
instead of generating a new one. Changes the existing UUID when
Packit 94f725
used with the \fIluksUUID\fR command.
Packit 94f725
Packit 94f725
The UUID must be provided in the standard UUID format,
Packit 94f725
e.g. 12345678-1234-1234-1234-123456789abc.
Packit 94f725
.TP
Packit 94f725
.B "\-\-allow\-discards\fR"
Packit 94f725
Allow the use of discard (TRIM) requests for the device.
Packit 94f725
This option is only relevant for \fIopen\fR action.
Packit 94f725
This is also not supported for LUKS2 devices with data integrity protection.
Packit 94f725
Packit 94f725
\fBWARNING:\fR This command can have a negative security impact
Packit 94f725
because it can make filesystem-level operations visible on
Packit 94f725
the physical device. For example, information leaking
Packit 94f725
filesystem type, used space, etc. may be extractable from
Packit 94f725
the physical device if the discarded blocks can be located
Packit 94f725
later. If in doubt, do not use it.
Packit 94f725
Packit 94f725
A kernel version of 3.1 or later is needed. For earlier kernels,
Packit 94f725
this option is ignored.
Packit 94f725
.TP
Packit 94f725
.B "\-\-perf\-same_cpu_crypt\fR"
Packit 94f725
Perform encryption using the same cpu that IO was submitted on.
Packit 94f725
The default is to use an unbound workqueue so that encryption work
Packit 94f725
is automatically balanced between available CPUs.
Packit 94f725
This option is only relevant for \fIopen\fR action.
Packit 94f725
Packit 94f725
\fBNOTE:\fR This option is available only for low-level dm-crypt
Packit 94f725
performance tuning, use only if you need a change to default dm-crypt
Packit 94f725
behaviour. Needs kernel 4.0 or later.
Packit 94f725
.TP
Packit 94f725
.B "\-\-perf\-submit_from_crypt_cpus\fR"
Packit 94f725
Disable offloading writes to a separate thread after encryption.
Packit 94f725
There are some situations where offloading write bios from the
Packit 94f725
encryption threads to a single thread degrades performance
Packit 94f725
significantly.  The default is to offload write bios to the same
Packit 94f725
thread.
Packit 94f725
This option is only relevant for \fIopen\fR action.
Packit 94f725
Packit 94f725
\fBNOTE:\fR This option is available only for low-level dm-crypt
Packit 94f725
performance tuning, use only if you need a change to default dm-crypt
Packit 94f725
behaviour. Needs kernel 4.0 or later.
Packit 94f725
.TP
Packit 94f725
.B "\-\-test\-passphrase\fR"
Packit 94f725
Do not activate the device, just verify passphrase.
Packit 94f725
This option is only relevant for \fIopen\fR action (the device
Packit 94f725
mapping name is not mandatory if this option is used).
Packit 94f725
.TP
Packit 94f725
.B "\-\-header\fR <device or file storing the LUKS header>"
Packit 94f725
Use a detached (separated) metadata device or file where the
Packit 94f725
LUKS header is stored. This option allows one to store ciphertext
Packit 94f725
and LUKS header on different devices.
Packit 94f725
Packit 94f725
This option is only relevant for LUKS devices and can be
Packit 94f725
used with the \fIluksFormat\fR, \fIopen\fR, \fIluksSuspend\fR,
Packit 94f725
\fIluksResume\fR, \fIstatus\fR and \fIresize\fR commands.
Packit 94f725
Packit 94f725
For \fIluksFormat\fR with a file name as the argument to \-\-header,
Packit 94f725
the file will be automatically created if it does not exist.
Packit 94f725
See the cryptsetup FAQ for header size calculation.
Packit 94f725
Packit 94f725
For other commands that change the LUKS header (e.g. \fIluksAddKey\fR),
Packit 94f725
specify the device or file with the LUKS header directly as the
Packit 94f725
LUKS device.
Packit 94f725
Packit 94f725
If used with \fIluksFormat\fR, the \-\-align\-payload option is taken
Packit 94f725
as absolute sector alignment on ciphertext device and can be zero.
Packit 94f725
Packit 94f725
\fBWARNING:\fR There is no check whether the ciphertext device specified
Packit 94f725
actually belongs to the header given. In fact, you can specify an
Packit 94f725
arbitrary device as the ciphertext device for \fIopen\fR
Packit 94f725
with the \-\-header option. Use with care.
Packit 94f725
.TP
Packit 94f725
.B "\-\-header\-backup\-file <file>"
Packit 94f725
Specify file with header backup for \fIluksHeaderBackup\fR or
Packit 94f725
\fIluksHeaderRestore\fR actions.
Packit 94f725
.TP
Packit 94f725
.B "\-\-force\-password"
Packit 94f725
Do not use password quality checking for new LUKS passwords.
Packit 94f725
Packit 94f725
This option applies only to \fIluksFormat\fR, \fIluksAddKey\fR and
Packit 94f725
\fIluksChangeKey\fR and is ignored if cryptsetup is built without
Packit 94f725
password quality checking support.
Packit 94f725
Packit 94f725
For more info about password quality check, see the manual page
Packit 94f725
for \fBpwquality.conf(5)\fR and \fBpasswdqc.conf(5)\fR.
Packit 94f725
.TP
Packit 94f725
.B "\-\-deferred"
Packit 94f725
Defers device removal in \fIclose\fR command until the last user closes it.
Packit 94f725
.TP
Packit 94f725
.B "\-\-disable\-locks"
Packit 94f725
Disable lock protection for metadata on disk.
Packit 94f725
This option is valid only for LUKS2 and ignored for other formats.
Packit 94f725
Packit 94f725
\fBWARNING:\fR Do not use this option unless you run cryptsetup in
Packit 94f725
a restricted environment where locking is impossible to perform
Packit 94f725
(where /run directory cannot be used).
Packit 94f725
.TP
Packit 94f725
.B "\-\-disable\-keyring"
Packit 94f725
Do not load volume key in kernel keyring and store it directly
Packit 94f725
in the dm-crypt target instead.
Packit 94f725
This option is supported only for the LUKS2 format.
Packit 94f725
.TP
Packit 94f725
.B "\-\-key\-description <text>"
Packit 94f725
Set key description in keyring for use with \fItoken\fR command.
Packit 94f725
.TP
Packit 94f725
.B "\-\-priority <normal|prefer|ignore>"
Packit 94f725
Set a priority for LUKS2 keyslot.
Packit 94f725
The \fIprefer\fR priority marked slots are tried before \fInormal\fR priority.
Packit 94f725
The \fIignored\fR priority means, that slot is never used, if not explicitly
Packit 94f725
requested by \fI\-\-key\-slot\fR option.
Packit 94f725
.TP
Packit 94f725
.B "\-\-token\-id"
Packit 94f725
Specify what token to use in actions \fItoken\fR, \fIopen\fR or \fIresize\fR.
Packit 94f725
If omitted, all available tokens will be checked before proceeding further with
Packit 94f725
passphrase prompt.
Packit 94f725
.TP
Packit 94f725
.B "\-\-token\-only"
Packit 94f725
Do not proceed further with action (any of \fItoken\fR, \fIopen\fR or
Packit 94f725
\fIresize\fR) if token activation failed. Without the option,
Packit 94f725
action asks for passphrase to proceed further.
Packit 94f725
.TP
Packit 94f725
.B "\-\-sector\-size <bytes>"
Packit 94f725
Set sector size for use with disk encryption. It must be power of two
Packit 94f725
and in range 512 - 4096 bytes. The default is 512 bytes sectors.
Packit 94f725
This option is available only in the LUKS2 mode.
Packit 94f725
Packit 94f725
Note that if sector size is higher than underlying device hardware sector
Packit 94f725
and there is not integrity protection that uses data journal, using
Packit 94f725
this option can increase risk on incomplete sector writes during a power fail.
Packit 94f725
Packit 94f725
If used together with \fI\-\-integrity\fR option and dm-integrity journal,
Packit 94f725
the atomicity of writes is guaranteed in all cases (but it cost write
Packit 94f725
performance - data has to be written twice).
Packit 94f725
Packit 94f725
Increasing sector size from 512 bytes to 4096 bytes can provide better
Packit 94f725
performance on most of the modern storage devices and also with some
Packit 94f725
hw encryption accelerators.
Packit 94f725
.TP
Packit 94f725
.B "\-\-iv-large-sectors"
Packit 94f725
Count Initialization Vector (IV) in larger sector size (if set) instead
Packit 94f725
of 512 bytes sectors. This option can be used only for \fIopen\fR command
Packit 94f725
and \fIplain\fR encryption type.
Packit 94f725
Packit 94f725
\fBNOTE:\fR This option does not have any performance or security impact,
Packit 94f725
use it only for accessing incompatible existing disk images from other systems
Packit 94f725
that require this option.
Packit 94f725
.TP
Packit 94f725
.B "\-\-persistent"
Packit 94f725
If used with LUKS2 devices and activation commands like \fIopen\fR or \fIrefresh\fR,
Packit 94f725
the specified activation flags are persistently written into metadata
Packit 94f725
and used next time automatically even for normal activation.
Packit 94f725
(No need to use cryptab or other system configuration files.)
Packit 94f725
Packit 94f725
If you need to remove a persistent flag, use \fI\-\-persistent\fR without
Packit 94f725
the flag you want to remove (e.g. to disable persistently stored discard flag,
Packit 94f725
use \fI\-\-persistent\fR without \fI\-\-allow-discards\fR).
Packit 94f725
Packit 94f725
Only \fI\-\-allow-discards\fR, \fI\-\-perf\-same_cpu_crypt\fR,
Packit 94f725
\fI\-\-perf\-submit_from_crypt_cpus\fR and \fI\-\-integrity\-no\-journal\fR
Packit 94f725
can be stored persistently.
Packit 94f725
.TP
Packit 94f725
.B "\-\-refresh"
Packit 94f725
Refreshes an active device with new set of parameters. See action \fIrefresh\fR description
Packit 94f725
for more details.
Packit 94f725
.TP
Packit 94f725
.B "\-\-label <LABEL>"
Packit 94f725
.B "\-\-subsystem <SUBSYSTEM>"
Packit 94f725
Set label and subsystem description for LUKS2 device, can be used
Packit 94f725
in \fIconfig\fR and \fIformat\fR actions.
Packit 94f725
The label and subsystem are optional fields and can be later used in udev scripts
Packit 94f725
for triggering user actions once device marked by these labels is detected.
Packit 94f725
.TP
Packit 94f725
.B "\-\-integrity <integrity algorithm>"
Packit 94f725
Specify integrity algorithm to be used for authenticated disk encryption in LUKS2.
Packit 94f725
Packit 94f725
\fBWARNING: This extension is EXPERIMENTAL\fR and requires dm-integrity
Packit 94f725
kernel target (available since kernel version 4.12).
Packit 94f725
For native AEAD modes, also enable "User-space interface for AEAD cipher algorithms"
Packit 94f725
in "Cryptographic API" section (CONFIG_CRYPTO_USER_API_AEAD .config option).
Packit 94f725
Packit 94f725
For more info, see \fIAUTHENTICATED DISK ENCRYPTION\fR section.
Packit 94f725
.TP
Packit 94f725
.B "\-\-luks2\-metadata\-size <size>"
Packit 94f725
This option can be used to enlarge the LUKS2 metadata (JSON) area.
Packit 94f725
The size includes 4096 bytes for binary metadata (usable JSON area is smaller
Packit 94f725
of the binary area).
Packit 94f725
According to LUKS2 specification, only these values are valid:
Packit 94f725
16, 32, 64, 128, 256, 512, 1024, 2048 and 4096 kB
Packit 94f725
The <size> can be specified with unit suffix (for example 128k).
Packit 94f725
.TP
Packit 94f725
.B "\-\-luks2\-keyslots\-size <size>"
Packit 94f725
This option can be used to set specific size of the LUKS2 binary keyslot area
Packit 94f725
(key material is encrypted there). The value must be aligned to multiple
Packit 94f725
of 4096 bytes with maximum size 128MB.
Packit 94f725
The <size> can be specified with unit suffix (for example 128k).
Packit 94f725
.TP
Packit 94f725
.B "\-\-keyslot\-cipher <cipher\-spec>"
Packit 94f725
This option can be used to set specific cipher encryption for the LUKS2 keyslot area.
Packit 94f725
.TP
Packit 94f725
.B "\-\-keyslot\-key\-size <bits>"
Packit 94f725
This option can be used to set specific key size for the LUKS2 keyslot area.
Packit 94f725
.TP
Packit 94f725
.B "\-\-integrity\-no\-journal"
Packit 94f725
Activate device with integrity protection without using data journal (direct
Packit 94f725
write of data and integrity tags).
Packit 94f725
Note that without journal power fail can cause non-atomic write and data corruption.
Packit 94f725
Use only if journalling is performed on a different storage layer.
Packit 94f725
.TP
Packit 94f725
.B "\-\-integrity\-no\-wipe"
Packit 94f725
Skip wiping of device authentication (integrity) tags. If you skip this
Packit 94f725
step, sectors will report invalid integrity tag until an application write
Packit 94f725
to the sector.
Packit 94f725
Packit 94f725
\fBNOTE:\fR Even some writes to the device can fail if the write is not
Packit 94f725
aligned to page size and page-cache initiates read of a sector with invalid
Packit 94f725
integrity tag.
Packit 94f725
.TP
Packit 94f725
.B "\-\-unbound"
Packit 94f725
Packit 94f725
Creates new or dumps existing LUKS2 unbound keyslot. See \fIluksAddKey\fR or
Packit 94f725
\fIluksDump\fR actions for more details.
Packit 94f725
Packit 94f725
.TP
Packit 94f725
.B "\-\-tcrypt\-hidden"
Packit 94f725
.B "\-\-tcrypt\-system"
Packit 94f725
.B "\-\-tcrypt\-backup"
Packit 94f725
Specify which TrueCrypt on-disk header will be used to open the device.
Packit 94f725
See \fITCRYPT\fR section for more info.
Packit 94f725
.TP
Packit 94f725
.B "\-\-veracrypt"
Packit 94f725
Allow VeraCrypt compatible mode. Only for TCRYPT extension.
Packit 94f725
See \fITCRYPT\fR section for more info.
Packit 94f725
.TP
Packit 94f725
.B "\-\-veracrypt\-pim"
Packit 94f725
.B "\-\-veracrypt\-query\-pim"
Packit 94f725
Use a custom Personal Iteration Multiplier (PIM) for VeraCrypt device.
Packit 94f725
See \fITCRYPT\fR section for more info.
Packit 94f725
.TP
Packit 94f725
.B "\-\-serialize\-memory\-hard\-pbkdf"
Packit 94f725
Use a global lock to serialize unlocking of keyslots using memory-hard PBKDF.
Packit 94f725
Packit 94f725
\fBNOTE:\fR This is (ugly) workaround for a specific situation when multiple
Packit 94f725
devices are activated in parallel and system instead of reporting out of memory
Packit 94f725
starts unconditionally stop processes using out-of-memory killer.
Packit 94f725
Packit 94f725
\fBDO NOT USE\fR this switch until you are implementing boot environment
Packit 94f725
with parallel devices activation!
Packit 94f725
.TP
Packit 94f725
.B "\-\-encrypt"
Packit 94f725
Initialize (and run) device encryption (\fIreencrypt\fR action parameter)
Packit 94f725
.TP
Packit 94f725
.B "\-\-decrypt"
Packit 94f725
Initialize (and run) device decryption (\fIreencrypt\fR action parameter)
Packit 94f725
.TP
Packit 94f725
.B "\-\-init\-only"
Packit 94f725
Initialize reencryption (any variant) operation in LUKS2 metadata only and exit. If any
Packit 94f725
reencrypt operation is already initialized in metadata, the command with \-\-init\-only
Packit 94f725
parameter fails.
Packit 94f725
.TP
Packit 94f725
.B "\-\-resume\-only"
Packit 94f725
Resume reencryption (any variant) operation already described in LUKS2 metadata. If no
Packit 94f725
reencrypt operation is initialized, the command with \-\-resume\-only
Packit 94f725
parameter fails. Useful for resuming reencrypt operation without accidentally triggering
Packit 94f725
new reencryption operation.
Packit 94f725
.TP
Packit 94f725
.B "\-\-resilience <mode>"
Packit 94f725
Reencryption resilience mode can be one of \fIchecksum\fR, \fIjournal\fR or \fInone\fR.
Packit 94f725
Packit 94f725
\fIchecksum\fR: default mode, where individual checksums of ciphertext hotzone sectors are stored,
Packit 94f725
so the recovery process can detect which sectors where already reencrypted. It requires that the device sector write is atomic.
Packit 94f725
Packit 94f725
\fIjournal\fR: the hotzone is journaled in the binary area (so the data are written twice).
Packit 94f725
Packit 94f725
\fInone\fR: performance mode. There is no protection and the only way it's safe to interrupt
Packit 94f725
the reencryption is similar to old offline reencryption utility. (ctrl+c).
Packit 94f725
Packit 94f725
The option is ignored if reencryption with datashift mode is in progress.
Packit 94f725
.TP
Packit 94f725
.B "\-\-resilience-hash <hash>"
Packit 94f725
The hash algorithm used with "\-\-resilience checksum" only. The default hash is sha256. With other resilience modes, the hash parameter is ignored.
Packit 94f725
.TP
Packit 94f725
.B "\-\-hotzone-size <size>"
Packit 94f725
This option can be used to set an upper limit on the size of reencryption area (hotzone).
Packit 94f725
The <size> can be specified with unit suffix (for example 50M). Note that actual hotzone
Packit 94f725
size may be less than specified <size> due to other limitations (free space in keyslots area or
Packit 94f725
available memory).
Packit 94f725
.TP
Packit 94f725
.B "\-\-reduce\-device\-size <size>"
Packit 94f725
Initialize LUKS2 reencryption with data device size reduction (currently only \-\-encrypt variant is supported).
Packit 94f725
Packit 94f725
Last <size> sectors of <device> will be used to properly initialize device reencryption. That means any
Packit 94f725
data at last <size> sectors will be lost.
Packit 94f725
Packit 94f725
It could be useful if you added some space to underlying partition or logical volume (so last <size> sectors contains no data).
Packit 94f725
Packit 94f725
Recommended minimal size is twice the default LUKS2 header size (\-\-reduce\-device\-size 32M) for \-\-encrypt use case. Be sure to
Packit 94f725
have enough (at least \-\-reduce\-device\-size value of free space at the end of <device>).
Packit 94f725
Packit 94f725
WARNING: This is a destructive operation and cannot be reverted.  Use with extreme care - accidentally overwritten filesystems are usually unrecoverable.
Packit 94f725
.TP
Packit 94f725
.B "\-\-version"
Packit 94f725
Show the program version.
Packit 94f725
.TP
Packit 94f725
.B "\-\-usage"
Packit 94f725
Show short option help.
Packit 94f725
.TP
Packit 94f725
.B "\-\-help, \-?"
Packit 94f725
Show help text and default parameters.
Packit 94f725
.SH RETURN CODES
Packit 94f725
Cryptsetup returns 0 on success and a non-zero value on error.
Packit 94f725
Packit 94f725
Error codes are: 1 wrong parameters, 2 no permission (bad passphrase),
Packit 94f725
3 out of memory, 4 wrong device specified, 5 device already exists
Packit 94f725
or device is busy.
Packit 94f725
.SH NOTES ON PASSPHRASE PROCESSING FOR PLAIN MODE
Packit 94f725
Note that no iterated hashing or salting is done in plain mode.
Packit 94f725
If hashing is done, it is a single direct hash. This means that
Packit 94f725
low-entropy passphrases are easy to attack in plain mode.
Packit 94f725
Packit 94f725
\fBFrom a terminal\fR: The passphrase is read until the
Packit 94f725
first newline, i.e. '\\n'.
Packit 94f725
The input without the newline character is processed with
Packit 94f725
the default hash or the hash specified with \-\-hash.
Packit 94f725
The hash result will be truncated to the key size
Packit 94f725
of the used cipher, or the size specified with \-s.
Packit 94f725
Packit 94f725
\fBFrom stdin\fR: Reading will continue until a newline (or until
Packit 94f725
the maximum input size is reached), with the trailing newline
Packit 94f725
stripped. The maximum input size is defined by the same
Packit 94f725
compiled-in default as for the maximum key file size and can
Packit 94f725
be overwritten using \-\-keyfile-size option.
Packit 94f725
Packit 94f725
The data read will be hashed with the default hash
Packit 94f725
or the hash specified with \-\-hash.
Packit 94f725
The hash result will be truncated to the key size
Packit 94f725
of the used cipher, or the size specified with \-s.
Packit 94f725
Packit 94f725
Note that if \-\-key-file=- is used for reading the key
Packit 94f725
from stdin, trailing newlines are not stripped from the input.
Packit 94f725
Packit 94f725
If "plain" is used as argument to \-\-hash, the input
Packit 94f725
data will not be hashed. Instead, it will be zero padded (if
Packit 94f725
shorter than the key size) or truncated (if longer than the
Packit 94f725
key size) and used directly as the binary key. This is useful for
Packit 94f725
directly specifying a binary key.
Packit 94f725
No warning will be given if the amount of data read from stdin is
Packit 94f725
less than the key size.
Packit 94f725
Packit 94f725
\fBFrom a key file\fR: It will be truncated to the
Packit 94f725
key size of the used cipher or the size given by \-s
Packit 94f725
and directly used as a binary key.
Packit 94f725
Packit 94f725
\fBWARNING\fR: The \-\-hash argument is being ignored.
Packit 94f725
The \-\-hash option is usable only for stdin input in plain mode.
Packit 94f725
Packit 94f725
If the key file is shorter than the key, cryptsetup
Packit 94f725
will quit with an error.
Packit 94f725
The maximum input size is defined by the same
Packit 94f725
compiled-in default as for the maximum key file size and can
Packit 94f725
be overwritten using \-\-keyfile-size option.
Packit 94f725
Packit 94f725
Packit 94f725
.SH NOTES ON PASSPHRASE PROCESSING FOR LUKS
Packit 94f725
LUKS uses PBKDF2 to protect against dictionary attacks
Packit 94f725
and to give some protection to low-entropy passphrases
Packit 94f725
(see RFC 2898 and the cryptsetup FAQ).
Packit 94f725
Packit 94f725
\fBFrom a terminal\fR: The passphrase is read until the
Packit 94f725
first newline and then processed by PBKDF2 without
Packit 94f725
the newline character.
Packit 94f725
Packit 94f725
\fBFrom stdin\fR:
Packit 94f725
LUKS will read passphrases from stdin up to the
Packit 94f725
first newline character or the compiled-in
Packit 94f725
maximum key file length. If \-\-keyfile\-size is
Packit 94f725
given, it is ignored.
Packit 94f725
Packit 94f725
\fBFrom key file\fR:
Packit 94f725
The complete keyfile is read up to the compiled-in
Packit 94f725
maximum size. Newline characters do not terminate the
Packit 94f725
input. The \-\-keyfile\-size option can be used to limit
Packit 94f725
what is read.
Packit 94f725
Packit 94f725
\fBPassphrase processing\fR:
Packit 94f725
Whenever a passphrase is added to a LUKS header (luksAddKey, luksFormat),
Packit 94f725
the user may specify how much the time the passphrase processing
Packit 94f725
should consume. The time is used to determine the iteration count
Packit 94f725
for PBKDF2 and higher times will offer better protection for
Packit 94f725
low-entropy passphrases, but open will take longer to
Packit 94f725
complete. For passphrases that have entropy higher than the
Packit 94f725
used key length, higher iteration times will not increase security.
Packit 94f725
Packit 94f725
The default setting of one or two seconds is sufficient for most
Packit 94f725
practical cases. The only exception is a low-entropy
Packit 94f725
passphrase used on a device with a slow CPU, as this will
Packit 94f725
result in a low iteration count. On a slow device, it may
Packit 94f725
be advisable to increase the iteration time using the
Packit 94f725
\-\-iter\-time option in order to obtain a higher
Packit 94f725
iteration count. This does slow down all later luksOpen
Packit 94f725
operations accordingly.
Packit 94f725
.SH INCOHERENT BEHAVIOR FOR INVALID PASSPHRASES/KEYS
Packit 94f725
LUKS checks for a valid passphrase when an encrypted partition
Packit 94f725
is unlocked. The behavior of plain dm-crypt is different.
Packit 94f725
It will always decrypt with the passphrase given. If the
Packit 94f725
given passphrase is wrong, the device mapped by plain
Packit 94f725
dm-crypt will essentially still contain encrypted data and
Packit 94f725
will be unreadable.
Packit 94f725
.SH NOTES ON SUPPORTED CIPHERS, MODES, HASHES AND KEY SIZES
Packit 94f725
The available combinations of ciphers, modes, hashes and key sizes
Packit 94f725
depend on kernel support. See /proc/crypto for a list of available
Packit 94f725
options. You might need to load additional kernel crypto modules
Packit 94f725
in order to get more options.
Packit 94f725
Packit 94f725
For the \-\-hash option, if the crypto backend is libgcrypt,
Packit 94f725
then all algorithms supported by the gcrypt library are available.
Packit 94f725
For other crypto backends, some algorithms may be missing.
Packit 94f725
.SH NOTES ON PASSPHRASES
Packit 94f725
Mathematics can't be bribed. Make sure you keep your passphrases safe.
Packit 94f725
There are a few nice tricks for constructing a fallback, when suddenly
Packit 94f725
out of the blue, your brain refuses to cooperate.
Packit 94f725
These fallbacks need LUKS, as it's only possible with LUKS
Packit 94f725
to have multiple passphrases. Still, if your attacker model does
Packit 94f725
not prevent it, storing your passphrase in a sealed envelope somewhere
Packit 94f725
may be a good idea as well.
Packit 94f725
.SH NOTES ON RANDOM NUMBER GENERATORS
Packit 94f725
Random Number Generators (RNG) used in cryptsetup are always the
Packit 94f725
kernel RNGs without any modifications or additions to data stream
Packit 94f725
produced.
Packit 94f725
Packit 94f725
There are two types of randomness cryptsetup/LUKS needs. One type
Packit 94f725
(which always uses /dev/urandom) is used for salts, the AF splitter
Packit 94f725
and for wiping deleted keyslots.
Packit 94f725
Packit 94f725
The second type is used for the volume (master) key. You can switch
Packit 94f725
between using /dev/random and /dev/urandom  here, see
Packit 94f725
\fP\-\-use\-random\fR and \fP\-\-use\-urandom\fR
Packit 94f725
options. Using /dev/random on a system without enough entropy sources
Packit 94f725
can cause \fPluksFormat\fR to block until the requested amount of
Packit 94f725
random data is gathered. In a low-entropy situation (embedded system),
Packit 94f725
this can take a very long time and potentially forever. At the same
Packit 94f725
time, using /dev/urandom in a low-entropy situation will
Packit 94f725
produce low-quality keys. This is a serious problem, but solving
Packit 94f725
it is out of scope for a mere man-page.
Packit 94f725
See \fPurandom(4)\fR for more information.
Packit 94f725
.SH AUTHENTICATED DISK ENCRYPTION (EXPERIMENTAL)
Packit 94f725
Since Linux kernel version 4.12 dm-crypt supports authenticated
Packit 94f725
disk encryption.
Packit 94f725
Packit 94f725
Normal disk encryption modes are length-preserving (plaintext sector
Packit 94f725
is of the same size as a ciphertext sector) and can provide only
Packit 94f725
confidentiality protection, but not cryptographically sound
Packit 94f725
data integrity protection.
Packit 94f725
Packit 94f725
Authenticated modes require additional space per-sector for
Packit 94f725
authentication tag and use Authenticated Encryption with Additional
Packit 94f725
Data (AEAD) algorithms.
Packit 94f725
Packit 94f725
If you configure LUKS2 device with data integrity protection,
Packit 94f725
there will be an underlying dm-integrity device, which provides
Packit 94f725
additional per-sector metadata space and also provide data
Packit 94f725
journal protection to ensure atomicity of data and metadata update.
Packit 94f725
Because there must be additional space for metadata and journal,
Packit 94f725
the available space for the device will be smaller than for
Packit 94f725
length-preserving modes.
Packit 94f725
Packit 94f725
The dm-crypt device then resides on top of such a dm-integrity device.
Packit 94f725
All activation and deactivation of this device stack is performed
Packit 94f725
by cryptsetup, there is no difference in using \fIluksOpen\fR
Packit 94f725
for integrity protected devices.
Packit 94f725
If you want to format LUKS2 device with data integrity protection,
Packit 94f725
use \fI\-\-integrity\fR option.
Packit 94f725
Packit 94f725
Since dm-integrity doesn't support discards (TRIM), dm-crypt device on top of it
Packit 94f725
inherits this, so integrity protection mode doesn't support discards either.
Packit 94f725
Packit 94f725
Some integrity modes requires two independent keys (key for encryption
Packit 94f725
and for authentication). Both these keys are stored in one LUKS keyslot.
Packit 94f725
Packit 94f725
\fBWARNING:\fR All support for authenticated modes is experimental
Packit 94f725
and there are only some modes available for now. Note that there
Packit 94f725
are a very few authenticated encryption algorithms that are suitable
Packit 94f725
for disk encryption.
Packit 94f725
Packit 94f725
.SH NOTES ON LOOPBACK DEVICE USE
Packit 94f725
Cryptsetup is usually used directly on a block device (disk
Packit 94f725
partition or LVM volume). However, if the device argument is a
Packit 94f725
file, cryptsetup tries to allocate a loopback device
Packit 94f725
and map it into this file. This mode requires Linux kernel 2.6.25
Packit 94f725
or more recent which supports the loop autoclear flag (loop device is
Packit 94f725
cleared on the last close automatically). Of course, you can
Packit 94f725
always map a file to a loop-device manually. See the
Packit 94f725
cryptsetup FAQ for an example.
Packit 94f725
Packit 94f725
When device mapping is active, you can see the loop backing file in
Packit 94f725
the status command output. Also see losetup(8).
Packit 94f725
.SH LUKS2 header locking
Packit 94f725
.PP
Packit 94f725
The LUKS2 on-disk metadata is updated in several steps and
Packit 94f725
to achieve proper atomic update, there is a locking mechanism.
Packit 94f725
For an image in file, code uses \fIflock(2)\fR system call.
Packit 94f725
For a block device, lock is performed over a special file stored
Packit 94f725
in a locking directory (by default \fI/run/lock/cryptsetup\fR).
Packit 94f725
The locking directory should be created with the proper security
Packit 94f725
context by the distribution during the boot-up phase.
Packit 94f725
Only LUKS2 uses locks, other formats do not use this mechanism.
Packit 94f725
.SH DEPRECATED ACTIONS
Packit 94f725
.PP
Packit 94f725
The \fIreload\fR action is no longer supported.
Packit 94f725
Please use \fIdmsetup(8)\fR if you need to
Packit 94f725
directly manipulate with the device mapping table.
Packit 94f725
.PP
Packit 94f725
The \fIluksDelKey\fR was replaced with \fIluksKillSlot\fR.
Packit 94f725
.PP
Packit 94f725
.SH REPORTING BUGS
Packit 94f725
Report bugs, including ones in the documentation, on
Packit 94f725
the cryptsetup mailing list at <dm-crypt@saout.de>
Packit 94f725
or in the 'Issues' section on LUKS website.
Packit 94f725
Please attach the output of the failed command with the
Packit 94f725
\-\-debug option added.
Packit 94f725
.SH AUTHORS
Packit 94f725
cryptsetup originally written by Jana Saout <jana@saout.de>
Packit 94f725
.br
Packit 94f725
The LUKS extensions and original man page were written by
Packit 94f725
Clemens Fruhwirth <clemens@endorphin.org>.
Packit 94f725
.br
Packit 94f725
Man page extensions by Milan Broz <gmazyland@gmail.com>.
Packit 94f725
.br
Packit 94f725
Man page rewrite and extension by Arno Wagner <arno@wagner.name>.
Packit 94f725
.SH COPYRIGHT
Packit 94f725
Copyright \(co 2004 Jana Saout
Packit 94f725
.br
Packit 94f725
Copyright \(co 2004-2006 Clemens Fruhwirth
Packit 94f725
.br
Packit 94f725
Copyright \(co 2012-2014 Arno Wagner
Packit 94f725
.br
Packit 94f725
Copyright \(co 2009-2020 Red Hat, Inc.
Packit 94f725
.br
Packit 94f725
Copyright \(co 2009-2020 Milan Broz
Packit 94f725
Packit 94f725
This is free software; see the source for copying conditions.  There is NO
Packit 94f725
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Packit 94f725
.SH SEE ALSO
Packit 94f725
The LUKS website at \fBhttps://gitlab.com/cryptsetup/cryptsetup/\fR
Packit 94f725
Packit 94f725
The cryptsetup FAQ, contained in the distribution package and
Packit 94f725
online at
Packit 94f725
\fBhttps://gitlab.com/cryptsetup/cryptsetup/wikis/FrequentlyAskedQuestions\fR
Packit 94f725
Packit 94f725
The cryptsetup mailing list and list archive, see FAQ entry 1.6.
Packit 94f725
Packit 94f725
The LUKS on-disk format specification available at
Packit 94f725
\fBhttps://gitlab.com/cryptsetup/cryptsetup/wikis/Specification\fR