You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: man/common_options.adoc
+18-4Lines changed: 18 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -736,13 +736,27 @@ This will override the values without benchmarking.
736
736
Note it can cause extremely long unlocking time or cause out-of-memory conditions with unconditional process termination.
737
737
Use only in specific cases, for example, if you know that the formatted device will be used on some small embedded system.
738
738
+
739
-
*MINIMAL AND MAXIMAL PBKDF COSTS:* For *PBKDF2*, the minimum iteration count is 1000 and maximum is 4294967295 (maximum for 32-bit unsigned integer).
740
-
Memory and parallel costs are unused for PBKDF2.
739
+
*MINIMAL AND MAXIMAL PBKDF COSTS:* For *PBKDF2*, the minimum iteration count is 1000 and the maximum is 4294967295 (maximum for 32-bit unsigned integer).
740
+
Memory and parallel costs are not supported for PBKDF2.
741
741
For *Argon2i* and *Argon2id*, the minimum iteration count (CPU cost) is 4, and the maximum is 4294967295 (maximum for a 32-bit unsigned integer).
742
742
Minimum memory cost is 32 KiB and maximum is 4 GiB.
743
-
(Limited by addressable memory on some CPU platforms.)
744
743
If the memory cost parameter is benchmarked (not specified by a parameter), it is always in the range from 64 MiB to 1 GiB.
745
-
The parallel cost minimum is 1 and maximum 4 (if enough CPU cores are available, otherwise it is decreased).
744
+
Memory cost above 1GiB (up to the 4GiB maximum) can be setup only by the --pbkdf-memory parameter.
745
+
The parallel cost minimum is 1 and maximum 4 (if enough CPU cores are available, otherwise it is decreased by the available CPU cores).
While elevated costs significantly increase brute-force overhead, they offer negligible protection against dictionary attacks.
749
+
The marginal cost increase for processing an entire dictionary remains fundamentally insufficient.
750
+
+
751
+
The hardcoded PBKDF limits represent engineered trade-offs between cryptographic security and operational usability.
752
+
LUKS maintains portability and must be used within a reasonable time on resource-constrained systems.
753
+
+
754
+
Cryptsetup deliberately restricts maximum memory cost (4 GiB) and parallel cost (4) parameters due to architectural limitations (like embedded and legacy systems).
755
+
+
756
+
PBKDF memory cost mandates actual physical RAM allocation with intensive write operations that must remain in physical RAM.
757
+
Any swap usage results in unacceptable performance degradation.
758
+
Memory management often overcommits allocations beyond available physical memory, expecting most allocated memory to remain unused.
759
+
In such situations, as PBKDF always uses all allocated memory, it frequently causes out-of-memory failures that abort cryptsetup operations.
Copy file name to clipboardExpand all lines: man/cryptsetup.8.adoc
+10-4Lines changed: 10 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -98,7 +98,7 @@ For most purposes, both terms can be used interchangeably.
98
98
LUKS can manage multiple passphrases that can be individually revoked or changed.
99
99
Each passphrase uses an individual keyslot containing a volume key for data encryption.
100
100
Keyslots can be securely scrubbed from persistent media due to the use of anti-forensic stripes.
101
-
Passphrases are protected against brute-force and dictionary attacks by the Password-Based Key Derivation Function (PBKDF).
101
+
Passphrases are protected against brute-force attacks by the Password-Based Key Derivation Function (PBKDF).
102
102
A passphrase stored in a file is called a key file.
103
103
The only difference between a passphrase and a key file is that a key file can contain binary data.
104
104
Both are processed the same.
@@ -489,8 +489,6 @@ The maximum input size is defined by the same compiled-in default as the maximum
489
489
490
490
=== Passphrase processing for LUKS
491
491
492
-
LUKS uses PBKDF to protect against dictionary attacks and to give some protection to low-entropy passphrases (see cryptsetup FAQ).
493
-
494
492
*From a terminal*: The passphrase is read until the first newline and then processed by PBKDF2 without the newline character.
495
493
496
494
*From stdin*: LUKS will read passphrases from stdin up to the first newline character or the compiled-in maximum key file length.
@@ -500,7 +498,15 @@ If --keyfile-size is given, it is ignored.
500
498
Newline characters do not terminate the input.
501
499
The --keyfile-size option can be used to limit what is read.
502
500
503
-
*Passphrase processing*: Whenever a passphrase is added to a LUKS header (luksAddKey, luksFormat), the user may specify how much time the passphrase processing should consume.
501
+
LUKS uses *Password-Based Key Derivation Function* (PBKDF) to protect against brute-force attacks and to give some protection to low-entropy passphrases (see cryptsetup FAQ).
502
+
LUKS1 supports the PBKDF2 algorithm only, while LUKS2 also supports memory-hard Argon2.
503
+
PBKDFs are configured with costs: how long the iteration should run (CPU cost or iteration count), how much memory is used (memory cost), and how many parallel processes are used (parallel cost).
504
+
PBKDF2 supports only iteration count.
505
+
Cryptsetup uses PBKDF benchmarking to calculate optimal costs based on the computer where the new passphrase is being initialized.
506
+
If needed, these costs can also be overwritten.
507
+
Note that there are some hardcoded limits, for details see *MINIMAL AND MAXIMAL PBKDF COSTS* section in --pbkdf option description.
508
+
509
+
Whenever a passphrase is added to a LUKS header (luksAddKey, luksFormat), the user may specify how much time the passphrase processing should consume.
504
510
The time is used to determine the iteration count for PBKDF2, and higher times will offer better protection for low-entropy passphrases, but the open command will take longer to complete.
505
511
For passphrases that have entropy higher than the used key length, higher iteration times will not increase security.
0 commit comments