Table of Contents
What Is a YubiKey?
A YubiKey is a hardware security key manufactured by Yubico that provides the strongest available form of two-factor and passwordless authentication. Unlike SMS codes or authenticator apps, a YubiKey is a physical device that must be present during the login process. This makes it immune to phishing, SIM swapping, and remote credential theft because the key must be physically touched or tapped to authenticate.
Hardware security keys are recommended by security experts, government agencies, and major technology companies as the gold standard for account protection. Google reported that after deploying security keys to all employees, the company experienced zero successful phishing attacks against staff accounts.
Choosing the Right YubiKey Model
Yubico offers several models designed for different use cases and device types. The YubiKey 5 NFC is the most versatile option, supporting USB-A connections for computers and NFC for mobile devices. The YubiKey 5C NFC uses USB-C, making it compatible with modern laptops and Android phones. The YubiKey 5Ci includes both USB-C and Lightning connectors for Apple device users.
For budget-conscious users, the Security Key series offers FIDO2 and U2F support at a lower price point but lacks some advanced features like OpenPGP and smart card functionality. If you only need to protect online accounts and do not require advanced cryptographic features, the Security Key series is an excellent choice.
When purchasing a YubiKey, always buy directly from Yubico or an authorized reseller. Purchasing from third-party sellers on marketplaces risks receiving a tampered device that could compromise your security rather than enhance it.
Understanding FIDO2 vs OTP Modes
FIDO2 and WebAuthn
FIDO2 is the modern standard for passwordless and phishing-resistant authentication. When you register a FIDO2 key with a website, the key generates a unique cryptographic key pair. The private key never leaves the YubiKey, and the public key is stored on the server. During authentication, the website sends a challenge that only the correct private key can answer. Crucially, the response is bound to the website's domain, making it impossible for phishing sites to intercept and reuse the authentication.
One-Time Passwords (OTP)
The YubiKey also supports one-time password generation. When you touch the key's button, it emits a unique one-time password that the server validates. Yubico OTP mode works with services that support Yubico's cloud validation service. The key can also generate OATH-TOTP codes compatible with Google Authenticator-style systems, though this requires the Yubico Authenticator app.
For maximum security, prefer FIDO2 authentication whenever a service supports it. FIDO2 provides cryptographic proof that you are authenticating to the legitimate website, a protection that OTP cannot provide.
Setting Up Your YubiKey with Major Services
Google Account
Navigate to your Google Account security settings at myaccount.google.com. Select "2-Step Verification" and then "Security Key." Insert your YubiKey and tap it when prompted. Google will register the key for future logins. You can register multiple keys for backup purposes.
Microsoft Account
Go to account.microsoft.com, navigate to Security, then Advanced Security Options. Select "Add a new way to sign in" and choose "Use a security key." Follow the prompts to register your YubiKey. Microsoft supports both USB and NFC security keys for Windows Hello and online account access.
GitHub
In GitHub settings, go to Password and Authentication, then under Two-factor authentication, click "Security keys." Register your YubiKey by following the on-screen instructions. GitHub fully supports FIDO2, making your developer account highly resistant to phishing.
Password Managers
Services like Bitwarden and 1Password support YubiKey authentication. Adding a hardware key to your password manager provides the strongest protection for your entire credential vault. Since your password manager holds the keys to all your accounts, securing it with a YubiKey is a high-impact step.
Backup Key Strategy
A critical consideration when adopting hardware security keys is backup access. If you lose your only YubiKey, you could be locked out of your accounts. The recommended approach is to purchase at least two YubiKeys and register both with every service you use.
Store your backup key in a secure location separate from your primary key, such as a home safe or a bank safety deposit box. When you register a new account, always register both keys at the same time so your backup is ready if needed.
In addition to a backup key, most services allow you to save recovery codes during setup. Generate these codes and store them securely, ideally printed on paper in a physically secure location rather than saved digitally. Make sure each recovery code is paired with a strong password — use our password generator to create unique credentials for every account.
Advanced Features
Beyond web authentication, YubiKeys support OpenPGP for email encryption and code signing, PIV smart card functionality for enterprise environments, and SSH key storage. Developers can use YubiKeys to sign Git commits, authenticate to remote servers, and encrypt sensitive communications. You can also use a YubiKey in combination with our text encryption tool for an additional layer of protection when handling sensitive information.
The YubiKey can also store static passwords, which is useful for entering complex credentials on systems that do not support FIDO2. However, static passwords do not provide the phishing resistance of FIDO2 and should be considered a convenience feature rather than a security feature.
Conclusion
Setting up a YubiKey is one of the most impactful security improvements you can make for your online accounts. The initial investment of purchasing two keys and spending time to register them pays off with virtually impenetrable phishing protection. Start by securing your most critical accounts — email, password manager, and financial services — then expand to other services as time permits. Combined with strong unique passwords and security awareness, a YubiKey makes your digital life significantly safer.
Share this article

Raimundo Coelho
Cybersecurity specialist and technology professor with over 20 years of experience in IT. Graduated from Universidade Estácio de Sá. Writing practical guides to help you protect your data and stay safe in the digital world.