Closed dbuckman closed 9 years ago
@dbuckman: It is a coincidence, that "aaaaaaaaaaaaaaaa"
is valid secret (eg. both "aaaaaaaaaaaaaaa"
and "aaaaaaaaaaaaaaaaa"
are not). The underlying rule is that secret must be a valid argument for base64.b32decode()
.
Does that answer your question?
Well it does answer that I was doing it wrong and need to understand base64.b32decode() better. I have some reading to do. Thanks for the help
Well it does answer that I was doing it wrong and need to understand base64.b32decode() better. I have some reading to do. Thanks for the help
If you are generating secret yourself, I suggest:
base64.b32encode()
; the result will be passable as secret, orbase64.b32encode()
and using the result as secret; oronetimepass.get_totp()
in your own function, that will do the conversion (using base64.b32encode()
) on your behalf,Example of how to use '1aaaaaaaaaaaaaaa'
as secret:
>>> from base64 import b32encode
>>> import onetimepass as otp
>>> secret = '1aaaaaaaaaaaaaaa'
>>> otp.get_totp(b32encode(secret))
706607
That would allow you to continue without need to understand base64.b32decode()
. Hope that helps.
Maybe I am doing something wrong, but when a secret has a digit in the first position generating a OTP fails. Is this by design or am I doing something wrong?
Thanks for the help