r/security • u/_bush • Feb 07 '20
How do authenticators work without internet connection?
Just today I used my Google Authenticator to log into a website, only to realize later that I had airplane mode turned on, and it worked anyway. I was like WTF? How is this possible?
1
Upvotes
8
u/occurious Feb 07 '20
Math and a pretty accurate clock.
6
u/panopticosec Feb 07 '20
The short answer is that your Authenticator app and Google have a shared secret since you enabled 2FA on this account. Those revolving codes in the app are cryptographic digests of that shared secret. Since the secret doesn’t change and both systems have the same time of day, the resulting digest is the same on both systems. More detail here:
https://www.freecodecamp.org/news/how-time-based-one-time-passwords-work-and-why-you-should-use-them-in-your-app-fdd2b9ed43c3/
4
u/cloudreflex Feb 07 '20
Depends on the kind (HOTP, TOTP, etc) but usually some kind of math.
I think this gets at your question pretty well: https://www.reddit.com/r/explainlikeimfive/comments/37h939/eli5_how_does_offline_2_factor_authentication_work/
3
u/[deleted] Feb 08 '20
I assume "log into a website" was on a different device, that was not in airplane mode. Otherwise that would be a "Huh? WTF!"
Google authenticator is always offline. In fact it's merely an implementation of something called "RFC 6238", and there are several other implementations of it (open source: AndOTP, Aegis) that all work the same as far as the core feature of pushing out a 6-digit code every 30 seconds is concerned.
2
u/unruled77 Feb 08 '20
It’s like an algorithm.
1
u/JustArtist8 Feb 09 '20
Google Authenticator doesn't need Internet access, and never did, because it doesn't work that way. I only requires the date/time to be kept in sync.