27

I’ve recently started using 2FA on a bunch of services and I’m not sure how to best store the recovery codes. I can think of 3 options:

  • In a secure note on LastPass
  • In a Dropbox folder
  • On a usb stick

All of them seem to have their respective pitfalls though:

In the case of lastpass: My passwords are all random strings about 20 - 30 characters long (based on the services password policies). So I doubt anyone’s going to be able to guess or brute force a password to one of my accounts. Therefore the most likely way I’ll have a compromised account is if someone compromises lastpass - in which case 2FA would be pointless if the security codes were also stored there.

In the case of Dropbox: The most likely reason I’ll need the security codes is if I lose my phone - but then I wont be able to access Dropbox anyways because I have 2FA enabled there too so those recovery codes will all essentially be lost.

In the case of a USB stick: This seems like the equilavent of writing passwords on post it notes - easy to lose/forget or may just not work 10 years down the line when its needed.

Out of the 3 the usb stick seems like the best option but I was wondering if anyone has come up with a better way of storing recovery codes? Also if physical storage is the way to go is there a preferable medium for this? Perhaps some sort of storage that is durable over a long period of time and likely to stay relevant into the future?

4
  • Many 2FA backup code implementations would email you when a backup recovery code is used. So storing the 2FA codes in your password manager may not necessarily be entirely pointless.
    – Lie Ryan
    Oct 1, 2017 at 15:40
  • Really? Does google 2FA does that?
    – user4234
    Sep 30, 2018 at 22:16
  • On physical storage — One option is to open a safe deposit box at your bank. This seems like a pretty good place to keep a spare YubiKey and/or recovery codes. Aug 26, 2020 at 2:15
  • 1
    "Therefore the most likely way I’ll have a compromised account is if someone compromises lastpass". I don't think that's entirely true. The most likely way is probably if you visit i-swear-this-is-youtube.com and type in your password, or you have to type in your password on another computer which is compromised, or a stranger on the bus watches you type it in etc. You may say "I'm too smart/careful for any of those" (like I often do) but we all make mistakes.
    – KNejad
    Oct 1, 2020 at 20:24

6 Answers 6

14

First of all, let's clarify that 2FA recovery codes are used to bypass 2FA itself.

2FA's main purpose is to make sure that you provide a secret from two different "channels", for example, something you know or something you have. The password is something you know and the recovery codes, if kept in memory (your brain or your computer's hard disk) is also something you know. Without going into too much discussion about the security of these recovery codes, it seems obvious to me that the "something you have" factor works better when completely outside the virtual world. That is, keeping the codes in a piece of paper, or small pieces of paper for each code, may be the best option IMHO. Clearly encrypting it and storing it in the cloud or in a separate computer/device/usb may work, but eventually you need to decrypt and access these codes in plain text. In an emergency it may not be ideal or if your systems/network have been compromised, the unencrypted codes might be accessible to an attacker. Therefore, I believe that if you print the code and keep in your wallet for example you maintain the secure properties of 2FA. One may need to reconsider it if travelling by plane as the officials might be able to force you to provide your password and confiscate your wallet. So just a note to be aware of :)

2
  • Just to be totally clear, are recovery codes only able to access the account when the password is also provided? Or are recovery codes alone like passwords themselves (and therefore should be treated with the same extreme care of a password?).
    – stevec
    Jan 13, 2022 at 0:48
  • 1
    @stevec one need to know the password too
    – szedjani
    Feb 17, 2022 at 10:47
6

Option 4: Print them in hardcopy (not digital) and keep them in a place you can keep them secure.

2
  • Still have to make sure the printer isn't logging what it printed though, or if it is figure out how to clear it. Unless by "print" you mean "write down" in which case I heartily agree, so long as you won't need them on short notice. Oct 3, 2017 at 13:46
  • You “clear a printer” by sending it a file containing 20 pages of whitespaces. I hear postscript is making a comeback.
    – user2497
    Oct 3, 2017 at 17:12
1

I keep mine in an encrypted document stored on iCloud. The iCloud account has two-factor authentication enabled, but I have four devices registered to it, and I think the chances of me losing my laptop, desktop, phone and tablet simultaneously are pretty low. Naturally, I have the encryption password and the iCloud password committed to memory.

2
  • 1
    Your house could get robbed and they take all of those together. Granted you probably have your phone on you when you leave the house (unless you're out for a run or at the beach), and next to you when you are in bed. But still it's by no means an impossible scenario
    – KNejad
    Oct 1, 2020 at 20:11
  • 1
    You could lose all those items at once if your house catches fire.
    – Marlon
    Jan 12, 2021 at 19:04
0

I keep my passwords in a local storage password manager, with a backup on a different device, because as a rather old dinosaurus, I do not really trust the cloud for strong privacy. The same in my real life, I carry my home keys in my pocket, and do not leave them in a flower pot to just find them when I need them.

With that process, I keep the recovery codes in the password manager vault along with the credentials.

Risk analysis:

  • password vault compromission: the attacker must both steal my phone (or computer) and guess the master password - global security at a 2FA level
  • password vault is lost or destroyed: I have a backup (in fact 2) so I should be able to restore it - but I should change all my passwords including the master one and all recovery codes if that happened...
  • the (numeric) note is lost or no longer readable: I use the password manager on a regular basis on at least 2 different devices, so I should notice if one was down

IMHO, it can make sense to keep the recovery codes even in the same place as the credentials, because I had to use them after a problem when changing a password: the server registered a password that I mistyped, so nobody (not even I) knew it.

For your use case, the password vault is in the cloud. I would not store the recovery codes in the vault because the access is already 2FA protected through you phone. I would either configure a backup access from a second device, or revert to the good old paper in a physical safe.

0

So I've been thinking about this question recently and Bitwarden just added a feature that makes it simple to switch between accounts which makes it fairly convenient to have a primary and secondary bitwarden account one with all your main passwords that you use day to day in conjunction with a phone with the TOTP private keys to act as your 2nd factor and one with your TOTP recovery codes. Secure the bitwarden accounts with passwords only in your brain and several physical tokens with webauthn like yubikeys. Several so losing 1 or 2 does not mean losing access to all your codes and ideally with one or two of these in separate physical locations e.g. safety box / bottom of a trusted relative's sock drawer. Hopefully more stuff will move to FIDO2/webauthn so we can ditch the TOTP middle man here in the future.

0
  1. The entire purpose of these codes is so that if you lose your phone, you can regain access to your 2FA secured accounts. Therefore, I would not store it on your phone's memory.

  2. A secure note on LastPass is a good idea, assuming that LastPass encrypts the notes. However, if you lose access to your 2FA device, you've lost access to LastPass as well. You could keep the LastPass recovery code somewhere else, like on a USB drive or print it out. This way, you can regain access to LastPass, and eventually get back all of your recovery codes.

  3. There's a few things you need to consider when storing your 2FA codes in cloud storage. First, can you get into your cloud storage account without your 2FA device? Does your cloud storage allow for SMS based 2FA? This is significant because if you lost your phone, you can go to your cell provider and ask them to transfer your number onto a new SIM. You can regain access to your phone number, but you can't do the same with TOTP seeds. I understand sim swapping concerns. You could also add your parent or family member's email address as a recovery email for 2FA. Second, is your cloud storage provider end to end encrypted or trustworthy (like MEGA)? If not, you can always encrypt your files before putting them into cloud storage, but this adds a step to the process.

  4. The USB drive is the most reliable option. If this USB drive always stays in your home, there's no need to encrypt it (unless you're concerned about thieves). The USB drive is not connected to the internet, so no privacy concerns. And it's a physical artifact, so it's harder to lose. However, if you were traveling overseas, or your house burned down, you would probably lose access to your USB drives.

I keep my recovery codes in my cloud storage accounts and in on USB drives in my house. Here's why I don't encrypt my recovery codes before putting them into cloud storage: I need VeraCrypt on the computer on which I wish to decrypt my files. There's no guarantee that I can install VeraCrypt on any computer, except my own computer. The whole point of putting such files in the cloud is to access them on another computer, if I ever lost access to my computer (ex. house fire, robbery). I have multiple recovery options set up on my cloud storage accounts, including using my parent's email as a recovery address. This way, I can be confident that I won't lose access to my cloud storage.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .