CRYPTSETUP-LUKSCONVERTKEY(8)
๐ CRYPTSETUP-LUKSCONVERTKEY ๐
okay so bestie, welcome to the cryptsetup-luksConvertKey page, straight outta the Maintenance Commands corner of the manual (section 8, for the girlies keeping track ๐ ). grab a strawberry drink and let's get into it, because this one is lowkey a lot and I am not skipping a single thing. ๐
๐ธ NAME ๐ธ
cryptsetup-luksConvertKey โ the icon that converts an existing LUKS2 keyslot to new PBKDF parameters. that's the whole job. periodt. โจ
๐ฆ SYNOPSIS ๐ฆ
cryptsetup luksConvertKey [<options>] <device>
๐ DESCRIPTION ๐
So what this does is convert an existing LUKS2 keyslot to new PBKDF parameters. the passphrase for the keyslot you're converting must be supplied interactively, or you can hand it over via --key-file. and if you don't specify any --pbkdf parameters, then the LUKS2 default PBKDF values just apply, no biggie. โจ
Now listen, here's where it gets a lil โจspecificโจ. if a keyslot is specified (via --key-slot), then you have to give the passphrase for that keyslot. but if no keyslot is specified and there's still a free keyslot hanging around, then the new parameters get put into a free keyslot first, before the keyslot holding the old parameters gets purged. and if there is no free keyslot at all? then the keyslot with the old parameters is directly overwritten. yes, directly. ๐
WARNING: if a keyslot gets overwritten, a media failure during this operation can cause the overwrite to fail after the old parameters have been wiped, which makes the LUKS container inaccessible. so likeโฆ be careful bestie, fr fr. ๐ญ
And <options> can be [--key-file, --keyfile-offset, --keyfile-size, --key-slot, --hash, --header, --disable-locks, --iter-time, --pbkdf, --pbkdf-force-iterations, --pbkdf-memory, --pbkdf-parallel, --keyslot-cipher, --keyslot-key-size, --timeout, --verify-passphrase].
โจ OPTIONS โจ
okay here comes the big list, and I mean the whole list, no skipping. ๐ซถ
--batch-mode,-qโ suppresses all confirmation questions. use with care, bestie! if the--verify-passphraseoption is not specified, this option also switches off the passphrase verification. ๐ซ--debugor--debug-jsonโ run in debug mode with full diagnostic logs. debug output lines are always prefixed by#. if--debug-jsonis used, additional LUKS2 JSON data structures get printed too. ๐--disable-locksโ disable lock protection for metadata on disk. this option is valid only for LUKS2 and is ignored for other formats.
WARNING: do not use this option unless you run cryptsetup in a restricted environment where locking is impossible to perform (where the /run directory cannot be used).
--force-passwordโ do not use password quality checking for new LUKS passwords. this option is ignored if cryptsetup is built without password quality checking support. for more info about password quality check, see the manual page forpwquality.conf(5)andpasswdqc.conf(5). ๐ช--hash,-h <hash-spec>โ the specified hash is used for PBKDF2 and the AF splitter.--header <device or file storing the LUKS header>โ use a detached (separated) metadata device or file where the LUKS header is stored. this option allows one to store the ciphertext and LUKS header on different devices. for commands that change the LUKS header (e.g.,luksAddKey), specify the device or file with the LUKS header directly as the LUKS device. ๐๏ธ--help,-?โ show help text and default parameters.--iter-time,-i <number of milliseconds>โ the number of milliseconds to spend with PBKDF passphrase processing. specifying0as a parameter selects the compiled-in default. โฑ๏ธ--key-file,-d fileโ read the passphrase from the file. if the name given is-, then the passphrase will be read from stdin. in this case, reading will not stop at newline characters. see section NOTES ON PASSPHRASE PROCESSING incryptsetup(8)for more information. ๐--keyfile-offset valueโ skipvaluebytes at the beginning of the key file.--keyfile-size,-l valueโ read a maximum ofvaluebytes from the key file. the default is to read the whole file up to the compiled-in maximum that can be queried with--help. supplying more data than the compiled-in maximum aborts the operation. this option is useful to cut trailing newlines, for example. if--keyfile-offsetis also given, the size count starts after the offset. โ๏ธ--key-slot,-S <0-N>โ for LUKS operations that add key material, this option allows you to specify which keyslot is selected for the new key. the maximum number of keyslots depends on the LUKS version. LUKS1 can have up to 8 keyslots. LUKS2 can have up to 32 keyslots based on keyslot area size and key size, but a valid keyslot ID can always be between 0 and 31 for LUKS2. ๐ข--keyslot-cipher <cipher-spec>โ this option can be used to set specific cipher encryption for the LUKS2 keyslot area.--keyslot-key-size <bits>โ this option can be used to set a specific key size for the LUKS2 keyslot area.--new-keyfile-offset valueโ skipvaluebytes at the start when adding a new passphrase from the key file.--new-keyfile-size valueโ read a maximum ofvaluebytes when adding a new passphrase from the key file. the default is to read the whole file up to the compiled-in maximum length that can be queried with--help. supplying more than the compiled-in maximum aborts the operation. when--new-keyfile-offsetis also given, reading starts after the offset. ๐--pbkdf <PBKDF spec>โ set Password-Based Key Derivation Function (PBKDF) algorithm for LUKS keyslot. the PBKDF can be:pbkdf2(for PBKDF2 according to RFC2898),argon2ifor Argon2i, orargon2idfor Argon2id (see Argon2 <https://www.cryptolux.org/index.php/Argon2> for more info). for LUKS1, only PBKDF2 is accepted (no need to use this option). the default PBKDF for LUKS2 is set during compilation time and is available in thecryptsetup --helpoutput. a PBKDF is used for increasing the dictionary and brute-force attack cost for keyslot passwords. the parameters can be time, memory and parallel cost. for PBKDF2, only the time cost (number of iterations) applies. for Argon2i/id, there is also memory cost (memory required during the process of key derivation) and parallel cost (number of threads that run in parallel during the key derivation. note that increasing memory cost also increases time, so the final parameter values are measured by a benchmark. the benchmark tries to find iteration time (--iter-time) with required memory cost--pbkdf-memory. if it is not possible, the memory cost is decreased as well. the parallel cost--pbkdf-parallelis constant and is checked against available CPU cores. you can see all PBKDF parameters for a particular LUKS2 keyslot with thecryptsetup-luksDump(8)command. if you do not want to use benchmark and want to specify all parameters directly, use--pbkdf-force-iterationswith--pbkdf-memoryand--pbkdf-parallel. this will override the values without benchmarking. note it can cause extremely long unlocking time or cause out-of-memory conditions with unconditional process termination. use only in specific cases, for example, if you know that the formatted device will be used on some small embedded system. ๐ MINIMAL AND MAXIMAL PBKDF COSTS: for PBKDF2, the minimum iteration count is1000and the maximum is4294967295(maximum for 32-bit unsigned integer). memory and parallel costs are not supported for PBKDF2. for Argon2i and Argon2id, the minimum iteration count (CPU cost) is4, and the maximum is4294967295(maximum for a 32-bit unsigned integer). minimum memory cost is32 KiBand maximum is4 GiB. if the memory cost parameter is benchmarked (not specified by a parameter), it is always in the range from64 MiBto1 GiB. memory cost above1GiB(up to the4GiBmaximum) can be setup only by the--pbkdf-memoryparameter. the parallel cost minimum is1and maximum4(if enough CPU cores are available, otherwise it is decreased by the available CPU cores). ๐งฎ
WARNING: increasing PBKDF computational costs above the mentioned limits provides negligible additional security improvement. while elevated costs significantly increase brute-force overhead, they offer negligible protection against dictionary attacks. the marginal cost increase for processing an entire dictionary remains fundamentally insufficient.
the hardcoded PBKDF limits represent engineered trade-offs between cryptographic security and operational usability. LUKS maintains portability and must be used within a reasonable time on resource-constrained systems. cryptsetup deliberately restricts maximum memory cost (4 GiB) and parallel cost (4) parameters due to architectural limitations (like embedded and legacy systems). PBKDF memory cost mandates actual physical RAM allocation with intensive write operations that must remain in physical RAM. any swap usage results in unacceptable performance degradation. memory management often overcommits allocations beyond available physical memory, expecting most allocated memory to remain unused. in such situations, as PBKDF always uses all allocated memory, it frequently causes out-of-memory failures that abort cryptsetup operations. ๐ญ
--pbkdf-force-iterations numberโ avoid the PBKDF benchmark and set the time cost (iterations) directly. it can be used only for a LUKS/LUKS2 device. see--pbkdfoption for more info.--pbkdf-memory numberโ set the memory cost for PBKDF (for Argon2i/id, the number represents kilobytes). note that it is the maximal value; PBKDF benchmark or available physical memory can decrease it. this option is not available for PBKDF2. ๐ง--pbkdf-parallel numberโ set the parallel cost for PBKDF (number of threads, up to 4). note that it is the maximal value; it is decreased automatically if the CPU online count is lower. this option is not available for PBKDF2. โก--timeout,-t secondsโ the number of seconds to wait before a timeout on passphrase input via terminal. it is relevant every time a passphrase is asked. it has no effect if used in conjunction with--key-file. this option is useful when the system should not stall if the user does not input a passphrase, e.g., during boot. the default is a value of0seconds, which means to wait forever. โณ--usageโ show short option help.--verify-passphrase,-yโ when interactively asking for a passphrase, ask for it twice and complain if both inputs do not match. ignored on input from file or stdin. โ--version,-Vโ show the program version.
๐ REPORTING BUGS ๐
found a bug? (not the cute kind ๐ฆ) report it at the cryptsetup mailing list <cryptsetup@lists.linux.dev> or in the Issues project section <https://gitlab.com/cryptsetup/cryptsetup/-/issues/new>.
and please, bestie, attach the output of the failed command with --debug option added. it helps so much, tysm. ๐ซถ
โจ SEE ALSO โจ
okay bestie, when you're done converting keys and you're like "wait, I have follow-up questions" ๐ญ โ here's where to go next:
- Cryptsetup FAQ โ the actual holy text of "why is it doing that" and "is my data gone". fr fr, read this before you panic-post: <https://gitlab.com/cryptsetup/cryptsetup/wikis/FrequentlyAskedQuestions>
cryptsetup(8),integritysetup(8)andveritysetup(8)โ the whole squad ๐. the main character, plus the two siblings that handle integrity and verification. go say hi.
๐ CRYPTSETUP ๐
This one is part of cryptsetup project โ so yes, it's in the family, it's got the genetics, it belongs: <https://gitlab.com/cryptsetup/cryptsetup/> ๐ฆ
and that's a wrap on CRYPTSETUP-LUKSCONVERTKEY(8), bestie!! you read the whole thing, you understood the whole thing, you're literally the moment ๐
โจ
this page came from cryptsetup 2.8.8 and it's dated 2026-09-07 ๐
now go convert those keys and be iconic about it. i'm so proud of you. periodt. ๐ซถ๐ธ
๐ฆ where this page comes from
- arch rolling: cryptsetup 2.8.8-1 ยท GPL-2.0-or-later
- fedora 44: cryptsetup 2.8.8-1.fc44 ยท GPL-2.0-or-later WITH cryptsetup-OpenSSL-exception AND LGPL-2.1-or-later WITH cryptsetup-OpenSSL-exception
- nixpkgs unstable: cryptsetup 2.8.8
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms