ArticleslgStudy

mathematics

Security of cryptographic hash functions

Security of cryptographic hash functions is a mathematics topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Security of cryptographic hash functions rather than just read about it. In short: In cryptography, cryptographic hash functions can be divided into two main categories. In the first category are those functions whose designs are based on mathematical problems, and whose security thus follows from rigorous mathematical proofs, complexity theory and formal reduction.

Key takeaways

  • Security of cryptographic hash functions belongs to mathematics; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Security of cryptographic hash functions to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Security of cryptographic hash functions from memory before moving on to harder problems.

Reference excerpt

In cryptography, cryptographic hash functions can be divided into two main categories. In the first category are those functions whose designs are based on mathematical problems, and whose security thus follows from rigorous mathematical proofs, complexity theory and formal reduction. These functions are called provably secure cryptographic hash functions. To construct these is very difficult, and few examples have been introduced. Their practical use is limited. In the second category are functions which are not based on mathematical problems, but on an ad-hoc constructions, in which the bits of the message are mixed to produce the hash. These are then believed to be hard to break, but no formal proof is given. Almost all hash functions in widespread use reside in this category. Some of these functions are already broken, and are no longer in use. See Hash function security summary.

Types of security of hash functions Generally, the basic security of cryptographic hash functions can be seen from different angles: pre-image resistance, second pre-image resistance, collision resistance, and pseudo-randomness.

Pre-image resistance: given a hash h, it should be hard to find any message m such that h = hash(m). This concept is related to that of the one-way function. Functions that lack this property are vulnerable to pre-image attacks. Second pre-image resistance: given an input m1, it should be hard to find another input m2 ≠ m1 such that hash(m1) = hash(m2). This property is sometimes referred to as weak collision resistance. Functions that lack this property are vulnerable to second pre-image attacks. Collision resistance: it should be hard to find two different messages m1 and m2 such that hash(m1) = hash(m2). Such a pair is called a (cryptographic) hash collision. This property is sometimes referred to as strong collision resistance. It requires a hash value at least twice as long as what is required for pre-image resistance; otherwise, collisions may be found by a birthday attack. Pseudo-randomness: it should be hard to distinguish a pseudo-random number generator based on the hash function from true random number generator; for example, it passes usual randomness tests.

The meaning of hard The basic question is the meaning of hard. There are two approaches to answer this question. First is the intuitive/practical approach: "hard means that it is almost certainly beyond the reach of any adversary who must be prevented from breaking the system for as long as the security of the system is deemed important." The second approach is theoretical and is based on the computational complexity theory: if problem A is hard, then there exists a formal security reduction from a problem which is widely considered unsolvable in polynomial time, such as integer factorization or the discrete logarithm problem. However, non-existence of a polynomial time algorithm does not automatically ensure that the system is secure. The difficulty of a problem also depends on its size. For example, RSA public-key cryptography (which relies on the difficulty of integer factorization) is considered secure only with keys that are at least 2048 bits long, whereas keys for the ElGamal cryptosystem (which relies on the difficulty of the discrete logarithm problem) are commonly in the range of 256–512 bits.

Password case If the set of inputs to the hash is relatively small or is ordered by likelihood in some way, then a brute force search may be practical, regardless of theoretical security. The likelihood of recovering the preimage depends on the input set size and the speed or cost of computing the hash function. A common example is the use of hashes to store password validation data. Rather than store the plaintext of user passwords, an access control system typically stores a hash of the password. When a person requests access, the password they submit is hashed and compared with the stored value. If the stored validation data is stolen, then the thief will only have the hash values, not the passwords. However, most users choose passwords in predictable ways, and passwords are often short enough so that all possible combinations can be tested if fast hashes are used. Special hashes called key derivation functions have been created to slow searches. See Password cracking.

Cryptographic hash functions

Most hash functions are built on an ad-hoc basis, where the bits of the message are nicely mixed to produce the hash. Various bitwise operations (e.g. rotations), modular additions, and compression functions are used in iterative mode to ensure high complexity and pseudo-randomness of the output. In this way, the security is very hard to prove and the proof is usually not done. Only a few years ago, one of the most popular hash functions, SHA-1, was shown to be less secure than its length suggested: collisions could be found in only 251 tests, rather than the brute-force number of 280. In other words, most of the hash functions in use nowadays are not provably collision-resistant. These hashes are not based on purely mathematical functions. This approach results generally in more effective hashing functions, but with the risk that a weakness of such a function will be eventually used to find collisions. One famous case is MD5.

… excerpt ends here. Continue reading the full article.

Worked examples

Example 1 — a first encounter with Security of cryptographic hash functions

Start with the simplest possible case. Write down what Security of cryptographic hash functions claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In mathematics, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Security of cryptographic hash functions before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Security of cryptographic hash functions ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Security of cryptographic hash functions

In research
Security of cryptographic hash functions appears in mathematics research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Security of cryptographic hash functions in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Security of cryptographic hash functions is common in secondary-school and first-year university syllabi. It links to neighbouring topics Cryptographic hash functions, so understanding it makes those chapters shorter.
In everyday life
Look for Security of cryptographic hash functions outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Security of cryptographic hash functions” →

How to study Security of cryptographic hash functions in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Security of cryptographic hash functions means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Security of cryptographic hash functions out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Security of cryptographic hash functions in simple terms?

In cryptography, cryptographic hash functions can be divided into two main categories. In the first category are those functions whose designs are based on mathematical problems, and whose security thus follows from rigorous mathematical proofs, complexity theory and formal reduction.

Why does Security of cryptographic hash functions matter?

Because it connects several mathematics ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Security of cryptographic hash functions?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Security of cryptographic hash functions.

Tags

  • Cryptographic hash functions

Keep exploring