On 29.3. 12:06, derek cooper wrote:
Hello,

I am trying to generate TOTP tokens using OATHLIB, with the following
test program:

const char* secret="12345678901234567890123456789011";

However the token generated does not match with the same token using
oathtool, when i use a real token (values above are dummy ones) oathtool
returns the correct value, but the test c program does not. the results:

Oathtool takes a hexadecimal representation of the key, the library function seems to take the raw binary value. For example, with
secret = "abcd" in your code should give the same value as
'oathtool --totp 61626364' on the command line.


--
Ilkka Virta <[email protected]>

Reply via email to