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