@@ -135,6 +135,10 @@ could cost GRUB half a minute due to those factors' absence.
135135
136136## Change the Parameters
137137
138+ The parameters that affect the unlock speed the most are applied on a per-key
139+ slot basis rather than on the entire LUKS partition, so they need to be changed
140+ individually for each key slot.
141+
138142` cryptsetup luksConvertKey ` can be used to update a key slot's parameters. If
139143the ` --key-file ` option is * not* included in its invocation, then ` cryptsetup `
140144asks for the passphrase and applies the new settings to any key slot that can
@@ -147,14 +151,21 @@ these ones for updating a key slot's parameters:
147151- ` --pbkdf-force-iterations ` : The new time cost for the key slot
148152- ` --pbkdf-memory ` : The new memory requirement for the key slot
149153
150- The following commands set the number of iterations (i.e. time cost) to 4 and
154+ The commands below set the number of iterations (i.e. time cost) to 4 and
151155memory requirement to 400 MiB, which, at least on a quad-core Intel Core
152156i5-1135G7 dated from 2020, allow the LUKS partition to be unlocked in about 2
153- seconds from GRUB 2.14 and should still grant reasonable security:
157+ seconds from GRUB 2.14 and should still grant reasonable security. Note that
158+ customized encryption parameters (like ` --pbkdf ` and ` --hash ` in previous
159+ sections) must be explicitly specified again in the commands, or else
160+ ` cryptsetup ` would reset them to their default values.
154161
155162``` console
156- # cryptsetup luksConvertKey /dev/sda2 --pbkdf-force-iterations 4 --pbkdf-memory 409600
157- # cryptsetup luksConvertKey /dev/sda2 --pbkdf-force-iterations 4 --pbkdf-memory 409600 --key-file /etc/cryptsetup-keys.d/gentoo.key
163+ # cryptsetup luksConvertKey /dev/sda2 \
164+ --pbkdf argon2id --hash sha512 \
165+ --pbkdf-force-iterations 4 --pbkdf-memory 409600
166+ # cryptsetup luksConvertKey /dev/sda2 \
167+ --pbkdf argon2id --hash sha512 \
168+ --pbkdf-force-iterations 4 --pbkdf-memory 409600 --key-file /etc/cryptsetup-keys.d/gentoo.key
158169```
159170
160171These commands update the parameters for both key slots together. Although
0 commit comments