Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can you explain how google authenticator / wireless tokens work?

Tags:

I've been curious as to how google generates one time log in tokens on an iPhone app without comminicatig with the server when the token is Assigned. The token changes every ten seconds. How does google know what the right token is? I disabled data and it still works.

Thanks

like image 459
NoviceCoding Avatar asked Mar 03 '11 18:03

NoviceCoding


People also ask

How does the Google Authenticator works?

The Authenticator app is based on the time-based one-time password (TOTP) system specified in the IETF's RFC 6238 document. The TOTP algorithm generates a six-digit passcode that factors in the current time of day to ensure that each passcode is unique. Passcodes are changed every 30-60 seconds for further security.

What is token from Google Authenticator?

The token provides an authenticator, which is a six digit number users must enter as the second factor of authentication. You need to install the Google Authenticator app on your smart phone or tablet devices. It generates a six-digit number, which changes every 30 seconds.

How do 2FA tokens work?

When a user needs to log in, they simply enter the number, along with their username and optionally, a PIN or password. Behind the scenes, the server that is authenticating the user also has a copy of the hard token's seed record, the algorithm used to generate the numbers, and the correct time.

How are 2FA tokens generated?

The setup process entails the server generating a secret key. The user enters the secret key into the authenticator application. The user can then generate an OTP to verify the setup process worked with the server. Each time the authenticator app is opened, a random number is generated for use at a fixed interval.


2 Answers

it uses your unique key during setup as well as a special sequence/algorithm (that's part of the authenticator program (in your case, the iPhone .app)) to generate a special key. As part of the key-generating process, it also uses the current time on your iPhone to match up with the computer time you are logging in from.

remember a verification code, wait for the current code to expire, and continue logging into your google account on your computer with your previously memorized code. it will still work. try changing the time on your phone by 20 minutes off or something, and use a newly-generated code, it will not work.

it works similar to the HSBC security dongle keychain thinggy (for online banking) if you have one.

like image 104
Chris Avatar answered Sep 29 '22 13:09

Chris


Google Authenticator generates OTPs based on the secret key. The secret key (seed) is 16 or 32 character alphanumeric code. In the process of token enrollment, the server generates the secret key and shares it with your phone via QR code (or you can enter it manually). For example, when TOTP algorithm is used, server and Google Authenticator know the seed and the current time and based on this information they generate the same one-time passwords (OTPs) at predetermined intervals. So the key elements are the secret key and time. Google Authenticator doesn’t require any internet connection or mobile network.

like image 32
Christian Avatar answered Sep 29 '22 12:09

Christian