rullzing
rullzing

Reputation: 652

md5 vs md4 recognition

Is there a way to actually find out whether a hash is MD5 or MD4?

For instance:

10c7ccc7a4f0aff03c915c485565b9da is an MD5 hash

be08c2de91787c51e7aee5dd16ca4f76 is an MD4 hash

I know that there is a difference "security wise" but how can someone determine which hash is which "programming wise" or just by the eyes. Or is there really no way to know for sure?

I was thinking about giving a hash and comparing it to the 2 of them. However, I noticed that they are all identical and there is no way to really check the difference ! The first "alpha-digit" is not necessarily a number in MD5, and it is not necessary a character in MD4. So how can someone determine which hash is being used?

Upvotes: 0

Views: 1122

Answers (1)

init_js
init_js

Reputation: 4631

Both MD5 and MD4 output 128-bit digests (16B, or 32B hex strings). The representation of digests (hashes) of both algorithms is undistinguishable from one another unless they are annotated with extra metadata (which would need to be provided by the application).

You wouldn't be able to tell without recomputing the hashes over the original file or original piece of data.

If you have the data, and are given two digests to differentiate, you'll have to recompute with one of the two algorithms, and hope the hash you derive is one of the test-two. In cases where the input data is corrupted, then you will not even re-obtain any of the two.

If you don't have access to the original data, and you had to take a guess today on the nature of just one (not two) 32-hexchar-long digest to go with that data, it would be most likely md5. MD4 was badly broken by 2008, and considered historic by 2011 (RFC 6150).

If you're given a single hash, and that hash is computed over a file, its hashing algorith is in practice indicated by the file extension of the checksum file (.md5sum, .md4sum, .sha1sum, etc.).

Upvotes: 1

Related Questions