LUKS password takes over 30 seconds to check

Ever since changing the LUKS password, it takes over/around 30 seconds to check the password.

The original LUKS password would be checked almost instantaneously.

Is there a way to speed up the process?

1 Like

Did you add a new password or change an existing one?
If you added a password to a new slot, unlocking will take longer because the unlocking process cycles through all your passphrase slots until it finds a match.
Using slot0 will provide the fastest unlocking time.

Check your slots with:
sudo cryptsetup luksDump <yourLuksDevice>

Here’s some information about manipulating luks keys.

I have always found this tutorial helpful:

I ensured that password is in slot0, but the password still takes longer than I would like to check. This started occurring after I added a new password and moved around all the slots. Currently, am using two LUKS slots, one for the key file, so only need to enter one password, and one for the primary password.

You can check your unlock time with…

TIMEFORMAT='%lU';time sudo cryptsetup luksOpen --test-passphrase --verbose <luksdevice>

Default should be about 2s, e. g. on the system I’m currently on:

TIMEFORMAT='%lU';time sudo cryptsetup luksOpen --test-passphrase --verbose /dev/sda2
Enter passphrase for /dev/sda2: 
Key slot 0 unlocked.
Command successful.

The default is sufficiently low, not sure why it is still taking so long to unlock or fail…

1 Like