mirror of
https://github.com/antonioribeiro/google2fa.git
synced 2026-04-27 00:55:49 +03:00
[GH-ISSUE #40] Using a bigger key results in "Invalid barcode" #16
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/google2fa#16
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @rdev5 on GitHub (Jul 26, 2016).
Original GitHub issue: https://github.com/antonioribeiro/google2fa/issues/40
FYI: https://github.com/antonioribeiro/google2fa#use-a-bigger-key
Setting a 32-byte key (with prefix) results in an
Invalid barcodeerror in the Google Authenticator app whereas 16-byte key seems to work fine.@antonioribeiro commented on GitHub (Jul 28, 2016):
Not getting any errors, here. Just generated a pretty big prefixed key:
This is the generated (154 chars) key:
Look at the key and QRCode:
@rdev5 commented on GitHub (Jul 28, 2016):
Have you tried in "in the Google Authenticator app" itself? That's what is generating the error.
@antonioribeiro commented on GitHub (Aug 3, 2016):
I can confirm that, but looks like this is a Google Authenticator "feature": secrect key size has to be a power of 2, so, for instance, a 512 bytes key worked, but not 511.
But Authenticator on iOS worked (read the barcode and generated codes correctly) fine with all sizes and prefixes I tried, for instance:
So, as Google Authenticator is probably a standard for Google 2FA, I was thinking about creating a property (and a setter) to enforce compatibility and raise an exception on incompatible keys.
What do you think?
@rdev5 commented on GitHub (Aug 3, 2016):
Sounds good. I would probably suggest having it enabled by default since this project is altogether google2fa and not just a generic TOTP library.
@antonioribeiro commented on GitHub (Aug 3, 2016):
Changes are here:
github.com/antonioribeiro/google2fa@69bbda5b71. Anyone willing to test it?@JC5 commented on GitHub (Apr 1, 2017):
So, nearly a year later, I tested it and it works fine for me!
@antonioribeiro commented on GitHub (Jun 17, 2017):
@JC5, Thank you!