Cryptography Stack Exchange is a question and answer site for software developers, mathematicians and others interested in cryptography. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Unkeyed hash functions are, by definition, hash functions computed without a key. SHA-1 is an example. MDCs (message digest codes) are a subclass of unkeyed hash functions. How are unkeyed hash functions secure, when the message is encrypted with a known, open hash function and without a key?

share|improve this question

migrated from Nov 14 '12 at 12:53

This question came from our site for information security professionals.

Welcome to cryptography Stack Exchange. Your question was migrated here, because it is mainly about the theoretical parts of cryptography, not the application thereof (which would be on topic on Security Stack Exchange). Please register your account on both sites (using the same mail address) to take ownership of your question again, be able to edit, comment and accept an answer. – Paŭlo Ebermann Nov 14 '12 at 19:09
Hash functions are not encryption. – Stephen Touset Nov 14 '12 at 23:12

Your question is ill-posed; to determine whether they provide "security", we need a specification of what you mean by security.

So I'll answer about just one potential use of hash functions:

Are you thinking about using hashing together with encryption to try to protect the integrity of the message against tampering? If so, generally speaking, unkeyed hash functions do not provide security against tampering with the message. You should not use them for message authentication or integrity protection.

(Some people used to recommend appending an unkeyed hash of the message to the end of the message, and then encrypting, in hopes that this would prevent tampering with the message. They called the hash function a "MDC". We now understand that this construction is not secure. Therefore, you should not use this approach.)

Instead, you should use either authenticated encryption or use a message authentication code (MAC). Both constructs are keyed functions.

If this is not what you were asking -- or even if it was -- you need to revise your question to clarify what you mean by "security". Security against what threats?

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.