From: "Jörn Engel" <joern@wohnheim.fh-wedel.de>
To: "Guillaume Lacôte" <Guillaume@lacote.name>
Cc: linux-kernel@vger.kernel.org, Linux@glacote.com
Subject: Re: Using compression before encryption in device-mapper
Date: Thu, 22 Apr 2004 14:15:49 +0200 [thread overview]
Message-ID: <20040422121549.GD3691@wohnheim.fh-wedel.de> (raw)
In-Reply-To: <200404221220.08987.Guillaume@Lacote.name>
On Thu, 22 April 2004 12:20:08 +0200, Guillaume Lacôte wrote:
>
> > After:
> > And of course it has to be at the beginning of a compression block, so
> > the offset is known in advance.
> OK, but this is not the case anymore if you insert random bytes first (?).
> Where does the encrypted non-random data start ? This depends on the huffman
> encoding, which you know nothing about.
True. But since the data is random, chances are it is impossible to
compress, so guessing the compressed data should be feasible. The
guess could be off by a few bits, but again, this makes the attack
harder by just a small factor.
Yeah, in the end, all small factors can multiply so something quite
sufficient.
> a) the attacker stills knows nothing about the rest of the tree (ie what the
> encoding of all other bits are). Basically to construct T2 you take T1, let
> "0" be the coding of "0", and prefix the code of all other bytes with a "1".
Too complicated. Figure out, where to find a block of encrypted
zeros, then look it up in a dictionary. If that is successful, you
have the key, full stop.
The attacker could even look for the most common block (or the 100
most common blocks), do a dictionary attack on those and afterwards
guess if the plaintext is all zeros, all ones or something similar.
> b) the attacker does not know (?) where the real data starts in the enciphered
> stream, since Huffman is variable-length.
What if the known plaintext is all zeros and compressed known
plaintext is longer than two encryption blocks? There will be one
block containing only compressed zeros.
> c) it is sufficient to ensure that not (p >> n). This is easily satistifed if
> the expectation of n is in the order of one block size, since at most p <
> block_size.
Block_size is confusing. Encryption block? Compression block?
Either way, even with p << n, you end up with, at most, 512 different
encodings for a zero. Again, 2, 4 or 8 are much more realistic.
> Could you detail what you mean with statistical encoding ? Thank you in
> advance, Guillaume.
Sorry, I meant arithmetical encoding. Statistical is the superset for
huffman (discrete) and arithmetic (continuous).
http://dogma.net/markn/articles/arith/part1.htm
Jörn
PS: To shorten this endless story, all you're trying to accomplish to
avoid dictionary attack on known plaintext. Those attack are
meaningless, as long as the encryption key is strong enough. So
use a true random key end be done with it.
And if you care about usability as well, store the key along with the
encrypted data, but encrypt the key with the digest of a simple
password. That is prone to dictionary attacks, but since it only
encrypts true random data (the real key), you're safe again.
--
Geld macht nicht glücklich.
Glück macht nicht satt.
next prev parent reply other threads:[~2004-04-22 12:15 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
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 [this message]
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=20040422121549.GD3691@wohnheim.fh-wedel.de \
--to=joern@wohnheim.fh-wedel.de \
--cc=Guillaume@lacote.name \
--cc=Linux@glacote.com \
--cc=linux-kernel@vger.kernel.org \
/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®