2 ms·
So why not sha1(sha1(secret) + sha1(message))? Or is that essentially an MAC?
by Mindless2112 13y ago
So why not sha1(sha1(secret) + sha1(message))? Or is that essentially an MAC?
- StavrosK 13y agoOne rule of thumb I've discovered: Whenever you say "why not X?", where "X" is some nonstandard construction, the answer is "because X is horribly broken in ways you can't even imagine".
- tptacek 13y agoFor one thing, you're incurring one more SHA1 invocation than you need; for another, you're clumsily duplicating HMAC, which has other security features (albeit not hugely practical ones). But the core feature of HMAC is indeed hashing the secret separately from the message.