3 ms·
why not hash a message then encrypt the hash with a symmetric cypher Provided that you're using a cipher with a block size equal to the hash length, this can w
by cperciva 17y ago
why not hash a message then encrypt the hash with a symmetric cypher
Provided that you're using a cipher with a block size equal to the hash length, this can work. This approach is usually avoided for two reasons:
1. It requires two building blocks (hash + cipher) instead of just one (hash).
2. Under the "standard model" of cryptography, you can prove things about HMAC(k, m) which you can't prove about Encrypt_k(Hash(m)) -- for practical purposes these are utterly irrelevant, but cryptographers are academics and like to have cute theoretical results.
- tptacek 17y agoAnd of course you must avoid using this construction yourself because it involves you designing your own cryptographic construction. You are actually more likely to have your system broken by making a new construction out of well-known pieces like AES and SHA1 than you would be if you made your own crypto primitives out of whole cloth. And you'd never think of designing your own block cipher. Hey, I like that argument! I think I'll repeat it ad nauseum from now on.