0

Does a cracker need to know the number of iterations a hashing algorithm uses to compute a hash?

If they don't know it, how do they figure it out? How much longer does it take to figure it out, than if they didn't know?

I can only guess that they try a number of the most common passwords, and try it with different iterations, and see what amount of iterations returns the most correct passwords. Would this even work though?

TruthOf42
  • 762

2 Answers2

4

The usual attack models assume that the attacker knows the exact algorithm used and the only unknown is (in the case of hashing-to-hide-plaintexts) the plaintext. In short, the enemy already knows the system.

Sometimes this gives the attacker too much credit, but that's better then underestimating them. Since password hashes are typically retrieved by breaking into a production server, it's likely that the application source code (which includes a full specification of the hashing procedure used) was grabbed at the same time. In other cases, the source code is open to begin with.

Robert Harvey
  • 199,517
  • Even if the source code wasn't grabbed, the algorithm and iterations used to create a password hash will often be saved together with it in the database - this makes it easy to change hashing strategy without immediately recalculating all hashes. – Jacob Raihle Jul 12 '19 at 07:16
-4

Unless you implement hashing algorithm on server side, and use some non-standard algorithm, Everything about hashing algorithm is known to hacker. if implemented on client side, it can be reverse engineered, even if you use non-standard algorithm, or obfuscate a standard algorithm.

  • 5
    A non-standard algorithm implemented on the server does not hinder an attacker. That belief is security through obscurity and the reasons it's bad are too numerous to list in a single answer let alone comment. –  Feb 07 '14 at 21:39
  • 2
    One of the most fundamental concepts behind security is to use algorithms that are just as effective even if they are known to the attacker. – user16764 Feb 07 '14 at 22:24