Open WhyNotHugo opened 7 years ago
On, this is onetimepass v1.0.1, python 3.6.1.
Base32 takes 8 output bytes to encode each 5 input bytes. 1-4 input bytes still require 8 output bytes, appending =
characters as padding.
In other words, otp asserts that len(secret) % 8 == 0
. Appending ======
to your example makes it correct.
Solution: otp should provide an option to autopad secrets. (Or just to it by default.)
Sure, this could be done to make it more user friendly.
Solution: otp should provide an option to autopad secrets. (Or just to it by default.)
Do you think this solution is enough / correct: https://stackoverflow.com/a/9807138/548696?
Looks good. (The condition is unnecessary though.) Tests should be easy to write too.
All secrets generated by fastmail see to make the library crash. I can't find any common pattern for them:
The one included in the above example is safe to share since I never added confirmed adding that one to my account. :)