Skip to content

OTP implementation incorrectly treats secret as UTF-8 string #15

@brahma-dev

Description

@brahma-dev

createOTP() currently treats the secret parameter as a UTF-8 string and passes it directly into createHMAC().sign(secret, bytes).
This results in incorrect HOTP/TOTP values for any secret that contains bytes ≥ 0x80 after Base32 decoding.

This breaks compatibility with standard OTP secrets (e.g., those generated by Google Authenticator, Authy, etc.), which are Base32 encoded.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions