Compare the three permitted HMAC variants
04RFC 6238 permits HMAC-SHA-256 and HMAC-SHA-512 in addition to the HOTP HMAC-SHA-1 building block. The hash and secret must match the setup used by both endpoints.
With the same counter and width and this mode’s64-byte key, the official result is90693936.
Source for this drawing: RFC 6238 · Read RFC source: Appendix B ↗
New to this? Start hereA quick picture + helpful background
A message needs an address.
Think of a packet as a small addressed envelope. Devices pass it onward; transport protocols decide what delivery promises an application gets.
Helpful first, if these ideas are unfamiliar
These pictures are analogies to help you learn. The linked RFC explains the actual rules.
Terms in this drawing
- Hash variant
- Which permitted SHA-based HMAC function the setup uses.
- Test vector
- A published input and expected output for checking an implementation.
Related RFCs and changes
“Updates” changes part of an earlier RFC. “Obsoletes” replaces it. This list shows selected related documents.
Implementations MAY use HMAC-SHA-256 or HMAC-SHA-512 instead of HMAC-SHA-1. These choices are not an on-the-wire negotiation defined by this RFC.
- Implementations MAY use HMAC-SHA-256 or HMAC-SHA-512 instead of HMAC-SHA-1. These choices are not an on-the-wire negotiation defined by this RFC.
- At time 59, T0=0, X=30 and eight digits, Appendix B expects SHA-1:94287082, SHA-256:46119246, SHA-512:90693936.
- Verified erratum 2866 corrects Appendix B: these test modes use different ASCII keys, of lengths20,32 and64 bytes respectively. Reusing the 20-byte fixture for all modes does not reproduce the table.
- The 32-byte fixture is the repeating ASCII 1234567890 sequence cut after32 characters; the 64-byte fixture is the same repeating sequence cut after64. These are exact public fixtures, not a suggested key-generation method.
- For interoperability, keys SHOULD have the length of the HMAC output (§5.1). Real keys SHOULD be randomly generated or derived using key-derivation algorithms; a different hash name alone does not protect a leaked key.
The drawings compare three local computations with counter 1; arrows show data flow, not a handshake between algorithms. Appendix A already uses the correct different key lengths. Verified erratum 4678 corrects JavaDoc, not the algorithm. Other merely reported errata are not adopted as requirements. The regression checks all 18 Appendix B values, including Unix time 20000000000.
Read the RFC section ↗