Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: Incorrect intitial HOTP code #113

Open
4 tasks done
adriamontoto opened this issue Jul 4, 2024 · 1 comment
Open
4 tasks done

bug: Incorrect intitial HOTP code #113

adriamontoto opened this issue Jul 4, 2024 · 1 comment
Labels
Bug Something isn't working

Comments

@adriamontoto
Copy link

adriamontoto commented Jul 4, 2024

Bug type

Error at runtime

App version

5.3.7

Device environment

iOS 17.5.1, iPhone 12 Pro

Bug description

I am facing an issue when generating OTP codes using HMAC. The first OTP code generated by 2FAS Auth does not match the first code generated by Google Authenticator or my python code.

Details:

  • URI: otpauth://hotp/test?secret=NLDCKV3Z7PIWGHFHYEMFWQQN63AU44CP&counter=0

  • Secret Key: NLDCKV3Z7PIWGHFHYEMFWQQN63AU44CP

  • Example:
    Expected First OTP (Python/Google Authenticator): 695386 (index 0)
    Actual First OTP (2FAS Auth): 441203 (which matches the second (index 1) OTP in Google Authenticator and my python code)
    I have tested this with other secret keys and the issue persists.

Comment

This discrepancy suggests that 2FAS Auth might be misaligning the OTP generation sequence or using a different starting point for the HMAC-based OTP calculation.

Solution

No response

Additional context

No response

Acknowledgements

  • This issue is not a duplicate of an existing bug report.
  • I understand that security vulnerabilities should be reported to [email protected] instead of on GitHub.
  • I have chosen an appropriate title.
  • All requested information has been provided properly.
@adriamontoto adriamontoto added the Bug Something isn't working label Jul 4, 2024
@adocyn
Copy link
Collaborator

adocyn commented Aug 19, 2024

Thank you. We'll check that out!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants