Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7568001
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T14:48:46+00:00 2026-05-30T14:48:46+00:00

The test values of the RFC specify: Appendix D – HOTP Algorithm: Test Values

  • 0

The test values of the RFC specify:

Appendix D - HOTP Algorithm: Test Values

   The following test data uses the ASCII string
   "12345678901234567890" for the secret:

   Secret = 0x3132333435363738393031323334353637383930

   Table 1 details for each count, the intermediate HMAC value.

   Count    Hexadecimal HMAC-SHA-1(secret, count)
   0        cc93cf18508d94934c64b65d8ba7667fb7cde4b0
   1        75a48a19d4cbe100644e8ac1397eea747a2d33ab

So if I try to get the HMAC for 0 in ruby I get:

[20] pry(AuthyOTP)> secret_key = "12345678901234567890"
=> "12345678901234567890"
[22] pry(AuthyOTP)> OpenSSL::HMAC.hexdigest(digest, secret_key, "0")
=> "32a67f374525d32d0ce13e3db42b5b4a3f370cce"

I was expected to get cc93cf18508d94934c64b65d8ba7667fb7cde4b0

So I wrote an implementation in java, and I get the same:

Calculation OTP for movingFactor = 0
    2. Calculate Hash = 
      32a67f374525d32d0ce13e3db42b5b4a3f370cce

So what is the hexadecimal SHA1-HMAC of “0” when the secret is “12345678901234567890” ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T14:48:48+00:00Added an answer on May 30, 2026 at 2:48 pm

    RFC4226 is correct.

    You are confusing a character strings with bytes. You are not suppose to compute the hmac-sha1 of ‘0’, you are suppose to compute the hmac-sha1 of an 8 byte integer that starts out at 0. In java, that would be the hmac-sha1 of byte [] counter = {0, 0, 0, 0, 0, 0, 0, 0};

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here is the code I input... mysql_query(INSERT INTO test (string) VALUES ('tes><ssst')); And this
I am running a cross server insert INSERT INTO server.database.dbo.table (Field) VALUES('test') Afterward, I
I have various objects in application,and each has isvalid method to test if values
I'm writing a unit test for a method that packs boolean values into a
How can I update multiple values in MySQL? This didn't work: UPDATE test SET
I have the following example class: Test.h: @interface Test : UIButton { NSString *value;
As mentioned above. I give one example, let's say all the test values are
Is it possible to use array_map() to test values of an array? I want
How to extract a list of different values from following list of tuples? tuple
def group_move(group, damper): # Make a copy to test values new = group #

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.