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

NAME

6       cryptsetup-benchmark - benchmarks ciphers and KDF
7

SYNOPSIS

9       cryptsetup benchmark [<options>]
10

DESCRIPTION

12       Benchmarks ciphers and KDF (key derivation function). Without
13       parameters, it tries to measure few common configurations.
14
15       To benchmark other ciphers or modes, you need to specify --cipher and
16       --key-size options.
17
18       To benchmark PBKDF you need to specify --pbkdf or --hash with optional
19       cost parameters --iter-time, --pbkdf-memory or --pbkdf-parallel.
20
21       NOTE: This benchmark uses memory only and is only informative. You
22       cannot directly predict real storage encryption speed from it.
23
24       For testing block ciphers, this benchmark requires kernel userspace
25       crypto API to be available (introduced in Linux kernel 2.6.38). If you
26       are configuring kernel yourself, enable "User-space interface for
27       symmetric key cipher algorithms" in "Cryptographic API" section
28       (CRYPTO_USER_API_SKCIPHER .config option).
29
30       <options> can be [--cipher, --key-size, --hash, --pbkdf, --iter-time,
31       --pbkdf-memory, --pbkdf-parallel].
32

OPTIONS

34       --hash, -h <hash-spec>
35           The specified hash is used for PBKDF2 and AF splitter.
36
37       --cipher, -c <cipher-spec>
38           Set the cipher specification string.
39
40       --key-size, -s bits
41           Sets key size in bits. The argument has to be a multiple of 8. The
42           possible key-sizes are limited by the cipher and mode used.
43
44           See /proc/crypto for more information. Note that key-size in
45           /proc/crypto is stated in bytes.
46
47           This option can be used for open --type plain or luksFormat. All
48           other LUKS actions will use the key-size specified in the LUKS
49           header. Use cryptsetup --help to show the compiled-in defaults.
50
51       --pbkdf <PBKDF spec>
52           Set Password-Based Key Derivation Function (PBKDF) algorithm for
53           LUKS keyslot. The PBKDF can be: pbkdf2 (for PBKDF2 according to
54           RFC2898), argon2i for Argon2i or argon2id for Argon2id (see Argon2
55           <https://www.cryptolux.org/index.php/Argon2> for more info).
56
57           For LUKS1, only PBKDF2 is accepted (no need to use this option).
58           The default PBKDF for LUKS2 is set during compilation time and is
59           available in cryptsetup --help output.
60
61           A PBKDF is used for increasing dictionary and brute-force attack
62           cost for keyslot passwords. The parameters can be time, memory and
63           parallel cost.
64
65           For PBKDF2, only time cost (number of iterations) applies. For
66           Argon2i/id, there is also memory cost (memory required during the
67           process of key derivation) and parallel cost (number of threads
68           that run in parallel during the key derivation.
69
70           Note that increasing memory cost also increases time, so the final
71           parameter values are measured by a benchmark. The benchmark tries
72           to find iteration time (--iter-time) with required memory cost
73           --pbkdf-memory. If it is not possible, the memory cost is decreased
74           as well. The parallel cost --pbkdf-parallel is constant and is
75           checked against available CPU cores.
76
77           You can see all PBKDF parameters for particular LUKS2 keyslot with
78           cryptsetup-luksDump(8) command.
79
80           NOTE: If you do not want to use benchmark and want to specify all
81           parameters directly, use --pbkdf-force-iterations with
82           --pbkdf-memory and --pbkdf-parallel. This will override the values
83           without benchmarking. Note it can cause extremely long unlocking
84           time. Use only in specific cases, for example, if you know that the
85           formatted device will be used on some small embedded system.
86
87           MINIMAL AND MAXIMAL PBKDF COSTS: For PBKDF2, the minimum iteration
88           count is 1000 and maximum is 4294967295 (maximum for 32bit unsigned
89           integer). Memory and parallel costs are unused for PBKDF2. For
90           Argon2i and Argon2id, minimum iteration count (CPU cost) is 4 and
91           maximum is 4294967295 (maximum for 32bit unsigned integer). Minimum
92           memory cost is 32 KiB and maximum is 4 GiB. (Limited by addressable
93           memory on some CPU platforms.) If the memory cost parameter is
94           benchmarked (not specified by a parameter) it is always in range
95           from 64 MiB to 1 GiB. The parallel cost minimum is 1 and maximum 4
96           (if enough CPUs cores are available, otherwise it is decreased).
97
98       --iter-time, -i <number of milliseconds>
99           The number of milliseconds to spend with PBKDF passphrase
100           processing. Specifying 0 as parameter selects the compiled-in
101           default.
102
103       --pbkdf-memory <number>
104           Set the memory cost for PBKDF (for Argon2i/id the number represents
105           kilobytes). Note that it is maximal value, PBKDF benchmark or
106           available physical memory can decrease it. This option is not
107           available for PBKDF2.
108
109       --pbkdf-parallel <number>
110           Set the parallel cost for PBKDF (number of threads, up to 4). Note
111           that it is maximal value, it is decreased automatically if CPU
112           online count is lower. This option is not available for PBKDF2.
113
114       --batch-mode, -q
115           Suppresses all confirmation questions. Use with care!
116
117           If the --verify-passphrase option is not specified, this option
118           also switches off the passphrase verification.
119
120       --debug or --debug-json
121           Run in debug mode with full diagnostic logs. Debug output lines are
122           always prefixed by #.
123
124           If --debug-json is used, additional LUKS2 JSON data structures are
125           printed.
126
127       --version, -V
128           Show the program version.
129
130       --usage
131           Show short option help.
132
133       --help, -?
134           Show help text and default parameters.
135

REPORTING BUGS

137       Report bugs at cryptsetup mailing list <cryptsetup@lists.linux.dev> or
138       in Issues project section
139       <https://gitlab.com/cryptsetup/cryptsetup/-/issues/new>.
140
141       Please attach output of the failed command with --debug option added.
142

SEE ALSO

144       Cryptsetup FAQ
145       <https://gitlab.com/cryptsetup/cryptsetup/wikis/FrequentlyAskedQuestions>
146
147       cryptsetup(8), integritysetup(8) and veritysetup(8)
148

CRYPTSETUP

150       Part of cryptsetup project <https://gitlab.com/cryptsetup/cryptsetup/>.
151
152
153
154cryptsetup 2.5.0                  2022-07-28           CRYPTSETUP-BENCHMARK(8)
Impressum