than 512 bits, say, 320 bits. Here the birthday colli-
sion attack has complexity 2
160
, whereas a collision
of a compression function (except for the final appli-
cation in a hashing) requires about 2
256
operations.
For the other members of the SHA-family we do not
recommend this measure.
As for the second item and applications which em-
ploy members of the SHA-family in the proposed
construction. Here we’d recommend to append to the
original message the values of two checksums, whose
outputs each has the size of one message block. These
two checksums must be different in such a way as to
avoid that by fixing certain bits in the message blocks
one also fixes certain bits in the checksums.
4.2 Performance
There is a slowdown when a hash function uses a
compression function in our new mode of operation
as opposed to the Merkle-Damg
˚
ard mode. If the com-
pression function takes an (n + m)-bit input and pro-
duces an n-bit output, then in the traditional mode
of operation, m bits of message are processed per it-
eration of the compression function, whereas in our
new mode of operation m − n bits are processed.
This slows down the whole operation by a factor
m/(m − n). In SHA-1, n = 160 and m = 512,
so the slowdown when using the compression func-
tion of SHA-1 in our new construction is by a factor
of about 1.5. In SHA-256, n = 256 and m = 512,
and so here the slowdown is by a factor of about 2.0
which is also the case for SHA-512.
4.3 Resistance to Short-cut Attacks
It is clear that the above proposed construction when
applied to members of the SHA-family gives the at-
tacker less freedom, since there are fewer bits that he
can choose. Currently, the best collision attack on
SHA-1 is the one discovered by Wang et al. (Wang
et al., 2005). This attack produces colliding messages
each formed by two blocks, with a near-collision af-
ter the first block. Such an approach does not apply to
our construction used with SHA-1, because of the use
of the constant iv
1
in the first argument of h.
The attacks of Wang rely heavily on message mod-
ifications (Wang and Yu, 2005; Wang et al., 2005),
which do not leave much freedom for the attacker to
choose message bits. In our construction, 160 bits of
the message block in SHA-1 are reserved for the bits
of the chaining variable, which makes life harder for
the attacker. But clearly this is not a strong argument
for our construction. The security arguments for an it-
erated hash function relies on the collision resistance
of the compression function. If a collision is found
for the latter, then there are no longer good arguments
to rely on the security of the hash function. However,
seen in the light of the recent developments in hash
function cryptanalysis, including the SHA-1 attacks,
there are good reasons to limit the freedom of the at-
tacker in future designs. This is a central idea in our
construction.
5 CONCLUSION
We have discussed some generic attacks on the
Merkle-Damg
˚
ard construction and possible counter-
measures to these. It turns out that some of these at-
tacks, notably the multi-collision and the herding at-
tacks, seem to be more difficult to protect against than
one might expect.
A new method for iterated hash function construc-
tion has been proposed. Given an n-bit compression
function resistant to collisions where n bits of the two
inputs to the compression function are identical, our
construction ensures a completely collision resistant
hash function. In its bare form our construction does
not give added protection against the multi-collision
nor the herding attacks, but suggestions were given
for possible ways of efficiently thwarting these attacks
as well.
ACKNOWLEDGEMENTS
The authors would like to thank Praveen Gauravaram
for helpful discussions.
REFERENCES
Biham, E., Chen, R., Joux, A., Carribault, P., Lemuet, C.,
and Jalby, W. (2005). Collisions of SHA-0 and Re-
duced SHA-1. In (Cramer, 2005), pages 36–57.
Brassard, G., editor (1990). Advances in Cryptology -
CRYPTO ’89, 9th Annual International Cryptology
Conference, Santa Barbara, California, USA, August
20-24, 1989, Proceedings, volume 435 of Lecture
Notes in Computer Science. Springer.
Cramer, R., editor (2005). Advances in Cryptology - EU-
ROCRYPT 2005, 24th Annual International Confer-
ence on the Theory and Applications of Cryptographic
Techniques, Aarhus, Denmark, May 22-26, 2005, Pro-
ceedings, volume 3494 of Lecture Notes in Computer
Science. Springer.
Damg
˚
ard, I. (1989). A Design Principle for Hash Functions.
In (Brassard, 1990), pages 416–427.
Ferguson, N. and Schneier, B. (2003). Practical Cryptog-
raphy. Wiley Publishing.
SECRYPT 2006 - INTERNATIONAL CONFERENCE ON SECURITY AND CRYPTOGRAPHY
252