# NIST expression for HMAC security strength

In NIST SP800-107, NIST claims that the security strength of HMAC is MIN(security of HMAC key, $$2L$$). $$L$$ is the length of the output of the underlying hash function. Let's take HMAC-SHA256 as an example. If the key used is larger than 512-bits, it is truncated to $$L$$ bits, which is 256-bits. However, if the key is smaller or equal 512-bits, the key is not truncated. Now, let's assume that key length is 384-bits. According to NIST, the strength of HMAC-SHA256 with this key is min(384, 2*256) = 384. However, since the output HMAC size is 256-bits, an adversary can guess an HMAC-SHA256 for an arbitrary message with success probability $$2^{-256}$$. In this case, how is the strength able to be defined as 384-bits? How can it be larger than the output size of the HMAC?

• I agree that (at least that part of the document - I haven't read the whole thing) is terribly worded. Explanations of MAC security level tend to be confusing. There's a generic attack on HMAC that's related to the chaining value (internal state size) and the tag length. For HMAC-SHA256, that technically brings the naive security level down to 128 bits because the chaining value and output length are 256 bits. However, as pointed out by Daniel, NIST ignores that completely because it isn't practical, but neither is the pre-image attack. Jul 15, 2022 at 18:23
• I would also like to point out that NIST says 2C, not 2L. The chaining value (internal state size) is C. SHA384 has a chaining value of 512 bits, not 384, demonstrating how C doesn't necessarily equal L. Jul 15, 2022 at 18:31
• Please look here: csrc.nist.rip/library/… IST says: "The security strength of the HMAC algorithm4 is the minimum of the security strength of K and the value of 2L (i.e., security strength = min(security strength of K, 2L)). " at section 5.3.4 Jul 16, 2022 at 4:44
• This document is newer. That's what I was referring to. Jul 16, 2022 at 7:37

Instead we look to section 5.3.5 where a limit, $$2^t$$, is set on the number of failed tags required to trigger a resetting event so that the probability of accepting a false tag before resetting is triggered is given by $$2^{t-\lambda}$$. Systems are invited to determine what an acceptable value of this probability is in order to defend against rare event attacks. No specific advice is given, though values $$\lambda=40, 64, 92$$ and $$t=20, 30, 35$$ are given as examples. For other rare event attacks, I've seen $$2^{-40}$$ and $$2^{-64}$$ quoted as acceptable levels of risk.
the success of a collision attack [...] would require the collection of at least $$2^{80}$$ pairs of chosen plaintexts and their corresponding HMAC values. This is an impractical task. So, the collision attack is not considered in this document.