Here is my situation. I'm working with an application for which uses hashing to authenticate data.
I have a string, which is hashed. It is, like in a hash length extension attack, H(key:known_value)
This hash is incremented by a nonce upon repeated attempts. On the first attempt there is no nonce, further attempts are H(key:known_value:nonce)
I believe I misunderstood a hash length extension attack (and was up for 9 hours last night learning that) in that by knowing the hash value, and the length of that entire hashed string, that I could add a nonce and get the same hash?
Not sure if I'm making sense, so let me demonstrate with example values:
hash("IamSecret:YouKnowMe") = 389fiu3vb93h39v (yes, not a real hash) hash("IamSecret:YouKnowMe:1") = f5d725d78223hjd2d2 (also made up)
I thought that a hash length extension would allow me to take the first hash, "389fiu3vb93h39v" and knowledge of the length of the secret (9) and the known data (":YouKnowMe") and append my data (":1") and come up with "f5d725d78223hjd2d2"?
But after 9 hours of messing with it, it seems thats NOT possible? What a hash length extension attack would allow me to do is to take my known values above, and come up with a string (something like :YouKnowMe\x80\x00\x00.......\x00:1) and figure out what the hash would be **IF I DID **hash("IamSecret:YouKnowMe\x80\x00\x00.......\x00:1")?
Is my understanding correct?
And if so, is there ANY way to do what my original issue was? I know the hash algorithm used, I know the hashed value of secret:known, I know 'known', I know the length of secret. Can I ADD DATA to 'known' and get the same hash that the client app would get if it just hashed secret:known:added_data?
I'm running on 4 hours sleep, sorry if my question is confusing :)