1
$\begingroup$

I'm not sure how to word this... I'm working with a HMAC (I think of it being a "salted hash"). I know the entire string being hashed, I do NOT know the salt. I also know the first 8 characters of the resulting hash. I can also, repeatedly, generate new hashes by changing the input string, and retrieve new first-8 characters.

Does that in any way make it even remotely possible to find the salt? Even via brute forcing, would that decrease the entropy at all, if I were able to modify the hashing algo (much like how bitcoin is mined by pre-computing most of the hash and only updating the nonce at the end, removing many many steps from the hashing itself)?

From all I've learned, I'm leaning towards a "no", that its no help whatsoever. That being said, I've never worked with a HMAC/salted hash before, so I'm not sure if that works any differently. Is finding the salt any easier because of how a HMAC is computed?

$\endgroup$
  • 2
    $\begingroup$ The question is not well defined. What exactly do you mean by salted HMAC? Do you mean HMAC with a random key that is not known? If so, you have no chance of finding it given the data (assuming a key of reasonable length). $\endgroup$ – Yehuda Lindell Jul 21 '15 at 18:22
2
$\begingroup$

Assuming you mean a normal HMAC with a strong unknown key, no amount of MAC values for known, or even chosen messages would help you find the key. That would mean a failure of HMAC's forgery resistance, which is expected of MAC algorithms.

(It would be a very bad case of forgery attack, since it would allow forging MACs for any messages. Even much lesser attacks, like being able to forge a single valid MAC for another message, would be considered significant breaks.)

| improve this answer | |
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.