All of lore.kernel.org
 help / color / mirror / Atom feed
* [dm-crypt] How can I write a passphrase hash to key file for plain dm-crypt ?
@ 2014-11-07 16:34 John Lane
  2014-11-07 18:56 ` Arno Wagner
  0 siblings, 1 reply; 4+ messages in thread
From: John Lane @ 2014-11-07 16:34 UTC (permalink / raw)
  To: dm-crypt

I'm trying to use plain dm-crypt. I have an example like this

    $ cryptsetup open /dev/sda mydisk --type plain --hash sha512

that works fine. I enter 'password' as the pass phrase when requested.

I want to create an equivalent key-file so that I can do

    $ cryptsetup open /dev/sda mydisk --type plain --key-file mykey

I couldn't find a cryptsetup command do to this, so I tried these:

    $ openssl dgst -sha512 -binary <<< 'password' > mykey
also
    $ sha512sum <<< 'my_passphrase' | head -c 128 > mykey

without success.

As I understand it, the key file contains a binary key that is used
as-is, so I would have thought the first try above would have worked. I
even used xxd to check that mykey contained the hash in binary data.

How can I make a key-file that is equivalent to a keyed-in passphrase?

Thanks in advance.

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

end of thread, other threads:[~2014-11-08  1:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-07 16:34 [dm-crypt] How can I write a passphrase hash to key file for plain dm-crypt ? John Lane
2014-11-07 18:56 ` Arno Wagner
2014-11-07 20:47   ` John Lane
2014-11-08  1:16     ` Arno Wagner

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.