4 ms·
If length extension attacks are a problem, you're using a hash function for something which a hash function is not intended to be used for; you probably wanted
by cperciva 9y ago
If length extension attacks are a problem, you're using a hash function for something which a hash function is not intended to be used for; you probably wanted a MAC instead.
- deleted 9y ago[deleted]
- 15155 9y agoWhy must MAC mean "HMAC RFC2104?"
- cperciva 9y agoIt doesn't. I said MAC, not HMAC.
- baby 9y ago1. Yes. And people do that. I'm nkt talking about me. I'm talking about things I see in my work (I'm a consultant). 2. People should be able to do that. If you're expecting your hash function to behave somehow like a random oracle there is no reason that h(key|data) doesn't work. I see people using sha-2 to derive keys all the time. Even this is unsafe depending on how you do it.