Skip to content

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

Open
@anirudhensurity

Description

@anirudhensurity

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions