From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from avasout05.plus.net (avasout05.plus.net [84.93.230.250]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by mail.server123.net (Postfix) with ESMTPS for ; Fri, 7 Nov 2014 17:39:42 +0100 (CET) Message-ID: <545CF49F.9040305@jelmail.com> Date: Fri, 07 Nov 2014 16:34:39 +0000 From: John Lane MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: [dm-crypt] How can I write a passphrase hash to key file for plain dm-crypt ? List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: dm-crypt@saout.de 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.