Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

As Colin mentioned if your cipher block size is the same as the hash output size there are no obvious attacks.

In practice your options to accomplish this are limited since any cryptographic hash under serious consideration (ie: not MD5) will produce an output longer than the block size of common symmetric ciphers (64 or 128 bits).

That means you have to choose a mode of operation to chain two or more blocks together and since you are constructing a MAC you are presumably going to use an unauthenticated one (or else it's turtles all the way down, right?).

What are some popular options to choose from?

ECB: You've reduced the collision resistance of your hash function to the block size of the cipher since you can now attack the output blocks independently.

CTR: Intercept message without delivering it. Extract keystream directly if the plaintext is known. Forge any arbitrary MAC. Game over.

CBC: Make sure not to leak any information about the difference between padding failure and MAC failure or else you have a padding oracle which can do many magical things, including possibly forge an arbitrary MAC.

Building a secure MAC construction in the way you've described is harder than it looks, mainly because symmetric ciphers themselves are unsafe to use without authentication.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: