Repository navigation
Description
Existing issues
- I searched open and closed issues and didn't find this already reported.
Extension URL
https://github.com/raycast/extensions/tree/main/extensions/proton-authenticator
What happened?
Proton Authenticator → Get Totp lists every account with the same 6-digit code. The code changes every 30 seconds, but it is identical across accounts and doesn't match the codes in the Proton Authenticator app.
Expected: each account shows its own code, matching Proton Authenticator. Actual: one shared code, and it's wrong for all of them.
It looks like a gap in Tinycast's Buffer shim rather than anything Raycast-only:
- The extension generates codes with
otplib12, which decodes each base32 secret with the bundledthirty-twopackage. That package builds its buffers with the legacynew Buffer(string)form. - Tinycast's
Bufferisclass Buffer extends Uint8Arraywith no constructor of its own, sonew Buffer("JBSWY3DP…")goes toUint8Array, which reads the string as a length. The secret comes out as an empty buffer (a numeric-looking string such asnew Buffer("6869", "hex")becomes 6,869 zero bytes instead). - Every account then gets an empty HMAC key, and
Hash.digesttreats an empty key as "no key", so it returns a plain hash of the time counter. Same input for every account, so the same code.
Steps to reproduce
- Install Proton Authenticator (
proton-authenticator, authorFared) and import two or more accounts. - Open Get Totp.
- Every row shows the same code.
The same failure without any real secrets, using the RFC 4226 / RFC 6238 test secrets through the runtime fixture harness:
✗ a base32 secret decodes to its key — ""
✗ each secret gets its own RFC 4226 code — ["362668","878336","362668"] (expected 755224, 287082, 282760)
✗ an empty HMAC key is still an HMAC — e3b0c442…b855 (SHA-256 of "", not HMAC-SHA256)
Screenshots or recording
I've left out a screenshot because the codes are live 2FA codes. The harness output above shows the same thing with public test secrets.
Tinycast version + channel
0.12.11 stable, build 138. The Buffer class and the Hash.digest check are unchanged on current main.
macOS version
27.2 (build 26B123), Apple Silicon.
Extension limits
- I understand this is closed if the extension depends on Raycast-only capabilities.
Contribution
- I'm willing to implement this myself once this issue is labelled
approved
I have a small fix ready, with a case in fixtures.mjs and one in ext-test: a Buffer constructor that decodes a string like Buffer.from, and createHmac keeping an empty key as an HMAC. Thank you for considering it, and happy to change the approach if you'd prefer something different.
Activity
github-actions commentedon Nov 8, 2026
Thanks for opening this! Tinycast stays small and focused, so new features are chosen
carefully and smaller conveniences are usually closed.
Tip
Planning to build this? Discussing the approach here first is highly preferred.
abue-ammar commentedon Nov 9, 2026
@akaready if it wont break other extension or other features open a pr