Is HMAC-SHA256 quantum safe? What the published guidance says
If your systems use HMAC-SHA256 to check that messages have not been altered, the published guidance is reassuring on the hash side. The UK National Cyber Security Centre's Next steps in preparing for post-quantum cryptography (dated 14 August 2024, first published November 2023) states that "the security of hash functions such as SHA-256 is also not significantly affected" by quantum computers, and that secure hash functions can continue to be used. RFC 2104, HMAC: Keyed-Hashing for Message Authentication (February 1997), states that the security of HMAC depends on its underlying hash function. Taken together, these sources point the question at SHA-256 and at how the key is handled, not at a separate post-quantum replacement for HMAC itself. The sources listed here do not give a dedicated quantum assessment of HMAC as a construction, so treat this as the position they support rather than a standalone certification.
The same NCSC page makes a parallel point about symmetric keys: existing symmetric algorithms with at least 128-bit keys can continue to be used. NIST's post-quantum cryptography FAQ, in an entry added 11/18/18 on a page last updated December 4, 2026, says that current applications can continue to use AES with key sizes of 128, 192, or 256 bits, and that Grover's algorithm offers a smaller practical advantage than its theoretical quadratic speedup. The French ANSSI document ANSSI views on the Post-Quantum Cryptography transition (dated January 4, 2022) notes that Grover's algorithm can speed up collision finding against hash functions and suggests 384-bit hash outputs for SHA-2 and SHA-3. Read that suggestion as an ANSSI recommendation, not as a requirement set by the other bodies cited here.
Engineers and security leads who rely on HMAC for integrity should confirm three things in their own environment. First, the hash inside the HMAC is an approved SHA-2 or SHA-3 function, as FIPS 198-1 (published July 2008) allows for any approved iterative hash. Second, keys meet the length and rotation guidance in RFC 2104, which says keys should be chosen randomly and refreshed periodically, and that keys shorter than the hash output length are discouraged. Third, the truncated tag length is not less than half the hash output and at least 80 bits. Auditors should also note that NIST plans to withdraw FIPS 198-1 and move its content into NIST SP 800-224, with feedback requested by July 23, 2025, so the reference document cited in a control may change.
What each body has published on HMAC and SHA-256 against quantum attack
This table lists each source covering HMAC or SHA-256, what it says about quantum attack and any date it sets. Read it row by row to see which positions are about the HMAC construction, which address the hash itself, and which set a schedule. None of the sources listed sets a retirement date for SHA-256.
| Source | What it says about HMAC or SHA-256 | Dates it sets |
|---|---|---|
| RFC 2104 (February 1997) | Defines HMAC as a message authentication code built on a hash function, with security depending on that hash. Gives key length and truncation guidance. Predates quantum concerns for this construction. | February 1997 publication. No retirement date. |
| FIPS 198-1 (July 2008) | Describes HMAC for use with any approved iterative hash function and a shared secret key. | Published July 2008. June 23, 2025 note says NIST plans to move its content into SP 800-224. |
| NIST PQC FAQ (last updated December 4, 2026) | States that current applications can continue to use AES. Says Grover's algorithm gives a smaller practical advantage than its theoretical speedup, and that NIST will issue transition guidance when needed. | Page last updated December 4, 2026. No retirement date for SHA-256. |
| NCSC Next steps (August 14, 2024) | Says the security of hash functions such as SHA-256 is not significantly affected by quantum computers, and that secure hash functions can continue to be used. | Page dated August 14, 2024. No retirement date for SHA-256. |
| ANSSI views (January 4, 2022) | Notes that Grover's algorithm can speed up collision finding attacks on hash functions and suggests 384-bit hash outputs for SHA-2 and SHA-3. | Page dated January 4, 2022. Gives no retirement date for SHA-256. |
| NIST SP 800-131A Rev. 3 IPD (October 21, 2024) | Covers a retirement timeline for SHA-1 and the 224-bit hash functions. Does not name SHA-256 for retirement. | Initial public draft dated October 21, 2024. No retirement date for SHA-256. |
| NIST Hash Functions (September 16, 2026) | Lists the SHA-2 family in FIPS 180-4, including SHA-256, and the SHA-3 family in FIPS 202. Confirm approved use against the current FIPS. | Page updated September 16, 2026. No retirement date for SHA-256. |
Why the guidance treats HMAC as a symmetric and hash-dependent construction
HMAC is a message authentication code built on a hash function and a shared secret key, and the published guidance groups it with symmetric algorithms and hashes rather than with the public-key algorithms that need replacing. RFC 2104 describes HMAC as keyed-hashing for message authentication, in which a shared secret lets two parties verify that data has not been altered, and it states that the security of HMAC depends on the underlying hash function. NIST FIPS 198-1 likewise describes HMAC as working with any approved iterative hash function and a shared secret key. Because HMAC has no public-key component, the NIST IR 8547 transition, which schedules quantum-vulnerable public-key signature and key-establishment algorithms for replacement, does not name HMAC or its hash functions in its abstract or keywords.
The UK NCSC makes the same separation. Its next-steps guidance says that, in contrast with public-key cryptography, the security of symmetric cryptography is not significantly impacted by quantum computers, and that the security of hash functions such as SHA-256 is also not significantly affected. Your practical question is therefore less about HMAC itself and more about the hash and key behind it. Confirm which hash your HMAC configuration names, and confirm the key length against the guidance on symmetric key sizes for your sector. The NCSC page supports symmetric algorithms with at least 128-bit keys, so a 256-bit key used with HMAC-SHA256 sits within that range.
ANSSI's view adds a caution for hashes. Its document notes that Grover's algorithm, a generic quantum algorithm, can speed up certain collision-finding attacks on hash functions, and it suggests using 384-bit hash outputs for SHA-2 and SHA-3, for instance. Teams that want a larger margin for long-lived data should check whether their HMAC deployment can use a longer hash such as SHA-384, and should confirm the output truncation settings against RFC 2104, which recommends a truncated output of at least half the hash length and at least 80 bits.
Where HMAC-SHA256 is relied on and what the sources say about each
HMAC-SHA256 appears in many places where systems check that data was not altered and that it came from a holder of a shared key. The cards below cover the main uses, with the RFC 2104 guidance on key length and truncation that applies to each.
Message integrity in protocols
Network and application protocols use HMAC to confirm that a message was not altered in transit and came from a party holding the shared key. RFC 2104 says the security of HMAC depends on the underlying hash function, and that keys should be chosen randomly and refreshed periodically. The sources reviewed here do not single out this use for replacement. Check which hash function and key length your protocol version specifies.
RFC 2104API request signing
Many APIs sign each request with an HMAC over the request contents and a timestamp, so the server can reject altered or replayed requests. Keys shorter than the hash output length are discouraged, so check the length of the secrets your clients hold. The sources do not single out request signing for replacement. Confirm your key length and how you rotate keys.
RFC 2104Cookie and token integrity
Web frameworks often compute an HMAC over session cookies or signed tokens so the server can detect tampering without storing state. Where the tag is truncated, RFC 2104 recommends the truncated output be at least half the hash length and at least 80 bits. The sources do not single out cookie or token integrity for replacement. Check the tag length your framework uses and where the signing key is stored.
RFC 2104Stored-data authentication
Some systems attach an HMAC to records or files at rest so later reads can confirm the data was not modified. Here the key must stay available for verification for as long as the data is kept, which affects key lifetime planning. The sources do not single out stored-data authentication for replacement. Confirm how long keys and tags must remain verifiable and where the keys are held.
Key derivation and truncated tags
HMAC is also used as a building block for deriving keys and for producing short tags. RFC 2104 gives the truncation limits: the truncated output should be at least half the hash output length and at least 80 bits. Tags or derived keys shorter than these limits fall outside that guidance. The sources do not single out these uses for replacement. Check each truncation length against RFC 2104 in your implementation.
RFC 2104What the sources say about data that must stay authentic for years
The sources on this page treat HMAC-SHA256 as a symmetric construction whose security depends on the underlying hash function and the shared key, not on public-key algorithms. The NCSC states that "the security of symmetric cryptography is not significantly impacted by quantum computers," and that "the security of hash functions such as SHA-256 is also not significantly affected," so secure hash functions can continue to be used. NIST's post-quantum FAQ makes a similar point, noting that Grover's algorithm offers a smaller practical advantage than its theoretical quadratic speedup because quantum hardware is costly and massively parallel attacks reduce its benefit. The NIST FAQ also says that "current applications can continue to use AES with key sizes 128, 192, or 256 bits," and that NIST will issue transition guidance when needed. For HMAC, this means the AES key-length position and the hash position are the relevant guidance, since HMAC is built on a hash rather than a block cipher.
Several points are not settled by the sources and need to be confirmed. The sources do not give a date for replacing HMAC-SHA256, and none of the cited documents says that HMAC-SHA256 must be retired. NIST IR 8547, the transition document, covers moving from quantum-vulnerable public-key algorithms to post-quantum signature and key-establishment schemes, and its abstract does not mention hash functions or symmetric algorithms. The ANSSI document goes further on hashes, suggesting "using 384 bits hash outputs for SHA-2 and SHA-3 for instance" against collision-finding attacks, so the sources differ in how far they go. Compare the position of the guidance you follow with the protections your system depends on, and confirm the key length and hash choice in your own implementation against RFC 2104 and FIPS 198-1.
For data that must stay authentic for years, set your own retention period and review it against the guidance you adopt rather than against a date from these sources. Record which hash and key length each system uses, check that HMAC keys meet the length and refresh guidance in RFC 2104, and track the withdrawal of FIPS 198-1 into NIST SP 800-224 along with any transition guidance NIST publishes. If your data must remain authentic beyond the period you can plan for, ask your security or compliance lead which hash output length and key size they want to standardize on, and document that decision so it can be revisited when new guidance appears.
What the guidance says to use instead or alongside HMAC-SHA256
The UK NCSC's position is that the security of hash functions such as SHA-256 is not significantly affected by quantum computers, and that secure hash functions can continue to be used. This is the most direct reading for HMAC-SHA256, since the HMAC construction's security depends on the underlying hash function, as RFC 2104 explains. The NCSC page is dated 14 August 2024, first published November 2023, and it frames the point in terms of hash functions generally rather than HMAC specifically.
- Source and date: NCSC, "Next steps in preparing for post-quantum cryptography," dated 14 August 2024.
- Condition: The NCSC statement is about the hash function itself, so the reader should confirm that the HMAC implementation they run uses an approved hash and a key of suitable length.
- Key length: RFC 2104 says keys shorter than the hash output length are discouraged and that keys should be chosen randomly and refreshed periodically.
- Truncation: RFC 2104 recommends the truncated output be at least half the hash length and at least 80 bits.
- Symmetric context: The NCSC page says existing symmetric algorithms with at least 128-bit keys can continue to be used.
Check the NCSC page directly and confirm the key and truncation settings in your own HMAC configuration.
ANSSI's views on the post-quantum transition, on a page dated January 4, 2022, state that Grover's algorithm can speed up collision finding attacks on hash functions, and it suggests using 384-bit hash outputs for SHA-2 and SHA-3 as one response. This is a collision-resistance point rather than a statement that SHA-256 has failed. ANSSI does not state in the cited text that SHA-384 can be dropped into an existing HMAC-SHA256 deployment without changes.
- Source and date: ANSSI, "ANSSI views on the Post-Quantum Cryptography transition," page dated January 4, 2022.
- Condition: The suggestion is framed around collision finding attacks on hash functions, not a general replacement requirement.
- Named algorithms: ANSSI names SHA-2 and SHA-3 at 384 bits as examples.
- Output length: SHA-384 is listed among the SHA-2 family in FIPS 180-4 on the NIST Hash Functions page.
- Interoperability: The sources do not say SHA-384 is interchangeable with SHA-256 without testing, so peers, key sizes and truncation length must be confirmed.
Confirm with your protocol peers and your own test vectors before changing the HMAC hash, since output length affects tag size and compatibility.
NIST's Hash Functions project page, updated September 16, 2026, lists SHA-3 as specified in FIPS 202, based on KECCAK. The page includes SHA3-224, SHA3-256, SHA3-384 and SHA3-512, with SHAKE128 and SHAKE256 extendable-output functions of which only the fixed-length functions are currently approved as hash algorithms. SHA-3 is therefore a named option for the underlying hash, but the sources do not say it is a drop-in replacement for SHA-256 inside HMAC.
- Source and date: NIST, "Hash Functions" project page, updated September 16, 2026.
- Approved functions: The fixed-length SHA3 functions are the approved hash algorithms on that page; SHAKE128 and SHAKE256 are not listed as approved hashes.
- Standard: SHA-3 is specified in FIPS 202.
- HMAC form: FIPS 198-1 describes HMAC with any approved iterative hash function, and the NIST planning note indicates its content is moving to NIST SP 800-224.
- Interoperability: Confirm that both ends of the connection support SHA3 inside HMAC before any change.
Verify that your libraries expose HMAC-SHA3 and test against your peers before adopting it.
What to do about HMAC-SHA256 in your systems, in order
This sequence gives you an inventory of where HMAC-SHA256 is used, the guidance that applies to your sector, vendor answers in writing, a tested plan for any hash change, and a dated record of your position. The output is a position you can defend to auditors and customers, built on the published sources rather than on assumptions about quantum timelines.
Find every place HMAC-SHA256 is used
Search your application code, shared libraries, API gateways, webhook signing, token issuance, backup tooling and infrastructure configuration for HMAC calls and for the SHA-256 hash that backs them. Include the HMAC inside vendor products you run, such as SaaS integrations and appliances, because these often hide it behind a setting. Record the component, the key length in use, the truncated output length if any, and the owner. The step is done when every HMAC-SHA256 instance is listed in one inventory that someone can update and that you can show to an auditor.
Read the guidance for your sector and customers
Work through the published positions that apply to you, starting with the NIST post-quantum FAQ, the UK NCSC next-steps guidance and the ANSSI views on the transition, and check which of them your regulators or largest customers reference. Note the NIST FIPS 198-1 planning note about moving its content into NIST SP 800-224, and the draft retirement timeline in NIST SP 800-131A Revision 3, which does not name SHA-256. Write down which sources apply, their dates, and what each says about symmetric algorithms and hashes. The output is a short reference file that names each source and the date you read it.
Ask each vendor in writing
Send every vendor whose product contains an HMAC-SHA256 instance a written question asking which HMAC and hash versions they support, which key lengths and truncation they use, and what their published roadmap says about hash output sizes or SHA-3. Ask them to name the exact product version and edition, since support often differs between releases. Request the answer as a dated document. The step is complete when each vendor has responded in writing or you have recorded the non-response, and the answers are stored next to the inventory.
Test any change to longer output or SHA-3
If your reading of the sources or your customers' requirements points toward a longer hash output, such as the 384-bit SHA-2 output that ANSSI suggests for SHA-2 and SHA-3 in its guidance, or toward SHA-3, plan the change as a controlled project rather than a configuration edit. Test compatibility with every system that verifies these HMACs, including older clients, stored signatures and any protocol that fixes the output length. Confirm that the SHA-3 variant you pick is one NIST currently approves as a hash function, since the fixed-length SHA3 functions are approved and the extendable-output SHAKE functions are not. The output is a tested rollout plan with a rollback path.
Record your position and sources
Write a dated statement of your position on HMAC-SHA256 that names the sources you relied on, the inventory you built, the vendor answers you received and any change plan you adopted. State plainly which points the sources do not address and which you have chosen to monitor. Store the record with the version history so you can show how the position evolved. Review it when a cited source is updated or when a customer or regulator asks. The step is complete when the record is signed off by the owner and filed where audit and customer security reviews can retrieve it.
Claims readers meet about HMAC-SHA256 and what the sources actually say
Readers often arrive with a claim they have heard about HMAC and quantum computing, some accurate, some overstated. The cards below set each common claim against what the published sources say, so you can see which part of the reasoning holds and which does not.
Quantum computers break HMAC-SHA256
This claim treats HMAC-SHA256 as if it were a public-key scheme that a quantum computer can solve. It is not. HMAC uses a shared secret key and a hash function, and the UK NCSC states that "the security of hash functions such as SHA-256 is also not significantly affected" by quantum computers. Before you accept or repeat the claim, check which part of the construction it refers to: the hash function, the shared key, or the key exchange used to distribute that key, which is a separate matter.
NCSC next stepsA longer key fixes HMAC
RFC 2104 gives advice on key length: keys should be chosen randomly and refreshed periodically, and keys shorter than the hash output length are discouraged. That advice concerns classical security, not quantum attacks, so it does not establish that a longer key is the quantum fix. Quantum guidance for symmetric keys is framed around Grover's algorithm and the 128-bit security level, so ask what the source being cited actually addresses before treating key length as the answer.
RFC 2104Grover halves security, so replace HMAC
Grover's algorithm offers a quadratic speedup in theory, and this claim assumes that the full speedup applies and that the result demands replacing HMAC. NIST's post-quantum FAQ says Grover's "practical advantage" is smaller than the theoretical speedup, because quantum hardware is costly and massively parallel attacks reduce its benefit. NIST also states that it will issue transition guidance when needed. Check the cited source for whether it discusses practical or theoretical cost before you act on a replacement decision.
NIST PQC FAQA listing proves quantum safety
Some vendors and listings describe a product or configuration as quantum safe, and readers may take that as proof for HMAC-SHA256. The sources reviewed for this page do not establish that a listing or product validation proves quantum safety. Any validation applies to a named module, version and issuer, and it does not cover every use of HMAC in your environment. Ask the vendor which exact component and version was validated, and whether the validation names HMAC-SHA256.
NIST IR 8547 covers hash functions
Readers sometimes assume that NIST IR 8547, the transition document for post-quantum algorithms, also sets the plan for hashes and MACs. Its abstract describes moving from quantum-vulnerable algorithms to post-quantum digital signature algorithms and key-establishment schemes, and its abstract and keywords do not mention hash functions or symmetric algorithms. Do not cite it for HMAC-SHA256 planning. Check the NIST Hash Functions project page and the symmetric guidance for hash-related positions instead.
NIST IR 8547Questions people ask about HMAC-SHA256 and quantum attack
Do we have to replace HMAC-SHA256 now because of quantum computers?
No. The sources listed on this page do not set a date for replacing HMAC-SHA256, and they do not place it on the list of algorithms to retire. The UK NCSC states that the security of symmetric cryptography is not significantly impacted by quantum computers, and that secure hash functions such as SHA-256 can continue to be used. Your planning question is less about a deadline and more about whether your keys and output lengths meet the guidance in this section. Confirm the current position in NIST publications and your own compliance requirements before you change anything.
Does using a longer key make HMAC-SHA256 quantum safe?
A longer key is not the main lever here. RFC 2104 says keys up to the hash block length can be used directly, that longer keys are first hashed down, and that keys shorter than the hash output length are discouraged. Its guidance is to choose keys randomly and refresh them periodically. On the quantum side, NIST's FAQ says that current applications can continue to use AES with 128, 192 or 256-bit keys, and that Grover's algorithm offers a smaller practical advantage than its theoretical speedup. Treat key length as a matter of sound practice under RFC 2104, and confirm the exact key size with the NIST FAQ on AES key sizes and your own policy.
What should we switch to if HMAC-SHA256 ever needs replacing?
The sources on this page point to SHA-384 or SHA-3 as the options to consider. The ANSSI document suggests using 384-bit hash outputs for SHA-2 and SHA-3 when Grover's algorithm is a concern for collision finding. NIST's Hash Functions page lists SHA-384 within the SHA-2 family in FIPS 180-4, and it lists SHA3-384 within SHA-3 in FIPS 202. For HMAC specifically, RFC 6234 includes sample code for SHA-based HMAC across SHA-224, SHA-256, SHA-384 and SHA-512. Confirm which HMAC construction your libraries and protocols support before you plan a change, because the sources do not describe a migration path for HMAC itself.
Is our data at risk today if we keep using HMAC-SHA256?
The sources do not describe present-day exposure from HMAC-SHA256. The NCSC says the security of hash functions such as SHA-256 is not significantly affected by quantum computers, and that secure hash functions can continue to be used. NIST's FAQ says most quantum attacks on proposed post-quantum cryptosystems have involved variants of Grover's algorithm, and that the practical benefit of Grover's algorithm is smaller than its theoretical speedup. These statements describe the algorithm family, not a specific deployment. Assess your own exposure with a review of where HMAC keys are generated, stored and rotated, and confirm the reasoning against the cited sources.
What should we ask a vendor about HMAC-SHA256 and quantum readiness?
Ask which HMAC construction and hash function the product uses, including the output length it truncates to. RFC 2104 recommends a truncated output of at least half the hash length and at least 80 bits, so ask whether the product follows that. Ask how keys are generated, how long keys are handled, and how often they are rotated. Ask whether the vendor has published any post-quantum position for HMAC or for the hash functions it relies on, and request the date of that statement. Ask which version and edition the answer applies to. The sources on this page do not include a vendor position, so write down any vendor response and treat it as a claim to verify.
Does the NIST post-quantum guidance cover our certificates and HMAC usage?
Not for HMAC. NIST IR 8547 concerns moving from quantum-vulnerable algorithms to post-quantum digital signature algorithms and key-establishment schemes. Its abstract and keywords do not mention hash functions or symmetric algorithms, so it does not address HMAC-SHA256 as a message authentication code. Certificates depend on signatures and key establishment, which NIST IR 8547 does address, so certificate work is a separate track from HMAC. Plan your certificate migration against NIST IR 8547 and keep HMAC under the hash and symmetric guidance discussed here.
Which parts of an HMAC-SHA256 deployment depend on a hash and which on public-key algorithms
The diagram starts at the shared secret key and the message, which feed the HMAC construction built on SHA-256. The tag comes out of that hash-based step, so its quantum position follows the hash and symmetric guidance from NCSC and ANSSI. If the shared key is set up with a public-key exchange, that exchange is the part covered by NIST IR 8547 and needs its own review. Check each edge against the source named on it, and confirm which parts your deployment actually uses.
Which HMAC-SHA256 components rely on hashes and which on public-key key setup.
How DeployOpen works on this
DeployOpen approaches HMAC-SHA256 questions by first confirming which keyed MAC construction and hash your systems use, then mapping where those keys are generated, stored and rotated. We build from that inventory, document the configuration and hand over evidence that your security and compliance teams can review.
How we scope
- We inventory every system that generates or verifies HMAC tags, including the hash function, output length and truncation in use.
- We record key lengths, how keys are generated, and whether they are refreshed, against the guidance in RFC 2104 and FIPS 198-1.
- The written scope defines which applications, services and libraries are covered, and engagements are fixed-scope, agreed before work starts.
How we build
- We review and configure HMAC implementations and key handling in the platforms you run, within your own infrastructure.
- We test that tags verify correctly, that keys meet the length rules in RFC 2104, and that truncated outputs follow the recommended minimum.
- We flag any system still relying on SHA-1 for HMAC, since NIST's draft SP 800-131A Revision 3 covers its retirement timeline.
How we hand over
- You receive documentation of the HMAC configuration, hash choice, key lengths and rotation settings for each in-scope system.
- Test results and configuration evidence are delivered so your security and compliance teams can review them directly.
- DeployOpen prepares evidence for your assessments, but independent auditors and certification bodies issue any audit report or attestation.
How we support
- Ongoing support, upgrades and continuous testing are available as a retainer after the initial handover.
- We can retest HMAC configurations after library upgrades or changes to key management, so evidence stays current.
- Ask us to confirm, for your specific versions, how the sources in this guidance apply to your HMAC implementation before relying on it.
Sources and further reading
- NIST post-quantum cryptography FAQ ↗
- NCSC next steps in preparing for post-quantum cryptography ↗
- ANSSI views on the post-quantum cryptography transition ↗
- RFC 2104: HMAC keyed-hashing for message authentication ↗
- NIST FIPS 198-1: The keyed-hash message authentication code ↗
- NIST hash functions project page ↗

