From: Arno Wagner <arno@wagner.name>
To: Lamy Geier <lamyergeier@gmail.com>
Cc: cryptsetup@lists.linux.dev
Subject: Re: Slow unlock of the LUKS device at boot
Date: Tue, 29 Nov 2022 21:39:51 +0100 [thread overview]
Message-ID: <20221129203951.GA26364@tansi.org> (raw)
In-Reply-To: <84bc33e5-c264-c1bc-a17a-9e4229a08a1e@gmail.com>
Hi Lamy,
if you created the slow-to-unlock LUKS container on this
device and with default parameters, then there seems to be
some bug or configuration problem at play.
I have never used keyfiles (except for some tests),
so I do not know what it could be.
Regards,
Arno
On Tue, Nov 29, 2022 at 21:19:50 CET, Lamy Geier wrote:
> # Observation
>
> For the slow partition (that uses LUKS2 and has LVM) takes about 6 minutes
> to test passphrase as follows and returns a warning "No usable token is
> available."
>
> ```bash
> sudo cryptsetup -v open --test-passphrase --type luks /dev/nvme0n1p5
> --key-file /etc/luks/boot_os.keyfile
> sudo cryptsetup -v open --test-passphrase --type luks /dev/nvme0n1p5
> ```
>
> For the boot partition (LUKS1), which used the same passphrase and keyfile
> as the above partition it takes just 5 seconds to test passphrase
>
>
> ```bash
> sudo cryptsetup -v open --test-passphrase --type luks /dev/nvme0n1p1
> --key-file /etc/luks/boot_os.keyfile
> sudo cryptsetup -v open --test-passphrase --type luks /dev/nvme0n1p1
> ```
>
> ---
>
> Also, I did cryptsetup benchmark as follows
>
> ``` bash
> $ cryptsetup benchmark
> # Tests are approximate using memory only (no storage IO).
> PBKDF2-sha1 2631307 iterations per second for 256-bit key
> PBKDF2-sha256 5637505 iterations per second for 256-bit key
> PBKDF2-sha512 2118335 iterations per second for 256-bit key
> PBKDF2-ripemd160 1115506 iterations per second for 256-bit key
> PBKDF2-whirlpool 1006310 iterations per second for 256-bit key
> argon2i 9 iterations, 1048576 memory, 4 parallel threads (CPUs) for
> 256-bit key (requested 2000 ms time)
> argon2id 9 iterations, 1048576 memory, 4 parallel threads (CPUs) for
> 256-bit key (requested 2000 ms time)
> # Algorithm | Key | Encryption | Decryption
> aes-cbc 128b 1727.7 MiB/s 6931.8 MiB/s
> serpent-cbc 128b 116.2 MiB/s 868.9 MiB/s
> twofish-cbc 128b 252.9 MiB/s 566.7 MiB/s
> aes-cbc 256b 1313.0 MiB/s 5684.8 MiB/s
> serpent-cbc 256b 120.3 MiB/s 867.2 MiB/s
> twofish-cbc 256b 257.5 MiB/s 563.5 MiB/s
> aes-xts 256b 5342.5 MiB/s 5333.8 MiB/s
> serpent-xts 256b 748.8 MiB/s 783.1 MiB/s
> twofish-xts 256b 517.7 MiB/s 530.6 MiB/s
> aes-xts 512b 4779.9 MiB/s 4819.2 MiB/s
> serpent-xts 512b 756.1 MiB/s 779.9 MiB/s
> twofish-xts 512b 521.5 MiB/s 529.2 MiB/s
> ```
>
>
>
> - Is the warning responsible for this slow behavior: "No usable token is
> available." Or can you suggest if I should tweak some key parameters or
> change the order of keys in keyslots.
>
>
> --
> Thanks and Regards
>
> Lamy
--
Arno Wagner, Dr. sc. techn., Dipl. Inform., Email: arno@wagner.name
GnuPG: ID: CB5D9718 FP: 12D6 C03B 1B30 33BB 13CF B774 E35C 5FA1 CB5D 9718
----
A good decision is based on knowledge and not on numbers. -- Plato
If it's in the news, don't worry about it. The very definition of
"news" is "something that hardly ever happens." -- Bruce Schneier
next prev parent reply other threads:[~2022-11-29 20:46 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-29 19:50 Slow unlock of the LUKS device at boot Lamy Geier
2022-11-29 20:02 ` Lamy Geier
2022-11-29 20:19 ` Lamy Geier
2022-11-29 20:39 ` Arno Wagner [this message]
2022-12-01 14:40 ` Ondrej Kozina
2022-12-01 21:07 ` Arno Wagner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20221129203951.GA26364@tansi.org \
--to=arno@wagner.name \
--cc=cryptsetup@lists.linux.dev \
--cc=lamyergeier@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox