All of lore.kernel.org
 help / color / mirror / Atom feed
From: Milan Broz <gmazyland@gmail.com>
To: "Julio Cesar Faracco - jfaracco@br.ibm.com" <jfaracco@br.ibm.com>,
	"dm-crypt@saout.de" <dm-crypt@saout.de>
Subject: Re: [dm-crypt] How to compress LUKS2 header?
Date: Fri, 27 Dec 2019 22:19:33 +0100	[thread overview]
Message-ID: <c0b58502-6698-89dd-a7ae-025bf80ee9c3@gmail.com> (raw)
In-Reply-To: <65f0e9b350cd4e9bb418c8d87e4333fe@br.ibm.com>

On 27/12/2019 21:46, Julio Cesar Faracco - jfaracco@br.ibm.com wrote:
> Thanks for your suggestions, guys...
> 
> Do you have any recommendation to reduce this header size then?
> Imagine 1000 lab machines.. They are taking 20 GB to backup each header.

Hi,

just few notes:

- used keyslots areas (both in LUKSv1 and LUKSv2) cannot be compressed,
it contains encrypted keyslot data.

- unused keyslot binary areas are filled by a random data on format (or wipe), so
these areas cannot be compressed either. (For LUKSv2 it is the whole binary area.)

That said...

We can probably add some option to wipe unused keyslot areas with zeroes
on backup.

For the header size - for LUKSv2 you can easily decrease header size,
if you do not need more slot area or you do not plan to use reencryption.

Please read this post
https://marc.info/?l=dm-crypt&m=157146906003981&w=2

Milan



> 
> Revert to LUKS v1 type is not a possibility.
> 
> I appreciate your help...
> 
> --
> Julio  Cesar Faracco
> 
>      
> From: dm-crypt <dm-crypt-bounces@saout.de> on behalf of Michael Kjörling <michael@kjorling.se>
> Sent: Friday, December 27, 2019 1:20:11 PM
> To: dm-crypt@saout.de
> Subject: [EXTERNAL] Re: [dm-crypt] How to compress LUKS2 header?
>      
> On 27 Dec 2019 10:56 -0500, from gebser@mousecar.com (ken):
>> Compressing a file is one step in the encryption of that file.  So if
>> your LUKS2 header file is encrypted, it's also already compressed.
>> Using ZIP on it would yield no further compression.
> 
> No, encryption does not imply compression. Rather, trying to compress
> ciphertext is a largely pointless exercise if the encryption is any
> good in the first place; therefore, _if_ you're going to compress the
> data you're encrypting (keeping in mind that doing so is not always a
> good idea; see compression oracle attacks), then you need to compress
> first, then encrypt, not the other way around.
> 
> I'm pretty sure the LUKS header backup isn't compressed.
> 

  reply	other threads:[~2019-12-27 21:19 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-23 14:41 [dm-crypt] How to compress LUKS2 header? Julio Faracco
2019-12-27 15:56 ` ken
2019-12-27 16:20   ` Michael Kjörling
2019-12-27 16:27     ` Arno Wagner
2019-12-27 20:46     ` Julio Cesar Faracco - jfaracco@br.ibm.com
2019-12-27 21:19       ` Milan Broz [this message]
2019-12-28  0:20       ` Arno Wagner
2019-12-26 20:12 Julio Cesar Faracco - jfaracco@br.ibm.com

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c0b58502-6698-89dd-a7ae-025bf80ee9c3@gmail.com \
    --to=gmazyland@gmail.com \
    --cc=dm-crypt@saout.de \
    --cc=jfaracco@br.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.