Google Titan Security Key: A Beginner's Guide

What Google's Titan Security Key does, how it compares with YubiKey, how FIDO2 passkeys work, and how to read the key's details with Python.

Passwords, SMS codes, authenticator apps and push prompts all share one weakness: a convincing fake login page can capture them, or talk you into approving them. That's why phishing still works so well. FIDO2 security keys and passkeys close that gap, because the key checks which website it's talking to before it signs anything. In this post, we'll look at Google's Titan Security Key, how it compares with YubiKey, how FIDO2 registration works, and how to read a key's details with Python.

What is Google Titan?

Google Titan is Google's own hardware security key. The current version, released in November 2023, supports FIDO U2F and FIDO2 (CTAP1 and CTAP2), lets you set a PIN, and stores more than 250 passkeys. It comes in USB-A/NFC ($30) and USB-C/NFC ($35) versions on the Google Store, which sells it in the US, Canada, the UK, Japan and several European countries. A secure element chip with Google-built firmware lets the key check that it hasn't been tampered with. Titan works with Google, Google Cloud and many other services that support FIDO, and it's compatible with Google's Advanced Protection Program, its strongest account protection for people at risk of targeted attacks.

Google Titan Security Keys in USB-A and USB-C versions
Google Titan Security Keys in USB-A and USB-C versions

How is Google Titan Different from YubiKey?

YubiKey is a hardware security key from Yubico. Both keys support U2F, FIDO2 and passkeys, so for signing in to websites they do the same job. The YubiKey 5 Series supports more authentication protocols: one-time passwords (OTP), smart card (PIV) and OpenPGP support, which matter if you want to store certificates or PGP keys. It also comes in more form factors, including USB-A/NFC, USB-C/NFC and USB-C/Lightning, a nano size that stays in the port, and the Bio series with a fingerprint reader. The most popular are the USB-A/NFC, USB-C/NFC and USB-C/Lightning models. YubiKeys are IP68 rated and crush resistant. I cover setup in my YubiKey beginner's guide.

For SSH, both keys work with OpenSSH 8.2 or later through its FIDO key types. ecdsa-sk works with any FIDO security key, including Titan. Yubico documents support for ed25519-sk and for keys stored on the device (resident keys) on YubiKeys with firmware 5.2.3 or later. Google doesn't publish an equivalent list for Titan, so if you depend on those options, test them on your key first.

Set up Titan with Your Google Account

In your Google Account, open Security, then Passkeys and security keys, and choose to create a passkey on a security key. Insert or tap your Titan key when asked, and set a PIN if you don't have one yet. From then on, you can sign in with the key and its PIN instead of your password. Google may take up to 7 days before it lets a newly added key sign in on its own. This delay protects your account if someone else adds a key without your knowledge. Register a second key, or keep another sign-in method, so that losing one key doesn't lock you out.

Common Authentication Use Cases

Google Titan keys can be used for application or service authentication in a variety of scenarios where secure and strong authentication is required. For example:

  1. Two-factor authentication (2FA) for web applications.
  2. Authentication for remote server/application access (see this post).
  3. Authentication for cloud services like Google Cloud, AWS, and Azure.
  4. Passwordless authentication, to simplify the authentication process and reduce the risk of password-based attacks like phishing and credential stuffing.
  5. Signing Git commits and authenticating to Git hosts with an SSH key stored on the security key.

FIDO2 Registration Flow

Here is a high-level overview of the FIDO2 registration process:

  1. The user initiates the registration process on their device by selecting the option to register a new security key with a particular service.
  2. The service (i.e. the relying party) generates a registration request, which includes a unique challenge and some information about the user and service.
  3. The browser passes the request to the security key and checks that the site asking is the one you're actually on.
  4. The security key asks you to touch it (and enter its PIN if needed), creates a new key pair just for this site, and returns the public key, a credential ID and an attestation that proves what kind of key it is.
  5. The attestation object is sent back to the service, which verifies the attestation signature and stores the user's public key.
  6. The service then creates a new user account (if necessary) and associates the user's public key with the account.
  7. The user is informed that the registration process is complete, and they can now use their security key to authenticate to the service.

Discoverable vs Non-Discoverable Credentials

FIDO2 credentials come in two kinds. A discoverable credential (once called a resident key) is stored on the security key itself, together with the account it belongs to. A passkey on a hardware key is a discoverable credential: you can sign in without typing a username, because the key can tell the site which accounts it holds. That uses up storage on the key, which is why Titan's 250-passkey capacity matters.

A non-discoverable credential isn't stored on the key. Instead, the key wraps the credential into a credential ID, which the service keeps and sends back each time you sign in. There's no limit on how many you can have, but you have to say who you are first so the service knows which credential ID to send. Either way, only the key that created the credential can use it.

OpenSSH makes the same distinction. ssh-keygen -t ecdsa-sk -O resident stores the credential on the key, so you can load it onto a new machine with ssh-keygen -K. Without -O resident, the file in ~/.ssh is a key handle that points to the credential, not the private key itself.

Set up Your Code Development Environment

For this tutorial, we'll create Python code to interact with the Google Titan security key. Here are the things you need to have in place first:

  • Python 3.10 or later, which python-fido2 2.x requires.
  • The library itself: pip install fido2==2.2.1.
  • A Titan key, or any FIDO security key.

On Linux, reading the key needs udev rules that give your user access to it (or sudo). On Windows, scripts that talk to the key directly need to run as Administrator.

Once you have these components in place, we can use the FIDO2 library to check device information, register credentials, and authenticate to the device.

Read Your Security Key's Details

Connect the key and run this script. It prints the USB details, then asks the key what it supports through the CTAP2 getInfo command. A U2F-only key, such as a first-generation Titan, doesn't answer CTAP2 commands, so the script checks for that first.

from fido2.ctap2 import Ctap2
from fido2.hid import CAPABILITY, CtapHidDevice

# Find the first connected FIDO security key
dev = next(CtapHidDevice.list_devices(), None)
if dev is None:
    raise SystemExit("No FIDO security key found.")

print(f"Product: {dev.product_name}")
print(f"Device version: {'.'.join(map(str, dev.device_version))}")

# CTAP2 keys advertise the CBOR capability
if dev.capabilities & CAPABILITY.CBOR:
    info = Ctap2(dev).get_info()
    print(f"Protocol versions: {info.versions}")
    print(f"AAGUID: {info.aaguid}")
    print(f"Options: {info.options}")
    print(f"Algorithms: {[a['alg'] for a in info.algorithms]}")
    print(f"Free passkey slots: {info.remaining_disc_creds}")
else:
    print("This key only supports U2F (CTAP1).")

versions lists the FIDO versions the key speaks, such as FIDO_2_0 and U2F_V2. options shows features like rk (discoverable credentials) and clientPin (whether a PIN is set). The AAGUID identifies the key model, and remaining_disc_creds is how many more passkeys it can store, if the key reports it.

Generate, Register, and Authenticate Credentials

The python-fido2 repository has working examples for the next steps. credential.py registers a credential and then authenticates with it. resident_key.py does the same with a discoverable credential, and get_info.py is a fuller version of the script above. Other examples cover hmac-secret, PRF, large blobs and verifying attestation.

The library has two sides. Fido2Client plays the browser's role: it talks to the security key on behalf of a website, which is what those examples use. On Windows, WindowsClient (in fido2.client.windows) does the same through the Windows WebAuthn API. If you're building the website side, use Fido2Server to create registration and sign-in challenges and to verify the key's responses.

Frequently Asked Questions

Does the Google Titan Security Key support passkeys? Yes. The keys Google has sold since November 2023 support FIDO2 passkeys and can store more than 250 of them, protected by a PIN. The original Titan keys only support U2F, so they work as a second factor but can't hold passkeys.

Titan or YubiKey: which should I buy? For signing in to websites and Google accounts, either works. Titan is cheaper and stores more passkeys. A YubiKey 5 is the better choice if you also want OTP, smart card or OpenPGP support, or a Lightning, nano or fingerprint model.

What happens if I lose my security key? Register at least two keys on every important account and keep one somewhere safe. Also keep the account's other recovery options up to date, so a single lost key doesn't lock you out.

Can I use a Titan key for SSH? Yes, with OpenSSH 8.2 or later: generate an ecdsa-sk key with ssh-keygen -t ecdsa-sk. Check that your key supports ed25519-sk and resident keys before relying on them.

References

Subscribe to alphasec

Don’t miss out on the latest issues. Sign up now to get access to the library of members-only issues.
jamie@example.com
Subscribe