Re: Maybe a stupid question regarding input output fed hash algorithms

From: Tom St Denis (tomstdenis_at_yahoo.com)
Date: 08/21/03


Date: 21 Aug 2003 12:16:08 -0700


<jonas.t@bredband.net> wrote in message news:<wwZ0b.67885$zL.288@news1.bredband.com>...
> If i feed MD5 with another MD5 output e.g 128 bit.

First off, why would you do that?

> Is it possible to backtrack the original 128 bit string, is the output from
> MD5 carrying such features that will make it possible to reverse a
> stream/chain of MD5 fed loop.

You only make the design weaker though. MD5 is obviously not an
invertable function so applying it twice only *lowers* the entropy of
the output. If you wanted to strengthen the design you would add more
rounds to it [or just use a SHA hash].

> Of course i realise that such a chain of linear input output doesn't make
> sense to use in a stream cipher.
> However if i start out with three MD5 buffers and let the outputs inputs
> rotate between the buffes and only use one of the output buffers for use as
> a linear streamcipher, do MD5 carry such features that it is possible to
> reverse it *if you know* that it is fed by a MD5 string.

This all sounds interestingly stupid. The most common way to make a
stream cipher from a hash is an CTR mode e.g.

C[i] = P[i] xor H(IV || key || i)

Of course such a construction is typically fairly slow.

> I also wonder if this kind of rotating input output buffers could be used to
> create streams from other hash algorithms.

Probably but until you formalize your idea nobody will care. If you
build it, they will come!

Fields of dreams [over Z....stupid math nerds on campus! damn you!]

> Maybe it is alltogether a very bad idea overall but if so i would like to
> know why, i'm a bit clueless since it seems like a good idea to me.

That's part and parcel of the problem. I couldn't tell you outright
what is exactly wrong with it other than it's overly complicated and
hasn't been studied much before [in your context, CTR mode has been
around forever].

Tom



Relevant Pages

  • Re: Maybe a stupid question regarding input output fed hash algorithms
    ... To create a pseudo random stream from a plain password and MD5 that could ...
    (sci.crypt)
  • Re: getting MD5 in blocks
    ... of the file data and do whatever you wish before you hash it ... ... > I want to be able to compute the MD5 of a large file but without using the stream method. ...
    (microsoft.public.dotnet.security)
  • Re: MD5 Algorithm
    ... I have down loaded the Forth code for MD5 but I don't ... decrypt asymetric encryptions coming from the server or, ... 2- Client generates a random stream B ...
    (comp.lang.forth)
  • Re: An hash-Encryption algorithm
    ... Not to mention stream repeating... ... > have to process longer and longer strings. ... > The right way to do this is to use MD5 as a pseudo-random function ... > and use either counter mode, output feedback mode or ciphertext ...
    (sci.crypt)
  • Re: Secure 128-bit hash?
    ... will produce a stream with the same MD5 hash as a given stream. ... ways of finding two different hashes which both produce the same hash. ...
    (sci.crypt)