# How long would it take to crack a double hash if salt and final hash are public?

I have a hash of a file $$H_1$$ and then I add salt and rehash it: $$H_2$$. I make my $$H_2$$ and salt public and I use my $$H_1$$ as a password. How long would it take for this to be cracked with someone trying to figure out all the combinations of the 128 characters and adding the salt to get $$H_2$$?

So they are trying to figure out $$H_1$$ and adding salt to confirm that it matches $$H_2$$. As $$Hash(H_1 \| salt) = H_2$$, how long would it take to crack the 128 characters to find the $$H_1$$ that corresponds with this combination?

Please assume SHA3-512 as hash function.

• still not clear. 512 bit size of $H_1$ used as a password and 128 characters search? – kelalaka Oct 13 '18 at 21:30
• @kelalaka I know my askers from stackoverflow, the user means hexadecimals. – Maarten Bodewes Oct 13 '18 at 21:35

A SHA3-512 hash outputs 512 bits. If you use that as input to the second application of the hash then it takes $$2^{511}$$ tries - on average - to brute force it. This is obviously far out of range of a practical attack.