Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to disable 128-bit requirement #46

Closed
timvisee opened this issue Jan 2, 2023 · 3 comments · Fixed by #48
Closed

Option to disable 128-bit requirement #46

timvisee opened this issue Jan 2, 2023 · 3 comments · Fixed by #48

Comments

@timvisee
Copy link
Contributor

timvisee commented Jan 2, 2023

Currently, a >= 128-bit secret is enforced. This is probably due to RFC6238.

Some services provide a smaller secret, Discord and PayPal are two examples (80 bits). I understand this is not per RFC6238 specification, but I'd love to support those as well.

Users of prs have discussed this here.

I'd therefore like to see an option to loosen this requirement. Would that be possible?


I'm thinking of TOTP::set_min_bits(80); function, or even a compile time feature to disable the check.

What do you think? I'd be very happy to give this a shot in a PR.

@constantoine
Copy link
Owner

Mhh I know I previously rejected a similar suggestion. I didn't know Discord and Paypal used smaller secrets, which kinda makes me want to scream into the void.

There would definitely need to be an API change for that. Maybe a _unchecked variant for new?

@timvisee
Copy link
Contributor Author

timvisee commented Jan 3, 2023

which kinda makes me want to scream into the void

Yes!

Good suggestion, a new function should only have minimal effect. Would you merge that if I'd implement it? Should it be behind a feature flag?

I'd be happy to go over my current TOTP database to find other examples.

@constantoine
Copy link
Owner

I don't think a feature flag would be necessary for that

Fingel added a commit to Fingel/ripasso that referenced this issue Sep 16, 2024
totp-rs is strictly RFC6238 compliant. This is a good thing, but the
reality is many sites/apps are still using 80 bit secrets for TOTP.
These include Github, Discord, Paypal, among others. The author of
totp-rs added a function `from_url_unchecked` to address this in this
issue: constantoine/totp-rs#46. I suggest we
use it here so that ripasso can be used practically for totp.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants