Bitcoin Forum

Other => Beginners & Help => Topic started by: nii236 on May 10, 2013, 02:33:24 PM



Title: How to backup Google Authenticator?
Post by: nii236 on May 10, 2013, 02:33:24 PM
Hello everyone,

I am trying to improve my online security by using 2 factor authentication through Google Authentication. I've set it up for MtGox and BTCT but I am concerned about what will happen if I lose my phone or it gets stolen. I will lose access to absolutely everything! Or I install  a ROM on top of the phone and lose all my data because I forget to backup.

What is a commonly accepted way of backing up one's Google Authenticator database? Ideally it would be a single file that I can load back into Google Authenticator or something that will be stored offline somewhere (putting it in cloud storage might not make sense in this case).

Thanks in advance.


Title: Re: How to backup Google Authenticator?
Post by: Endgame on May 10, 2013, 02:37:08 PM
Just create some backup codes and store them in a safe place, then if you lose your phone you can simply log in with backup code and turn off 2 factor. See here for instructions: http://support.google.com/accounts/bin/answer.py?hl=en&answer=1187538


Title: Re: How to backup Google Authenticator?
Post by: nii236 on May 10, 2013, 04:03:24 PM
Yes, but that is only for Google accounts. What about MtGox and BTCT and others?


Title: Re: How to backup Google Authenticator?
Post by: Jasmin68k on May 10, 2013, 04:18:53 PM
Whenever you register for 2FA you get something called "secret key" or "shared secret" etc.

That is what you need to take a backup of.

Without your phone this secret key can be put into a variety of different apps/scripts etc. to generate the OTP just like your phone would have done it.

One example of such a simple authenticator would be this one: https://github.com/mclamp/JAuth



Title: Re: How to backup Google Authenticator?
Post by: nii236 on May 10, 2013, 04:29:15 PM
Thanks. So the QR code that I scan is the backup itself? Good to know. However you can't copy the MtGox one for some reason. I'll have to take a screenshot or something.


Title: Re: How to backup Google Authenticator?
Post by: Jasmin68k on May 10, 2013, 04:41:31 PM
TBH I don't know what different websites put into their QR codes, probably depends on the website.

With MtGox what you need to make a backup of (copy/paste, screenshot etc.) is called "Secure Private Key".

If you use the authenticator I used as an example above, you can then generate the OTP with "java -jar JAuth.jar -secret=YOURSECUREPRIVATEKEY".

For other websites and/or authenticator apps it's basically the same procedure. So in essence you don't need a phone at all, if you don't want to use one.


Title: Re: How to backup Google Authenticator?
Post by: DeathAndTaxes on May 10, 2013, 04:44:34 PM
The QR code contains the shared secret (which is what synchronizes the codes on your smartphone and the site's backend server.  Same shared secret + same time means both you and site generate the same code in sync.   The shared secret is simply a number.  The QR code also contains some less important information like "display name".

So if you have a backup of the QR code you use it to "setup" another smartphone

1) When you setup 2FA before you scan the QR code print it out.  
2) Instead of scanning the QR code on screen scan the printout (this verifies the printout was correct, no printing errors rending it unreadable).  
3) Complete the 2FA setup.
4) Now just label the printout.
5) Store the all your labeled google authenticator QR codes in a safe place (like fireproof safe or safety deposit box).


Title: Re: How to backup Google Authenticator?
Post by: trigeek on May 10, 2013, 05:00:27 PM
Hello everyone,

I am trying to improve my online security by using 2 factor authentication through Google Authentication. I've set it up for MtGox and BTCT but I am concerned about what will happen if I lose my phone or it gets stolen. I will lose access to absolutely everything! Or I install  a ROM on top of the phone and lose all my data because I forget to backup.

What is a commonly accepted way of backing up one's Google Authenticator database? Ideally it would be a single file that I can load back into Google Authenticator or something that will be stored offline somewhere (putting it in cloud storage might not make sense in this case).

Thanks in advance.

You can use titanium backup free to back up the data for the google authenticator android app to your sd card.  be careful with the backup though- it's best to store it somewhere else password protected vs. on your phone.


Title: Re: How to backup Google Authenticator?
Post by: Lohoris on May 10, 2013, 05:18:21 PM
You can use titanium backup free to back up the data for the google authenticator android app to your sd card.  be careful with the backup though- it's best to store it somewhere else password protected vs. on your phone.
Will only work if his phone is rooted.


Title: Re: How to backup Google Authenticator?
Post by: pekv2 on May 10, 2013, 08:08:41 PM
You can also not only backup the code, but as well as run google authenticator on your windows pc.

http://code.google.com/p/gauth4win/downloads/list


Title: Re: How to backup Google Authenticator?
Post by: glon on August 21, 2013, 11:31:57 PM
The QR code contains the shared secret (which is what synchronizes the codes on your smartphone and the site's backend server.  Same shared secret + same time means both you and site generate the same code in sync.   The shared secret is simply a number.  The QR code also contains some less important information like "display name".

So if you have a backup of the QR code you use it to "setup" another smartphone

1) When you setup 2FA before you scan the QR code print it out.  
2) Instead of scanning the QR code on screen scan the printout (this verifies the printout was correct, no printing errors rending it unreadable).  

3) Complete the 2FA setup.
4) Now just label the printout.
5) Store the all your labeled google authenticator QR codes in a safe place (like fireproof safe or safety deposit box).

Hi, what if I've already completed point 3 before even thinking about doing 1/2? Thanks!


Title: Re: How to backup Google Authenticator?
Post by: DeathAndTaxes on August 21, 2013, 11:43:57 PM
@glon Well depending on the site you may have options.
If the site still shows the authenticator code you can print it after the fact.
If the site allows you to change the authenticator code you could change it and in doing so completing the steps above.
If the site allows you to disable the authenticator code then do so and then enable it completing steps above.
If the sties doesn't allow you to change, disable, or show you the authenticator code you probably will need to request the admin remove authenticator from your account.



Title: Re: How to backup Google Authenticator?
Post by: 01BTC10 on August 21, 2013, 11:51:03 PM
You can also not only backup the code, but as well as run google authenticator on your windows pc.

http://code.google.com/p/gauth4win/downloads/list
Won't this defeat the purpose to have 2FA in the first place?


Title: Re: How to backup Google Authenticator?
Post by: DeathAndTaxes on August 21, 2013, 11:52:15 PM
You can also not only backup the code, but as well as run google authenticator on your windows pc.

http://code.google.com/p/gauth4win/downloads/list
Won't this defeat the purpose to have 2FA in the first place?

Yes unless what he means is a dedicated offline machine used for nothing but generating the authentication codes.


Title: Re: How to backup Google Authenticator?
Post by: jago25_98 on September 04, 2013, 05:12:56 AM
You often aren't given the secret key to copy and paste so a common way is to screenshot that qrcode or take a photo. The thing is, you have to remember to do this on logon and you're punching an unencrypted backup through the system.

The whole thing is a disaster waiting to happen. It got me when my phone got stolen and it's caught many others out too. There should be an encrypted backup solution for Google Authenticator. It's just because it's intended for use with Google and usually gmail - there you have all the backup options - paper codes, phone, SMS.

Using Google Authenticator for third party things is fine but really I think gox and all these sites should tell people they should backup and print or backup and encrypt the qrcode.


Title: Re: How to backup Google Authenticator?
Post by: gambitv on September 04, 2013, 03:39:40 PM
Thank you for this valuable post. I have just reset all my authenticator settings and now have a nice stack of printouts to put away in a safe.


Title: Re: How to backup Google Authenticator?
Post by: capoeira on September 04, 2013, 04:51:33 PM
You can also not only backup the code, but as well as run google authenticator on your windows pc.

http://code.google.com/p/gauth4win/downloads/list
Won't this defeat the purpose to have 2FA in the first place?

Yes unless what he means is a dedicated offline machine used for nothing but generating the authentication codes.


why is that? if you get hacked you are lost anyways (shouldn't run Windows at all).
2FA is to protect you against password hacks


Title: Re: How to backup Google Authenticator?
Post by: glon on September 04, 2013, 10:58:22 PM
You often aren't given the secret key to copy and paste so a common way is to screenshot that qrcode or take a photo. The thing is, you have to remember to do this on logon and you're punching an unencrypted backup through the system.

The whole thing is a disaster waiting to happen. It got me when my phone got stolen and it's caught many others out too. There should be an encrypted backup solution for Google Authenticator. It's just because it's intended for use with Google and usually gmail - there you have all the backup options - paper codes, phone, SMS.

Using Google Authenticator for third party things is fine but really I think gox and all these sites should tell people they should backup and print or backup and encrypt the qrcode.

And wouldn't you know it Google has just updated their Authenticator iphone app and all my tokens are gone after the update. WTF????????????????????????????

Anyone else?


Title: Re: How to backup Google Authenticator?
Post by: capoeira on September 04, 2013, 11:22:34 PM
You often aren't given the secret key to copy and paste so a common way is to screenshot that qrcode or take a photo. The thing is, you have to remember to do this on logon and you're punching an unencrypted backup through the system.

The whole thing is a disaster waiting to happen. It got me when my phone got stolen and it's caught many others out too. There should be an encrypted backup solution for Google Authenticator. It's just because it's intended for use with Google and usually gmail - there you have all the backup options - paper codes, phone, SMS.

Using Google Authenticator for third party things is fine but really I think gox and all these sites should tell people they should backup and print or backup and encrypt the qrcode.

And wouldn't you know it Google has just updated their Authenticator iphone app and all my tokens are gone after the update. WTF????????????????????????????

Anyone else?


only afected I-Phone...there is a topic here (with recover manual) search it


Title: Re: How to backup Google Authenticator?
Post by: glon on September 04, 2013, 11:24:56 PM
You often aren't given the secret key to copy and paste so a common way is to screenshot that qrcode or take a photo. The thing is, you have to remember to do this on logon and you're punching an unencrypted backup through the system.

The whole thing is a disaster waiting to happen. It got me when my phone got stolen and it's caught many others out too. There should be an encrypted backup solution for Google Authenticator. It's just because it's intended for use with Google and usually gmail - there you have all the backup options - paper codes, phone, SMS.

Using Google Authenticator for third party things is fine but really I think gox and all these sites should tell people they should backup and print or backup and encrypt the qrcode.

And wouldn't you know it Google has just updated their Authenticator iphone app and all my tokens are gone after the update. WTF????????????????????????????

Anyone else?


only afected I-Phone...there is a topic here (with recover manual) search it

Yes I said it's an iphone app issue. Care to make yourself useful and post a link to the topic "with recover manual"?


Title: Re: How to backup Google Authenticator?
Post by: Rampion on September 04, 2013, 11:25:40 PM
Print the QR code and store it in a safe place. Before activating 2-fa check that the QR you printed can be scanned by GA.


Title: Re: How to backup Google Authenticator?
Post by: capoeira on September 05, 2013, 02:09:38 AM
You often aren't given the secret key to copy and paste so a common way is to screenshot that qrcode or take a photo. The thing is, you have to remember to do this on logon and you're punching an unencrypted backup through the system.

The whole thing is a disaster waiting to happen. It got me when my phone got stolen and it's caught many others out too. There should be an encrypted backup solution for Google Authenticator. It's just because it's intended for use with Google and usually gmail - there you have all the backup options - paper codes, phone, SMS.

Using Google Authenticator for third party things is fine but really I think gox and all these sites should tell people they should backup and print or backup and encrypt the qrcode.

And wouldn't you know it Google has just updated their Authenticator iphone app and all my tokens are gone after the update. WTF????????????????????????????

Anyone else?


only afected I-Phone...there is a topic here (with recover manual) search it

Yes I said it's an iphone app issue. Care to make yourself useful and post a link to the topic "with recover manual"?


google is your friend:

https://bitcointalk.org/index.php?topic=287459.msg3077955#msg3077955


Title: Re: How to backup Google Authenticator?
Post by: glon on September 05, 2013, 06:22:47 AM
You often aren't given the secret key to copy and paste so a common way is to screenshot that qrcode or take a photo. The thing is, you have to remember to do this on logon and you're punching an unencrypted backup through the system.

The whole thing is a disaster waiting to happen. It got me when my phone got stolen and it's caught many others out too. There should be an encrypted backup solution for Google Authenticator. It's just because it's intended for use with Google and usually gmail - there you have all the backup options - paper codes, phone, SMS.

Using Google Authenticator for third party things is fine but really I think gox and all these sites should tell people they should backup and print or backup and encrypt the qrcode.

And wouldn't you know it Google has just updated their Authenticator iphone app and all my tokens are gone after the update. WTF????????????????????????????

Anyone else?


only afected I-Phone...there is a topic here (with recover manual) search it

Yes I said it's an iphone app issue. Care to make yourself useful and post a link to the topic "with recover manual"?


google is your friend:


No they're not. :D


Title: Re: How to backup Google Authenticator?
Post by: b!z on September 05, 2013, 11:25:52 AM
Titanium Backup on Android, OpenBackup (or other) on iOS.


Title: Re: How to backup Google Authenticator?
Post by: Lohoris on October 12, 2013, 12:15:34 PM
Titanium Backup on Android
only if you're rooted


Title: Re: How to backup Google Authenticator?
Post by: wacked on January 12, 2014, 11:59:31 PM
Use this program https://code.google.com/p/winauth/ Then make sure after you add all your secrets to it, then back up the winauth.xml file which houses our your secrets from %appdata%\winauth
Also has password/encrypted option and allows you to tie to the PC in question if so desired.

As others have said backup the secrets or QR code and you can also use another phone or tablet to house your info in Google Authenticator or Authy < which you can set to backup your data. Authy also allows you to set a pin # for the program, GA doesn't but you can download a 3rd party app to do the same.


Title: Re: How to backup Google Authenticator?
Post by: Samoshi on January 23, 2014, 07:44:01 AM
Print the QR code and store it in a safe place. Before activating 2-fa check that the QR you printed can be scanned by GA.

This is the best simple solution to keep a backup. You can also take a photo and store your photos on Evernote or similar cloud service.


Title: Re: How to backup Google Authenticator?
Post by: Rampion on January 23, 2014, 01:53:23 PM
Print the QR code and store it in a safe place. Before activating 2-fa check that the QR you printed can be scanned by GA.

This is the best simple solution to keep a backup. You can also take a photo and store your photos on Evernote or similar cloud service.

I wouldn't recommend Evernote or a similar cloud service - you would be trusting your very valuable backup to the servers of a third party (in this case Evernote), and thus you have to assume that at some point somebody could hack their servers and access the information you stored on them.

If storing the backup on the cloud is a "must", then I would definitely recommend to use strong encryption to protect the backup before uploading it. The attack vector that lead to one of the biggest thefts in BTC's history (allinvain's 25k BTC theft (https://bitcointalk.org/index.php?topic=16457.0)) was very probably an unencrypted wallet.dat stored on dropbox.


Title: Re: How to backup Google Authenticator?
Post by: lateman on April 22, 2014, 06:17:30 AM
Hey Folks,

i was in the following situation. Had mt.gox changed to 2f authentication and didn't backed up my secret. Now i got me a new phone and have moved all the other stuff with no problem. My old phone is a nexus 4 which is rooted and my new phone is a samsung galaxy s5. I don't want to root my s5 atm so titanium is a no go. Helium backup does no backup for google authenticator. mt.gox is not usable atm moment and might not be in the next time. So here is what i did:

  • adb shell to my nexus with a terminal
  • enter "su"
  • allow root from phone
  • "cd /data/user/0/com.google.android.apps.authenticator2/databases"
  • "sqlite3 databases"
  • "select * from accounts;"

And there it was. There should be a line like this:
1|MtGox-USER-TOTP#553617|BLAHBLAHBLAH|0|0|0||MtGox-USER-TOTP#553617

On the new phone just enter "BLAHBLAHBLAH" in the GA App instead of scanning a QR code. Done!

I hope this will help someone

Greetings, lateman.


Title: Re: How to backup Google Authenticator?
Post by: sana8410 on April 22, 2014, 07:08:50 PM
Google authenticator isn't tied to your google account... it's an open API that anyone can use (which is why the PAM module even exists)


Title: Re: How to backup Google Authenticator?
Post by: Abel jonh on April 24, 2014, 03:08:50 AM
Thanks! I lost my iPhone someday ago, now I can continue my work. thanks ;)


Title: Re: How to backup Google Authenticator?
Post by: wakhidNkcom on June 21, 2014, 10:43:32 PM
Use this program https://code.google.com/p/winauth/ Then make sure after you add all your secrets to it, then back up the winauth.xml file which houses our your secrets from %appdata%\winauth
Also has password/encrypted option and allows you to tie to the PC in question if so desired.

this one is very helpful for me,, thanks you  ;)


Title: Re: How to backup Google Authenticator?
Post by: vaisajne on July 31, 2014, 10:40:11 AM
Hey Folks,

i was in the following situation. Had mt.gox changed to 2f authentication and didn't backed up my secret. Now i got me a new phone and have moved all the other stuff with no problem. My old phone is a nexus 4 which is rooted and my new phone is a samsung galaxy s5. I don't want to root my s5 atm so titanium is a no go. Helium backup does no backup for google authenticator. mt.gox is not usable atm moment and might not be in the next time. So here is what i did:

  • adb shell to my nexus with a terminal
  • enter "su"
  • allow root from phone
  • "cd /data/user/0/com.google.android.apps.authenticator2/databases"
  • "sqlite3 databases"
  • "select * from accounts;"

And there it was. There should be a line like this:
1|MtGox-USER-TOTP#553617|BLAHBLAHBLAH|0|0|0||MtGox-USER-TOTP#553617

On the new phone just enter "BLAHBLAHBLAH" in the GA App instead of scanning a QR code. Done!

I hope this will help someone

Greetings, lateman.

This is a very useful information. Thanks for sharing.