What do most attacks on hash functions involve?

A. Finding Collisions
B. Pre-generating millions of hashes and comparing them to the plain text that generates it.
C. Really good random guessing.

A. Finding Collisions

The correct answer is A. Finding Collisions.

Most attacks on hash functions involve finding collisions. A collision occurs when two different input messages produce the same hash value. In other words, if there are two different messages, M1 and M2, which have the same hash value h(M1) = h(M2), then a collision has been found.

One common approach to finding collisions is through the use of mathematical algorithms and techniques. These attacks take advantage of weaknesses in the design or implementation of the hash function. They can involve various methods such as:

1. Brute force: In this method, the attacker systematically tries many different inputs until they find two that produce the same hash value. This can be a time-consuming process, especially for complex hash functions.

2. Birthday attacks: These attacks make use of the birthday paradox, which states that in a group of just 23 people, there is a 50% chance that at least two people share the same birthday. Similarly, in a hash function with a large output space, attackers can exploit this probability to find collisions efficiently.

3. Mathematical weaknesses: Some hash functions may have underlying mathematical weaknesses that can be exploited to find collisions more easily. These weaknesses could include vulnerabilities in the function's mathematical operations or the way they handle certain input values.

In contrast, option B, pre-generating millions of hashes and comparing them to the plain text, is not a common attack on hash functions. While it is technically possible, it is highly impractical and inefficient, especially for secure hash functions.

Option C, really good random guessing, is also not a common attack on hash functions. Hash functions are designed to produce outputs that appear random, making it extremely difficult to guess the original input from the hash value alone. Random guessing is neither a reliable nor practical approach to attack most hash functions.