Two factor authentication overview
Bit of kerfuffle this week around Reddit, which had a security breach despite having two factor authentication enabled. Some basic introductory notes for folks wondering what’s going on.
- Two-Factor authentication (or 2FA) is any login protocol that requires a second thing for logging in besides your password. Passwords are a terrible form of security, you should use 2FA for any account you care about. Definitely your email account and your bank. Also whatever is important in your job: your Amazon Web Services account, or your Twitter account, or whatever.
- SMS (text messages) are often used as the second factor in 2FA: the website text messages you a one-time code you type in to the login page. You give the website your cell phone number to set it up. But SMS is not secure; it’s far too easy to convince a mobile phone company to hijack a cell phone number. SMS is better than no 2FA, but if you have any other option at all don’t use SMS. Note many accounts have a backdoor SMS recovery option that you only use if you lost your password; these are also insecure and seem to be what tripped up Reddit. SMS 2FA is also vulnerable to phishing and MITM attacks.
- TOTP / HOTP, one-time passwords, are also a common 2FA option and are pretty good. App generates codes every minute / every login and you type them into the page. You set it up by scanning a QRCode when you set up the login, then run an app like Google Authenticator, Authy, or 1Password to generate a number that you type in to log in. It’s what I use in practice. Not positive how safe it is to use 1Password to store both passwords and this second factor in the same system, so mostly I don’t use that. These are still vulnerable to phishing and MITM attacks.
- U2F / Yubikey is the new hotness in 2FA. You have a physical device, a little USB key, and a special protocol that lets web sites authenticate through your browser to the key itself. The hardware is designed to be secure. Also the second factor that’s used is phishing resistant. Yubikeys are quite common in the tech industry but does require software support that’s not available everywhere.
- Push-based 2FA, where you have a custom app on your phone that pops up a confirmation dialog. You press a single button to approve the login and you’re done. It’s very convenient. I first saw this in the Blizzard Authenticator. Duo Push is a product you can use to implement push-based 2FA on your own sites. Apple’s iCloud 2FA also does a variety of push 2FA along with also requiring you type in a code. I don’t know how secure push-based is but I’m guessing pretty good, at least the obvious phishing attacks won’t work.
tl;dr: use 2FA on important accounts. Avoid SMS if you can.