# Can someone please explain the "secret" and the "data" in the MD5 hashing algorithm?

I've been studying the MD5 hashing algorithm, and there is something that I just don't understand yet. They say that the server holds some sort or "secret" and that it appends some sort of "message" (or "data") to that secret. Then, the algorithm adds the appropriate padding to the concatenated ("secret" + "data") and the process continues from there. Now, it is said that only the server knows the "secret", but an attacker would know the "data" as well as the signature (which is apparently the result that comes out of hashing ("secret + data")). Now, here is what I don't get:

Let's say we have a URL:

http://website.com/ABCDEFGHIJKLMNOP?parameter=something

Now, the ABCDEFGHIJKLMNOP part is the hashed part of this URL. Would it be correct to call that part the signature? If so, what exactly is the "data" that an attacker supposedly knows? Where in this URL is the "data" that was appended to the "secret"?

Also, why is "data" appended to the "secret" in the first place? Why isn't the "secret" just hashed by itself and kept hidden from an attacker instead of giving the attacker some apparently known "data"?

• One thing is sure: MD5 itself does not suppose that anything is secret, nor does it specifies a "server" entity. MD5 is a fully public function that transforms a message (any bitstring up to some extremely large size) into a 128-bit bitstring. That the message is secret, or not, has nothing to do with MD5 itself. A sure thing is that if the hash is to be secret, at least some of the message must be. The question is about MD5 in some context that is currently unclear. The mention of "signature" suggests something more complex than HMAC or password hashing. We can't tel!!
– fgrieu
Jul 20 at 15:59
• A link to a resource that makes this claim would be helpful. As fgrieu says, the claim isn't true about MD5 per se, but it could be correct in a larger context. As for a url, the significance of the parts is up to the creator - you can't tell in general if there are hashes involved at all. And in any case, "the hashed part of the url" doesn't mean much. Jul 20 at 16:33
• @bmm6o Here is a link that mentions what I mean about the "secret" and the "data" and all of that: blog.skullsecurity.org/2012/… Jul 20 at 17:25
• @Rikudou That article is about attacking a badly-designed message authentication code (MAC) algorithm based on MD5 (or some other extendable hash). The "secret" and "data" parts come from it being used as a MAC, not from MD5 itself. Jul 20 at 18:02
• In proper signature, there is a private key used to produce the signature, and a public key to verify the signature. Nothing such in the case at hand.
– fgrieu
Jul 21 at 6:25

As indicated, this is about creating a $$\operatorname{MAC}_k(m) = \operatorname{H}(k \| m)$$ where $$k$$ is the key / secret and $$m$$ is the message / data.