Re: key-size argument not working with luksAddKey

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Sep 14, 2010 at 12:59:57PM -0400, Josh Litherland wrote:
> > That is done differently. May I direct your attention to the
> > item "How do I read a LUKS slot key from file?" in the FAQ?
> 
> Understood.  The point of my original query is that the procedure outlined
> in that FAQ _will not work_ if the key-file you provide has trailing bytes
> after the actual key part, as it does in my 2000key test file and as it will
> _always_ do if you're using a raw block device as your key file.

Oh, it works. It just does not take partial files as input,
only full ones. This is not surprising as cutting out part
of a file is a task for a diffewrent tool by the UNIX 
philosophy, see my second anzwer about reading the passphrase
from STDIN and cutting with 'head'. 

> A workaround that works is to dd off the key into a separate file and use
> that new file as the argument for luksAddKey (and then be careful to shred
> -u the file afterward!).  My patch adds the ability to handle this task
> internally within cryptsetup, without having to duplicate and subsequently
> destroy the extra copy of the key, and in a way that is consistent with the
> user interface of other luks operations.

Copying the file is a bad idea for security reasons. As cryptsetup 
accepts '-' as filename (except on adding or changing a passphrase), 
it is not needed. Also note that in more complex set-ups you
might be able transfer the cutout of the passphrase bit-sequence
by a named pipe.

I can see what you are tryong to do, but I think your patch 
falls into the Microsoft pitfall of having complex tools 
that do a lot of tasts but none particularly well ;-)

I recomend having a look through the Gnu Textutils. They
are 8-bit clean (work on binary data) and there is amazing 
stuff in there. Another pitfall for us few that can actually
code is to write things that already exist and work well.
Believe me, I do understand the urge.

Arno

-- 
Arno Wagner, Dr. sc. techn., Dipl. Inform., CISSP -- Email: arno@xxxxxxxxxxx 
GnuPG:  ID: 1E25338F  FP: 0C30 5782 9D93 F785 E79C  0296 797F 6B50 1E25 338F
----
Cuddly UI's are the manifestation of wishful thinking. -- Dylan Evans

If it's in the news, don't worry about it.  The very definition of 
"news" is "something that hardly ever happens." -- Bruce Schneier 
_______________________________________________
dm-crypt mailing list
dm-crypt@xxxxxxxx
http://www.saout.de/mailman/listinfo/dm-crypt


[Index of Archives]     [Device Mapper Devel]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Packaging]     [Fedora SELinux]     [Yosemite News]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux