All of lore.kernel.org
 help / color / mirror / Atom feed
* [dm-crypt] Can I test for LUKS passphrase strength without formatting a device?
@ 2017-11-07 16:51 Jan Tulak
  2017-11-07 18:45 ` Milan Broz
  2017-11-07 21:12 ` Michael Kjörling
  0 siblings, 2 replies; 4+ messages in thread
From: Jan Tulak @ 2017-11-07 16:51 UTC (permalink / raw)
  To: dm-crypt

Hi

Is it possible to test whether a passphrase is strong enough (and
luksFormat will accept it), without the need to really create a device
with this passphrase? I ask because I want to test the password before
I run a sequence of commands and I don't want them to fail in the
middle just because of a weak passphrase.

I checked for the --test-passphrase, but that verifies if the
passphrase would decrypt an existing device, which is not what I want.

Thanks,
Jan

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dm-crypt] Can I test for LUKS passphrase strength without formatting a device?
  2017-11-07 16:51 [dm-crypt] Can I test for LUKS passphrase strength without formatting a device? Jan Tulak
@ 2017-11-07 18:45 ` Milan Broz
  2017-11-07 21:34   ` Jan Tulak
  2017-11-07 21:12 ` Michael Kjörling
  1 sibling, 1 reply; 4+ messages in thread
From: Milan Broz @ 2017-11-07 18:45 UTC (permalink / raw)
  To: Jan Tulak, dm-crypt

On 11/07/2017 05:51 PM, Jan Tulak wrote:
> Is it possible to test whether a passphrase is strong enough (and
> luksFormat will accept it), without the need to really create a device
> with this passphrase? I ask because I want to test the password before
> I run a sequence of commands and I don't want them to fail in the
> middle just because of a weak passphrase.

Cryptsetup/LUKS does not itself enforce any passphrase quality, it is libpwquality
that libcryptsetup can be linked to (optionally, we use it in all Red Hat distros).

See man for pwquality library (the idea is to enforce password policy for the whole
distro, so it uses configuration pwquality file).

> I checked for the --test-passphrase, but that verifies if the
> passphrase would decrypt an existing device, which is not what I want.

This tests only LUKS, pwquality is called only in Format.

m.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dm-crypt] Can I test for LUKS passphrase strength without formatting a device?
  2017-11-07 16:51 [dm-crypt] Can I test for LUKS passphrase strength without formatting a device? Jan Tulak
  2017-11-07 18:45 ` Milan Broz
@ 2017-11-07 21:12 ` Michael Kjörling
  1 sibling, 0 replies; 4+ messages in thread
From: Michael Kjörling @ 2017-11-07 21:12 UTC (permalink / raw)
  To: dm-crypt

On 7 Nov 2017 17:51 +0100, from jtulak@redhat.com (Jan Tulak):
> Is it possible to test whether a passphrase is strong enough (and
> luksFormat will accept it), without the need to really create a device
> with this passphrase? I ask because I want to test the password before
> I run a sequence of commands and I don't want them to fail in the
> middle just because of a weak passphrase.

Adding to Milan Broz's answer, you can always use a simple file (or a
sparse file) as a backing device for a LUKS container. Doing so will
also tell you that the utilities can understand all other options
you're feeding them, which may be a consideration if you are providing
custom settings (for example, hash algorithm, encryption algorithm,
etc.). Just remember to close the container before you delete the
file.

-- 
Michael Kjörling • https://michael.kjorling.se • michael@kjorling.se
                 “People who think they know everything really annoy
                 those of us who know we don’t.” (Bjarne Stroustrup)

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dm-crypt] Can I test for LUKS passphrase strength without formatting a device?
  2017-11-07 18:45 ` Milan Broz
@ 2017-11-07 21:34   ` Jan Tulak
  0 siblings, 0 replies; 4+ messages in thread
From: Jan Tulak @ 2017-11-07 21:34 UTC (permalink / raw)
  To: Milan Broz; +Cc: dm-crypt

On Tue, Nov 7, 2017 at 7:45 PM, Milan Broz <gmazyland@gmail.com> wrote:
> On 11/07/2017 05:51 PM, Jan Tulak wrote:
>> Is it possible to test whether a passphrase is strong enough (and
>> luksFormat will accept it), without the need to really create a device
>> with this passphrase? I ask because I want to test the password before
>> I run a sequence of commands and I don't want them to fail in the
>> middle just because of a weak passphrase.
>
> Cryptsetup/LUKS does not itself enforce any passphrase quality, it is libpwquality
> that libcryptsetup can be linked to (optionally, we use it in all Red Hat distros).
>
> See man for pwquality library (the idea is to enforce password policy for the whole
> distro, so it uses configuration pwquality file).
>
>> I checked for the --test-passphrase, but that verifies if the
>> passphrase would decrypt an existing device, which is not what I want.
>
> This tests only LUKS, pwquality is called only in Format.
>
> m.

Ah, thanks for directing me the right way. :-)

Cheers,
Jan

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-11-07 21:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-07 16:51 [dm-crypt] Can I test for LUKS passphrase strength without formatting a device? Jan Tulak
2017-11-07 18:45 ` Milan Broz
2017-11-07 21:34   ` Jan Tulak
2017-11-07 21:12 ` Michael Kjörling

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.