News for hackers. Stuff that matters.
Re:How does Google Authenticator work? by LeoPanthera on Friday August 27, 2021 @02:14PM (#28331198)
Google Authenticator is an implementation of the catchily-named "Time-based One-Time Password" or TOTP.

https://en.wikipedia.org/wiki/Time-based_One-Time_Password

It is not the only one, any time a site asks you to add a "Google Authenticator" code you can use any TOTP app. 1Password has the functionality built in, for example.

Re:How does Google Authenticator work? by tshaddox on Friday August 27, 2021 @03:34PM (#28332078)
I use 1Password for all of my MFA codes on the web. It's extremely convenient to have them synced across all my devices, but I can't help but think that having my passwords and my MFA private keys stored in the same place almost entirely defeats the purpose of multi-factor authentication.
Re:How does Google Authenticator work? by jeromegv on Friday August 27, 2021 @05:02PM (#28332938)
If your passwords are leaked in a data leak, they still wouldn't get your 2FA. So I wouldn't say it entirely defeats the purpose of 2FA.
Re:How does Google Authenticator work? by tialaramex on Friday August 27, 2021 @05:11PM (#28333015)
Depending on the leak, the secret that drives TOTP could also be in the same database table (or a nearby one). This means anybody with that secret can trivially run the TOTP algorithm and get the correct six digit code for any time present or future.

If you care about MFA that can survive leaks, you want WebAuthn. As with phishing this known problem was considered in the design of WebAuthn and so your WebAuthn credentials aren't designed to need to be secret.

In fact here you go, here are WebAuthn credentials for a vanity system I own, copied out of its authentication database:

ID: AXnUJ920FfJlRjZtocN+9Bc9IP6gvsBiWA3GfJxckh3nQ/KekQ6xB2byfI2GM7IcGS2MpzxZs6IHmAxvgAcE/Mw= Public key: pQECAyYgASFYIFf0iDSfNpYNA5Br9zXSIUH69BqyvFcgbqy6tWC8rsLwIlggCDqury9UOzI1DnOFyE3aYwaBLvP0NyNez98v0TcieKs=

That's all the backend needs to check I'm really me, and yet it's also completely useless to an attacker, they can't even use it to compare across sites and "unmask" me.

Re:How does Google Authenticator work? by bdamm on Friday August 27, 2021 @11:07PM (#28335287)
WebAuthn is great. Put it to work recently in a new control system and it sure is a nice feeling to deploy with zero need for passwords.
Re:How does Google Authenticator work? by brokenmachine on Sunday August 29, 2021 @11:54PM (#28352673)
I had a quick look on wikipedia about how webauthn works, looks like you use a hardware (USB?) device to sign something with the PIN you enter.

What happens if you lose that device, or if it fails?

Re:How does Google Authenticator work? by tshaddox on Friday August 27, 2021 @06:54PM (#28333862)
If they stored my password in plain text, I'm not sure I would trust their 2FA implementation to actually function as a second factor to protect my account. :) Seriously though, isn't this a little like saying that a website could have two passwords on each account so if they suffer a data leak that happens to leak only one of your passwords, that wouldn't be enough to access your account?
Re:How does Google Authenticator work? by lysp on Friday August 27, 2021 @11:37PM (#28335436)
I actually do the opposite.

Keep passwords on browser, and MFA on phone.

If my browser / desktop got compromised, someone would still need my phone to access my accounts.

Re:How does Google Authenticator work? by leshenka on Saturday August 28, 2021 @01:46AM (#28335924)
That's like the definition of 2FA/MFA
Re:How does Google Authenticator work? by tiddles on Saturday August 28, 2021 @02:58AM (#28336162)
Sounds like they're doing it properly then!
Re:How does Google Authenticator work? by tomesco on Saturday August 28, 2021 @02:46AM (#28336124)
1Password had a blog post [1] addressing this concern. Essentially you still have the benefit of one-timeness, but not second factor, and need to compare that to what your security needs are.

[1] https://blog.1password.com/totp-for-1password-users/

Re:How does Google Authenticator work? by easton on Friday August 27, 2021 @04:43PM (#28332769)
There is still a little bit of a point, as it guarantees the password came out of 1Password and wasn't from somewhere else. If someone screencapped your password out of 1Password, it wouldn't of use unless they could get into your vault somehow.
Re:How does Google Authenticator work? by agret on Saturday August 28, 2021 @01:59AM (#28335970)
I use LastPass for password sync and Authy for 2FA. Feels a bit safer having them seperate.
Re:How does Google Authenticator work? by beermonster on Saturday August 28, 2021 @03:37AM (#28336316)
Google Authenticator allows you to sync passwords between devices these days. Fairly recent(ish) and long overdue update.
Re:How does Google Authenticator work? by Abishek_Muthian on Tuesday August 31, 2021 @01:23PM (#28370874)
Isn't it just one time export which by function of TOTP is synced and not an actual sync like in 1Password? i.e. Only the accounts which were available when you exported would be there in another device.
Re:How does Google Authenticator work? by temp0826 on Friday August 27, 2021 @07:50PM (#28334245)
Can you use 1password to act as the code generator for logging in to 1password?
Re:How does Google Authenticator work? by deepspace on Friday August 27, 2021 @08:03PM (#28334318)
Yes. Of course, you need to be logged in on another device to do that.
Re:How does Google Authenticator work? by kaladin-jasnah on Friday August 27, 2021 @05:06PM (#28332978)
Have to chime in but my favourite authenticator is andOTP. Seems to be FOSS as well since it's on F-Droid[0] and I hear it has good support from migration from one phone/ROM to another.

[0] https://f-droid.org/en/packages/org.shadowice.flocke.andotp/

Re:How does Google Authenticator work? by rraghur on Saturday August 28, 2021 @12:50AM (#28335717)
Mine is aegis.. it's on f droid, completely open source, let's you backup your secrets so changing phones isn't a pita
Re:How does Google Authenticator work? by stavros on Saturday August 28, 2021 @04:12AM (#28336458)
Seconding Aegis, it's great.
Re:How does Google Authenticator work? by circularfoyers on Saturday August 28, 2021 @02:10PM (#28340149)
andOTP does all of that too and was out before Aegis. What does it have over andOTP?
Re:How does Google Authenticator work? by teekert on Friday August 27, 2021 @05:26PM (#28333147)
AndOTP is really nice. It is the one thing I miss on iOS. On iOS there does not seem to be any totp apps that can just export their db as an encrypted file (or unencrypted if you so choose). So in Apple land I’m stuck with MS Authenticator, coincidentally my only app that needs iCloud (I really want it backed up).
Re:How does Google Authenticator work? by commoner on Friday August 27, 2021 @06:12PM (#28333525)
Raivo is an iOS TOTP authenticator that is open source and supports exports. Hopefully, this is what you're looking for:

https://apps.apple.com/us/app/raivo-otp/id1459042137

https://github.com/raivo-otp/ios-application

Re:How does Google Authenticator work? by AnonC on Saturday August 28, 2021 @09:57AM (#28338088)
To add something about this app, I know that people understand “open source” to mean different things. In the case of Raivo, the app is a “source available” one. It’s not FOSS.

The license [1] says:

> Modification, duplication or distribution of this Service (in source and binary forms) for any purpose is strictly prohibited.

[1]: https://github.com/raivo-otp/ios-application/blob/master/LIC...

Re:How does Google Authenticator work? by commoner on Saturday August 28, 2021 @11:44AM (#28338941)
You're 100% right. Raivo is source-available, but not free (libre) or open source. I found it through a forum post and neglected to check the license.
Re:How does Google Authenticator work? by jumhyn on Friday August 27, 2021 @08:49PM (#28334552)
FWIW, iOS 15 lets you put a TOTP secret right into the saved password entry on your phone, and it will autofill the code just like it autofills your password.
Re:How does Google Authenticator work? by teekert on Saturday August 28, 2021 @11:54AM (#28339030)
Will I be able to export? When I moved to iOS, AndOTP saved me because I could copy paste all personal keys from AndOTP to MS authenticator. This will probably lock me in…
Re:How does Google Authenticator work? by jumhyn on Saturday August 28, 2021 @12:34PM (#28339344)
On iOS each password item in Settings.app has a "Share" button that lets you AirDrop to another device. I don't see another way to export from iOS.

Safari on macOS (at least in Monterey) offers a bulk export option, which can export all your passwords to an unencrypted CSV file. The information includes URL, username/email, password, and an "OTPAuth" column. For GitHub (the only account I've enabled native TOTP for while the feature is still in beta) the entry in that column looks like this:

> otpauth://totp/github.com:<username>?secret=<secret>&issuer=github.com&algorithm=SHA1&digits=6&period=30

So I'm not sure if that would be directly importable to another service, but at the very least you get the secret and so could transfer the data account-by-account if you had to.

Re:How does Google Authenticator work? by asiachick on Saturday August 28, 2021 @02:04PM (#28340098)
given Apple's new spying stance I'm not sure I want to allow the to store my passwords
Re:How does Google Authenticator work? by jumhyn on Saturday August 28, 2021 @04:29PM (#28341240)
May not make a difference if you don’t take Apple at their word but iCloud Keychain is among the services/data encrypted end-to-end[1] and there’s no exception mentioned for iCloud backup (like there is for Messages).

[1]: https://support.apple.com/en-us/HT202303

Re:How does Google Authenticator work? by artificialLimbs on Saturday August 28, 2021 @01:56AM (#28335959)
There is Tofu. It doesn't export, but it does back up to iCloud, fwiw.

https://www.tofuauth.com/

Re:How does Google Authenticator work? by slim on Friday August 27, 2021 @06:03PM (#28333457)
My favorite is Android Token because it's only 67 kb and it has everything including qrcode scanning :) check it on fdroid
Re:How does Google Authenticator work? by ocdtrekkie on Friday August 27, 2021 @02:42PM (#28331513)
It's truly and deeply frustrating to me how many sites and services push "Google Authenticator" branding instead of specifying that it's TOTP or that literally any good 2FA app will work. It's almost to that "Google" = "search" level, but for a more niche aspect.
Re:How does Google Authenticator work? by ezekg on Friday August 27, 2021 @04:20PM (#28332575)
I'm not sure why you're being down voted, but I agree. I've had several discussions where people think Authy is incompatible with sites that prompt for Google Authenticator, like it's some special more-secure TOTP app.
Re:How does Google Authenticator work? by animex on Friday August 27, 2021 @03:02PM (#28331732)
In Fortune 1000 land, Microsoft Authenticator rules the land. I love it because most have implemented notification push-authentication with biometric verification. Some sites will use that in lieu of any password at all.

The worst is when separate apps & companies roll their own authenticator app.

Re:How does Google Authenticator work? by filoleg on Friday August 27, 2021 @04:05PM (#28332422)
For me personally, Microsoft Authenticator started ruling as well recently, after 5+ years with Google Authenticator. Why? I have already mentioned it in other comments before, and it is due to Google’s insistence on not implementing recovery from backup.

If i store my 2FA in google authenticator and something happens to my phone? I am in a world of serious pain. If i upgrade phones? I have to disable and re-enable 2FA on my new phone manually for every single service I use.

Microsoft Authenticator solves both of those problems, as they have recently (less than a year ago iirc) added a “backup to cloud” feature. No more stressing about something happening to my phone, as long as i have my (single) primary recovery key stored on a piece of paper somewhere safe (as opposed to having a paper recovery key for every 2fa service i use).

Prior to this, i was seriously considering getting a cheap backup phone to which i set up all the 2fa codes simultaneously with my main phone, then put that cheap phone in a bank cell/safe/etc., and then rely on it in case something happens to my main phone. That would still not solve the problem of manual transfer and disabling/re-enabling 2fa for every single service, but that would be much better than losing the device.

Note: I know Authy exists and had this functionality of cloud syncing 2FA keys between logged in devices for years, but for some irrational reason i was sticking with the “simpler is better, and i somehow trust google more with this one”, but luckily, I trust MSFT with my 2FA no less than i would google, perhaps even moreso. And the biometric 2FA for services that support it (so far, I’ve only seen it used with certain corporate MSFT services) are a nice cherry on top.

Re:How does Google Authenticator work? by isbvhodnvemrwvn on Friday August 27, 2021 @04:47PM (#28332802)
Google Authenticator has added account transfer at some point in the recent couple years - you get a QR code that you can scan on another device to transfer stuff. It's not automated backup, but it makes migration to new devices easier.
Re:How does Google Authenticator work? by akersten on Friday August 27, 2021 @04:53PM (#28332859)
Can I print that QR code and stuff it in a safe to scan 3 years from now, or does it expire? It isn't clear from the export screen.
Re:How does Google Authenticator work? by remus on Friday August 27, 2021 @05:11PM (#28333021)
I'm pretty sure the QR codes actually encode your secrets so if you want to print them out you're good to go. Obviously won't include any new ones you add in in the meantime though.
Re:How does Google Authenticator work? by unclebucknasty on Friday August 27, 2021 @05:06PM (#28332968)
>Can I print that QR code and stuff it in a safe to scan 3 years from now, or does it expire?

Given the protocol/algorithm, it shouldn't expire.

Re:How does Google Authenticator work? by filoleg on Friday August 27, 2021 @05:15PM (#28333036)
This is only for Google-specific services that use 2FA (and it works with any authenticator apps, not just Google Authenticator, because this functionality is dependent on the service, not the app).

So if I try to do this for my Google account 2FA (with Google Authenticator, Microsoft Authenticator, or literally any other authenticator app), it works. But it won’t work for any of my other 2FA accounts, like MSFT, Discord, etc., no matter which authenticator app I use.

To your defense, Google Authenticator added the option for restoring from local backup fairly recently, but only for Android. And even then, no ability to sync it with multiple devices.

Re:How does Google Authenticator work? by nemetroid on Friday August 27, 2021 @07:46PM (#28334227)
That doesn't make much sense to me. If the app has the state necessary to generate TOTP codes, why couldn't it transfer that state to a different device? How could it be dependent on the service?
Re:How does Google Authenticator work? by nl on Friday August 27, 2021 @08:45PM (#28334542)
This isn't the case.

I recently changed phones from Android to iOS and the export/import from Google Authenticator was fine for non-Google services.

Edit: I think there was a bug where it seemed to only export the tokens visible on the page, so I had to scroll and do it again for additional tokens. Maybe you are hitting that.

Re:How does Google Authenticator work? by JumpCrisscross on Friday August 27, 2021 @05:06PM (#28332974)
> If i store my 2FA in google authenticator and something happens to my phone? I am in a world of serious pain

On iOS, you can back up Google Authenticator. It then restores with your 2FA codes intact. (I don't do this, because I feel it weakness 2FA's security and am decent about saving recovery codes. But everyone's tolerance for B.S. is different.)

Re:How does Google Authenticator work? by filoleg on Friday August 27, 2021 @05:13PM (#28333028)
> On iOS, you can back up Google Authenticator. It then restores with your 2FA codes intact.

Source needed. I just opened Google Authenticator on iOS, and it isn’t an option. Googling confirmed that it isn’t supported on iOS.

If you try to restore the phone from the backup (whether iCloud or local backup), it will restore the app, but it will have no 2FA codes present.

Re:How does Google Authenticator work? by JumpCrisscross on Friday August 27, 2021 @05:28PM (#28333166)
> I just opened Google Authenticator on iOS, and it isn’t an option

Why would it be an option in the app? Go to your phone's backup settings and select Google Authenticator. When I had this on, it worked. (It might have since changed.)

Google being Google, there is zero reliable documentation on anything, but here's a community thing from a few years ago [1].

[1] https://support.google.com/mail/forum/AAAAK7un8RUcSLd5H1MpO4...

Re:How does Google Authenticator work? by greggman3 on Saturday August 28, 2021 @02:19PM (#28340228)
Are you sure this actually works?

My understanding is that iCloud backup is specified by the user per app (can default to on). Going into my iPhone->Settings->Authenticator there are no iCloud settings and iPhone->Settings->iCloud shows lots of apps but Authenticator is not one of them.

I have iCloud backup on, have switched through at least 2 phones (as in 6+->10->11) where I have Google Authenticator on. The new phone never had any of the Authenticator codes after restoring yet all the other apps restored their data.

Re:How does Google Authenticator work? by filoleg on Tuesday August 31, 2021 @12:28PM (#28370041)
Exact same experience. The app backs up into icloud and gets restored on backup restore just fine. But no 2FA codes are present after restoring, so I had to enter them manually.
Re:How does Google Authenticator work? by JumpCrisscross on Saturday August 28, 2021 @04:16PM (#28341147)
Settings->User->iCloud->Manage Storage->Backups.
Re:How does Google Authenticator work? by koolba on Friday August 27, 2021 @04:56PM (#28332886)
> Microsoft Authenticator solves both of those problems, as they have recently (less than a year ago iirc) added a “backup to cloud” feature.

Is this to the same cloud that Microsoft gives unfettered access to all its customer’s Cosmos DB data?

2FA backups are fine but they need to be onto local, offline, disks. Automated cloud backups that can be decrypted at rest are no longer “something only you have”.

Re:How does Google Authenticator work? by filoleg on Friday August 27, 2021 @05:21PM (#28333085)
It isn’t “the same cloud” that you were talking about, it is iCloud.
Re:How does Google Authenticator work? by tialaramex on Friday August 27, 2021 @03:43PM (#28332182)
Microsoft's stuff all wants you to install the Microsoft Authenticator which needs a Microsoft account for some reason and that (for me anyway) then immediately wanted me to setup 2FA, for which it required me to install the Microsoft Authenticator, which ... you can see how that goes.

As I began to experience Déjà vu on the first day of a new job I snapped out of it, removed the Microsoft Authenticator and told it nah, I'm OK actually, show me that QR code for "other authenticators" and never looked back.

Re:How does Google Authenticator work? by jaywalk on Friday August 27, 2021 @04:12PM (#28332473)
Microsoft Authenticator is more than just TOTP, which is why it wants a Microsoft account. It also supports push approvals.
Re:How does Google Authenticator work? by greggman3 on Saturday August 28, 2021 @02:26PM (#28340305)
I'm a little surprised Google hasn't don't this but I guess they have give gmail. Sign into google and it will ask me to approve on my gmail app.

Not entirely sure I like these "authenticate on from another device". Just yesterday I mis-placed my phone. I wanted to sign into iCloud.com for use "find my phone" feature from my PC. It required me to use apple's authentication via a code sent to the phone, the exact thing I was looking for! :(

Re:How does Google Authenticator work? by loloquwowndueo on Friday August 27, 2021 @02:50PM (#28331601)
Back in the day it was the best-known and most reliably available cross-platform (iOS, android) code generator - so many sites just assume it as a de facto standard. It also reduces support burden to tell people this is the officially supported code generator, that way you don’t need to struggle understanding why a random app might be having trouble with codes.

These days it’s much less of an issue as there are many more clients - the IdP I manage now mentions authy, tofu and 1password as also supported.

Re:How does Google Authenticator work? by tinus_hn on Friday August 27, 2021 @02:57PM (#28331679)
Also Google Authenticator does not allow you to include your codes in your backup, even when it’s encrypted. So due to Google Authenticator, losing your 2fa codes is an expected problem and many companies allow you to reset it by simply calling them.

It sounds really secure but it really is not.

Re:How does Google Authenticator work? by nanidin on Saturday August 28, 2021 @02:29AM (#28336066)
Google Authenticator has a feature to allow export of all saved codes into one QR code for re-import into Google Authenticator running on another device. I printed a copy of my export QR code for use in case my device is lost or stolen.
Re:How does Google Authenticator work? by greggman3 on Saturday August 28, 2021 @02:24PM (#28340289)
Thanks! I hadn't seen that feature. Just checked it out. It shows multiple QR codes (in my case 2 QR codes which contain 11 TOTPs total) that you can scan from another device running Google Authenticator to transfer to codes. I guess I can screenshot those QR goes to back up (scary)
Re:How does Google Authenticator work? by unclebucknasty on Friday August 27, 2021 @05:00PM (#28332920)
It's about the perception of security and reducing friction. Everyone knows Google, so you don't have to convince users of the trustworthiness of a lesser-known brand or open source project within the sensitive context of increasing security.
Re:How does Google Authenticator work? by fraa-orolo on Friday August 27, 2021 @06:48PM (#28333792)
Have you seen users? I have to convince users not to install random crap.
Re:How does Google Authenticator work? by pilsetnieks on Friday August 27, 2021 @06:46PM (#28333780)
On the one hand, I agree but on the other, this is the one case where you cannot take any chance of having your user install some random dodgy app that promises the same functionality.
Re:How does Google Authenticator work? by akerl_ on Friday August 27, 2021 @02:16PM (#28331212)
The author seems to address this directly:

> But here we’re focusing on apps like Google Authenticator that use something called TOTP algorithm.

> What we want to achieve is understand how apps like Google Authenticator (or any other TOTP app) are solving that?

Re:How does Google Authenticator work? by jvanderbot on Friday August 27, 2021 @09:23PM (#28334733)
You can use oathtool if you'd like to "do it yourself". I usually just keep (encrypted with Pass) my secret keys for Authenticators, and execute a one line alias:

oathtool -b --totp `pass show <X>`

... for <X> in github, gmail, blizzard, whatever ...

This way, you can have a backup in case your phone gets lost, and easily port between phones.

Re:How does Google Authenticator work? by stevekemp on Saturday August 28, 2021 @01:55AM (#28335949)
If you're using pass already you could use their OTP plugin:

https://github.com/tadfisher/pass-otp

That gives you "pass otp github.com", etc. You can also export the QRcode, and do similar things.

I put together a simple distribution of pass with a couple of plugins I use, including otp, which is easy to setup - just clone beneath `/opt/pass`:

https://github.com/skx/pass

Re:How does Google Authenticator work? by jvanderbot on Saturday August 28, 2021 @11:40AM (#28338891)
Great tip thanks!
Re:How does Google Authenticator work? by jillesvangurp on Saturday August 28, 2021 @03:35AM (#28336307)
It's really easy to integrate into websites as well. I did so a few years ago. The TOTP algorithm is just a few lines of code. I adapted this implementation https://github.com/j256/two-factor-auth at the time. There are similar libraries available for lots of languages.

You need a library like that and a way to convert an otp:// url into a QR code, for which there are many libaries as well. The rest is just implementing a sane UX around this. Storing the user's TOTP secret server side is a bit tricky. I suspect a plain text field in a database is quite common for this; which of course would be disastrous if that database were ever stolen. Secret stores don't scale for this as they tend to be designed for just a handful of secrets. We ended up encrypting these totp secrets using a key from our secret store.

Re:How does Google Authenticator work? by willis936 on Friday August 27, 2021 @03:24PM (#28331961)
You can even convert TOTP from 2FA into 1.5ish FA by using a password manager that stores the TOTP secret and generates the TOTP key from it.
Re:How does Google Authenticator work? by Godel_unicode on Friday August 27, 2021 @04:57PM (#28332892)
An adversary still has to get the manager DB and the key to unlock it (your password manager DB is encrypted with a key, right?).
Re:How does Google Authenticator work? by willis936 on Friday August 27, 2021 @05:43PM (#28333283)
What's the point of using a key? That doesn't add a second factor of authentication. Something you have and something else you have is 1FA.

A password with more than 200 bits of entropy seems reasonable.

Re:How does Google Authenticator work? by maxerickson on Friday August 27, 2021 @05:46PM (#28333308)
They key doesn't particularly increase the security of the authentication, but it helps a bit if you lose control of the device the db is stored on.
Re:How does Google Authenticator work? by willis936 on Friday August 27, 2021 @07:02PM (#28333929)
Yeah but a key without a second factor (something you know) is still better than a key. Just make sure your password isn't brute forceable.
Re:How does Google Authenticator work? by Godel_unicode on Friday August 27, 2021 @07:13PM (#28334016)
Firstly, while that's technically correct according to the CISSP, it's obviously not actually correct. Two different things I have can absolutely be two factors as long as they are not susceptible to the same method of compromise. 1+1=2.

Secondly, many password vaults refer to the master password you use to unlock it as the key.

Thirdly, many security keys require a pin or similar to be used.

Re:How does Google Authenticator work? by judge2020 on Friday August 27, 2021 @06:53PM (#28333849)
Unfortunately, Stripe does this currently: https://i.judge.sh/youthful/Derpy/chrome_TIDNqlcRvI.png
Re:How does Google Authenticator work? by werid on Saturday August 28, 2021 @02:26AM (#28336053)
at one point i used a python script to provide a totp response to google when using youtube-dl (before logging in became broken and had to switch to cookies)

    import onetimepass as otp
    my_secret = ''  
    my_token = otp.get_totp(my_secret)  
    print my_token