[dm-crypt] Add new key from a variable

Arno Wagner arno at wagner.name
Fri Dec 26 17:51:59 CET 2014


This may not be such a good idea. If you are unlucky, the 
variable content may end up in swap. My guess would be that
the probability is low though.

Arno


On Fri, Dec 26, 2014 at 07:49:40 CET, Sven Eschenberg wrote:
> Hi,
> 
> You could use STDIN to pipe the value of $var into cryptsetup, if that
> fits your needs. See man page on password processing to make sure you
> don't hit any surprises.
> 
> Regards
> 
> -Sven
> 
> 
> On Fri, December 26, 2014 03:47, Jian-Ming Zheng wrote:
> > Hi,
> >
> > I want to write a script to add a new key to LUKS device /dev/sda2. As
> > I know, I can set the new key in a key file (for example,
> > new-key-file) and use the key file in the option. For example,
> >
> > $ cryptsetup luksAddKey /dev/sda2 new-key-file
> >
> > Can I add a new key from a variable defined in my script (for example,
> > $newkey) instead of using a key file?
> >
> > Thanks
> > _______________________________________________
> > dm-crypt mailing list
> > dm-crypt at saout.de
> > http://www.saout.de/mailman/listinfo/dm-crypt
> >
> 
> 
> _______________________________________________
> dm-crypt mailing list
> dm-crypt at saout.de
> http://www.saout.de/mailman/listinfo/dm-crypt

-- 
Arno Wagner,     Dr. sc. techn., Dipl. Inform.,    Email: arno at wagner.name
GnuPG: ID: CB5D9718  FP: 12D6 C03B 1B30 33BB 13CF  B774 E35C 5FA1 CB5D 9718
----
A good decision is based on knowledge and not on numbers. -- Plato

If it's in the news, don't worry about it.  The very definition of 
"news" is "something that hardly ever happens." -- Bruce Schneier


More information about the dm-crypt mailing list