Re: cryptographic ergodic sequence generators?

2003-10-15 Thread John S. Denker
Perry E. Metzger wrote:

I've noted to others on this before that for an application like
the IP fragmentation id, it might be even better if no repeats
occurred in any block of 2^31 (n being 32) but the sequence did not
repeat itself (or at least could be harmlessly reseeded at very very
long intervals).
I assume the point of the reseeding is to make
the ID-values more unpredictable.
On 09/07/2003 11:18 AM, David Wagner wrote:

 Let E_k(.) be a secure block cipher on 31 bits with key k.
 Pick an unending sequence of keys k0, k1, k2, ... for E.

 Then your desired sequence can be constructed by
   E_k0(0), E_k0(1), E_k0(2), ..., E_k0(2^31 - 1),
   2^31 + E_k1(0), 2^31 + E_k1(1), ..., 2^31 + E_k1(2^31 - 1),
   E_k2(0), E_k2(1), E_k2(2), ..., E_k2(2^31 - 1),
   2^31 + E_k3(0), 2^31 + E_k3(1), ..., 2^31 + E_k3(2^31 - 1),
Again if we assume the point is to make the values
unpredictable (not just ergodic), then there is
room for improvement.
To see what I mean, divide the values into generations
G=0,1,2,3... where each row in the tableau above is
one generation.
The problem is that at the end of each generation,
the values become highly predictable, à la Blackjack.
David's proposal can be improved by the method used
by Blackjack dealers:  shuffle early.  In each
generation, let the argument of E_kG(.) max out at
some fraction (f) of 2^(n-1).  A limit of f=1/2 is
the obvious choice, although other f values e.g. f=2/3
work nicely too.  The domain and range of E_kG(.) are
still unrestricted (n-1)-bit numbers.
This gives us the following properties
 -- Guaranteed no repeats within the last f*2^(n-1) IDs.
 -- Probably no repeats in an even longer time.
 -- Even if the opponent is a hard-working Blackjack
player, he has only one chance in (1-f)*2^(n-1)
of guessing the next value.  To put this number in
context, note that the opposition has one chance
in 2^(n-1) of guessing the next value without any
work at all, just by random guessing.
Setting f too near zero degrades the no-repeat guarantee.
Setting f too near unity leads to the Blackjack problem.
Setting f somewhere in the middle should be just fine.
=

Discussion of conceivable refinements:

A proposal that keeps coming up is to take the values
generated above and run them through an additional
encryption stage, with a key that is randomly chosen
at start-up time (then held fixed for all generations).
The domain and range of this post-processing stage
are n-bit numbers.
This makes the output seem more elegant, in that we
have unpredictability spread over the whole n-bit word,
rather than having n-1 hard-to-predict bits plus one
almost-constant bit.
Define the phase to be P := (G mod 2).

The opponent will have to collect roughly 2^n data
points before being able to figure out which values
belong to which phase, so initially his guess rate
will be closer to one in 2^n, which is a twofold
improvement ... temporarily.
This temporary improvement is not permanent, if we
allow the opponent to have on the order of 2^n
memory.  He will in the long run learn which values
belong to which phase.  I see no way to prevent this.
So as far as I can tell, the proposed post-processing
is more in the nature of a temporary annoyance to the
opposition, and should not be considered industrial-strength
cryptography.
Perhaps more to the point, if we are going to allow
the opposition to have 2^n memory, it would be only
fair to allow the good guys to have 2^n memory.  In
that case, all the schemes discussed above pale in
comparison to something I suggested previously, namely
generating an ID absolutely randomly, but using a
look-up table to check if it has been used recently,
in which case we veto it and generate another.  If
you can afford the look-up table, these randomly
generated IDs have the maximum possible unpredictability.
-
The Cryptography Mailing List
Unsubscribe by sending unsubscribe cryptography to [EMAIL PROTECTED]


Re: cryptographic ergodic sequence generators?

2003-09-07 Thread David Wagner
Perry E. Metzger wrote:
I've noted to others on this before that for an application like
the IP fragmentation id, it might be even better if no repeats
occurred in any block of 2^31 (n being 32) but the sequence did not
repeat itself (or at least could be harmlessly reseeded at very very
long intervals).

Let E_k(.) be a secure block cipher on 31 bits with key k.
(For instance, E might be 16 rounds of Luby-Rackoff using
f(x) = AES_{AES_{k}(i)}(x) as the Feistel function in the ith round.)
Pick an unending sequence of keys k0, k1, k2, ... for E.

Then your desired sequence can be constructed by
  E_k0(0), E_k0(1), E_k0(2), ..., E_k0(2^31 - 1),
  2^31 + E_k1(0), 2^31 + E_k1(1), 2^31 + E_k1(2), ..., 2^31 + E_k1(2^31 - 1),
  E_k2(0), E_k2(1), E_k2(2), ..., E_k2(2^31 - 1),
  2^31 + E_k3(0), 2^31 + E_k3(1), 2^31 + E_k3(2), ..., 2^31 + E_k3(2^31 - 1),
  ...,

-
The Cryptography Mailing List
Unsubscribe by sending unsubscribe cryptography to [EMAIL PROTECTED]


cryptographic ergodic sequence generators?

2003-09-06 Thread Perry E. Metzger

For making things like IP fragmentation ids and other similar protocol
elements unpredictable, it would be useful to have what I'll call a
cryptographic ergodic sequence generator -- that is, a generator that
will produce a sequence of n bit numbers such that there are no
repeats until you pass the 2^nth number in the sequence (that is, the
sequence is a permutation of all 2^n bit numbers) and such that it is
very difficult to predict what the next number in the sequence might
be beyond the fact that it will not be one of the numbers seen earlier
in the sequence. It is also rather important that the generator be
computationally inexpensive.

Anyone know how to produce such a thing?

Perry

-
The Cryptography Mailing List
Unsubscribe by sending unsubscribe cryptography to [EMAIL PROTECTED]


lopsided Feistel (was: cryptographic ergodic sequence generators)

2003-09-06 Thread John S. Denker
On 09/06/2003 02:33 PM, Tim Dierks wrote:
 I'm sure that it would be possible to design a Feistel-based block
 cipher with variable block size, supporting some range of even values
 of n.
There's no need to exclude odd n.

I know the typical superficial textbook describes
the Feistel trick in terms of splitting each block
exactly in half, but if you understand the trick
you see that it works just fine for other splits.
It doesn't need to be anywhere near half.  It
doesn't even need to be a two-way split.
You could process a 21-bit word as:
 -- three groups of seven, or
 -- seven groups of three, or
 -- one group of twelve and one group of nine, or
 -- whatever.
-
The Cryptography Mailing List
Unsubscribe by sending unsubscribe cryptography to [EMAIL PROTECTED]