mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Guillaume Lacôte" <Guillaume@Lacote.name>
To: Timothy Miller <miller@techsource.com>
Cc: linux-kernel@vger.kernel.org, Linux@glacote.com
Subject: Re: Using compression before encryption in device-mapper
Date: Wed, 14 Apr 2004 08:48:00 +0200	[thread overview]
Message-ID: <200404140848.00477.Guillaume@Lacote.name> (raw)
In-Reply-To: <407C1BEC.30801@techsource.com>

Thank you for your prompt answers.
Le Mardi 13 Avril 2004 18:57, Timothy Miller a écrit :
[snip]
> I have a suggestion.  If you're compressing only for the sake of
> obfuscation, then don't really try to save any space.  Use a fast
> compression algorithm which doesn't necessarily do a great job.
I prefer speaking in terms of "entropy-per-bit" and "redundancy" rather than 
"obfuscation", although you got the idea.
Actually I plan to use a basic dynamic huffman : the rationale for this is 
that there is no meta-data (and any meta-data would help an attacker), since 
the weighted tree is updated along (de)compression. And from J. S. Vitter's 
article (Design and analysis of Dynamic Huffman Codes) we know that in the 
worst-case scenario the Huffman encoding will use one additional bit per 
byte. Thus allocating 9 native blocks for every 8 "compressed" blocks will 
do, although it is a bit more complicated than the 2-to-1 scheme I had 
suggested.

>
> When you're going to write, compress the block.  If it gets smaller,
> fine.  Store it in the same space it would have required even if it were
> uncompressed.  If the block gets bigger, then store it uncompressed.
> Whether or not the block could be compressed would be stored in metadata
> (in the inode, I guess).
Actually I do _not_ want to do that. The reason for that is that I want to add 
yet another layer before compression, which would interleave real data with 
random bytes. These random bytes are not drawn uniformly but rather drawn as 
to make the distribution on huffman trees (and thus on the encodings) 
uniform. This ensures that in order to decode my real data, an attacker has 
to decode the random data first; but since all _compressed_ random sequences 
are made equi-probable, there is (hopefully) no better way for him to do this 
than brute force. This is the idea I have (successfully ?) implemented in 
http://jsam.sourceforge.net .

Thus I still want to "compress" my data even if its size grows.

The problem I encounter however is that if forcibly allocating more space than 
required (e.g. 9 plain blocks every 8 compressed blocks) I will need padding. 
However padding is generally unwise cryptographically speaking ...



  reply	other threads:[~2004-04-14  6:48 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-04-13 15:44 Guillaume Lacôte
2004-04-13 16:57 ` Timothy Miller
2004-04-14  6:48   ` Guillaume Lacôte [this message]
2004-04-13 17:45 ` Jörn Engel
2004-04-13 19:42   ` Ville Herva
2004-04-14  6:54   ` Guillaume Lacôte
2004-04-14  9:43     ` Jörn Engel
2004-04-14 10:02       ` Guillaume Lacôte
2004-04-14 11:25         ` Jörn Engel
2004-04-14 12:44         ` Paulo Marques
2004-04-14 13:34           ` Jörn Engel
2004-04-14 13:58           ` maccorin
2004-04-14 14:02           ` Guillaume Lacôte
2004-04-14 14:39             ` Grzegorz Kulewski
2004-04-14 15:07               ` Guillaume Lacôte
2004-04-14 16:14                 ` Grzegorz Kulewski
2004-04-14 15:23             ` Paulo Marques
2004-04-14 15:32               ` Guillaume Lacôte
2004-04-14 17:25           ` Bill Davidsen
2004-04-15  9:28 ` Jörn Engel
2004-04-22  7:59   ` Guillaume Lacôte
2004-04-22  9:18     ` Jörn Engel
2004-04-22 10:20       ` Guillaume Lacôte
2004-04-22 12:15         ` Jörn Engel
2004-04-22 13:06           ` Guillaume Lacôte
2004-04-22 16:00             ` Jörn Engel
2004-04-23 15:16               ` Guillaume Lacôte
2004-04-23 16:57                 ` Jörn Engel
     [not found] <1KykU-4VD-17@gated-at.bofh.it>
     [not found] ` <1KPvh-26S-7@gated-at.bofh.it>
     [not found]   ` <1KSMw-4P1-13@gated-at.bofh.it>
     [not found]     ` <1KTfJ-5gK-25@gated-at.bofh.it>
2004-04-14 15:02       ` Pascal Schmidt
2004-04-14 15:25         ` Guillaume Lacôte
2004-04-14 19:29           ` Pascal Schmidt

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=200404140848.00477.Guillaume@Lacote.name \
    --to=guillaume@lacote.name \
    --cc=Linux@glacote.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=miller@techsource.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®