2
$\begingroup$

For comparing these 3 hash functions SHA3-512, SHA512, and Whirlpool. Which one is strongest against collision and preimage attacks. Are they fundamentally the same because of the same size output? Please disregard all other characteristics of the algorithms.

$\endgroup$
  • 1
    $\begingroup$ "Are they fundamentally the same because of the same size output? Please disregard all other characteristics of the algorithms" ... so yes? $\endgroup$ – Richie Frame Mar 11 at 20:09
  • 1
    $\begingroup$ @kelalaka Thanks! I just didn't realize it's that simple. $\endgroup$ – 7r4c0r Mar 11 at 20:28
  • 1
    $\begingroup$ @kelalaka Actually not homework, I'm working on a project that will store a huge number of hash results, and I need a key value for the database, one that will be least prone for collision. Your answer tells me I should simply append the 3 and make that the key. $\endgroup$ – 7r4c0r Mar 11 at 20:32
  • 1
    $\begingroup$ Actually, you can assume that none of these algorithms will ever collide. Yes, it's possible; it's so improbable that it can practically be ignored... $\endgroup$ – poncho Mar 11 at 20:51
  • 2
    $\begingroup$ if for some reason you are looking for even higher than the collision resistance of the above hashes, plain Keccak with a 1024-bit rate has 288-bit collision resistance at reduced performance $\endgroup$ – Richie Frame Mar 11 at 23:52
2
$\begingroup$
  • Generic expected pre-image resistance for a hash function with $n$-bit output is $\mathcal{O}(2^n)$

  • Generic expected collision resistance for a hash function with $n$-bit output is $\mathcal{O}(\sqrt{2^n}) = \mathcal{O}(2^{n/2})$ due to the generic birthday attack on the hash functions.

\begin{array}{|c|c|c|c|}\hline \text{name} & \text{output size} & \text{pre-image resistance} & \text{collision resistance} \\ \hline \operatorname{SHA-512} & 512 & \mathcal{O}(2^{512})& \mathcal{O}(2^{256}) \\ \hline \operatorname{SHA3-512} & 512 & \mathcal{O}(2^{512}) & \mathcal{O}(2^{256}) \\ \hline \operatorname{Whirlpool}& 512 &\mathcal{O}(2^{512}) & \mathcal{O}(2^{256}) \\ \hline \end{array}

Therefore they have the same as long as there is no attack better than these on any of these.

Note 1 There is not pre-image collision. There is pre-image attack or pre-image resistance.

Note 2 SHA-512 is vulnerable to length extension attack. Prefer the SHA3-512 or Blake2 series.

| 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.