Re: New hash function: avalanche

From: lurker (na@nospam.org)
Date: 02/20/03


From: na@nospam.org (lurker)
Date: Thu, 20 Feb 2003 00:07:23 GMT

On 19 Feb 2003 14:34:21 -0800, NOSPAMperlmodules@lunkwill.org (Jason)
wrote:

>This post inspired me; we really haven't been taking advantage of the
>avalanche effect as much as we could be:
>
>"flip" <flip_alpha@safebunch.com> wrote in message news:<1045246491.764833@news-1.nethere.net>...
>[...]
>> As I recall, a good hash function will change at least half of it's output
>> bits (the hash value) for a single bit change in the input.
>[...]
>
>Thusly, I have constructed a new hash function which is guaranteed to
>change *all* output bits for every bit of change in the input. I call
>it "Avalanche". To insure collision-resistance and irreversibility,
>it's based on a combination of MD5 and SHA1. As soon as I can
>complete the proof of security, expect a patent and major publication.
> Code follows:
>
> -J
>
>/* ************* Avalanche.c ************************* */
>/* (c) 2003 Jason Holt */
>/* Total avalanche effect hash function - changes every*/
>/* output bit for any bit change on input. */
>/* */
>/* Free for academic use, but do not use commercially! */
>/* Contact author for licensing terms. */
>/* *****************************************************/
>
>// Copy output data immediately; not thread safe
>char *Avalanche(char *input, int inlen) {
>
> static char out[16];
>
> // Randomizing s-box:
> char aybabtu[16] =
> {65,76,76,32,89,79,85,82,32,66,65,83,69,33,33,33};
>
> char *md5 = MD5(input);
> char *sha1 = SHA1(input);
>
> int i, j, k;
>
> for(i=0; i < 16; i++) {
> out[i] = md5[i] ^ sha1[i]; // mix md5 output with SHA1
> out[i] = out[i] ^ md5[i] ^ sha1[i]; // second round
> out[i] = out[i] ^ aybabtu[i]; // involve randomizing string
>
> for(j=0; j<inlen; j++) {
> for(k=0; k<8; k++) {
> if(input[j] & (1 << k)) out[i] = ~out[i]; // ensure mixing
> // with all input bits
> }
> }
> }
>
> return out;
>}

In general we don't see much use of logical branching on random values
or addition functions in cryptography. They are slow operations and
are often overlooked and undervalued.



Relevant Pages

  • New hash function: avalanche
    ... > As I recall, a good hash function will change at least half of it's output ... I have constructed a new hash function which is guaranteed to ... it's based on a combination of MD5 and SHA1. ... /* Total avalanche effect hash function - changes every*/ ...
    (sci.crypt)
  • Re: Please Cure My Ignorance (I know that may be difficult :-)) on Hash Functions
    ... > I had one additioanl question: ... > As I recall, a good hash function will change at least half of it's output ... A good hash function should have an output that is uncorrelated ... This is probably from some "information theory" unicity ...
    (sci.crypt)
  • Re: New hash function: avalanche
    ... > avalanche effect as much as we could be: ... a good hash function will change at least half of it's output ... You are joking right? ... put in question protecting any European or Asian rights. ...
    (sci.crypt)