Can I define a hash algorithm based on the original key and output hash?

If I have both a start key and a hash that was created, is there a way to determine which hash algorithm was used?

For example:

  • Key : taller
  • Hash : df072c8afcf2385b8d34aab3362020d0
  • Algorithm :?
+7
security algorithm hash
source share
5 answers

Well, given that there are many popular hashing algorithms, it is possible that what you offer is not so ridiculous.

But suppose I asked about this:

If I have input and output, do I define a function?

Generally speaking, no, you cannot determine the internal operation of any function, simply knowing one input and one output , without additional information.

// very, very basic illustration if (unknownFunction(2) == 4) { // what does unknownFunction do? // return x + 2? // or return x * 2? // or return Math.Pow(x, 2)? // or return Math.Pow(x, 3) - 4? // etc. } 
+3
source share

By considering length, you can decide which algorithms to try. MD5 and MD2 produce 16-byte digests. SHA-1 produces 20 bytes of output. Etc. Then execute each hash at the input and see if it matches the output. If so, then your algorithm.

Of course, if more than the β€œkey” was hashed, you need to know that too. And depending on the application, hashes are often applied iteratively. That is, the hash output is hashed again, and this output is hashed & hellip; often thousands of times. Therefore, if you know in advance how many iterations have been completed, this can also help.

There is nothing but the length of the output of the cryptographic hash that will help narrow down the algorithm that created it.

+13
source share
  • The hash seems to contain only hexadecimal characters (each character represents 4 bits)

  • The total counter is 32 characters β†’ it is a 128-bit hash.

  • The standard hashing algorithms that meet these specifications are: haval, md2, md4, md5, and ripemd128.

  • The highest probability that MD5 was used.

  • md5 ("highest")! = df072c8afcf2385b8d34aab3362020d0

  • The highest probability that some salt has been used.

  • The highest probability is still MD5.

+3
source share

Does not match any of the usual hashing algorithms:

http://www.fileformat.info/tool/hash.htm?text=higher

Perhaps salt was added before hashing ...

+2
source share

Do not try any bunch that you know, and see if it matches.

0
source share

All Articles