I am new to hash functions and blockciphers and try to do some exercises to get a better understanding.

Considering the following block cipher if K is predefined value IV and the last ciphertext is the hash. I don’t really see how this hash function would be not secure but from what I heard block ciphers are only good hash functions if they use some sort of feed forward/backward with xor.

$C_1 = E_K(P_1)$
$C_i = E_{C_{i-1}}(P_i)$ for $i > 1$

Why is this hash function – which is based on a block cipher – insecure?


1 Answer 1


If you want a hint as to why your proposed hash function isn't secure (even against preimage attacks), I would note that block ciphers are invertible, that is, given $C_{i-1}$ and $C_i$, we can efficiently compute the value $P_i$ must be so that $C_i = E_{C_{i-1}}(P_i)$ holds. Question for you to complete the answer: how can an attacker exploit this to create preimages?


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.