'\" t .\" Title: cryptsetup-benchmark .\" Author: [see the "AUTHOR(S)" section] .\" Generator: Asciidoctor 2.0.20 .\" Date: 2023-07-18 .\" Manual: Maintenance Commands .\" Source: cryptsetup 2.7.2 .\" Language: English .\" .TH "CRYPTSETUP\-BENCHMARK" "8" "2023-07-18" "cryptsetup 2.7.2" "Maintenance Commands" .ie \n(.g .ds Aq \(aq .el .ds Aq ' .ss \n[.ss] 0 .nh .ad l .de URL \fI\\$2\fP <\\$1>\\$3 .. .als MTO URL .if \n[.g] \{\ . mso www.tmac . am URL . ad l . . . am MTO . ad l . . . LINKSTYLE blue R < > .\} .SH "NAME" cryptsetup-benchmark \- benchmarks ciphers and KDF .SH "SYNOPSIS" .sp \fBcryptsetup \fIbenchmark\fP []\fP .SH "DESCRIPTION" .sp Benchmarks ciphers and KDF (key derivation function). Without parameters, it tries to measure few common configurations. .sp To benchmark other ciphers or modes, you need to specify \fB\-\-cipher\fP and \fB\-\-key\-size\fP options. .sp To benchmark PBKDF you need to specify \fB\-\-pbkdf\fP or \fB\-\-hash\fP with optional cost parameters \fB\-\-iter\-time\fP, \fB\-\-pbkdf\-memory\fP or \fB\-\-pbkdf\-parallel\fP. .sp \fBNOTE:\fP This benchmark uses memory only and is only informative. You cannot directly predict real storage encryption speed from it. .sp For testing block ciphers, this benchmark requires kernel userspace crypto API to be available (introduced in Linux kernel 2.6.38). If you are configuring kernel yourself, enable "User\-space interface for symmetric key cipher algorithms" in "Cryptographic API" section (CRYPTO_USER_API_SKCIPHER .config option). .sp \fB\fP can be [\-\-cipher, \-\-key\-size, \-\-hash, \-\-pbkdf, \-\-iter\-time, \-\-pbkdf\-memory, \-\-pbkdf\-parallel]. .SH "OPTIONS" .sp \fB\-\-batch\-mode, \-q\fP .RS 4 Suppresses all confirmation questions. Use with care! .sp If the \-\-verify\-passphrase option is not specified, this option also switches off the passphrase verification. .RE .sp \fB\-\-cipher, \-c\fP \fI\fP .RS 4 Set the cipher specification string. .RE .sp \fB\-\-debug or \-\-debug\-json\fP .RS 4 Run in debug mode with full diagnostic logs. Debug output lines are always prefixed by \fB#\fP. .sp If \-\-debug\-json is used, additional LUKS2 JSON data structures are printed. .RE .sp \fB\-\-hash, \-h\fP \fI\fP .RS 4 The specified hash is used for PBKDF2 and AF splitter. .RE .sp \fB\-\-help, \-?\fP .RS 4 Show help text and default parameters. .RE .sp \fB\-\-iter\-time, \-i \fP .RS 4 The number of milliseconds to spend with PBKDF passphrase processing. Specifying 0 as parameter selects the compiled\-in default. .RE .sp \fB\-\-key\-size, \-s\fP \fIbits\fP .RS 4 Sets key size in \fIbits\fP. The argument has to be a multiple of 8. The possible key\-sizes are limited by the cipher and mode used. .sp See /proc/crypto for more information. Note that key\-size in /proc/crypto is stated in bytes. .sp This option can be used for \fIopen \-\-type plain\fP or \fIluksFormat\fP. All other LUKS actions will use the key\-size specified in the LUKS header. Use \fIcryptsetup \-\-help\fP to show the compiled\-in defaults. .RE .sp \fB\-\-pbkdf \fP .RS 4 Set Password\-Based Key Derivation Function (PBKDF) algorithm for LUKS keyslot. The PBKDF can be: \fIpbkdf2\fP (for PBKDF2 according to RFC2898), \fIargon2i\fP for Argon2i or \fIargon2id\fP for Argon2id (see .URL "https://www.cryptolux.org/index.php/Argon2" "Argon2" "" for more info). .sp 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 \fIcryptsetup \-\-help\fP output. .sp A PBKDF is used for increasing dictionary and brute\-force attack cost for keyslot passwords. The parameters can be time, memory and parallel cost. .sp For PBKDF2, only 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. .sp 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 (\fI\-\-iter\-time\fP) with required memory cost \fI\-\-pbkdf\-memory\fP. If it is not possible, the memory cost is decreased as well. The parallel cost \fI\-\-pbkdf\-parallel\fP is constant and is checked against available CPU cores. .sp You can see all PBKDF parameters for particular LUKS2 keyslot with \fBcryptsetup\-luksDump\fP(8) command. .sp \fBNOTE:\fP If you do not want to use benchmark and want to specify all parameters directly, use \fI\-\-pbkdf\-force\-iterations\fP with \fI\-\-pbkdf\-memory\fP and \fI\-\-pbkdf\-parallel\fP. 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. .sp \fBMINIMAL AND MAXIMAL PBKDF COSTS:\fP For \fBPBKDF2\fP, the minimum iteration count is 1000 and maximum is 4294967295 (maximum for 32bit unsigned integer). Memory and parallel costs are unused for PBKDF2. For \fBArgon2i\fP and \fBArgon2id\fP, minimum iteration count (CPU cost) is 4 and maximum is 4294967295 (maximum for 32bit unsigned integer). Minimum memory cost is 32 KiB and maximum is 4 GiB. (Limited by addressable memory on some CPU platforms.) If the memory cost parameter is benchmarked (not specified by a parameter) it is always in range from 64 MiB to 1 GiB. The parallel cost minimum is 1 and maximum 4 (if enough CPUs cores are available, otherwise it is decreased). .RE .sp \fB\-\-pbkdf\-memory \fP .RS 4 Set the memory cost for PBKDF (for Argon2i/id the number represents kilobytes). Note that it is maximal value, PBKDF benchmark or available physical memory can decrease it. This option is not available for PBKDF2. .RE .sp \fB\-\-pbkdf\-parallel \fP .RS 4 Set the parallel cost for PBKDF (number of threads, up to 4). Note that it is maximal value, it is decreased automatically if CPU online count is lower. This option is not available for PBKDF2. .RE .sp \fB\-\-usage\fP .RS 4 Show short option help. .RE .sp \fB\-\-version, \-V\fP .RS 4 Show the program version. .RE .SH "REPORTING BUGS" .sp Report bugs at \c .MTO "cryptsetup\(atlists.linux.dev" "\fBcryptsetup mailing list\fP" or in \c .URL "https://gitlab.com/cryptsetup/cryptsetup/\-/issues/new" "\fBIssues project section\fP" "." .sp Please attach output of the failed command with \-\-debug option added. .SH "SEE ALSO" .sp .URL "https://gitlab.com/cryptsetup/cryptsetup/wikis/FrequentlyAskedQuestions" "\fBCryptsetup FAQ\fP" "" .sp \fBcryptsetup\fP(8), \fBintegritysetup\fP(8) and \fBveritysetup\fP(8) .SH "CRYPTSETUP" .sp Part of \c .URL "https://gitlab.com/cryptsetup/cryptsetup/" "\fBcryptsetup project\fP" "."