q2K BHP
Black History Portal
THE BHP WIRE —
HIDDEN TRUTHS
What's New!
THE JOURNEY THROUGH TIME

Explore Black History

Explore the people, places, events, achievements, struggles and stories that shaped our journey.

✊🏾

Civil Rights

Movements, leaders, victories and the continuing fight for equality.

⚙️

Black Inventors

Innovation, patents, science, technology and world-changing contributions.

🏆

Sports

Pioneers, champions, Negro Leagues, records, activism and excellence.

♟️

People

Meet the people whose lives, choices and achievements shaped the journey.

📍

Places

Black towns, communities, institutions and places where history happened.

📜

Events

Moments that changed communities, movements, institutions and the nation.

Enter a person, place, event, or topic.
MY'STORY

The MOVE Fire

This is a personal recollection on the Move fire on May 13, 1985 Philadelphia police fired thousands of rounds at the MOVE house, city officials approved dropping an explosive device on the roof, the resulting fire was allowed to burn, 11 people—including five children—died, and 61 homes were destroyed. Philadelphia City Council later called it a “brutal attack carried out by the City of Philadelphia on its own citizens” and acknowledged that no individual faced criminal consequences for the bombing. One timeline correction worth preserving for the BHP record: the major previous MOVE-police confrontation was August 8, 1978, about seven years before the bombing, not a year or two earlier. Officer James Ramp was killed, other police and firefighters were wounded, nine MOVE members were later convicted, and television cameras recorded police beating Delbert Africa during his arrest. The 1985 MOVE Commission later specifically criticized city planners for failing to adequately use lessons from that 1978 confrontation. And that actually strengthens the point you’re making: 1985 did not happen without precedent or institutional memory. There had already been a deadly confrontation with MOVE, years of conflict, negotiations and police involvement before Osage Avenue.

MORE →
BLACK FACTS
The Truths They Never Taught You...

Katherine Johnson — Mathematics to the Moon

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 →
BHP gathered finds from its connected research sources. Showing the 4 strongest Black History matches.
← BACK TO RESULTS
Wikipedia

HMAC-based one-time password

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).

Algorithm

[edit]

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:

  • A cryptographic hash method H (default is SHA-1)
  • A secret key K, which is an arbitrary byte string and must remain private
  • A counter C, which is 8 bytes long and counts the number of iterations
  • A HOTP value length d (6–10, default is 6, and 6–8 is recommended)

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):

HOTP value = HOTP(K, C) mod 10d.

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):

HOTP(K, C) = truncate(HMACH(K, C)),

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:

truncate(MAC) = extract31(MAC, MAC[(19 × 8 + 4):(19 × 8 + 7)]),

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:

extract31(MAC, i) = MAC[(i × 8 + 1):(i × 8 + 4 × 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]

Implementation

[edit]

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

[edit]
The URI mentioned in this section, encoded as a QR code. Many smartphones allow users to scan such codes and enroll them in an authenticator app, such as Google Authenticator.

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.

Tokens

[edit]

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]).

Reception

[edit]

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]

See also

[edit]

References

[edit]
  1. ^ M'Raihi, David; Naccache, David; Rydell, Johan; Bajaj, Siddharth; Machani, Salah (June 2011). OCRA: OATH Challenge-Response Algorithm (Report). Internet Engineering Task Force.
  2. ^ Frank, Hoornaert; David, Naccache; Mihir, Bellare; Ohad, Ranen (December 2005). "HOTP: An HMAC-Based One-Time Password Algorithm". tools.ietf.org. doi:10.17487/RFC4226.
  3. ^ Habets, Thomas (2018-11-26). "Key Uri Format". GitHub. Retrieved 2026-05-24.
  4. ^ "DS3 Launches OathToken Midlet Application". Data Security Systems Solutions. 2006-02-24. Archived from the original on 29 December 2013.
  5. ^ "StrongAuth". 2010. Archived from the original on 2010-05-18.
  6. ^ Cobbs, Archie L. (2010). "OATH Token". Archie L. Cobbs.
  7. ^ a b "ActivIdentity Soft Tokens". ActivIdentity. 2010. Archived from the original on 2010-09-17.
  8. ^ Whitbeck, Sean (2011). "OTP Generator for N900". Sean Whitbeck.
  9. ^ "SecuriToken". Feel Good Software. 2011. Archived from the original on 2012-04-25.
  10. ^ Kearns, Dave (2004-12-06). "Digging deeper into OATH doesn't look so good". Network World.
  11. ^ Willoughby, Mark (2005-03-21). "No agreement on Oath authentication". Computerworld. Archived from the original on 2012-10-11. Retrieved 2010-10-07.
  12. ^ Kaliski, Burt (2005-05-19). "Algorithm agility and OATH". Computerworld. Archived from the original on 2012-10-11. Retrieved 2010-10-07.
  13. ^ Diodati, Mark (2010). "Road Map: Replacing Passwords with OTP Authentication". Burton Group. Archived from the original on 2011-07-21. Retrieved 2011-02-10.
  14. ^ "NIST SP 800-63B-4: Digital Identity Guidelines - Authentication and Authenticator Management". National Institute of Standards and Technology. July 2025. Retrieved August 17, 2026.
[edit]

Source: Wikipedia. Article content is retrieved live through the MediaWiki API.

No preview image
Wikipedia

HMAC-based one-time password

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).

MORE →
Wikipedia

HMAC

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.

MORE →
No preview image
Wikipedia

SipHash

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.

MORE →
No preview image
Wikipedia

Message authentication code

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.

MORE →
TOPIC OF THE DAY

Greenwood / Black Wall Street

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 →
TRIVIA QUESTION OF THE DAY

Which Black woman became the first elected to the United States Congress?

Shirley Chisholm, elected in 1968.