#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2005
    Posts
    67
    Rep Power
    38

    Combining MD5 hashes


    I'm sure this is not possible, but I thought I would ask in case I am wrong.

    Let's say I have two pieces of data - A & B. I then get the MD5 hash over both pieces of data and end up with two hashes: Ah & Bh.

    Now, let's say that I simply append B to A so I have single piece of data C and get the MD5 hash of C: Ch.

    Is there a way to combine Ah & Bh to get Ch.

    The issue I have is that to obtain the very large pieces of data is difficult and might even be separated in time, but I would like to have a hash value computed over the entire set of data without keeping the data collected in the past around.

    I would also be curious about whether this would work for the SHA-1 hash.

    As I said, I am pretty sure this is not possible, but I always like to leave open the possibility that I am wrong.

    Thank you.
  2. #2
  3. No Profile Picture
    Lost in code
    Devshed Supreme Being (6500+ posts)

    Join Date
    Dec 2004
    Posts
    8,317
    Rep Power
    7170
    It is not possible with either MD5 or SHA. There might be a checksum algorithm that has this property, but I don't know of any off the top of my head.
    PHP FAQ

    Originally Posted by Spad
    Ah USB, the only rectangular connector where you have to make 3 attempts before you get it the right way around

IMN logo majestic logo threadwatch logo seochat tools logo