Skip to content

TOTP generation fails when Base32 secret is not properly padded (missing padding handling) #1546

Open

Description

@MallardsAreCool

Describe the issue

TOTP generation is unable to handle padding on secret keys that aren't mod 8 via QRCodes.

To reproduce:

  • Import TOTP via QR code that isn't mod 8 or is padded to be mod 8
  • Compare the generated TOTP with other authenticators (Google, Microsoft, Authy)
  • The codes won't match due to missing padding

Example secrets that won't scan correctly:
otpauth://totp/Example:User?secret=J3WWIV3PTGJPQV5QAICM&issuer=Example
otpauth://totp/Example:User?secret=J3WWIV3PTGJPQV5QAICM====&issuer=Example

Browser

Chrome

Browser Version

149.0.7827.156

Extension Version

8.0.2

Activity

  1. VastBlast commented on Jul 10, 2026

    @VastBlast

    This issue was fixed in https://github.com/VastBlast/authenticator-2fa which is a project I started, inspired by this one. Unfortunately this project does not seem to be maintained anymore. Feel free to open any issues there if you have any.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions