It's a security feature that could have stopped hackers at the gate before they seized control of the, and it's something you should be using to protect your own online accounts, wherever it's available. So how does two-factor authentication work? In a nutshell, it requires not one but two pieces of privileged information before granting access to an online account. Let's say you've already set up two-factor authentication for your Google account, and now a hacker halfway around the world is trying to break into your Gmail.