Re: cryptsetup with Python subprocess + pipes

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

 



Ahhh yes! Thank you Diagon and Milan.
I've added now the -q switch.

I looked at the pycryptsetup but 2 things:

1. It's not Python 3
2. It's an extra dependency and not in the repos.

Milan Broz:
> On 06/23/2016 11:37 PM, Police Terror wrote:
>> Hello,
>>
>> I'm trying to make a plausible deniability encryption wrapper around
>> cryptsetup.
>>
>> Basically it uses a hash table to first lookup an offset (encrypted with
>> the password), then uses that offset to load a hidden volume within a
>> contiguous file (within which other volumes may or may not exist).
>>
>> The theory is solid, and everything is mostly working. The only problem
>> I'm having is doing the communication in Python:
>>
>>     # Format the volume
>>     pipe = subprocess.Popen(["cryptsetup", "luksFormat", loop_device],
>>                             stdout=subprocess.PIPE,
>>                             stdin=subprocess.PIPE)
>>     out = pipe.communicate(input=b"YES\n" + password)
>>     if pipe.returncode:
>>         error("Problem formatting volume.")
>>         return pipe.returncode
>>
>> For some reason, this does not give any output! But the volume gets
>> created, but I cannot decrypt it with the password.
> 
> Probably because if you use pipe, cryptsetup will switch to batch
> mode where there is no question and no output.
> 
> It is better to add batch mode (-q switch) explicitly and remove from
> "YES\n" from your script (otherwise it becomes password ;-).
> 
> There is also simple Python pycryptsetup wrapper (it doesn't cover all
> commands though).
> 
> Milan
> _______________________________________________
> dm-crypt mailing list
> dm-crypt@xxxxxxxx
> http://www.saout.de/mailman/listinfo/dm-crypt
> 
_______________________________________________
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