Closed SudoerWithAnOpinion closed 2 years ago
Hi
most of the application requires a base32 encoded version of the key...
For example I was able to test your secret key (lowercase) with the following website: https://totp.danhersam.com/?key=NBXHINTSNJWHG23ENZTWY6L2MM
My arduino agrees with the codes generated by the website, NBX... is the encoded version of "hnt6rjlskdnglyzc"
Let me know...
I also tested the GAuth app with the base32 version of the key as "configuration code" and it works fine
Can you walk me through what you do with hnt6rjlskdnglyzc
to make it work? I put it into your site to convert to the HEX array and used it as the TOTP's input but it didn't work.
Hi
I simply copied your definition:
uint8_t hardHMAC_L[] = {0x68, 0x6e, 0x74, 0x36, 0x72, 0x6a, 0x6c, 0x73, 0x6b, 0x64, 0x6e, 0x67, 0x6c, 0x79, 0x7a, 0x63};
in my example and run the sketch
I've tried looking at past issues and the example code but I cannot get Google Authenticator and the sketch to agree. I am able to use the totp secret in MS authenticator, Google Authenticator, and other places and they all agree (as well as actually working for an account I was testing; this was removed from the account before posting for security reasons)
I thought the issue might be upper vs lowercasing but that seems unhelpful.
The example provided is great, but without including the original secret, it's very hard to verify if I've done something wrong. I've included an abridged copy of my code, laving out the WiFi and NTP details as I've already confirmed the time being output is correct.
These are the outputs I get: Google Authenticator TOTP Code: 841238 (Arduino) TOTP Code (hnt6rjlskdnglyzc): 976485 (Arduino) TOTP Code (HNT6RJLSKDNGLYZC): 415344
Do you have any pointer as to what I may be doing wrong? Any help would be appreciated.