1CRYPTSETUP-LUKSCONVERTKEY(8) Maintenance Commands CRYPTSETUP-LUKSCONVERTKEY(8)
2
3
4

NAME

6       cryptsetup-luksConvertKey - converts an existing LUKS2 keyslot to new
7       PBKDF parameters
8

SYNOPSIS

10       cryptsetup luksConvertKey [<options>] <device>
11

DESCRIPTION

13       Converts an existing LUKS2 keyslot to new PBKDF parameters. The
14       passphrase for keyslot to be converted must be supplied interactively
15       or via --key-file. If no --pbkdf parameters are specified LUKS2 default
16       PBKDF values will apply.
17
18       If a keyslot is specified (via --key-slot), the passphrase for that
19       keyslot must be given. If no keyslot is specified and there is still a
20       free keyslot, then the new parameters will be put into a free keyslot
21       before the keyslot containing the old parameters is purged. If there is
22       no free keyslot, then the keyslot with the old parameters is
23       overwritten directly.
24
25       WARNING: If a keyslot is overwritten, a media failure during this
26       operation can cause the overwrite to fail after the old parameters have
27       been wiped and make the LUKS container inaccessible.
28
29       <options> can be [--key-file, --keyfile-offset, --keyfile-size,
30       --key-slot, --hash, --header, --disable-locks, --iter-time, --pbkdf,
31       --pbkdf-force-iterations, --pbkdf-memory, --pbkdf-parallel,
32       --keyslot-cipher, --keyslot-key-size, --timeout, --verify-passphrase].
33

OPTIONS

35       --hash, -h <hash-spec>
36           The specified hash is used for PBKDF2 and AF splitter.
37
38       --verify-passphrase, -y
39           When interactively asking for a passphrase, ask for it twice and
40           complain if both inputs do not match. Ignored on input from file or
41           stdin.
42
43       --key-file, -d name
44           Read the passphrase from file.
45
46           If the name given is "-", then the passphrase will be read from
47           stdin. In this case, reading will not stop at newline characters.
48
49           With LUKS, the passphrase supplied via --key-file is always the
50           existing passphrase requested by a command, except in the case of
51           luksFormat where --key-file is equivalent to the positional key
52           file argument.
53
54           If you want to set a new passphrase via key file, you have to use a
55           positional argument to luksAddKey.
56
57           See section NOTES ON PASSPHRASE PROCESSING in cryptsetup(8) for
58           more information.
59
60       --keyfile-offset value
61           Skip value bytes at the beginning of the key file.
62
63       --keyfile-size, -l value
64           Read a maximum of value bytes from the key file. The default is to
65           read the whole file up to the compiled-in maximum that can be
66           queried with --help. Supplying more data than the compiled-in
67           maximum aborts the operation.
68
69           This option is useful to cut trailing newlines, for example. If
70           --keyfile-offset is also given, the size count starts after the
71           offset.
72
73       --new-keyfile-offset value
74           Skip value bytes at the start when adding a new passphrase from key
75           file with luksAddKey.
76
77       --new-keyfile-size value
78           Read a maximum of value bytes when adding a new passphrase from key
79           file with luksAddKey. The default is to read the whole file up to
80           the compiled-in maximum length that can be queried with --help.
81           Supplying more than the compiled in maximum aborts the operation.
82           When --new-keyfile-offset is also given, reading starts after the
83           offset.
84
85       --key-slot, -S <0-N>
86           For LUKS operations that add key material, this option allows you
87           to specify which key slot is selected for the new key.
88
89           The maximum number of key slots depends on the LUKS version. LUKS1
90           can have up to 8 key slots. LUKS2 can have up to 32 key slots based
91           on key slot area size and key size, but a valid key slot ID can
92           always be between 0 and 31 for LUKS2.
93
94       --pbkdf <PBKDF spec>
95           Set Password-Based Key Derivation Function (PBKDF) algorithm for
96           LUKS keyslot. The PBKDF can be: pbkdf2 (for PBKDF2 according to
97           RFC2898), argon2i for Argon2i or argon2id for Argon2id (see Argon2
98           <https://www.cryptolux.org/index.php/Argon2> for more info).
99
100           For LUKS1, only PBKDF2 is accepted (no need to use this option).
101           The default PBKDF for LUKS2 is set during compilation time and is
102           available in cryptsetup --help output.
103
104           A PBKDF is used for increasing dictionary and brute-force attack
105           cost for keyslot passwords. The parameters can be time, memory and
106           parallel cost.
107
108           For PBKDF2, only time cost (number of iterations) applies. For
109           Argon2i/id, there is also memory cost (memory required during the
110           process of key derivation) and parallel cost (number of threads
111           that run in parallel during the key derivation.
112
113           Note that increasing memory cost also increases time, so the final
114           parameter values are measured by a benchmark. The benchmark tries
115           to find iteration time (--iter-time) with required memory cost
116           --pbkdf-memory. If it is not possible, the memory cost is decreased
117           as well. The parallel cost --pbkdf-parallel is constant and is
118           checked against available CPU cores.
119
120           You can see all PBKDF parameters for particular LUKS2 keyslot with
121           cryptsetup-luksDump(8) command.
122
123           NOTE: If you do not want to use benchmark and want to specify all
124           parameters directly, use --pbkdf-force-iterations with
125           --pbkdf-memory and --pbkdf-parallel. This will override the values
126           without benchmarking. Note it can cause extremely long unlocking
127           time. Use only in specific cases, for example, if you know that the
128           formatted device will be used on some small embedded system.
129
130           MINIMAL AND MAXIMAL PBKDF COSTS: For PBKDF2, the minimum iteration
131           count is 1000 and maximum is 4294967295 (maximum for 32bit unsigned
132           integer). Memory and parallel costs are unused for PBKDF2. For
133           Argon2i and Argon2id, minimum iteration count (CPU cost) is 4 and
134           maximum is 4294967295 (maximum for 32bit unsigned integer). Minimum
135           memory cost is 32 KiB and maximum is 4 GiB. (Limited by addressable
136           memory on some CPU platforms.) If the memory cost parameter is
137           benchmarked (not specified by a parameter) it is always in range
138           from 64 MiB to 1 GiB. The parallel cost minimum is 1 and maximum 4
139           (if enough CPUs cores are available, otherwise it is decreased).
140
141       --iter-time, -i <number of milliseconds>
142           The number of milliseconds to spend with PBKDF passphrase
143           processing. Specifying 0 as parameter selects the compiled-in
144           default.
145
146       --pbkdf-memory <number>
147           Set the memory cost for PBKDF (for Argon2i/id the number represents
148           kilobytes). Note that it is maximal value, PBKDF benchmark or
149           available physical memory can decrease it. This option is not
150           available for PBKDF2.
151
152       --pbkdf-parallel <number>
153           Set the parallel cost for PBKDF (number of threads, up to 4). Note
154           that it is maximal value, it is decreased automatically if CPU
155           online count is lower. This option is not available for PBKDF2.
156
157       --pbkdf-force-iterations <num>
158           Avoid PBKDF benchmark and set time cost (iterations) directly. It
159           can be used for LUKS/LUKS2 device only. See --pbkdf option for more
160           info.
161
162       --timeout, -t <number of seconds>
163           The number of seconds to wait before timeout on passphrase input
164           via terminal. It is relevant every time a passphrase is asked. It
165           has no effect if used in conjunction with --key-file.
166
167           This option is useful when the system should not stall if the user
168           does not input a passphrase, e.g. during boot. The default is a
169           value of 0 seconds, which means to wait forever.
170
171       --header <device or file storing the LUKS header>
172           Use a detached (separated) metadata device or file where the LUKS
173           header is stored. This option allows one to store ciphertext and
174           LUKS header on different devices.
175
176           For commands that change the LUKS header (e.g. luksAddKey), specify
177           the device or file with the LUKS header directly as the LUKS
178           device.
179
180       --force-password
181           Do not use password quality checking for new LUKS passwords.
182
183           This option is ignored if cryptsetup is built without password
184           quality checking support.
185
186           For more info about password quality check, see the manual page for
187           pwquality.conf(5) and passwdqc.conf(5).
188
189       --disable-locks
190           Disable lock protection for metadata on disk. This option is valid
191           only for LUKS2 and ignored for other formats.
192
193           WARNING: Do not use this option unless you run cryptsetup in a
194           restricted environment where locking is impossible to perform
195           (where /run directory cannot be used).
196
197       --keyslot-cipher <cipher-spec>
198           This option can be used to set specific cipher encryption for the
199           LUKS2 keyslot area.
200
201       --keyslot-key-size <bits>
202           This option can be used to set specific key size for the LUKS2
203           keyslot area.
204
205       --batch-mode, -q
206           Suppresses all confirmation questions. Use with care!
207
208           If the --verify-passphrase option is not specified, this option
209           also switches off the passphrase verification.
210
211       --debug or --debug-json
212           Run in debug mode with full diagnostic logs. Debug output lines are
213           always prefixed by #.
214
215           If --debug-json is used, additional LUKS2 JSON data structures are
216           printed.
217
218       --version, -V
219           Show the program version.
220
221       --usage
222           Show short option help.
223
224       --help, -?
225           Show help text and default parameters.
226

REPORTING BUGS

228       Report bugs at cryptsetup mailing list <cryptsetup@lists.linux.dev> or
229       in Issues project section
230       <https://gitlab.com/cryptsetup/cryptsetup/-/issues/new>.
231
232       Please attach output of the failed command with --debug option added.
233

SEE ALSO

235       Cryptsetup FAQ
236       <https://gitlab.com/cryptsetup/cryptsetup/wikis/FrequentlyAskedQuestions>
237
238       cryptsetup(8), integritysetup(8) and veritysetup(8)
239

CRYPTSETUP

241       Part of cryptsetup project <https://gitlab.com/cryptsetup/cryptsetup/>.
242
243
244
245cryptsetup 2.5.0                  2022-07-28      CRYPTSETUP-LUKSCONVERTKEY(8)
Impressum