Civil Rights
Movements, leaders, victories and the continuing fight for equality.
Explore the people, places, events, achievements, struggles and stories that shaped our journey.
Movements, leaders, victories and the continuing fight for equality.
Innovation, patents, science, technology and world-changing contributions.
Pioneers, champions, Negro Leagues, records, activism and excellence.
Meet the people whose lives, choices and achievements shaped the journey.
Black towns, communities, institutions and places where history happened.
Moments that changed communities, movements, institutions and the nation.
Katherine Johnson’s mathematical calculations helped guide some of America’s most important early space missions while she confronted the racial and gender barriers faced by Black women in twentieth-century America.
MORE →Reflects the personal views, recollections, and perspective of the author, Mike Davis.
This is a personal recollection on the Move fire on May 13, 1985
This article has multiple issues. Please help improve it or discuss these issues on the talk page. (Learn how and when to remove these messages)
|
HMAC-based one-time password (HOTP) is a cryptographic algorithm based on a one-time password (OTP) and hash-based message authentication code (HMAC). At setup time, a client and server share a secret and other initialization settings. In future exchanges, when a client attempts to access a server, a challenge is sent from the server to the client and the client then uses the previously exchanged secret and computes a value (a one time password) to be used as the server's challenge response.
HOTP is the basis for the commonly used time-based one-time password (TOTP) algorithm which extends upon it. It often forms part of multi-factor authentication protocols such as the Open Authentication initiative (OATH).[1].
HOTP was published as an informational IETF RFC 4226 in December 2005, documenting the algorithm along with a Java implementation. Since then, the algorithm has been adopted by many companies worldwide (see below).
The HOTP algorithm provides a method of authentication by symmetric generation of human-readable passwords, or values, each used for only one authentication attempt. The one-time property follows directly from the single use of each counter value.
Parties intending to use HOTP must establish some initial parameters, which are typically specified by the authenticator, and either accepted or not by the authenticated entity:
Both parties compute the HOTP value derived from the secret key K and the counter C. Then the authenticator checks its locally generated value against the value supplied by the authenticated.
The authenticator and the authenticated entity increment the counter C independently. Since the authenticated entity may increment the counter more than the authenticator, RFC 4226 recommends a resynchronization protocol. It proposes that the authenticator repeatedly try verification ahead of their counter through a window of size s. The authenticator's counter continues forward of the value at which verification succeeds, and requires no actions by the authenticated entity.
To protect against brute-force attacks targeting the small size of HOTP values, the RFC also recommends implementing persistent throttling of HOTP verification. This can be achieved by either locking out verification after a small number of failed attempts, or by linearly increasing the delay after each failed attempt.
6-digit codes are commonly provided by proprietary hardware tokens from a number of vendors informing the default value of d. Truncation extracts 31 bits or decimal digits, meaning that d can be at most 10, with the 10th digit adding less variation, taking values of 0, 1, and 2 (i.e., 0.3 digits).
After verification, the authenticator can authenticate itself simply by generating the next HOTP value, returning it, and then the authenticated can generate their own HOTP value to verify it. Note that counters are guaranteed to be synchronised at this point in the process.
The HOTP value is the human-readable design output, a d-digit decimal number (without omission of leading 0s):
That is, the value is the d least significant base-10 digits of HOTP.
HOTP is a truncation of the HMAC of the counter C (under the key K and hash function H):
where the counter C must be used big-endian.
Truncation first takes the 4 least significant bits of the MAC and uses them as a byte offset i:
where ":" is used to extract bits from a starting bit number up to and including an ending bit number, where these bit numbers are 0-origin. The use of "19" in the above formula relates to the size of the output from the hash function. With the default of SHA-1, the output is 20 bytes, and so the last byte is byte 19 (0-origin).
That index i is used to select 31 bits from MAC, starting at bit i × 8 + 1:
31 bits are a single bit short of a 4-byte word. Thus the value can be placed inside such a word without using the sign bit (the most significant bit). This is done to definitely avoid doing modular arithmetic on negative numbers, as this has many differing definitions and implementations.[2]
The following Python code implements the HMAC-SHA1 and HOTP algorithms.
import hashlib
def hmac_sha1(key: bytes, msg: bytes) -> bytes:
if len(key) > 64:
key = hashlib.sha1(key).digest()
if len(key) < 64:
key = key.ljust(64, b'\0')
o_key_pad = bytes(i ^ 0x5c for i in key)
i_key_pad = bytes(i ^ 0x36 for i in key)
return hashlib.sha1(
o_key_pad +
hashlib.sha1(i_key_pad + msg).digest()
).digest()
def hotp(key: bytes, ctr: int, length: int) -> str:
mac = hmac_sha1(key=key, msg=ctr.to_bytes(8, 'big'))
offset = mac[-1] & 0xf
truncated = bytearray(mac[offset:offset+4])
truncated[0] &= 0x7f
value = int.from_bytes(truncated, 'big') % (10**length)
return str(value).rjust(length, '0')
otpauth:// URI scheme
Some implementations of HOTP and TOTP for smartphones allow users to scan QR codes to add HOTP and TOTP tokens to their authenticator apps. These QR codes contain Uniform Resource Identifiers (URIs) with the scheme otpauth://.[3]
HOTP otpauth:// URIs begin with otpauth://hotp/ and must contain a label, secret, and counter. The label is encoded as part of the path, while the secret and counter are encoded as query parameters. The URI may optionally contain other fields, such as the number of digits (which defaults to 6), the algorithm used (which defaults to SHA1), and the issuer name.
The secret is encoded as RFC 4648 Base32, with padding omitted. For example, the URI otpauth://hotp/Wikipedian?secret=JBSWY3DPFQQHO33SNRSCC&counter=42 represents a HOTP token labeled "Wikipedian", with the secret Hello, world! encoded as ASCII, and the initial counter 42. When added to an authenticator, it should produce the code 439256.
Both hardware and software tokens are available from various vendors, for some of them see references below.
Software tokens are available for (nearly) all major mobile/smartphone platforms (J2ME,[4] Android,[5] iPhone,[6] BlackBerry,[7] Maemo,[8] macOS,[9] and Windows Mobile[7]).
Although the early reception from some of the computer press was negative during 2004 and 2005,[10][11][12] after IETF adopted HOTP as RFC 4226 in December 2005, various vendors started to produce HOTP-compatible tokens and/or whole authentication solutions.
According to the article "Road Map: Replacing Passwords with OTP Authentication"[13] on strong authentication, published by Burton Group (a division of Gartner, Inc.) in 2010, "Gartner's expectation is that the hardware OTP form factor will continue to enjoy modest growth while smartphone OTPs will grow and become the default hardware platform over time."
As of the NIST's July 2025 revision of its Digital Identity Guidelines (SP 800-63B-4), one-time password authenticators such as those based on HOTP are classified as "something you have" authenticators, supporting authenticator assurance levels AAL1 through AAL2, but are not considered sufficient on their own to reach the highest level, AAL3, since they are not resistant to verifier impersonation attacks.[14]
Source: Wikipedia. Article content is retrieved live through the MediaWiki API.
HMAC-based one-time password (HOTP) is a cryptographic algorithm based on a one-time password (OTP) and hash-based message authentication code (HMAC). At setup time, a client and server share a secret and other initialization settings. In future exchanges, when a client attempts to access a server, a challenge is sent from the server to the client and the client then uses the previously exchanged secret and computes a value (a one time password) to be used as the server's challenge response. HOTP is the basis for the commonly used time-based one-time password (TOTP) algorithm which extends upon it. It often forms part of multi-factor authentication protocols such as the Open Authentication initiative (OATH).. HOTP was published as an informational IETF RFC 4226 in December 2005, documenting the algorithm along with a Java implementation. Since then, the algorithm has been adopted by many companies worldwide (see below).
In cryptography, an HMAC (sometimes expanded as hash-based message authentication code or keyed-hash message authentication code) is a specific type of message authentication code (MAC) involving a cryptographic hash function and a secret cryptographic key. As with any MAC, it may be used to simultaneously verify both the data integrity and authenticity of a message. An HMAC is a type of keyed hash function that can also be used in a key derivation scheme or a key stretching scheme. HMAC can provide authentication using a shared secret instead of using digital signatures with asymmetric cryptography. It trades off the need for a complex public key infrastructure by delegating the key exchange to the communicating parties, who are responsible for establishing and using a trusted channel to agree on the key prior to communication.
SipHash is an add–rotate–xor (ARX) based family of pseudorandom functions created by Jean-Philippe Aumasson and Daniel J. Bernstein in 2012, in response to a spate of "hash flooding" denial-of-service attacks (HashDoS) in late 2011. SipHash is designed as a secure pseudorandom function and can also be used as a secure message authentication code (MAC). SipHash, however, is not a general purpose key-less hash function such as Secure Hash Algorithms (SHA) and therefore must always be used with a secret key in order to be secure. That is, SHA is designed so that it is difficult for an attacker to find two messages X and Y such that SHA(X) = SHA(Y), even though anyone may compute SHA(X). SipHash instead guarantees that, having seen Xi and SipHash(Xi, k), an attacker who does not know the key k cannot find (any information about) k or SipHash(Y, k) for any message Y ∉ {Xi} which they have not seen before.
In cryptography, a message authentication code (MAC), sometimes known as an authentication tag, is a short piece of information used for authenticating and integrity-checking a message. In other words, it is used to confirm that the message came from the stated sender (its authenticity) and has not been changed (its integrity). The MAC value allows verifiers (who also possess a secret key) to detect any changes to the message content.
Before the 1921 destruction of Tulsa’s Greenwood District, Black residents had created a remarkable center of business and community life. The district included stores, professional offices, entertainment venues and homes owned by Black citizens. Understanding Greenwood means learning what was built—not only what was burned.
MORE →Shirley Chisholm, elected in 1968.