HMAC will, hell or high water (assuming you're not doing HMAC-CRC32 or whatever :-)) give you a MAC. (It'll do slightly better; unlike, say, GMAC -- but that's a boring detail for now.)
You can shoot yourself in the foot with HMAC but it won't be because of HMAC; for example: if your messages don't contain a nonce or timestamp they might be replayable or something. But that's not an HMAC flaw.
So to answer your question: maybe? You can get in plenty of trouble with HMAC, but it won't be HMAC's fault.
Also if you don't use an unambiguous encoding if you're signing multiple aggregated fields. Either by using field separators that can't occur in the data, or by using a format that prefixes fields with their lengths.
Right. You can use JSON or something to get out of this quick.
Re:Cryptographic Right Answers
by andrewflnr on Wednesday April 04, 2018 @03:12PM
(#16757915)
Well, sure, but it's not AES's fault when you reuse nonces, either. :)
I recently ran into some HMAC-based crypto that I thought was pretty sketchy based on the "no custom crypto" principle, but I'm wondering if my concerns were overblown. I haven't found any obvious holes in it, but I'm not an expert so I don't know if that means much.