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

Unable to generate TOTPs for secret size of 1,3,10,11,14 #102

Open
anirudhensurity opened this issue Feb 3, 2025 · 0 comments
Open

Unable to generate TOTPs for secret size of 1,3,10,11,14 #102

anirudhensurity opened this issue Feb 3, 2025 · 0 comments

Comments

@anirudhensurity
Copy link

Description
When generating a TOTP secret, the Generate function successfully encodes and decodes secrets of length 16 but fails for lengths 1, 3, 10, 14, etc.. The issue seems to be related to Base32 encoding, which requires the input length to be a multiple of 5.

Steps to Reproduce
Call the Generate function with a secret length of 1, 3, 10, or 14 bytes.
The function fails to correctly encode or decode the secret, causing test cases to fail.
When the secret length is 16, the function works fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant