From: Matt Mackall <mpm@selenic.com>
To: Theodore Tso <tytso@mit.edu>,
Andrew Morton <akpm@linux-foundation.org>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 4/6] random: make backtracking attacks harder
Date: Sun, 9 Dec 2007 11:05:20 -0600 [thread overview]
Message-ID: <20071209170520.GY19691@waste.org> (raw)
In-Reply-To: <20071209133300.GB17037@thunk.org>
On Sun, Dec 09, 2007 at 08:33:00AM -0500, Theodore Tso wrote:
> On Sat, Dec 08, 2007 at 11:43:37PM -0600, Matt Mackall wrote:
> > > If you are trying to find the value of the 80 bits that were
> > > extracted, and you know the current state of the pool, yes, you can
> > > take the 96 bits that were changed after the last extraction, and try
> > > all possible 2**96 combinations of the bits; but you probably won't
> > > rule anything out, since after you iterate over all of the 2**96
> > > combinations, you'll probably be able to generate all of the 2**80
> > > possible output bits. So you won't gain anything by trying to do a
> > > backtracking attack. So I don't think there's anything to worry about
> > > here.
> >
> > Two observations:
> >
> > - 2**96 << 2**160 so our feedback is much weaker than our hash so we
> > should improve it on general principle
>
> Well, no. You're comparing apples and oranges here. You can iterate
> over 2**96 choices, but given that even if you are doing an iterative
> guessing attack, you have 2**80 knowns, and 2**96 unknowns, it doesn't
> buy you anything. So saying that there is a successful attack with
> O(2**96) simply isn't true!
Again, I agree that there's not any sort of useful attack here.
> > - there's a way to improve this attack to 2**64 in some situations!
>
> Yeah, but again, what does this "attack" buy you? If you know the
> output, and the current state of the pool, after doing 2**64
> iterations you can get the state of the pool before the output.
> Big-di-whoopdie-do. You can't actually *do* anything with it.
Ahh, but this an attack on the output! You know only:
pool' (including a fortuitously placed add_ptr)
and from that, you can get all but 64 bits of pool. By 2**64 iterations of:
pool = pool' + guess
hash = SHA1(init, pool) # simplified
pool^ = add(pool, hash)
if pool^ = pool':
success!
Now you've recovered pool. Then you can recover the *output* with:
hash = SHA1(init, pool)
pool' = add(pool, hash)
entropy = extract(pool)
output = SHA1(hash, entropy)
Depending on where the add_ptr lands, we might even be able to go back
another iteration.
By the way, I think the paper missed out on some corner case attacks
which extend the range to greater than half of the possible add_ptr
positions. Whenever less than 96 bits are changed in the first block,
we can discover the pool in O(2**64).
> It's fixing a non-problem, but I don't think changing actually hurts
> anything. My preferred way of dealing with this problem is simply to
> increase the output pool size, since that increases the number of bits
> that change each time from 96 bits to 160 bits.
Let's do that. But let's also do this because it makes the code more
readable and somewhat stronger (for instance the first word fed back
will be cascaded from the whole pool rather than the first 512 bits).
We also only need to grab the lock once.
--
Mathematics is the supreme nostalgia of our time.
next prev parent reply other threads:[~2007-12-09 17:05 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <2.753618428@selenic.com>
[not found] ` <3.753618428@selenic.com>
2007-12-09 0:01 ` [PATCH 2/6] random: use xor for mixing Theodore Tso
2007-12-09 0:40 ` Matt Mackall
2007-12-09 2:08 ` Theodore Tso
2007-12-09 13:33 ` Alan Cox
2007-12-19 21:09 ` Bill Davidsen
[not found] ` <4.753618428@selenic.com>
2007-12-09 0:35 ` [PATCH 3/6] random: do extraction before mixing Theodore Tso
2007-12-09 7:12 ` Matt Mackall
[not found] ` <5.753618428@selenic.com>
2007-12-09 1:45 ` [PATCH 4/6] random: make backtracking attacks harder Theodore Tso
2007-12-09 5:43 ` Matt Mackall
2007-12-09 13:33 ` Theodore Tso
2007-12-09 17:05 ` Matt Mackall [this message]
2007-12-10 13:37 ` Theodore Tso
[not found] ` <6.753618428@selenic.com>
2007-12-09 1:48 ` [PATCH 5/6] random: step more rapidly through the pool when adding and extracting Theodore Tso
2007-12-09 4:00 ` Andrew Morton
2007-12-09 4:22 ` Matt Mackall
2007-12-09 12:55 ` Theodore Tso
2007-12-09 17:08 ` Matt Mackall
[not found] ` <7.753618428@selenic.com>
2007-12-09 1:51 ` [PATCH 6/6] random: improve variable naming, clear extract buffer Theodore Tso
2007-12-09 5:08 ` Matt Mackall
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=20071209170520.GY19691@waste.org \
--to=mpm@selenic.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tytso@mit.edu \
/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;
as well as URLs for NNTP newsgroup(s).