While the resulting codes you get at the end of the process are only six digits, the TOTP secret can really be any length.
Everything is fed into an HMAC after all. It's only the last step where truncation occurs.
Everything is fed into an HMAC after all. It's only the last step where truncation occurs.
The probability of guessing the challenge _wrong_ once is (1 - (100 / 1000000)). Every 30 seconds you get another chance. The probability of guessing the challenge wrong N times in a row is (1 - (100/1000000)) ^ N. Around chance number 7000, the probability that you've guessed it wrong all N times goes lower than 50/50. ~7000 * 30s in hours is around 58 hours.